@arbidocs/blocks 0.5.23 → 0.5.25
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/{ConnectedNativeDocxComparison-GMQHSY3Z.js → ConnectedNativeDocxComparison-MZX222GC.js} +6 -6
- package/dist/{ConnectedNativeDocxComparison-GMQHSY3Z.js.map → ConnectedNativeDocxComparison-MZX222GC.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-HH3PHNXU.cjs → ConnectedNativeDocxComparison-WRO3J6VV.cjs} +7 -7
- package/dist/{ConnectedNativeDocxComparison-HH3PHNXU.cjs.map → ConnectedNativeDocxComparison-WRO3J6VV.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-4IAKVBEF.js → ConnectedNativeDocxEditor-OJ6SYZ3W.js} +5 -5
- package/dist/{ConnectedNativeDocxEditor-4IAKVBEF.js.map → ConnectedNativeDocxEditor-OJ6SYZ3W.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-JNHNZG3P.cjs → ConnectedNativeDocxEditor-XTUJWL25.cjs} +7 -7
- package/dist/{ConnectedNativeDocxEditor-JNHNZG3P.cjs.map → ConnectedNativeDocxEditor-XTUJWL25.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-CZZOH667.cjs → ConnectedStreamedWordArtifact-5JURNV4L.cjs} +7 -7
- package/dist/ConnectedStreamedWordArtifact-5JURNV4L.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-GLJCJPTP.js → ConnectedStreamedWordArtifact-KURJRZH3.js} +6 -6
- package/dist/{ConnectedStreamedWordArtifact-GLJCJPTP.js.map → ConnectedStreamedWordArtifact-KURJRZH3.js.map} +1 -1
- package/dist/{WorkspaceTableView-ECPHGWHF.js → WorkspaceTableView-2XI6FIOO.js} +7 -7
- package/dist/WorkspaceTableView-2XI6FIOO.js.map +1 -0
- package/dist/{WorkspaceTableView-6JVHGDUB.cjs → WorkspaceTableView-KG4D53SK.cjs} +13 -13
- package/dist/WorkspaceTableView-KG4D53SK.cjs.map +1 -0
- package/dist/agents/index.cjs +326 -326
- package/dist/agents/index.js +4 -4
- package/dist/{chunk-X4Y7ZHFB.js → chunk-2GDKBLD5.js} +11 -6
- package/dist/chunk-2GDKBLD5.js.map +1 -0
- package/dist/{chunk-DXO2RXVQ.cjs → chunk-3FQHFFV5.cjs} +4 -4
- package/dist/{chunk-DXO2RXVQ.cjs.map → chunk-3FQHFFV5.cjs.map} +1 -1
- package/dist/{chunk-AAVFCPKD.js → chunk-3OATYBZK.js} +4 -4
- package/dist/{chunk-AAVFCPKD.js.map → chunk-3OATYBZK.js.map} +1 -1
- package/dist/{chunk-AF24CV6J.js → chunk-4I2V55LL.js} +3 -3
- package/dist/{chunk-AF24CV6J.js.map → chunk-4I2V55LL.js.map} +1 -1
- package/dist/{chunk-VNHLFS6T.cjs → chunk-4KLBM5K5.cjs} +4 -4
- package/dist/{chunk-VNHLFS6T.cjs.map → chunk-4KLBM5K5.cjs.map} +1 -1
- package/dist/{chunk-7DDMF3DZ.cjs → chunk-53T2FY4Z.cjs} +5 -31
- package/dist/chunk-53T2FY4Z.cjs.map +1 -0
- package/dist/{chunk-BTF4AZMG.js → chunk-57CG33XJ.js} +5 -5
- package/dist/chunk-57CG33XJ.js.map +1 -0
- package/dist/chunk-5ZBXFHZW.js +434 -0
- package/dist/chunk-5ZBXFHZW.js.map +1 -0
- package/dist/{chunk-KJVDYWAM.cjs → chunk-6UKNYQ7Q.cjs} +13 -8
- package/dist/chunk-6UKNYQ7Q.cjs.map +1 -0
- package/dist/{chunk-TTJGCJWX.cjs → chunk-6UZ6YTML.cjs} +46 -6
- package/dist/chunk-6UZ6YTML.cjs.map +1 -0
- package/dist/{chunk-NVRJ6WTR.js → chunk-7RFDYAK7.js} +3 -3
- package/dist/{chunk-NVRJ6WTR.js.map → chunk-7RFDYAK7.js.map} +1 -1
- package/dist/{chunk-ZYGQFD5Y.js → chunk-BSDZXG55.js} +3 -3
- package/dist/{chunk-ZYGQFD5Y.js.map → chunk-BSDZXG55.js.map} +1 -1
- package/dist/{chunk-O4EQYPLO.cjs → chunk-C2SZQKX2.cjs} +169 -27
- package/dist/chunk-C2SZQKX2.cjs.map +1 -0
- package/dist/{chunk-I5RK4WAE.cjs → chunk-FGZQUH2Y.cjs} +3 -3
- package/dist/{chunk-I5RK4WAE.cjs.map → chunk-FGZQUH2Y.cjs.map} +1 -1
- package/dist/{chunk-7S76Q5RK.js → chunk-GA2A7OX6.js} +3 -3
- package/dist/{chunk-7S76Q5RK.js.map → chunk-GA2A7OX6.js.map} +1 -1
- package/dist/{chunk-XL55UDLO.js → chunk-IJJKUTKM.js} +5 -30
- package/dist/chunk-IJJKUTKM.js.map +1 -0
- package/dist/{chunk-BL74GYSA.cjs → chunk-JGCYM3II.cjs} +9 -9
- package/dist/{chunk-BL74GYSA.cjs.map → chunk-JGCYM3II.cjs.map} +1 -1
- package/dist/{chunk-ZX663X3X.cjs → chunk-KNRAKOCO.cjs} +6 -428
- package/dist/chunk-KNRAKOCO.cjs.map +1 -0
- package/dist/chunk-KUQOHPKP.cjs +443 -0
- package/dist/chunk-KUQOHPKP.cjs.map +1 -0
- package/dist/{chunk-JUUOJP7I.cjs → chunk-KWJW5TMH.cjs} +5 -5
- package/dist/chunk-KWJW5TMH.cjs.map +1 -0
- package/dist/{chunk-FZVAJFRH.cjs → chunk-LAGHW4JM.cjs} +24 -10
- package/dist/chunk-LAGHW4JM.cjs.map +1 -0
- package/dist/{chunk-6XW3CMU4.js → chunk-N3KNAQ55.js} +144 -4
- package/dist/chunk-N3KNAQ55.js.map +1 -0
- package/dist/{chunk-C6P2QW36.js → chunk-NZIVQ4Q4.js} +4 -4
- package/dist/{chunk-C6P2QW36.js.map → chunk-NZIVQ4Q4.js.map} +1 -1
- package/dist/{chunk-44FPFTU2.js → chunk-ORUV4MEP.js} +3 -3
- package/dist/{chunk-44FPFTU2.js.map → chunk-ORUV4MEP.js.map} +1 -1
- package/dist/{chunk-75Z5AUMM.js → chunk-QB6JCNVG.js} +3 -3
- package/dist/{chunk-75Z5AUMM.js.map → chunk-QB6JCNVG.js.map} +1 -1
- package/dist/{chunk-S4G3DNMA.cjs → chunk-QZTA2M4U.cjs} +9 -9
- package/dist/{chunk-S4G3DNMA.cjs.map → chunk-QZTA2M4U.cjs.map} +1 -1
- package/dist/{chunk-F2BYURQZ.cjs → chunk-T67EFI43.cjs} +5 -5
- package/dist/{chunk-F2BYURQZ.cjs.map → chunk-T67EFI43.cjs.map} +1 -1
- package/dist/{chunk-RVKVGS72.js → chunk-TDFL676I.js} +25 -11
- package/dist/chunk-TDFL676I.js.map +1 -0
- package/dist/{chunk-YD3RN2FY.cjs → chunk-U72QI2W3.cjs} +3 -3
- package/dist/{chunk-YD3RN2FY.cjs.map → chunk-U72QI2W3.cjs.map} +1 -1
- package/dist/{chunk-75UVQKQ5.cjs → chunk-WTGJHS7F.cjs} +48 -48
- package/dist/{chunk-75UVQKQ5.cjs.map → chunk-WTGJHS7F.cjs.map} +1 -1
- package/dist/{chunk-SLRVI2YU.js → chunk-X6U6L6BG.js} +29 -4
- package/dist/chunk-X6U6L6BG.js.map +1 -0
- package/dist/{chunk-SQ5F5BFW.cjs → chunk-XDU3HHUU.cjs} +32 -6
- package/dist/chunk-XDU3HHUU.cjs.map +1 -0
- package/dist/{chunk-SKVVOEMX.js → chunk-XXUPUXBF.js} +8 -423
- package/dist/chunk-XXUPUXBF.js.map +1 -0
- package/dist/{chunk-PZRTRYPD.js → chunk-ZKAIT3M2.js} +46 -7
- package/dist/chunk-ZKAIT3M2.js.map +1 -0
- package/dist/connect/docx.cjs +9 -9
- package/dist/connect/docx.js +5 -5
- package/dist/connect/index.cjs +1393 -891
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +739 -242
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +4 -4
- package/dist/connect/viewer.js +4 -4
- package/dist/connection/auth/CompactLogin.d.ts +26 -0
- package/dist/connection/auth/ConnectedLoginPage.d.ts +9 -1
- package/dist/connection/auth/index.d.ts +3 -1
- package/dist/connection/auth/sso-popup.d.ts +13 -0
- package/dist/connection/auth/sso-sign-in.d.ts +38 -0
- package/dist/connection/auth/useLoginActions.d.ts +4 -2
- package/dist/connection/projects/ConnectedProjectsPanel.d.ts +9 -1
- package/dist/connection/projects/ProjectsListPage.d.ts +41 -0
- package/dist/connection/projects/index.d.ts +1 -0
- package/dist/connection/settings-page/appearanceSection.d.ts +30 -0
- package/dist/connection/settings-page/index.d.ts +1 -0
- package/dist/facts/index.cjs +55 -55
- package/dist/facts/index.js +3 -3
- package/dist/index.cjs +498 -526
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +15 -54
- package/dist/index.js.map +1 -1
- package/dist/settings/AppearanceSettings.d.ts +1 -2
- package/dist/settings/index.cjs +162 -162
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +2 -2
- package/dist/site/index.cjs +82 -74
- package/dist/site/index.d.ts +2 -0
- package/dist/site/index.js +3 -3
- package/dist/studio/index.cjs +73 -73
- package/dist/studio/index.js +5 -5
- package/dist/theme/appearance.d.ts +47 -0
- package/dist/theme/fromCss.d.ts +33 -0
- package/dist/workflow-canvas/index.cjs +20 -18
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +8 -6
- package/dist/workflow-canvas/index.js.map +1 -1
- package/dist/workspaces/index.cjs +43 -43
- package/dist/workspaces/index.js +3 -3
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-CZZOH667.cjs.map +0 -1
- package/dist/WorkspaceTableView-6JVHGDUB.cjs.map +0 -1
- package/dist/WorkspaceTableView-ECPHGWHF.js.map +0 -1
- package/dist/chunk-6XW3CMU4.js.map +0 -1
- package/dist/chunk-7DDMF3DZ.cjs.map +0 -1
- package/dist/chunk-AMTWY22T.js +0 -11
- package/dist/chunk-AMTWY22T.js.map +0 -1
- package/dist/chunk-BTF4AZMG.js.map +0 -1
- package/dist/chunk-FZVAJFRH.cjs.map +0 -1
- package/dist/chunk-JUUOJP7I.cjs.map +0 -1
- package/dist/chunk-KJVDYWAM.cjs.map +0 -1
- package/dist/chunk-O4EQYPLO.cjs.map +0 -1
- package/dist/chunk-PZRTRYPD.js.map +0 -1
- package/dist/chunk-RVKVGS72.js.map +0 -1
- package/dist/chunk-SKVVOEMX.js.map +0 -1
- package/dist/chunk-SLRVI2YU.js.map +0 -1
- package/dist/chunk-SQ5F5BFW.cjs.map +0 -1
- package/dist/chunk-TTJGCJWX.cjs.map +0 -1
- package/dist/chunk-X4Y7ZHFB.js.map +0 -1
- package/dist/chunk-XL55UDLO.js.map +0 -1
- package/dist/chunk-ZU2B2RZK.cjs +0 -13
- package/dist/chunk-ZU2B2RZK.cjs.map +0 -1
- package/dist/chunk-ZX663X3X.cjs.map +0 -1
package/dist/agents/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { AgentCard, AgentGallery, ConversationListView, ConversationTurnSpeaker, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, SkillCard, SkillRow, TASK_COLUMN_ORDER, TaskInbox, TaskMoveDialog, TaskOutputsCell, TaskStatusPill, TaskTable, TaskThreadChip, TasksToolbar, ThreadNotifyDialog, UploadTaskItem, UploadTaskList, WorkflowsToolbar, createTaskColumns, filterConversationRows, formatElapsed, useWorkflowPreview } from '../chunk-
|
|
3
|
-
export { ANNOTATE, ANNOTATE_ID, AUTOMATION_EVENTS, ActionStepBody, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentConnectInstructions, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentMainView, AgentTypeSelector, ApprovalEvidence, AssigneeLine, AssistantEntity, BUILTIN_SKILLS, CHRONOLOGY, CHRONOLOGY_ID, CUSTOM_TASK, CUSTOM_TASK_ID, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DASHBOARD_OPERATIONS, DASHBOARD_PINNED, DEEP_RESEARCH, DEEP_RESEARCH_ID, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CAPABILITIES, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TEMPLATES, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_STEP_BAR_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_THREAD_LAUNCHER_LABELS, DEFAULT_THREAD_STATE_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_WORKFLOW_RUNNER_LABELS, DEFAULT_WORKFLOW_RUN_STATUS_LABELS, DEFAULT_WORKFLOW_STEP_PARTS_LABELS, DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, GENERATE_IMAGE, GENERATE_IMAGE_ID, GoalCriteria, IMAGE_ASPECT_AUTO, IMAGE_ASPECT_RATIOS, MAX_TASK_DEPTH, MODEL_NAME_ICONS, MODEL_TIER_ICON_MAP, MODEL_TIER_LABELS, NewThreadDialog, PillSelect, REMIND_TASK, REMIND_TASK_ID, RecurrenceBuilder, SKILL_FIELD_TYPE_LABELS, SKILL_MAIN_FILENAME, SKILL_SOURCE_LABELS, SKILL_TYPES, SKILL_TYPE_LABELS, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, STEP_ICON_MAP, SUMMARISE, SUMMARISE_ID, SendBackControl, SkillActionButton, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillLibraryDetail, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TAG_ICONS, TIMELINE, TIMELINE_ID, TIMELINE_PROMPT, TOOL_ICON_MAP, TRANSLATE, TRANSLATE_ID, TRANSLATE_LANGUAGES, TRIGGER_LABELS, TaskActivityDialog, TaskActivityTimeline, TaskComposer, TaskEmptyState, TaskFlow, TaskPlan, TaskRunsDialog, TaskStartDialog, ThreadActivity, ThreadLauncher, ThreadStatusLine, TupleArrayField, WEB_WORKFLOWS, WEEKDAYS, WORD_ASK, WORD_ASK_ID, WORD_CONTINUE, WORD_CONTINUE_ID, WORD_SUMMARISE, WORD_SUMMARISE_ID, WORD_SUPPORT, WORD_SUPPORT_ID, WORD_WORKFLOWS, WORKFLOW_REGISTRY, WorkflowRunStatus, WorkflowRunner, WorkflowStepAction, WorkflowThreadStartedBy, WorkflowThreadStrip, activeStepId, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildLibrarySkills, buildRRule, buildTaskRows, buildZipSkillImport, closeWorkflowLaunch, compactThreadActivity, composePersona, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createsWork, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveAnnotationName, deriveWorkflowName, descendantIds, describeRRule, describeTrigger, filterLibrarySkills, firstWords, fromPlanAssignee, fromPlanDocumentRef, fromPlanSteps, getAgentStepIcon, getAgentStepPresentation, getCurrentAgentStepPresentation, getModelIcon, goalProgress, groupThreadActivity, hasTaskFields, humanizeSection, importMarkdownSkill, importSkillFile, importSkillFromUrl, indexTasks, inferType, inputDocumentIds, isAgenticWorkflow, isIncompleteSignal, isMainSkillFile, isOutOfBounds, isPlainTodo, isSupersededStop, isValidAgentName, isoToLocalInput, latestMessageTime, layoutFromPlanSteps, linkedRunsFromActivity, localInputToIso, moveTargets, newThreadToRequest, nextCriterionId, notifiedLabel, openWorkflowLaunch, ownerExtId, parseRRule, parseSkillFrontmatter, prettifyKey, readSkillArchive, recordWorkflowUse, renderWorkflowIcon, resetWorkflowUsage, resolveScopeInputs, serializeSkill, skillSlug, sortByRecentUse, stepAccent, stepWindow, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskActivityHeadline, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, toPlanAssignee, toPlanDocumentRef, toPlanSteps, unnotifiedMentions, useWorkflowLaunchRequest, useWorkflowUsage, useWorkflowView, workflowFromSkillMarkdown, workflowTaskFields, workflowToComposerValues, workflowToSkillMarkdown, workflowWhen } from '../chunk-
|
|
2
|
+
export { AgentCard, AgentGallery, ConversationListView, ConversationTurnSpeaker, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_ROW_LABELS, DEFAULT_TASKS_CHROME_LABELS, DEFAULT_TASK_LIST_LABELS, DEFAULT_TASK_OUTPUTS_CELL_LABELS, DEFAULT_TASK_STATUS_PILL_LABELS, DEFAULT_TASK_THREAD_CHIP_LABELS, DEFAULT_UPLOAD_TASK_ITEM_LABELS, DEFAULT_UPLOAD_TASK_LIST_LABELS, DEFAULT_WORKFLOWS_CHROME_LABELS, SkillCard, SkillRow, TASK_COLUMN_ORDER, TaskInbox, TaskMoveDialog, TaskOutputsCell, TaskStatusPill, TaskTable, TaskThreadChip, TasksToolbar, ThreadNotifyDialog, UploadTaskItem, UploadTaskList, WorkflowsToolbar, createTaskColumns, filterConversationRows, formatElapsed, useWorkflowPreview } from '../chunk-NZIVQ4Q4.js';
|
|
3
|
+
export { ANNOTATE, ANNOTATE_ID, AUTOMATION_EVENTS, ActionStepBody, AgentAvatarField, AgentBar, AgentBarIconButton, AgentBarMenu, AgentBarNotes, AgentBarProbeAnswer, AgentBarQueuedNote, AgentBarStatus, AgentConnectInstructions, AgentCreateView, AgentCreatedView, AgentCreator, AgentEditView, AgentMainView, AgentTypeSelector, ApprovalEvidence, AssigneeLine, AssistantEntity, BUILTIN_SKILLS, CHRONOLOGY, CHRONOLOGY_ID, CUSTOM_TASK, CUSTOM_TASK_ID, CapabilityGrid, CapabilityTile, ConfigField, ConfigForm, ConsentActions, ConsentBulletList, ConsentCard, ConsentFootnote, ConsentHeader, ConsentMessage, ConsentNotice, ConsentPage, ConsentPermissionList, ConsentSection, ConsentStrong, ConsentText, CopyableUrl, DASHBOARD_OPERATIONS, DASHBOARD_PINNED, DEEP_RESEARCH, DEEP_RESEARCH_ID, DEFAULT_AGENT_AVATAR_FIELD_LABELS, DEFAULT_AGENT_BAR_LABELS, DEFAULT_AGENT_CAPABILITIES, DEFAULT_AGENT_CREATOR_LABELS, DEFAULT_AGENT_STEPS_LABELS, DEFAULT_AGENT_TEMPLATES, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TYPE_SELECTOR_LABELS, DEFAULT_AUTHORIZE_AGENT_LABELS, DEFAULT_CONFIG_FIELD_LABELS, DEFAULT_CONFIG_FORM_LABELS, DEFAULT_CONSENT_ACTIONS_LABELS, DEFAULT_COPYABLE_URL_LABELS, DEFAULT_NEW_THREAD_DIALOG_LABELS, DEFAULT_PILL_SELECT_LABELS, DEFAULT_RECURRENCE, DEFAULT_RECURRENCE_BUILDER_LABELS, DEFAULT_SKILL_EDIT_FORM_LABELS, DEFAULT_SKILL_GENERATE_FORM_LABELS, DEFAULT_SKILL_GLOBAL_BADGE_LABELS, DEFAULT_SKILL_VIEW_TOGGLE_LABELS, DEFAULT_STEP_BAR_LABELS, DEFAULT_SUBAGENT_ROSTER_LABELS, DEFAULT_TASK_ACTIVITY_LABELS, DEFAULT_TASK_COMPOSER_LABELS, DEFAULT_TASK_PLAN_LABELS, DEFAULT_TASK_RUNS_DIALOG_LABELS, DEFAULT_THREAD_LAUNCHER_LABELS, DEFAULT_THREAD_STATE_LABELS, DEFAULT_TUPLE_ARRAY_FIELD_LABELS, DEFAULT_WORKFLOW_RUNNER_LABELS, DEFAULT_WORKFLOW_RUN_STATUS_LABELS, DEFAULT_WORKFLOW_STEP_PARTS_LABELS, DEFAULT_WORKFLOW_THREAD_STRIP_LABELS, DERIVED_NAME_WORDS, EMPTY_NEW_THREAD, GENERATE_IMAGE, GENERATE_IMAGE_ID, GoalCriteria, IMAGE_ASPECT_AUTO, IMAGE_ASPECT_RATIOS, MAX_TASK_DEPTH, MODEL_NAME_ICONS, MODEL_TIER_ICON_MAP, MODEL_TIER_LABELS, NewThreadDialog, PillSelect, REMIND_TASK, REMIND_TASK_ID, RecurrenceBuilder, SKILL_FIELD_TYPE_LABELS, SKILL_MAIN_FILENAME, SKILL_SOURCE_LABELS, SKILL_TYPES, SKILL_TYPE_LABELS, STATUS_LABELS, STATUS_ORDER, STATUS_TONE, STEP_ICON_MAP, SUMMARISE, SUMMARISE_ID, SendBackControl, SkillActionButton, SkillDetail, SkillDetailSection, SkillEditForm, SkillFilterChips, SkillGenerateForm, SkillGlobalBadge, SkillLibraryDetail, SkillTile, SkillTypeBadge, SkillViewToggle, StepDetail, StepNarration, StepOutcome, StepParams, StepRow, StepSummary, StepTrace, StepTraceSummary, SubAgentLane, SubStepGroup, SubagentRoster, TAG_ICONS, TIMELINE, TIMELINE_ID, TIMELINE_PROMPT, TOOL_ICON_MAP, TRANSLATE, TRANSLATE_ID, TRANSLATE_LANGUAGES, TRIGGER_LABELS, TaskActivityDialog, TaskActivityTimeline, TaskComposer, TaskEmptyState, TaskFlow, TaskPlan, TaskRunsDialog, TaskStartDialog, ThreadActivity, ThreadLauncher, ThreadStatusLine, TupleArrayField, WEB_WORKFLOWS, WEEKDAYS, WORD_ASK, WORD_ASK_ID, WORD_CONTINUE, WORD_CONTINUE_ID, WORD_SUMMARISE, WORD_SUMMARISE_ID, WORD_SUPPORT, WORD_SUPPORT_ID, WORD_WORKFLOWS, WORKFLOW_REGISTRY, WorkflowRunStatus, WorkflowRunner, WorkflowStepAction, WorkflowThreadStartedBy, WorkflowThreadStrip, activeStepId, agentConfigSectionToValues, agentCreatorToConfigSection, asTaskStatus, authModeFor, buildLibrarySkills, buildRRule, buildTaskRows, buildZipSkillImport, closeWorkflowLaunch, compactThreadActivity, composePersona, composerToTaskQuery, composerToWorkRequest, composerToWorkflowRequest, composerToWorkflowUpdate, createsWork, defaultScopeRenderer, defaultTaskComposerValues, deriveAgentName, deriveAnnotationName, deriveWorkflowName, descendantIds, describeRRule, describeTrigger, filterLibrarySkills, firstWords, fromPlanAssignee, fromPlanDocumentRef, fromPlanSteps, getAgentStepIcon, getAgentStepPresentation, getCurrentAgentStepPresentation, getModelIcon, goalProgress, groupThreadActivity, hasTaskFields, humanizeSection, importMarkdownSkill, importSkillFile, importSkillFromUrl, indexTasks, inferType, inputDocumentIds, isAgenticWorkflow, isIncompleteSignal, isMainSkillFile, isOutOfBounds, isPlainTodo, isSupersededStop, isValidAgentName, isoToLocalInput, latestMessageTime, layoutFromPlanSteps, linkedRunsFromActivity, localInputToIso, moveTargets, newThreadToRequest, nextCriterionId, notifiedLabel, openWorkflowLaunch, ownerExtId, parseRRule, parseSkillFrontmatter, prettifyKey, readSkillArchive, recordWorkflowUse, renderWorkflowIcon, resetWorkflowUsage, resolveScopeInputs, serializeSkill, skillSlug, sortByRecentUse, stepAccent, stepWindow, stripPersonaPreamble, summarizeAgent, summarizeCapabilities, taskActivityHeadline, taskComposerToCreateRequest, taskComposerToUpdateRequest, taskNeedsAccess, taskToComposerValues, toPlanAssignee, toPlanDocumentRef, toPlanSteps, unnotifiedMentions, useWorkflowLaunchRequest, useWorkflowUsage, useWorkflowView, workflowFromSkillMarkdown, workflowTaskFields, workflowToComposerValues, workflowToSkillMarkdown, workflowWhen } from '../chunk-ORUV4MEP.js';
|
|
4
4
|
import '../chunk-CQCC7LE7.js';
|
|
5
|
-
export { AgentSelect, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, PersonPill, SchemaForm, TaskTriggerChip, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, buildWorkflowScopeSource, createWorkflowColumns, documentScopeLabels, hasTrigger, isSkillRow, matchWorkflowScope, workflowStatus, workflowTriggerType } from '../chunk-
|
|
5
|
+
export { AgentSelect, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, PersonPill, SchemaForm, TaskTriggerChip, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, buildWorkflowScopeSource, createWorkflowColumns, documentScopeLabels, hasTrigger, isSkillRow, matchWorkflowScope, workflowStatus, workflowTriggerType } from '../chunk-GA2A7OX6.js';
|
|
6
6
|
import '../chunk-MQEN62NR.js';
|
|
7
7
|
import '../chunk-G4GLDQLY.js';
|
|
8
8
|
import '../chunk-M4S75AEJ.js';
|
|
@@ -12,7 +12,6 @@ import '../chunk-RLWIUUQ5.js';
|
|
|
12
12
|
import '../chunk-YU2KUMGE.js';
|
|
13
13
|
import '../chunk-SUDPZ5IQ.js';
|
|
14
14
|
import '../chunk-7F5Z4K5W.js';
|
|
15
|
-
import '../chunk-WNDIVNPT.js';
|
|
16
15
|
import '../chunk-ABEKUV6L.js';
|
|
17
16
|
import '../chunk-P6GHJSLR.js';
|
|
18
17
|
export { DEFAULT_ASSIGNEE_WORDING, DEFAULT_STEP_DOCUMENT_LABELS, DEFAULT_STEP_KIND_LABELS, DEFAULT_STEP_RECORD_LABELS, STEP_KIND_ICONS, StepDocumentButton, StepDocumentCards, StepRecord, WORKFLOW_STEP_KINDS, assigneeName, canAssign, composeStepPrompt, dependsOn, fillRunText, fillStepInputs, initialRunInputs, isPersonAction, isPersonStep, isRunFinished, isSteppedWorkflow, nextAction, orderSteps, reviewInstructions, runFields, runFieldsOf, runThreadTitle, sendBackTargets, splitDocRef, stepConfigProblems, stepDependencies, stepDocuments, stepFields, stepKindOf, stepLevels, stepPhase, stepStatesFromActivity, upstreamSteps, validateStep, validateWorkflowGraph, workflowSteps } from '../chunk-THNTNAYI.js';
|
|
@@ -26,6 +25,7 @@ import '../chunk-GRT4EH76.js';
|
|
|
26
25
|
import '../chunk-U4HWVCRN.js';
|
|
27
26
|
import '../chunk-TX2ZICS7.js';
|
|
28
27
|
import '../chunk-7F6CBP3Z.js';
|
|
28
|
+
import '../chunk-WNDIVNPT.js';
|
|
29
29
|
import '../chunk-VUNV25KB.js';
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
|
31
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getHumanUserCount, getWorkspaceTypeInfo, getVariantBgClass } from './chunk-
|
|
2
|
+
import { getHumanUserCount, getWorkspaceTypeInfo, getVariantBgClass } from './chunk-57CG33XJ.js';
|
|
3
3
|
import { KeyValueRow, CollapsibleSection } from './chunk-WZ63HE2C.js';
|
|
4
4
|
import { MemberAvatarStack } from './chunk-FUPAGAZB.js';
|
|
5
5
|
import { WorkspaceTypeBadgeView } from './chunk-NBV56SGU.js';
|
|
@@ -7,7 +7,7 @@ import { ActionLink } from './chunk-SUDPZ5IQ.js';
|
|
|
7
7
|
import { fmtDate } from './chunk-5VYJP6XD.js';
|
|
8
8
|
import { ModalHeader } from './chunk-TX2ZICS7.js';
|
|
9
9
|
import { FileText, MessagesSquare, Users, Check, ChevronRight, UserPlus, LogOut, Globe, AlertCircle, Plus, ArrowUpRight, AlignLeft, CreditCard, User } from 'lucide-react';
|
|
10
|
-
import { formatRelativeTime, cn, Popover, PopoverTrigger, PopoverContent, Button, IconToggle, Dialog, DialogContent, DialogTitle, DialogDescription, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectSeparator, Input } from '@arbidocs/react/ui';
|
|
10
|
+
import { formatRelativeTime, cn, Popover, PopoverTrigger, PopoverContent, Button, IconToggle, Dialog, DialogContent, DialogTitle, DialogDescription, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectSeparator, entityNoun, Input, getEntityLabel } from '@arbidocs/react/ui';
|
|
11
11
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
12
12
|
import { createContext, useContext, useMemo, useId, useState } from 'react';
|
|
13
13
|
|
|
@@ -255,7 +255,10 @@ function ProjectPicker({
|
|
|
255
255
|
disabled,
|
|
256
256
|
readOnly,
|
|
257
257
|
className,
|
|
258
|
-
labels = {
|
|
258
|
+
labels = {
|
|
259
|
+
placeholder: `Select ${entityNoun("PROJECT")}`,
|
|
260
|
+
create: `Create new ${entityNoun("PROJECT")}...`
|
|
261
|
+
},
|
|
259
262
|
testId
|
|
260
263
|
}) {
|
|
261
264
|
const welcome = variant === "welcome";
|
|
@@ -322,7 +325,9 @@ var DEFAULT_LABELS = {
|
|
|
322
325
|
name: "Name *",
|
|
323
326
|
description: "Description",
|
|
324
327
|
visibility: "Visibility",
|
|
325
|
-
project
|
|
328
|
+
get project() {
|
|
329
|
+
return getEntityLabel("PROJECT");
|
|
330
|
+
},
|
|
326
331
|
over: (n) => `${n} over`,
|
|
327
332
|
charsLeft: (n) => `${n} chars left`
|
|
328
333
|
};
|
|
@@ -752,5 +757,5 @@ function WorkspaceTypeBadge({
|
|
|
752
757
|
}
|
|
753
758
|
|
|
754
759
|
export { CommonWorkspaceToggle, DEFAULT_WORKSPACE_CARD_LABELS, ExpandableSection, FormActions, FormErrorBanner, ItalicNone, LeaveFooter, ModalActionRow, PageLoading, ProjectActionButton, ProjectOptionRow, ProjectPicker, WorkspaceAudienceLine, WorkspaceCard, WorkspaceFieldsView, WorkspaceFormModal, WorkspaceGroup, WorkspaceIdentityPanel, WorkspaceList, WorkspacePageFrame, WorkspaceProjectSlot, WorkspaceTypeBadge, formatRole, getRoleBadgeClass, getRoleDescription };
|
|
755
|
-
//# sourceMappingURL=chunk-
|
|
756
|
-
//# sourceMappingURL=chunk-
|
|
760
|
+
//# sourceMappingURL=chunk-2GDKBLD5.js.map
|
|
761
|
+
//# sourceMappingURL=chunk-2GDKBLD5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/workspaces/WorkspaceSettingsParts.tsx","../src/workspaces/CommonWorkspaceToggle.tsx","../src/workspaces/workspace-roles.ts","../src/workspaces/WorkspaceFormParts.tsx","../src/workspaces/WorkspaceCard.tsx","../src/workspaces/WorkspaceGroup.tsx","../src/workspaces/WorkspaceTypeBadge.tsx"],"names":["jsx","jsxs","cn","Button","Globe","FileText","ChevronRight","Users"],"mappings":";;;;;;;;;;;;AASO,SAAS,kBAAA,CAAmB,EAAE,MAAA,EAAQ,QAAA,EAAS,EAA6C;AACjG,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAU,iCAAA;AAAA,MACV,WAAA,EAAU,gBAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MAGb,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAA,EAAU,2EAAA,EACb,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAU,kCAAA,EAAoC,QAAA,EAAS,CAAA,EAC9D;AAAA;AAAA,GACF;AAEJ;AAGO,SAAS,sBAAA,CAAuB,EAAE,QAAA,EAAS,EAA4B;AAC5E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,0BAAA;AAAA,MACV,SAAA,EAAU,mEAAA;AAAA,MAET;AAAA;AAAA,GACH;AAEJ;AAUO,SAAS,oBAAA,CAAqB,EAAE,MAAA,EAAQ,OAAA,EAAS,UAAS,EAA8B;AAC7F,EAAA,uBACE,GAAA,CAAC,SAAI,SAAA,EAAU,iCAAA,EACb,+BAAC,KAAA,EAAA,EAAI,SAAA,EAAU,wCAAA,EAAyC,aAAA,EAAa,MAAA,EACnE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EAAW,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,IAClC;AAAA,GAAA,EACH,CAAA,EACF,CAAA;AAEJ;AAGO,SAAS,UAAA,CAAW,EAAE,QAAA,E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,EACd,IAAA,GAAO,IAAA;AAAA,EACP,UAAA,GAAa,KAAA;AAAA,EACb;AACF,CAAA,EAA4B;AAC1B,EAAA,MAAM,SAAA,GAAY,iBAAA,CAAkB,SAAA,CAAU,KAAK,CAAA;AACnD,EAAA,MAAM,EAAE,IAAA,EAAM,OAAA,KAAY,oBAAA,CAAqB,SAAA,CAAU,WAAW,SAAS,CAAA;AAC7E,EAAA,MAAM,OAAO,SAAA,CAAU,SAAA,GAAYE,KAAAA,GAAQ,SAAA,GAAY,IAAIG,KAAAA,GAAQ,IAAA;AAEnE,EAAA,uBACEP,GAAAA;AAAA,IAAC,sBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,OAAA,EAAS,kBAAkB,OAAO,CAAA;AAAA,MAClC,SAAA,EAAW,IAAA;AAAA,MACX,WAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ","file":"chunk-2GDKBLD5.js","sourcesContent":["import type { ReactNode } from 'react'\nimport { LogOut, UserPlus } from 'lucide-react'\nimport { Button, cn, Popover, PopoverContent, PopoverTrigger } from '@arbidocs/react/ui'\n\n/**\n * Page frame of a workspace's home: a bounded column whose ONE scroll region spans the full\n * width (scrollbar on the outer edge), the inset living on the content inside it. A container,\n * so children can use `@2xl:` queries.\n */\nexport function WorkspacePageFrame({ testId, children }: { testId?: string; children: ReactNode }) {\n return (\n <div\n className=\"flex h-full flex-col @container\"\n data-slot=\"workspace-page\"\n data-testid={testId}\n >\n {/* scrollbar-gutter:stable keeps the content from jumping when a scrollbar appears. */}\n <div className=\"scrollbar-subtle min-h-0 flex-1 overflow-y-auto [scrollbar-gutter:stable]\">\n <div className=\"space-y-6 px-4 pb-6 sm:px-6 pt-4\">{children}</div>\n </div>\n </div>\n )\n}\n\n/** Tinted card holding the identity bar and the expandable member list. */\nexport function WorkspaceIdentityPanel({ children }: { children: ReactNode }) {\n return (\n <div\n data-slot=\"workspace-identity-panel\"\n className=\"group rounded-lg border border-border bg-card px-4 py-3 shadow-xs\"\n >\n {children}\n </div>\n )\n}\n\nexport interface WorkspaceProjectSlotProps {\n testId: string\n /** Screen-reader caption (\"Project:\"): the chip says what it is without a word in front. */\n caption: string\n children: ReactNode\n}\n\n/** The project control / chip pinned to the end of the name row. */\nexport function WorkspaceProjectSlot({ testId, caption, children }: WorkspaceProjectSlotProps) {\n return (\n <div className=\"flex min-w-0 items-center gap-3\">\n <div className=\"flex min-w-0 flex-1 items-center gap-2\" data-testid={testId}>\n <span className=\"sr-only\">{caption}</span>\n {children}\n </div>\n </div>\n )\n}\n\n/** Stated absence (\"None\") rather than a blank gap. */\nexport function ItalicNone({ children }: { children: ReactNode }) {\n return <span className=\"text-sm italic text-muted-foreground\">{children}</span>\n}\n\nexport interface WorkspaceAudienceLineProps {\n visibility: {\n testId: string\n caption: string\n /** The owner's visibility switch (developers only). */\n toggle?: ReactNode\n /** The state named in words, so the switch is never a puzzle. */\n stateText: string\n /** What the state means for who can see the workspace; opened by tapping the state words. */\n stateHelp: string\n }\n /** Member avatar stack. */\n members: ReactNode\n /** \"Share\" button (owners). */\n share?: { label: string; onClick: () => void; testId: string }\n}\n\n/** Visibility and members end the description line together: who can see and use the workspace. */\nexport function WorkspaceAudienceLine({ visibility, members, share }: WorkspaceAudienceLineProps) {\n return (\n <span className=\"flex flex-wrap items-center gap-x-4 gap-y-2\" data-slot=\"workspace-audience\">\n <span className=\"flex items-center gap-2\" data-testid={visibility.testId}>\n <span className=\"sr-only\">{visibility.caption}</span>\n {visibility.toggle}\n {/* Tap-to-explain, not hover-only: the words must answer a click on touch screens too. */}\n <Popover>\n <PopoverTrigger className=\"touch-hit cursor-pointer rounded-sm text-sm text-muted-foreground underline decoration-dotted underline-offset-4 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\">\n {visibility.stateText}\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-64 text-sm\">\n {visibility.stateHelp}\n </PopoverContent>\n </Popover>\n </span>\n {/* Faces first, then Share: \"these people ... add more\". */}\n <span className=\"flex items-center gap-1\">\n {members}\n {share && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 gap-1.5 px-3 text-sm pointer-coarse:h-11\"\n onClick={share.onClick}\n data-testid={share.testId}\n >\n <UserPlus className=\"size-4\" />\n {share.label}\n </Button>\n )}\n </span>\n </span>\n )\n}\n\n/**\n * Collapsible block under the identity bar. Stays mounted and animates its height (grid-rows\n * 0fr to 1fr), so opening and closing glides instead of snapping.\n */\nexport function ExpandableSection({\n expanded,\n testId,\n children,\n}: {\n expanded: boolean\n testId?: string\n children: ReactNode\n}) {\n return (\n <div\n className={cn(\n 'grid transition-[grid-template-rows] duration-300 ease-in-out',\n expanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'\n )}\n data-slot=\"expandable-section\"\n data-expanded={expanded}\n data-testid={testId}\n >\n <div className=\"overflow-hidden\">\n <div className=\"mt-4 border-t border-border pt-4\">{children}</div>\n </div>\n </div>\n )\n}\n\n/** Centered loading placeholder of a page body. */\nexport function PageLoading({ children }: { children: ReactNode }) {\n return <div className=\"flex h-64 items-center justify-center\">{children}</div>\n}\n\nexport interface LeaveFooterProps {\n testId?: string\n leave: { label: string; disabled?: boolean; onClick: () => void; testId?: string }\n}\n\n/** Leaving ENDS your part in the workspace, so it sits last and alone at the foot of the page. */\nexport function LeaveFooter({ testId, leave }: LeaveFooterProps) {\n return (\n <div className=\"flex justify-end\" data-slot=\"leave-footer\" data-testid={testId}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={leave.onClick}\n disabled={leave.disabled}\n className=\"h-7 px-2 text-sm text-destructive hover:bg-destructive/10 hover:text-destructive pointer-coarse:h-11\"\n data-testid={leave.testId}\n >\n <LogOut className=\"mr-1 size-3.5\" />\n {leave.label}\n </Button>\n </div>\n )\n}\n","/**\n * CommonWorkspaceToggle Component\n *\n * Toggle for workspace common/members-only visibility.\n * Takes isCommon and onToggle as props for form integration.\n */\n\nimport { Globe } from 'lucide-react'\nimport { IconToggle } from '@arbidocs/react/ui'\n\nexport interface CommonWorkspaceToggleProps {\n isCommon: boolean\n onToggle: (isCommon: boolean) => void\n disabled?: boolean\n /** Tooltip to show when disabled */\n disabledTooltip?: string\n 'data-testid'?: string\n}\n\nconst COLORS = {\n text: 'text-muted-foreground',\n bg: 'bg-gray-600',\n}\n\nexport function CommonWorkspaceToggle({\n isCommon,\n onToggle,\n disabled = false,\n disabledTooltip,\n 'data-testid': dataTestId,\n}: CommonWorkspaceToggleProps) {\n return (\n <IconToggle\n icon={Globe}\n isActive={isCommon}\n onToggle={onToggle}\n colors={COLORS}\n disabled={disabled}\n disabledTooltip={disabledTooltip}\n tooltipActive=\"On: everyone on this deployment can see it. Turn off to limit it to members.\"\n tooltipInactive=\"Off: only members of this workspace can see it. Turn on to let everyone on this deployment see it.\"\n data-testid={dataTestId}\n />\n )\n}\n","/**\n * A workspace role ('owner' | 'collaborator' | 'guest') as people see it: its name, its badge\n * colours and what it lets a member do.\n */\n\nexport type WorkspaceRoleName = 'owner' | 'collaborator' | 'guest'\n\n/** \"Owner\", \"Collaborator\", \"Guest\". */\nexport function formatRole(role: string): string {\n return role.charAt(0).toUpperCase() + role.slice(1)\n}\n\nconst ROLE_BADGE_CLASSES: Record<WorkspaceRoleName, string> = {\n owner: 'bg-primary text-white hover:bg-primary border border-primary',\n collaborator: 'bg-secondary text-white hover:bg-secondary border border-secondary',\n guest: 'bg-gray-600 text-white hover:bg-gray-600 border border-gray-600',\n}\n\n/** The badge classes of a role. */\nexport function getRoleBadgeClass(role: WorkspaceRoleName): string {\n return ROLE_BADGE_CLASSES[role]\n}\n\nconst ROLE_DESCRIPTIONS: Record<WorkspaceRoleName, string> = {\n owner:\n 'Owners have full control of the workspace, including adding and removing members, but cannot see private content created by other members.',\n collaborator:\n 'Collaborators can create and edit shared content, but cannot delete shared content created by others and cannot manage workspace settings or membership.',\n guest:\n 'Guests can create private content and view shared content, but cannot create or edit shared content.',\n}\n\n/** What a role lets a member do (a tooltip). */\nexport function getRoleDescription(role: WorkspaceRoleName): string {\n return ROLE_DESCRIPTIONS[role]\n}\n","import { useState, type ReactNode, useId } from 'react'\nimport {\n AlertCircle,\n AlignLeft,\n ArrowUpRight,\n CreditCard,\n FileText,\n Globe,\n Plus,\n} from 'lucide-react'\nimport {\n Button,\n cn,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogTitle,\n Input,\n Select,\n SelectContent,\n SelectItem,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n entityNoun,\n getEntityLabel,\n} from '@arbidocs/react/ui'\nimport { KeyValueRow } from '../home/KeyValueRow'\nimport { ModalHeader } from '../settings/ModalScaffold'\n\n/** Inline error strip of a form. */\nexport function FormErrorBanner({\n message,\n testId,\n className,\n id,\n}: {\n message: string\n testId?: string\n className?: string\n /** Lets a field point at this message with `aria-describedby`. */\n id?: string\n}) {\n return (\n <div\n id={id}\n role=\"alert\"\n data-slot=\"form-error\"\n data-testid={testId}\n className={cn(\n 'flex items-center gap-2 rounded-md border border-red-border bg-red-bg p-3 text-sm text-red-text',\n className\n )}\n >\n <AlertCircle className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n {message}\n </div>\n )\n}\n\n/** Right-aligned footer row of a form (Cancel + submit). */\nexport function FormActions({ className, children }: { className?: string; children: ReactNode }) {\n return (\n <div\n data-slot=\"form-actions\"\n className={cn('sticky bottom-0 flex justify-end gap-2 bg-background pt-2', className)}\n >\n {children}\n </div>\n )\n}\n\n/** Footer row of a modal body, separated by a rule. */\nexport function ModalActionRow({ children }: { children: ReactNode }) {\n return (\n <div\n data-slot=\"modal-action-row\"\n className=\"sticky bottom-0 -mx-6 -mb-6 flex flex-col-reverse gap-2 border-t border-border bg-background px-6 pb-6 pt-3 sm:flex-row sm:items-center sm:justify-end\"\n >\n {children}\n </div>\n )\n}\n\nexport interface WorkspaceFormModalProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n title: ReactNode\n /** Icon before the title. */\n icon?: ReactNode\n /** Optional intro paragraph above the form (first-run welcome). */\n intro?: ReactNode\n testId?: string\n /** Visually hidden description. */\n description?: string\n children: ReactNode\n}\n\n/** Dialog frame of the create-workspace form: header, optional intro, scrolling body. */\nexport function WorkspaceFormModal({\n open,\n onOpenChange,\n title,\n icon,\n intro,\n testId,\n description = 'Create a new workspace',\n children,\n}: WorkspaceFormModalProps) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n presentation=\"sheet\"\n className=\"flex max-h-panel w-modal max-w-modal-vw flex-col overflow-hidden p-0\"\n data-testid={testId}\n >\n <ModalHeader>\n <ModalTitleRow icon={icon} title={title} description={description} />\n </ModalHeader>\n <div className=\"min-h-0 flex-1 overflow-auto px-6 pb-6\">\n {intro && <p className=\"pb-4 text-sm text-muted-foreground\">{intro}</p>}\n {children}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction ModalTitleRow({\n icon,\n title,\n description,\n}: {\n icon?: ReactNode\n title: ReactNode\n description: string\n}) {\n return (\n <>\n <DialogTitle>\n <div className=\"flex items-center gap-2\">\n {icon}\n <span>{title}</span>\n </div>\n </DialogTitle>\n <DialogDescription className=\"sr-only\">{description}</DialogDescription>\n </>\n )\n}\n\n/** One entry of the project picker: identity on the left, optional quota summary on the right. */\nexport function ProjectOptionRow({ identity, meta }: { identity: ReactNode; meta?: string }) {\n return (\n <div className=\"flex w-full min-w-0 items-center gap-2\">\n {identity}\n {meta && <span className=\"ml-auto truncate text-sm text-muted-foreground\">{meta}</span>}\n </div>\n )\n}\n\nexport interface ProjectPickerOption {\n id: string\n content: ReactNode\n}\n\nexport interface ProjectPickerProps {\n value?: string\n options: ProjectPickerOption[]\n onChange: (id: string) => void\n /**\n * `form` (default): the full-width field of the workspace form. `welcome`: the compact switcher\n * in the welcome dialog's quota header (muted pill, menu aligned to its end).\n */\n variant?: 'form' | 'welcome'\n /** Adds a \"Create new project...\" entry. */\n onCreate?: () => void\n disabled?: boolean\n readOnly?: boolean\n className?: string\n labels?: { placeholder: string; create: string }\n /** Trigger test id (default `workspace-project-select`, or `welcome-modal-project-select`). */\n testId?: string\n}\n\nconst CREATE_VALUE = '__create__'\n\n/** The one project picker: a workspace's owning project (optionally with a create entry), or the\n * welcome dialog's project switcher (`variant=\"welcome\"`). */\nexport function ProjectPicker({\n value,\n options,\n onChange,\n variant = 'form',\n onCreate,\n disabled,\n readOnly,\n className,\n labels = {\n placeholder: `Select ${entityNoun('PROJECT')}`,\n create: `Create new ${entityNoun('PROJECT')}...`,\n },\n testId,\n}: ProjectPickerProps) {\n const welcome = variant === 'welcome'\n return (\n <Select\n value={value ?? options[0]?.id}\n onValueChange={(v) => (v === CREATE_VALUE ? onCreate?.() : onChange(v))}\n disabled={disabled || readOnly}\n >\n <SelectTrigger\n className={cn(\n welcome &&\n 'h-7 w-auto max-w-[9.5rem] shrink-0 gap-1 border-none bg-muted px-2 text-xs font-medium pointer-coarse:h-11',\n className,\n readOnly && 'cursor-not-allowed'\n )}\n data-testid={\n testId ?? (welcome ? 'welcome-modal-project-select' : 'workspace-project-select')\n }\n >\n {welcome ? <SelectValue /> : <SelectValue placeholder={labels.placeholder} />}\n </SelectTrigger>\n <SelectContent align={welcome ? 'end' : undefined}>\n {options.map((o) => (\n <SelectItem key={o.id} value={o.id}>\n {o.content}\n </SelectItem>\n ))}\n {onCreate && (\n <>\n <SelectSeparator />\n <SelectItem value={CREATE_VALUE}>\n <div className=\"flex items-center gap-1.5 text-primary\">\n <Plus className=\"size-3.5\" />\n <span>{labels.create}</span>\n </div>\n </SelectItem>\n </>\n )}\n </SelectContent>\n </Select>\n )\n}\n\n/** Compact CTA on a project row (e.g. Upgrade / Change plan). */\nexport function ProjectActionButton({\n label,\n onClick,\n className,\n testId,\n}: {\n label: string\n onClick: () => void\n className?: string\n testId?: string\n}) {\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onClick}\n className={cn(\n 'h-7 gap-1.5 whitespace-nowrap px-2 py-0 text-sm font-medium pointer-coarse:h-11',\n className\n )}\n data-testid={testId}\n >\n <ArrowUpRight className=\"size-3.5\" />\n {label}\n </Button>\n )\n}\n\nexport interface WorkspaceFieldsViewProps {\n /** `modal` (create flow) or `settings` (editing an existing workspace). */\n variant?: 'modal' | 'settings'\n name: string\n description: string\n onNameChange: (value: string) => void\n onDescriptionChange: (value: string) => void\n onNameBlur?: () => void\n onNameFocus?: () => void\n onDescriptionBlur?: () => void\n disabled?: boolean\n readOnly?: boolean\n maxNameLength?: number\n /** Id of the form's error message (a `FormErrorBanner id`): the name input is then `aria-invalid`\n * and described by it. */\n errorId?: string\n /** Content of the Visibility row (settings only); omit to hide the row. */\n visibility?: ReactNode\n /** Content of the Project row; omit to hide the row. */\n project?: ReactNode\n labels?: Partial<WorkspaceFieldsLabels>\n}\n\nexport interface WorkspaceFieldsLabels {\n readOnlyNotice: string\n name: string\n description: string\n visibility: string\n project: string\n over: (n: number) => string\n charsLeft: (n: number) => string\n}\n\nconst DEFAULT_LABELS: WorkspaceFieldsLabels = {\n readOnlyNotice: 'Read-only workspace',\n name: 'Name *',\n description: 'Description',\n visibility: 'Visibility',\n get project() {\n return getEntityLabel('PROJECT')\n },\n over: (n) => `${n} over`,\n charsLeft: (n) => `${n} chars left`,\n}\n\n/** Name / description / visibility / project rows shared by the create and settings forms. */\nexport function WorkspaceFieldsView({\n variant = 'modal',\n name,\n description,\n onNameChange,\n onDescriptionChange,\n onNameBlur,\n onNameFocus,\n onDescriptionBlur,\n disabled = false,\n readOnly = false,\n errorId,\n maxNameLength = 50,\n visibility,\n project,\n labels,\n}: WorkspaceFieldsViewProps) {\n const workspaceDescriptionId = useId()\n const workspaceNameId = useId()\n const l = { ...DEFAULT_LABELS, ...labels }\n const [nameFocused, setNameFocused] = useState(false)\n const isModal = variant === 'modal'\n const charsLeft = maxNameLength - name.length\n // The modal only surfaces the counter near the limit; settings shows it while focused.\n const counterVisible = !readOnly && nameFocused && (!isModal || charsLeft <= 10)\n const isDisabled = isModal ? disabled : disabled || readOnly\n\n return (\n <div className=\"space-y-1\" data-slot=\"workspace-fields\">\n {readOnly && (\n <div data-testid=\"workspace-form-readonly-notice\" className=\"sr-only\">\n {l.readOnlyNotice}\n </div>\n )}\n <KeyValueRow label={l.name} icon={<FileText size={14} />} htmlFor={workspaceNameId}>\n <div className=\"relative\">\n <Input\n id={workspaceNameId}\n type=\"text\"\n value={name}\n onChange={(e) => onNameChange(e.target.value)}\n onBlur={() => {\n setNameFocused(false)\n onNameBlur?.()\n }}\n onFocus={() => {\n setNameFocused(true)\n onNameFocus?.()\n }}\n maxLength={maxNameLength}\n readOnly={readOnly}\n disabled={isDisabled}\n className={cn(\n isModal ? 'bg-background' : 'capitalize',\n readOnly && 'cursor-not-allowed',\n 'pr-20'\n )}\n required\n aria-invalid={errorId ? true : undefined}\n aria-describedby={errorId}\n data-testid=\"workspace-form-name-input\"\n />\n {counterVisible && (\n <div\n className={cn(\n 'pointer-events-none absolute right-3 top-1/2 hidden -translate-y-1/2 text-sm lg:block',\n charsLeft < 0 ? 'text-red-text' : 'text-muted-foreground'\n )}\n >\n {charsLeft < 0 ? l.over(-charsLeft) : l.charsLeft(charsLeft)}\n </div>\n )}\n </div>\n </KeyValueRow>\n\n <KeyValueRow\n label={l.description}\n icon={<AlignLeft size={14} />}\n htmlFor={workspaceDescriptionId}\n >\n <Input\n id={workspaceDescriptionId}\n type=\"text\"\n dictate\n value={description}\n onChange={(e) => onDescriptionChange(e.target.value)}\n onBlur={onDescriptionBlur}\n readOnly={readOnly}\n disabled={isDisabled}\n className={cn(isModal && 'bg-background', readOnly && 'cursor-not-allowed')}\n data-testid=\"workspace-form-description-input\"\n />\n </KeyValueRow>\n\n {visibility && (\n <KeyValueRow label={l.visibility} icon={<Globe size={14} />}>\n {visibility}\n </KeyValueRow>\n )}\n {project && (\n <KeyValueRow label={l.project} icon={<CreditCard size={14} />}>\n {project}\n </KeyValueRow>\n )}\n </div>\n )\n}\n","import {\n createContext,\n useContext,\n type HTMLAttributes,\n useMemo,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { Check, ChevronRight, FileText, MessagesSquare, Users } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { formatRelativeTime } from '@arbidocs/react/ui'\nimport { fmtDate } from '../lib/format'\nimport { ActionLink } from '../components/ActionLink'\nimport { MemberAvatarStack, type StackedMember } from '../components/MemberAvatarStack'\n\n/** Everything a workspace tile shows, source-agnostic (not the raw SDK shape). */\nexport interface WorkspaceSummary {\n id: string\n name: string\n description?: string | null\n /** Host-supplied line under the name (a reference, a client, a status...). Not interpreted. */\n subtitle?: ReactNode\n docCount: number\n /** Hidden when undefined, so a host without chats shows no empty counter. */\n chatCount?: number\n /** Number of visible members (agents excluded by the caller). */\n memberCount: number\n members: StackedMember[]\n /** The viewer may not see who is here (RLS): renders an em dash, not a `0`. */\n membersHidden?: boolean\n /** ISO timestamp: rendered as \"Updated {relative}\". */\n updatedAt?: string | null\n}\n\n/** Every fixed string of the workspace tile. Pass a partial `labels` to translate or reword. */\nexport interface WorkspaceCardLabels {\n /** The tile's accessible name. */\n openWorkspace: (name: string) => string\n currentWorkspace: string\n documents: string\n chats: string\n members: string\n /** `relative` is the formatted \"3 days ago\". */\n updated: (relative: string) => string\n}\n\nexport const DEFAULT_WORKSPACE_CARD_LABELS: WorkspaceCardLabels = {\n openWorkspace: (name) => `Open workspace ${name}`,\n currentWorkspace: 'Current workspace',\n documents: 'Documents',\n chats: 'Tasks',\n members: 'Members',\n updated: (relative) => `Updated ${relative}`,\n}\n\ninterface CardContextValue {\n current: boolean\n testId?: string\n labels: WorkspaceCardLabels\n}\n\nconst CardContext = createContext<CardContextValue>({\n current: false,\n labels: DEFAULT_WORKSPACE_CARD_LABELS,\n})\n\ntype DivProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>\n\n/* ------------------------------------------------------------------ */\n/* Parts */\n/* ------------------------------------------------------------------ */\n\nexport interface WorkspaceCardRootProps extends DivProps {\n /** This is the workspace you are in: accented surface, \"Current workspace\" cue. */\n current?: boolean\n onSelect: () => void\n /**\n * Real link target. The tile then renders as an anchor (ctrl-click / new tab, in-SPA through\n * the host environment's `linkComponent`); `onSelect` still fires on a plain click.\n */\n href?: string\n /** Accessible name; defaults to `labels.openWorkspace(name)` when composed via `WorkspaceCard`. */\n label: string\n testId?: string\n labels?: Partial<WorkspaceCardLabels>\n children: ReactNode\n}\n\n/**\n * The tile surface: one button that opens the workspace. A raised white card\n * (hairline border, soft shadow, hover lift); the current workspace takes the selection tint.\n */\nfunction WorkspaceCardRoot({\n current = false,\n onSelect,\n href,\n label,\n testId,\n labels,\n className,\n children,\n ...rest\n}: WorkspaceCardRootProps) {\n const mergedLabels = useMemo(() => ({ ...DEFAULT_WORKSPACE_CARD_LABELS, ...labels }), [labels])\n const surfaceClass = cn(\n '@container/ws-card flex min-h-40 w-full cursor-pointer flex-col gap-3 rounded-lg p-4 text-left transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n current\n ? 'bg-accent text-accent-foreground'\n : 'border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40',\n className\n )\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n onSelect()\n }\n }\n return (\n <CardContext.Provider value={{ current, testId, labels: mergedLabels }}>\n {href ? (\n <ActionLink\n {...(rest as object)}\n href={href}\n onSelect={onSelect}\n aria-label={label}\n aria-current={current ? 'page' : undefined}\n data-slot=\"workspace-card\"\n data-testid={testId}\n data-active={current || undefined}\n className={surfaceClass}\n >\n {children}\n </ActionLink>\n ) : (\n <div\n {...rest}\n role=\"button\"\n tabIndex={0}\n aria-label={label}\n aria-current={current ? 'page' : undefined}\n data-slot=\"workspace-card\"\n data-testid={testId}\n data-active={current || undefined}\n onClick={onSelect}\n onKeyDown={handleKeyDown}\n className={surfaceClass}\n >\n {children}\n </div>\n )}\n </CardContext.Provider>\n )\n}\n\n/** Mark + name + open cue, on one row. Put the entity mark first. */\nfunction WorkspaceCardHeader({ className, children, ...rest }: DivProps & { children: ReactNode }) {\n return (\n <div\n {...rest}\n className={cn('flex flex-wrap items-center gap-x-3 gap-y-2', className)}\n data-slot=\"workspace-card-header\"\n >\n {children}\n </div>\n )\n}\n\nfunction WorkspaceCardTitle({ children, className }: { children: ReactNode; className?: string }) {\n const { testId } = useContext(CardContext)\n return (\n <h3\n className={cn(\n 'line-clamp-2 min-w-24 flex-1 break-words text-base font-semibold leading-tight text-foreground',\n className\n )}\n data-slot=\"workspace-card-title\"\n data-testid={testId && `${testId}-title`}\n >\n {children}\n </h3>\n )\n}\n\n/**\n * The open cue is always on screen (never hover-only): a chevron, or the words\n * \"Current workspace\" on the one you are in.\n */\nfunction WorkspaceCardOpenCue({\n testId,\n currentLabel,\n}: {\n /** Deliberately separate from the card id: suites count cards by prefix. */\n testId?: string\n /** Overrides `labels.currentWorkspace`. */\n currentLabel?: string\n}) {\n const { current, labels } = useContext(CardContext)\n return (\n <span\n className=\"inline-flex max-w-full min-w-0 shrink-0 items-center text-sm text-muted-foreground\"\n data-slot=\"workspace-card-open-cue\"\n data-testid={testId}\n >\n {current ? (\n // Never wider than the card: the words truncate, and in a card narrower than 20rem\n // the pill shrinks to a check (the words stay as the accessible name).\n <span className=\"inline-flex max-w-full min-w-0 items-center gap-1 rounded-full bg-background px-2 py-0.5 text-xs font-medium text-foreground\">\n <Check className=\"hidden size-3 shrink-0 @max-xs/ws-card:block\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate @max-xs/ws-card:sr-only\">\n {currentLabel ?? labels.currentWorkspace}\n </span>\n </span>\n ) : (\n <ChevronRight className=\"size-4\" aria-hidden=\"true\" />\n )}\n </span>\n )\n}\n\nfunction WorkspaceCardDescription({\n children,\n className,\n}: {\n children: ReactNode\n className?: string\n}) {\n return (\n <p\n className={cn('line-clamp-2 text-sm text-muted-foreground', className)}\n title={typeof children === 'string' ? children : undefined}\n data-slot=\"workspace-card-description\"\n >\n {children}\n </p>\n )\n}\n\n/** Host-supplied line under the title. */\nfunction WorkspaceCardSubtitle({\n className,\n children,\n ...rest\n}: DivProps & { children: ReactNode }) {\n return (\n <div\n {...rest}\n className={cn('truncate text-xs text-muted-foreground', className)}\n data-slot=\"workspace-card-subtitle\"\n >\n {children}\n </div>\n )\n}\n\n/** Footer block: stats row and meta line, pinned to the bottom of the tile. */\nfunction WorkspaceCardFooter({ className, children, ...rest }: DivProps & { children: ReactNode }) {\n return (\n <div {...rest} className={cn('mt-auto flex flex-col gap-2', className)}>\n {children}\n </div>\n )\n}\n\nexport interface WorkspaceCardStatsProps {\n docCount: number\n /** Omit to hide the chats counter. */\n chatCount?: number\n memberCount: number\n members?: StackedMember[]\n membersHidden?: boolean\n /** Faces before the rest collapse into `+N`. */\n maxAvatars?: number\n className?: string\n}\n\n/** Documents / chats / members counts, with the member faces at the trailing edge. */\nfunction WorkspaceCardStats({\n docCount,\n chatCount,\n memberCount,\n members = [],\n membersHidden = false,\n maxAvatars = 3,\n className,\n}: WorkspaceCardStatsProps) {\n const { current, testId, labels } = useContext(CardContext)\n return (\n <div\n className={cn('flex w-full items-center gap-x-4 text-sm text-muted-foreground', className)}\n data-slot=\"workspace-card-stats\"\n >\n <span className=\"inline-flex items-center gap-1.5\" title={labels.documents}>\n <FileText className=\"size-4\" aria-hidden=\"true\" />\n <span className=\"tabular-nums\">{docCount.toLocaleString()}</span>\n </span>\n {chatCount !== undefined && (\n <span className=\"inline-flex items-center gap-1.5\" title={labels.chats}>\n <MessagesSquare className=\"size-4\" aria-hidden=\"true\" />\n <span className=\"tabular-nums\">{chatCount.toLocaleString()}</span>\n </span>\n )}\n <span className=\"inline-flex items-center gap-1.5\" title={labels.members}>\n <Users className=\"size-4\" aria-hidden=\"true\" />\n <span className=\"tabular-nums\" data-testid={testId && `${testId}-member-count`}>\n {membersHidden ? '—' : memberCount}\n </span>\n </span>\n <MemberAvatarStack\n members={members}\n total={memberCount}\n max={maxAvatars}\n hidden={membersHidden}\n ringClassName={current ? 'ring-accent' : 'ring-muted'}\n label={labels.members}\n className=\"ml-auto\"\n testId={testId && `${testId}-member-avatars`}\n />\n </div>\n )\n}\n\n/** \"Updated 3 days ago\", with the exact date on the title. */\nfunction WorkspaceCardMeta({ updatedAt }: { updatedAt: string }) {\n const { labels } = useContext(CardContext)\n return (\n <span\n className=\"min-w-0 max-w-full self-start truncate text-xs text-muted-foreground\"\n title={fmtDate(updatedAt)}\n data-slot=\"workspace-card-meta\"\n >\n {labels.updated(formatRelativeTime(updatedAt))}\n </span>\n )\n}\n\n/* ------------------------------------------------------------------ */\n/* Default composition */\n/* ------------------------------------------------------------------ */\n\nexport interface WorkspaceCardProps {\n workspace: WorkspaceSummary\n current?: boolean\n onSelect: () => void\n /** Real link target; see `WorkspaceCard.Root`. */\n href?: string\n /** The entity mark shown before the name (the host's own workspace glyph). */\n mark?: ReactNode\n /** Card id; derived ids: `-title`, `-member-count`, `-member-avatars`. */\n testId?: string\n /** Id for the open cue (kept apart from `testId`, see `WorkspaceCard.OpenCue`). */\n openCueTestId?: string\n maxAvatars?: number\n /**\n * The stats row: omit for the default counts + member faces, `false` to hide it, or any node to\n * replace it.\n */\n stats?: ReactNode | false\n /** Reword the tile's fixed strings. */\n labels?: Partial<WorkspaceCardLabels>\n className?: string\n}\n\n/**\n * The workspace tile: mark + name + open cue, description, stats and meta.\n * The whole tile opens the workspace; nothing on it is hover-only.\n *\n * Need a different layout? Compose the parts: `WorkspaceCard.Root`, `.Header`,\n * `.Title`, `.OpenCue`, `.Subtitle`, `.Description`, `.Footer`, `.Stats`, `.Meta`.\n */\nfunction WorkspaceCardBase({\n workspace,\n current = false,\n onSelect,\n href,\n mark,\n testId,\n openCueTestId,\n maxAvatars,\n stats,\n labels,\n className,\n}: WorkspaceCardProps) {\n const mergedLabels = { ...DEFAULT_WORKSPACE_CARD_LABELS, ...labels }\n return (\n <WorkspaceCardRoot\n current={current}\n onSelect={onSelect}\n href={href}\n label={mergedLabels.openWorkspace(workspace.name)}\n labels={labels}\n testId={testId}\n className={className}\n >\n <WorkspaceCardHeader>\n {mark}\n <WorkspaceCardTitle>{workspace.name}</WorkspaceCardTitle>\n <WorkspaceCardOpenCue testId={openCueTestId} />\n </WorkspaceCardHeader>\n {workspace.subtitle && <WorkspaceCardSubtitle>{workspace.subtitle}</WorkspaceCardSubtitle>}\n {workspace.description && (\n <WorkspaceCardDescription>{workspace.description}</WorkspaceCardDescription>\n )}\n <WorkspaceCardFooter>\n {stats === undefined ? (\n <WorkspaceCardStats\n docCount={workspace.docCount}\n chatCount={workspace.chatCount}\n memberCount={workspace.memberCount}\n members={workspace.members}\n membersHidden={workspace.membersHidden}\n maxAvatars={maxAvatars}\n />\n ) : (\n stats\n )}\n {workspace.updatedAt && <WorkspaceCardMeta updatedAt={workspace.updatedAt} />}\n </WorkspaceCardFooter>\n </WorkspaceCardRoot>\n )\n}\n\nexport const WorkspaceCard = Object.assign(WorkspaceCardBase, {\n Root: WorkspaceCardRoot,\n Header: WorkspaceCardHeader,\n Title: WorkspaceCardTitle,\n OpenCue: WorkspaceCardOpenCue,\n Subtitle: WorkspaceCardSubtitle,\n Description: WorkspaceCardDescription,\n Footer: WorkspaceCardFooter,\n Stats: WorkspaceCardStats,\n Meta: WorkspaceCardMeta,\n})\n","import type { ReactNode } from 'react'\nimport { ChevronRight } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { CollapsibleSection } from '../home/CollapsibleSection'\n\nexport interface WorkspaceListProps {\n children: ReactNode\n className?: string\n testId?: string\n}\n\n/** The column that stacks workspace groups (padding follows the page gutter). */\nexport function WorkspaceList({ children, className, testId }: WorkspaceListProps) {\n return (\n <div\n className={cn('flex w-full flex-col gap-2 px-4 py-4 sm:px-8', className)}\n data-slot=\"workspace-list\"\n data-testid={testId}\n >\n {children}\n </div>\n )\n}\n\nexport interface WorkspaceGroupProps {\n /** Group heading: name, count, badges. Plain text on the canvas, no band. */\n title: ReactNode\n isExpanded: boolean\n onToggle: () => void\n /**\n * Makes the whole header one target (e.g. open the project panel); the\n * chevron stays a separate toggle. Adds a trailing `openLabel` affordance.\n */\n onOpen?: () => void\n /** Words beside the trailing chevron when `onOpen` is set, e.g. \"Plans & Usage\". */\n openLabel?: string\n /** Muted words on the right of a collapsed group without `onOpen`, e.g. \"Show 11 shared workspaces\". */\n collapsedHint?: string\n /** The cards, laid out in a responsive grid (1 / 2 / 3 columns). */\n children: ReactNode\n className?: string\n}\n\n/**\n * One collapsible band of workspace tiles under a slim header. The open\n * affordance is always visible, so nothing is reachable by hover alone.\n */\nexport function WorkspaceGroup({\n title,\n isExpanded,\n onToggle,\n onOpen,\n openLabel,\n collapsedHint,\n children,\n className,\n}: WorkspaceGroupProps) {\n return (\n <CollapsibleSection\n title={title}\n isExpanded={isExpanded}\n onToggle={onToggle}\n onHeaderClick={onOpen}\n rightContent={\n onOpen && openLabel ? (\n <span className=\"flex shrink-0 items-center gap-1 text-sm font-medium text-muted-foreground\">\n {openLabel}\n <ChevronRight className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n </span>\n ) : collapsedHint && !isExpanded ? (\n <span className=\"shrink-0 text-sm text-muted-foreground\">{collapsedHint}</span>\n ) : undefined\n }\n className={cn('group', className)}\n headerClassName=\"mb-3 flex-wrap gap-y-2 rounded-md px-1 py-1 pointer-coarse:min-h-11\"\n childrenClassName=\"mb-8 grid gap-3 @xl:grid-cols-2 @5xl:grid-cols-3\"\n >\n {children}\n </CollapsibleSection>\n )\n}\n","/**\n * WorkspaceTypeBadge: a workspace's type badge (private, shared or public: icon, colour, label).\n */\n\nimport { User, Users, Globe } from 'lucide-react'\nimport type { components } from '@arbidocs/client'\nimport { WorkspaceTypeBadgeView } from './WorkspaceBadges'\nimport { getHumanUserCount, getVariantBgClass, getWorkspaceTypeInfo } from './workspace-type'\n\ntype Workspace = Pick<components['schemas']['WorkspaceResponse'], 'is_public' | 'users'>\n\nexport interface WorkspaceTypeBadgeProps {\n workspace: Workspace\n showTooltip?: boolean\n size?: 'sm' | 'md'\n isSelected?: boolean\n className?: string\n}\n\nexport function WorkspaceTypeBadge({\n workspace,\n showTooltip = false,\n size = 'md',\n isSelected = false,\n className,\n}: WorkspaceTypeBadgeProps) {\n const userCount = getHumanUserCount(workspace.users)\n const { type, variant } = getWorkspaceTypeInfo(workspace.is_public, userCount)\n const icon = workspace.is_public ? Globe : userCount > 1 ? Users : User\n\n return (\n <WorkspaceTypeBadgeView\n icon={icon}\n bgClass={getVariantBgClass(variant)}\n typeLabel={type}\n showTooltip={showTooltip}\n size={size}\n isSelected={isSelected}\n className={className}\n />\n )\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkJGCYM3II_cjs = require('./chunk-JGCYM3II.cjs');
|
|
5
5
|
var chunk5H37UWWS_cjs = require('./chunk-5H37UWWS.cjs');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
|
|
@@ -9,10 +9,10 @@ function ConnectedStreamedWordArtifact({
|
|
|
9
9
|
fontBaseUrl,
|
|
10
10
|
...props
|
|
11
11
|
}) {
|
|
12
|
-
const adapter =
|
|
12
|
+
const adapter = chunkJGCYM3II_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
|
|
13
13
|
return /* @__PURE__ */ jsxRuntime.jsx(chunk5H37UWWS_cjs.StreamedWordArtifact, { ...props, adapter });
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
exports.ConnectedStreamedWordArtifact = ConnectedStreamedWordArtifact;
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-3FQHFFV5.cjs.map
|
|
18
|
+
//# sourceMappingURL=chunk-3FQHFFV5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/docx/ConnectedStreamedWordArtifact.tsx"],"names":["useConnectedNativeDocxAdapter","jsx","StreamedWordArtifact"],"mappings":";;;;;;AAMO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0E;AACxE,EAAA,MAAM,OAAA,GAAUA,gDAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOC,cAAA,CAACC,sCAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AAC5D","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/connection/docx/ConnectedStreamedWordArtifact.tsx"],"names":["useConnectedNativeDocxAdapter","jsx","StreamedWordArtifact"],"mappings":";;;;;;AAMO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0E;AACxE,EAAA,MAAM,OAAA,GAAUA,gDAA8B,WAAW,CAAA;AACzD,EAAA,uBAAOC,cAAA,CAACC,sCAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AAC5D","file":"chunk-3FQHFFV5.cjs","sourcesContent":["import { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\nimport {\n StreamedWordArtifact,\n type StreamedWordArtifactProps,\n} from '../../docx/StreamedWordArtifact'\n\nexport function ConnectedStreamedWordArtifact({\n fontBaseUrl,\n ...props\n}: Omit<StreamedWordArtifactProps, 'adapter'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <StreamedWordArtifact {...props} adapter={adapter} />\n}\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { loadDocxFonts, isCandidate } from './chunk-MTSKK3BN.js';
|
|
3
3
|
import { NativeDocxEditor, contentPath, builtinHouseTemplate } from './chunk-LU23I2HS.js';
|
|
4
|
-
import { buildWorkflowScopeSource, documentScopeLabels, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, workflowTriggerType } from './chunk-
|
|
5
|
-
import { DocumentPicker } from './chunk-WNDIVNPT.js';
|
|
4
|
+
import { buildWorkflowScopeSource, documentScopeLabels, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, workflowTriggerType } from './chunk-GA2A7OX6.js';
|
|
6
5
|
import { useListedDocuments, useConnectedTags, useConnectedConversations } from './chunk-DHPEUC6H.js';
|
|
7
6
|
import { useConnectedWorkspace } from './chunk-RRIXIUYD.js';
|
|
8
7
|
import { useHost } from './chunk-T4P237N6.js';
|
|
9
8
|
import { fmtDate } from './chunk-5VYJP6XD.js';
|
|
10
9
|
import { parseDeepLinkPath, buildDeepLinkUrl } from './chunk-7Q5INDUS.js';
|
|
11
10
|
import { useBlocksEnvironment } from './chunk-GRT4EH76.js';
|
|
11
|
+
import { DocumentPicker } from './chunk-WNDIVNPT.js';
|
|
12
12
|
import { useMemo, useRef, useState, useCallback, useEffect } from 'react';
|
|
13
13
|
import { useQueryClient } from '@tanstack/react-query';
|
|
14
14
|
import { useAgents, useUploadDocuments, useThumbnails, useWorkspaceUsers, useWorkflows, useUpdateWorkflow, useDeleteWorkflow, useRunWorkflow, useArbi, refreshDocuments, useSetWorkspaceHouseTemplate, useWorkspaces, supportsHouseTemplates, workspaceHouseTemplateId, useHouseTemplateCandidates } from '@arbidocs/react';
|
|
@@ -551,5 +551,5 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
|
551
551
|
}
|
|
552
552
|
|
|
553
553
|
export { ConnectedNativeDocxEditor, ConnectedWorkflowDocumentsField, ConnectedWorkflowLauncher, ConnectedWorkflowsTable, DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, toWorkflowFieldDocument, useConnectedAgentOptions, useConnectedNativeDocxAdapter, useConnectedWorkflowScopeSource, useConnectedWorkspaceRole, useDocxCommentTarget, useNativeDocxSupport };
|
|
554
|
-
//# sourceMappingURL=chunk-
|
|
555
|
-
//# sourceMappingURL=chunk-
|
|
554
|
+
//# sourceMappingURL=chunk-3OATYBZK.js.map
|
|
555
|
+
//# sourceMappingURL=chunk-3OATYBZK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useMemo","jsx","useRef","useAgents","useState","useArbi","jsxs","useWorkspaceUsers"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAO,OAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,CAAC,CAAA;AAG9E,SAAS,wBAAwB,GAAA,EAA+C;AAErF,EAAA,MAAM,UAAU,gBAAA,CAAiB,GAAA,CAAA,CAAK,IAAI,SAAA,IAAa,EAAA,EAAI,aAAa,CAAA;AACxE,EAAA,OAAO;AAAA,IACL,IAAI,GAAA,CAAI,WAAA;AAAA,IACR,OAAO,GAAA,CAAI,YAAA,EAAc,KAAA,IAAS,GAAA,CAAI,aAAa,GAAA,CAAI,WAAA;AAAA,IACvD,UAAU,GAAA,CAAI,SAAA;AAAA,IACd,KAAA,EAAO,OAAA,GAAU,IAAA,GAAQ,GAAA,CAAI,OAAA,IAAW,I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A,EAAgB,kBAAA,EAAmB;AAAA,UAC9C,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,YACnB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,aAAa,OAAA,CAAQ,WAAA;AAAA,YACrB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,eAAe,OAAA,CAAQ;AAAA,WACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-AAVFCPKD.js","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedTags, useListedDocuments, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useListedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useListedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useMemo","jsx","useRef","useAgents","useState","useArbi","jsxs","useWorkspaceUsers"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAO,OAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,CAAC,CAAA;AAG9E,SAAS,wBAAwB,GAAA,EAA+C;AAErF,EAAA,MAAM,UAAU,gBAAA,CAAiB,GAAA,CAAA,CAAK,IAAI,SAAA,IAAa,EAAA,EAAI,aAAa,CAAA;AACxE,EAAA,OAAO;AAAA,IACL,IAAI,GAAA,CAAI,WAAA;AAAA,IACR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,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,MAAA,CAAO,QAAQ,CAAA,CAAA,EAAI,kBAAA,CAAmB,EAAE,CAAC,CAAA,SAAA,CAAA,EAAa;AAAA,UAChF,MAAA,EAAQ,MAAA;AAAA,UACR,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA,EAAmB;AAAA,UAC9C,IAAA,EAAM,KAAK,SAAA,CAAU;AAAA,YACnB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,aAAa,OAAA,CAAQ,WAAA;AAAA,YACrB,YAAY,OAAA,CAAQ,SAAA;AAAA,YACpB,eAAe,OAAA,CAAQ;AAAA,WACxB;AAAA,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-3OATYBZK.js","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedTags, useListedDocuments, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useListedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useListedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useConnectedNativeDocxAdapter } from './chunk-
|
|
2
|
+
import { useConnectedNativeDocxAdapter } from './chunk-3OATYBZK.js';
|
|
3
3
|
import { StreamedWordArtifact } from './chunk-Z6CAKLA5.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -12,5 +12,5 @@ function ConnectedStreamedWordArtifact({
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export { ConnectedStreamedWordArtifact };
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-4I2V55LL.js.map
|
|
16
|
+
//# sourceMappingURL=chunk-4I2V55LL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/docx/ConnectedStreamedWordArtifact.tsx"],"names":[],"mappings":";;;;AAMO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0E;AACxE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,uBAAO,GAAA,CAAC,oBAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AAC5D","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/connection/docx/ConnectedStreamedWordArtifact.tsx"],"names":[],"mappings":";;;;AAMO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0E;AACxE,EAAA,MAAM,OAAA,GAAU,8BAA8B,WAAW,CAAA;AACzD,EAAA,uBAAO,GAAA,CAAC,oBAAA,EAAA,EAAsB,GAAG,KAAA,EAAO,OAAA,EAAkB,CAAA;AAC5D","file":"chunk-4I2V55LL.js","sourcesContent":["import { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\nimport {\n StreamedWordArtifact,\n type StreamedWordArtifactProps,\n} from '../../docx/StreamedWordArtifact'\n\nexport function ConnectedStreamedWordArtifact({\n fontBaseUrl,\n ...props\n}: Omit<StreamedWordArtifactProps, 'adapter'> & { fontBaseUrl?: string }) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n return <StreamedWordArtifact {...props} adapter={adapter} />\n}\n"]}
|