@arbidocs/blocks 0.5.42 → 0.5.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedCallDock-362WOEGQ.cjs → ConnectedCallDock-NGHSDLJS.cjs} +9 -9
- package/dist/{ConnectedCallDock-362WOEGQ.cjs.map → ConnectedCallDock-NGHSDLJS.cjs.map} +1 -1
- package/dist/{ConnectedCallDock-ZVUSSOMT.js → ConnectedCallDock-YJSO52N4.js} +8 -8
- package/dist/{ConnectedCallDock-ZVUSSOMT.js.map → ConnectedCallDock-YJSO52N4.js.map} +1 -1
- package/dist/{ConnectedCallRoom-XRU4QR6Z.cjs → ConnectedCallRoom-4XGFFYHE.cjs} +9 -9
- package/dist/{ConnectedCallRoom-XRU4QR6Z.cjs.map → ConnectedCallRoom-4XGFFYHE.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-PHZQS7YE.js → ConnectedCallRoom-T6NS2MY4.js} +8 -8
- package/dist/{ConnectedCallRoom-PHZQS7YE.js.map → ConnectedCallRoom-T6NS2MY4.js.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-V2F6GTI7.js → ConnectedNativeDocxComparison-52KQKJGY.js} +16 -16
- package/dist/{ConnectedNativeDocxComparison-RW2G2UZC.js.map → ConnectedNativeDocxComparison-52KQKJGY.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-AVIO2OZA.cjs → ConnectedNativeDocxComparison-UVLZGS2V.cjs} +17 -17
- package/dist/{ConnectedNativeDocxComparison-AVIO2OZA.cjs.map → ConnectedNativeDocxComparison-UVLZGS2V.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-NMFUEM2Q.js → ConnectedNativeDocxEditor-BRBL3MOV.js} +14 -14
- package/dist/{ConnectedNativeDocxEditor-NMFUEM2Q.js.map → ConnectedNativeDocxEditor-BRBL3MOV.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-GIJ2CXTY.cjs → ConnectedNativeDocxEditor-KHR5I7W6.cjs} +16 -16
- package/dist/{ConnectedNativeDocxEditor-GIJ2CXTY.cjs.map → ConnectedNativeDocxEditor-KHR5I7W6.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-Z5VMYI37.cjs → ConnectedStreamedWordArtifact-DSVFI7BX.cjs} +17 -17
- package/dist/ConnectedStreamedWordArtifact-DSVFI7BX.cjs.map +1 -0
- package/dist/{ConnectedNativeDocxComparison-RW2G2UZC.js → ConnectedStreamedWordArtifact-EQUE6WT5.js} +16 -16
- package/dist/ConnectedStreamedWordArtifact-EQUE6WT5.js.map +1 -0
- package/dist/{NativeDocxEditor-D6Z7BXTA.js → NativeDocxEditor-HJTKCPX2.js} +4 -4
- package/dist/{NativeDocxEditor-D6Z7BXTA.js.map → NativeDocxEditor-HJTKCPX2.js.map} +1 -1
- package/dist/{NativeDocxEditor-HE4PQV5F.cjs → NativeDocxEditor-TVZ6O6YS.cjs} +8 -8
- package/dist/{NativeDocxEditor-HE4PQV5F.cjs.map → NativeDocxEditor-TVZ6O6YS.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-ABQAHQ6P.cjs → WorkspaceTableView-2CGEO5KK.cjs} +8 -8
- package/dist/{WorkspaceTableView-ABQAHQ6P.cjs.map → WorkspaceTableView-2CGEO5KK.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-FZCPEXPJ.js → WorkspaceTableView-3ARFQYNO.js} +6 -6
- package/dist/{WorkspaceTableView-FZCPEXPJ.js.map → WorkspaceTableView-3ARFQYNO.js.map} +1 -1
- package/dist/agents/index.cjs +330 -330
- package/dist/agents/index.js +8 -8
- package/dist/calls/index.cjs +3 -3
- package/dist/calls/index.js +3 -3
- package/dist/chat/index.cjs +79 -79
- package/dist/chat/index.js +3 -3
- package/dist/{chunk-B7UQK7Y4.cjs → chunk-2QDNQM63.cjs} +5 -5
- package/dist/{chunk-B7UQK7Y4.cjs.map → chunk-2QDNQM63.cjs.map} +1 -1
- package/dist/chunk-3YZ3RUSB.cjs +18 -0
- package/dist/{chunk-E7AEW4KA.cjs.map → chunk-3YZ3RUSB.cjs.map} +1 -1
- package/dist/{chunk-XD54MZV4.js → chunk-4DDPMLGU.js} +4 -4
- package/dist/{chunk-XD54MZV4.js.map → chunk-4DDPMLGU.js.map} +1 -1
- package/dist/{chunk-IYW7JR3J.js → chunk-7CHI36EP.js} +5 -5
- package/dist/{chunk-IYW7JR3J.js.map → chunk-7CHI36EP.js.map} +1 -1
- package/dist/{chunk-ORFP3QJQ.js → chunk-AEXFUPO7.js} +3 -3
- package/dist/{chunk-ORFP3QJQ.js.map → chunk-AEXFUPO7.js.map} +1 -1
- package/dist/{chunk-DECUWH2D.js → chunk-AL7EXOX5.js} +3 -3
- package/dist/{chunk-DECUWH2D.js.map → chunk-AL7EXOX5.js.map} +1 -1
- package/dist/{chunk-NIA4H7QN.js → chunk-BTTUZZN3.js} +3 -3
- package/dist/{chunk-NIA4H7QN.js.map → chunk-BTTUZZN3.js.map} +1 -1
- package/dist/{chunk-KALKK4BB.js → chunk-DYYTVUBW.js} +3 -3
- package/dist/{chunk-KALKK4BB.js.map → chunk-DYYTVUBW.js.map} +1 -1
- package/dist/{chunk-X7C3MQRU.cjs → chunk-E3IEZMRK.cjs} +19 -19
- package/dist/{chunk-X7C3MQRU.cjs.map → chunk-E3IEZMRK.cjs.map} +1 -1
- package/dist/{chunk-QOROUFTZ.js → chunk-EFDZRAW6.js} +4 -4
- package/dist/{chunk-QOROUFTZ.js.map → chunk-EFDZRAW6.js.map} +1 -1
- package/dist/{chunk-XSHR5UQO.cjs → chunk-FEVJA4BP.cjs} +3 -3
- package/dist/{chunk-XSHR5UQO.cjs.map → chunk-FEVJA4BP.cjs.map} +1 -1
- package/dist/{chunk-ZG3KKPDP.js → chunk-FOIDBAZB.js} +4 -4
- package/dist/{chunk-ZG3KKPDP.js.map → chunk-FOIDBAZB.js.map} +1 -1
- package/dist/{chunk-WDR6FO22.cjs → chunk-GKHIRR5A.cjs} +5 -5
- package/dist/{chunk-WDR6FO22.cjs.map → chunk-GKHIRR5A.cjs.map} +1 -1
- package/dist/{chunk-74OXAUPK.cjs → chunk-GT5FCYV5.cjs} +4 -4
- package/dist/{chunk-74OXAUPK.cjs.map → chunk-GT5FCYV5.cjs.map} +1 -1
- package/dist/{chunk-S7OTTPKG.cjs → chunk-HNEOW7F3.cjs} +3 -3
- package/dist/{chunk-S7OTTPKG.cjs.map → chunk-HNEOW7F3.cjs.map} +1 -1
- package/dist/{chunk-KEOKVS6D.js → chunk-ICCBNHPU.js} +3 -3
- package/dist/{chunk-KEOKVS6D.js.map → chunk-ICCBNHPU.js.map} +1 -1
- package/dist/{chunk-3U6527ZU.cjs → chunk-JKMV4QNV.cjs} +9 -9
- package/dist/{chunk-3U6527ZU.cjs.map → chunk-JKMV4QNV.cjs.map} +1 -1
- package/dist/chunk-K53QRFPJ.cjs +18 -0
- package/dist/{chunk-NJBWN4Z5.cjs.map → chunk-K53QRFPJ.cjs.map} +1 -1
- package/dist/{chunk-MXLS7IBH.cjs → chunk-K7S5BMAB.cjs} +4 -4
- package/dist/{chunk-MXLS7IBH.cjs.map → chunk-K7S5BMAB.cjs.map} +1 -1
- package/dist/{chunk-J4QH5YXL.cjs → chunk-LNYEYR7W.cjs} +3 -3
- package/dist/{chunk-J4QH5YXL.cjs.map → chunk-LNYEYR7W.cjs.map} +1 -1
- package/dist/{chunk-WP3L6XFN.js → chunk-NE7M6NJY.js} +3 -3
- package/dist/{chunk-WP3L6XFN.js.map → chunk-NE7M6NJY.js.map} +1 -1
- package/dist/{chunk-OC36NMDZ.cjs → chunk-O3MRE2HL.cjs} +16 -16
- package/dist/{chunk-OC36NMDZ.cjs.map → chunk-O3MRE2HL.cjs.map} +1 -1
- package/dist/{chunk-2QPTXTRP.js → chunk-OPZBIGW4.js} +3 -3
- package/dist/{chunk-2QPTXTRP.js.map → chunk-OPZBIGW4.js.map} +1 -1
- package/dist/{chunk-DCA4R3EU.js → chunk-P6MVDOCL.js} +3 -3
- package/dist/{chunk-DCA4R3EU.js.map → chunk-P6MVDOCL.js.map} +1 -1
- package/dist/{chunk-Z6DNYFVM.cjs → chunk-PICGTGEB.cjs} +3 -3
- package/dist/{chunk-Z6DNYFVM.cjs.map → chunk-PICGTGEB.cjs.map} +1 -1
- package/dist/{chunk-3DHSLNVN.js → chunk-PRY52BW5.js} +3 -3
- package/dist/{chunk-3DHSLNVN.js.map → chunk-PRY52BW5.js.map} +1 -1
- package/dist/{chunk-6WZMRAQD.js → chunk-REHG7VRQ.js} +5 -5
- package/dist/{chunk-6WZMRAQD.js.map → chunk-REHG7VRQ.js.map} +1 -1
- package/dist/{chunk-HTOGVT5R.cjs → chunk-TPNLYQD2.cjs} +12 -5
- package/dist/chunk-TPNLYQD2.cjs.map +1 -0
- package/dist/{chunk-CWPGRR4E.cjs → chunk-UZVXVTTB.cjs} +13 -13
- package/dist/{chunk-CWPGRR4E.cjs.map → chunk-UZVXVTTB.cjs.map} +1 -1
- package/dist/{chunk-Q2M5P7AC.cjs → chunk-V7JDMKNQ.cjs} +5 -5
- package/dist/{chunk-Q2M5P7AC.cjs.map → chunk-V7JDMKNQ.cjs.map} +1 -1
- package/dist/{chunk-P5JFZSKH.js → chunk-VA3YYR7R.js} +3 -3
- package/dist/{chunk-P5JFZSKH.js.map → chunk-VA3YYR7R.js.map} +1 -1
- package/dist/{chunk-5TFI4YW2.js → chunk-VFSHI7IX.js} +3 -3
- package/dist/{chunk-5TFI4YW2.js.map → chunk-VFSHI7IX.js.map} +1 -1
- package/dist/{chunk-4RPASW36.js → chunk-WAIHNFUH.js} +4 -4
- package/dist/{chunk-4RPASW36.js.map → chunk-WAIHNFUH.js.map} +1 -1
- package/dist/{chunk-AE3QELMB.cjs → chunk-WALADS2S.cjs} +3 -3
- package/dist/{chunk-AE3QELMB.cjs.map → chunk-WALADS2S.cjs.map} +1 -1
- package/dist/{chunk-2GBVU5HH.cjs → chunk-WRERJFEV.cjs} +5 -5
- package/dist/{chunk-2GBVU5HH.cjs.map → chunk-WRERJFEV.cjs.map} +1 -1
- package/dist/{chunk-ZIDHMCJ4.js → chunk-X7CXCEGO.js} +9 -4
- package/dist/chunk-X7CXCEGO.js.map +1 -0
- package/dist/{chunk-FR6NUJJ2.js → chunk-YAGSGBVM.js} +8 -8
- package/dist/{chunk-FR6NUJJ2.js.map → chunk-YAGSGBVM.js.map} +1 -1
- package/dist/{chunk-BRYHW3OL.cjs → chunk-YTB6DLAD.cjs} +4 -4
- package/dist/{chunk-BRYHW3OL.cjs.map → chunk-YTB6DLAD.cjs.map} +1 -1
- package/dist/{chunk-ZM5LRCHW.cjs → chunk-YWGDZR6A.cjs} +16 -16
- package/dist/{chunk-ZM5LRCHW.cjs.map → chunk-YWGDZR6A.cjs.map} +1 -1
- package/dist/{chunk-HSI534XQ.js → chunk-ZAYUJFPI.js} +3 -3
- package/dist/{chunk-HSI534XQ.js.map → chunk-ZAYUJFPI.js.map} +1 -1
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +20 -20
- package/dist/connect/docx.js +16 -16
- package/dist/connect/index.cjs +924 -904
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +56 -37
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +65 -65
- package/dist/connect/viewer.js +18 -18
- package/dist/connection/tips/useContextualHints.d.ts +13 -0
- package/dist/docx/index.cjs +51 -51
- package/dist/docx/index.js +4 -4
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +236 -236
- package/dist/files/index.js +4 -4
- package/dist/index.cjs +667 -619
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -19
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +155 -155
- package/dist/settings/index.js +2 -2
- package/dist/shell/index.cjs +73 -73
- package/dist/shell/index.js +5 -5
- package/dist/site/index.cjs +21 -21
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +8 -8
- package/dist/studio/index.js +7 -7
- package/dist/tips/index.d.ts +2 -0
- package/dist/tips/useTipsPlacement.d.ts +24 -0
- package/dist/tips/visibility.d.ts +5 -0
- package/dist/workflow-canvas/index.cjs +24 -24
- package/dist/workflow-canvas/index.js +11 -11
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-V2F6GTI7.js.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-Z5VMYI37.cjs.map +0 -1
- package/dist/chunk-E7AEW4KA.cjs +0 -18
- package/dist/chunk-HTOGVT5R.cjs.map +0 -1
- package/dist/chunk-NJBWN4Z5.cjs +0 -18
- package/dist/chunk-ZIDHMCJ4.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useWorkflowView, SkillTypeBadge, SkillGlobalBadge, SkillActionButton, activateOnKey } from './chunk-
|
|
2
|
+
import { useWorkflowView, SkillTypeBadge, SkillGlobalBadge, SkillActionButton, activateOnKey } from './chunk-YAGSGBVM.js';
|
|
3
3
|
import { ActionLink } from './chunk-73DANGPH.js';
|
|
4
|
+
import { EmptyState } from './chunk-P6GHJSLR.js';
|
|
4
5
|
import { workflowSteps, initialRunInputs, stepPhase, composeStepPrompt } from './chunk-THNTNAYI.js';
|
|
5
6
|
import { formatCount } from './chunk-5VYJP6XD.js';
|
|
6
|
-
import { EmptyState } from './chunk-P6GHJSLR.js';
|
|
7
7
|
import { testIdOr } from './chunk-7F6CBP3Z.js';
|
|
8
8
|
import { useState, useRef, useEffect } from 'react';
|
|
9
9
|
import { MessageSquare, Eye, ClipboardList, Pencil, Copy, Trash2, Bot, Sparkles, Plus, Download, Lock, Globe } from 'lucide-react';
|
|
@@ -493,5 +493,5 @@ function SkillRow({
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
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-
|
|
497
|
-
//# sourceMappingURL=chunk-
|
|
496
|
+
//# sourceMappingURL=chunk-FOIDBAZB.js.map
|
|
497
|
+
//# sourceMappingURL=chunk-FOIDBAZB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agents/workflows/useWorkflowPreview.ts","../src/agents/definitions/AgentCard.tsx","../src/agents/definitions/AgentGallery.tsx","../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,MA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EAAU,oCAAA,EACb,QAAA,EAAA;AAAA,0BAAAF,GAAAA,CAAC,iBAAA,EAAA,EAAkB,KAAA,EAAO,CAAA,CAAE,SAAS,OAAA,EAAS,MAAM,SAAA,EAAU,EAC5D,0BAAAA,GAAAA,CAACI,GAAAA,EAAA,EAAI,SAAA,EAAU,UAAS,CAAA,EAC1B,CAAA;AAAA,UACC,0BACCJ,GAAAA,CAAC,iBAAA,EAAA,EAAkB,KAAA,EAAO,EAAE,IAAA,EAAM,OAAA,EAAS,MAAM,MAAA,IAC/C,QAAA,kBAAAA,GAAAA,CAACK,QAAA,EAAO,SAAA,EAAU,UAAS,CAAA,EAC7B,CAAA;AAAA,UAED,mCACCL,GAAAA;AAAA,YAAC,iBAAA;AAAA,YAAA;AAAA,cACC,KAAA,EAAO,QAAA,GAAW,CAAA,CAAE,WAAA,GAAc,CAAA,CAAE,OAAA;AAAA,cACpC,OAAA,EAAS,MAAM,eAAA,EAAgB;AAAA,cAE9B,QAAA,EAAA,QAAA,mBAAWA,GAAAA,CAACM,IAAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS,CAAA,mBAAKN,GAAAA,CAACO,KAAAA,EAAA,EAAM,WAAU,qBAAA,EAAsB;AAAA;AAAA,WACnF;AAAA,UAED,4BACCP,GAAAA,CAAC,iBAAA,EAAA,EAAkB,KAAA,EAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,MAAM,QAAA,IACjD,QAAA,kBAAAA,GAAAA,CAACQ,QAAA,EAAO,SAAA,EAAU,2BAA0B,CAAA,EAC9C;AAAA,SAAA,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-ZG3KKPDP.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","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
|
+
{"version":3,"sources":["../src/agents/workflows/useWorkflowPreview.ts","../src/agents/definitions/AgentCard.tsx","../src/agents/definitions/AgentGallery.tsx","../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,O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MAAM,eAAA,EAAgB;AAAA,cAE9B,QAAA,EAAA,QAAA,mBAAWA,GAAAA,CAACM,IAAAA,EAAA,EAAK,SAAA,EAAU,QAAA,EAAS,CAAA,mBAAKN,GAAAA,CAACO,KAAAA,EAAA,EAAM,WAAU,qBAAA,EAAsB;AAAA;AAAA,WACnF;AAAA,UAED,4BACCP,GAAAA,CAAC,iBAAA,EAAA,EAAkB,KAAA,EAAO,EAAE,MAAA,EAAQ,OAAA,EAAS,MAAM,QAAA,IACjD,QAAA,kBAAAA,GAAAA,CAACQ,QAAA,EAAO,SAAA,EAAU,2BAA0B,CAAA,EAC9C;AAAA,SAAA,EAEJ;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-FOIDBAZB.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","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,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkPICGTGEB_cjs = require('./chunk-PICGTGEB.cjs');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
function StreamedWordArtifact({
|
|
@@ -15,7 +15,7 @@ function StreamedWordArtifact({
|
|
|
15
15
|
}) {
|
|
16
16
|
if (!busy && documentId) {
|
|
17
17
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
-
|
|
18
|
+
chunkPICGTGEB_cjs.NativeDocxEditor,
|
|
19
19
|
{
|
|
20
20
|
adapter,
|
|
21
21
|
documentId,
|
|
@@ -26,7 +26,7 @@ function StreamedWordArtifact({
|
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
-
|
|
29
|
+
chunkPICGTGEB_cjs.NativeDocxEditor,
|
|
30
30
|
{
|
|
31
31
|
adapter,
|
|
32
32
|
documentId: "stream-preview",
|
|
@@ -39,5 +39,5 @@ function StreamedWordArtifact({
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
exports.StreamedWordArtifact = StreamedWordArtifact;
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-GKHIRR5A.cjs.map
|
|
43
|
+
//# sourceMappingURL=chunk-GKHIRR5A.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/docx/StreamedWordArtifact.tsx"],"names":["jsx","NativeDocxEditor"],"mappings":";;;;;AAmBO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA8B;AAC5B,EAAA,IAAI,CAAC,QAAQ,UAAA,EAAY;AACvB,IAAA,uBACEA,cAAA;AAAA,MAACC,kCAAA;AAAA,MAAA;AAAA,QAEC,OAAA;AAAA,QACA,UAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAJK;AAAA,KAKP;AAAA,EAEJ;AACA,EAAA,uBACED,cAAA;AAAA,IAACC,kCAAA;AAAA,IAAA;AAAA,MAEC,OAAA;AAAA,MACA,UAAA,EAAW,gBAAA;AAAA,MACX,KAAA;AAAA,MACA,YAAA,EAAa,EAAA;AAAA,MACb,MAAA,EAAQ,EAAE,OAAA,EAAS,IAAA,EAAM,KAAA;AAAM,KAAA;AAAA,IAL3B;AAAA,GAMN;AAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/docx/StreamedWordArtifact.tsx"],"names":["jsx","NativeDocxEditor"],"mappings":";;;;;AAmBO,SAAS,oBAAA,CAAqB;AAAA,EACnC,OAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA8B;AAC5B,EAAA,IAAI,CAAC,QAAQ,UAAA,EAAY;AACvB,IAAA,uBACEA,cAAA;AAAA,MAACC,kCAAA;AAAA,MAAA;AAAA,QAEC,OAAA;AAAA,QACA,UAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,OAAA;AAAA,MAJK;AAAA,KAKP;AAAA,EAEJ;AACA,EAAA,uBACED,cAAA;AAAA,IAACC,kCAAA;AAAA,IAAA;AAAA,MAEC,OAAA;AAAA,MACA,UAAA,EAAW,gBAAA;AAAA,MACX,KAAA;AAAA,MACA,YAAA,EAAa,EAAA;AAAA,MACb,MAAA,EAAQ,EAAE,OAAA,EAAS,IAAA,EAAM,KAAA;AAAM,KAAA;AAAA,IAL3B;AAAA,GAMN;AAEJ","file":"chunk-GKHIRR5A.cjs","sourcesContent":["import { NativeDocxEditor, type NativeDocxAdapter } from './NativeDocxEditor'\n\nexport interface StreamedWordArtifactProps {\n adapter: NativeDocxAdapter\n /** Streamed Markdown, shown as a read-only preview while the draft is generated. */\n content: string\n title: string\n busy: boolean\n error?: string | null\n /** The DOCX draft the server stored for this generation (`doc-…`), once known. */\n documentId?: string\n onSaved?: (documentId: string) => void\n}\n\n/**\n * One drafting surface for an AI document draft. The server stores every draft as DOCX, so\n * this component never creates a document: it previews the streamed Markdown until generation\n * ends and the stored DOCX is known, then opens that DOCX in the live collaborative editor.\n */\nexport function StreamedWordArtifact({\n adapter,\n content,\n title,\n busy,\n error,\n documentId,\n onSaved,\n}: StreamedWordArtifactProps) {\n if (!busy && documentId) {\n return (\n <NativeDocxEditor\n key={documentId}\n adapter={adapter}\n documentId={documentId}\n title={title}\n onSaved={onSaved}\n />\n )\n }\n return (\n <NativeDocxEditor\n key=\"stream-preview\"\n adapter={adapter}\n documentId=\"stream-preview\"\n title={title}\n draftContent=\"\"\n stream={{ content, busy, error }}\n />\n )\n}\n"]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkY42LJ4TF_cjs = require('./chunk-Y42LJ4TF.cjs');
|
|
5
|
-
var chunkZ2XZ2D4N_cjs = require('./chunk-Z2XZ2D4N.cjs');
|
|
6
|
-
var chunkCQ2YSHIF_cjs = require('./chunk-CQ2YSHIF.cjs');
|
|
7
5
|
var chunkP6HVJP6Z_cjs = require('./chunk-P6HVJP6Z.cjs');
|
|
8
6
|
var chunkG2BKHCI2_cjs = require('./chunk-G2BKHCI2.cjs');
|
|
7
|
+
var chunkZ2XZ2D4N_cjs = require('./chunk-Z2XZ2D4N.cjs');
|
|
8
|
+
var chunkCQ2YSHIF_cjs = require('./chunk-CQ2YSHIF.cjs');
|
|
9
9
|
var chunkB3NYBMDR_cjs = require('./chunk-B3NYBMDR.cjs');
|
|
10
10
|
var React = require('react');
|
|
11
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -372,5 +372,5 @@ exports.useViewerDraftDocument = useViewerDraftDocument;
|
|
|
372
372
|
exports.useViewerIsDetached = useViewerIsDetached;
|
|
373
373
|
exports.useViewerPassageCitation = useViewerPassageCitation;
|
|
374
374
|
exports.useViewerStreamingDocument = useViewerStreamingDocument;
|
|
375
|
-
//# sourceMappingURL=chunk-
|
|
376
|
-
//# sourceMappingURL=chunk-
|
|
375
|
+
//# sourceMappingURL=chunk-GT5FCYV5.cjs.map
|
|
376
|
+
//# sourceMappingURL=chunk-GT5FCYV5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chat/mermaid-normalize.ts","../src/connection/conversation/MermaidDiagram.tsx","../src/connection/conversation/DocumentWorkspaceContext.tsx","../src/connection/conversation/ConnectedMarkdown.tsx","../src/connection/viewer/ConnectedDocumentToolsProvider.tsx","../src/connection/viewer/support.ts"],"names":["useState","useId","useEffect","jsxs","jsx","createContext","useContext","useBlocksEnvironment","React","useArbiSession","MentionChip","QuietLink","useArbiHost","Fragment","useDocument","EntityPill","FileText","DocumentEntity","Mail","mentionFromHref","MarkdownLink","workspaceDocIdFromHref","MarkdownStreamingContext","MarkdownCode","rehypeDocEntityPills","useMemo","KitMarkdownRenderer","useOptionalDocumentTools","useArbi","useQueryClient","useHost","useConnectedWorkspace","useCallback","refreshDocuments","arbiQueryKeys","documentBytesKey","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,OAAO,aAAa,UAAU,CAAA;AAChC;AAGO,SAAS,uBAAuB,OAAA,EAAkD;AACvF,EAAA,MAAM,QAAA,GAAW,wBAAA,EAAyB,CAAE,gBAAA,IAAoB,IAAA;AAChE,EAAA,OAAO,SAAS,OAAO,CAAA;AACzB;AAGO,SAAS,wBAAA,GAAwD;AACtE,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,kBAAA,IAAsB,IAAA;AACrE,EAAA,OAAO,WAAA,EAAY;AACrB;AAGO,SAAS,mBAAA,GAA+B;AAC7C,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,aAAA,IAAiB,QAAA;AAChE,EAAA,OAAO,WAAA,EAAY;AACrB","file":"chunk-74OXAUPK.cjs","sourcesContent":["/**\n * Defensive normalizer for single-line `graph` / `flowchart` Mermaid source.\n *\n * Some LLMs emit the entire diagram on one line. Mermaid's parser splits\n * statements on newlines, so a single-line graph fails outright. This helper\n * inserts newlines on safe statement boundaries so the diagram has a chance\n * of parsing. Only attempts normalization when:\n * 1. The source has no embedded newlines (i.e. is genuinely single-line), and\n * 2. The first directive is `graph` or `flowchart`.\n *\n * Other diagram types (sequenceDiagram, classDiagram, gantt, …) have very\n * different syntaxes — applying these heuristics to them would corrupt valid\n * input, so they're left untouched.\n *\n * Boundaries we split on:\n * - After the diagram-type header (`graph TD`, `flowchart LR`, …).\n * - Before each `style` / `classDef` / `class` / `linkStyle` / `click`\n * / `subgraph` keyword.\n * - Before/after `end` (closes a subgraph block).\n * - After a `]` (label close) that's followed by another node identifier\n * starting a new edge or node declaration.\n */\nexport function normalizeMermaidGraph(source: string): string {\n // Already multi-line — assume it's well-formed; don't touch it.\n if (/\\n/.test(source)) return source\n\n const headerMatch = source.match(/^\\s*(graph|flowchart)\\s+\\w+\\s+/)\n if (!headerMatch) return source\n\n const header = headerMatch[0].trimEnd()\n let body = source.slice(headerMatch[0].length)\n\n // Insert newline before keywords that always start a new statement.\n body = body.replace(/\\s+(style|classDef|class|linkStyle|click|subgraph)\\s/g, '\\n$1 ')\n\n // `end` closes a subgraph: put it on its own line, with a break after it\n // too so any trailing statements don't stay attached.\n body = body.replace(/\\s+end\\b\\s*/g, '\\nend\\n')\n\n // After a label close (`]`), if the next token looks like a Mermaid node id\n // followed by another `[` or `-->`, that's a new statement starting.\n body = body.replace(/\\]\\s+(?=[A-Za-z_][\\w-]*\\s*(?:\\[|-->))/g, ']\\n')\n\n // Collapse any accidental runs of blank lines we may have produced.\n body = body.replace(/\\n{2,}/g, '\\n')\n\n return `${header}\\n${body.trimStart()}`\n}\n","/**\n * MermaidDiagram Component\n *\n * Renders a Mermaid diagram from source code.\n * Used inside MarkdownRenderer to handle ```mermaid code blocks.\n * Lazy-loads the mermaid library to avoid bloating the initial bundle.\n */\n\nimport { useState, useEffect, useId } from 'react'\nimport { normalizeMermaidGraph } from '../../chat/mermaid-normalize'\n\ninterface MermaidDiagramProps {\n /** Mermaid diagram source code */\n chart: string\n}\n\n// Lazy-load and initialize mermaid once\nlet mermaidInstance: typeof import('mermaid').default | null = null\nlet mermaidLoadPromise: Promise<typeof import('mermaid').default> | null = null\n\nasync function getMermaid() {\n if (mermaidInstance) return mermaidInstance\n if (!mermaidLoadPromise) {\n mermaidLoadPromise = import('mermaid').then((mod) => {\n const m = mod.default\n m.initialize({\n startOnLoad: false,\n theme: 'default',\n securityLevel: 'strict',\n flowchart: { useMaxWidth: true, curve: 'basis' },\n })\n mermaidInstance = m\n return m\n })\n }\n return mermaidLoadPromise\n}\n\nexport function MermaidDiagram({ chart }: MermaidDiagramProps) {\n const [svg, setSvg] = useState<string | null>(null)\n const [error, setError] = useState<string | null>(null)\n const uniqueId = useId().replace(/:/g, '-')\n\n useEffect(() => {\n let cancelled = false\n\n async function render() {\n const mermaid = await getMermaid()\n const diagramId = `mermaid${uniqueId}`\n\n // Validate with parse() before render(). In Mermaid v11 a render() with\n // bad source can return a \"Syntax error in text\" bomb SVG instead of\n // throwing — and it appends DOM side-effects of its own — so a try/catch\n // around render() doesn't reliably catch failures and the bomb leaks\n // into the page (especially under React StrictMode where effects run\n // twice). parse() throws cleanly with no DOM side-effects.\n //\n // Defensive rescue: some LLMs emit single-line `graph`/`flowchart`\n // source. If the original parse fails, try a normalized variant. The\n // normalizer is a no-op on already-multi-line source and on non-graph\n // diagram types, so this only helps the bad-source case and never\n // corrupts valid input.\n let validSource: string | null = null\n let firstErr: unknown\n try {\n await mermaid.parse(chart)\n validSource = chart\n } catch (err) {\n firstErr = err\n const normalized = normalizeMermaidGraph(chart)\n if (normalized !== chart) {\n try {\n await mermaid.parse(normalized)\n validSource = normalized\n } catch (retryErr) {\n console.warn('Mermaid normalized parse also failed', retryErr)\n }\n }\n }\n\n if (cancelled) return\n\n if (!validSource) {\n console.warn('Mermaid parse failed, showing source', firstErr)\n setError('Failed to render diagram')\n setSvg(null)\n return\n }\n\n try {\n const { svg: renderedSvg } = await mermaid.render(diagramId, validSource)\n if (!cancelled) {\n setSvg(renderedSvg)\n setError(null)\n }\n } catch (renderErr) {\n if (!cancelled) {\n console.warn('Mermaid render failed despite parse success', renderErr)\n setError('Failed to render diagram')\n setSvg(null)\n }\n }\n }\n\n render()\n return () => {\n cancelled = true\n }\n }, [chart, uniqueId])\n\n if (error) {\n // Fall back to showing the raw source in a code block\n return (\n <div className=\"code-block\" data-testid=\"mermaid-error\">\n <div className=\"text-sm text-muted-foreground mb-1\">{error}</div>\n <code className=\"language-mermaid\">{chart}</code>\n </div>\n )\n }\n\n if (!svg) {\n return (\n <div\n className=\"flex items-center justify-center py-8 text-muted-foreground text-sm\"\n data-testid=\"mermaid-loading\"\n >\n Rendering diagram...\n </div>\n )\n }\n\n return (\n <div\n className=\"mermaid-diagram my-4 overflow-x-auto rounded-md border border-border bg-background p-4\"\n data-testid=\"mermaid-diagram\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n )\n}\n","/**\n * The workspace a conversation's document references belong to, when it is not the open one: an\n * agent's direct-message thread runs in the agent's workspace, so the documents it names are there.\n * A reference then opens that workspace first (`openDocument(id, { workspaceId })`).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\n/** The workspace of the documents referenced inside it (null: the open workspace). */\nexport const DocumentWorkspaceContext = createContext<string | null>(null)\nexport const useDocumentWorkspace = () => useContext(DocumentWorkspaceContext)\n\n/** A reference to a document of another workspace: opening it opens that workspace first. */\nexport function WorkspaceDocumentReference({\n workspaceId,\n docId,\n children,\n className = 'inline-flex rounded-full border px-2 py-0.5 text-xs hover:bg-muted',\n}: {\n workspaceId: string\n docId: string\n children?: ReactNode\n className?: string\n}) {\n const { openDocument } = useBlocksEnvironment()\n return (\n <button\n type=\"button\"\n className={className}\n onClick={() => openDocument(docId, { workspaceId })}\n >\n {children ?? docId}\n </button>\n )\n}\n","/**\n * The conversation's markdown: the kit's `MarkdownRenderer` (`@arbidocs/react`: sanitised HTML,\n * slugs, lazy KaTeX, streaming blocks, tables, code) with what a conversation adds: @mention chips,\n * workspace documents opening in the viewer, quiet external links, document and email pills (the\n * host's chips, `ArbiChatHost.renderDocumentChip` / `renderMailChip`) and Mermaid diagrams.\n */\nimport { useArbiHost, useArbiSession, useDocument } from '@arbidocs/react'\nimport { mentionFromHref, type MentionKind } from '@arbidocs/react/shell'\nimport {\n EntityPill,\n MarkdownCode,\n MarkdownLink,\n MarkdownRenderer as KitMarkdownRenderer,\n MarkdownStreamingContext,\n type MarkdownRendererProps as KitMarkdownRendererProps,\n DocumentEntity,\n} from '@arbidocs/react/ui'\nimport React, { useContext, useMemo } from 'react'\nimport { FileText, Mail } from 'lucide-react'\n\n/** The markdown element overrides, as the kit's renderer takes them. */\ntype Components = NonNullable<KitMarkdownRendererProps['components']>\nimport { MentionChip } from '../../chat/MentionMenu'\nimport { QuietLink } from '../../citations/QuietMarks'\nimport { rehypeDocEntityPills } from '../../chat/rehype-doc-entity-pills'\nimport { workspaceDocIdFromHref } from '../../chat/doc-links'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { MermaidDiagram } from './MermaidDiagram'\nimport { useDocumentWorkspace, WorkspaceDocumentReference } from './DocumentWorkspaceContext'\n\n/** Plain text of a link's children (the `@Label` of a mention link). */\nfunction childrenText(children: React.ReactNode): string {\n return React.Children.toArray(children)\n .map((child) => (typeof child === 'string' || typeof child === 'number' ? String(child) : ''))\n .join('')\n}\n\n/** A mention chip; a mention of the reader stands out. */\nfunction MentionLink({ kind, id, text }: { kind: MentionKind; id: string; text: string }) {\n const currentUserId = useArbiSession().user?.external_id\n return (\n <MentionChip\n kind={kind}\n id={id}\n label={text.replace(/^@/, '')}\n isSelf={kind === 'user' && id === currentUserId}\n />\n )\n}\n\n/**\n * A link to elsewhere, as quiet text. Its menu (Open link / Copy link) is the deliberate step\n * the old confirmation dialog used to be; nothing opens until the menu's primary row is chosen.\n */\nexport function ExternalLink({ href, children }: React.ComponentPropsWithoutRef<'a'>) {\n return (\n <QuietLink href={href} kind=\"external\">\n {children}\n </QuietLink>\n )\n}\n\n/**\n * A workspace document referenced by a link's href rather than by its text.\n *\n * `rehypeDocEntityPills` turns a bare `doc-…` id into a pill, but it only walks\n * TEXT nodes — so `[NVDA DCF Valuation Report](…doc-abc12345…)`, which is how an\n * answer links an artifact it just saved, keeps the id in the href where the\n * plugin never looks. The link then fell through to `ExternalLink`, and opening\n * your own workspace document asked you to confirm an \"external link\" and\n * launched a new tab. It opens in the document viewer, like the pill and the\n * artifact card already do.\n */\nexport function InternalDocLink({\n docId,\n href,\n children,\n}: React.ComponentPropsWithoutRef<'a'> & { docId: string }) {\n const { openDocument } = useBlocksEnvironment()\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) {\n return (\n <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId}>\n {children}\n </WorkspaceDocumentReference>\n )\n }\n\n return (\n <QuietLink href={href} kind=\"document\" onOpen={() => openDocument(docId)}>\n {children}\n </QuietLink>\n )\n}\n\n/** A document of the workspace, as a pill: the host's chip, else the document entity. */\nexport function DocumentChip({ docId }: { docId: string }) {\n const render = useArbiHost().chat?.renderDocumentChip\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) return <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId} />\n return render ? <>{render(docId)}</> : <DefaultDocumentChip docId={docId} />\n}\n\nfunction DefaultDocumentChip({ docId }: { docId: string }) {\n const { data: doc } = useDocument(docId)\n const { openDocument } = useBlocksEnvironment()\n if (!doc)\n return (\n <EntityPill\n icon={<FileText className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label={docId}\n size=\"sm\"\n onClick={() => openDocument(docId)}\n data-testid=\"doc-entity-pill\"\n />\n )\n return (\n <DocumentEntity doc={doc} onClick={() => openDocument(docId)} data-testid=\"doc-entity-pill\" />\n )\n}\n\n/** An email of the person's mailbox, as a pill: the host's chip, else a plain \"Email\". */\nexport function MailChip({ mailId }: { mailId: string }) {\n const render = useArbiHost().chat?.renderMailChip\n if (render) return <>{render(mailId)}</>\n return (\n <EntityPill\n icon={<Mail className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label=\"Email\"\n size=\"sm\"\n data-testid=\"mail-entity-pill\"\n />\n )\n}\n\n/**\n * The conversation's overrides, layered on the kit's defaults. Module scope, so the reference is stable\n * and memoised markdown blocks do not re-parse.\n */\nconst conversationMarkdownComponents: Partial<Components> = {\n a: function ConversationMarkdownLink({\n href,\n children,\n ...props\n }: React.ComponentPropsWithoutRef<'a'>) {\n const deploymentDomain = useBlocksEnvironment().runtimeConfig.deploymentDomain\n // @mentions: `linkMentions` turned them into `#mention-<id>` links; draw them as chips.\n const mention = mentionFromHref(href)\n if (mention) {\n return <MentionLink kind={mention.kind} id={mention.id} text={childrenText(children)} />\n }\n // Bookmarks: in-page anchors are near-invisible text; the menu jumps or copies the place.\n if (href?.startsWith('#') && !href.startsWith('#cite-')) {\n return (\n <QuietLink href={href} kind=\"anchor\">\n {children}\n </QuietLink>\n )\n }\n // Citations, `cite:` references and bare links: the kit's link.\n if (!href || href.startsWith('#') || href.startsWith('cite:')) {\n return (\n <MarkdownLink href={href} {...props}>\n {children}\n </MarkdownLink>\n )\n }\n // A workspace document is not an external link, wherever it is hosted: it opens in the viewer.\n const docId = workspaceDocIdFromHref(href, deploymentDomain)\n if (docId) {\n return (\n <InternalDocLink docId={docId} href={href} {...props}>\n {children}\n </InternalDocLink>\n )\n }\n return (\n <ExternalLink href={href} {...props}>\n {children}\n </ExternalLink>\n )\n },\n code: function ConversationMarkdownCode(\n props: React.ComponentPropsWithoutRef<'code'> & { inline?: boolean }\n ) {\n const isStreaming = useContext(MarkdownStreamingContext)\n const { className, children } = props\n const language = /language-(\\w+)/.exec(className || '')?.[1]\n if (!language) {\n // Answers often backtick a bare doc id (`doc-f7b3eeb5`). The text-node pass skips code, so\n // the id would stay monospace text; show it as the document pill. Only a whole id (eight\n // alphanumerics): while streaming, a partial one (\"doc-e\") would be looked up and 404.\n const codeText = typeof children === 'string' ? children.trim() : ''\n if (/^doc-[a-zA-Z0-9]{8}$/.test(codeText)) return <DocumentChip docId={codeText} />\n if (/^eml-[a-zA-Z0-9]{8}$/.test(codeText)) return <MailChip mailId={codeText} />\n }\n // Mermaid lazy-loads its own bundle and re-renders SVG on every change. While streaming the\n // fence is almost always partial, so it stays a code block until generation completes.\n if (language === 'mermaid' && !isStreaming) {\n return <MermaidDiagram chart={String(children).replace(/\\n$/, '')} />\n }\n return <MarkdownCode {...props} />\n },\n span: ({ children, className, ...props }: React.ComponentPropsWithoutRef<'span'>) => {\n const docId = (props as Record<string, unknown>)['data-doc-id'] as string | undefined\n if (docId) return <DocumentChip docId={docId} />\n const mailId = (props as Record<string, unknown>)['data-mail-id'] as string | undefined\n if (mailId) return <MailChip mailId={mailId} />\n return (\n <span className={className} {...props}>\n {children}\n </span>\n )\n },\n}\n\n/** Bare `doc-…` / `eml-…` ids in text become `<span data-doc-id>` / `<span data-mail-id>` pills. */\nconst conversationRehypePlugins = [rehypeDocEntityPills]\n\nexport type ConnectedMarkdownProps = Omit<KitMarkdownRendererProps, 'rehypePlugins'>\n\n/**\n * The kit's renderer with the conversation's overrides; a caller's `components` (e.g. the citation\n * core's) still win over both.\n */\nfunction ConnectedMarkdownComponent({ components, ...props }: ConnectedMarkdownProps) {\n const merged = useMemo(\n () =>\n components\n ? { ...conversationMarkdownComponents, ...components }\n : conversationMarkdownComponents,\n [components]\n )\n return (\n <KitMarkdownRenderer {...props} components={merged} rehypePlugins={conversationRehypePlugins} />\n )\n}\n\nexport const ConnectedMarkdown = React.memo(ConnectedMarkdownComponent)\n","/**\n * The PDF document tools (markup, Freeze, signing, signature requests, productions) on the\n * signed-in session, for any host: the API client, the signed-in user, the host's notices and\n * document opening (`BlocksEnvironment`), and the shared caches a change refreshes. A host with its\n * own binding (its own lists to refresh, an XHR upload with progress, Mail) gives it as the host\n * configuration's `documentTools`, field by field. An enclosing `DocumentToolsProvider` (a dialog\n * with its own client) wins.\n */\n\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { arbiQueryKeys, refreshDocuments, useArbi } from '@arbidocs/react'\nimport {\n DocumentToolsProvider,\n clientUpload,\n documentBytesKey,\n useOptionalDocumentTools,\n type DocumentChange,\n type DocumentToolsClient,\n type DocumentToolsEnvironment,\n type DocumentToolsNotify,\n type DocumentUploadRequest,\n} from '@arbidocs/react/document-tools'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\n\n/** What a host binds of the document tools itself; each absent field is the kit's own. */\nexport interface DocumentToolsHost {\n /** The API client the tools call. Default: the host `arbi`'s. */\n client?: DocumentToolsClient\n /** The deployment domain keys are derived for (signing). Default: the host `arbi`'s. */\n deploymentDomain?: string\n /** Open a document or a version the tools made. Default: the environment's `openDocument`. */\n openDocument?: (documentRef: string) => void\n /** Refresh the host's lists after a change. Default: the shared document caches. */\n onDocumentsChanged?: DocumentToolsEnvironment['onDocumentsChanged']\n /** Upload a derived copy. Default: through the API client, into the open workspace. */\n uploadDocument?: DocumentToolsEnvironment['uploadDocument']\n /**\n * Where \"View certificate\" goes for a signature `reference` (e.g. the site's own verify page).\n * Default: the certificate link the API returns (on the deployment domain).\n */\n certificateUrl?: (reference: string) => string\n /** Email a document (a hook): absent, or returning nothing, when mail is not offered. */\n useEmailDocument?: () => ((documentRef: string) => void) | undefined\n}\n\nconst NO_EMAIL = () => undefined\n\nexport function ConnectedDocumentToolsProvider({ children }: { children: ReactNode }) {\n const enclosing = useOptionalDocumentTools()\n return enclosing ? <>{children}</> : <OwnDocumentTools>{children}</OwnDocumentTools>\n}\n\nfunction OwnDocumentTools({ children }: { children: ReactNode }) {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const host = useHost().documentTools\n const { user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { notify: environmentNotify, openDocument: openInHost } = useBlocksEnvironment()\n const useEmailDocument = host?.useEmailDocument ?? NO_EMAIL\n const emailDocument = useEmailDocument()\n const client = host?.client ?? (arbi.isLoggedIn ? arbi.getClient().fetch : null)\n const signer = useMemo(\n () => (user ? { name: user.name, email: user.email, externalId: user.externalId } : null),\n [user]\n )\n const notify = useCallback<DocumentToolsNotify>(\n (message, kind, options) =>\n environmentNotify(message, kind, {\n description: options?.description,\n action: options?.action,\n }),\n [environmentNotify]\n )\n const ownDocumentsChanged = useCallback(\n async (ids: string[], change: DocumentChange) => {\n // The list carries each version's markup count and the copies; a signature or a saved\n // version is a new current version, with new versions and a new rendered PDF.\n const refresh: Promise<unknown>[] = [refreshDocuments(queryClient, arbi, ids)]\n if (change === 'signed' || change === 'version')\n for (const id of ids)\n refresh.push(\n queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documentVersions(id) }),\n queryClient.invalidateQueries({ queryKey: documentBytesKey(id) })\n )\n await Promise.all(refresh)\n },\n [queryClient, arbi]\n )\n // The server files an upload in the session's open workspace: re-assert it first.\n const ownUpload = useCallback(\n async (request: DocumentUploadRequest) => {\n if (!client) throw new Error('Sign in to save a copy.')\n await ensureWorkspaceOpen()\n return clientUpload(client)(request)\n },\n [client, ensureWorkspaceOpen]\n )\n const ownOpenDocument = useCallback((ref: string) => openInHost(ref), [openInHost])\n if (!client) return <>{children}</>\n return (\n <DocumentToolsProvider\n client={client}\n deploymentDomain={host?.deploymentDomain}\n user={signer}\n notify={notify}\n openDocument={host?.openDocument ?? ownOpenDocument}\n onDocumentsChanged={host?.onDocumentsChanged ?? ownDocumentsChanged}\n uploadDocument={host?.uploadDocument ?? ownUpload}\n emailDocument={emailDocument}\n certificateUrl={host?.certificateUrl}\n >\n {children}\n </DocumentToolsProvider>\n )\n}\n","/**\n * What a host adds to the connected document viewer. The viewer reads documents, versions, PDFs,\n * markup and signatures on the signed-in session by itself; these are the host's own things it\n * cannot know: documents the host makes on the client (an artifact streaming in from a chat, an\n * unsaved draft), the host's dialogs and workflows a document action opens, and how the host lays\n * the viewer out. It is the host configuration's `viewer`. Every field is optional: without one the\n * viewer offers less (no Translate button, no draft controls), never something that does nothing.\n * What changes while the viewer is open is read through hooks (`use…`).\n */\n\nimport type { ReactNode } from 'react'\nimport type { components } from '@arbidocs/client'\nimport { useHost } from '../../provider/host'\n\n/** A document's record, as the viewer reads it. */\nexport type ViewerDocumentRecord = components['schemas']['DocResponse']\n\n/** An artifact being generated in a chat, shown in the viewer as it streams. */\nexport interface ViewerStreamingDocument {\n title?: string | null\n /** The content so far (Markdown, or the html/react source of a live artifact). */\n content: string\n /** How it is carried: a document draft, a live `html` / `react` artifact, an `image`. */\n mode?: string | null\n isComplete: boolean\n}\n\n/** A document the user started on the client, with no backend record until it is saved. */\nexport interface ViewerDraftDocument {\n kind: 'text' | 'audio' | 'photo' | 'video'\n title?: string | null\n /** A text draft's starting content. */\n content?: string | null\n}\n\nexport interface DocumentViewerSupport {\n /** The artifact streaming in as this document, if one is (a hook). */\n useStreamingDocument?: (documentId: string) => ViewerStreamingDocument | undefined\n /** The unsaved draft with this client id, if there is one (a hook). */\n useDraftDocument?: (draftId: string) => ViewerDraftDocument | undefined\n /** A draft's kind (text, photo, audio, video), in place of the tabs. */\n renderDraftKind?: (draftId: string) => ReactNode\n /** A draft's name (editable), in place of the title. */\n renderDraftTitle?: (draftId: string) => ReactNode\n /** The recorder of a photo, audio or video draft: the whole body of the viewer. */\n renderCaptureDraft?: (draftId: string) => ReactNode\n /** A text draft was saved as `documentId`; the viewer shows it next. */\n onDraftSaved?: (draftId: string, documentId: string) => void\n /** Documents related to the one open (near duplicates), beside its name. */\n renderRelated?: (document: ViewerDocumentRecord) => ReactNode\n /** A document as a pill (the comparison's other side). Default: its name. */\n renderDocumentPill?: (documentId: string) => ReactNode\n /** Open the host's share dialog for the document. Default: share it with the workspace. */\n share?: (document: { id: string; name: string | undefined; isPrivate: boolean }) => void\n /** Ask the assistant about a version (`doc-…@v2`) open read-only. Absent: not offered. */\n askAboutVersion?: (versionRef: string) => void\n /** Translate the document (or the version) on screen. Absent: not offered. */\n translate?: (documentRef: string) => void\n /** Start an image generation from the image on screen. Absent: not offered. */\n useImageAsReference?: (documentId: string) => void\n /**\n * A citation being edited elsewhere (a fact's sources, a field's) picks its passages in the text\n * view: clicks and selections there are handed to it (a hook). Absent: passages are not pickable.\n */\n usePassageCitation?: () => PassageCitation | undefined\n /** Open the document's passages in the host's navigator (a passage's menu). Absent: not offered. */\n openInNavigator?: (documentId: string) => void\n /** Start a new label or field in the host's editor (the passage tagging panel). Absent: not offered. */\n createTag?: () => void\n /** How dates read (versions, signatures). Default: `fmtDate`. */\n formatDate?: (iso: string) => string\n /** Whether the viewer is shown in another window, where PDF pages render without the page's web\n * fonts (a hook). */\n useIsDetached?: () => boolean\n}\n\n/** A passage picked for a citation: its chunk and, when known, its page. */\nexport interface PickedPassage {\n chunk_id: string\n page?: number\n}\n\n/** The citation a host is editing, as the text view sees it. */\nexport interface PassageCitation {\n /** The citation picking passages now, and the document it picks in; null when none is. */\n active: { documentId: string; key: string | null } | null\n /** Passages to light (a fact's cited passages while its sources are open). */\n highlighted: readonly string[]\n /** Passages added to the citation. */\n pick: (passages: PickedPassage[]) => void\n /** Passages taken off it. */\n unpick: (chunkIds: string[]) => void\n}\n\nconst NO_SUPPORT: DocumentViewerSupport = {}\n\nexport function useDocumentViewerSupport(): DocumentViewerSupport {\n return useHost().viewer ?? NO_SUPPORT\n}\n\nconst NONE = () => undefined\nconst ATTACHED = () => false\n\n/** The artifact streaming in as this document (none without the host's). */\nexport function useViewerStreamingDocument(\n documentId: string\n): ViewerStreamingDocument | undefined {\n const useStreaming = useDocumentViewerSupport().useStreamingDocument ?? NONE\n return useStreaming(documentId)\n}\n\n/** The unsaved draft with this id (none without the host's). */\nexport function useViewerDraftDocument(draftId: string): ViewerDraftDocument | undefined {\n const useDraft = useDocumentViewerSupport().useDraftDocument ?? NONE\n return useDraft(draftId)\n}\n\n/** The citation picking passages (none without the host's). */\nexport function useViewerPassageCitation(): PassageCitation | undefined {\n const useCitation = useDocumentViewerSupport().usePassageCitation ?? NONE\n return useCitation()\n}\n\n/** Whether the viewer is in another window (never without the host's). */\nexport function useViewerIsDetached(): boolean {\n const useDetached = useDocumentViewerSupport().useIsDetached ?? ATTACHED\n return useDetached()\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/chat/mermaid-normalize.ts","../src/connection/conversation/MermaidDiagram.tsx","../src/connection/conversation/DocumentWorkspaceContext.tsx","../src/connection/conversation/ConnectedMarkdown.tsx","../src/connection/viewer/ConnectedDocumentToolsProvider.tsx","../src/connection/viewer/support.ts"],"names":["useState","useId","useEffect","jsxs","jsx","createContext","useContext","useBlocksEnvironment","React","useArbiSession","MentionChip","QuietLink","useArbiHost","Fragment","useDocument","EntityPill","FileText","DocumentEntity","Mail","mentionFromHref","MarkdownLink","workspaceDocIdFromHref","MarkdownStreamingContext","MarkdownCode","rehypeDocEntityPills","useMemo","KitMarkdownRenderer","useOptionalDocumentTools","useArbi","useQueryClient","useHost","useConnectedWorkspace","useCallback","refreshDocuments","arbiQueryKeys","documentBytesKey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A,OAAO,aAAa,UAAU,CAAA;AAChC;AAGO,SAAS,uBAAuB,OAAA,EAAkD;AACvF,EAAA,MAAM,QAAA,GAAW,wBAAA,EAAyB,CAAE,gBAAA,IAAoB,IAAA;AAChE,EAAA,OAAO,SAAS,OAAO,CAAA;AACzB;AAGO,SAAS,wBAAA,GAAwD;AACtE,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,kBAAA,IAAsB,IAAA;AACrE,EAAA,OAAO,WAAA,EAAY;AACrB;AAGO,SAAS,mBAAA,GAA+B;AAC7C,EAAA,MAAM,WAAA,GAAc,wBAAA,EAAyB,CAAE,aAAA,IAAiB,QAAA;AAChE,EAAA,OAAO,WAAA,EAAY;AACrB","file":"chunk-GT5FCYV5.cjs","sourcesContent":["/**\n * Defensive normalizer for single-line `graph` / `flowchart` Mermaid source.\n *\n * Some LLMs emit the entire diagram on one line. Mermaid's parser splits\n * statements on newlines, so a single-line graph fails outright. This helper\n * inserts newlines on safe statement boundaries so the diagram has a chance\n * of parsing. Only attempts normalization when:\n * 1. The source has no embedded newlines (i.e. is genuinely single-line), and\n * 2. The first directive is `graph` or `flowchart`.\n *\n * Other diagram types (sequenceDiagram, classDiagram, gantt, …) have very\n * different syntaxes — applying these heuristics to them would corrupt valid\n * input, so they're left untouched.\n *\n * Boundaries we split on:\n * - After the diagram-type header (`graph TD`, `flowchart LR`, …).\n * - Before each `style` / `classDef` / `class` / `linkStyle` / `click`\n * / `subgraph` keyword.\n * - Before/after `end` (closes a subgraph block).\n * - After a `]` (label close) that's followed by another node identifier\n * starting a new edge or node declaration.\n */\nexport function normalizeMermaidGraph(source: string): string {\n // Already multi-line — assume it's well-formed; don't touch it.\n if (/\\n/.test(source)) return source\n\n const headerMatch = source.match(/^\\s*(graph|flowchart)\\s+\\w+\\s+/)\n if (!headerMatch) return source\n\n const header = headerMatch[0].trimEnd()\n let body = source.slice(headerMatch[0].length)\n\n // Insert newline before keywords that always start a new statement.\n body = body.replace(/\\s+(style|classDef|class|linkStyle|click|subgraph)\\s/g, '\\n$1 ')\n\n // `end` closes a subgraph: put it on its own line, with a break after it\n // too so any trailing statements don't stay attached.\n body = body.replace(/\\s+end\\b\\s*/g, '\\nend\\n')\n\n // After a label close (`]`), if the next token looks like a Mermaid node id\n // followed by another `[` or `-->`, that's a new statement starting.\n body = body.replace(/\\]\\s+(?=[A-Za-z_][\\w-]*\\s*(?:\\[|-->))/g, ']\\n')\n\n // Collapse any accidental runs of blank lines we may have produced.\n body = body.replace(/\\n{2,}/g, '\\n')\n\n return `${header}\\n${body.trimStart()}`\n}\n","/**\n * MermaidDiagram Component\n *\n * Renders a Mermaid diagram from source code.\n * Used inside MarkdownRenderer to handle ```mermaid code blocks.\n * Lazy-loads the mermaid library to avoid bloating the initial bundle.\n */\n\nimport { useState, useEffect, useId } from 'react'\nimport { normalizeMermaidGraph } from '../../chat/mermaid-normalize'\n\ninterface MermaidDiagramProps {\n /** Mermaid diagram source code */\n chart: string\n}\n\n// Lazy-load and initialize mermaid once\nlet mermaidInstance: typeof import('mermaid').default | null = null\nlet mermaidLoadPromise: Promise<typeof import('mermaid').default> | null = null\n\nasync function getMermaid() {\n if (mermaidInstance) return mermaidInstance\n if (!mermaidLoadPromise) {\n mermaidLoadPromise = import('mermaid').then((mod) => {\n const m = mod.default\n m.initialize({\n startOnLoad: false,\n theme: 'default',\n securityLevel: 'strict',\n flowchart: { useMaxWidth: true, curve: 'basis' },\n })\n mermaidInstance = m\n return m\n })\n }\n return mermaidLoadPromise\n}\n\nexport function MermaidDiagram({ chart }: MermaidDiagramProps) {\n const [svg, setSvg] = useState<string | null>(null)\n const [error, setError] = useState<string | null>(null)\n const uniqueId = useId().replace(/:/g, '-')\n\n useEffect(() => {\n let cancelled = false\n\n async function render() {\n const mermaid = await getMermaid()\n const diagramId = `mermaid${uniqueId}`\n\n // Validate with parse() before render(). In Mermaid v11 a render() with\n // bad source can return a \"Syntax error in text\" bomb SVG instead of\n // throwing — and it appends DOM side-effects of its own — so a try/catch\n // around render() doesn't reliably catch failures and the bomb leaks\n // into the page (especially under React StrictMode where effects run\n // twice). parse() throws cleanly with no DOM side-effects.\n //\n // Defensive rescue: some LLMs emit single-line `graph`/`flowchart`\n // source. If the original parse fails, try a normalized variant. The\n // normalizer is a no-op on already-multi-line source and on non-graph\n // diagram types, so this only helps the bad-source case and never\n // corrupts valid input.\n let validSource: string | null = null\n let firstErr: unknown\n try {\n await mermaid.parse(chart)\n validSource = chart\n } catch (err) {\n firstErr = err\n const normalized = normalizeMermaidGraph(chart)\n if (normalized !== chart) {\n try {\n await mermaid.parse(normalized)\n validSource = normalized\n } catch (retryErr) {\n console.warn('Mermaid normalized parse also failed', retryErr)\n }\n }\n }\n\n if (cancelled) return\n\n if (!validSource) {\n console.warn('Mermaid parse failed, showing source', firstErr)\n setError('Failed to render diagram')\n setSvg(null)\n return\n }\n\n try {\n const { svg: renderedSvg } = await mermaid.render(diagramId, validSource)\n if (!cancelled) {\n setSvg(renderedSvg)\n setError(null)\n }\n } catch (renderErr) {\n if (!cancelled) {\n console.warn('Mermaid render failed despite parse success', renderErr)\n setError('Failed to render diagram')\n setSvg(null)\n }\n }\n }\n\n render()\n return () => {\n cancelled = true\n }\n }, [chart, uniqueId])\n\n if (error) {\n // Fall back to showing the raw source in a code block\n return (\n <div className=\"code-block\" data-testid=\"mermaid-error\">\n <div className=\"text-sm text-muted-foreground mb-1\">{error}</div>\n <code className=\"language-mermaid\">{chart}</code>\n </div>\n )\n }\n\n if (!svg) {\n return (\n <div\n className=\"flex items-center justify-center py-8 text-muted-foreground text-sm\"\n data-testid=\"mermaid-loading\"\n >\n Rendering diagram...\n </div>\n )\n }\n\n return (\n <div\n className=\"mermaid-diagram my-4 overflow-x-auto rounded-md border border-border bg-background p-4\"\n data-testid=\"mermaid-diagram\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n )\n}\n","/**\n * The workspace a conversation's document references belong to, when it is not the open one: an\n * agent's direct-message thread runs in the agent's workspace, so the documents it names are there.\n * A reference then opens that workspace first (`openDocument(id, { workspaceId })`).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\n/** The workspace of the documents referenced inside it (null: the open workspace). */\nexport const DocumentWorkspaceContext = createContext<string | null>(null)\nexport const useDocumentWorkspace = () => useContext(DocumentWorkspaceContext)\n\n/** A reference to a document of another workspace: opening it opens that workspace first. */\nexport function WorkspaceDocumentReference({\n workspaceId,\n docId,\n children,\n className = 'inline-flex rounded-full border px-2 py-0.5 text-xs hover:bg-muted',\n}: {\n workspaceId: string\n docId: string\n children?: ReactNode\n className?: string\n}) {\n const { openDocument } = useBlocksEnvironment()\n return (\n <button\n type=\"button\"\n className={className}\n onClick={() => openDocument(docId, { workspaceId })}\n >\n {children ?? docId}\n </button>\n )\n}\n","/**\n * The conversation's markdown: the kit's `MarkdownRenderer` (`@arbidocs/react`: sanitised HTML,\n * slugs, lazy KaTeX, streaming blocks, tables, code) with what a conversation adds: @mention chips,\n * workspace documents opening in the viewer, quiet external links, document and email pills (the\n * host's chips, `ArbiChatHost.renderDocumentChip` / `renderMailChip`) and Mermaid diagrams.\n */\nimport { useArbiHost, useArbiSession, useDocument } from '@arbidocs/react'\nimport { mentionFromHref, type MentionKind } from '@arbidocs/react/shell'\nimport {\n EntityPill,\n MarkdownCode,\n MarkdownLink,\n MarkdownRenderer as KitMarkdownRenderer,\n MarkdownStreamingContext,\n type MarkdownRendererProps as KitMarkdownRendererProps,\n DocumentEntity,\n} from '@arbidocs/react/ui'\nimport React, { useContext, useMemo } from 'react'\nimport { FileText, Mail } from 'lucide-react'\n\n/** The markdown element overrides, as the kit's renderer takes them. */\ntype Components = NonNullable<KitMarkdownRendererProps['components']>\nimport { MentionChip } from '../../chat/MentionMenu'\nimport { QuietLink } from '../../citations/QuietMarks'\nimport { rehypeDocEntityPills } from '../../chat/rehype-doc-entity-pills'\nimport { workspaceDocIdFromHref } from '../../chat/doc-links'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { MermaidDiagram } from './MermaidDiagram'\nimport { useDocumentWorkspace, WorkspaceDocumentReference } from './DocumentWorkspaceContext'\n\n/** Plain text of a link's children (the `@Label` of a mention link). */\nfunction childrenText(children: React.ReactNode): string {\n return React.Children.toArray(children)\n .map((child) => (typeof child === 'string' || typeof child === 'number' ? String(child) : ''))\n .join('')\n}\n\n/** A mention chip; a mention of the reader stands out. */\nfunction MentionLink({ kind, id, text }: { kind: MentionKind; id: string; text: string }) {\n const currentUserId = useArbiSession().user?.external_id\n return (\n <MentionChip\n kind={kind}\n id={id}\n label={text.replace(/^@/, '')}\n isSelf={kind === 'user' && id === currentUserId}\n />\n )\n}\n\n/**\n * A link to elsewhere, as quiet text. Its menu (Open link / Copy link) is the deliberate step\n * the old confirmation dialog used to be; nothing opens until the menu's primary row is chosen.\n */\nexport function ExternalLink({ href, children }: React.ComponentPropsWithoutRef<'a'>) {\n return (\n <QuietLink href={href} kind=\"external\">\n {children}\n </QuietLink>\n )\n}\n\n/**\n * A workspace document referenced by a link's href rather than by its text.\n *\n * `rehypeDocEntityPills` turns a bare `doc-…` id into a pill, but it only walks\n * TEXT nodes — so `[NVDA DCF Valuation Report](…doc-abc12345…)`, which is how an\n * answer links an artifact it just saved, keeps the id in the href where the\n * plugin never looks. The link then fell through to `ExternalLink`, and opening\n * your own workspace document asked you to confirm an \"external link\" and\n * launched a new tab. It opens in the document viewer, like the pill and the\n * artifact card already do.\n */\nexport function InternalDocLink({\n docId,\n href,\n children,\n}: React.ComponentPropsWithoutRef<'a'> & { docId: string }) {\n const { openDocument } = useBlocksEnvironment()\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) {\n return (\n <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId}>\n {children}\n </WorkspaceDocumentReference>\n )\n }\n\n return (\n <QuietLink href={href} kind=\"document\" onOpen={() => openDocument(docId)}>\n {children}\n </QuietLink>\n )\n}\n\n/** A document of the workspace, as a pill: the host's chip, else the document entity. */\nexport function DocumentChip({ docId }: { docId: string }) {\n const render = useArbiHost().chat?.renderDocumentChip\n const workspaceId = useDocumentWorkspace()\n if (workspaceId) return <WorkspaceDocumentReference workspaceId={workspaceId} docId={docId} />\n return render ? <>{render(docId)}</> : <DefaultDocumentChip docId={docId} />\n}\n\nfunction DefaultDocumentChip({ docId }: { docId: string }) {\n const { data: doc } = useDocument(docId)\n const { openDocument } = useBlocksEnvironment()\n if (!doc)\n return (\n <EntityPill\n icon={<FileText className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label={docId}\n size=\"sm\"\n onClick={() => openDocument(docId)}\n data-testid=\"doc-entity-pill\"\n />\n )\n return (\n <DocumentEntity doc={doc} onClick={() => openDocument(docId)} data-testid=\"doc-entity-pill\" />\n )\n}\n\n/** An email of the person's mailbox, as a pill: the host's chip, else a plain \"Email\". */\nexport function MailChip({ mailId }: { mailId: string }) {\n const render = useArbiHost().chat?.renderMailChip\n if (render) return <>{render(mailId)}</>\n return (\n <EntityPill\n icon={<Mail className=\"w-3.5 h-3.5 flex-shrink-0\" />}\n label=\"Email\"\n size=\"sm\"\n data-testid=\"mail-entity-pill\"\n />\n )\n}\n\n/**\n * The conversation's overrides, layered on the kit's defaults. Module scope, so the reference is stable\n * and memoised markdown blocks do not re-parse.\n */\nconst conversationMarkdownComponents: Partial<Components> = {\n a: function ConversationMarkdownLink({\n href,\n children,\n ...props\n }: React.ComponentPropsWithoutRef<'a'>) {\n const deploymentDomain = useBlocksEnvironment().runtimeConfig.deploymentDomain\n // @mentions: `linkMentions` turned them into `#mention-<id>` links; draw them as chips.\n const mention = mentionFromHref(href)\n if (mention) {\n return <MentionLink kind={mention.kind} id={mention.id} text={childrenText(children)} />\n }\n // Bookmarks: in-page anchors are near-invisible text; the menu jumps or copies the place.\n if (href?.startsWith('#') && !href.startsWith('#cite-')) {\n return (\n <QuietLink href={href} kind=\"anchor\">\n {children}\n </QuietLink>\n )\n }\n // Citations, `cite:` references and bare links: the kit's link.\n if (!href || href.startsWith('#') || href.startsWith('cite:')) {\n return (\n <MarkdownLink href={href} {...props}>\n {children}\n </MarkdownLink>\n )\n }\n // A workspace document is not an external link, wherever it is hosted: it opens in the viewer.\n const docId = workspaceDocIdFromHref(href, deploymentDomain)\n if (docId) {\n return (\n <InternalDocLink docId={docId} href={href} {...props}>\n {children}\n </InternalDocLink>\n )\n }\n return (\n <ExternalLink href={href} {...props}>\n {children}\n </ExternalLink>\n )\n },\n code: function ConversationMarkdownCode(\n props: React.ComponentPropsWithoutRef<'code'> & { inline?: boolean }\n ) {\n const isStreaming = useContext(MarkdownStreamingContext)\n const { className, children } = props\n const language = /language-(\\w+)/.exec(className || '')?.[1]\n if (!language) {\n // Answers often backtick a bare doc id (`doc-f7b3eeb5`). The text-node pass skips code, so\n // the id would stay monospace text; show it as the document pill. Only a whole id (eight\n // alphanumerics): while streaming, a partial one (\"doc-e\") would be looked up and 404.\n const codeText = typeof children === 'string' ? children.trim() : ''\n if (/^doc-[a-zA-Z0-9]{8}$/.test(codeText)) return <DocumentChip docId={codeText} />\n if (/^eml-[a-zA-Z0-9]{8}$/.test(codeText)) return <MailChip mailId={codeText} />\n }\n // Mermaid lazy-loads its own bundle and re-renders SVG on every change. While streaming the\n // fence is almost always partial, so it stays a code block until generation completes.\n if (language === 'mermaid' && !isStreaming) {\n return <MermaidDiagram chart={String(children).replace(/\\n$/, '')} />\n }\n return <MarkdownCode {...props} />\n },\n span: ({ children, className, ...props }: React.ComponentPropsWithoutRef<'span'>) => {\n const docId = (props as Record<string, unknown>)['data-doc-id'] as string | undefined\n if (docId) return <DocumentChip docId={docId} />\n const mailId = (props as Record<string, unknown>)['data-mail-id'] as string | undefined\n if (mailId) return <MailChip mailId={mailId} />\n return (\n <span className={className} {...props}>\n {children}\n </span>\n )\n },\n}\n\n/** Bare `doc-…` / `eml-…` ids in text become `<span data-doc-id>` / `<span data-mail-id>` pills. */\nconst conversationRehypePlugins = [rehypeDocEntityPills]\n\nexport type ConnectedMarkdownProps = Omit<KitMarkdownRendererProps, 'rehypePlugins'>\n\n/**\n * The kit's renderer with the conversation's overrides; a caller's `components` (e.g. the citation\n * core's) still win over both.\n */\nfunction ConnectedMarkdownComponent({ components, ...props }: ConnectedMarkdownProps) {\n const merged = useMemo(\n () =>\n components\n ? { ...conversationMarkdownComponents, ...components }\n : conversationMarkdownComponents,\n [components]\n )\n return (\n <KitMarkdownRenderer {...props} components={merged} rehypePlugins={conversationRehypePlugins} />\n )\n}\n\nexport const ConnectedMarkdown = React.memo(ConnectedMarkdownComponent)\n","/**\n * The PDF document tools (markup, Freeze, signing, signature requests, productions) on the\n * signed-in session, for any host: the API client, the signed-in user, the host's notices and\n * document opening (`BlocksEnvironment`), and the shared caches a change refreshes. A host with its\n * own binding (its own lists to refresh, an XHR upload with progress, Mail) gives it as the host\n * configuration's `documentTools`, field by field. An enclosing `DocumentToolsProvider` (a dialog\n * with its own client) wins.\n */\n\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { arbiQueryKeys, refreshDocuments, useArbi } from '@arbidocs/react'\nimport {\n DocumentToolsProvider,\n clientUpload,\n documentBytesKey,\n useOptionalDocumentTools,\n type DocumentChange,\n type DocumentToolsClient,\n type DocumentToolsEnvironment,\n type DocumentToolsNotify,\n type DocumentUploadRequest,\n} from '@arbidocs/react/document-tools'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\n\n/** What a host binds of the document tools itself; each absent field is the kit's own. */\nexport interface DocumentToolsHost {\n /** The API client the tools call. Default: the host `arbi`'s. */\n client?: DocumentToolsClient\n /** The deployment domain keys are derived for (signing). Default: the host `arbi`'s. */\n deploymentDomain?: string\n /** Open a document or a version the tools made. Default: the environment's `openDocument`. */\n openDocument?: (documentRef: string) => void\n /** Refresh the host's lists after a change. Default: the shared document caches. */\n onDocumentsChanged?: DocumentToolsEnvironment['onDocumentsChanged']\n /** Upload a derived copy. Default: through the API client, into the open workspace. */\n uploadDocument?: DocumentToolsEnvironment['uploadDocument']\n /**\n * Where \"View certificate\" goes for a signature `reference` (e.g. the site's own verify page).\n * Default: the certificate link the API returns (on the deployment domain).\n */\n certificateUrl?: (reference: string) => string\n /** Email a document (a hook): absent, or returning nothing, when mail is not offered. */\n useEmailDocument?: () => ((documentRef: string) => void) | undefined\n}\n\nconst NO_EMAIL = () => undefined\n\nexport function ConnectedDocumentToolsProvider({ children }: { children: ReactNode }) {\n const enclosing = useOptionalDocumentTools()\n return enclosing ? <>{children}</> : <OwnDocumentTools>{children}</OwnDocumentTools>\n}\n\nfunction OwnDocumentTools({ children }: { children: ReactNode }) {\n const arbi = useArbi()\n const queryClient = useQueryClient()\n const host = useHost().documentTools\n const { user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { notify: environmentNotify, openDocument: openInHost } = useBlocksEnvironment()\n const useEmailDocument = host?.useEmailDocument ?? NO_EMAIL\n const emailDocument = useEmailDocument()\n const client = host?.client ?? (arbi.isLoggedIn ? arbi.getClient().fetch : null)\n const signer = useMemo(\n () => (user ? { name: user.name, email: user.email, externalId: user.externalId } : null),\n [user]\n )\n const notify = useCallback<DocumentToolsNotify>(\n (message, kind, options) =>\n environmentNotify(message, kind, {\n description: options?.description,\n action: options?.action,\n }),\n [environmentNotify]\n )\n const ownDocumentsChanged = useCallback(\n async (ids: string[], change: DocumentChange) => {\n // The list carries each version's markup count and the copies; a signature or a saved\n // version is a new current version, with new versions and a new rendered PDF.\n const refresh: Promise<unknown>[] = [refreshDocuments(queryClient, arbi, ids)]\n if (change === 'signed' || change === 'version')\n for (const id of ids)\n refresh.push(\n queryClient.invalidateQueries({ queryKey: arbiQueryKeys.documentVersions(id) }),\n queryClient.invalidateQueries({ queryKey: documentBytesKey(id) })\n )\n await Promise.all(refresh)\n },\n [queryClient, arbi]\n )\n // The server files an upload in the session's open workspace: re-assert it first.\n const ownUpload = useCallback(\n async (request: DocumentUploadRequest) => {\n if (!client) throw new Error('Sign in to save a copy.')\n await ensureWorkspaceOpen()\n return clientUpload(client)(request)\n },\n [client, ensureWorkspaceOpen]\n )\n const ownOpenDocument = useCallback((ref: string) => openInHost(ref), [openInHost])\n if (!client) return <>{children}</>\n return (\n <DocumentToolsProvider\n client={client}\n deploymentDomain={host?.deploymentDomain}\n user={signer}\n notify={notify}\n openDocument={host?.openDocument ?? ownOpenDocument}\n onDocumentsChanged={host?.onDocumentsChanged ?? ownDocumentsChanged}\n uploadDocument={host?.uploadDocument ?? ownUpload}\n emailDocument={emailDocument}\n certificateUrl={host?.certificateUrl}\n >\n {children}\n </DocumentToolsProvider>\n )\n}\n","/**\n * What a host adds to the connected document viewer. The viewer reads documents, versions, PDFs,\n * markup and signatures on the signed-in session by itself; these are the host's own things it\n * cannot know: documents the host makes on the client (an artifact streaming in from a chat, an\n * unsaved draft), the host's dialogs and workflows a document action opens, and how the host lays\n * the viewer out. It is the host configuration's `viewer`. Every field is optional: without one the\n * viewer offers less (no Translate button, no draft controls), never something that does nothing.\n * What changes while the viewer is open is read through hooks (`use…`).\n */\n\nimport type { ReactNode } from 'react'\nimport type { components } from '@arbidocs/client'\nimport { useHost } from '../../provider/host'\n\n/** A document's record, as the viewer reads it. */\nexport type ViewerDocumentRecord = components['schemas']['DocResponse']\n\n/** An artifact being generated in a chat, shown in the viewer as it streams. */\nexport interface ViewerStreamingDocument {\n title?: string | null\n /** The content so far (Markdown, or the html/react source of a live artifact). */\n content: string\n /** How it is carried: a document draft, a live `html` / `react` artifact, an `image`. */\n mode?: string | null\n isComplete: boolean\n}\n\n/** A document the user started on the client, with no backend record until it is saved. */\nexport interface ViewerDraftDocument {\n kind: 'text' | 'audio' | 'photo' | 'video'\n title?: string | null\n /** A text draft's starting content. */\n content?: string | null\n}\n\nexport interface DocumentViewerSupport {\n /** The artifact streaming in as this document, if one is (a hook). */\n useStreamingDocument?: (documentId: string) => ViewerStreamingDocument | undefined\n /** The unsaved draft with this client id, if there is one (a hook). */\n useDraftDocument?: (draftId: string) => ViewerDraftDocument | undefined\n /** A draft's kind (text, photo, audio, video), in place of the tabs. */\n renderDraftKind?: (draftId: string) => ReactNode\n /** A draft's name (editable), in place of the title. */\n renderDraftTitle?: (draftId: string) => ReactNode\n /** The recorder of a photo, audio or video draft: the whole body of the viewer. */\n renderCaptureDraft?: (draftId: string) => ReactNode\n /** A text draft was saved as `documentId`; the viewer shows it next. */\n onDraftSaved?: (draftId: string, documentId: string) => void\n /** Documents related to the one open (near duplicates), beside its name. */\n renderRelated?: (document: ViewerDocumentRecord) => ReactNode\n /** A document as a pill (the comparison's other side). Default: its name. */\n renderDocumentPill?: (documentId: string) => ReactNode\n /** Open the host's share dialog for the document. Default: share it with the workspace. */\n share?: (document: { id: string; name: string | undefined; isPrivate: boolean }) => void\n /** Ask the assistant about a version (`doc-…@v2`) open read-only. Absent: not offered. */\n askAboutVersion?: (versionRef: string) => void\n /** Translate the document (or the version) on screen. Absent: not offered. */\n translate?: (documentRef: string) => void\n /** Start an image generation from the image on screen. Absent: not offered. */\n useImageAsReference?: (documentId: string) => void\n /**\n * A citation being edited elsewhere (a fact's sources, a field's) picks its passages in the text\n * view: clicks and selections there are handed to it (a hook). Absent: passages are not pickable.\n */\n usePassageCitation?: () => PassageCitation | undefined\n /** Open the document's passages in the host's navigator (a passage's menu). Absent: not offered. */\n openInNavigator?: (documentId: string) => void\n /** Start a new label or field in the host's editor (the passage tagging panel). Absent: not offered. */\n createTag?: () => void\n /** How dates read (versions, signatures). Default: `fmtDate`. */\n formatDate?: (iso: string) => string\n /** Whether the viewer is shown in another window, where PDF pages render without the page's web\n * fonts (a hook). */\n useIsDetached?: () => boolean\n}\n\n/** A passage picked for a citation: its chunk and, when known, its page. */\nexport interface PickedPassage {\n chunk_id: string\n page?: number\n}\n\n/** The citation a host is editing, as the text view sees it. */\nexport interface PassageCitation {\n /** The citation picking passages now, and the document it picks in; null when none is. */\n active: { documentId: string; key: string | null } | null\n /** Passages to light (a fact's cited passages while its sources are open). */\n highlighted: readonly string[]\n /** Passages added to the citation. */\n pick: (passages: PickedPassage[]) => void\n /** Passages taken off it. */\n unpick: (chunkIds: string[]) => void\n}\n\nconst NO_SUPPORT: DocumentViewerSupport = {}\n\nexport function useDocumentViewerSupport(): DocumentViewerSupport {\n return useHost().viewer ?? NO_SUPPORT\n}\n\nconst NONE = () => undefined\nconst ATTACHED = () => false\n\n/** The artifact streaming in as this document (none without the host's). */\nexport function useViewerStreamingDocument(\n documentId: string\n): ViewerStreamingDocument | undefined {\n const useStreaming = useDocumentViewerSupport().useStreamingDocument ?? NONE\n return useStreaming(documentId)\n}\n\n/** The unsaved draft with this id (none without the host's). */\nexport function useViewerDraftDocument(draftId: string): ViewerDraftDocument | undefined {\n const useDraft = useDocumentViewerSupport().useDraftDocument ?? NONE\n return useDraft(draftId)\n}\n\n/** The citation picking passages (none without the host's). */\nexport function useViewerPassageCitation(): PassageCitation | undefined {\n const useCitation = useDocumentViewerSupport().usePassageCitation ?? NONE\n return useCitation()\n}\n\n/** Whether the viewer is in another window (never without the host's). */\nexport function useViewerIsDetached(): boolean {\n const useDetached = useDocumentViewerSupport().useIsDetached ?? ATTACHED\n return useDetached()\n}\n"]}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
|
|
5
|
+
var chunkG2BKHCI2_cjs = require('./chunk-G2BKHCI2.cjs');
|
|
5
6
|
var chunkB6MVQCXW_cjs = require('./chunk-B6MVQCXW.cjs');
|
|
6
7
|
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
7
|
-
var chunkG2BKHCI2_cjs = require('./chunk-G2BKHCI2.cjs');
|
|
8
8
|
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
9
9
|
var react = require('react');
|
|
10
10
|
var ui = require('@arbidocs/react/ui');
|
|
@@ -1317,5 +1317,5 @@ exports.useSidebarController = useSidebarController;
|
|
|
1317
1317
|
exports.useSidebarSettle = useSidebarSettle;
|
|
1318
1318
|
exports.workspaceKindColor = workspaceKindColor;
|
|
1319
1319
|
exports.workspaceKindMeta = workspaceKindMeta;
|
|
1320
|
-
//# sourceMappingURL=chunk-
|
|
1321
|
-
//# sourceMappingURL=chunk-
|
|
1320
|
+
//# sourceMappingURL=chunk-HNEOW7F3.cjs.map
|
|
1321
|
+
//# sourceMappingURL=chunk-HNEOW7F3.cjs.map
|