@arbidocs/blocks 0.5.44 → 0.5.45

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.
Files changed (73) hide show
  1. package/dist/{ConnectedNativeDocxComparison-4DYPHNY2.js → ConnectedNativeDocxComparison-52KQKJGY.js} +6 -6
  2. package/dist/{ConnectedNativeDocxComparison-4DYPHNY2.js.map → ConnectedNativeDocxComparison-52KQKJGY.js.map} +1 -1
  3. package/dist/{ConnectedNativeDocxComparison-OZE2SPNU.cjs → ConnectedNativeDocxComparison-UVLZGS2V.cjs} +7 -7
  4. package/dist/{ConnectedNativeDocxComparison-OZE2SPNU.cjs.map → ConnectedNativeDocxComparison-UVLZGS2V.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxEditor-F3EHJKDI.js → ConnectedNativeDocxEditor-BRBL3MOV.js} +5 -5
  6. package/dist/{ConnectedNativeDocxEditor-F3EHJKDI.js.map → ConnectedNativeDocxEditor-BRBL3MOV.js.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-MUM6YRPY.cjs → ConnectedNativeDocxEditor-KHR5I7W6.cjs} +7 -7
  8. package/dist/{ConnectedNativeDocxEditor-MUM6YRPY.cjs.map → ConnectedNativeDocxEditor-KHR5I7W6.cjs.map} +1 -1
  9. package/dist/{ConnectedStreamedWordArtifact-F6M766FG.cjs → ConnectedStreamedWordArtifact-DSVFI7BX.cjs} +7 -7
  10. package/dist/ConnectedStreamedWordArtifact-DSVFI7BX.cjs.map +1 -0
  11. package/dist/{ConnectedStreamedWordArtifact-XUWLRRG5.js → ConnectedStreamedWordArtifact-EQUE6WT5.js} +6 -6
  12. package/dist/{ConnectedStreamedWordArtifact-XUWLRRG5.js.map → ConnectedStreamedWordArtifact-EQUE6WT5.js.map} +1 -1
  13. package/dist/WorkspaceTableView-2CGEO5KK.cjs +1 -1
  14. package/dist/WorkspaceTableView-3ARFQYNO.js +1 -1
  15. package/dist/agents/definitions/agentTasks.d.ts +4 -0
  16. package/dist/agents/definitions/index.d.ts +1 -0
  17. package/dist/agents/index.cjs +330 -326
  18. package/dist/agents/index.js +4 -4
  19. package/dist/{chunk-T5BCPKU3.cjs → chunk-2QDNQM63.cjs} +3 -3
  20. package/dist/{chunk-T5BCPKU3.cjs.map → chunk-2QDNQM63.cjs.map} +1 -1
  21. package/dist/{chunk-3GHFTAOV.cjs → chunk-3YZ3RUSB.cjs} +4 -4
  22. package/dist/{chunk-3GHFTAOV.cjs.map → chunk-3YZ3RUSB.cjs.map} +1 -1
  23. package/dist/{chunk-JS7KJRKG.js → chunk-75Z5AUMM.js} +3 -3
  24. package/dist/{chunk-JS7KJRKG.js.map → chunk-75Z5AUMM.js.map} +1 -1
  25. package/dist/{chunk-VE6DHRXD.js → chunk-7CHI36EP.js} +3 -3
  26. package/dist/{chunk-VE6DHRXD.js.map → chunk-7CHI36EP.js.map} +1 -1
  27. package/dist/{chunk-CG7EYB3J.js → chunk-EFDZRAW6.js} +3 -3
  28. package/dist/{chunk-CG7EYB3J.js.map → chunk-EFDZRAW6.js.map} +1 -1
  29. package/dist/{chunk-FKFGP7MQ.cjs → chunk-ET42AFEJ.cjs} +31 -18
  30. package/dist/chunk-ET42AFEJ.cjs.map +1 -0
  31. package/dist/{chunk-QPDQYZIR.cjs → chunk-K53QRFPJ.cjs} +4 -4
  32. package/dist/{chunk-QPDQYZIR.cjs.map → chunk-K53QRFPJ.cjs.map} +1 -1
  33. package/dist/{chunk-GUV63FUC.cjs → chunk-O3MRE2HL.cjs} +11 -11
  34. package/dist/{chunk-GUV63FUC.cjs.map → chunk-O3MRE2HL.cjs.map} +1 -1
  35. package/dist/{chunk-TOP5BMS7.js → chunk-OQMWTEM2.js} +16 -4
  36. package/dist/chunk-OQMWTEM2.js.map +1 -0
  37. package/dist/{chunk-H6UK6LGL.js → chunk-REHG7VRQ.js} +4 -4
  38. package/dist/{chunk-H6UK6LGL.js.map → chunk-REHG7VRQ.js.map} +1 -1
  39. package/dist/{chunk-PV5A5SAC.cjs → chunk-TPNLYQD2.cjs} +5 -5
  40. package/dist/{chunk-PV5A5SAC.cjs.map → chunk-TPNLYQD2.cjs.map} +1 -1
  41. package/dist/{chunk-QWSAJNQE.cjs → chunk-UZVXVTTB.cjs} +9 -9
  42. package/dist/{chunk-QWSAJNQE.cjs.map → chunk-UZVXVTTB.cjs.map} +1 -1
  43. package/dist/{chunk-G5JENSLN.js → chunk-WAIHNFUH.js} +3 -3
  44. package/dist/{chunk-G5JENSLN.js.map → chunk-WAIHNFUH.js.map} +1 -1
  45. package/dist/{chunk-T6KAZPOZ.js → chunk-X7CXCEGO.js} +3 -3
  46. package/dist/{chunk-T6KAZPOZ.js.map → chunk-X7CXCEGO.js.map} +1 -1
  47. package/dist/{chunk-EY4IEOW3.js → chunk-YAGSGBVM.js} +3 -3
  48. package/dist/{chunk-EY4IEOW3.js.map → chunk-YAGSGBVM.js.map} +1 -1
  49. package/dist/{chunk-F72ZD5Q2.cjs → chunk-YD3RN2FY.cjs} +3 -3
  50. package/dist/{chunk-F72ZD5Q2.cjs.map → chunk-YD3RN2FY.cjs.map} +1 -1
  51. package/dist/connect/docx.cjs +9 -9
  52. package/dist/connect/docx.js +5 -5
  53. package/dist/connect/index.cjs +367 -296
  54. package/dist/connect/index.cjs.map +1 -1
  55. package/dist/connect/index.d.ts +1 -0
  56. package/dist/connect/index.js +81 -11
  57. package/dist/connect/index.js.map +1 -1
  58. package/dist/connect/viewer.cjs +3 -3
  59. package/dist/connect/viewer.js +3 -3
  60. package/dist/connection/agents/useConnectedAgentManagement.d.ts +60 -0
  61. package/dist/facts/index.cjs +55 -55
  62. package/dist/facts/index.js +3 -3
  63. package/dist/index.cjs +388 -384
  64. package/dist/index.js +5 -5
  65. package/dist/settings/index.cjs +1 -1
  66. package/dist/settings/index.js +1 -1
  67. package/dist/workflow-canvas/index.cjs +17 -17
  68. package/dist/workflow-canvas/index.js +4 -4
  69. package/node_modules/@arbidocs/coedit/package.json +1 -1
  70. package/package.json +5 -5
  71. package/dist/ConnectedStreamedWordArtifact-F6M766FG.cjs.map +0 -1
  72. package/dist/chunk-FKFGP7MQ.cjs.map +0 -1
  73. package/dist/chunk-TOP5BMS7.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useWorkflowView, SkillTypeBadge, SkillGlobalBadge, SkillActionButton, activateOnKey } from './chunk-EY4IEOW3.js';
2
+ import { useWorkflowView, SkillTypeBadge, SkillGlobalBadge, SkillActionButton, activateOnKey } from './chunk-YAGSGBVM.js';
3
3
  import { ActionLink } from './chunk-73DANGPH.js';
4
4
  import { EmptyState } from './chunk-P6GHJSLR.js';
5
5
  import { workflowSteps, initialRunInputs, stepPhase, composeStepPrompt } from './chunk-THNTNAYI.js';
@@ -298,6 +298,18 @@ function AgentGallery({
298
298
  )
299
299
  ] });
300
300
  }
301
+
302
+ // src/agents/definitions/agentTasks.ts
303
+ function groupAgentTasks(tasks) {
304
+ const grouped = /* @__PURE__ */ new Map();
305
+ for (const task of tasks) {
306
+ if (!task.agent_ext_id) continue;
307
+ const assigned = grouped.get(task.agent_ext_id);
308
+ if (assigned) assigned.push(task);
309
+ else grouped.set(task.agent_ext_id, [task]);
310
+ }
311
+ return grouped;
312
+ }
301
313
  var DEFAULT_SKILL_CARD_LABELS = {
302
314
  global: "Global",
303
315
  globalTitle: "Shared with everyone in the marketplace",
@@ -492,6 +504,6 @@ function SkillRow({
492
504
  );
493
505
  }
494
506
 
495
- export { AgentCard, AgentGallery, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_ROW_LABELS, SkillCard, SkillRow, useWorkflowPreview };
496
- //# sourceMappingURL=chunk-TOP5BMS7.js.map
497
- //# sourceMappingURL=chunk-TOP5BMS7.js.map
507
+ export { AgentCard, AgentGallery, DEFAULT_AGENT_CARD_LABELS, DEFAULT_AGENT_GALLERY_LABELS, DEFAULT_SKILL_CARD_LABELS, DEFAULT_SKILL_ROW_LABELS, SkillCard, SkillRow, groupAgentTasks, useWorkflowPreview };
508
+ //# sourceMappingURL=chunk-OQMWTEM2.js.map
509
+ //# sourceMappingURL=chunk-OQMWTEM2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agents/workflows/useWorkflowPreview.ts","../src/agents/definitions/AgentCard.tsx","../src/agents/definitions/AgentGallery.tsx","../src/agents/definitions/agentTasks.ts","../src/agents/skills/SkillCard.tsx","../src/agents/skills/SkillRow.tsx"],"names":["jsx","cn","jsxs","Button","Eye","Pencil","Lock","Globe","Trash2"],"mappings":";;;;;;;;;;;AAwBO,SAAS,kBAAA,CACd,QAAA,EACA,EAAE,MAAA,GAAS,UAAA,EAAY,OAAA,GAAU,GAAA,EAAK,eAAA,EAAiB,OAAA,EAAQ,GAA+B,EAAC,EAC9E;AACjB,EAAA,MAAM,KAAA,GAAQ,cAAc,QAAQ,CAAA;AACpC,EAAA,MAAM,CAAC,QAAQ,SAAS,CAAA,GAAI,SAAyB,MAAM,gBAAA,CAAiB,QAAQ,CAAC,CAAA;AACrF,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,QAAA,CAA4C,EAAE,CAAA;AAC1E,EAAA,MAAM,GAAA,GAAM,CAAC,EAAA,EAAY,KAAA,KAA6B,UAAU,CAAC,CAAA,MAAO,EAAE,GAAG,CAAA,EAAG,CAAC,EAAE,GAAG,OAAM,CAAE,CAAA;AAI9F,EAAA,MAAM,MAAA,GAAS,MAAA,iBAAO,IAAI,GAAA,EAA4C,CAAA;AACtE,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,UAAU,MAAA,CAAO,OAAA;AACvB,IAAA,OAAO,MAAM;AACX,MAAA,KAAA,MAAW,CAAA,IAAK,OAAA,CAAQ,MAAA,EAAO,eAAgB,CAAC,CAAA;AAChD,MAAA,OAAA,CAAQ,KAAA,EAAM;AACd,MAAA,SAAA;AAAA,QAAU,CAAC,MACT,MAAA,CAAO,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SAAA,EAAU,2BAA0B,CAAA,EAC9C;AAAA,SAAA,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-OQMWTEM2.js","sourcesContent":["/**\n * A stepped workflow run on screen only (the builder's preview): agent steps run one at a time,\n * the way the server does, and answer with the prompt they would send; action steps just finish.\n * No thread, no agent.\n */\n\nimport { useEffect, useRef, useState } from 'react'\nimport {\n composeStepPrompt,\n initialRunInputs,\n stepPhase,\n workflowSteps,\n type StepComposeOptions,\n} from './run'\nimport type { WorkflowDefinition, WorkflowInputs, WorkflowStepState } from './types'\nimport { useWorkflowView, type WorkflowRunView } from './useWorkflowView'\n\nexport interface UseWorkflowPreviewOptions extends StepComposeOptions {\n /** What a stand-in agent step answers; `{prompt}` is replaced with the prompt it would send. */\n answer?: string\n /** How long a stand-in step takes. */\n delayMs?: number\n}\n\nexport function useWorkflowPreview(\n workflow: WorkflowDefinition,\n { answer = '{prompt}', delayMs = 400, resolveWorkflow, compose }: UseWorkflowPreviewOptions = {}\n): WorkflowRunView {\n const steps = workflowSteps(workflow)\n const [inputs, setInputs] = useState<WorkflowInputs>(() => initialRunInputs(workflow))\n const [states, setStates] = useState<Record<string, WorkflowStepState>>({})\n const set = (id: string, state: WorkflowStepState) => setStates((s) => ({ ...s, [id]: state }))\n\n // A stand-in step's timer outlives the re-render its start causes; it is cleared on unmount, and\n // a step it cut short starts again (StrictMode mounts twice).\n const timers = useRef(new Map<string, ReturnType<typeof setTimeout>>())\n useEffect(() => {\n const pending = timers.current\n return () => {\n for (const t of pending.values()) clearTimeout(t)\n pending.clear()\n setStates((s) =>\n Object.fromEntries(\n Object.entries(s).map(([id, v]) => [\n id,\n v.status === 'running' ? { status: 'pending' } : v,\n ])\n )\n )\n }\n }, [])\n\n // One turn at a time: start the first ready agent step when nothing is running.\n useEffect(() => {\n if (Object.values(states).some((s) => s.status === 'running')) return\n // An action step (a signature, an email, a review) stands in the same way, with no answer.\n const next = steps.find(\n (s) =>\n (s.kind === 'agent' || s.kind === 'action') && stepPhase(steps, states, s.id) === 'ready'\n )\n if (!next || (next.kind !== 'agent' && next.kind !== 'action')) return\n const prompt =\n next.kind === 'agent'\n ? composeStepPrompt(workflow, next, inputs, { resolveWorkflow, compose })\n : ''\n set(next.id, { status: 'running', startedAt: new Date().toISOString() })\n timers.current.set(\n next.id,\n setTimeout(() => {\n timers.current.delete(next.id)\n set(\n next.id,\n next.kind === 'agent'\n ? { status: 'done', text: answer.replace('{prompt}', prompt) }\n : { status: 'done' }\n )\n }, delayMs)\n )\n // `inputs` are read when a step starts, not watched.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [states, steps, workflow])\n\n return useWorkflowView({\n steps,\n states,\n inputs,\n setInput: (name, value) => setInputs((i) => ({ ...i, [name]: value })),\n complete: async (step) => set(step.id, { status: 'done' }),\n skip: async (id) => set(id, { status: 'skipped' }),\n retry: async (id) => set(id, { status: 'pending' }),\n isLocked: (id) => states[id]?.status === 'done',\n })\n}\n","import type { HTMLAttributes, ReactNode } from 'react'\nimport { ClipboardList, Copy, Eye, MessageSquare, Pencil, Trash2 } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../../components/ActionLink'\nimport { testIdOr } from '../../chat/test-id'\nimport { formatCount } from '../../lib/format'\n\nexport interface AgentCardLabels {\n running: string\n /** Pulse indicator aria-label. */\n runningIndicator: string\n /** Chip text; receives the running count. */\n runningCount: (count: number) => string\n /** Chip text; receives the task count (0 -> none yet). */\n taskCount: (count: number) => string\n goalMet: (met: number, total: number) => string\n watch: string\n message: string\n assignTask: string\n edit: string\n copyAddress: string\n deleteAgent: (name: string) => string\n}\n\nexport const DEFAULT_AGENT_CARD_LABELS: AgentCardLabels = {\n running: 'Running',\n runningIndicator: 'Running',\n runningCount: (count) => `${count} running`,\n taskCount: (count) =>\n count > 0 ? formatCount(count, { one: 'task', other: 'tasks' }) : 'no tasks yet',\n goalMet: (met, total) => `✓ ${met}/${total} met`,\n watch: 'Watch',\n message: 'Message',\n assignTask: 'Assign task',\n edit: 'Edit',\n copyAddress: 'Copy address',\n deleteAgent: (name) => `Delete agent ${name}`,\n}\n\nexport interface AgentCardTestIds {\n root: string\n watch: string\n message: string\n assignTask: string\n edit: string\n copyAddress: string\n delete: string\n}\n\nexport interface AgentCardProps {\n /** Display name; also the key in the test ids (`agent-card-{name}`, `agent-edit-{name}`...). */\n name: string\n /** The agent's avatar (the app supplies its entity avatar). */\n avatar: ReactNode\n /** Tasks currently running for this agent; shows a pulse + chip when > 0. */\n runningCount: number\n /** All tasks assigned to this agent. */\n taskCount: number\n /** Extra content under the chips (the app shows what the agent can access). */\n details?: ReactNode\n /** Criteria progress of the agent's most recent goal task. */\n goalProgress?: { met: number; total: number } | null\n /** When set, a Watch action opens the live run. */\n onWatch?: () => void\n /** Each action is optional: the button is omitted when its handler is absent. */\n onMessage?: () => void\n onAssignTask?: () => void\n onEdit?: () => void\n /** When set, a ghost \"Copy address\" action copies the agent's address (it is not shown raw). */\n onCopyAddress?: () => void\n onDelete?: () => void\n /**\n * Destination of the agent; the name becomes a real link. `onSelect` fires on a plain click\n * (modified clicks go to the browser).\n */\n href?: string\n onSelect?: () => void\n labels?: Partial<AgentCardLabels>\n /** Overrides for the default `agent-card-{name}` / `agent-watch-run-{name}` ... ids. */\n testIds?: Partial<AgentCardTestIds>\n testId?: string\n className?: string\n}\n\nconst ACTION = 'h-9 gap-1.5 px-2 text-sm pointer-coarse:h-11'\n\n/** One agent in the gallery: avatar, live task chips, and Watch / Assign task / Edit / Delete. */\nexport function AgentCard({\n name,\n avatar,\n runningCount,\n taskCount,\n goalProgress,\n details,\n onWatch,\n onMessage,\n onAssignTask,\n onEdit,\n onCopyAddress,\n onDelete,\n href,\n onSelect,\n labels,\n testIds,\n testId,\n className,\n ...rest\n}: AgentCardProps & Omit<HTMLAttributes<HTMLDivElement>, keyof AgentCardProps>) {\n const l = { ...DEFAULT_AGENT_CARD_LABELS, ...labels }\n return (\n <div\n {...rest}\n className={cn('rounded-lg bg-muted p-4', className)}\n data-testid={testIdOr(testId ?? testIds?.root, { testId: `agent-card-${name}` })}\n data-slot=\"agent-card\"\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"relative shrink-0\">\n {avatar}\n {runningCount > 0 && (\n <span\n className=\"absolute -right-0.5 -top-0.5 size-2.5 rounded-full bg-ai-ink\"\n role=\"img\"\n aria-label={l.runningIndicator}\n >\n <span className=\"absolute inset-0 animate-ping rounded-full bg-ai-ink opacity-60\" />\n </span>\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n {href ? (\n <ActionLink\n href={href}\n onSelect={onSelect}\n className=\"block max-w-full truncate text-left font-medium hover:underline\"\n >\n {name}\n </ActionLink>\n ) : (\n <p className=\"truncate font-medium\">{name}</p>\n )}\n <div className=\"mt-1.5 flex flex-wrap gap-1 text-xs text-muted-foreground\">\n {runningCount > 0 ? (\n <span className=\"rounded-full bg-ai-soft px-2 py-px text-ai-ink\">\n {l.runningCount(runningCount)}\n </span>\n ) : (\n <span className=\"rounded-full bg-background px-2 py-px\">\n {l.taskCount(taskCount)}\n </span>\n )}\n {goalProgress && (\n <span className=\"rounded-full bg-background px-2 py-px\">\n {l.goalMet(goalProgress.met, goalProgress.total)}\n </span>\n )}\n </div>\n {details}\n </div>\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-center gap-1 pt-1\">\n {onMessage && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={ACTION}\n onClick={onMessage}\n data-testid={testIdOr(testIds?.message, { testId: `agent-message-${name}` })}\n >\n <MessageSquare size={14} /> {l.message}\n </Button>\n )}\n {onWatch && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(ACTION, 'text-ai-ink hover:text-ai-ink')}\n onClick={onWatch}\n data-testid={testIdOr(testIds?.watch, { testId: `agent-watch-run-${name}` })}\n >\n <Eye size={14} /> {l.watch}\n </Button>\n )}\n {onAssignTask && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={ACTION}\n onClick={onAssignTask}\n data-testid={testIdOr(testIds?.assignTask, { testId: `agent-assign-task-${name}` })}\n >\n <ClipboardList size={14} /> {l.assignTask}\n </Button>\n )}\n {onEdit && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={ACTION}\n onClick={onEdit}\n data-testid={testIdOr(testIds?.edit, { testId: `agent-edit-${name}` })}\n >\n <Pencil size={14} /> {l.edit}\n </Button>\n )}\n {onCopyAddress && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(ACTION, 'text-muted-foreground')}\n onClick={onCopyAddress}\n data-testid={testIdOr(testIds?.copyAddress, { testId: `agent-copy-address-${name}` })}\n >\n <Copy size={14} /> {l.copyAddress}\n </Button>\n )}\n {onDelete && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(ACTION, 'ml-auto text-muted-foreground hover:text-red-text')}\n onClick={onDelete}\n aria-label={l.deleteAgent(name)}\n data-testid={testIdOr(testIds?.delete, { testId: `agent-delete-${name}` })}\n >\n <Trash2 size={14} />\n </Button>\n )}\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Bot, Plus, Sparkles } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../../chat/test-id'\nimport { EmptyState } from '../../components/EmptyState'\n\nexport interface AgentGalleryLabels {\n /** Intro line next to the New agent button. */\n description: string\n emptyTitle: string\n emptyDescription: string\n emptyCta: string\n newAgent: string\n}\n\nexport const DEFAULT_AGENT_GALLERY_LABELS: AgentGalleryLabels = {\n description: 'Personas that work for you, on demand.',\n emptyTitle: 'Create your first agent',\n emptyDescription:\n 'Describe a persona, pick its tools, generate an avatar, then hand it work from an agent card and watch it converge.',\n emptyCta: 'Create an agent',\n newAgent: 'New agent',\n}\n\nexport interface AgentGalleryTestIds {\n emptyCta: string\n createButton: string\n gallery: string\n}\n\nexport interface AgentGalleryProps {\n /** Number of agents; 0 shows the first-run empty state instead of the grid. */\n count: number\n onCreate: () => void\n /** The AgentCard children. */\n children?: ReactNode\n /** Intro line next to the New agent button (wins over `labels.description`). */\n description?: string\n labels?: Partial<AgentGalleryLabels>\n testIds?: Partial<AgentGalleryTestIds>\n className?: string\n}\n\n/** Agents grid with an intro row + New agent action, or a first-run empty state. */\nexport function AgentGallery({\n count,\n onCreate,\n children,\n description,\n labels,\n testIds,\n className,\n}: AgentGalleryProps) {\n const l = { ...DEFAULT_AGENT_GALLERY_LABELS, ...labels }\n if (count === 0) {\n return (\n <div className={cn('mt-8', className)}>\n <EmptyState\n className=\"rounded-lg border-0 bg-muted\"\n icon={Bot}\n title={l.emptyTitle}\n description={l.emptyDescription}\n action={\n <Button\n onClick={onCreate}\n className=\"gap-1.5\"\n data-testid={testIdOr(testIds?.emptyCta, { testId: 'agent-empty-cta' })}\n >\n <Sparkles size={16} /> {l.emptyCta}\n </Button>\n }\n />\n </div>\n )\n }\n return (\n <div className={className}>\n <div className=\"mb-4 flex flex-wrap items-center justify-between gap-x-3 gap-y-2\">\n <p className=\"min-w-0 text-sm text-muted-foreground\">{description ?? l.description}</p>\n <Button\n size=\"sm\"\n onClick={onCreate}\n className=\"h-8 gap-1.5 pointer-coarse:h-11\"\n data-testid={testIdOr(testIds?.createButton, { testId: 'agent-create-button' })}\n >\n <Plus size={16} /> {l.newAgent}\n </Button>\n </div>\n <div\n className=\"grid grid-cols-[repeat(auto-fill,minmax(16rem,1fr))] gap-4\"\n data-testid={testIdOr(testIds?.gallery, { testId: 'agent-gallery' })}\n data-slot=\"agent-gallery\"\n >\n {children}\n </div>\n </div>\n )\n}\n","/** Tasks per assigned agent, retaining server order for latest-goal/watch presentation. */\nexport function groupAgentTasks<T extends { agent_ext_id?: string | null }>(\n tasks: readonly T[]\n): Map<string, T[]> {\n const grouped = new Map<string, T[]>()\n for (const task of tasks) {\n if (!task.agent_ext_id) continue\n const assigned = grouped.get(task.agent_ext_id)\n if (assigned) assigned.push(task)\n else grouped.set(task.agent_ext_id, [task])\n }\n return grouped\n}\n","import type { HTMLAttributes, MouseEvent, ReactNode } from 'react'\nimport { Download, Eye, Globe, Lock, Pencil } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../../components/ActionLink'\nimport { testIdOr } from '../../chat/test-id'\nimport {\n SkillActionButton,\n SkillGlobalBadge,\n SkillTypeBadge,\n activateOnKey,\n type SkillGlobalBadgeLabels,\n} from './SkillParts'\n\nexport interface SkillCardLabels extends SkillGlobalBadgeLabels {\n preview: string\n edit: string\n export: string\n makePrivate: string\n makePrivateTooltip: string\n publish: string\n}\n\nexport const DEFAULT_SKILL_CARD_LABELS: SkillCardLabels = {\n global: 'Global',\n globalTitle: 'Shared with everyone in the marketplace',\n preview: 'Preview skill',\n edit: 'Edit skill',\n export: 'Export skill',\n makePrivate: 'Make private',\n makePrivateTooltip: 'Make private (unpublish)',\n publish: 'Publish to marketplace',\n}\n\nexport interface SkillCardTestIds {\n root: string\n preview: string\n edit: string\n export: string\n toggleVisibility: string\n}\n\nexport interface SkillCardProps {\n name: string\n description: string\n /** Skill type; a small badge is shown when not `markdown`. */\n type?: string\n /** `global` shows a badge and drives the publish toggle. */\n visibility?: 'mine' | 'global'\n /** Only owners see the publish toggle. */\n isOwner?: boolean\n /** Leading icon (the app supplies its skill entity icon). */\n icon?: ReactNode\n /** Invoke the skill (row click / Enter / Space). */\n onClick: () => void\n onPreview: (e: MouseEvent) => void\n onEdit: (e: MouseEvent) => void\n onExport: (e: MouseEvent) => void\n /** Publish / unpublish. Owner-only; omit to hide. */\n onToggleVisibility?: (e: MouseEvent) => void\n /** Destination of the skill; the name becomes a real link (modified clicks go to the browser). */\n href?: string\n labels?: Partial<SkillCardLabels>\n testId?: string\n testIds?: Partial<SkillCardTestIds>\n className?: string\n}\n\n/**\n * Horizontal skill row: icon + `/name` + badges + description, with preview / edit / export /\n * publish actions. All actions are always visible (nothing is hover-only).\n */\nexport function SkillCard({\n name,\n description,\n type,\n visibility = 'mine',\n isOwner = true,\n icon,\n onClick,\n onPreview,\n onEdit,\n onExport,\n onToggleVisibility,\n href,\n labels,\n testId,\n testIds,\n className,\n ...rest\n}: SkillCardProps & Omit<HTMLAttributes<HTMLDivElement>, keyof SkillCardProps | 'onClick'>) {\n const l = { ...DEFAULT_SKILL_CARD_LABELS, ...labels }\n const isGlobal = visibility === 'global'\n return (\n <div\n {...rest}\n role=\"button\"\n tabIndex={0}\n className={cn(\n 'flex w-full cursor-pointer flex-wrap items-center gap-x-3 gap-y-1 rounded-lg bg-muted px-4 py-3 transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n className\n )}\n onClick={onClick}\n onKeyDown={activateOnKey(onClick)}\n data-skill-name={name}\n data-testid={testIdOr(testId ?? testIds?.root, { testId: 'skill-card' })}\n data-slot=\"skill-card\"\n >\n {icon && <span className=\"shrink-0 text-primary [&>svg]:size-5\">{icon}</span>}\n {href ? (\n // The link owns plain + modified clicks; stop the row handler from double-firing.\n <span onClick={(e) => e.stopPropagation()}>\n <ActionLink\n href={href}\n onSelect={onClick}\n className=\"whitespace-nowrap font-mono text-sm font-medium\"\n >\n /{name}\n </ActionLink>\n </span>\n ) : (\n <span className=\"whitespace-nowrap font-mono text-sm font-medium\">/{name}</span>\n )}\n {type && type !== 'markdown' && <SkillTypeBadge type={type} />}\n {isGlobal && <SkillGlobalBadge labels={l} />}\n <span className=\"min-w-0 text-sm text-muted-foreground max-sm:order-last max-sm:w-full max-sm:line-clamp-2 sm:flex-1 sm:truncate\">\n {description}\n </span>\n <span className=\"ml-auto flex shrink-0 items-center gap-1\" data-slot=\"skill-card-actions\">\n <SkillActionButton\n label={l.preview}\n onClick={onPreview}\n testId={testIdOr(testIds?.preview, { testId: 'preview-skill-button' })}\n >\n <Eye className=\"size-4 text-muted-foreground\" />\n </SkillActionButton>\n <SkillActionButton\n label={l.edit}\n onClick={onEdit}\n testId={testIdOr(testIds?.edit, { testId: 'edit-skill-button' })}\n >\n <Pencil className=\"size-4 text-muted-foreground\" />\n </SkillActionButton>\n <SkillActionButton\n label={l.export}\n onClick={onExport}\n testId={testIdOr(testIds?.export, { testId: 'export-skill-button' })}\n >\n <Download className=\"size-4 text-muted-foreground\" />\n </SkillActionButton>\n {isOwner && onToggleVisibility && (\n <SkillActionButton\n label={isGlobal ? l.makePrivate : l.publish}\n tooltip={isGlobal ? l.makePrivateTooltip : l.publish}\n onClick={onToggleVisibility}\n testId={testIdOr(testIds?.toggleVisibility, {\n testId: 'toggle-skill-visibility-button',\n })}\n >\n {isGlobal ? (\n <Lock className=\"size-4 text-muted-foreground\" />\n ) : (\n <Globe className=\"size-4 text-primary\" />\n )}\n </SkillActionButton>\n )}\n </span>\n </div>\n )\n}\n","import type { HTMLAttributes, ReactNode } from 'react'\nimport { Eye, Globe, Lock, Pencil, Trash2 } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../../components/ActionLink'\nimport { testIdOr } from '../../chat/test-id'\nimport {\n SkillActionButton,\n SkillGlobalBadge,\n SkillTypeBadge,\n activateOnKey,\n type SkillGlobalBadgeLabels,\n} from './SkillParts'\n\nexport interface SkillRowLabels extends SkillGlobalBadgeLabels {\n preview: string\n edit: string\n makePrivate: string\n publish: string\n delete: string\n /** Row tooltip; receives the skill name. */\n insertTitle: (name: string) => string\n}\n\nexport const DEFAULT_SKILL_ROW_LABELS: SkillRowLabels = {\n global: 'Global',\n globalTitle: 'Shared with everyone in the marketplace',\n preview: 'Preview',\n edit: 'Edit',\n makePrivate: 'Make private',\n publish: 'Publish to marketplace',\n delete: 'Delete',\n insertTitle: (name) => `Insert /${name} into the chat`,\n}\n\nexport interface SkillRowProps {\n name: string\n description?: string\n type?: string\n isGlobal?: boolean\n icon?: ReactNode\n /** Invoke the skill (inserts `/name` into the chat). */\n onInvoke: () => void\n onPreview: () => void\n /** Owner-only actions: omit to hide. */\n onEdit?: () => void\n onTogglePublish?: () => void\n onDelete?: () => void\n /** Destination of the skill; the name becomes a real link (modified clicks go to the browser). */\n href?: string\n labels?: Partial<SkillRowLabels>\n /** Overrides the default `skills-panel-row-{name}` id. */\n testId?: string\n className?: string\n}\n\n/** Compact two-line skill row for side panels. Actions are always visible. */\nexport function SkillRow({\n name,\n description,\n type,\n isGlobal = false,\n icon,\n onInvoke,\n onPreview,\n onEdit,\n onTogglePublish,\n onDelete,\n href,\n labels,\n testId,\n className,\n ...rest\n}: SkillRowProps & Omit<HTMLAttributes<HTMLDivElement>, keyof SkillRowProps | 'onClick'>) {\n const l = { ...DEFAULT_SKILL_ROW_LABELS, ...labels }\n return (\n <div\n {...rest}\n role=\"button\"\n tabIndex={0}\n className={cn(\n 'flex cursor-pointer items-center gap-2 px-4 py-2 hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring',\n className\n )}\n onClick={onInvoke}\n onKeyDown={activateOnKey(onInvoke)}\n data-testid={testIdOr(testId, { testId: `skills-panel-row-${name}` })}\n data-slot=\"skill-row\"\n title={l.insertTitle(name)}\n >\n {icon && <span className=\"shrink-0 text-primary [&>svg]:size-4\">{icon}</span>}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-1.5\">\n {href ? (\n // The link owns plain + modified clicks; stop the row handler from double-firing.\n <span className=\"min-w-0\" onClick={(e) => e.stopPropagation()}>\n <ActionLink href={href} onSelect={onInvoke} className=\"truncate font-mono text-sm\">\n /{name}\n </ActionLink>\n </span>\n ) : (\n <span className=\"truncate font-mono text-sm\">/{name}</span>\n )}\n {type && type !== 'markdown' && <SkillTypeBadge type={type} />}\n {isGlobal && <SkillGlobalBadge labels={l} />}\n </div>\n {description && <div className=\"truncate text-xs text-muted-foreground\">{description}</div>}\n </div>\n <div className=\"flex shrink-0 items-center gap-0.5\">\n <SkillActionButton label={l.preview} onClick={() => onPreview()}>\n <Eye className=\"size-4\" />\n </SkillActionButton>\n {onEdit && (\n <SkillActionButton label={l.edit} onClick={() => onEdit()}>\n <Pencil className=\"size-4\" />\n </SkillActionButton>\n )}\n {onTogglePublish && (\n <SkillActionButton\n label={isGlobal ? l.makePrivate : l.publish}\n onClick={() => onTogglePublish()}\n >\n {isGlobal ? <Lock className=\"size-4\" /> : <Globe className=\"size-4 text-primary\" />}\n </SkillActionButton>\n )}\n {onDelete && (\n <SkillActionButton label={l.delete} onClick={() => onDelete()}>\n <Trash2 className=\"size-4 text-destructive\" />\n </SkillActionButton>\n )}\n </div>\n </div>\n )\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { loadDocxFonts, isCandidate } from './chunk-MTSKK3BN.js';
3
3
  import { NativeDocxEditor, contentPath, builtinHouseTemplate } from './chunk-BTTUZZN3.js';
4
- import { buildWorkflowScopeSource, documentScopeLabels, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, workflowTriggerType } from './chunk-VE6DHRXD.js';
4
+ import { buildWorkflowScopeSource, documentScopeLabels, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, workflowTriggerType } from './chunk-7CHI36EP.js';
5
+ import { DocumentPicker } from './chunk-WNDIVNPT.js';
5
6
  import { useListedDocuments, useConnectedTags, useConnectedConversations } from './chunk-SYP2A4GQ.js';
6
7
  import { useConnectedWorkspace } from './chunk-7LN3ISPG.js';
7
8
  import { useHost } from './chunk-ILBBV2ZY.js';
8
- import { DocumentPicker } from './chunk-WNDIVNPT.js';
9
9
  import { fmtDate } from './chunk-5VYJP6XD.js';
10
10
  import { parseDeepLinkPath, buildDeepLinkUrl } from './chunk-7Q5INDUS.js';
11
11
  import { useBlocksEnvironment } from './chunk-QZUZPC4J.js';
@@ -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-H6UK6LGL.js.map
555
- //# sourceMappingURL=chunk-H6UK6LGL.js.map
554
+ //# sourceMappingURL=chunk-REHG7VRQ.js.map
555
+ //# sourceMappingURL=chunk-REHG7VRQ.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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AAa;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-H6UK6LGL.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&apos;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,CA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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&apos;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"]}
@@ -4,7 +4,7 @@
4
4
  var chunk5Y6V7F6W_cjs = require('./chunk-5Y6V7F6W.cjs');
5
5
  var chunkD54JXTPG_cjs = require('./chunk-D54JXTPG.cjs');
6
6
  var chunkJIOHDVWH_cjs = require('./chunk-JIOHDVWH.cjs');
7
- var chunkGUV63FUC_cjs = require('./chunk-GUV63FUC.cjs');
7
+ var chunkO3MRE2HL_cjs = require('./chunk-O3MRE2HL.cjs');
8
8
  var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
9
9
  var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
10
10
  var ui = require('@arbidocs/react/ui');
@@ -440,9 +440,9 @@ function workspaceActivityHeadline(item) {
440
440
  return item.status ? `${run} (${item.status.replace(/_/g, " ")})` : run;
441
441
  }
442
442
  default: {
443
- const headline = chunkGUV63FUC_cjs.taskActivityHeadline(
443
+ const headline = chunkO3MRE2HL_cjs.taskActivityHeadline(
444
444
  { kind: item.kind, detail: item.detail },
445
- chunkGUV63FUC_cjs.DEFAULT_TASK_ACTIVITY_LABELS
445
+ chunkO3MRE2HL_cjs.DEFAULT_TASK_ACTIVITY_LABELS
446
446
  );
447
447
  return `${headline} in ${thread}`;
448
448
  }
@@ -2143,5 +2143,5 @@ exports.tagTableMarkdown = tagTableMarkdown;
2143
2143
  exports.tagsPageNouns = tagsPageNouns;
2144
2144
  exports.workspaceActivityHeadline = workspaceActivityHeadline;
2145
2145
  exports.workspaceActivityTarget = workspaceActivityTarget;
2146
- //# sourceMappingURL=chunk-PV5A5SAC.cjs.map
2147
- //# sourceMappingURL=chunk-PV5A5SAC.cjs.map
2146
+ //# sourceMappingURL=chunk-TPNLYQD2.cjs.map
2147
+ //# sourceMappingURL=chunk-TPNLYQD2.cjs.map