@arbidocs/blocks 0.5.114 → 0.5.116
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-2KXEQENS.cjs → ConnectedCallDock-WER7R222.cjs} +21 -21
- package/dist/{ConnectedCallDock-2KXEQENS.cjs.map → ConnectedCallDock-WER7R222.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-MU3NPNXF.cjs → ConnectedCallRoom-T7OBQTYP.cjs} +14 -14
- package/dist/{ConnectedCallRoom-MU3NPNXF.cjs.map → ConnectedCallRoom-T7OBQTYP.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-VH3I65H6.cjs → ConnectedNativeDocxComparison-546ILGLW.cjs} +19 -19
- package/dist/{ConnectedNativeDocxComparison-VH3I65H6.cjs.map → ConnectedNativeDocxComparison-546ILGLW.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs → ConnectedProductionSetDialog-LHB4VQWC.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs.map → ConnectedProductionSetDialog-LHB4VQWC.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-KQSHCA75.cjs → ConnectedStreamedWordArtifact-S2ZFZLZQ.cjs} +19 -19
- package/dist/{ConnectedStreamedWordArtifact-KQSHCA75.cjs.map → ConnectedStreamedWordArtifact-S2ZFZLZQ.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-OCPFVMLD.cjs → DocumentReviewCard-ZSBZBGFK.cjs} +15 -15
- package/dist/{DocumentReviewCard-OCPFVMLD.cjs.map → DocumentReviewCard-ZSBZBGFK.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-BAGOEMXW.cjs → FilesViewerDialog-6UKR5WEF.cjs} +44 -44
- package/dist/{FilesViewerDialog-BAGOEMXW.cjs.map → FilesViewerDialog-6UKR5WEF.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-EJEIJDOC.cjs → NativeDocxEditor-2LQY2CTV.cjs} +6 -6
- package/dist/{NativeDocxEditor-EJEIJDOC.cjs.map → NativeDocxEditor-2LQY2CTV.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-IMAZICIZ.cjs → WorkspaceTableView-J3C6VH4T.cjs} +8 -8
- package/dist/{WorkspaceTableView-IMAZICIZ.cjs.map → WorkspaceTableView-J3C6VH4T.cjs.map} +1 -1
- package/dist/agents/index.cjs +297 -297
- package/dist/{ai-7U4B4CVF.cjs → ai-IM4A23YT.cjs} +24 -24
- package/dist/ai-IM4A23YT.cjs.map +1 -0
- package/dist/calls/index.cjs +121 -121
- package/dist/chat/DraftingDocChip.d.ts +3 -1
- package/dist/chat/DraftingDocChip.js +7 -4
- package/dist/chat/DraftingDocChip.js.map +2 -2
- package/dist/chat/index.cjs +37 -37
- package/dist/{chunk-4ED7CNOX.cjs → chunk-2CSLFAGF.cjs} +430 -150
- package/dist/chunk-2CSLFAGF.cjs.map +1 -0
- package/dist/{chunk-Q6DQGGP4.cjs → chunk-325GVZE6.cjs} +3 -3
- package/dist/{chunk-Q6DQGGP4.cjs.map → chunk-325GVZE6.cjs.map} +1 -1
- package/dist/{chunk-LFRNBT2I.cjs → chunk-557MJ4IH.cjs} +20 -20
- package/dist/{chunk-LFRNBT2I.cjs.map → chunk-557MJ4IH.cjs.map} +1 -1
- package/dist/{chunk-JSQQV23D.cjs → chunk-6UTKM5AB.cjs} +3 -3
- package/dist/{chunk-JSQQV23D.cjs.map → chunk-6UTKM5AB.cjs.map} +1 -1
- package/dist/{chunk-H5OLHP2U.cjs → chunk-7OPOPYV6.cjs} +3 -3
- package/dist/{chunk-H5OLHP2U.cjs.map → chunk-7OPOPYV6.cjs.map} +1 -1
- package/dist/{chunk-AHT6DQNI.cjs → chunk-B2HNNG25.cjs} +50 -50
- package/dist/{chunk-AHT6DQNI.cjs.map → chunk-B2HNNG25.cjs.map} +1 -1
- package/dist/{chunk-WW6LXQY6.cjs → chunk-B3LZITVF.cjs} +12 -12
- package/dist/{chunk-WW6LXQY6.cjs.map → chunk-B3LZITVF.cjs.map} +1 -1
- package/dist/{chunk-V5IMYLYK.cjs → chunk-BQ5RIWWT.cjs} +3 -3
- package/dist/{chunk-V5IMYLYK.cjs.map → chunk-BQ5RIWWT.cjs.map} +1 -1
- package/dist/{chunk-INEPPS4H.cjs → chunk-COD5ENHK.cjs} +4 -4
- package/dist/{chunk-INEPPS4H.cjs.map → chunk-COD5ENHK.cjs.map} +1 -1
- package/dist/{chunk-MC4F2URI.cjs → chunk-CPG7II4E.cjs} +28 -28
- package/dist/{chunk-MC4F2URI.cjs.map → chunk-CPG7II4E.cjs.map} +1 -1
- package/dist/{chunk-7XT5B2DZ.cjs → chunk-CPR6EHG7.cjs} +47 -47
- package/dist/{chunk-7XT5B2DZ.cjs.map → chunk-CPR6EHG7.cjs.map} +1 -1
- package/dist/{chunk-3U36VYMD.cjs → chunk-DDIW4HLU.cjs} +27 -27
- package/dist/{chunk-3U36VYMD.cjs.map → chunk-DDIW4HLU.cjs.map} +1 -1
- package/dist/chunk-HB2O4THB.cjs +18 -0
- package/dist/{chunk-ZZA756I4.cjs.map → chunk-HB2O4THB.cjs.map} +1 -1
- package/dist/{chunk-IFOGBMAE.cjs → chunk-KLMNCBLY.cjs} +9 -6
- package/dist/chunk-KLMNCBLY.cjs.map +1 -0
- package/dist/{chunk-TDN33HSK.cjs → chunk-KTQOGT2L.cjs} +6 -6
- package/dist/{chunk-TDN33HSK.cjs.map → chunk-KTQOGT2L.cjs.map} +1 -1
- package/dist/{chunk-UUENH4BJ.cjs → chunk-KXIRVKCJ.cjs} +3 -3
- package/dist/{chunk-UUENH4BJ.cjs.map → chunk-KXIRVKCJ.cjs.map} +1 -1
- package/dist/{chunk-436I7PQL.cjs → chunk-NIE3N6OM.cjs} +9 -9
- package/dist/{chunk-436I7PQL.cjs.map → chunk-NIE3N6OM.cjs.map} +1 -1
- package/dist/{chunk-XKDUPU7B.cjs → chunk-NJCK6V6U.cjs} +4 -4
- package/dist/{chunk-XKDUPU7B.cjs.map → chunk-NJCK6V6U.cjs.map} +1 -1
- package/dist/{chunk-5QUL5BZO.cjs → chunk-NNUK5ZM7.cjs} +4 -4
- package/dist/{chunk-5QUL5BZO.cjs.map → chunk-NNUK5ZM7.cjs.map} +1 -1
- package/dist/{chunk-4NPCDS2X.cjs → chunk-NY3YUCOW.cjs} +3 -3
- package/dist/{chunk-4NPCDS2X.cjs.map → chunk-NY3YUCOW.cjs.map} +1 -1
- package/dist/{chunk-6DCIZA3X.cjs → chunk-OEREKAAP.cjs} +75 -75
- package/dist/{chunk-6DCIZA3X.cjs.map → chunk-OEREKAAP.cjs.map} +1 -1
- package/dist/{chunk-3ODEWSRO.cjs → chunk-P77YTTJ3.cjs} +4 -4
- package/dist/{chunk-3ODEWSRO.cjs.map → chunk-P77YTTJ3.cjs.map} +1 -1
- package/dist/{chunk-3R6YHJ3G.cjs → chunk-QHOHDNBU.cjs} +6 -6
- package/dist/{chunk-3R6YHJ3G.cjs.map → chunk-QHOHDNBU.cjs.map} +1 -1
- package/dist/{chunk-LYTIQQQ2.cjs → chunk-R7CJEIA5.cjs} +3 -3
- package/dist/{chunk-LYTIQQQ2.cjs.map → chunk-R7CJEIA5.cjs.map} +1 -1
- package/dist/{chunk-MGQSLMTC.cjs → chunk-SB4M3ITT.cjs} +239 -85
- package/dist/chunk-SB4M3ITT.cjs.map +1 -0
- package/dist/{chunk-2W5E62EY.cjs → chunk-SGYSDABK.cjs} +6 -6
- package/dist/{chunk-2W5E62EY.cjs.map → chunk-SGYSDABK.cjs.map} +1 -1
- package/dist/{chunk-UNDQYTRF.cjs → chunk-T23UTIRI.cjs} +6 -6
- package/dist/{chunk-UNDQYTRF.cjs.map → chunk-T23UTIRI.cjs.map} +1 -1
- package/dist/{chunk-E4BLRF2L.cjs → chunk-TDO5UWXF.cjs} +5 -5
- package/dist/{chunk-E4BLRF2L.cjs.map → chunk-TDO5UWXF.cjs.map} +1 -1
- package/dist/{chunk-4IOYQLKG.cjs → chunk-TP5PGWIO.cjs} +3 -3
- package/dist/{chunk-4IOYQLKG.cjs.map → chunk-TP5PGWIO.cjs.map} +1 -1
- package/dist/{chunk-7X3FS5HQ.cjs → chunk-TT4IF52H.cjs} +35 -35
- package/dist/{chunk-7X3FS5HQ.cjs.map → chunk-TT4IF52H.cjs.map} +1 -1
- package/dist/{chunk-NHHEMBXQ.cjs → chunk-VGCTYTEW.cjs} +22 -14
- package/dist/chunk-VGCTYTEW.cjs.map +1 -0
- package/dist/{chunk-HM5L4SBC.cjs → chunk-VKH3BEZE.cjs} +3 -3
- package/dist/{chunk-HM5L4SBC.cjs.map → chunk-VKH3BEZE.cjs.map} +1 -1
- package/dist/{chunk-GQXPNIRE.cjs → chunk-WAV762GP.cjs} +6 -6
- package/dist/{chunk-GQXPNIRE.cjs.map → chunk-WAV762GP.cjs.map} +1 -1
- package/dist/{chunk-MZ2KZXNU.cjs → chunk-WXUU3COI.cjs} +3 -3
- package/dist/{chunk-MZ2KZXNU.cjs.map → chunk-WXUU3COI.cjs.map} +1 -1
- package/dist/{chunk-BW5MF464.cjs → chunk-XKVPSOKP.cjs} +4 -4
- package/dist/{chunk-BW5MF464.cjs.map → chunk-XKVPSOKP.cjs.map} +1 -1
- package/dist/{chunk-57EE6CMW.cjs → chunk-Y24V6HPR.cjs} +15 -15
- package/dist/{chunk-57EE6CMW.cjs.map → chunk-Y24V6HPR.cjs.map} +1 -1
- package/dist/{chunk-ET3NVY27.cjs → chunk-YGBHY67W.cjs} +5 -5
- package/dist/{chunk-ET3NVY27.cjs.map → chunk-YGBHY67W.cjs.map} +1 -1
- package/dist/{chunk-7TEUGFIL.cjs → chunk-YGXOKB5Z.cjs} +4 -4
- package/dist/{chunk-7TEUGFIL.cjs.map → chunk-YGXOKB5Z.cjs.map} +1 -1
- package/dist/connect/docx.cjs +23 -23
- package/dist/connect/index.cjs +1231 -1069
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +33 -33
- package/dist/connection/conversation/ConnectedConversation.js +143 -55
- package/dist/connection/conversation/ConnectedConversation.js.map +2 -2
- package/dist/connection/conversation/ConversationSendButton.d.ts +1 -0
- package/dist/connection/conversation/ConversationSendButton.js +3 -2
- package/dist/connection/conversation/ConversationSendButton.js.map +2 -2
- package/dist/connection/conversation/DocumentTargetNotice.d.ts +7 -0
- package/dist/connection/conversation/DocumentTargetNotice.js +45 -0
- package/dist/connection/conversation/DocumentTargetNotice.js.map +7 -0
- package/dist/connection/conversation/documentSwitch.d.ts +9 -0
- package/dist/connection/conversation/documentSwitch.js +40 -0
- package/dist/connection/conversation/documentSwitch.js.map +7 -0
- package/dist/connection/docx/ConnectedNativeDocxEditor.js +10 -2
- package/dist/connection/docx/ConnectedNativeDocxEditor.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +124 -21
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/VersionDropdown.d.ts +9 -0
- package/dist/connection/viewer/VersionDropdown.js +39 -0
- package/dist/connection/viewer/VersionDropdown.js.map +7 -0
- package/dist/connection/viewer/ViewerPdfPane.js +4 -1
- package/dist/connection/viewer/ViewerPdfPane.js.map +2 -2
- package/dist/connection/viewer/useViewerBlobs.d.ts +3 -1
- package/dist/connection/viewer/useViewerBlobs.js +14 -8
- package/dist/connection/viewer/useViewerBlobs.js.map +2 -2
- package/dist/connection/viewer/useViewerTabs.js +10 -0
- package/dist/connection/viewer/useViewerTabs.js.map +2 -2
- package/dist/dashboards/index.cjs +1 -1
- package/dist/docx/DocxCommandMenu.d.ts +8 -0
- package/dist/docx/DocxCommandMenu.js +202 -0
- package/dist/docx/DocxCommandMenu.js.map +7 -0
- package/dist/docx/NativeDocxEditor.d.ts +4 -2
- package/dist/docx/NativeDocxEditor.js +54 -13
- package/dist/docx/NativeDocxEditor.js.map +2 -2
- package/dist/docx/RibbonMenu.d.ts +3 -1
- package/dist/docx/RibbonMenu.js +10 -3
- package/dist/docx/RibbonMenu.js.map +2 -2
- package/dist/docx/RibbonOverflow.d.ts +3 -0
- package/dist/docx/RibbonOverflow.js +24 -1
- package/dist/docx/RibbonOverflow.js.map +2 -2
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/signatures/SignatureFields.d.ts +5 -1
- package/dist/docx/signatures/SignatureFields.js +57 -10
- package/dist/docx/signatures/SignatureFields.js.map +2 -2
- package/dist/embed/index.cjs +38 -38
- package/dist/files/index.cjs +224 -224
- package/dist/index.cjs +1731 -1731
- package/dist/settings/index.cjs +147 -147
- package/dist/shell/index.cjs +90 -90
- package/dist/site/index.cjs +5 -5
- package/dist/studio/index.cjs +27 -27
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +54 -54
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/docx/styles.css +94 -0
- package/dist/ai-7U4B4CVF.cjs.map +0 -1
- package/dist/chunk-4ED7CNOX.cjs.map +0 -1
- package/dist/chunk-IFOGBMAE.cjs.map +0 -1
- package/dist/chunk-MGQSLMTC.cjs.map +0 -1
- package/dist/chunk-NHHEMBXQ.cjs.map +0 -1
- package/dist/chunk-ZZA756I4.cjs +0 -18
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var chunkYZSQ7F5K_cjs = require('./chunk-YZSQ7F5K.cjs');
|
|
5
4
|
var chunkJV5TVUOU_cjs = require('./chunk-JV5TVUOU.cjs');
|
|
5
|
+
var chunkYZSQ7F5K_cjs = require('./chunk-YZSQ7F5K.cjs');
|
|
6
6
|
var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var ui = require('@arbidocs/react/ui');
|
|
@@ -621,5 +621,5 @@ exports.SidebarBadgeRow = SidebarBadgeRow;
|
|
|
621
621
|
exports.SidebarRowHoverContext = SidebarRowHoverContext;
|
|
622
622
|
exports.useShellStartInset = useShellStartInset;
|
|
623
623
|
exports.useSidebarContext = useSidebarContext;
|
|
624
|
-
//# sourceMappingURL=chunk-
|
|
625
|
-
//# sourceMappingURL=chunk-
|
|
624
|
+
//# sourceMappingURL=chunk-325GVZE6.cjs.map
|
|
625
|
+
//# sourceMappingURL=chunk-325GVZE6.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shell/sidebar-context.ts","../src/shell/SidebarBadgeRow.tsx","../src/lib/start-inset.ts","../src/shell/Sidebar.tsx"],"names":["createContext","useContext","forwardRef","SidebarBadgeRow","jsxs","cn","jsx","Tooltip","TooltipTrigger","TooltipContent","useEffect","useMemo","useRef","useDrawerBehavior","testIdOr","Fragment","BlocksTooltipProvider","useState","ActionLink","PanelLeftClose","PanelLeftOpen","X"],"mappings":";;;;;;;;;;AAYO,IAAM,sBAAA,GAAwC;AAAA,EACnD,cAAA,EAAgB,iBAAA;AAAA,EAChB,WAAA,EAAa,cAAA;AAAA,EACb,WAAA,EAAa,cAAA;AAAA,EACb,mBAAA,EAAqB;AACvB;AAOO,IAAM,iBAAiBA,mBAAA,CAAmC;AAAA,EAC/D,QAAA,EAAU,IAAA;AAAA,EACV,MAAA,EAAQ;AACV,CAAC,CAAA;AACM,IAAM,iBAAA,GAAoB,MAA2BC,gBAAA,CAAW,cAAc;AAG9E,IAAM,sBAAA,GAAyBD,oBAAc,KAAK;ACIlD,IAAM,eAAA,GAAkBE,gBAAA;AAAA,EAC7B,SAASC,gBAAAA,CACP,EAAE,IAAA,EAAM,OAAO,KAAA,EAAO,SAAA,EAAW,OAAA,EAAS,WAAA,EAAa,WAAW,IAAA,GAAO,QAAA,EAAU,GAAG,IAAA,IACtF,GAAA,EACA;AACA,IAAA,MAAM,EAAE,QAAA,EAAS,GAAI,iBAAA,EAAkB;AACvC,IAAA,MAAM,QAAA,GAAW,OAAA,KAAY,QAAA,GAAW,KAAA,GAAQ,MAAA,CAAA;AAChD,IAAA,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SAAA,EAAU,sDAAA;AAAA,MAET,QAAA,EAAA;AAAA,QAAA,IAAA;AAAA,wBACDE,cAAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YACL,OAAA,EAAS,OAAA;AAAA,YACT,YAAA,EAAY,UAAA;AAAA,YACZ,eAAaQ,0BAAA,CAAS,MAAA,EAAQ,EAAE,MAAA,EAAQ,oBAAoB,CAAA;AAAA,YAC5D,SAAA,EAAU,kIAAA;AAAA,YAEV,QAAA,kBAAAR,cAAAA,CAACe,aAAA,EAAA,EAAE,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AACxB;AAAA;AAAA,GACF;AAEJ;AAIO,IAAM,OAAA,GAAU;AAAA,EACrB,IAAA,EAAM,WAAA;AAAA,EACN,MAAA,EAAQ,aAAA;AAAA,EACR,GAAA,EAAK,UAAA;AAAA,EACL,KAAA,EAAO,YAAA;AAAA,EACP,UAAA,EAAY,iBAAA;AAAA,EACZ,OAAA,EAAS,cAAA;AAAA,EACT,MAAA,EAAQ,aAAA;AAAA,EACR,SAAA,EAAW,gBAAA;AAAA,EACX,QAAA,EAAU,eAAA;AAAA,EACV,YAAA,EAAc;AAChB","file":"chunk-Q6DQGGP4.cjs","sourcesContent":["import { createContext, useContext } from 'react'\n\n/** Fixed strings of the sidebar family. Set once on `Sidebar.Root`; parts read them from context. */\nexport interface SidebarLabels {\n /** The sidebar's accessible name (the Root `aria-label` prop wins). */\n mainNavigation: string\n hideSidebar: string\n showSidebar: string\n /** The drawer's close button (the `closeLabel` prop wins). */\n closeNavigationMenu: string\n}\n\nexport const DEFAULT_SIDEBAR_LABELS: SidebarLabels = {\n mainNavigation: 'Main navigation',\n hideSidebar: 'Hide sidebar',\n showSidebar: 'Show sidebar',\n closeNavigationMenu: 'Close navigation menu',\n}\n\nexport interface SidebarContextValue {\n /** Labels are visible (full width), as opposed to the icon-only rail. */\n expanded: boolean\n labels: SidebarLabels\n}\nexport const SidebarContext = createContext<SidebarContextValue>({\n expanded: true,\n labels: DEFAULT_SIDEBAR_LABELS,\n})\nexport const useSidebarContext = (): SidebarContextValue => useContext(SidebarContext)\n\n/** True while the surrounding row is hovered/focused; trailing controls may brighten on it. */\nexport const SidebarRowHoverContext = createContext(false)\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { useSidebarContext } from './sidebar-context'\n\nexport interface SidebarBadgeRowProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'children'\n> {\n /** Glyph (20px). */\n icon: ReactNode\n /** Visible label of the expanded row; the tooltip of the icon-only rail. */\n label: string\n /** Unread/pending number. Hidden at 0 or `undefined`; values above 9 read \"9+\". */\n count?: number\n /**\n * Accessible name including the count, for example \"Notifications, 2 unread\". Defaults to\n * `label` plus the count.\n */\n ariaLabel?: string\n /**\n * `row`: a labelled row styled like the module rows, badge at the right. `icon`: icon-only with\n * the badge on the corner. Default follows the sidebar (`row` expanded, `icon` on the rail).\n */\n variant?: 'row' | 'icon'\n /** Test id of the count badge. */\n badgeTestId?: string\n}\n\n/**\n * A sidebar row that carries a badge and may open something (a panel, a popover): the\n * notifications and contacts rows above the account bar. A real button that forwards its ref and\n * rest props, so it can be a popover trigger (`<DropdownMenuTrigger asChild>`). The badge is\n * visible in both the expanded row and the icon-only rail, and the accessible name carries the\n * count in both.\n */\nexport const SidebarBadgeRow = forwardRef<HTMLButtonElement, SidebarBadgeRowProps>(\n function SidebarBadgeRow(\n { icon, label, count, ariaLabel, variant, badgeTestId, className, type = 'button', ...rest },\n ref\n ) {\n const { expanded } = useSidebarContext()\n const resolved = variant ?? (expanded ? 'row' : 'icon')\n const hasCount = count !== undefined && count > 0\n const badgeText = hasCount ? (count > 9 ? '9+' : String(count)) : null\n const name = ariaLabel ?? (hasCount ? `${label}, ${count}` : label)\n\n if (resolved === 'row') {\n return (\n <button\n ref={ref}\n type={type}\n aria-label={name}\n data-slot=\"sidebar-badge-row\"\n data-variant=\"row\"\n className={cn(\n 'group flex h-9 w-full cursor-pointer items-center rounded-md px-3 text-left text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11',\n className\n )}\n {...rest}\n >\n <span className=\"flex size-5 flex-shrink-0 items-center justify-center\" aria-hidden>\n {icon}\n </span>\n <span className=\"ml-3 min-w-0 truncate\" aria-hidden>\n {label}\n </span>\n {badgeText && (\n <span\n aria-hidden\n data-testid={badgeTestId}\n className=\"ml-auto inline-flex min-w-5 flex-shrink-0 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-semibold leading-5 tabular-nums text-primary-foreground\"\n >\n {badgeText}\n </span>\n )}\n </button>\n )\n }\n\n const iconButton = (\n <button\n ref={ref}\n type={type}\n aria-label={name}\n data-slot=\"sidebar-badge-row\"\n data-variant=\"icon\"\n title={variant === 'icon' ? label : undefined}\n className={cn(\n 'relative m-0 flex h-9 w-12 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11',\n className\n )}\n {...rest}\n >\n <span className=\"flex size-5 items-center justify-center\" aria-hidden>\n {icon}\n </span>\n {badgeText && (\n <span\n aria-hidden\n data-testid={badgeTestId}\n className=\"absolute right-1 top-0.5 flex min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold leading-4 tabular-nums text-primary-foreground\"\n >\n {badgeText}\n </span>\n )}\n </button>\n )\n // A standalone icon button (the page header) keeps its native title; the rail uses a tooltip.\n if (variant === 'icon') return iconButton\n return (\n <Tooltip delayDuration={50}>\n <TooltipTrigger asChild>{iconButton}</TooltipTrigger>\n <TooltipContent side=\"right\" sideOffset={8}>\n {label}\n </TooltipContent>\n </Tooltip>\n )\n }\n)\n","import { useEffect } from 'react'\n\n/**\n * The CSS custom property that carries how much of the screen's start (left) edge a docked sidebar\n * takes, set on `<html>`. A floating element pinned to the start corner (the install prompt)\n * positions itself `calc(var(--shell-start-inset, 0px) + 0.75rem)` so it never covers the\n * sidebar's footer (the account menu).\n */\nexport const SHELL_START_INSET_VAR = '--shell-start-inset'\n\nconst widths = new Map<symbol, number>()\n\nfunction apply(): void {\n if (typeof document === 'undefined') return\n const inset = Math.max(0, ...widths.values())\n const style = document.documentElement.style\n if (inset > 0) style.setProperty(SHELL_START_INSET_VAR, `${inset}px`)\n else style.removeProperty(SHELL_START_INSET_VAR)\n}\n\n/**\n * Report a sidebar docked at the start edge, `width` px wide (0 while it is collapsed or is an\n * overlay drawer), to {@link SHELL_START_INSET_VAR}. `Sidebar.Root` calls it; call it from your\n * own docked side panel.\n */\nexport function useShellStartInset(width: number): void {\n useEffect(() => {\n const key = Symbol('shell-start-inset')\n widths.set(key, width)\n apply()\n return () => {\n widths.delete(key)\n apply()\n }\n }, [width])\n}\n","import {\n Fragment,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n type PointerEventHandler,\n} from 'react'\nimport { PanelLeftClose, PanelLeftOpen, X } from 'lucide-react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport {\n DEFAULT_SIDEBAR_LABELS,\n SidebarContext,\n SidebarRowHoverContext,\n useSidebarContext,\n type SidebarLabels,\n} from './sidebar-context'\nimport { SidebarBadgeRow } from './SidebarBadgeRow'\nimport { ActionLink } from '../components/ActionLink'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { useDrawerBehavior } from '../lib/use-drawer'\nimport { useShellStartInset } from '../lib/start-inset'\nimport type { SidebarMode } from '../lib/sidebar-mode'\nimport type { NavItem, NavItemIndicator, NavSection } from './types'\n\n/**\n * Sidebar: the one tinted column that carries the app frame. Compound parts:\n * Sidebar.Root positioning shell for the four modes (drawer / collapsed / pinned / rail)\n * Sidebar.Header top block (switcher, ask field, pin toggle)\n * Sidebar.Nav the rows: pass `items` (NavItem[]) or compose Sidebar.NavItem children\n * Sidebar.Group a labelled run of rows (heading when expanded, divider on the rail)\n * Sidebar.Footer pinned to the bottom (offline pill, tips card, action cluster)\n * Sidebar.PinToggle / Sidebar.DrawerHeader the header's two stock controls\n *\n * Presentational and controlled: the app resolves `mode`/`expanded` (see `resolveSidebarLayout`\n * and `useSidebarSettle`) and owns where hover/pin/drawer state lives.\n */\n\nconst noop = () => {}\n\nconst COLLAPSED_PX = 64\nconst EXPANDED_PX = 256\nconst COLLAPSED_WIDTH = `${COLLAPSED_PX}px`\nconst EXPANDED_WIDTH = `${EXPANDED_PX}px`\n\nexport interface SidebarRootProps {\n /** Constrain the drawer to an embedded frame. The app keeps the viewport default. */\n contained?: boolean\n mode: SidebarMode\n /** Labels visible. Provided to every part through context. */\n expanded: boolean\n /** `rail` mode: floats open to full width. */\n isHovering?: boolean\n onBackdropClick?: () => void\n /** `rail` mode on touch: the floated-open rail dims the content behind it; tapping it closes. */\n hasRailBackdrop?: boolean\n onMouseEnter?: () => void\n onMouseLeave?: () => void\n onPointerEnter?: PointerEventHandler<HTMLElement>\n onPointerLeave?: PointerEventHandler<HTMLElement>\n children: ReactNode\n className?: string\n 'aria-label'?: string\n labels?: Partial<SidebarLabels>\n /** Root id (default `sidebar`). */\n 'data-testid'?: string\n /** Drawer backdrop id (default `sidebar-backdrop`). */\n backdropTestId?: string\n}\n\nfunction SidebarRoot({\n mode,\n contained = false,\n expanded,\n isHovering = false,\n onBackdropClick,\n hasRailBackdrop = false,\n onMouseEnter,\n onMouseLeave,\n onPointerEnter,\n onPointerLeave,\n children,\n className,\n 'aria-label': ariaLabelProp,\n labels,\n 'data-testid': testId,\n backdropTestId,\n}: SidebarRootProps) {\n const mergedLabels = useMemo(() => ({ ...DEFAULT_SIDEBAR_LABELS, ...labels }), [labels])\n // The drawer is a modal: scroll lock, Escape, focus trap and focus return to the opener.\n const drawerRef = useRef<HTMLDivElement>(null)\n const isDrawer = mode === 'drawer'\n useDrawerBehavior(isDrawer, onBackdropClick ?? noop, drawerRef)\n // Floating start-corner elements (the install prompt) sit clear of the docked sidebar; a rail\n // expanding on hover floats over the page, so only its collapsed width counts.\n useShellStartInset(mode === 'pinned' ? EXPANDED_PX : mode === 'rail' ? COLLAPSED_PX : 0)\n const ariaLabel = ariaLabelProp ?? mergedLabels.mainNavigation\n const contextValue = useMemo(() => ({ expanded, labels: mergedLabels }), [expanded, mergedLabels])\n // `navBase` omits horizontal padding so each mode owns its own: the collapsed state must\n // reach a true 0 width, which an `!important` px would block.\n const navBase =\n 'group/sidebar bg-sidebar border-r border-border text-foreground scrollbar-themed flex flex-col h-full overflow-y-auto overflow-x-hidden pb-safe pt-3 transition-all duration-300 ease-in-out'\n const common = {\n 'aria-label': ariaLabel,\n 'data-testid': testIdOr(testId, { testId: 'sidebar' }),\n 'data-slot': 'sidebar',\n 'data-mode': mode,\n } as const\n const fixedWidth: CSSProperties = { width: EXPANDED_WIDTH, minWidth: EXPANDED_WIDTH }\n\n let body: ReactNode\n if (mode === 'drawer') {\n // Small-screen off-canvas panel + dismiss backdrop; bypasses the hover/collapse model. The\n // wrapper is the modal dialog; the nav landmark sits inside it.\n body = (\n <div\n ref={drawerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n data-slot=\"sidebar-drawer\"\n className={cn(contained ? 'absolute' : 'fixed', 'inset-0 z-50')}\n >\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={onBackdropClick}\n aria-hidden=\"true\"\n data-testid={testIdOr(backdropTestId, { testId: 'sidebar-backdrop' })}\n />\n <nav\n {...common}\n className={cn(navBase, '!px-3 absolute left-0 top-0 pt-safe shadow-xl', className)}\n style={fixedWidth}\n >\n {children}\n </nav>\n </div>\n )\n } else if (mode === 'collapsed') {\n // Stays mounted at width 0 so the transition runs on both enter and leave. Horizontal padding\n // is dropped or overflow-hidden would reveal a clipped sliver of the icons.\n body = (\n <nav\n {...common}\n className={cn(navBase, 'absolute left-0 top-0 z-[45]', className)}\n style={{\n width: '0px',\n minWidth: 0,\n paddingLeft: 0,\n paddingRight: 0,\n borderRightWidth: 0,\n pointerEvents: 'none',\n }}\n // Width 0 hides the links visually; inert also takes them out of the tab order and the\n // accessibility tree.\n inert\n >\n {children}\n </nav>\n )\n } else if (mode === 'pinned') {\n body = (\n <nav\n {...common}\n className={cn(navBase, '!px-3 relative flex-shrink-0', className)}\n style={fixedWidth}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n >\n {children}\n </nav>\n )\n } else {\n // Rail: a permanent spacer keeps the flex layout still; the nav is always absolute so only\n // its width animates on hover (no layout jump).\n body = (\n <>\n <div\n className=\"bg-sidebar border-r border-border flex flex-col h-full relative px-0 pb-safe flex-shrink-0\"\n style={{ width: COLLAPSED_WIDTH, minWidth: COLLAPSED_WIDTH }}\n aria-hidden=\"true\"\n />\n {isHovering && hasRailBackdrop && (\n <div\n className=\"fixed inset-0 z-[44] bg-black/40\"\n onClick={onBackdropClick}\n aria-hidden=\"true\"\n data-testid={testIdOr(backdropTestId, { testId: 'sidebar-backdrop' })}\n />\n )}\n <nav\n {...common}\n className={cn(\n navBase,\n isHovering ? '!px-3 shadow-xl' : '!px-2',\n 'absolute left-0 top-0 z-[45]',\n className\n )}\n style={{\n width: isHovering ? EXPANDED_WIDTH : COLLAPSED_WIDTH,\n minWidth: isHovering ? EXPANDED_WIDTH : COLLAPSED_WIDTH,\n }}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n >\n {children}\n </nav>\n </>\n )\n }\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <BlocksTooltipProvider>{body}</BlocksTooltipProvider>\n </SidebarContext.Provider>\n )\n}\n\nexport interface SidebarSectionProps {\n children: ReactNode\n className?: string\n 'data-testid'?: string\n}\n\nfunction SidebarHeader({ children, className, 'data-testid': testId }: SidebarSectionProps) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-3 pb-3', className)}\n >\n {children}\n </div>\n )\n}\n\nexport interface SidebarNavProps extends Omit<SidebarSectionProps, 'children'> {\n children?: ReactNode\n /** Rows as data. Children render after them. */\n items?: NavItem[]\n /** Labelled groups of rows as data (each a `Sidebar.Group`), after `items`. */\n sections?: NavSection[]\n}\n\nfunction SidebarNav({\n items,\n sections,\n children,\n className,\n 'data-testid': testId,\n}: SidebarNavProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n data-slot=\"sidebar-nav\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-0.5', !expanded && 'items-center', className)}\n >\n {items?.map((item) => (\n <SidebarNavItem key={item.id} {...item} />\n ))}\n {sections?.map((section, index) => (\n <Fragment key={section.id}>\n {/* An unlabelled run after other rows is set apart, so it never reads as part of the\n group above it. */}\n {!section.label && (index > 0 || !!items?.length) && (\n <div\n role=\"separator\"\n data-slot=\"sidebar-group-divider\"\n className={cn('my-1 h-px bg-border', expanded ? 'mx-2' : 'w-6')}\n />\n )}\n <SidebarGroup\n label={section.label}\n ariaLabel={section.ariaLabel}\n data-testid={section.testId}\n >\n {section.items.map((item) => (\n <SidebarNavItem key={item.id} {...item} />\n ))}\n </SidebarGroup>\n </Fragment>\n ))}\n {children}\n </div>\n )\n}\n\nexport interface SidebarGroupProps extends SidebarSectionProps {\n /** Group heading. Shown above the rows when expanded; a thin divider stands in on the rail. */\n label?: ReactNode\n /** Accessible name when `label` is not plain text. */\n ariaLabel?: string\n}\n\n/** A labelled run of rows inside the nav (for example \"Workspace\", \"Tools\"). */\nfunction SidebarGroup({\n label,\n ariaLabel,\n children,\n className,\n 'data-testid': testId,\n}: SidebarGroupProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : undefined)}\n data-slot=\"sidebar-group\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-0.5', !expanded && 'items-center', className)}\n >\n {label &&\n (expanded ? (\n <SidebarGroupLabel>{label}</SidebarGroupLabel>\n ) : (\n <div\n role=\"separator\"\n data-slot=\"sidebar-group-divider\"\n className=\"my-1 h-px w-6 bg-border\"\n />\n ))}\n {children}\n </div>\n )\n}\n\n/** The heading of a `Sidebar.Group` (exported for custom headings). Hidden by the group on the rail. */\nfunction SidebarGroupLabel({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <div\n data-slot=\"sidebar-group-label\"\n className={cn(\n 'px-2 pb-0.5 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nfunction SidebarFooter({ children, className, 'data-testid': testId }: SidebarSectionProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-testid={testId}\n className={cn(\n 'mt-auto flex flex-shrink-0 flex-col gap-2 pt-3 pb-3',\n !expanded && 'items-center',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nconst INDICATOR_TONES: Record<NavItemIndicator, string> = {\n progress: 'bg-primary',\n error: 'bg-red-solid',\n attention: 'bg-yellow-solid',\n}\n\nexport type SidebarNavItemProps = Omit<NavItem, 'id'> & {\n id?: string\n className?: string\n /** Tooltip shown on the icon-only rail; defaults to the label. */\n tooltip?: string\n}\n\n/**\n * One row: [icon] [label] [count] [trailing]. 36px (44px on coarse pointers). The active row is\n * the selection tint, never a filled block; counts are quiet numbers, not pills.\n *\n * The expanded row is a div with role=\"button\" (not a native <button>) so an interactive\n * `trailing` control can be nested without producing button-in-button markup.\n */\nfunction SidebarNavItem({\n label,\n icon,\n active = false,\n onSelect,\n href,\n external,\n pressed,\n count,\n countIcon,\n testId,\n disabled = false,\n trailing,\n indicator,\n className,\n tooltip,\n}: SidebarNavItemProps) {\n const { expanded } = useSidebarContext()\n // Tracked as state (not CSS :hover) so a trailing control can read it via context.\n const [isRowActive, setIsRowActive] = useState(false)\n const tip = expanded ? undefined : (tooltip ?? label)\n // A toggle row says whether it is pressed; a destination whether it is the current page.\n const selected = active || pressed === true\n const state =\n pressed !== undefined\n ? { 'aria-pressed': pressed }\n : { 'aria-current': active ? ('page' as const) : undefined }\n\n if (!expanded) {\n const railButton = (\n <ActionLink\n href={href}\n external={external}\n onSelect={onSelect}\n disabled={disabled}\n aria-label={label}\n {...state}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={cn(\n 'm-0 flex h-9 w-12 items-center justify-center rounded-md transition-colors pointer-coarse:h-11',\n selected\n ? 'bg-accent text-accent-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n disabled && 'pointer-events-none cursor-not-allowed opacity-30',\n className\n )}\n >\n <div className=\"flex size-5 items-center justify-center\">\n {indicator ? (\n <div className=\"relative\">\n {icon}\n <div\n data-slot=\"sidebar-nav-indicator\"\n data-tone={indicator}\n className={cn(\n 'absolute -right-1 -top-1 size-2.5 rounded-full border border-sidebar',\n INDICATOR_TONES[indicator]\n )}\n />\n </div>\n ) : (\n icon\n )}\n </div>\n </ActionLink>\n )\n if (!tip) return railButton\n return (\n <Tooltip delayDuration={50}>\n <TooltipTrigger asChild>{railButton}</TooltipTrigger>\n <TooltipContent side=\"right\" sideOffset={8}>\n {tip}\n </TooltipContent>\n </Tooltip>\n )\n }\n\n const rowClass = cn(\n 'group flex h-9 w-full cursor-pointer items-center rounded-md px-3 text-sm transition-colors pointer-coarse:h-11',\n selected\n ? 'bg-accent font-semibold text-accent-foreground'\n : 'font-medium text-muted-foreground hover:bg-muted hover:text-foreground',\n disabled && 'pointer-events-none cursor-not-allowed opacity-30',\n className\n )\n const countNode = count !== undefined && (\n <span\n // `ml-auto` lines the counts up on the right edge as one column of numbers.\n className={cn(\n 'ml-auto inline-flex flex-shrink-0 items-center gap-0.5 pl-2 text-xs font-normal tabular-nums',\n selected ? 'text-accent-foreground' : 'text-muted-foreground'\n )}\n >\n {countIcon}\n {count}\n </span>\n )\n\n // A link row without a nested control is the anchor itself.\n if (href && !disabled && !trailing) {\n return (\n <ActionLink\n href={href}\n external={external}\n onSelect={onSelect}\n {...state}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={rowClass}\n >\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n </ActionLink>\n )\n }\n\n // A link row with a nested control: a stretched anchor sits under the content, and the\n // trailing control rises above it, so there is never an interactive element inside an anchor.\n if (href && !disabled) {\n return (\n <div\n onMouseEnter={() => setIsRowActive(true)}\n onMouseLeave={() => setIsRowActive(false)}\n onFocusCapture={() => setIsRowActive(true)}\n onBlurCapture={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setIsRowActive(false)\n }}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={cn(rowClass, 'relative')}\n >\n <ActionLink\n href={href}\n external={external}\n onSelect={onSelect}\n aria-label={label}\n {...state}\n className=\"absolute inset-0 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <div className=\"pointer-events-none flex min-w-0 flex-1 items-center\">\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n </div>\n <SidebarRowHoverContext.Provider value={isRowActive}>\n <span className=\"relative ml-2 flex flex-shrink-0 items-center\">{trailing}</span>\n </SidebarRowHoverContext.Provider>\n </div>\n )\n }\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n {...state}\n onClick={disabled ? undefined : onSelect}\n onMouseEnter={() => setIsRowActive(true)}\n onMouseLeave={() => setIsRowActive(false)}\n onFocusCapture={() => setIsRowActive(true)}\n onBlurCapture={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setIsRowActive(false)\n }}\n onKeyDown={\n disabled\n ? undefined\n : (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onSelect()\n }\n }\n }\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={rowClass}\n >\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n {trailing && (\n <SidebarRowHoverContext.Provider value={isRowActive}>\n <span className=\"ml-auto flex flex-shrink-0 items-center pl-2\">{trailing}</span>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n\nexport interface SidebarPinToggleProps {\n isPinned: boolean\n onToggle: () => void\n className?: string\n /** Default `sidebar-pin-button`. */\n 'data-testid'?: string\n}\n\n/**\n * Pin/unpin button, revealed while the pointer is over the sidebar. It is always visible on\n * coarse pointers (no hover on touch) and revealed by keyboard focus anywhere in the sidebar. It\n * is hidden with opacity and pointer-events, never display:none, so it keeps its accessible name\n * and stays in the tab order.\n */\nfunction SidebarPinToggle({\n isPinned,\n onToggle,\n className,\n 'data-testid': testId,\n}: SidebarPinToggleProps) {\n const { expanded, labels } = useSidebarContext()\n const label = isPinned ? labels.hideSidebar : labels.showSidebar\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n title={label}\n aria-label={label}\n aria-pressed={isPinned}\n data-testid={testIdOr(testId, { testId: 'sidebar-pin-button' })}\n className={cn(\n 'flex flex-shrink-0 items-center justify-center rounded-md text-muted-foreground transition-[opacity,colors] hover:bg-muted hover:text-foreground pointer-coarse:size-11',\n 'pointer-events-none opacity-0 group-hover/sidebar:pointer-events-auto group-hover/sidebar:opacity-100',\n 'group-focus-within/sidebar:pointer-events-auto group-focus-within/sidebar:opacity-100',\n 'pointer-coarse:pointer-events-auto pointer-coarse:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100',\n expanded ? 'size-9' : 'h-9 w-12',\n className\n )}\n >\n {isPinned ? <PanelLeftClose className=\"size-5\" /> : <PanelLeftOpen className=\"size-5\" />}\n </button>\n )\n}\n\nexport interface SidebarDrawerHeaderProps {\n /** Brand mark. */\n logo: ReactNode\n onClose: () => void\n closeLabel?: string\n /** Close button id (default `mobile-nav-close`). */\n 'data-testid'?: string\n}\n\n/** The phone drawer's header: brand mark and a 44px close button. */\nfunction SidebarDrawerHeader({\n logo,\n onClose,\n closeLabel: closeLabelProp,\n 'data-testid': testId,\n}: SidebarDrawerHeaderProps) {\n const { labels } = useSidebarContext()\n const closeLabel = closeLabelProp ?? labels.closeNavigationMenu\n return (\n <div\n data-slot=\"sidebar-drawer-header\"\n className=\"flex flex-shrink-0 items-center justify-between pb-2\"\n >\n {logo}\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={closeLabel}\n data-testid={testIdOr(testId, { testId: 'mobile-nav-close' })}\n className=\"flex size-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n\nexport { DEFAULT_SIDEBAR_LABELS, SidebarRowHoverContext, useSidebarContext, type SidebarLabels }\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Header: SidebarHeader,\n Nav: SidebarNav,\n Group: SidebarGroup,\n GroupLabel: SidebarGroupLabel,\n NavItem: SidebarNavItem,\n Footer: SidebarFooter,\n PinToggle: SidebarPinToggle,\n BadgeRow: SidebarBadgeRow,\n DrawerHeader: SidebarDrawerHeader,\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/shell/sidebar-context.ts","../src/shell/SidebarBadgeRow.tsx","../src/lib/start-inset.ts","../src/shell/Sidebar.tsx"],"names":["createContext","useContext","forwardRef","SidebarBadgeRow","jsxs","cn","jsx","Tooltip","TooltipTrigger","TooltipContent","useEffect","useMemo","useRef","useDrawerBehavior","testIdOr","Fragment","BlocksTooltipProvider","useState","ActionLink","PanelLeftClose","PanelLeftOpen","X"],"mappings":";;;;;;;;;;AAYO,IAAM,sBAAA,GAAwC;AAAA,EACnD,cAAA,EAAgB,iBA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AA,EAAY,iBAAA;AAAA,EACZ,OAAA,EAAS,cAAA;AAAA,EACT,MAAA,EAAQ,aAAA;AAAA,EACR,SAAA,EAAW,gBAAA;AAAA,EACX,QAAA,EAAU,eAAA;AAAA,EACV,YAAA,EAAc;AAChB","file":"chunk-325GVZE6.cjs","sourcesContent":["import { createContext, useContext } from 'react'\n\n/** Fixed strings of the sidebar family. Set once on `Sidebar.Root`; parts read them from context. */\nexport interface SidebarLabels {\n /** The sidebar's accessible name (the Root `aria-label` prop wins). */\n mainNavigation: string\n hideSidebar: string\n showSidebar: string\n /** The drawer's close button (the `closeLabel` prop wins). */\n closeNavigationMenu: string\n}\n\nexport const DEFAULT_SIDEBAR_LABELS: SidebarLabels = {\n mainNavigation: 'Main navigation',\n hideSidebar: 'Hide sidebar',\n showSidebar: 'Show sidebar',\n closeNavigationMenu: 'Close navigation menu',\n}\n\nexport interface SidebarContextValue {\n /** Labels are visible (full width), as opposed to the icon-only rail. */\n expanded: boolean\n labels: SidebarLabels\n}\nexport const SidebarContext = createContext<SidebarContextValue>({\n expanded: true,\n labels: DEFAULT_SIDEBAR_LABELS,\n})\nexport const useSidebarContext = (): SidebarContextValue => useContext(SidebarContext)\n\n/** True while the surrounding row is hovered/focused; trailing controls may brighten on it. */\nexport const SidebarRowHoverContext = createContext(false)\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { useSidebarContext } from './sidebar-context'\n\nexport interface SidebarBadgeRowProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'children'\n> {\n /** Glyph (20px). */\n icon: ReactNode\n /** Visible label of the expanded row; the tooltip of the icon-only rail. */\n label: string\n /** Unread/pending number. Hidden at 0 or `undefined`; values above 9 read \"9+\". */\n count?: number\n /**\n * Accessible name including the count, for example \"Notifications, 2 unread\". Defaults to\n * `label` plus the count.\n */\n ariaLabel?: string\n /**\n * `row`: a labelled row styled like the module rows, badge at the right. `icon`: icon-only with\n * the badge on the corner. Default follows the sidebar (`row` expanded, `icon` on the rail).\n */\n variant?: 'row' | 'icon'\n /** Test id of the count badge. */\n badgeTestId?: string\n}\n\n/**\n * A sidebar row that carries a badge and may open something (a panel, a popover): the\n * notifications and contacts rows above the account bar. A real button that forwards its ref and\n * rest props, so it can be a popover trigger (`<DropdownMenuTrigger asChild>`). The badge is\n * visible in both the expanded row and the icon-only rail, and the accessible name carries the\n * count in both.\n */\nexport const SidebarBadgeRow = forwardRef<HTMLButtonElement, SidebarBadgeRowProps>(\n function SidebarBadgeRow(\n { icon, label, count, ariaLabel, variant, badgeTestId, className, type = 'button', ...rest },\n ref\n ) {\n const { expanded } = useSidebarContext()\n const resolved = variant ?? (expanded ? 'row' : 'icon')\n const hasCount = count !== undefined && count > 0\n const badgeText = hasCount ? (count > 9 ? '9+' : String(count)) : null\n const name = ariaLabel ?? (hasCount ? `${label}, ${count}` : label)\n\n if (resolved === 'row') {\n return (\n <button\n ref={ref}\n type={type}\n aria-label={name}\n data-slot=\"sidebar-badge-row\"\n data-variant=\"row\"\n className={cn(\n 'group flex h-9 w-full cursor-pointer items-center rounded-md px-3 text-left text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11',\n className\n )}\n {...rest}\n >\n <span className=\"flex size-5 flex-shrink-0 items-center justify-center\" aria-hidden>\n {icon}\n </span>\n <span className=\"ml-3 min-w-0 truncate\" aria-hidden>\n {label}\n </span>\n {badgeText && (\n <span\n aria-hidden\n data-testid={badgeTestId}\n className=\"ml-auto inline-flex min-w-5 flex-shrink-0 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-semibold leading-5 tabular-nums text-primary-foreground\"\n >\n {badgeText}\n </span>\n )}\n </button>\n )\n }\n\n const iconButton = (\n <button\n ref={ref}\n type={type}\n aria-label={name}\n data-slot=\"sidebar-badge-row\"\n data-variant=\"icon\"\n title={variant === 'icon' ? label : undefined}\n className={cn(\n 'relative m-0 flex h-9 w-12 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11',\n className\n )}\n {...rest}\n >\n <span className=\"flex size-5 items-center justify-center\" aria-hidden>\n {icon}\n </span>\n {badgeText && (\n <span\n aria-hidden\n data-testid={badgeTestId}\n className=\"absolute right-1 top-0.5 flex min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold leading-4 tabular-nums text-primary-foreground\"\n >\n {badgeText}\n </span>\n )}\n </button>\n )\n // A standalone icon button (the page header) keeps its native title; the rail uses a tooltip.\n if (variant === 'icon') return iconButton\n return (\n <Tooltip delayDuration={50}>\n <TooltipTrigger asChild>{iconButton}</TooltipTrigger>\n <TooltipContent side=\"right\" sideOffset={8}>\n {label}\n </TooltipContent>\n </Tooltip>\n )\n }\n)\n","import { useEffect } from 'react'\n\n/**\n * The CSS custom property that carries how much of the screen's start (left) edge a docked sidebar\n * takes, set on `<html>`. A floating element pinned to the start corner (the install prompt)\n * positions itself `calc(var(--shell-start-inset, 0px) + 0.75rem)` so it never covers the\n * sidebar's footer (the account menu).\n */\nexport const SHELL_START_INSET_VAR = '--shell-start-inset'\n\nconst widths = new Map<symbol, number>()\n\nfunction apply(): void {\n if (typeof document === 'undefined') return\n const inset = Math.max(0, ...widths.values())\n const style = document.documentElement.style\n if (inset > 0) style.setProperty(SHELL_START_INSET_VAR, `${inset}px`)\n else style.removeProperty(SHELL_START_INSET_VAR)\n}\n\n/**\n * Report a sidebar docked at the start edge, `width` px wide (0 while it is collapsed or is an\n * overlay drawer), to {@link SHELL_START_INSET_VAR}. `Sidebar.Root` calls it; call it from your\n * own docked side panel.\n */\nexport function useShellStartInset(width: number): void {\n useEffect(() => {\n const key = Symbol('shell-start-inset')\n widths.set(key, width)\n apply()\n return () => {\n widths.delete(key)\n apply()\n }\n }, [width])\n}\n","import {\n Fragment,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n type PointerEventHandler,\n} from 'react'\nimport { PanelLeftClose, PanelLeftOpen, X } from 'lucide-react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport {\n DEFAULT_SIDEBAR_LABELS,\n SidebarContext,\n SidebarRowHoverContext,\n useSidebarContext,\n type SidebarLabels,\n} from './sidebar-context'\nimport { SidebarBadgeRow } from './SidebarBadgeRow'\nimport { ActionLink } from '../components/ActionLink'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { useDrawerBehavior } from '../lib/use-drawer'\nimport { useShellStartInset } from '../lib/start-inset'\nimport type { SidebarMode } from '../lib/sidebar-mode'\nimport type { NavItem, NavItemIndicator, NavSection } from './types'\n\n/**\n * Sidebar: the one tinted column that carries the app frame. Compound parts:\n * Sidebar.Root positioning shell for the four modes (drawer / collapsed / pinned / rail)\n * Sidebar.Header top block (switcher, ask field, pin toggle)\n * Sidebar.Nav the rows: pass `items` (NavItem[]) or compose Sidebar.NavItem children\n * Sidebar.Group a labelled run of rows (heading when expanded, divider on the rail)\n * Sidebar.Footer pinned to the bottom (offline pill, tips card, action cluster)\n * Sidebar.PinToggle / Sidebar.DrawerHeader the header's two stock controls\n *\n * Presentational and controlled: the app resolves `mode`/`expanded` (see `resolveSidebarLayout`\n * and `useSidebarSettle`) and owns where hover/pin/drawer state lives.\n */\n\nconst noop = () => {}\n\nconst COLLAPSED_PX = 64\nconst EXPANDED_PX = 256\nconst COLLAPSED_WIDTH = `${COLLAPSED_PX}px`\nconst EXPANDED_WIDTH = `${EXPANDED_PX}px`\n\nexport interface SidebarRootProps {\n /** Constrain the drawer to an embedded frame. The app keeps the viewport default. */\n contained?: boolean\n mode: SidebarMode\n /** Labels visible. Provided to every part through context. */\n expanded: boolean\n /** `rail` mode: floats open to full width. */\n isHovering?: boolean\n onBackdropClick?: () => void\n /** `rail` mode on touch: the floated-open rail dims the content behind it; tapping it closes. */\n hasRailBackdrop?: boolean\n onMouseEnter?: () => void\n onMouseLeave?: () => void\n onPointerEnter?: PointerEventHandler<HTMLElement>\n onPointerLeave?: PointerEventHandler<HTMLElement>\n children: ReactNode\n className?: string\n 'aria-label'?: string\n labels?: Partial<SidebarLabels>\n /** Root id (default `sidebar`). */\n 'data-testid'?: string\n /** Drawer backdrop id (default `sidebar-backdrop`). */\n backdropTestId?: string\n}\n\nfunction SidebarRoot({\n mode,\n contained = false,\n expanded,\n isHovering = false,\n onBackdropClick,\n hasRailBackdrop = false,\n onMouseEnter,\n onMouseLeave,\n onPointerEnter,\n onPointerLeave,\n children,\n className,\n 'aria-label': ariaLabelProp,\n labels,\n 'data-testid': testId,\n backdropTestId,\n}: SidebarRootProps) {\n const mergedLabels = useMemo(() => ({ ...DEFAULT_SIDEBAR_LABELS, ...labels }), [labels])\n // The drawer is a modal: scroll lock, Escape, focus trap and focus return to the opener.\n const drawerRef = useRef<HTMLDivElement>(null)\n const isDrawer = mode === 'drawer'\n useDrawerBehavior(isDrawer, onBackdropClick ?? noop, drawerRef)\n // Floating start-corner elements (the install prompt) sit clear of the docked sidebar; a rail\n // expanding on hover floats over the page, so only its collapsed width counts.\n useShellStartInset(mode === 'pinned' ? EXPANDED_PX : mode === 'rail' ? COLLAPSED_PX : 0)\n const ariaLabel = ariaLabelProp ?? mergedLabels.mainNavigation\n const contextValue = useMemo(() => ({ expanded, labels: mergedLabels }), [expanded, mergedLabels])\n // `navBase` omits horizontal padding so each mode owns its own: the collapsed state must\n // reach a true 0 width, which an `!important` px would block.\n const navBase =\n 'group/sidebar bg-sidebar border-r border-border text-foreground scrollbar-themed flex flex-col h-full overflow-y-auto overflow-x-hidden pb-safe pt-3 transition-all duration-300 ease-in-out'\n const common = {\n 'aria-label': ariaLabel,\n 'data-testid': testIdOr(testId, { testId: 'sidebar' }),\n 'data-slot': 'sidebar',\n 'data-mode': mode,\n } as const\n const fixedWidth: CSSProperties = { width: EXPANDED_WIDTH, minWidth: EXPANDED_WIDTH }\n\n let body: ReactNode\n if (mode === 'drawer') {\n // Small-screen off-canvas panel + dismiss backdrop; bypasses the hover/collapse model. The\n // wrapper is the modal dialog; the nav landmark sits inside it.\n body = (\n <div\n ref={drawerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n data-slot=\"sidebar-drawer\"\n className={cn(contained ? 'absolute' : 'fixed', 'inset-0 z-50')}\n >\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={onBackdropClick}\n aria-hidden=\"true\"\n data-testid={testIdOr(backdropTestId, { testId: 'sidebar-backdrop' })}\n />\n <nav\n {...common}\n className={cn(navBase, '!px-3 absolute left-0 top-0 pt-safe shadow-xl', className)}\n style={fixedWidth}\n >\n {children}\n </nav>\n </div>\n )\n } else if (mode === 'collapsed') {\n // Stays mounted at width 0 so the transition runs on both enter and leave. Horizontal padding\n // is dropped or overflow-hidden would reveal a clipped sliver of the icons.\n body = (\n <nav\n {...common}\n className={cn(navBase, 'absolute left-0 top-0 z-[45]', className)}\n style={{\n width: '0px',\n minWidth: 0,\n paddingLeft: 0,\n paddingRight: 0,\n borderRightWidth: 0,\n pointerEvents: 'none',\n }}\n // Width 0 hides the links visually; inert also takes them out of the tab order and the\n // accessibility tree.\n inert\n >\n {children}\n </nav>\n )\n } else if (mode === 'pinned') {\n body = (\n <nav\n {...common}\n className={cn(navBase, '!px-3 relative flex-shrink-0', className)}\n style={fixedWidth}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n >\n {children}\n </nav>\n )\n } else {\n // Rail: a permanent spacer keeps the flex layout still; the nav is always absolute so only\n // its width animates on hover (no layout jump).\n body = (\n <>\n <div\n className=\"bg-sidebar border-r border-border flex flex-col h-full relative px-0 pb-safe flex-shrink-0\"\n style={{ width: COLLAPSED_WIDTH, minWidth: COLLAPSED_WIDTH }}\n aria-hidden=\"true\"\n />\n {isHovering && hasRailBackdrop && (\n <div\n className=\"fixed inset-0 z-[44] bg-black/40\"\n onClick={onBackdropClick}\n aria-hidden=\"true\"\n data-testid={testIdOr(backdropTestId, { testId: 'sidebar-backdrop' })}\n />\n )}\n <nav\n {...common}\n className={cn(\n navBase,\n isHovering ? '!px-3 shadow-xl' : '!px-2',\n 'absolute left-0 top-0 z-[45]',\n className\n )}\n style={{\n width: isHovering ? EXPANDED_WIDTH : COLLAPSED_WIDTH,\n minWidth: isHovering ? EXPANDED_WIDTH : COLLAPSED_WIDTH,\n }}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n >\n {children}\n </nav>\n </>\n )\n }\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <BlocksTooltipProvider>{body}</BlocksTooltipProvider>\n </SidebarContext.Provider>\n )\n}\n\nexport interface SidebarSectionProps {\n children: ReactNode\n className?: string\n 'data-testid'?: string\n}\n\nfunction SidebarHeader({ children, className, 'data-testid': testId }: SidebarSectionProps) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-3 pb-3', className)}\n >\n {children}\n </div>\n )\n}\n\nexport interface SidebarNavProps extends Omit<SidebarSectionProps, 'children'> {\n children?: ReactNode\n /** Rows as data. Children render after them. */\n items?: NavItem[]\n /** Labelled groups of rows as data (each a `Sidebar.Group`), after `items`. */\n sections?: NavSection[]\n}\n\nfunction SidebarNav({\n items,\n sections,\n children,\n className,\n 'data-testid': testId,\n}: SidebarNavProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n data-slot=\"sidebar-nav\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-0.5', !expanded && 'items-center', className)}\n >\n {items?.map((item) => (\n <SidebarNavItem key={item.id} {...item} />\n ))}\n {sections?.map((section, index) => (\n <Fragment key={section.id}>\n {/* An unlabelled run after other rows is set apart, so it never reads as part of the\n group above it. */}\n {!section.label && (index > 0 || !!items?.length) && (\n <div\n role=\"separator\"\n data-slot=\"sidebar-group-divider\"\n className={cn('my-1 h-px bg-border', expanded ? 'mx-2' : 'w-6')}\n />\n )}\n <SidebarGroup\n label={section.label}\n ariaLabel={section.ariaLabel}\n data-testid={section.testId}\n >\n {section.items.map((item) => (\n <SidebarNavItem key={item.id} {...item} />\n ))}\n </SidebarGroup>\n </Fragment>\n ))}\n {children}\n </div>\n )\n}\n\nexport interface SidebarGroupProps extends SidebarSectionProps {\n /** Group heading. Shown above the rows when expanded; a thin divider stands in on the rail. */\n label?: ReactNode\n /** Accessible name when `label` is not plain text. */\n ariaLabel?: string\n}\n\n/** A labelled run of rows inside the nav (for example \"Workspace\", \"Tools\"). */\nfunction SidebarGroup({\n label,\n ariaLabel,\n children,\n className,\n 'data-testid': testId,\n}: SidebarGroupProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : undefined)}\n data-slot=\"sidebar-group\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-0.5', !expanded && 'items-center', className)}\n >\n {label &&\n (expanded ? (\n <SidebarGroupLabel>{label}</SidebarGroupLabel>\n ) : (\n <div\n role=\"separator\"\n data-slot=\"sidebar-group-divider\"\n className=\"my-1 h-px w-6 bg-border\"\n />\n ))}\n {children}\n </div>\n )\n}\n\n/** The heading of a `Sidebar.Group` (exported for custom headings). Hidden by the group on the rail. */\nfunction SidebarGroupLabel({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <div\n data-slot=\"sidebar-group-label\"\n className={cn(\n 'px-2 pb-0.5 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nfunction SidebarFooter({ children, className, 'data-testid': testId }: SidebarSectionProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-testid={testId}\n className={cn(\n 'mt-auto flex flex-shrink-0 flex-col gap-2 pt-3 pb-3',\n !expanded && 'items-center',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nconst INDICATOR_TONES: Record<NavItemIndicator, string> = {\n progress: 'bg-primary',\n error: 'bg-red-solid',\n attention: 'bg-yellow-solid',\n}\n\nexport type SidebarNavItemProps = Omit<NavItem, 'id'> & {\n id?: string\n className?: string\n /** Tooltip shown on the icon-only rail; defaults to the label. */\n tooltip?: string\n}\n\n/**\n * One row: [icon] [label] [count] [trailing]. 36px (44px on coarse pointers). The active row is\n * the selection tint, never a filled block; counts are quiet numbers, not pills.\n *\n * The expanded row is a div with role=\"button\" (not a native <button>) so an interactive\n * `trailing` control can be nested without producing button-in-button markup.\n */\nfunction SidebarNavItem({\n label,\n icon,\n active = false,\n onSelect,\n href,\n external,\n pressed,\n count,\n countIcon,\n testId,\n disabled = false,\n trailing,\n indicator,\n className,\n tooltip,\n}: SidebarNavItemProps) {\n const { expanded } = useSidebarContext()\n // Tracked as state (not CSS :hover) so a trailing control can read it via context.\n const [isRowActive, setIsRowActive] = useState(false)\n const tip = expanded ? undefined : (tooltip ?? label)\n // A toggle row says whether it is pressed; a destination whether it is the current page.\n const selected = active || pressed === true\n const state =\n pressed !== undefined\n ? { 'aria-pressed': pressed }\n : { 'aria-current': active ? ('page' as const) : undefined }\n\n if (!expanded) {\n const railButton = (\n <ActionLink\n href={href}\n external={external}\n onSelect={onSelect}\n disabled={disabled}\n aria-label={label}\n {...state}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={cn(\n 'm-0 flex h-9 w-12 items-center justify-center rounded-md transition-colors pointer-coarse:h-11',\n selected\n ? 'bg-accent text-accent-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n disabled && 'pointer-events-none cursor-not-allowed opacity-30',\n className\n )}\n >\n <div className=\"flex size-5 items-center justify-center\">\n {indicator ? (\n <div className=\"relative\">\n {icon}\n <div\n data-slot=\"sidebar-nav-indicator\"\n data-tone={indicator}\n className={cn(\n 'absolute -right-1 -top-1 size-2.5 rounded-full border border-sidebar',\n INDICATOR_TONES[indicator]\n )}\n />\n </div>\n ) : (\n icon\n )}\n </div>\n </ActionLink>\n )\n if (!tip) return railButton\n return (\n <Tooltip delayDuration={50}>\n <TooltipTrigger asChild>{railButton}</TooltipTrigger>\n <TooltipContent side=\"right\" sideOffset={8}>\n {tip}\n </TooltipContent>\n </Tooltip>\n )\n }\n\n const rowClass = cn(\n 'group flex h-9 w-full cursor-pointer items-center rounded-md px-3 text-sm transition-colors pointer-coarse:h-11',\n selected\n ? 'bg-accent font-semibold text-accent-foreground'\n : 'font-medium text-muted-foreground hover:bg-muted hover:text-foreground',\n disabled && 'pointer-events-none cursor-not-allowed opacity-30',\n className\n )\n const countNode = count !== undefined && (\n <span\n // `ml-auto` lines the counts up on the right edge as one column of numbers.\n className={cn(\n 'ml-auto inline-flex flex-shrink-0 items-center gap-0.5 pl-2 text-xs font-normal tabular-nums',\n selected ? 'text-accent-foreground' : 'text-muted-foreground'\n )}\n >\n {countIcon}\n {count}\n </span>\n )\n\n // A link row without a nested control is the anchor itself.\n if (href && !disabled && !trailing) {\n return (\n <ActionLink\n href={href}\n external={external}\n onSelect={onSelect}\n {...state}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={rowClass}\n >\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n </ActionLink>\n )\n }\n\n // A link row with a nested control: a stretched anchor sits under the content, and the\n // trailing control rises above it, so there is never an interactive element inside an anchor.\n if (href && !disabled) {\n return (\n <div\n onMouseEnter={() => setIsRowActive(true)}\n onMouseLeave={() => setIsRowActive(false)}\n onFocusCapture={() => setIsRowActive(true)}\n onBlurCapture={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setIsRowActive(false)\n }}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={cn(rowClass, 'relative')}\n >\n <ActionLink\n href={href}\n external={external}\n onSelect={onSelect}\n aria-label={label}\n {...state}\n className=\"absolute inset-0 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <div className=\"pointer-events-none flex min-w-0 flex-1 items-center\">\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n </div>\n <SidebarRowHoverContext.Provider value={isRowActive}>\n <span className=\"relative ml-2 flex flex-shrink-0 items-center\">{trailing}</span>\n </SidebarRowHoverContext.Provider>\n </div>\n )\n }\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n {...state}\n onClick={disabled ? undefined : onSelect}\n onMouseEnter={() => setIsRowActive(true)}\n onMouseLeave={() => setIsRowActive(false)}\n onFocusCapture={() => setIsRowActive(true)}\n onBlurCapture={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setIsRowActive(false)\n }}\n onKeyDown={\n disabled\n ? undefined\n : (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onSelect()\n }\n }\n }\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={rowClass}\n >\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n {trailing && (\n <SidebarRowHoverContext.Provider value={isRowActive}>\n <span className=\"ml-auto flex flex-shrink-0 items-center pl-2\">{trailing}</span>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n\nexport interface SidebarPinToggleProps {\n isPinned: boolean\n onToggle: () => void\n className?: string\n /** Default `sidebar-pin-button`. */\n 'data-testid'?: string\n}\n\n/**\n * Pin/unpin button, revealed while the pointer is over the sidebar. It is always visible on\n * coarse pointers (no hover on touch) and revealed by keyboard focus anywhere in the sidebar. It\n * is hidden with opacity and pointer-events, never display:none, so it keeps its accessible name\n * and stays in the tab order.\n */\nfunction SidebarPinToggle({\n isPinned,\n onToggle,\n className,\n 'data-testid': testId,\n}: SidebarPinToggleProps) {\n const { expanded, labels } = useSidebarContext()\n const label = isPinned ? labels.hideSidebar : labels.showSidebar\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n title={label}\n aria-label={label}\n aria-pressed={isPinned}\n data-testid={testIdOr(testId, { testId: 'sidebar-pin-button' })}\n className={cn(\n 'flex flex-shrink-0 items-center justify-center rounded-md text-muted-foreground transition-[opacity,colors] hover:bg-muted hover:text-foreground pointer-coarse:size-11',\n 'pointer-events-none opacity-0 group-hover/sidebar:pointer-events-auto group-hover/sidebar:opacity-100',\n 'group-focus-within/sidebar:pointer-events-auto group-focus-within/sidebar:opacity-100',\n 'pointer-coarse:pointer-events-auto pointer-coarse:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100',\n expanded ? 'size-9' : 'h-9 w-12',\n className\n )}\n >\n {isPinned ? <PanelLeftClose className=\"size-5\" /> : <PanelLeftOpen className=\"size-5\" />}\n </button>\n )\n}\n\nexport interface SidebarDrawerHeaderProps {\n /** Brand mark. */\n logo: ReactNode\n onClose: () => void\n closeLabel?: string\n /** Close button id (default `mobile-nav-close`). */\n 'data-testid'?: string\n}\n\n/** The phone drawer's header: brand mark and a 44px close button. */\nfunction SidebarDrawerHeader({\n logo,\n onClose,\n closeLabel: closeLabelProp,\n 'data-testid': testId,\n}: SidebarDrawerHeaderProps) {\n const { labels } = useSidebarContext()\n const closeLabel = closeLabelProp ?? labels.closeNavigationMenu\n return (\n <div\n data-slot=\"sidebar-drawer-header\"\n className=\"flex flex-shrink-0 items-center justify-between pb-2\"\n >\n {logo}\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={closeLabel}\n data-testid={testIdOr(testId, { testId: 'mobile-nav-close' })}\n className=\"flex size-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n\nexport { DEFAULT_SIDEBAR_LABELS, SidebarRowHoverContext, useSidebarContext, type SidebarLabels }\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Header: SidebarHeader,\n Nav: SidebarNav,\n Group: SidebarGroup,\n GroupLabel: SidebarGroupLabel,\n NavItem: SidebarNavItem,\n Footer: SidebarFooter,\n PinToggle: SidebarPinToggle,\n BadgeRow: SidebarBadgeRow,\n DrawerHeader: SidebarDrawerHeader,\n}\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
4
|
+
var chunk6UTKM5AB_cjs = require('./chunk-6UTKM5AB.cjs');
|
|
5
|
+
var chunkWAV762GP_cjs = require('./chunk-WAV762GP.cjs');
|
|
7
6
|
var chunk7JLJH5CW_cjs = require('./chunk-7JLJH5CW.cjs');
|
|
8
|
-
var
|
|
9
|
-
var chunkQRAQZTJE_cjs = require('./chunk-QRAQZTJE.cjs');
|
|
7
|
+
var chunkWXUU3COI_cjs = require('./chunk-WXUU3COI.cjs');
|
|
10
8
|
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
9
|
+
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
10
|
+
var chunkQRAQZTJE_cjs = require('./chunk-QRAQZTJE.cjs');
|
|
11
11
|
var chunkTKHCIHE2_cjs = require('./chunk-TKHCIHE2.cjs');
|
|
12
12
|
var browser = require('@arbidocs/sdk/browser');
|
|
13
13
|
var react = require('@arbidocs/react');
|
|
@@ -50,11 +50,11 @@ function useLaunchWorkflow({
|
|
|
50
50
|
} = {}) {
|
|
51
51
|
const { data: documents = [] } = react.useDocuments();
|
|
52
52
|
const { data: workspaceTags = [] } = react.useTags();
|
|
53
|
-
const tags = react$1.useMemo(() =>
|
|
53
|
+
const tags = react$1.useMemo(() => chunkWXUU3COI_cjs.documentScopeLabels(workspaceTags), [workspaceTags]);
|
|
54
54
|
const createTag = react.useCreateTag();
|
|
55
55
|
const updateTag = react.useUpdateTag();
|
|
56
56
|
const generate = react.useGenerateDocTags();
|
|
57
|
-
const { create: createTask } =
|
|
57
|
+
const { create: createTask } = chunk6UTKM5AB_cjs.useWorkflowTasks();
|
|
58
58
|
const applyModel = react.useApplyChatModel();
|
|
59
59
|
const session = react.useArbiSessionStore();
|
|
60
60
|
const { notify, openFiles, openNewConversation } = chunkTKHCIHE2_cjs.useBlocksEnvironment();
|
|
@@ -62,7 +62,7 @@ function useLaunchWorkflow({
|
|
|
62
62
|
async ({ inputs, scope }) => {
|
|
63
63
|
const description = text(inputs, "description");
|
|
64
64
|
const name = text(inputs, "name") || chunk7JLJH5CW_cjs.deriveAnnotationName(description);
|
|
65
|
-
const matching =
|
|
65
|
+
const matching = chunkWXUU3COI_cjs.matchWorkflowScope(documents, scope);
|
|
66
66
|
if (!name || !description || matching.length === 0) return;
|
|
67
67
|
try {
|
|
68
68
|
const existing = tags.find((t) => t.name.toLowerCase() === name.toLowerCase());
|
|
@@ -162,7 +162,7 @@ function useLaunchWorkflow({
|
|
|
162
162
|
const binding = PROMPT_BINDINGS[workflow.id];
|
|
163
163
|
const prepare = () => {
|
|
164
164
|
if (binding?.attachScope !== false && !chunkQRAQZTJE_cjs.isEmptyWorkflowScope(scope)) {
|
|
165
|
-
const ids =
|
|
165
|
+
const ids = chunkWXUU3COI_cjs.matchWorkflowScope(documents, scope).map((d) => d.external_id);
|
|
166
166
|
if (ids.length > 0) {
|
|
167
167
|
session.setConversationDocuments(
|
|
168
168
|
inPlace ? session.getState().conversationId ?? "new" : "new",
|
|
@@ -213,7 +213,7 @@ function ConnectedWorkflowStart({
|
|
|
213
213
|
);
|
|
214
214
|
const { openUpload } = chunkTKHCIHE2_cjs.useBlocksEnvironment();
|
|
215
215
|
const { data: workspaceTags = [] } = react.useTags();
|
|
216
|
-
const tags = react$1.useMemo(() =>
|
|
216
|
+
const tags = react$1.useMemo(() => chunkWXUU3COI_cjs.documentScopeLabels(workspaceTags), [workspaceTags]);
|
|
217
217
|
const fieldPlaceholder = react$1.useCallback(
|
|
218
218
|
(field, inputs, workflow) => {
|
|
219
219
|
if (workflow.id !== chunk7JLJH5CW_cjs.ANNOTATE_ID || field.name !== "name") return void 0;
|
|
@@ -223,7 +223,7 @@ function ConnectedWorkflowStart({
|
|
|
223
223
|
[]
|
|
224
224
|
);
|
|
225
225
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
226
|
-
|
|
226
|
+
chunkWAV762GP_cjs.ConnectedWorkflowLauncher,
|
|
227
227
|
{
|
|
228
228
|
...rest,
|
|
229
229
|
workflows,
|
|
@@ -268,7 +268,7 @@ function canOpenSkill(workflow, skillsEnabled) {
|
|
|
268
268
|
return workflow.run.kind === "prompt" && (skillsEnabled || chunk7JLJH5CW_cjs.isSkillPackWorkflow(workflow));
|
|
269
269
|
}
|
|
270
270
|
function useSlashSkillWorkflows({ landing, send }) {
|
|
271
|
-
const { skills, skillsEnabled } =
|
|
271
|
+
const { skills, skillsEnabled } = chunk6UTKM5AB_cjs.useWorkflowDefinitions();
|
|
272
272
|
const { commands } = react.useBuiltinCommands();
|
|
273
273
|
const [active, setActive] = react$1.useState(null);
|
|
274
274
|
const open = react$1.useCallback(
|
|
@@ -332,11 +332,11 @@ function useSlashSkillWorkflows({ landing, send }) {
|
|
|
332
332
|
}
|
|
333
333
|
var NO_SKILLS = [];
|
|
334
334
|
function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
335
|
-
const hostSkills =
|
|
336
|
-
const listings =
|
|
337
|
-
const skillsEnabled =
|
|
335
|
+
const hostSkills = chunk6UTKM5AB_cjs.useHostSkills();
|
|
336
|
+
const listings = chunk6UTKM5AB_cjs.useUsableSkillListings(hostSkills);
|
|
337
|
+
const skillsEnabled = chunk6UTKM5AB_cjs.useSkillsEnabled();
|
|
338
338
|
const { commands } = react.useBuiltinCommands();
|
|
339
|
-
const builtins =
|
|
339
|
+
const builtins = chunk6UTKM5AB_cjs.useNamedWorkflows(builtinSkills);
|
|
340
340
|
const items = react$1.useMemo(() => {
|
|
341
341
|
const packSlugs = new Set(hostSkills.map((w) => w.id));
|
|
342
342
|
return chunk5F4DCIHS_cjs.buildSlashItems(
|
|
@@ -347,7 +347,7 @@ function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
|
347
347
|
kind: "command"
|
|
348
348
|
})),
|
|
349
349
|
[
|
|
350
|
-
...hostSkills.map(
|
|
350
|
+
...hostSkills.map(chunk6UTKM5AB_cjs.hostSkillItem),
|
|
351
351
|
...skillsEnabled ? skillItems(
|
|
352
352
|
builtins.filter((w) => !packSlugs.has(w.id)),
|
|
353
353
|
listings
|
|
@@ -355,7 +355,7 @@ function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
|
355
355
|
]
|
|
356
356
|
);
|
|
357
357
|
}, [commands, hostSkills, listings, skillsEnabled, builtins]);
|
|
358
|
-
return { items, canBrowseSkills:
|
|
358
|
+
return { items, canBrowseSkills: chunk6UTKM5AB_cjs.useCanBrowseSkills() };
|
|
359
359
|
}
|
|
360
360
|
function useSlashItems(text2, builtinSkills = NO_SKILLS) {
|
|
361
361
|
const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills);
|
|
@@ -402,5 +402,5 @@ exports.useLaunchWorkflow = useLaunchWorkflow;
|
|
|
402
402
|
exports.useSlashItems = useSlashItems;
|
|
403
403
|
exports.useSlashMenuItems = useSlashMenuItems;
|
|
404
404
|
exports.useSlashSkillWorkflows = useSlashSkillWorkflows;
|
|
405
|
-
//# sourceMappingURL=chunk-
|
|
406
|
-
//# sourceMappingURL=chunk-
|
|
405
|
+
//# sourceMappingURL=chunk-557MJ4IH.cjs.map
|
|
406
|
+
//# sourceMappingURL=chunk-557MJ4IH.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workflows/launch-bindings.ts","../src/connection/workflows/useLaunchWorkflow.ts","../src/connection/workflows/ConnectedWorkflowStart.tsx","../src/connection/workflows/useSlashSkillWorkflows.tsx","../src/connection/conversation/useSlashItems.ts"],"names":["GENERATE_IMAGE_ID","buildRetrievalChunkTool","buildRetrievalFullContextTool","IMAGE_ASPECT_AUTO","useDocuments","useTags","useMemo","documentScopeLabels","useCreateTag","useUpdateTag","useGenerateDocTags","useWorkflowTasks","useApplyChatModel","useArbiSessionStore","useBlocksEnvironment","useCallback","deriveAnnotationName","matchWorkflowScope","ANNOTATE_ID","recordWorkflowUse","getDocumentTitle","composeWorkflowPrompt","isEmptyWorkflowScope","useHost","renderWorkflowIcon","jsx","ConnectedWorkflowLauncher","jsxs","TriangleAlert","isSkillPackWorkflow","useWorkflowDefinitions","useBuiltinCommands","useState","text","promptFieldName","useHostSkills","useUsableSkillListings","useSkillsEnabled","useNamedWorkflows","buildSlashItems","hostSkillItem","useCanBrowseSkills","parseSlashTokenInProgress","filterSlashItems","mergeSkillWorkflows"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAM,YAAA,GAAe,CAAC,MAAA,KAAqC;AACzD,EAAA,MAAM,QAAQ,MAAA,CAAO,UAAA;AACrB,EAAA,OAAO,KAAA,EAAO,aAAa,EAAC;AAC9B,CAAA;AAEO,IAAM,eAAA,GAAiD;AAAA,EAC5D,CAACA,mCAAiB,GAAG;AAAA,IACnB,WAAA,EAAa,KAAA;AAAA,IACb,KAAA,EAAO,CAAC,MAAA,KAAW;AACjB,MAAA,MAAM,cAAc,OAAO,MAAA,CAAO,YAAA,KAAiB,QAAA,GAAW,OAAO,YAAA,GAAe,EAAA;AACpF,MAAA,OAAO;AAAA,QACL,eAAA,EAAiBC,+BAAA,CAAwB,EAAE,CAAA;AAAA,QAC3C,sBAAA,EAAwBC,qCAAA,CAA8B,YAAA,CAAa,MAAM,CAAC,CAAA;AAAA,QAC1E,GAAI,WAAA,IAAe,WAAA,KAAgBC,mCAAA,GAC/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CAAA,CAAE,EAAE,CAAA;AAC1B,MAAA,OAAO;AAAA,QACL,MAAM,CAAA,CAAE,EAAA;AAAA,QACR,WAAA,EAAa,GAAG,WAAA,KAAgB,CAAA,CAAE,UAAU,CAAA,CAAE,EAAA,GAAK,EAAE,KAAA,GAAQ,EAAA,CAAA;AAAA,QAC7D,OAAA,EAAS,GAAG,QAAA,IAAY,EAAA;AAAA,QACxB,UAAA,EAAY,CAAA,EAAG,UAAA,KAAe,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-LFRNBT2I.cjs","sourcesContent":["/**\n * Host bindings of prompt workflows that need more than words on send. Bound by workflow id, the\n * same way the annotation operation is: blocks and the registry stay declarative, and the one\n * place that knows the wire shape is here.\n *\n * Generate image: the reference images and the aspect ratio ride structured tool arguments\n * (`retrieval_full_context` over every reference, `image_generation.aspect_ratio`), never the\n * prompt text: the image model does not reliably honour a shape or sources worded into the prompt,\n * and the references go to the separate image model in its own request, so (unlike the app's\n * one-at-a-time pinned document) several of them do not compound against the agent's context.\n */\n\nimport type { WorkflowInputs, WorkflowScope } from '../../agents/workflows/types'\nimport { buildRetrievalChunkTool, buildRetrievalFullContextTool } from '@arbidocs/sdk/browser'\nimport type { TurnTools } from '@arbidocs/react'\nimport { GENERATE_IMAGE_ID, IMAGE_ASPECT_AUTO } from '../../agents/workflows/catalogue/seed'\n\nexport interface PromptBinding {\n /** Attach the scoped files to the chat (default true). Off when the files are tool inputs. */\n attachScope: boolean\n /** Structured tools for the one send, from the form's inputs. */\n tools?: (inputs: WorkflowInputs) => TurnTools\n}\n\nconst referencesOf = (inputs: WorkflowInputs): string[] => {\n const value = inputs.references as WorkflowScope | undefined\n return value?.documents ?? []\n}\n\nexport const PROMPT_BINDINGS: Record<string, PromptBinding> = {\n [GENERATE_IMAGE_ID]: {\n attachScope: false,\n tools: (inputs) => {\n const aspectRatio = typeof inputs.aspect_ratio === 'string' ? inputs.aspect_ratio : ''\n return {\n retrieval_chunk: buildRetrievalChunkTool([]),\n retrieval_full_context: buildRetrievalFullContextTool(referencesOf(inputs)),\n ...(aspectRatio && aspectRatio !== IMAGE_ASPECT_AUTO\n ? {\n image_generation: {\n name: 'image_generation' as const,\n description: 'image generation',\n tool_args: { aspect_ratio: aspectRatio },\n tool_responses: {},\n },\n }\n : {}),\n }\n },\n },\n}\n","/**\n * The host side of the launch contract: `onLaunch({workflow, inputs, scope, agentId})`.\n *\n * Blocks only say WHAT to run; this performs it, so workspace isolation stays host-side:\n *\n * - prompt workflow, my assistant: open a fresh chat (or stay in this one when `inPlace`), scope\n * its documents, set the composed draft and ask for it to be sent (`autoSendDraft`). The host's\n * send waits for the new chat's documents to be seeded, so a scoped run is never sent with the\n * wrong files. Order matters: `openNewConversation` resets the draft, so it is set after it.\n * - prompt workflow, another agent: a run-now task assigned to that agent (the interactive chat\n * query has no agent parameter), created through the same path as the task composer.\n * - operation workflow (tier B): the handler bound to its id (annotation).\n * - a workflow's own model becomes the chat's (`useApplyChatModel`).\n *\n * The prompt is composed in exactly one place: `composeWorkflowPrompt(workflow, inputs)`.\n */\n\nimport {\n useApplyChatModel,\n useArbiSessionStore,\n useCreateTag,\n useDocuments,\n useGenerateDocTags,\n useTags,\n useUpdateTag,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport { useCallback, useMemo } from 'react'\nimport { composeWorkflowPrompt, isEmptyWorkflowScope } from '../../agents/workflows/workflow'\nimport { documentScopeLabels, matchWorkflowScope } from '../../agents/workflows/workspaceScope'\nimport {\n type WorkflowInputs,\n type WorkflowLanding,\n type WorkflowLaunch,\n} from '../../agents/workflows/types'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { PROMPT_BINDINGS } from './launch-bindings'\nimport { ANNOTATE_ID } from '../../agents/workflows/catalogue/seed'\nimport { useWorkflowTasks } from './useWorkflowTasks'\nimport { recordWorkflowUse } from '../../agents/workflows/catalogue/workflow-usage'\n\nexport interface UseLaunchWorkflowOptions {\n /**\n * Where launches from this surface land, over each workflow's own default. The empty chat and\n * the slash menu send into the conversation on screen (`current-chat`); everything else opens a\n * fresh one. A single launch can still override it (`WorkflowLaunch.landing`).\n */\n landing?: WorkflowLanding\n /**\n * A prompt run on the user's own assistant is sent here instead of through the session's draft:\n * the surface's own chat (`ChatPage`) or its own ask (the document ask). Everything else is the\n * same: the file scope, the workflow's model and its bound tools are set on the session in scope\n * (before a send in place, after a send that opens a fresh chat), so the turn carries them.\n */\n send?: (prompt: string) => void\n}\n\nconst text = (inputs: WorkflowInputs, name: string): string => {\n const v = inputs[name]\n return typeof v === 'string' ? v.trim() : ''\n}\n\nexport function useLaunchWorkflow({\n landing: surfaceLanding,\n send,\n}: UseLaunchWorkflowOptions = {}) {\n const { data: documents = [] } = useDocuments()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n const createTag = useCreateTag()\n const updateTag = useUpdateTag()\n const generate = useGenerateDocTags()\n const { create: createTask } = useWorkflowTasks()\n const applyModel = useApplyChatModel()\n const session = useArbiSessionStore()\n const { notify, openFiles, openNewConversation } = useBlocksEnvironment()\n\n /** Annotation: create (or reuse) the label, start the AI run, land on Files filtered to the set. */\n const annotate = useCallback(\n async ({ inputs, scope }: WorkflowLaunch) => {\n const description = text(inputs, 'description')\n const name = text(inputs, 'name') || deriveAnnotationName(description)\n const matching = matchWorkflowScope(documents, scope)\n if (!name || !description || matching.length === 0) return\n try {\n // A same-named label is reused rather than duplicated, the rule the Files page's\n // label-creation paths follow.\n const existing = tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n let tagId: string\n if (existing) {\n tagId = existing.external_id\n await updateTag.mutateAsync({\n tagId: tagId,\n change: { instruction: description },\n })\n } else {\n const created = await createTag.mutateAsync({\n name,\n tagType: { type: 'text', options: [] },\n shared: true,\n instruction: description,\n })\n const createdId = (created as { external_id?: string } | undefined)?.external_id\n if (!createdId) throw new Error('tag create returned no id')\n tagId = createdId\n }\n const docIds = matching.map((d) => d.external_id)\n // overwrite=true so a re-run on an existing field refreshes stale values, matching the\n // Files page's default review behaviour.\n await generate.mutateAsync({ tagIds: [tagId], docIds: docIds, overwrite: true })\n // Land on Files with those documents selected and the view narrowed to the annotated set\n // through the same tri-state quick filter the pickers write to. An empty scope selected\n // every file, so no filter is applied.\n const filters: Record<string, 'include'> = {}\n scope.folders.forEach((folder) => {\n filters[folder === '' ? 'folder:none' : `folder:${folder}`] = 'include'\n })\n scope.labels.forEach((labelId) => {\n filters[labelId] = 'include'\n })\n openFiles({ select: docIds, filters })\n } catch (error) {\n notify('Could not start the annotation', 'error')\n throw error\n }\n },\n [documents, tags, createTag, updateTag, generate, openFiles, notify]\n )\n\n return useCallback(\n async (launch: WorkflowLaunch) => {\n const { workflow, inputs, scope, agentId } = launch\n if (workflow.run.kind === 'operation') {\n if (workflow.id === ANNOTATE_ID) {\n await annotate(launch)\n recordWorkflowUse(workflow.id)\n return\n }\n throw new Error(`No host handler for workflow \"${workflow.id}\"`)\n }\n\n // Names for the wording: a `documents` field quotes the files it picked.\n const documentTitles = Object.fromEntries(\n documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])\n )\n const prompt = composeWorkflowPrompt(workflow, inputs, { documentTitles })\n if (!prompt) return\n recordWorkflowUse(workflow.id)\n\n if (agentId) {\n try {\n const created = await createTask({\n workflow,\n values: {\n assignee: 'agent',\n workflowId: workflow.id,\n inputs,\n when: 'now',\n runAt: '',\n rrule: '',\n timezone: 'UTC',\n eventKind: '',\n afterTaskId: '',\n parentTaskId: '',\n shared: true,\n description: '',\n dueAt: '',\n agentId,\n name: '',\n notifyOnComplete: true,\n access: 'ask_each_run',\n },\n })\n const ran = created.kind === 'work' ? created.ran : null\n const title = created.kind === 'work' ? created.task.title : created.workflow.name\n notify(\n ran === false\n ? 'Task created, but the run could not start'\n : `Running \\u201c${title ?? workflow.title}\\u201d`,\n ran === false ? 'warning' : 'success'\n )\n } catch (error) {\n notify(\n error instanceof Error && error.message.startsWith('Open a workspace')\n ? error.message\n : 'Could not start the run',\n 'error'\n )\n throw error\n }\n return\n }\n\n const landing = launch.landing ?? surfaceLanding ?? workflow.landing\n const inPlace = landing === 'current-chat'\n const binding = PROMPT_BINDINGS[workflow.id]\n /** The run's setup on the session in scope: its file scope, its model, its bound tools. */\n const prepare = () => {\n // Scope the chat to the chosen files when a restriction was made; otherwise the\n // workspace's usual \"all documents\" attachment (useDocumentAutoAdd) applies.\n if (binding?.attachScope !== false && !isEmptyWorkflowScope(scope)) {\n const ids = matchWorkflowScope(documents, scope).map((d) => d.external_id)\n if (ids.length > 0) {\n session.setConversationDocuments(\n inPlace ? (session.getState().conversationId ?? 'new') : 'new',\n ids.map((docId) => ({ docId, isPinned: false }))\n )\n }\n }\n if (workflow.model) void applyModel(workflow.model, `Workflow - ${workflow.title}`)\n // The tools ride the next send of the session in scope.\n session.setPendingTools(binding?.tools?.(inputs) ?? null)\n }\n // A fresh chat's reset clears the draft and the model, so the setup follows it. A surface\n // with its own send sends in its chat (set up first) or opens a fresh one (set up after).\n if (send) {\n if (inPlace) prepare()\n send(prompt)\n if (!inPlace) prepare()\n return\n }\n if (!inPlace) openNewConversation()\n prepare()\n session.setDraft(prompt)\n session.setAutoSendDraft(true)\n },\n [\n annotate,\n applyModel,\n createTask,\n documents,\n surfaceLanding,\n session,\n notify,\n openNewConversation,\n send,\n ]\n )\n}\n","/**\n * The workflow launcher, wired to run what it launches: `ConnectedWorkflowLauncher` (the\n * workspace's files behind scope and file fields, the user's agents behind \"Run as\") with the one\n * launch handler (`useLaunchWorkflow`), the host's upload dialog for adding files\n * (`environment.openUpload`), and the touches of the annotation operation (its derived name and\n * overwrite warning, \"Annotate N documents\").\n *\n * The dashboard's Start band, Files (\"Create new\") and, headless, the slash menu use it.\n */\n\nimport { useTags } from '@arbidocs/react'\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { TriangleAlert } from 'lucide-react'\nimport { documentScopeLabels } from '../../agents/workflows/workspaceScope'\nimport {\n type WorkflowDefinition,\n type WorkflowField,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { ConnectedWorkflowLauncher } from '../ConnectedWorkflowLauncher'\nimport { type StartTile } from '../../home/StartTiles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { ANNOTATE_ID, renderWorkflowIcon } from '../../agents/workflows/catalogue/seed'\nimport { useLaunchWorkflow } from './useLaunchWorkflow'\n\n// The agent picker names the person it hands the work to: the default \"Run as\" / \"My assistant\"\n// copy did not say who an assistant is.\nconst AGENT_LABELS = { label: 'Who this runs for', myAssistant: 'Me (your own assistant)' }\n\nexport interface ConnectedWorkflowStartProps {\n workflows: WorkflowDefinition[]\n /** Which of `workflows` get a tile (a filtered or capped view). */\n tileWorkflows?: WorkflowDefinition[]\n /** Render the Start band (off when another surface opens the dialog). */\n showTiles?: boolean\n caption?: string\n captionTestId?: string\n testId?: string\n /** Plain tiles appended to the band (e.g. the \"Create a file\" menu). */\n extraTiles?: StartTile[]\n /** Controlled open workflow id. */\n activeId?: string | null\n onActiveIdChange?: (id: string | null) => void\n initialInputsFor?: (workflow: WorkflowDefinition) => Partial<WorkflowInputs> | undefined\n /** Where launches land, over each workflow's default (`current-chat` = the chat on screen). */\n landing?: WorkflowLanding\n /** A prompt run's own send (a chat that is not the session's conversation). See `useLaunchWorkflow`. */\n send?: (prompt: string) => void\n /** The host's own \"Add\" control, offered when a workflow needs files and there are none. */\n addFilesAction?: ReactNode\n tileTestId?: (workflow: WorkflowDefinition) => string | undefined\n disabledReason?: (workflow: WorkflowDefinition) => string | undefined\n}\n\nexport function ConnectedWorkflowStart({\n workflows,\n landing,\n send,\n addFilesAction,\n ...rest\n}: ConnectedWorkflowStartProps) {\n const onLaunch = useLaunchWorkflow({ landing, send })\n // The host's icons first (a skill pack names its own), then the kit's, then the skill icon.\n const hostIcon = useHost().workflows?.renderIcon\n const renderIcon = useCallback(\n (key: string) => hostIcon?.(key) ?? renderWorkflowIcon(key) ?? renderWorkflowIcon('skill'),\n [hostIcon]\n )\n const { openUpload } = useBlocksEnvironment()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n\n // The annotation's name is optional: left blank it is taken from the question, which the\n // field's placeholder shows before anything runs.\n const fieldPlaceholder = useCallback(\n (field: WorkflowField, inputs: WorkflowInputs, workflow: WorkflowDefinition) => {\n if (workflow.id !== ANNOTATE_ID || field.name !== 'name') return undefined\n const derived = deriveAnnotationName(String(inputs.description ?? ''))\n return derived ? `Otherwise “${derived}”` : 'Taken from the description'\n },\n []\n )\n\n return (\n <ConnectedWorkflowLauncher\n {...rest}\n workflows={workflows}\n onLaunch={onLaunch}\n renderIcon={renderIcon}\n onAddFiles={openUpload}\n agentLabels={AGENT_LABELS}\n addFilesAction={addFilesAction}\n fieldPlaceholder={fieldPlaceholder}\n submitLabel={({ workflow, matchedCount }) =>\n workflow.id === ANNOTATE_ID && matchedCount !== null\n ? `Annotate ${matchedCount} document${matchedCount !== 1 ? 's' : ''}`\n : undefined\n }\n renderNotice={({ workflow, inputs }) => {\n if (workflow.id !== ANNOTATE_ID) return null\n // A same-named label is reused: warn that this overwrites its stored description and the\n // cell values for the selected documents.\n const name =\n String(inputs.name ?? '').trim() || deriveAnnotationName(String(inputs.description ?? ''))\n const existing = name\n ? tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n : undefined\n if (!existing) return null\n return (\n <div\n className=\"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200\"\n role=\"status\"\n data-testid=\"workflow-existing-label-warning\"\n >\n <TriangleAlert className=\"mt-0.5 size-4 shrink-0 text-amber-500\" />\n <span>\n An annotation called <span className=\"font-medium\">{existing.name}</span> already\n exists. Annotating will overwrite its description and the current cell values for the\n selected files.\n </span>\n </div>\n )\n }}\n />\n )\n}\n","/**\n * Slash skills are launched prompt-first, through the one workflow launcher.\n *\n * A skill (or a prompt-style built-in such as Deep research) is run WITH a prompt, so it never\n * just executes:\n * - picking it in the slash menu opens its form (the prompt field first, focused, required);\n * - typing `/slug` and pressing Enter opens the same form with the field empty;\n * - typing `/slug some text` and pressing Enter opens it with the text already in the field.\n * The rule is the same for any recognised skill slug as the FIRST token of the draft; a backend\n * command (`/goal`, `/compact`, ...) is never a skill and is sent as typed. Nothing is sent from\n * the composer until the user starts it in the form. Without skills enabled (`show_skills`) this\n * applies to the host's skill packs only (`host.workflows.skillPacks`): the menu lists no other\n * skills and any other `/text` is sent as typed.\n *\n * The run lands where the surface says (`landing`), through the one launch handler. A chat that\n * is not the session's conversation (`ChatPage`, the document ask) passes `send`: the composed\n * prompt then goes to its own send, as a typed message would.\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from 'react'\nimport { promptFieldName } from '../../agents/workflows/workflow'\nimport { isSkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport { type SlashMenuItem } from '../../chat/SlashMenu'\nimport {\n type WorkflowDefinition,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport { ConnectedWorkflowStart } from './ConnectedWorkflowStart'\nimport { useWorkflowDefinitions } from './useWorkflowDefinitions'\n\n/** `/slug` or `/slug rest of the line`: the first token and the text after it. */\nconst TYPED_SKILL = /^\\s*\\/([a-zA-Z0-9][a-zA-Z0-9_-]*)(?:\\s+([\\s\\S]*))?$/\n\n/** What the typed draft names: its slug (lower-cased) and the text after it (trimmed). */\nexport function parseTypedSkill(draft: string): { slug: string; text: string } | null {\n const m = TYPED_SKILL.exec(draft)\n return m ? { slug: m[1].toLowerCase(), text: (m[2] ?? '').trim() } : null\n}\n\n/**\n * Whether a skill opens its form from a menu (the `/` menus, the command palette): a prompt skill,\n * and with skills switched off (`show_skills`) only the host's packs. The one gate both share.\n */\nexport function canOpenSkill(workflow: WorkflowDefinition, skillsEnabled: boolean): boolean {\n return workflow.run.kind === 'prompt' && (skillsEnabled || isSkillPackWorkflow(workflow))\n}\n\nexport interface UseSlashSkillWorkflowsOptions {\n landing: WorkflowLanding\n /** Where the composed prompt goes, for a chat that is not the session's conversation. */\n send?: (prompt: string) => void\n}\n\nexport function useSlashSkillWorkflows({ landing, send }: UseSlashSkillWorkflowsOptions): {\n /** Opens the launcher for a picked menu item. True when it did (the caller then clears the draft). */\n openFor: (item: SlashMenuItem) => boolean\n /**\n * Opens the launcher for a typed `/slug text` draft, text pre-filled. True when the draft names\n * a skill (the caller then clears the draft and sends nothing).\n */\n openForDraft: (draft: string) => boolean\n /**\n * Opens the launcher for a skill by id (a surface listing the skills itself, the command\n * palette). True when it is a skill this person may run here.\n */\n openSkill: (id: string) => boolean\n /** The skills this person may open here: the host's packs, and the rest with `show_skills`. */\n openable: WorkflowDefinition[]\n /** Render once, anywhere in the surface that hosts the slash menu. */\n launcher: ReactNode\n} {\n const { skills, skillsEnabled } = useWorkflowDefinitions()\n const { commands } = useBuiltinCommands()\n const [active, setActive] = useState<{ id: string; text: string } | null>(null)\n\n // Stable while the lists are, so a surface can memoise what it builds on them.\n const open = useCallback(\n (workflow: WorkflowDefinition | undefined, text: string): boolean => {\n if (!workflow || !canOpenSkill(workflow, skillsEnabled)) return false\n setActive({ id: workflow.id, text })\n return true\n },\n [skillsEnabled]\n )\n\n const openFor = useCallback(\n (item: SlashMenuItem): boolean =>\n item.kind === 'skill' &&\n open(\n skills.find((w) => w.id === item.name),\n ''\n ),\n [open, skills]\n )\n\n const openSkill = useCallback(\n (id: string): boolean =>\n open(\n skills.find((w) => w.id === id),\n ''\n ),\n [open, skills]\n )\n\n const openable = useMemo(\n () => skills.filter((w) => canOpenSkill(w, skillsEnabled)),\n [skills, skillsEnabled]\n )\n\n const openForDraft = useCallback(\n (draft: string): boolean => {\n const typed = parseTypedSkill(draft)\n if (!typed) return false\n // A backend command wins a name collision, as in the menu: it is sent as typed.\n if (commands.some((c) => c.name.toLowerCase() === typed.slug)) return false\n return open(\n skills.find((w) => w.id.toLowerCase() === typed.slug),\n typed.text\n )\n },\n [open, skills, commands]\n )\n\n // Mounted only while a workflow is open: the ask bar lives in every page's topbar, so the\n // launcher's data hooks (files, agents, tasks) must not run until it is needed.\n const launcher = useMemo(() => {\n if (active === null) return null\n const initialInputsFor = (\n workflow: WorkflowDefinition\n ): Partial<WorkflowInputs> | undefined => {\n const field = promptFieldName(workflow)\n return field && active.text ? { [field]: active.text } : undefined\n }\n return (\n <ConnectedWorkflowStart\n workflows={skills}\n showTiles={false}\n landing={landing}\n send={send}\n activeId={active.id}\n onActiveIdChange={(id) => id === null && setActive(null)}\n initialInputsFor={initialInputsFor}\n />\n )\n }, [active, skills, landing, send])\n\n return { openFor, openForDraft, openSkill, openable, launcher }\n}\n","/**\n * The slash menu's data, in one place for every surface that hosts it (the chat composers, the\n * workspace ask bar, the document ask and `ChatPage`): the backend's built-in commands, the host's\n * skill packs and the user's skills, filtered by the slash token in progress. Commands and the\n * user's skills are typed `/<slug>` and dispatched by the backend; a skill opens its form\n * (`useSlashSkillWorkflows`).\n */\n\nimport { useMemo } from 'react'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { buildSlashItems, filterSlashItems, parseSlashToken } from '../../chat/slash-menu-helpers'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\nimport { useCanBrowseSkills, useSkillsEnabled } from '../workflows/useSkillsEnabled'\nimport { hostSkillItem, useHostSkills } from '../workflows/useHostSkills'\nimport { useUsableSkillListings } from '../workflows/useWorkflowDefinitions'\nimport { useNamedWorkflows } from '../workflows/useNamedWorkflows'\n\nconst NO_SKILLS: ReadonlyArray<WorkflowDefinition> = []\n\n/**\n * Every row of the menu, unfiltered: commands, then the host's packs (always: the host offers\n * them), then, for skills users (`show_skills`), the built-in skills and the user's own.\n *\n * @param builtinSkills The built-in skills to offer (prompt workflows offered as `/slug`), for a\n * surface that can open their form; default none.\n */\nexport function useSlashMenuItems(builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS): {\n items: SlashMenuItem[]\n /** The menu's \"Browse all\" footer opens the Skills browser: skills users, never guests. */\n canBrowseSkills: boolean\n} {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const skillsEnabled = useSkillsEnabled()\n const { commands } = useBuiltinCommands()\n const builtins = useNamedWorkflows(builtinSkills)\n const items = useMemo<SlashMenuItem[]>(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n return buildSlashItems(\n commands.map((c) => ({\n name: c.name,\n description: c.description,\n argHint: c.arg_hint,\n kind: 'command' as const,\n })),\n [\n ...hostSkills.map(hostSkillItem),\n ...(skillsEnabled\n ? skillItems(\n builtins.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n : []),\n ]\n )\n }, [commands, hostSkills, listings, skillsEnabled, builtins])\n return { items, canBrowseSkills: useCanBrowseSkills() }\n}\n\n/**\n * @param text The draft.\n * @param builtinSkills The built-in skills (prompt workflows offered as `/slug`).\n */\nexport function useSlashItems(\n text: string,\n builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS\n) {\n const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills)\n const slashToken = parseSlashToken(text)\n const filteredItems = useMemo(\n () => (slashToken !== null ? filterSlashItems(items, slashToken) : []),\n [items, slashToken]\n )\n return {\n slashToken,\n filteredItems,\n isOpen: slashToken !== null && filteredItems.length > 0,\n canBrowseSkills,\n }\n}\n\ntype SkillListings = ReturnType<typeof useUsableSkillListings>\n\n/**\n * Built-in skills share the list and the `/slug` path; a same-slug skill of the user's own shadows\n * the built-in, as on the backend.\n */\nfunction skillItems(\n builtinSkills: ReadonlyArray<WorkflowDefinition>,\n listings: SkillListings\n): SlashMenuItem[] {\n const { host, skills } = mergeSkillWorkflows([...builtinSkills], listings)\n const listing = new Map(listings.map((s) => [s.slug, s]))\n return [\n ...host.map((w): SlashMenuItem => ({\n name: w.id,\n description: w.description,\n argHint: w.inputs[0]?.label ?? '',\n visibility: 'global',\n kind: 'skill',\n })),\n ...skills.map((w): SlashMenuItem => {\n const s = listing.get(w.id)\n return {\n name: w.id,\n description: s?.description || (w.title !== w.id ? w.title : ''),\n argHint: s?.arg_hint ?? '',\n visibility: s?.visibility === 'global' ? 'global' : 'mine',\n kind: 'skill',\n }\n }),\n ]\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/workflows/launch-bindings.ts","../src/connection/workflows/useLaunchWorkflow.ts","../src/connection/workflows/ConnectedWorkflowStart.tsx","../src/connection/workflows/useSlashSkillWorkflows.tsx","../src/connection/conversation/useSlashItems.ts"],"names":["GENERATE_IMAGE_ID","buildRetrievalChunkTool","buildRetrievalFullContextTool","IMAGE_ASPECT_AUTO","useDocuments","useTags","useMemo","documentScopeLabels","useCreateTag","useUpdateTag","useGenerateDocTags","useWorkflowTasks","useApplyChatModel","useArbiSessionStore","useBlocksEnvironment","useCallback","deriveAnnotationName","matchWorkflowScope","ANNOTATE_ID","recordWorkflowUse","getDocumentTitle","composeWorkflowPrompt","isEmptyWorkflowScope","useHost","renderWorkflowIcon","jsx","ConnectedWorkflowLauncher","jsxs","TriangleAlert","isSkillPackWorkflow","useWorkflowDefinitions","useBuiltinCommands","useState","text","promptFieldName","useHostSkills","useUsableSkillListings","useSkillsEnabled","useNamedWorkflows","buildSlashItems","hostSkillItem","useCanBrowseSkills","parseSlashTokenInProgress","filterSlashItems","mergeSkillWorkflows"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAM,YAAA,GAAe,CAAC,MAAA,KAAqC;AACzD,EAAA,MAAM,QAAQ,MAAA,CAAO,UAAA;AACrB,EAAA,OAAO,KAAA,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AA,EAAM,CAAC,CAAC,CAAC,CAAA;AACxD,EAAA,OAAO;AAAA,IACL,GAAG,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,MAAsB;AAAA,MACjC,MAAM,CAAA,CAAE,EAAA;AAAA,MACR,aAAa,CAAA,CAAE,WAAA;AAAA,MACf,OAAA,EAAS,CAAA,CAAE,MAAA,CAAO,CAAC,GAAG,KAAA,IAAS,EAAA;AAAA,MAC/B,UAAA,EAAY,QAAA;AAAA,MACZ,IAAA,EAAM;AAAA,KACR,CAAE,CAAA;AAAA,IACF,GAAG,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,KAAqB;AAClC,MAAA,MAAM,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAE,EAAE,CAAA;AAC1B,MAAA,OAAO;AAAA,QACL,MAAM,CAAA,CAAE,EAAA;AAAA,QACR,WAAA,EAAa,GAAG,WAAA,KAAgB,CAAA,CAAE,UAAU,CAAA,CAAE,EAAA,GAAK,EAAE,KAAA,GAAQ,EAAA,CAAA;AAAA,QAC7D,OAAA,EAAS,GAAG,QAAA,IAAY,EAAA;AAAA,QACxB,UAAA,EAAY,CAAA,EAAG,UAAA,KAAe,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-557MJ4IH.cjs","sourcesContent":["/**\n * Host bindings of prompt workflows that need more than words on send. Bound by workflow id, the\n * same way the annotation operation is: blocks and the registry stay declarative, and the one\n * place that knows the wire shape is here.\n *\n * Generate image: the reference images and the aspect ratio ride structured tool arguments\n * (`retrieval_full_context` over every reference, `image_generation.aspect_ratio`), never the\n * prompt text: the image model does not reliably honour a shape or sources worded into the prompt,\n * and the references go to the separate image model in its own request, so (unlike the app's\n * one-at-a-time pinned document) several of them do not compound against the agent's context.\n */\n\nimport type { WorkflowInputs, WorkflowScope } from '../../agents/workflows/types'\nimport { buildRetrievalChunkTool, buildRetrievalFullContextTool } from '@arbidocs/sdk/browser'\nimport type { TurnTools } from '@arbidocs/react'\nimport { GENERATE_IMAGE_ID, IMAGE_ASPECT_AUTO } from '../../agents/workflows/catalogue/seed'\n\nexport interface PromptBinding {\n /** Attach the scoped files to the chat (default true). Off when the files are tool inputs. */\n attachScope: boolean\n /** Structured tools for the one send, from the form's inputs. */\n tools?: (inputs: WorkflowInputs) => TurnTools\n}\n\nconst referencesOf = (inputs: WorkflowInputs): string[] => {\n const value = inputs.references as WorkflowScope | undefined\n return value?.documents ?? []\n}\n\nexport const PROMPT_BINDINGS: Record<string, PromptBinding> = {\n [GENERATE_IMAGE_ID]: {\n attachScope: false,\n tools: (inputs) => {\n const aspectRatio = typeof inputs.aspect_ratio === 'string' ? inputs.aspect_ratio : ''\n return {\n retrieval_chunk: buildRetrievalChunkTool([]),\n retrieval_full_context: buildRetrievalFullContextTool(referencesOf(inputs)),\n ...(aspectRatio && aspectRatio !== IMAGE_ASPECT_AUTO\n ? {\n image_generation: {\n name: 'image_generation' as const,\n description: 'image generation',\n tool_args: { aspect_ratio: aspectRatio },\n tool_responses: {},\n },\n }\n : {}),\n }\n },\n },\n}\n","/**\n * The host side of the launch contract: `onLaunch({workflow, inputs, scope, agentId})`.\n *\n * Blocks only say WHAT to run; this performs it, so workspace isolation stays host-side:\n *\n * - prompt workflow, my assistant: open a fresh chat (or stay in this one when `inPlace`), scope\n * its documents, set the composed draft and ask for it to be sent (`autoSendDraft`). The host's\n * send waits for the new chat's documents to be seeded, so a scoped run is never sent with the\n * wrong files. Order matters: `openNewConversation` resets the draft, so it is set after it.\n * - prompt workflow, another agent: a run-now task assigned to that agent (the interactive chat\n * query has no agent parameter), created through the same path as the task composer.\n * - operation workflow (tier B): the handler bound to its id (annotation).\n * - a workflow's own model becomes the chat's (`useApplyChatModel`).\n *\n * The prompt is composed in exactly one place: `composeWorkflowPrompt(workflow, inputs)`.\n */\n\nimport {\n useApplyChatModel,\n useArbiSessionStore,\n useCreateTag,\n useDocuments,\n useGenerateDocTags,\n useTags,\n useUpdateTag,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport { useCallback, useMemo } from 'react'\nimport { composeWorkflowPrompt, isEmptyWorkflowScope } from '../../agents/workflows/workflow'\nimport { documentScopeLabels, matchWorkflowScope } from '../../agents/workflows/workspaceScope'\nimport {\n type WorkflowInputs,\n type WorkflowLanding,\n type WorkflowLaunch,\n} from '../../agents/workflows/types'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { PROMPT_BINDINGS } from './launch-bindings'\nimport { ANNOTATE_ID } from '../../agents/workflows/catalogue/seed'\nimport { useWorkflowTasks } from './useWorkflowTasks'\nimport { recordWorkflowUse } from '../../agents/workflows/catalogue/workflow-usage'\n\nexport interface UseLaunchWorkflowOptions {\n /**\n * Where launches from this surface land, over each workflow's own default. The empty chat and\n * the slash menu send into the conversation on screen (`current-chat`); everything else opens a\n * fresh one. A single launch can still override it (`WorkflowLaunch.landing`).\n */\n landing?: WorkflowLanding\n /**\n * A prompt run on the user's own assistant is sent here instead of through the session's draft:\n * the surface's own chat (`ChatPage`) or its own ask (the document ask). Everything else is the\n * same: the file scope, the workflow's model and its bound tools are set on the session in scope\n * (before a send in place, after a send that opens a fresh chat), so the turn carries them.\n */\n send?: (prompt: string) => void\n}\n\nconst text = (inputs: WorkflowInputs, name: string): string => {\n const v = inputs[name]\n return typeof v === 'string' ? v.trim() : ''\n}\n\nexport function useLaunchWorkflow({\n landing: surfaceLanding,\n send,\n}: UseLaunchWorkflowOptions = {}) {\n const { data: documents = [] } = useDocuments()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n const createTag = useCreateTag()\n const updateTag = useUpdateTag()\n const generate = useGenerateDocTags()\n const { create: createTask } = useWorkflowTasks()\n const applyModel = useApplyChatModel()\n const session = useArbiSessionStore()\n const { notify, openFiles, openNewConversation } = useBlocksEnvironment()\n\n /** Annotation: create (or reuse) the label, start the AI run, land on Files filtered to the set. */\n const annotate = useCallback(\n async ({ inputs, scope }: WorkflowLaunch) => {\n const description = text(inputs, 'description')\n const name = text(inputs, 'name') || deriveAnnotationName(description)\n const matching = matchWorkflowScope(documents, scope)\n if (!name || !description || matching.length === 0) return\n try {\n // A same-named label is reused rather than duplicated, the rule the Files page's\n // label-creation paths follow.\n const existing = tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n let tagId: string\n if (existing) {\n tagId = existing.external_id\n await updateTag.mutateAsync({\n tagId: tagId,\n change: { instruction: description },\n })\n } else {\n const created = await createTag.mutateAsync({\n name,\n tagType: { type: 'text', options: [] },\n shared: true,\n instruction: description,\n })\n const createdId = (created as { external_id?: string } | undefined)?.external_id\n if (!createdId) throw new Error('tag create returned no id')\n tagId = createdId\n }\n const docIds = matching.map((d) => d.external_id)\n // overwrite=true so a re-run on an existing field refreshes stale values, matching the\n // Files page's default review behaviour.\n await generate.mutateAsync({ tagIds: [tagId], docIds: docIds, overwrite: true })\n // Land on Files with those documents selected and the view narrowed to the annotated set\n // through the same tri-state quick filter the pickers write to. An empty scope selected\n // every file, so no filter is applied.\n const filters: Record<string, 'include'> = {}\n scope.folders.forEach((folder) => {\n filters[folder === '' ? 'folder:none' : `folder:${folder}`] = 'include'\n })\n scope.labels.forEach((labelId) => {\n filters[labelId] = 'include'\n })\n openFiles({ select: docIds, filters })\n } catch (error) {\n notify('Could not start the annotation', 'error')\n throw error\n }\n },\n [documents, tags, createTag, updateTag, generate, openFiles, notify]\n )\n\n return useCallback(\n async (launch: WorkflowLaunch) => {\n const { workflow, inputs, scope, agentId } = launch\n if (workflow.run.kind === 'operation') {\n if (workflow.id === ANNOTATE_ID) {\n await annotate(launch)\n recordWorkflowUse(workflow.id)\n return\n }\n throw new Error(`No host handler for workflow \"${workflow.id}\"`)\n }\n\n // Names for the wording: a `documents` field quotes the files it picked.\n const documentTitles = Object.fromEntries(\n documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])\n )\n const prompt = composeWorkflowPrompt(workflow, inputs, { documentTitles })\n if (!prompt) return\n recordWorkflowUse(workflow.id)\n\n if (agentId) {\n try {\n const created = await createTask({\n workflow,\n values: {\n assignee: 'agent',\n workflowId: workflow.id,\n inputs,\n when: 'now',\n runAt: '',\n rrule: '',\n timezone: 'UTC',\n eventKind: '',\n afterTaskId: '',\n parentTaskId: '',\n shared: true,\n description: '',\n dueAt: '',\n agentId,\n name: '',\n notifyOnComplete: true,\n access: 'ask_each_run',\n },\n })\n const ran = created.kind === 'work' ? created.ran : null\n const title = created.kind === 'work' ? created.task.title : created.workflow.name\n notify(\n ran === false\n ? 'Task created, but the run could not start'\n : `Running \\u201c${title ?? workflow.title}\\u201d`,\n ran === false ? 'warning' : 'success'\n )\n } catch (error) {\n notify(\n error instanceof Error && error.message.startsWith('Open a workspace')\n ? error.message\n : 'Could not start the run',\n 'error'\n )\n throw error\n }\n return\n }\n\n const landing = launch.landing ?? surfaceLanding ?? workflow.landing\n const inPlace = landing === 'current-chat'\n const binding = PROMPT_BINDINGS[workflow.id]\n /** The run's setup on the session in scope: its file scope, its model, its bound tools. */\n const prepare = () => {\n // Scope the chat to the chosen files when a restriction was made; otherwise the\n // workspace's usual \"all documents\" attachment (useDocumentAutoAdd) applies.\n if (binding?.attachScope !== false && !isEmptyWorkflowScope(scope)) {\n const ids = matchWorkflowScope(documents, scope).map((d) => d.external_id)\n if (ids.length > 0) {\n session.setConversationDocuments(\n inPlace ? (session.getState().conversationId ?? 'new') : 'new',\n ids.map((docId) => ({ docId, isPinned: false }))\n )\n }\n }\n if (workflow.model) void applyModel(workflow.model, `Workflow - ${workflow.title}`)\n // The tools ride the next send of the session in scope.\n session.setPendingTools(binding?.tools?.(inputs) ?? null)\n }\n // A fresh chat's reset clears the draft and the model, so the setup follows it. A surface\n // with its own send sends in its chat (set up first) or opens a fresh one (set up after).\n if (send) {\n if (inPlace) prepare()\n send(prompt)\n if (!inPlace) prepare()\n return\n }\n if (!inPlace) openNewConversation()\n prepare()\n session.setDraft(prompt)\n session.setAutoSendDraft(true)\n },\n [\n annotate,\n applyModel,\n createTask,\n documents,\n surfaceLanding,\n session,\n notify,\n openNewConversation,\n send,\n ]\n )\n}\n","/**\n * The workflow launcher, wired to run what it launches: `ConnectedWorkflowLauncher` (the\n * workspace's files behind scope and file fields, the user's agents behind \"Run as\") with the one\n * launch handler (`useLaunchWorkflow`), the host's upload dialog for adding files\n * (`environment.openUpload`), and the touches of the annotation operation (its derived name and\n * overwrite warning, \"Annotate N documents\").\n *\n * The dashboard's Start band, Files (\"Create new\") and, headless, the slash menu use it.\n */\n\nimport { useTags } from '@arbidocs/react'\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { TriangleAlert } from 'lucide-react'\nimport { documentScopeLabels } from '../../agents/workflows/workspaceScope'\nimport {\n type WorkflowDefinition,\n type WorkflowField,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { ConnectedWorkflowLauncher } from '../ConnectedWorkflowLauncher'\nimport { type StartTile } from '../../home/StartTiles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { ANNOTATE_ID, renderWorkflowIcon } from '../../agents/workflows/catalogue/seed'\nimport { useLaunchWorkflow } from './useLaunchWorkflow'\n\n// The agent picker names the person it hands the work to: the default \"Run as\" / \"My assistant\"\n// copy did not say who an assistant is.\nconst AGENT_LABELS = { label: 'Who this runs for', myAssistant: 'Me (your own assistant)' }\n\nexport interface ConnectedWorkflowStartProps {\n workflows: WorkflowDefinition[]\n /** Which of `workflows` get a tile (a filtered or capped view). */\n tileWorkflows?: WorkflowDefinition[]\n /** Render the Start band (off when another surface opens the dialog). */\n showTiles?: boolean\n caption?: string\n captionTestId?: string\n testId?: string\n /** Plain tiles appended to the band (e.g. the \"Create a file\" menu). */\n extraTiles?: StartTile[]\n /** Controlled open workflow id. */\n activeId?: string | null\n onActiveIdChange?: (id: string | null) => void\n initialInputsFor?: (workflow: WorkflowDefinition) => Partial<WorkflowInputs> | undefined\n /** Where launches land, over each workflow's default (`current-chat` = the chat on screen). */\n landing?: WorkflowLanding\n /** A prompt run's own send (a chat that is not the session's conversation). See `useLaunchWorkflow`. */\n send?: (prompt: string) => void\n /** The host's own \"Add\" control, offered when a workflow needs files and there are none. */\n addFilesAction?: ReactNode\n tileTestId?: (workflow: WorkflowDefinition) => string | undefined\n disabledReason?: (workflow: WorkflowDefinition) => string | undefined\n}\n\nexport function ConnectedWorkflowStart({\n workflows,\n landing,\n send,\n addFilesAction,\n ...rest\n}: ConnectedWorkflowStartProps) {\n const onLaunch = useLaunchWorkflow({ landing, send })\n // The host's icons first (a skill pack names its own), then the kit's, then the skill icon.\n const hostIcon = useHost().workflows?.renderIcon\n const renderIcon = useCallback(\n (key: string) => hostIcon?.(key) ?? renderWorkflowIcon(key) ?? renderWorkflowIcon('skill'),\n [hostIcon]\n )\n const { openUpload } = useBlocksEnvironment()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n\n // The annotation's name is optional: left blank it is taken from the question, which the\n // field's placeholder shows before anything runs.\n const fieldPlaceholder = useCallback(\n (field: WorkflowField, inputs: WorkflowInputs, workflow: WorkflowDefinition) => {\n if (workflow.id !== ANNOTATE_ID || field.name !== 'name') return undefined\n const derived = deriveAnnotationName(String(inputs.description ?? ''))\n return derived ? `Otherwise “${derived}”` : 'Taken from the description'\n },\n []\n )\n\n return (\n <ConnectedWorkflowLauncher\n {...rest}\n workflows={workflows}\n onLaunch={onLaunch}\n renderIcon={renderIcon}\n onAddFiles={openUpload}\n agentLabels={AGENT_LABELS}\n addFilesAction={addFilesAction}\n fieldPlaceholder={fieldPlaceholder}\n submitLabel={({ workflow, matchedCount }) =>\n workflow.id === ANNOTATE_ID && matchedCount !== null\n ? `Annotate ${matchedCount} document${matchedCount !== 1 ? 's' : ''}`\n : undefined\n }\n renderNotice={({ workflow, inputs }) => {\n if (workflow.id !== ANNOTATE_ID) return null\n // A same-named label is reused: warn that this overwrites its stored description and the\n // cell values for the selected documents.\n const name =\n String(inputs.name ?? '').trim() || deriveAnnotationName(String(inputs.description ?? ''))\n const existing = name\n ? tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n : undefined\n if (!existing) return null\n return (\n <div\n className=\"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200\"\n role=\"status\"\n data-testid=\"workflow-existing-label-warning\"\n >\n <TriangleAlert className=\"mt-0.5 size-4 shrink-0 text-amber-500\" />\n <span>\n An annotation called <span className=\"font-medium\">{existing.name}</span> already\n exists. Annotating will overwrite its description and the current cell values for the\n selected files.\n </span>\n </div>\n )\n }}\n />\n )\n}\n","/**\n * Slash skills are launched prompt-first, through the one workflow launcher.\n *\n * A skill (or a prompt-style built-in such as Deep research) is run WITH a prompt, so it never\n * just executes:\n * - picking it in the slash menu opens its form (the prompt field first, focused, required);\n * - typing `/slug` and pressing Enter opens the same form with the field empty;\n * - typing `/slug some text` and pressing Enter opens it with the text already in the field.\n * The rule is the same for any recognised skill slug as the FIRST token of the draft; a backend\n * command (`/goal`, `/compact`, ...) is never a skill and is sent as typed. Nothing is sent from\n * the composer until the user starts it in the form. Without skills enabled (`show_skills`) this\n * applies to the host's skill packs only (`host.workflows.skillPacks`): the menu lists no other\n * skills and any other `/text` is sent as typed.\n *\n * The run lands where the surface says (`landing`), through the one launch handler. A chat that\n * is not the session's conversation (`ChatPage`, the document ask) passes `send`: the composed\n * prompt then goes to its own send, as a typed message would.\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from 'react'\nimport { promptFieldName } from '../../agents/workflows/workflow'\nimport { isSkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport { type SlashMenuItem } from '../../chat/SlashMenu'\nimport {\n type WorkflowDefinition,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport { ConnectedWorkflowStart } from './ConnectedWorkflowStart'\nimport { useWorkflowDefinitions } from './useWorkflowDefinitions'\n\n/** `/slug` or `/slug rest of the line`: the first token and the text after it. */\nconst TYPED_SKILL = /^\\s*\\/([a-zA-Z0-9][a-zA-Z0-9_-]*)(?:\\s+([\\s\\S]*))?$/\n\n/** What the typed draft names: its slug (lower-cased) and the text after it (trimmed). */\nexport function parseTypedSkill(draft: string): { slug: string; text: string } | null {\n const m = TYPED_SKILL.exec(draft)\n return m ? { slug: m[1].toLowerCase(), text: (m[2] ?? '').trim() } : null\n}\n\n/**\n * Whether a skill opens its form from a menu (the `/` menus, the command palette): a prompt skill,\n * and with skills switched off (`show_skills`) only the host's packs. The one gate both share.\n */\nexport function canOpenSkill(workflow: WorkflowDefinition, skillsEnabled: boolean): boolean {\n return workflow.run.kind === 'prompt' && (skillsEnabled || isSkillPackWorkflow(workflow))\n}\n\nexport interface UseSlashSkillWorkflowsOptions {\n landing: WorkflowLanding\n /** Where the composed prompt goes, for a chat that is not the session's conversation. */\n send?: (prompt: string) => void\n}\n\nexport function useSlashSkillWorkflows({ landing, send }: UseSlashSkillWorkflowsOptions): {\n /** Opens the launcher for a picked menu item. True when it did (the caller then clears the draft). */\n openFor: (item: SlashMenuItem) => boolean\n /**\n * Opens the launcher for a typed `/slug text` draft, text pre-filled. True when the draft names\n * a skill (the caller then clears the draft and sends nothing).\n */\n openForDraft: (draft: string) => boolean\n /**\n * Opens the launcher for a skill by id (a surface listing the skills itself, the command\n * palette). True when it is a skill this person may run here.\n */\n openSkill: (id: string) => boolean\n /** The skills this person may open here: the host's packs, and the rest with `show_skills`. */\n openable: WorkflowDefinition[]\n /** Render once, anywhere in the surface that hosts the slash menu. */\n launcher: ReactNode\n} {\n const { skills, skillsEnabled } = useWorkflowDefinitions()\n const { commands } = useBuiltinCommands()\n const [active, setActive] = useState<{ id: string; text: string } | null>(null)\n\n // Stable while the lists are, so a surface can memoise what it builds on them.\n const open = useCallback(\n (workflow: WorkflowDefinition | undefined, text: string): boolean => {\n if (!workflow || !canOpenSkill(workflow, skillsEnabled)) return false\n setActive({ id: workflow.id, text })\n return true\n },\n [skillsEnabled]\n )\n\n const openFor = useCallback(\n (item: SlashMenuItem): boolean =>\n item.kind === 'skill' &&\n open(\n skills.find((w) => w.id === item.name),\n ''\n ),\n [open, skills]\n )\n\n const openSkill = useCallback(\n (id: string): boolean =>\n open(\n skills.find((w) => w.id === id),\n ''\n ),\n [open, skills]\n )\n\n const openable = useMemo(\n () => skills.filter((w) => canOpenSkill(w, skillsEnabled)),\n [skills, skillsEnabled]\n )\n\n const openForDraft = useCallback(\n (draft: string): boolean => {\n const typed = parseTypedSkill(draft)\n if (!typed) return false\n // A backend command wins a name collision, as in the menu: it is sent as typed.\n if (commands.some((c) => c.name.toLowerCase() === typed.slug)) return false\n return open(\n skills.find((w) => w.id.toLowerCase() === typed.slug),\n typed.text\n )\n },\n [open, skills, commands]\n )\n\n // Mounted only while a workflow is open: the ask bar lives in every page's topbar, so the\n // launcher's data hooks (files, agents, tasks) must not run until it is needed.\n const launcher = useMemo(() => {\n if (active === null) return null\n const initialInputsFor = (\n workflow: WorkflowDefinition\n ): Partial<WorkflowInputs> | undefined => {\n const field = promptFieldName(workflow)\n return field && active.text ? { [field]: active.text } : undefined\n }\n return (\n <ConnectedWorkflowStart\n workflows={skills}\n showTiles={false}\n landing={landing}\n send={send}\n activeId={active.id}\n onActiveIdChange={(id) => id === null && setActive(null)}\n initialInputsFor={initialInputsFor}\n />\n )\n }, [active, skills, landing, send])\n\n return { openFor, openForDraft, openSkill, openable, launcher }\n}\n","/**\n * The slash menu's data, in one place for every surface that hosts it (the chat composers, the\n * workspace ask bar, the document ask and `ChatPage`): the backend's built-in commands, the host's\n * skill packs and the user's skills, filtered by the slash token in progress. Commands and the\n * user's skills are typed `/<slug>` and dispatched by the backend; a skill opens its form\n * (`useSlashSkillWorkflows`).\n */\n\nimport { useMemo } from 'react'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { buildSlashItems, filterSlashItems, parseSlashToken } from '../../chat/slash-menu-helpers'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\nimport { useCanBrowseSkills, useSkillsEnabled } from '../workflows/useSkillsEnabled'\nimport { hostSkillItem, useHostSkills } from '../workflows/useHostSkills'\nimport { useUsableSkillListings } from '../workflows/useWorkflowDefinitions'\nimport { useNamedWorkflows } from '../workflows/useNamedWorkflows'\n\nconst NO_SKILLS: ReadonlyArray<WorkflowDefinition> = []\n\n/**\n * Every row of the menu, unfiltered: commands, then the host's packs (always: the host offers\n * them), then, for skills users (`show_skills`), the built-in skills and the user's own.\n *\n * @param builtinSkills The built-in skills to offer (prompt workflows offered as `/slug`), for a\n * surface that can open their form; default none.\n */\nexport function useSlashMenuItems(builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS): {\n items: SlashMenuItem[]\n /** The menu's \"Browse all\" footer opens the Skills browser: skills users, never guests. */\n canBrowseSkills: boolean\n} {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const skillsEnabled = useSkillsEnabled()\n const { commands } = useBuiltinCommands()\n const builtins = useNamedWorkflows(builtinSkills)\n const items = useMemo<SlashMenuItem[]>(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n return buildSlashItems(\n commands.map((c) => ({\n name: c.name,\n description: c.description,\n argHint: c.arg_hint,\n kind: 'command' as const,\n })),\n [\n ...hostSkills.map(hostSkillItem),\n ...(skillsEnabled\n ? skillItems(\n builtins.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n : []),\n ]\n )\n }, [commands, hostSkills, listings, skillsEnabled, builtins])\n return { items, canBrowseSkills: useCanBrowseSkills() }\n}\n\n/**\n * @param text The draft.\n * @param builtinSkills The built-in skills (prompt workflows offered as `/slug`).\n */\nexport function useSlashItems(\n text: string,\n builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS\n) {\n const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills)\n const slashToken = parseSlashToken(text)\n const filteredItems = useMemo(\n () => (slashToken !== null ? filterSlashItems(items, slashToken) : []),\n [items, slashToken]\n )\n return {\n slashToken,\n filteredItems,\n isOpen: slashToken !== null && filteredItems.length > 0,\n canBrowseSkills,\n }\n}\n\ntype SkillListings = ReturnType<typeof useUsableSkillListings>\n\n/**\n * Built-in skills share the list and the `/slug` path; a same-slug skill of the user's own shadows\n * the built-in, as on the backend.\n */\nfunction skillItems(\n builtinSkills: ReadonlyArray<WorkflowDefinition>,\n listings: SkillListings\n): SlashMenuItem[] {\n const { host, skills } = mergeSkillWorkflows([...builtinSkills], listings)\n const listing = new Map(listings.map((s) => [s.slug, s]))\n return [\n ...host.map((w): SlashMenuItem => ({\n name: w.id,\n description: w.description,\n argHint: w.inputs[0]?.label ?? '',\n visibility: 'global',\n kind: 'skill',\n })),\n ...skills.map((w): SlashMenuItem => {\n const s = listing.get(w.id)\n return {\n name: w.id,\n description: s?.description || (w.title !== w.id ? w.title : ''),\n argHint: s?.arg_hint ?? '',\n visibility: s?.visibility === 'global' ? 'global' : 'mine',\n kind: 'skill',\n }\n }),\n ]\n}\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk7JLJH5CW_cjs = require('./chunk-7JLJH5CW.cjs');
|
|
5
|
-
var chunkQRAQZTJE_cjs = require('./chunk-QRAQZTJE.cjs');
|
|
6
5
|
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
6
|
+
var chunkQRAQZTJE_cjs = require('./chunk-QRAQZTJE.cjs');
|
|
7
7
|
var chunkTKHCIHE2_cjs = require('./chunk-TKHCIHE2.cjs');
|
|
8
8
|
var react = require('@arbidocs/react');
|
|
9
9
|
var react$1 = require('react');
|
|
@@ -189,5 +189,5 @@ exports.useUsableSkillListings = useUsableSkillListings;
|
|
|
189
189
|
exports.useWorkflowDefinitions = useWorkflowDefinitions;
|
|
190
190
|
exports.useWorkflowTasks = useWorkflowTasks;
|
|
191
191
|
exports.withoutMarketplace = withoutMarketplace;
|
|
192
|
-
//# sourceMappingURL=chunk-
|
|
193
|
-
//# sourceMappingURL=chunk-
|
|
192
|
+
//# sourceMappingURL=chunk-6UTKM5AB.cjs.map
|
|
193
|
+
//# sourceMappingURL=chunk-6UTKM5AB.cjs.map
|