@agimon-ai/po-web-components 0.0.0-alpha.212 → 0.0.0-alpha.214
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/index.cjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/po-runtime-identity.json +1 -1
- package/dist/src/components/Button.cjs +1 -1
- package/dist/src/components/Button.cjs.map +1 -1
- package/dist/src/components/Button.mjs +1 -1
- package/dist/src/components/Button.mjs.map +1 -1
- package/dist/src/components/ProfilePicker.cjs +1 -1
- package/dist/src/components/ProfilePicker.cjs.map +1 -1
- package/dist/src/components/ProfilePicker.d.mts +6 -1
- package/dist/src/components/ProfilePicker.d.mts.map +1 -1
- package/dist/src/components/ProfilePicker.mjs +1 -1
- package/dist/src/components/ProfilePicker.mjs.map +1 -1
- package/dist/src/components/Select.cjs +1 -1
- package/dist/src/components/Select.cjs.map +1 -1
- package/dist/src/components/Select.mjs +1 -1
- package/dist/src/components/Select.mjs.map +1 -1
- package/dist/src/lib/profilePicker.cjs +1 -1
- package/dist/src/lib/profilePicker.cjs.map +1 -1
- package/dist/src/lib/profilePicker.d.mts +10 -0
- package/dist/src/lib/profilePicker.d.mts.map +1 -1
- package/dist/src/lib/profilePicker.mjs +1 -1
- package/dist/src/lib/profilePicker.mjs.map +1 -1
- package/locales/vi.json +4 -0
- package/locales/zh-CN.json +4 -0
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("./src/icons/icons.cjs");const ee=require("./src/lib/cn.cjs"),e=require("./src/components/Accordion.cjs"),t=require("./src/lib/ansiSpans.cjs"),n=require("./src/components/AnsiText.cjs"),r=require("./src/components/Avatar.cjs"),i=require("./src/components/Dot.cjs"),a=require("./src/components/AgentAvatar.cjs"),o=require("./src/components/Badge.cjs"),s=require("./src/components/Tooltip.cjs"),c=require("./src/components/Breadcrumb.cjs"),te=require("./src/components/Spinner.cjs"),l=require("./src/components/Button.cjs"),u=require("./src/components/Dialog.cjs"),d=require("./src/lib/review.cjs"),f=require("./src/components/DiffView.cjs"),ne=require("./src/components/Drawer.cjs"),p=require("./src/components/DropdownMenu.cjs"),re=require("./src/components/Checkbox.cjs"),ie=require("./src/lib/editorLanguage.cjs"),m=require("./src/lib/markdownMediaSlot.cjs"),h=require("./src/lib/markdownMedia.cjs"),g=require("./src/lib/syntaxHighlight.cjs"),_=require("./src/components/SyntaxText.cjs"),ae=require("./src/components/CodeBlock.cjs"),oe=require("./src/components/Skeleton.cjs"),se=require("./src/components/CodeEditor.cjs"),v=require("./src/components/Collapsible.cjs"),y=require("./src/components/Input.cjs"),b=require("./src/lib/optionList.cjs"),x=require("./src/components/OptionList.cjs"),S=require("./src/components/Command.cjs"),C=require("./src/components/Panel.cjs"),w=require("./src/components/CtaCard.cjs"),ce=require("./src/components/EmptyState.cjs"),le=require("./src/components/LoadingState.cjs"),T=require("./src/lib/files.cjs"),E=require("./src/components/Tabs.cjs"),D=require("./src/components/FileBrowser.cjs"),O=require("./src/components/MediaViewerDialog.cjs"),ue=require("./src/components/Markdown.cjs"),de=require("./src/components/FilePreview.cjs"),k=require("./src/lib/fileDownload.cjs"),fe=require("./src/components/FlowGraph.cjs"),A=require("./src/lib/hashlineHighlight.cjs"),pe=require("./src/components/HashlineLines.cjs"),me=require("./src/components/Kbd.cjs"),j=require("./src/components/McpToolWidget.cjs"),he=require("./src/components/Label.cjs"),ge=require("./src/components/ViewableImage.cjs"),_e=require("./src/lib/media.cjs"),M=require("./src/components/PdfPreview.cjs"),N=require("./src/components/MediaPreview.cjs"),P=require("./src/components/StatusBadge.cjs"),F=require("./src/components/MessageItem.cjs"),I=require("./src/components/MessageLines.cjs"),L=require("./src/components/Popover.cjs"),R=require("./src/components/Picker.cjs"),z=require("./src/lib/profilePicker.cjs"),B=require("./src/components/ProfilePicker.cjs"),V=require("./src/lib/runDuration.cjs"),ve=require("./src/components/LiveDuration.cjs"),ye=require("./src/components/Progress.cjs"),be=require("./src/lib/qrMatrix.cjs"),xe=require("./src/components/QrCode.cjs"),H=require("./src/components/RadioGroup.cjs"),Se=require("./src/components/ReferenceChip.cjs"),Ce=require("./src/components/Textarea.cjs"),we=require("./src/components/ReviewCommentDraft.cjs"),U=require("./src/components/ScrollArea.cjs"),Te=require("./src/components/SectionLabel.cjs"),W=require("./src/components/Select.cjs"),Ee=require("./src/components/Separator.cjs"),G=require("./src/components/Settings.cjs"),De=require("./src/components/SetupRow.cjs"),K=require("./src/components/Sheet.cjs"),Oe=require("./src/components/StreamCursor.cjs"),ke=require("./src/components/Switch.cjs"),Ae=require("./src/components/TerminalView.cjs"),q=require("./src/components/Toast.cjs"),je=require("./src/components/PathText.cjs"),Me=require("./src/components/ToolPathLink.cjs"),J=require("./src/lib/collapse.cjs"),Y=require("./src/lib/hashlineView.cjs"),X=require("./src/lib/pathGroups.cjs"),Z=require("./src/lib/tone.cjs"),Ne=require("./src/types/editor.cjs"),Q=require("./src/types/tone.cjs");let $=require("lucide-react");exports.ACCENT_TONES=Q.ACCENT_TONES,exports.Accordion=e.Accordion,exports.AccordionContent=e.AccordionContent,exports.AccordionItem=e.AccordionItem,exports.AccordionTrigger=e.AccordionTrigger,Object.defineProperty(exports,"ActivityIcon",{enumerable:!0,get:function(){return $.Activity}}),exports.AgentAvatar=a.AgentAvatar,Object.defineProperty(exports,"AlertIcon",{enumerable:!0,get:function(){return $.CircleAlert}}),exports.AnsiLine=n.AnsiLine,exports.AnsiText=n.AnsiText,Object.defineProperty(exports,"AppWindowIcon",{enumerable:!0,get:function(){return $.AppWindow}}),Object.defineProperty(exports,"ArrowLeftIcon",{enumerable:!0,get:function(){return $.ArrowLeft}}),Object.defineProperty(exports,"ArrowRightIcon",{enumerable:!0,get:function(){return $.ArrowRight}}),Object.defineProperty(exports,"ArrowUpRightIcon",{enumerable:!0,get:function(){return $.ArrowUpRight}}),Object.defineProperty(exports,"AudioLinesIcon",{enumerable:!0,get:function(){return $.AudioLines}}),exports.Avatar=r.Avatar,exports.AvatarFallback=r.AvatarFallback,exports.AvatarImage=r.AvatarImage,exports.BREADCRUMB_ELLIPSIS=c.BREADCRUMB_ELLIPSIS,Object.defineProperty(exports,"Back10Icon",{enumerable:!0,get:function(){return $.RotateCcw}}),exports.Badge=o.Badge,Object.defineProperty(exports,"BellIcon",{enumerable:!0,get:function(){return $.Bell}}),Object.defineProperty(exports,"BookmarkPlusIcon",{enumerable:!0,get:function(){return $.BookmarkPlus}}),Object.defineProperty(exports,"BoxIcon",{enumerable:!0,get:function(){return $.Square}}),Object.defineProperty(exports,"BranchIcon",{enumerable:!0,get:function(){return $.GitBranch}}),exports.Breadcrumb=c.Breadcrumb,exports.Button=l.Button,exports.CHIP_TONES=Q.CHIP_TONES,exports.CHIP_TO_STATUS=Z.CHIP_TO_STATUS,Object.defineProperty(exports,"CalendarIcon",{enumerable:!0,get:function(){return $.Calendar}}),Object.defineProperty(exports,"CheckIcon",{enumerable:!0,get:function(){return $.Check}}),exports.Checkbox=re.Checkbox,Object.defineProperty(exports,"ChevronDownIcon",{enumerable:!0,get:function(){return $.ChevronDown}}),Object.defineProperty(exports,"ChevronRightIcon",{enumerable:!0,get:function(){return $.ChevronRight}}),Object.defineProperty(exports,"ChevronUpIcon",{enumerable:!0,get:function(){return $.ChevronUp}}),Object.defineProperty(exports,"CloseIcon",{enumerable:!0,get:function(){return $.X}}),exports.CodeBlock=ae.CodeBlock,exports.CodeEditor=se.CodeEditor,exports.Collapsible=v.Collapsible,exports.CollapsibleContent=v.CollapsibleContent,exports.CollapsibleTrigger=v.CollapsibleTrigger,exports.CommandDialog=S.CommandDialog,exports.CommandEmpty=S.CommandEmpty,exports.CommandFooter=S.CommandFooter,exports.CommandGroup=S.CommandGroup,exports.CommandGroupLabel=S.CommandGroupLabel,exports.CommandHeader=S.CommandHeader,exports.CommandInput=S.CommandInput,exports.CommandItem=S.CommandItem,exports.CommandItemLabel=S.CommandItemLabel,exports.CommandList=S.CommandList,Object.defineProperty(exports,"ConnectorIcon",{enumerable:!0,get:function(){return $.Spline}}),Object.defineProperty(exports,"CopyIcon",{enumerable:!0,get:function(){return $.Copy}}),exports.CtaCard=w.CtaCard,exports.DEFAULT_FILE_BROWSER_FILTERS=D.DEFAULT_FILE_BROWSER_FILTERS,exports.DOT_TONES=Q.DOT_TONES,exports.Dialog=u.Dialog,exports.DialogBody=u.DialogBody,exports.DialogClose=u.DialogClose,exports.DialogContent=u.DialogContent,exports.DialogDescription=u.DialogDescription,exports.DialogFooter=u.DialogFooter,exports.DialogHeader=u.DialogHeader,exports.DialogTitle=u.DialogTitle,exports.DialogTrigger=u.DialogTrigger,exports.DiffView=f.DiffView,exports.Dot=i.Dot,Object.defineProperty(exports,"DownloadIcon",{enumerable:!0,get:function(){return $.Download}}),exports.Drawer=ne.Drawer,exports.DropdownMenu=p.DropdownMenu,exports.DropdownMenuCheckboxItem=p.DropdownMenuCheckboxItem,exports.DropdownMenuContent=p.DropdownMenuContent,exports.DropdownMenuGroup=p.DropdownMenuGroup,exports.DropdownMenuItem=p.DropdownMenuItem,exports.DropdownMenuLabel=p.DropdownMenuLabel,exports.DropdownMenuRadioGroup=p.DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=p.DropdownMenuRadioItem,exports.DropdownMenuSeparator=p.DropdownMenuSeparator,exports.DropdownMenuShortcut=p.DropdownMenuShortcut,exports.DropdownMenuSub=p.DropdownMenuSub,exports.DropdownMenuSubContent=p.DropdownMenuSubContent,exports.DropdownMenuSubTrigger=p.DropdownMenuSubTrigger,exports.DropdownMenuTrigger=p.DropdownMenuTrigger,Object.defineProperty(exports,"EditIcon",{enumerable:!0,get:function(){return $.Pencil}}),exports.EmptyState=ce.EmptyState,Object.defineProperty(exports,"EnterIcon",{enumerable:!0,get:function(){return $.CornerDownLeft}}),Object.defineProperty(exports,"EraserIcon",{enumerable:!0,get:function(){return $.Eraser}}),Object.defineProperty(exports,"ExternalLinkIcon",{enumerable:!0,get:function(){return $.ExternalLink}}),exports.FileAge=D.FileAge,exports.FileBrowser=D.FileBrowser,Object.defineProperty(exports,"FileIcon",{enumerable:!0,get:function(){return $.FileText}}),exports.FilePreview=de.FilePreview,Object.defineProperty(exports,"FitIcon",{enumerable:!0,get:function(){return $.Scan}}),exports.FlowGraph=fe.FlowGraph,Object.defineProperty(exports,"FolderIcon",{enumerable:!0,get:function(){return $.Folder}}),Object.defineProperty(exports,"ForkIcon",{enumerable:!0,get:function(){return $.GitFork}}),Object.defineProperty(exports,"Forward10Icon",{enumerable:!0,get:function(){return $.RotateCw}}),exports.GREP_COLLAPSED_LINES=Y.GREP_COLLAPSED_LINES,Object.defineProperty(exports,"GearIcon",{enumerable:!0,get:function(){return $.Settings}}),Object.defineProperty(exports,"GlobeIcon",{enumerable:!0,get:function(){return $.Globe}}),Object.defineProperty(exports,"GridIcon",{enumerable:!0,get:function(){return $.LayoutGrid}}),Object.defineProperty(exports,"HandIcon",{enumerable:!0,get:function(){return $.Hand}}),exports.HashlineLines=pe.HashlineLines,Object.defineProperty(exports,"HelpIcon",{enumerable:!0,get:function(){return $.CircleHelp}}),Object.defineProperty(exports,"HighlighterIcon",{enumerable:!0,get:function(){return $.Highlighter}}),Object.defineProperty(exports,"HomeIcon",{enumerable:!0,get:function(){return $.House}}),Object.defineProperty(exports,"IdCardIcon",{enumerable:!0,get:function(){return $.IdCard}}),Object.defineProperty(exports,"ImageIcon",{enumerable:!0,get:function(){return $.Image}}),exports.Input=y.Input,exports.Kbd=me.Kbd,Object.defineProperty(exports,"KebabIcon",{enumerable:!0,get:function(){return $.MoreVertical}}),exports.LINE_TONE_TO_STATUS=Z.LINE_TONE_TO_STATUS,exports.Label=he.Label,Object.defineProperty(exports,"LanguagesIcon",{enumerable:!0,get:function(){return $.Languages}}),Object.defineProperty(exports,"LightbulbIcon",{enumerable:!0,get:function(){return $.Lightbulb}}),Object.defineProperty(exports,"ListIcon",{enumerable:!0,get:function(){return $.List}}),exports.LiveDuration=ve.LiveDuration,Object.defineProperty(exports,"LoaderIcon",{enumerable:!0,get:function(){return $.Loader2}}),exports.LoadingState=le.LoadingState,Object.defineProperty(exports,"LockIcon",{enumerable:!0,get:function(){return $.Lock}}),exports.MAX_DIGIT_SHORTCUT=b.MAX_DIGIT_SHORTCUT,exports.MEDIA_KINDS=Ne.MEDIA_KINDS,exports.MESSAGE_LINE_TONES=Q.MESSAGE_LINE_TONES,exports.Markdown=ue.Markdown,exports.McpToolFields=j.McpToolFields,exports.McpToolFrame=j.McpToolFrame,exports.McpToolOutput=j.McpToolOutput,exports.MediaPreview=N.MediaPreview,exports.MediaViewerDialog=O.MediaViewerDialog,Object.defineProperty(exports,"MenuIcon",{enumerable:!0,get:function(){return $.Menu}}),Object.defineProperty(exports,"MessageIcon",{enumerable:!0,get:function(){return $.MessageCircle}}),exports.MessageItem=F.MessageItem,exports.MessageItemBody=F.MessageItemBody,exports.MessageItemGroup=F.MessageItemGroup,exports.MessageItemHeader=F.MessageItemHeader,exports.MessageItemHeaderAccessoryContext=F.MessageItemHeaderAccessoryContext,exports.MessageItemStatus=F.MessageItemStatus,exports.MessageLines=I.MessageLines,Object.defineProperty(exports,"MicIcon",{enumerable:!0,get:function(){return $.Mic}}),Object.defineProperty(exports,"MinusIcon",{enumerable:!0,get:function(){return $.Minus}}),Object.defineProperty(exports,"MonitorIcon",{enumerable:!0,get:function(){return $.Monitor}}),exports.NavTab=E.NavTab,exports.NavTabBadge=E.NavTabBadge,Object.defineProperty(exports,"NoteIcon",{enumerable:!0,get:function(){return $.StickyNote}}),exports.OptionLabel=x.OptionLabel,exports.OptionList=x.OptionList,exports.OptionRow=x.OptionRow,Object.defineProperty(exports,"PaletteIcon",{enumerable:!0,get:function(){return $.Palette}}),exports.PanZoom=O.PanZoom,exports.Panel=C.Panel,exports.PanelBody=C.PanelBody,exports.PanelHeader=C.PanelHeader,Object.defineProperty(exports,"PaperclipIcon",{enumerable:!0,get:function(){return $.Paperclip}}),exports.PathText=je.PathText,Object.defineProperty(exports,"PauseIcon",{enumerable:!0,get:function(){return $.Pause}}),exports.PdfPreview=M.PdfPreview,exports.PickerContent=R.PickerContent,exports.PickerList=R.PickerList,Object.defineProperty(exports,"PinIcon",{enumerable:!0,get:function(){return $.MapPin}}),Object.defineProperty(exports,"PlayCircleIcon",{enumerable:!0,get:function(){return $.CirclePlay}}),Object.defineProperty(exports,"PlayIcon",{enumerable:!0,get:function(){return $.Play}}),Object.defineProperty(exports,"PlusIcon",{enumerable:!0,get:function(){return $.Plus}}),Object.defineProperty(exports,"PointerIcon",{enumerable:!0,get:function(){return $.MousePointer2}}),exports.Popover=L.Popover,exports.PopoverAnchor=L.PopoverAnchor,exports.PopoverClose=L.PopoverClose,exports.PopoverContent=L.PopoverContent,exports.PopoverFooter=L.PopoverFooter,exports.PopoverHeader=L.PopoverHeader,exports.PopoverTrigger=L.PopoverTrigger,exports.ProfilePicker=B.ProfilePicker,exports.Progress=ye.Progress,Object.defineProperty(exports,"PuzzleIcon",{enumerable:!0,get:function(){return $.Puzzle}}),exports.QrCode=xe.QrCode,Object.defineProperty(exports,"QuoteIcon",{enumerable:!0,get:function(){return $.Quote}}),exports.READ_COLLAPSED_LINES=Y.READ_COLLAPSED_LINES,exports.RadioGroup=H.RadioGroup,exports.RadioGroupCard=H.RadioGroupCard,exports.RadioGroupItem=H.RadioGroupItem,Object.defineProperty(exports,"RedoIcon",{enumerable:!0,get:function(){return $.Redo2}}),exports.ReferenceChip=Se.ReferenceChip,Object.defineProperty(exports,"RefreshIcon",{enumerable:!0,get:function(){return $.RefreshCw}}),exports.ReviewCommentDraft=we.ReviewCommentDraft,Object.defineProperty(exports,"RewindIcon",{enumerable:!0,get:function(){return $.Rewind}}),exports.STATUS_EDGE=P.STATUS_EDGE,exports.STATUS_GLYPH=F.STATUS_GLYPH,exports.STATUS_LABEL=F.STATUS_LABEL,exports.STATUS_TONES=Q.STATUS_TONES,exports.STATUS_TO_CHIP=Z.STATUS_TO_CHIP,exports.STATUS_TO_DOT=Z.STATUS_TO_DOT,exports.ScrollArea=U.ScrollArea,exports.ScrollBar=U.ScrollBar,Object.defineProperty(exports,"SearchIcon",{enumerable:!0,get:function(){return $.Search}}),exports.SectionLabel=Te.SectionLabel,exports.Select=W.Select,exports.SelectContent=W.SelectContent,exports.SelectGroup=W.SelectGroup,exports.SelectItem=W.SelectItem,exports.SelectLabel=W.SelectLabel,exports.SelectSeparator=W.SelectSeparator,exports.SelectTrigger=W.SelectTrigger,exports.SelectValue=W.SelectValue,Object.defineProperty(exports,"SendIcon",{enumerable:!0,get:function(){return $.Send}}),exports.Separator=Ee.Separator,Object.defineProperty(exports,"ServerIcon",{enumerable:!0,get:function(){return $.Server}}),exports.SettingsActions=G.SettingsActions,exports.SettingsCard=G.SettingsCard,exports.SettingsDescription=G.SettingsDescription,exports.SettingsField=G.SettingsField,exports.SettingsHeader=G.SettingsHeader,exports.SettingsNote=G.SettingsNote,exports.SettingsPage=G.SettingsPage,exports.SettingsRow=G.SettingsRow,exports.SettingsRowDescription=G.SettingsRowDescription,exports.SettingsRowText=G.SettingsRowText,exports.SettingsRowTitle=G.SettingsRowTitle,exports.SettingsSection=G.SettingsSection,exports.SettingsSectionDescription=G.SettingsSectionDescription,exports.SettingsSectionHeader=G.SettingsSectionHeader,exports.SettingsSectionTitle=G.SettingsSectionTitle,exports.SettingsTitle=G.SettingsTitle,exports.SetupRow=De.SetupRow,exports.Sheet=K.Sheet,exports.SheetBody=K.SheetBody,exports.SheetClose=K.SheetClose,exports.SheetContent=K.SheetContent,exports.SheetDescription=K.SheetDescription,exports.SheetFooter=K.SheetFooter,exports.SheetHeader=K.SheetHeader,exports.SheetOverlay=K.SheetOverlay,exports.SheetTitle=K.SheetTitle,exports.SheetTrigger=K.SheetTrigger,Object.defineProperty(exports,"ShieldIcon",{enumerable:!0,get:function(){return $.ShieldCheck}}),Object.defineProperty(exports,"ShrinkIcon",{enumerable:!0,get:function(){return $.Shrink}}),Object.defineProperty(exports,"SidebarIcon",{enumerable:!0,get:function(){return $.PanelLeft}}),exports.Skeleton=oe.Skeleton,Object.defineProperty(exports,"SlidersIcon",{enumerable:!0,get:function(){return $.SlidersHorizontal}}),Object.defineProperty(exports,"SmartphoneIcon",{enumerable:!0,get:function(){return $.Smartphone}}),Object.defineProperty(exports,"SparklesIcon",{enumerable:!0,get:function(){return $.Sparkles}}),exports.Spinner=te.Spinner,exports.StatusBadge=P.StatusBadge,Object.defineProperty(exports,"StepBackIcon",{enumerable:!0,get:function(){return $.StepBack}}),Object.defineProperty(exports,"StepForwardIcon",{enumerable:!0,get:function(){return $.StepForward}}),Object.defineProperty(exports,"StopIcon",{enumerable:!0,get:function(){return $.Square}}),exports.StreamCursor=Oe.StreamCursor,exports.Switch=ke.Switch,exports.SyntaxLine=_.SyntaxLine,exports.SyntaxText=_.SyntaxText,exports.Tabs=E.Tabs,exports.TabsContent=E.TabsContent,exports.TabsList=E.TabsList,exports.TabsTrigger=E.TabsTrigger,Object.defineProperty(exports,"TargetIcon",{enumerable:!0,get:function(){return $.Target}}),Object.defineProperty(exports,"TaskIcon",{enumerable:!0,get:function(){return $.SquareCheckBig}}),Object.defineProperty(exports,"TerminalIcon",{enumerable:!0,get:function(){return $.SquareTerminal}}),exports.TerminalView=Ae.TerminalView,exports.Textarea=Ce.Textarea,exports.Toast=q.Toast,exports.ToastAction=q.ToastAction,exports.ToastClose=q.ToastClose,exports.ToastDescription=q.ToastDescription,exports.ToastProvider=q.ToastProvider,exports.ToastTitle=q.ToastTitle,exports.ToastViewport=q.ToastViewport,exports.ToolPathLink=Me.ToolPathLink,exports.Tooltip=s.Tooltip,exports.TooltipContent=s.TooltipContent,exports.TooltipProvider=s.TooltipProvider,exports.TooltipTrigger=s.TooltipTrigger,Object.defineProperty(exports,"TrashIcon",{enumerable:!0,get:function(){return $.Trash2}}),Object.defineProperty(exports,"UndoIcon",{enumerable:!0,get:function(){return $.Undo2}}),Object.defineProperty(exports,"UnlockIcon",{enumerable:!0,get:function(){return $.LockOpen}}),Object.defineProperty(exports,"UserIcon",{enumerable:!0,get:function(){return $.UserRound}}),Object.defineProperty(exports,"UsersIcon",{enumerable:!0,get:function(){return $.Users}}),exports.ViewableImage=ge.ViewableImage,Object.defineProperty(exports,"VolumeIcon",{enumerable:!0,get:function(){return $.Volume2}}),Object.defineProperty(exports,"WorkflowIcon",{enumerable:!0,get:function(){return $.Workflow}}),Object.defineProperty(exports,"WrenchIcon",{enumerable:!0,get:function(){return $.Wrench}}),exports.ageLabel=T.ageLabel,exports.agentInitials=a.agentInitials,exports.ansiSpans=t.ansiSpans,exports.badgeVariants=o.badgeVariants,exports.boundedFileSource=k.boundedFileSource,exports.breadcrumbSegments=c.breadcrumbSegments,exports.buildReviewPrompt=d.buildReviewPrompt,exports.buttonVariants=l.buttonVariants,exports.clockRefreshMs=V.clockRefreshMs,exports.clockText=V.clockText,exports.cn=ee.cn,exports.collapseLines=J.collapseLines,exports.compactDetails=Y.compactDetails,exports.defaultReviewHeading=d.defaultReviewHeading,exports.detectGrammar=g.detectGrammar,exports.dialogFooterVariants=u.dialogFooterVariants,exports.diffGutterWidth=d.diffGutterWidth,exports.diffRangeOf=d.diffRangeOf,exports.dotVariants=i.dotVariants,exports.drawableImageUrl=h.drawableImageUrl,exports.dropdownMenuItemVariants=p.dropdownMenuItemVariants,exports.fieldVariants=y.fieldVariants,exports.fileAssetPath=T.fileAssetPath,exports.fileKind=T.fileKind,exports.filePreviewMode=T.filePreviewMode,exports.fileTree=T.fileTree,exports.filterFiles=T.filterFiles,exports.formatRunDuration=V.formatRunDuration,exports.grammarKeyOf=ie.grammarKeyOf,exports.groupByDirectory=X.groupByDirectory,exports.groupRowLabel=X.groupRowLabel,exports.handleOptionListKey=b.handleOptionListKey,exports.hashlineBody=Y.hashlineBody,exports.hashlineGroups=A.hashlineGroups,exports.hashlineGroupsKey=A.hashlineGroupsKey,exports.highlightToLines=g.highlightToLines,exports.inlineProfileIcon=z.inlineProfileIcon,exports.isFileLayout=T.isFileLayout,exports.markdownMediaReview=h.markdownMediaReview,exports.markdownMediaReviewSlot=m.markdownMediaReviewSlot,exports.mediaKindOf=_e.mediaKindOf,exports.messageItemRowVariants=F.messageItemRowVariants,exports.messageItemStatusVariants=F.messageItemStatusVariants,exports.messageItemVariants=F.messageItemVariants,exports.messageLineVariants=I.messageLineVariants,exports.modifiedLabel=T.modifiedLabel,exports.newestFiles=T.newestFiles,exports.optionListHint=b.optionListHint,exports.optionListVariants=x.optionListVariants,exports.optionMarker=b.optionMarker,exports.optionMarkerVariants=x.optionMarkerVariants,exports.optionRowVariants=x.optionRowVariants,exports.parseFileHeader=Y.parseFileHeader,exports.parseProfileCatalog=z.parseProfileCatalog,exports.parseTaggedLine=Y.parseTaggedLine,exports.presentHashlineLines=Y.presentHashlineLines,exports.qrMatrix=be.qrMatrix,exports.rangedFileBlob=k.rangedFileBlob,exports.readMediaBytes=k.readMediaBytes,exports.resolvePdfViewportRegion=M.resolvePdfViewportRegion,exports.resultTextLines=Y.resultTextLines,exports.reviewCommentAnchor=d.reviewCommentAnchor,exports.sizeLabel=T.sizeLabel,exports.sortFiles=T.sortFiles,exports.statusBadgeVariants=P.statusBadgeVariants,exports.svgImageUrl=h.svgImageUrl,exports.syntaxStyleOf=g.syntaxStyleOf,exports.tabBadgeVariants=E.tabBadgeVariants,exports.tabVariants=E.tabVariants,exports.takeTrailingNotice=Y.takeTrailingNotice,exports.toastVariants=q.toastVariants,exports.toolTone=F.toolTone,exports.trimSnippet=d.trimSnippet,exports.useMessageItem=F.useMessageItem,exports.useProfileCatalog=B.useProfileCatalog,exports.useSyntaxLines=_.useSyntaxLines;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("./src/icons/icons.cjs");const ee=require("./src/lib/cn.cjs"),e=require("./src/components/Accordion.cjs"),t=require("./src/lib/ansiSpans.cjs"),n=require("./src/components/AnsiText.cjs"),r=require("./src/components/Avatar.cjs"),i=require("./src/components/Dot.cjs"),a=require("./src/components/AgentAvatar.cjs"),o=require("./src/components/Badge.cjs"),s=require("./src/components/Tooltip.cjs"),c=require("./src/components/Breadcrumb.cjs"),te=require("./src/components/Spinner.cjs"),l=require("./src/components/Button.cjs"),u=require("./src/components/Dialog.cjs"),d=require("./src/lib/review.cjs"),f=require("./src/components/DiffView.cjs"),ne=require("./src/components/Drawer.cjs"),p=require("./src/components/DropdownMenu.cjs"),re=require("./src/components/Checkbox.cjs"),ie=require("./src/lib/editorLanguage.cjs"),m=require("./src/lib/markdownMediaSlot.cjs"),h=require("./src/lib/markdownMedia.cjs"),g=require("./src/lib/syntaxHighlight.cjs"),_=require("./src/components/SyntaxText.cjs"),ae=require("./src/components/CodeBlock.cjs"),oe=require("./src/components/Skeleton.cjs"),se=require("./src/components/CodeEditor.cjs"),v=require("./src/components/Collapsible.cjs"),y=require("./src/components/Input.cjs"),b=require("./src/lib/optionList.cjs"),x=require("./src/components/OptionList.cjs"),S=require("./src/components/Command.cjs"),C=require("./src/components/Panel.cjs"),w=require("./src/components/CtaCard.cjs"),ce=require("./src/components/EmptyState.cjs"),le=require("./src/components/LoadingState.cjs"),T=require("./src/lib/files.cjs"),E=require("./src/components/Tabs.cjs"),D=require("./src/components/FileBrowser.cjs"),O=require("./src/components/MediaViewerDialog.cjs"),ue=require("./src/components/Markdown.cjs"),de=require("./src/components/FilePreview.cjs"),k=require("./src/lib/fileDownload.cjs"),fe=require("./src/components/FlowGraph.cjs"),A=require("./src/lib/hashlineHighlight.cjs"),pe=require("./src/components/HashlineLines.cjs"),me=require("./src/components/Kbd.cjs"),j=require("./src/components/McpToolWidget.cjs"),he=require("./src/components/Label.cjs"),ge=require("./src/components/ViewableImage.cjs"),_e=require("./src/lib/media.cjs"),M=require("./src/components/PdfPreview.cjs"),N=require("./src/components/MediaPreview.cjs"),P=require("./src/components/StatusBadge.cjs"),F=require("./src/components/MessageItem.cjs"),I=require("./src/components/MessageLines.cjs"),L=require("./src/components/Popover.cjs"),R=require("./src/components/Picker.cjs"),z=require("./src/lib/profilePicker.cjs"),B=require("./src/components/ProfilePicker.cjs"),V=require("./src/lib/runDuration.cjs"),ve=require("./src/components/LiveDuration.cjs"),ye=require("./src/components/Progress.cjs"),be=require("./src/lib/qrMatrix.cjs"),xe=require("./src/components/QrCode.cjs"),H=require("./src/components/RadioGroup.cjs"),Se=require("./src/components/ReferenceChip.cjs"),Ce=require("./src/components/Textarea.cjs"),we=require("./src/components/ReviewCommentDraft.cjs"),U=require("./src/components/ScrollArea.cjs"),Te=require("./src/components/SectionLabel.cjs"),W=require("./src/components/Select.cjs"),Ee=require("./src/components/Separator.cjs"),G=require("./src/components/Settings.cjs"),De=require("./src/components/SetupRow.cjs"),K=require("./src/components/Sheet.cjs"),Oe=require("./src/components/StreamCursor.cjs"),ke=require("./src/components/Switch.cjs"),Ae=require("./src/components/TerminalView.cjs"),q=require("./src/components/Toast.cjs"),je=require("./src/components/PathText.cjs"),Me=require("./src/components/ToolPathLink.cjs"),J=require("./src/lib/collapse.cjs"),Y=require("./src/lib/hashlineView.cjs"),X=require("./src/lib/pathGroups.cjs"),Z=require("./src/lib/tone.cjs"),Ne=require("./src/types/editor.cjs"),Q=require("./src/types/tone.cjs");let $=require("lucide-react");exports.ACCENT_TONES=Q.ACCENT_TONES,exports.Accordion=e.Accordion,exports.AccordionContent=e.AccordionContent,exports.AccordionItem=e.AccordionItem,exports.AccordionTrigger=e.AccordionTrigger,Object.defineProperty(exports,"ActivityIcon",{enumerable:!0,get:function(){return $.Activity}}),exports.AgentAvatar=a.AgentAvatar,Object.defineProperty(exports,"AlertIcon",{enumerable:!0,get:function(){return $.CircleAlert}}),exports.AnsiLine=n.AnsiLine,exports.AnsiText=n.AnsiText,Object.defineProperty(exports,"AppWindowIcon",{enumerable:!0,get:function(){return $.AppWindow}}),Object.defineProperty(exports,"ArrowLeftIcon",{enumerable:!0,get:function(){return $.ArrowLeft}}),Object.defineProperty(exports,"ArrowRightIcon",{enumerable:!0,get:function(){return $.ArrowRight}}),Object.defineProperty(exports,"ArrowUpRightIcon",{enumerable:!0,get:function(){return $.ArrowUpRight}}),Object.defineProperty(exports,"AudioLinesIcon",{enumerable:!0,get:function(){return $.AudioLines}}),exports.Avatar=r.Avatar,exports.AvatarFallback=r.AvatarFallback,exports.AvatarImage=r.AvatarImage,exports.BREADCRUMB_ELLIPSIS=c.BREADCRUMB_ELLIPSIS,Object.defineProperty(exports,"Back10Icon",{enumerable:!0,get:function(){return $.RotateCcw}}),exports.Badge=o.Badge,Object.defineProperty(exports,"BellIcon",{enumerable:!0,get:function(){return $.Bell}}),Object.defineProperty(exports,"BookmarkPlusIcon",{enumerable:!0,get:function(){return $.BookmarkPlus}}),Object.defineProperty(exports,"BoxIcon",{enumerable:!0,get:function(){return $.Square}}),Object.defineProperty(exports,"BranchIcon",{enumerable:!0,get:function(){return $.GitBranch}}),exports.Breadcrumb=c.Breadcrumb,exports.Button=l.Button,exports.CHIP_TONES=Q.CHIP_TONES,exports.CHIP_TO_STATUS=Z.CHIP_TO_STATUS,Object.defineProperty(exports,"CalendarIcon",{enumerable:!0,get:function(){return $.Calendar}}),Object.defineProperty(exports,"CheckIcon",{enumerable:!0,get:function(){return $.Check}}),exports.Checkbox=re.Checkbox,Object.defineProperty(exports,"ChevronDownIcon",{enumerable:!0,get:function(){return $.ChevronDown}}),Object.defineProperty(exports,"ChevronRightIcon",{enumerable:!0,get:function(){return $.ChevronRight}}),Object.defineProperty(exports,"ChevronUpIcon",{enumerable:!0,get:function(){return $.ChevronUp}}),Object.defineProperty(exports,"CloseIcon",{enumerable:!0,get:function(){return $.X}}),exports.CodeBlock=ae.CodeBlock,exports.CodeEditor=se.CodeEditor,exports.Collapsible=v.Collapsible,exports.CollapsibleContent=v.CollapsibleContent,exports.CollapsibleTrigger=v.CollapsibleTrigger,exports.CommandDialog=S.CommandDialog,exports.CommandEmpty=S.CommandEmpty,exports.CommandFooter=S.CommandFooter,exports.CommandGroup=S.CommandGroup,exports.CommandGroupLabel=S.CommandGroupLabel,exports.CommandHeader=S.CommandHeader,exports.CommandInput=S.CommandInput,exports.CommandItem=S.CommandItem,exports.CommandItemLabel=S.CommandItemLabel,exports.CommandList=S.CommandList,Object.defineProperty(exports,"ConnectorIcon",{enumerable:!0,get:function(){return $.Spline}}),Object.defineProperty(exports,"CopyIcon",{enumerable:!0,get:function(){return $.Copy}}),exports.CtaCard=w.CtaCard,exports.DEFAULT_FILE_BROWSER_FILTERS=D.DEFAULT_FILE_BROWSER_FILTERS,exports.DOT_TONES=Q.DOT_TONES,exports.Dialog=u.Dialog,exports.DialogBody=u.DialogBody,exports.DialogClose=u.DialogClose,exports.DialogContent=u.DialogContent,exports.DialogDescription=u.DialogDescription,exports.DialogFooter=u.DialogFooter,exports.DialogHeader=u.DialogHeader,exports.DialogTitle=u.DialogTitle,exports.DialogTrigger=u.DialogTrigger,exports.DiffView=f.DiffView,exports.Dot=i.Dot,Object.defineProperty(exports,"DownloadIcon",{enumerable:!0,get:function(){return $.Download}}),exports.Drawer=ne.Drawer,exports.DropdownMenu=p.DropdownMenu,exports.DropdownMenuCheckboxItem=p.DropdownMenuCheckboxItem,exports.DropdownMenuContent=p.DropdownMenuContent,exports.DropdownMenuGroup=p.DropdownMenuGroup,exports.DropdownMenuItem=p.DropdownMenuItem,exports.DropdownMenuLabel=p.DropdownMenuLabel,exports.DropdownMenuRadioGroup=p.DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=p.DropdownMenuRadioItem,exports.DropdownMenuSeparator=p.DropdownMenuSeparator,exports.DropdownMenuShortcut=p.DropdownMenuShortcut,exports.DropdownMenuSub=p.DropdownMenuSub,exports.DropdownMenuSubContent=p.DropdownMenuSubContent,exports.DropdownMenuSubTrigger=p.DropdownMenuSubTrigger,exports.DropdownMenuTrigger=p.DropdownMenuTrigger,Object.defineProperty(exports,"EditIcon",{enumerable:!0,get:function(){return $.Pencil}}),exports.EmptyState=ce.EmptyState,Object.defineProperty(exports,"EnterIcon",{enumerable:!0,get:function(){return $.CornerDownLeft}}),Object.defineProperty(exports,"EraserIcon",{enumerable:!0,get:function(){return $.Eraser}}),Object.defineProperty(exports,"ExternalLinkIcon",{enumerable:!0,get:function(){return $.ExternalLink}}),exports.FileAge=D.FileAge,exports.FileBrowser=D.FileBrowser,Object.defineProperty(exports,"FileIcon",{enumerable:!0,get:function(){return $.FileText}}),exports.FilePreview=de.FilePreview,Object.defineProperty(exports,"FitIcon",{enumerable:!0,get:function(){return $.Scan}}),exports.FlowGraph=fe.FlowGraph,Object.defineProperty(exports,"FolderIcon",{enumerable:!0,get:function(){return $.Folder}}),Object.defineProperty(exports,"ForkIcon",{enumerable:!0,get:function(){return $.GitFork}}),Object.defineProperty(exports,"Forward10Icon",{enumerable:!0,get:function(){return $.RotateCw}}),exports.GREP_COLLAPSED_LINES=Y.GREP_COLLAPSED_LINES,Object.defineProperty(exports,"GearIcon",{enumerable:!0,get:function(){return $.Settings}}),Object.defineProperty(exports,"GlobeIcon",{enumerable:!0,get:function(){return $.Globe}}),Object.defineProperty(exports,"GridIcon",{enumerable:!0,get:function(){return $.LayoutGrid}}),Object.defineProperty(exports,"HandIcon",{enumerable:!0,get:function(){return $.Hand}}),exports.HashlineLines=pe.HashlineLines,Object.defineProperty(exports,"HelpIcon",{enumerable:!0,get:function(){return $.CircleHelp}}),Object.defineProperty(exports,"HighlighterIcon",{enumerable:!0,get:function(){return $.Highlighter}}),Object.defineProperty(exports,"HomeIcon",{enumerable:!0,get:function(){return $.House}}),Object.defineProperty(exports,"IdCardIcon",{enumerable:!0,get:function(){return $.IdCard}}),Object.defineProperty(exports,"ImageIcon",{enumerable:!0,get:function(){return $.Image}}),exports.Input=y.Input,exports.Kbd=me.Kbd,Object.defineProperty(exports,"KebabIcon",{enumerable:!0,get:function(){return $.MoreVertical}}),exports.LINE_TONE_TO_STATUS=Z.LINE_TONE_TO_STATUS,exports.Label=he.Label,Object.defineProperty(exports,"LanguagesIcon",{enumerable:!0,get:function(){return $.Languages}}),Object.defineProperty(exports,"LightbulbIcon",{enumerable:!0,get:function(){return $.Lightbulb}}),Object.defineProperty(exports,"ListIcon",{enumerable:!0,get:function(){return $.List}}),exports.LiveDuration=ve.LiveDuration,Object.defineProperty(exports,"LoaderIcon",{enumerable:!0,get:function(){return $.Loader2}}),exports.LoadingState=le.LoadingState,Object.defineProperty(exports,"LockIcon",{enumerable:!0,get:function(){return $.Lock}}),exports.MAX_DIGIT_SHORTCUT=b.MAX_DIGIT_SHORTCUT,exports.MEDIA_KINDS=Ne.MEDIA_KINDS,exports.MESSAGE_LINE_TONES=Q.MESSAGE_LINE_TONES,exports.Markdown=ue.Markdown,exports.McpToolFields=j.McpToolFields,exports.McpToolFrame=j.McpToolFrame,exports.McpToolOutput=j.McpToolOutput,exports.MediaPreview=N.MediaPreview,exports.MediaViewerDialog=O.MediaViewerDialog,Object.defineProperty(exports,"MenuIcon",{enumerable:!0,get:function(){return $.Menu}}),Object.defineProperty(exports,"MessageIcon",{enumerable:!0,get:function(){return $.MessageCircle}}),exports.MessageItem=F.MessageItem,exports.MessageItemBody=F.MessageItemBody,exports.MessageItemGroup=F.MessageItemGroup,exports.MessageItemHeader=F.MessageItemHeader,exports.MessageItemHeaderAccessoryContext=F.MessageItemHeaderAccessoryContext,exports.MessageItemStatus=F.MessageItemStatus,exports.MessageLines=I.MessageLines,Object.defineProperty(exports,"MicIcon",{enumerable:!0,get:function(){return $.Mic}}),Object.defineProperty(exports,"MinusIcon",{enumerable:!0,get:function(){return $.Minus}}),Object.defineProperty(exports,"MonitorIcon",{enumerable:!0,get:function(){return $.Monitor}}),exports.NavTab=E.NavTab,exports.NavTabBadge=E.NavTabBadge,Object.defineProperty(exports,"NoteIcon",{enumerable:!0,get:function(){return $.StickyNote}}),exports.OptionLabel=x.OptionLabel,exports.OptionList=x.OptionList,exports.OptionRow=x.OptionRow,Object.defineProperty(exports,"PaletteIcon",{enumerable:!0,get:function(){return $.Palette}}),exports.PanZoom=O.PanZoom,exports.Panel=C.Panel,exports.PanelBody=C.PanelBody,exports.PanelHeader=C.PanelHeader,Object.defineProperty(exports,"PaperclipIcon",{enumerable:!0,get:function(){return $.Paperclip}}),exports.PathText=je.PathText,Object.defineProperty(exports,"PauseIcon",{enumerable:!0,get:function(){return $.Pause}}),exports.PdfPreview=M.PdfPreview,exports.PickerContent=R.PickerContent,exports.PickerList=R.PickerList,Object.defineProperty(exports,"PinIcon",{enumerable:!0,get:function(){return $.MapPin}}),Object.defineProperty(exports,"PlayCircleIcon",{enumerable:!0,get:function(){return $.CirclePlay}}),Object.defineProperty(exports,"PlayIcon",{enumerable:!0,get:function(){return $.Play}}),Object.defineProperty(exports,"PlusIcon",{enumerable:!0,get:function(){return $.Plus}}),Object.defineProperty(exports,"PointerIcon",{enumerable:!0,get:function(){return $.MousePointer2}}),exports.Popover=L.Popover,exports.PopoverAnchor=L.PopoverAnchor,exports.PopoverClose=L.PopoverClose,exports.PopoverContent=L.PopoverContent,exports.PopoverFooter=L.PopoverFooter,exports.PopoverHeader=L.PopoverHeader,exports.PopoverTrigger=L.PopoverTrigger,exports.ProfilePicker=B.ProfilePicker,exports.Progress=ye.Progress,Object.defineProperty(exports,"PuzzleIcon",{enumerable:!0,get:function(){return $.Puzzle}}),exports.QrCode=xe.QrCode,Object.defineProperty(exports,"QuoteIcon",{enumerable:!0,get:function(){return $.Quote}}),exports.READ_COLLAPSED_LINES=Y.READ_COLLAPSED_LINES,exports.RadioGroup=H.RadioGroup,exports.RadioGroupCard=H.RadioGroupCard,exports.RadioGroupItem=H.RadioGroupItem,Object.defineProperty(exports,"RedoIcon",{enumerable:!0,get:function(){return $.Redo2}}),exports.ReferenceChip=Se.ReferenceChip,Object.defineProperty(exports,"RefreshIcon",{enumerable:!0,get:function(){return $.RefreshCw}}),exports.ReviewCommentDraft=we.ReviewCommentDraft,Object.defineProperty(exports,"RewindIcon",{enumerable:!0,get:function(){return $.Rewind}}),exports.STATUS_EDGE=P.STATUS_EDGE,exports.STATUS_GLYPH=F.STATUS_GLYPH,exports.STATUS_LABEL=F.STATUS_LABEL,exports.STATUS_TONES=Q.STATUS_TONES,exports.STATUS_TO_CHIP=Z.STATUS_TO_CHIP,exports.STATUS_TO_DOT=Z.STATUS_TO_DOT,exports.ScrollArea=U.ScrollArea,exports.ScrollBar=U.ScrollBar,Object.defineProperty(exports,"SearchIcon",{enumerable:!0,get:function(){return $.Search}}),exports.SectionLabel=Te.SectionLabel,exports.Select=W.Select,exports.SelectContent=W.SelectContent,exports.SelectGroup=W.SelectGroup,exports.SelectItem=W.SelectItem,exports.SelectLabel=W.SelectLabel,exports.SelectSeparator=W.SelectSeparator,exports.SelectTrigger=W.SelectTrigger,exports.SelectValue=W.SelectValue,Object.defineProperty(exports,"SendIcon",{enumerable:!0,get:function(){return $.Send}}),exports.Separator=Ee.Separator,Object.defineProperty(exports,"ServerIcon",{enumerable:!0,get:function(){return $.Server}}),exports.SettingsActions=G.SettingsActions,exports.SettingsCard=G.SettingsCard,exports.SettingsDescription=G.SettingsDescription,exports.SettingsField=G.SettingsField,exports.SettingsHeader=G.SettingsHeader,exports.SettingsNote=G.SettingsNote,exports.SettingsPage=G.SettingsPage,exports.SettingsRow=G.SettingsRow,exports.SettingsRowDescription=G.SettingsRowDescription,exports.SettingsRowText=G.SettingsRowText,exports.SettingsRowTitle=G.SettingsRowTitle,exports.SettingsSection=G.SettingsSection,exports.SettingsSectionDescription=G.SettingsSectionDescription,exports.SettingsSectionHeader=G.SettingsSectionHeader,exports.SettingsSectionTitle=G.SettingsSectionTitle,exports.SettingsTitle=G.SettingsTitle,exports.SetupRow=De.SetupRow,exports.Sheet=K.Sheet,exports.SheetBody=K.SheetBody,exports.SheetClose=K.SheetClose,exports.SheetContent=K.SheetContent,exports.SheetDescription=K.SheetDescription,exports.SheetFooter=K.SheetFooter,exports.SheetHeader=K.SheetHeader,exports.SheetOverlay=K.SheetOverlay,exports.SheetTitle=K.SheetTitle,exports.SheetTrigger=K.SheetTrigger,Object.defineProperty(exports,"ShieldIcon",{enumerable:!0,get:function(){return $.ShieldCheck}}),Object.defineProperty(exports,"ShrinkIcon",{enumerable:!0,get:function(){return $.Shrink}}),Object.defineProperty(exports,"SidebarIcon",{enumerable:!0,get:function(){return $.PanelLeft}}),exports.Skeleton=oe.Skeleton,Object.defineProperty(exports,"SlidersIcon",{enumerable:!0,get:function(){return $.SlidersHorizontal}}),Object.defineProperty(exports,"SmartphoneIcon",{enumerable:!0,get:function(){return $.Smartphone}}),Object.defineProperty(exports,"SparklesIcon",{enumerable:!0,get:function(){return $.Sparkles}}),exports.Spinner=te.Spinner,exports.StatusBadge=P.StatusBadge,Object.defineProperty(exports,"StepBackIcon",{enumerable:!0,get:function(){return $.StepBack}}),Object.defineProperty(exports,"StepForwardIcon",{enumerable:!0,get:function(){return $.StepForward}}),Object.defineProperty(exports,"StopIcon",{enumerable:!0,get:function(){return $.Square}}),exports.StreamCursor=Oe.StreamCursor,exports.Switch=ke.Switch,exports.SyntaxLine=_.SyntaxLine,exports.SyntaxText=_.SyntaxText,exports.Tabs=E.Tabs,exports.TabsContent=E.TabsContent,exports.TabsList=E.TabsList,exports.TabsTrigger=E.TabsTrigger,Object.defineProperty(exports,"TargetIcon",{enumerable:!0,get:function(){return $.Target}}),Object.defineProperty(exports,"TaskIcon",{enumerable:!0,get:function(){return $.SquareCheckBig}}),Object.defineProperty(exports,"TerminalIcon",{enumerable:!0,get:function(){return $.SquareTerminal}}),exports.TerminalView=Ae.TerminalView,exports.Textarea=Ce.Textarea,exports.Toast=q.Toast,exports.ToastAction=q.ToastAction,exports.ToastClose=q.ToastClose,exports.ToastDescription=q.ToastDescription,exports.ToastProvider=q.ToastProvider,exports.ToastTitle=q.ToastTitle,exports.ToastViewport=q.ToastViewport,exports.ToolPathLink=Me.ToolPathLink,exports.Tooltip=s.Tooltip,exports.TooltipContent=s.TooltipContent,exports.TooltipProvider=s.TooltipProvider,exports.TooltipTrigger=s.TooltipTrigger,Object.defineProperty(exports,"TrashIcon",{enumerable:!0,get:function(){return $.Trash2}}),Object.defineProperty(exports,"UndoIcon",{enumerable:!0,get:function(){return $.Undo2}}),Object.defineProperty(exports,"UnlockIcon",{enumerable:!0,get:function(){return $.LockOpen}}),Object.defineProperty(exports,"UserIcon",{enumerable:!0,get:function(){return $.UserRound}}),Object.defineProperty(exports,"UsersIcon",{enumerable:!0,get:function(){return $.Users}}),exports.ViewableImage=ge.ViewableImage,Object.defineProperty(exports,"VolumeIcon",{enumerable:!0,get:function(){return $.Volume2}}),Object.defineProperty(exports,"WorkflowIcon",{enumerable:!0,get:function(){return $.Workflow}}),Object.defineProperty(exports,"WrenchIcon",{enumerable:!0,get:function(){return $.Wrench}}),exports.ageLabel=T.ageLabel,exports.agentInitials=a.agentInitials,exports.ansiSpans=t.ansiSpans,exports.badgeVariants=o.badgeVariants,exports.boundedFileSource=k.boundedFileSource,exports.breadcrumbSegments=c.breadcrumbSegments,exports.buildReviewPrompt=d.buildReviewPrompt,exports.buttonVariants=l.buttonVariants,exports.clockRefreshMs=V.clockRefreshMs,exports.clockText=V.clockText,exports.cn=ee.cn,exports.collapseLines=J.collapseLines,exports.compactDetails=Y.compactDetails,exports.defaultReviewHeading=d.defaultReviewHeading,exports.detectGrammar=g.detectGrammar,exports.dialogFooterVariants=u.dialogFooterVariants,exports.diffGutterWidth=d.diffGutterWidth,exports.diffRangeOf=d.diffRangeOf,exports.dotVariants=i.dotVariants,exports.drawableImageUrl=h.drawableImageUrl,exports.dropdownMenuItemVariants=p.dropdownMenuItemVariants,exports.fieldVariants=y.fieldVariants,exports.fileAssetPath=T.fileAssetPath,exports.fileKind=T.fileKind,exports.filePreviewMode=T.filePreviewMode,exports.fileTree=T.fileTree,exports.filterFiles=T.filterFiles,exports.formatRunDuration=V.formatRunDuration,exports.grammarKeyOf=ie.grammarKeyOf,exports.groupByDirectory=X.groupByDirectory,exports.groupRowLabel=X.groupRowLabel,exports.handleOptionListKey=b.handleOptionListKey,exports.hashlineBody=Y.hashlineBody,exports.hashlineGroups=A.hashlineGroups,exports.hashlineGroupsKey=A.hashlineGroupsKey,exports.highlightToLines=g.highlightToLines,exports.inlineProfileIcon=z.inlineProfileIcon,exports.isFileLayout=T.isFileLayout,exports.launchProfileChoice=z.launchProfileChoice,exports.markdownMediaReview=h.markdownMediaReview,exports.markdownMediaReviewSlot=m.markdownMediaReviewSlot,exports.mediaKindOf=_e.mediaKindOf,exports.messageItemRowVariants=F.messageItemRowVariants,exports.messageItemStatusVariants=F.messageItemStatusVariants,exports.messageItemVariants=F.messageItemVariants,exports.messageLineVariants=I.messageLineVariants,exports.modifiedLabel=T.modifiedLabel,exports.newestFiles=T.newestFiles,exports.optionListHint=b.optionListHint,exports.optionListVariants=x.optionListVariants,exports.optionMarker=b.optionMarker,exports.optionMarkerVariants=x.optionMarkerVariants,exports.optionRowVariants=x.optionRowVariants,exports.parseFileHeader=Y.parseFileHeader,exports.parseProfileCatalog=z.parseProfileCatalog,exports.parseTaggedLine=Y.parseTaggedLine,exports.presentHashlineLines=Y.presentHashlineLines,exports.qrMatrix=be.qrMatrix,exports.rangedFileBlob=k.rangedFileBlob,exports.readMediaBytes=k.readMediaBytes,exports.resolvePdfViewportRegion=M.resolvePdfViewportRegion,exports.resultTextLines=Y.resultTextLines,exports.reviewCommentAnchor=d.reviewCommentAnchor,exports.sizeLabel=T.sizeLabel,exports.sortFiles=T.sortFiles,exports.statusBadgeVariants=P.statusBadgeVariants,exports.svgImageUrl=h.svgImageUrl,exports.syntaxStyleOf=g.syntaxStyleOf,exports.tabBadgeVariants=E.tabBadgeVariants,exports.tabVariants=E.tabVariants,exports.takeTrailingNotice=Y.takeTrailingNotice,exports.toastVariants=q.toastVariants,exports.toolTone=F.toolTone,exports.trimSnippet=d.trimSnippet,exports.useMessageItem=F.useMessageItem,exports.useProfileCatalog=B.useProfileCatalog,exports.useSyntaxLines=_.useSyntaxLines;
|
package/dist/index.d.mts
CHANGED
|
@@ -46,7 +46,7 @@ import { MessageLine, MessageLineTone, MessageLines, MessageLinesProps, messageL
|
|
|
46
46
|
import { Panel, PanelBody, PanelHeader, PanelProps } from "./src/components/Panel.mjs";
|
|
47
47
|
import { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger } from "./src/components/Popover.mjs";
|
|
48
48
|
import { PickerContent, PickerContentProps, PickerItem, PickerList, PickerListProps } from "./src/components/Picker.mjs";
|
|
49
|
-
import { ProfileChoice, ProfilePickerCatalog, ProfilePickerProfile, ProfilePickerState, ProfilePickerStatus, inlineProfileIcon, parseProfileCatalog } from "./src/lib/profilePicker.mjs";
|
|
49
|
+
import { ProfileChoice, ProfilePickerCatalog, ProfilePickerProfile, ProfilePickerState, ProfilePickerStatus, inlineProfileIcon, launchProfileChoice, parseProfileCatalog } from "./src/lib/profilePicker.mjs";
|
|
50
50
|
import { ProfilePicker, ProfilePickerProps, useProfileCatalog } from "./src/components/ProfilePicker.mjs";
|
|
51
51
|
import { LiveDuration, LiveDurationProps } from "./src/components/LiveDuration.mjs";
|
|
52
52
|
import { Progress } from "./src/components/Progress.mjs";
|
|
@@ -87,4 +87,4 @@ import { buildReviewPrompt, defaultReviewHeading, diffGutterWidth, diffRangeOf,
|
|
|
87
87
|
import { MAX_DIGIT_SHORTCUT, handleOptionListKey, optionListHint, optionMarker } from "./src/lib/optionList.mjs";
|
|
88
88
|
import { CHIP_TO_STATUS, LINE_TONE_TO_STATUS, STATUS_TO_CHIP, STATUS_TO_DOT } from "./src/lib/tone.mjs";
|
|
89
89
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./src/components/Tooltip.mjs";
|
|
90
|
-
export { ACCENT_TONES, type AccentTone, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityIcon, AgentAvatar, type AgentState, AlertIcon, AnsiLine, type AnsiLineProps, type AnsiSpan, AnsiText, type AnsiTextProps, AppWindowIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpRightIcon, AudioLinesIcon, Avatar, AvatarFallback, AvatarImage, BREADCRUMB_ELLIPSIS, Back10Icon, Badge, type BadgeProps, type BadgeTone, BellIcon, BookmarkPlusIcon, type BoundedFileSource, BoxIcon, BranchIcon, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CHIP_TONES, CHIP_TO_STATUS, CalendarIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, type ChipTone, CloseIcon, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorController, type CodeEditorProps, type CollapsedLines, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandDialog, type CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandHeader, CommandInput, CommandItem, CommandItemLabel, CommandList, ConnectorIcon, CopyIcon, CtaCard, type CtaCardProps, DEFAULT_FILE_BROWSER_FILTERS, DOT_TONES, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogTitle, DialogTrigger, type DiffHunk, type DiffMarker, type DiffRow, type DiffSelection, type DiffSide, DiffView, type DiffViewProps, Dot, type DotProps, type DotTone, DownloadIcon, Drawer, type DrawerProps, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditIcon, type EditorEdit, type EditorMarkedRange, type EditorSelectionRange, type EditorTextRange, type EditorViewportRectangle, EmptyState, type EmptyStateAction, type EmptyStateProps, type EmptyStateSize, EnterIcon, EraserIcon, ExternalLinkIcon, type FieldSize, type FieldVariant, FileAge, FileBrowser, type FileBrowserFilters, type FileBrowserLayout, type FileBrowserProps, type FileFilters, FileIcon, type FileItem, type FileKind, type FileLayout, type FileModified, FilePreview, type FilePreviewProps, type FileRangeLoader, type FileSort, type FileSortDirection, type FileStatus, type FileStatusFilter, type FileTextPreview, type FileTreeRow, FitIcon, FlowGraph, type FlowGraphEdge, type FlowGraphEdgeShape, type FlowGraphEdgeTone, type FlowGraphEditable, type FlowGraphNode, type FlowGraphNodeResize, type FlowGraphOverlayView, type FlowGraphPlaceTarget, type FlowGraphProps, type FlowGraphSide, FolderIcon, ForkIcon, Forward10Icon, GREP_COLLAPSED_LINES, GearIcon, GlobeIcon, type GrammarKey, type GrammarQuery, GridIcon, HandIcon, type HashlineBody, type HashlineGroup, HashlineLines, type HashlineLinesProps, type HashlineResult, type HashlineResultKind, HelpIcon, HighlighterIcon, HomeIcon, IdCardIcon, ImageIcon, Input, type InputProps, Kbd, KebabIcon, LINE_TONE_TO_STATUS, Label, LanguagesIcon, LightbulbIcon, ListIcon, LiveDuration, type LiveDurationProps, LoaderIcon, LoadingState, type LoadingStateProps, type LoadingStateSize, LockIcon, MAX_DIGIT_SHORTCUT, MEDIA_KINDS, MESSAGE_LINE_TONES, Markdown, type MarkdownMedia, type MarkdownMediaReview, type MarkdownMediaReviewContribution, type MarkdownMediaReviewPanelProps, McpToolFields, McpToolFrame, McpToolOutput, type MediaFrameCapture, type MediaFrameMetadata, type MediaIntrinsicSize, type MediaKind, type MediaPlaybackState, MediaPreview, type MediaPreviewController, type MediaPreviewProps, MediaViewerDialog, MenuIcon, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, MessageItemHeaderAccessoryContext, type MessageItemHeaderProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, type MessageLine, type MessageLineTone, MessageLines, type MessageLinesProps, MicIcon, MinusIcon, MonitorIcon, NavTab, NavTabBadge, type NavTabProps, NoteIcon, OptionLabel, OptionList, type OptionListProps, OptionRow, type OptionRowProps, PaletteIcon, PanZoom, Panel, PanelBody, PanelHeader, type PanelProps, PaperclipIcon, type PathGroup, PathText, type PathTextProps, PauseIcon, type PdfNormalizedRectangle, type PdfPageRegion, type PdfPageState, PdfPreview, type PdfPreviewController, type PdfPreviewProps, PickerContent, type PickerContentProps, type PickerItem, PickerList, type PickerListProps, PinIcon, PlayCircleIcon, PlayIcon, PlusIcon, PointerIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, type PresentedLine, type ProfileChoice, ProfilePicker, type ProfilePickerCatalog, type ProfilePickerProfile, type ProfilePickerProps, type ProfilePickerState, type ProfilePickerStatus, Progress, PuzzleIcon, QrCode, type QrCodeProps, QuoteIcon, READ_COLLAPSED_LINES, RadioGroup, RadioGroupCard, RadioGroupItem, RedoIcon, ReferenceChip, type ReferenceRenderer, RefreshIcon, type ReviewComment, ReviewCommentDraft, type ReviewCommentDraftProps, RewindIcon, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, STATUS_TONES, STATUS_TO_CHIP, STATUS_TO_DOT, ScrollArea, ScrollBar, SearchIcon, SectionLabel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SendIcon, Separator, ServerIcon, SettingsActions, SettingsCard, SettingsDescription, SettingsField, SettingsHeader, SettingsNote, SettingsPage, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, SettingsTitle, SetupRow, type SetupRowProps, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, SheetOverlay, SheetTitle, SheetTrigger, ShieldIcon, ShrinkIcon, SidebarIcon, Skeleton, SlidersIcon, SmartphoneIcon, SparklesIcon, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusTone, StepBackIcon, StepForwardIcon, StopIcon, StreamCursor, Switch, SyntaxLine, type SyntaxLineProps, type SyntaxLines, type SyntaxQuery, type SyntaxSpan, SyntaxText, type SyntaxTextProps, type SyntaxToken, Tabs, TabsContent, TabsList, TabsTrigger, type TaggedLine, type TaggedLineMarker, TargetIcon, TaskIcon, type TerminalHandle, TerminalIcon, TerminalView, type TerminalViewProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, ToolPathLink, type ToolPathLinkProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TrashIcon, UndoIcon, UnlockIcon, UserIcon, UsersIcon, ViewableImage, type ViewableImageProps, VolumeIcon, WorkflowIcon, WrenchIcon, ageLabel, agentInitials, ansiSpans, badgeVariants, boundedFileSource, breadcrumbSegments, buildReviewPrompt, buttonVariants, clockRefreshMs, clockText, cn, collapseLines, compactDetails, defaultReviewHeading, detectGrammar, dialogFooterVariants, diffGutterWidth, diffRangeOf, dotVariants, drawableImageUrl, dropdownMenuItemVariants, fieldVariants, fileAssetPath, fileKind, filePreviewMode, fileTree, filterFiles, formatRunDuration, grammarKeyOf, groupByDirectory, groupRowLabel, handleOptionListKey, hashlineBody, hashlineGroups, hashlineGroupsKey, highlightToLines, inlineProfileIcon, isFileLayout, markdownMediaReview, markdownMediaReviewSlot, mediaKindOf, messageItemRowVariants, messageItemStatusVariants, messageItemVariants, messageLineVariants, modifiedLabel, newestFiles, optionListHint, optionListVariants, optionMarker, optionMarkerVariants, optionRowVariants, parseFileHeader, parseProfileCatalog, parseTaggedLine, presentHashlineLines, qrMatrix, rangedFileBlob, readMediaBytes, resolvePdfViewportRegion, resultTextLines, reviewCommentAnchor, sizeLabel, sortFiles, statusBadgeVariants, svgImageUrl, syntaxStyleOf, tabBadgeVariants, tabVariants, takeTrailingNotice, toastVariants, toolTone, trimSnippet, useMessageItem, useProfileCatalog, useSyntaxLines };
|
|
90
|
+
export { ACCENT_TONES, type AccentTone, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityIcon, AgentAvatar, type AgentState, AlertIcon, AnsiLine, type AnsiLineProps, type AnsiSpan, AnsiText, type AnsiTextProps, AppWindowIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpRightIcon, AudioLinesIcon, Avatar, AvatarFallback, AvatarImage, BREADCRUMB_ELLIPSIS, Back10Icon, Badge, type BadgeProps, type BadgeTone, BellIcon, BookmarkPlusIcon, type BoundedFileSource, BoxIcon, BranchIcon, Breadcrumb, type BreadcrumbProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CHIP_TONES, CHIP_TO_STATUS, CalendarIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronRightIcon, ChevronUpIcon, type ChipTone, CloseIcon, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorController, type CodeEditorProps, type CollapsedLines, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandDialog, type CommandDialogProps, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandHeader, CommandInput, CommandItem, CommandItemLabel, CommandList, ConnectorIcon, CopyIcon, CtaCard, type CtaCardProps, DEFAULT_FILE_BROWSER_FILTERS, DOT_TONES, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogTitle, DialogTrigger, type DiffHunk, type DiffMarker, type DiffRow, type DiffSelection, type DiffSide, DiffView, type DiffViewProps, Dot, type DotProps, type DotTone, DownloadIcon, Drawer, type DrawerProps, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditIcon, type EditorEdit, type EditorMarkedRange, type EditorSelectionRange, type EditorTextRange, type EditorViewportRectangle, EmptyState, type EmptyStateAction, type EmptyStateProps, type EmptyStateSize, EnterIcon, EraserIcon, ExternalLinkIcon, type FieldSize, type FieldVariant, FileAge, FileBrowser, type FileBrowserFilters, type FileBrowserLayout, type FileBrowserProps, type FileFilters, FileIcon, type FileItem, type FileKind, type FileLayout, type FileModified, FilePreview, type FilePreviewProps, type FileRangeLoader, type FileSort, type FileSortDirection, type FileStatus, type FileStatusFilter, type FileTextPreview, type FileTreeRow, FitIcon, FlowGraph, type FlowGraphEdge, type FlowGraphEdgeShape, type FlowGraphEdgeTone, type FlowGraphEditable, type FlowGraphNode, type FlowGraphNodeResize, type FlowGraphOverlayView, type FlowGraphPlaceTarget, type FlowGraphProps, type FlowGraphSide, FolderIcon, ForkIcon, Forward10Icon, GREP_COLLAPSED_LINES, GearIcon, GlobeIcon, type GrammarKey, type GrammarQuery, GridIcon, HandIcon, type HashlineBody, type HashlineGroup, HashlineLines, type HashlineLinesProps, type HashlineResult, type HashlineResultKind, HelpIcon, HighlighterIcon, HomeIcon, IdCardIcon, ImageIcon, Input, type InputProps, Kbd, KebabIcon, LINE_TONE_TO_STATUS, Label, LanguagesIcon, LightbulbIcon, ListIcon, LiveDuration, type LiveDurationProps, LoaderIcon, LoadingState, type LoadingStateProps, type LoadingStateSize, LockIcon, MAX_DIGIT_SHORTCUT, MEDIA_KINDS, MESSAGE_LINE_TONES, Markdown, type MarkdownMedia, type MarkdownMediaReview, type MarkdownMediaReviewContribution, type MarkdownMediaReviewPanelProps, McpToolFields, McpToolFrame, McpToolOutput, type MediaFrameCapture, type MediaFrameMetadata, type MediaIntrinsicSize, type MediaKind, type MediaPlaybackState, MediaPreview, type MediaPreviewController, type MediaPreviewProps, MediaViewerDialog, MenuIcon, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, MessageItemHeaderAccessoryContext, type MessageItemHeaderProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, type MessageLine, type MessageLineTone, MessageLines, type MessageLinesProps, MicIcon, MinusIcon, MonitorIcon, NavTab, NavTabBadge, type NavTabProps, NoteIcon, OptionLabel, OptionList, type OptionListProps, OptionRow, type OptionRowProps, PaletteIcon, PanZoom, Panel, PanelBody, PanelHeader, type PanelProps, PaperclipIcon, type PathGroup, PathText, type PathTextProps, PauseIcon, type PdfNormalizedRectangle, type PdfPageRegion, type PdfPageState, PdfPreview, type PdfPreviewController, type PdfPreviewProps, PickerContent, type PickerContentProps, type PickerItem, PickerList, type PickerListProps, PinIcon, PlayCircleIcon, PlayIcon, PlusIcon, PointerIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, type PresentedLine, type ProfileChoice, ProfilePicker, type ProfilePickerCatalog, type ProfilePickerProfile, type ProfilePickerProps, type ProfilePickerState, type ProfilePickerStatus, Progress, PuzzleIcon, QrCode, type QrCodeProps, QuoteIcon, READ_COLLAPSED_LINES, RadioGroup, RadioGroupCard, RadioGroupItem, RedoIcon, ReferenceChip, type ReferenceRenderer, RefreshIcon, type ReviewComment, ReviewCommentDraft, type ReviewCommentDraftProps, RewindIcon, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, STATUS_TONES, STATUS_TO_CHIP, STATUS_TO_DOT, ScrollArea, ScrollBar, SearchIcon, SectionLabel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SendIcon, Separator, ServerIcon, SettingsActions, SettingsCard, SettingsDescription, SettingsField, SettingsHeader, SettingsNote, SettingsPage, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, SettingsTitle, SetupRow, type SetupRowProps, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, SheetOverlay, SheetTitle, SheetTrigger, ShieldIcon, ShrinkIcon, SidebarIcon, Skeleton, SlidersIcon, SmartphoneIcon, SparklesIcon, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusTone, StepBackIcon, StepForwardIcon, StopIcon, StreamCursor, Switch, SyntaxLine, type SyntaxLineProps, type SyntaxLines, type SyntaxQuery, type SyntaxSpan, SyntaxText, type SyntaxTextProps, type SyntaxToken, Tabs, TabsContent, TabsList, TabsTrigger, type TaggedLine, type TaggedLineMarker, TargetIcon, TaskIcon, type TerminalHandle, TerminalIcon, TerminalView, type TerminalViewProps, Textarea, type TextareaProps, Toast, ToastAction, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, ToolPathLink, type ToolPathLinkProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TrashIcon, UndoIcon, UnlockIcon, UserIcon, UsersIcon, ViewableImage, type ViewableImageProps, VolumeIcon, WorkflowIcon, WrenchIcon, ageLabel, agentInitials, ansiSpans, badgeVariants, boundedFileSource, breadcrumbSegments, buildReviewPrompt, buttonVariants, clockRefreshMs, clockText, cn, collapseLines, compactDetails, defaultReviewHeading, detectGrammar, dialogFooterVariants, diffGutterWidth, diffRangeOf, dotVariants, drawableImageUrl, dropdownMenuItemVariants, fieldVariants, fileAssetPath, fileKind, filePreviewMode, fileTree, filterFiles, formatRunDuration, grammarKeyOf, groupByDirectory, groupRowLabel, handleOptionListKey, hashlineBody, hashlineGroups, hashlineGroupsKey, highlightToLines, inlineProfileIcon, isFileLayout, launchProfileChoice, markdownMediaReview, markdownMediaReviewSlot, mediaKindOf, messageItemRowVariants, messageItemStatusVariants, messageItemVariants, messageLineVariants, modifiedLabel, newestFiles, optionListHint, optionListVariants, optionMarker, optionMarkerVariants, optionRowVariants, parseFileHeader, parseProfileCatalog, parseTaggedLine, presentHashlineLines, qrMatrix, rangedFileBlob, readMediaBytes, resolvePdfViewportRegion, resultTextLines, reviewCommentAnchor, sizeLabel, sortFiles, statusBadgeVariants, svgImageUrl, syntaxStyleOf, tabBadgeVariants, tabVariants, takeTrailingNotice, toastVariants, toolTone, trimSnippet, useMessageItem, useProfileCatalog, useSyntaxLines };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ActivityIcon as e,AlertIcon as t,AppWindowIcon as n,ArrowLeftIcon as r,ArrowRightIcon as i,ArrowUpRightIcon as a,AudioLinesIcon as o,Back10Icon as s,BellIcon as c,BookmarkPlusIcon as l,BoxIcon as u,BranchIcon as d,CalendarIcon as f,CheckIcon as p,ChevronDownIcon as m,ChevronRightIcon as h,ChevronUpIcon as g,CloseIcon as _,ConnectorIcon as v,CopyIcon as y,DownloadIcon as b,EditIcon as x,EnterIcon as S,EraserIcon as C,ExternalLinkIcon as w,FileIcon as T,FitIcon as E,FolderIcon as D,ForkIcon as O,Forward10Icon as k,GearIcon as A,GlobeIcon as j,GridIcon as M,HandIcon as N,HelpIcon as P,HighlighterIcon as F,HomeIcon as I,IdCardIcon as L,ImageIcon as R,KebabIcon as z,LanguagesIcon as B,LightbulbIcon as V,ListIcon as H,LoaderIcon as U,LockIcon as W,MenuIcon as G,MessageIcon as K,MicIcon as q,MinusIcon as J,MonitorIcon as Y,NoteIcon as X,PaletteIcon as Z,PaperclipIcon as Q,PauseIcon as $,PinIcon as ee,PlayCircleIcon as te,PlayIcon as ne,PlusIcon as re,PointerIcon as ie,PuzzleIcon as ae,QuoteIcon as oe,RedoIcon as se,RefreshIcon as ce,RewindIcon as le,SearchIcon as ue,SendIcon as de,ServerIcon as fe,ShieldIcon as pe,ShrinkIcon as me,SidebarIcon as he,SlidersIcon as ge,SmartphoneIcon as _e,SparklesIcon as ve,StepBackIcon as ye,StepForwardIcon as be,StopIcon as xe,TargetIcon as Se,TaskIcon as Ce,TerminalIcon as we,TrashIcon as Te,UndoIcon as Ee,UnlockIcon as De,UserIcon as Oe,UsersIcon as ke,VolumeIcon as Ae,WorkflowIcon as je,WrenchIcon as Me}from"./src/icons/icons.mjs";import{cn as Ne}from"./src/lib/cn.mjs";import{Accordion as Pe,AccordionContent as Fe,AccordionItem as Ie,AccordionTrigger as Le}from"./src/components/Accordion.mjs";import{ansiSpans as Re}from"./src/lib/ansiSpans.mjs";import{AnsiLine as ze,AnsiText as Be}from"./src/components/AnsiText.mjs";import{Avatar as Ve,AvatarFallback as He,AvatarImage as Ue}from"./src/components/Avatar.mjs";import{Dot as We,dotVariants as Ge}from"./src/components/Dot.mjs";import{AgentAvatar as Ke,agentInitials as qe}from"./src/components/AgentAvatar.mjs";import{Badge as Je,badgeVariants as Ye}from"./src/components/Badge.mjs";import{Tooltip as Xe,TooltipContent as Ze,TooltipProvider as Qe,TooltipTrigger as $e}from"./src/components/Tooltip.mjs";import{BREADCRUMB_ELLIPSIS as et,Breadcrumb as tt,breadcrumbSegments as nt}from"./src/components/Breadcrumb.mjs";import{Spinner as rt}from"./src/components/Spinner.mjs";import{Button as it,buttonVariants as at}from"./src/components/Button.mjs";import{Dialog as ot,DialogBody as st,DialogClose as ct,DialogContent as lt,DialogDescription as ut,DialogFooter as dt,DialogHeader as ft,DialogTitle as pt,DialogTrigger as mt,dialogFooterVariants as ht}from"./src/components/Dialog.mjs";import{buildReviewPrompt as gt,defaultReviewHeading as _t,diffGutterWidth as vt,diffRangeOf as yt,reviewCommentAnchor as bt,trimSnippet as xt}from"./src/lib/review.mjs";import{DiffView as St}from"./src/components/DiffView.mjs";import{Drawer as Ct}from"./src/components/Drawer.mjs";import{DropdownMenu as wt,DropdownMenuCheckboxItem as Tt,DropdownMenuContent as Et,DropdownMenuGroup as Dt,DropdownMenuItem as Ot,DropdownMenuLabel as kt,DropdownMenuRadioGroup as At,DropdownMenuRadioItem as jt,DropdownMenuSeparator as Mt,DropdownMenuShortcut as Nt,DropdownMenuSub as Pt,DropdownMenuSubContent as Ft,DropdownMenuSubTrigger as It,DropdownMenuTrigger as Lt,dropdownMenuItemVariants as Rt}from"./src/components/DropdownMenu.mjs";import{Checkbox as zt}from"./src/components/Checkbox.mjs";import{grammarKeyOf as Bt}from"./src/lib/editorLanguage.mjs";import{markdownMediaReviewSlot as Vt}from"./src/lib/markdownMediaSlot.mjs";import{drawableImageUrl as Ht,markdownMediaReview as Ut,svgImageUrl as Wt}from"./src/lib/markdownMedia.mjs";import{detectGrammar as Gt,highlightToLines as Kt,syntaxStyleOf as qt}from"./src/lib/syntaxHighlight.mjs";import{SyntaxLine as Jt,SyntaxText as Yt,useSyntaxLines as Xt}from"./src/components/SyntaxText.mjs";import{CodeBlock as Zt}from"./src/components/CodeBlock.mjs";import{Skeleton as Qt}from"./src/components/Skeleton.mjs";import{CodeEditor as $t}from"./src/components/CodeEditor.mjs";import{Collapsible as en,CollapsibleContent as tn,CollapsibleTrigger as nn}from"./src/components/Collapsible.mjs";import{Input as rn,fieldVariants as an}from"./src/components/Input.mjs";import{MAX_DIGIT_SHORTCUT as on,handleOptionListKey as sn,optionListHint as cn,optionMarker as ln}from"./src/lib/optionList.mjs";import{OptionLabel as un,OptionList as dn,OptionRow as fn,optionListVariants as pn,optionMarkerVariants as mn,optionRowVariants as hn}from"./src/components/OptionList.mjs";import{CommandDialog as gn,CommandEmpty as _n,CommandFooter as vn,CommandGroup as yn,CommandGroupLabel as bn,CommandHeader as xn,CommandInput as Sn,CommandItem as Cn,CommandItemLabel as wn,CommandList as Tn}from"./src/components/Command.mjs";import{Panel as En,PanelBody as Dn,PanelHeader as On}from"./src/components/Panel.mjs";import{CtaCard as kn}from"./src/components/CtaCard.mjs";import{EmptyState as An}from"./src/components/EmptyState.mjs";import{LoadingState as jn}from"./src/components/LoadingState.mjs";import{ageLabel as Mn,fileAssetPath as Nn,fileKind as Pn,filePreviewMode as Fn,fileTree as In,filterFiles as Ln,isFileLayout as Rn,modifiedLabel as zn,newestFiles as Bn,sizeLabel as Vn,sortFiles as Hn}from"./src/lib/files.mjs";import{NavTab as Un,NavTabBadge as Wn,Tabs as Gn,TabsContent as Kn,TabsList as qn,TabsTrigger as Jn,tabBadgeVariants as Yn,tabVariants as Xn}from"./src/components/Tabs.mjs";import{DEFAULT_FILE_BROWSER_FILTERS as Zn,FileAge as Qn,FileBrowser as $n}from"./src/components/FileBrowser.mjs";import{MediaViewerDialog as er,PanZoom as tr}from"./src/components/MediaViewerDialog.mjs";import{Markdown as nr}from"./src/components/Markdown.mjs";import{FilePreview as rr}from"./src/components/FilePreview.mjs";import{boundedFileSource as ir,rangedFileBlob as ar,readMediaBytes as or}from"./src/lib/fileDownload.mjs";import{FlowGraph as sr}from"./src/components/FlowGraph.mjs";import{hashlineGroups as cr,hashlineGroupsKey as lr}from"./src/lib/hashlineHighlight.mjs";import{HashlineLines as ur}from"./src/components/HashlineLines.mjs";import{Kbd as dr}from"./src/components/Kbd.mjs";import{McpToolFields as fr,McpToolFrame as pr,McpToolOutput as mr}from"./src/components/McpToolWidget.mjs";import{Label as hr}from"./src/components/Label.mjs";import{ViewableImage as gr}from"./src/components/ViewableImage.mjs";import{mediaKindOf as _r}from"./src/lib/media.mjs";import{PdfPreview as vr,resolvePdfViewportRegion as yr}from"./src/components/PdfPreview.mjs";import{MediaPreview as br}from"./src/components/MediaPreview.mjs";import{STATUS_EDGE as xr,StatusBadge as Sr,statusBadgeVariants as Cr}from"./src/components/StatusBadge.mjs";import{MessageItem as wr,MessageItemBody as Tr,MessageItemGroup as Er,MessageItemHeader as Dr,MessageItemHeaderAccessoryContext as Or,MessageItemStatus as kr,STATUS_GLYPH as Ar,STATUS_LABEL as jr,messageItemRowVariants as Mr,messageItemStatusVariants as Nr,messageItemVariants as Pr,toolTone as Fr,useMessageItem as Ir}from"./src/components/MessageItem.mjs";import{MessageLines as Lr,messageLineVariants as Rr}from"./src/components/MessageLines.mjs";import{Popover as zr,PopoverAnchor as Br,PopoverClose as Vr,PopoverContent as Hr,PopoverFooter as Ur,PopoverHeader as Wr,PopoverTrigger as Gr}from"./src/components/Popover.mjs";import{PickerContent as Kr,PickerList as qr}from"./src/components/Picker.mjs";import{inlineProfileIcon as Jr,parseProfileCatalog as Yr}from"./src/lib/profilePicker.mjs";import{ProfilePicker as Xr,useProfileCatalog as Zr}from"./src/components/ProfilePicker.mjs";import{clockRefreshMs as Qr,clockText as $r,formatRunDuration as ei}from"./src/lib/runDuration.mjs";import{LiveDuration as ti}from"./src/components/LiveDuration.mjs";import{Progress as ni}from"./src/components/Progress.mjs";import{qrMatrix as ri}from"./src/lib/qrMatrix.mjs";import{QrCode as ii}from"./src/components/QrCode.mjs";import{RadioGroup as ai,RadioGroupCard as oi,RadioGroupItem as si}from"./src/components/RadioGroup.mjs";import{ReferenceChip as ci}from"./src/components/ReferenceChip.mjs";import{Textarea as li}from"./src/components/Textarea.mjs";import{ReviewCommentDraft as ui}from"./src/components/ReviewCommentDraft.mjs";import{ScrollArea as di,ScrollBar as fi}from"./src/components/ScrollArea.mjs";import{SectionLabel as pi}from"./src/components/SectionLabel.mjs";import{Select as mi,SelectContent as hi,SelectGroup as gi,SelectItem as _i,SelectLabel as vi,SelectSeparator as yi,SelectTrigger as bi,SelectValue as xi}from"./src/components/Select.mjs";import{Separator as Si}from"./src/components/Separator.mjs";import{SettingsActions as Ci,SettingsCard as wi,SettingsDescription as Ti,SettingsField as Ei,SettingsHeader as Di,SettingsNote as Oi,SettingsPage as ki,SettingsRow as Ai,SettingsRowDescription as ji,SettingsRowText as Mi,SettingsRowTitle as Ni,SettingsSection as Pi,SettingsSectionDescription as Fi,SettingsSectionHeader as Ii,SettingsSectionTitle as Li,SettingsTitle as Ri}from"./src/components/Settings.mjs";import{SetupRow as zi}from"./src/components/SetupRow.mjs";import{Sheet as Bi,SheetBody as Vi,SheetClose as Hi,SheetContent as Ui,SheetDescription as Wi,SheetFooter as Gi,SheetHeader as Ki,SheetOverlay as qi,SheetTitle as Ji,SheetTrigger as Yi}from"./src/components/Sheet.mjs";import{StreamCursor as Xi}from"./src/components/StreamCursor.mjs";import{Switch as Zi}from"./src/components/Switch.mjs";import{TerminalView as Qi}from"./src/components/TerminalView.mjs";import{Toast as $i,ToastAction as ea,ToastClose as ta,ToastDescription as na,ToastProvider as ra,ToastTitle as ia,ToastViewport as aa,toastVariants as oa}from"./src/components/Toast.mjs";import{PathText as sa}from"./src/components/PathText.mjs";import{ToolPathLink as ca}from"./src/components/ToolPathLink.mjs";import{collapseLines as la}from"./src/lib/collapse.mjs";import{GREP_COLLAPSED_LINES as ua,READ_COLLAPSED_LINES as da,compactDetails as fa,hashlineBody as pa,parseFileHeader as ma,parseTaggedLine as ha,presentHashlineLines as ga,resultTextLines as _a,takeTrailingNotice as va}from"./src/lib/hashlineView.mjs";import{groupByDirectory as ya,groupRowLabel as ba}from"./src/lib/pathGroups.mjs";import{CHIP_TO_STATUS as xa,LINE_TONE_TO_STATUS as Sa,STATUS_TO_CHIP as Ca,STATUS_TO_DOT as wa}from"./src/lib/tone.mjs";import{MEDIA_KINDS as Ta}from"./src/types/editor.mjs";import{ACCENT_TONES as Ea,CHIP_TONES as Da,DOT_TONES as Oa,MESSAGE_LINE_TONES as ka,STATUS_TONES as Aa}from"./src/types/tone.mjs";export{Ea as ACCENT_TONES,Pe as Accordion,Fe as AccordionContent,Ie as AccordionItem,Le as AccordionTrigger,e as ActivityIcon,Ke as AgentAvatar,t as AlertIcon,ze as AnsiLine,Be as AnsiText,n as AppWindowIcon,r as ArrowLeftIcon,i as ArrowRightIcon,a as ArrowUpRightIcon,o as AudioLinesIcon,Ve as Avatar,He as AvatarFallback,Ue as AvatarImage,et as BREADCRUMB_ELLIPSIS,s as Back10Icon,Je as Badge,c as BellIcon,l as BookmarkPlusIcon,u as BoxIcon,d as BranchIcon,tt as Breadcrumb,it as Button,Da as CHIP_TONES,xa as CHIP_TO_STATUS,f as CalendarIcon,p as CheckIcon,zt as Checkbox,m as ChevronDownIcon,h as ChevronRightIcon,g as ChevronUpIcon,_ as CloseIcon,Zt as CodeBlock,$t as CodeEditor,en as Collapsible,tn as CollapsibleContent,nn as CollapsibleTrigger,gn as CommandDialog,_n as CommandEmpty,vn as CommandFooter,yn as CommandGroup,bn as CommandGroupLabel,xn as CommandHeader,Sn as CommandInput,Cn as CommandItem,wn as CommandItemLabel,Tn as CommandList,v as ConnectorIcon,y as CopyIcon,kn as CtaCard,Zn as DEFAULT_FILE_BROWSER_FILTERS,Oa as DOT_TONES,ot as Dialog,st as DialogBody,ct as DialogClose,lt as DialogContent,ut as DialogDescription,dt as DialogFooter,ft as DialogHeader,pt as DialogTitle,mt as DialogTrigger,St as DiffView,We as Dot,b as DownloadIcon,Ct as Drawer,wt as DropdownMenu,Tt as DropdownMenuCheckboxItem,Et as DropdownMenuContent,Dt as DropdownMenuGroup,Ot as DropdownMenuItem,kt as DropdownMenuLabel,At as DropdownMenuRadioGroup,jt as DropdownMenuRadioItem,Mt as DropdownMenuSeparator,Nt as DropdownMenuShortcut,Pt as DropdownMenuSub,Ft as DropdownMenuSubContent,It as DropdownMenuSubTrigger,Lt as DropdownMenuTrigger,x as EditIcon,An as EmptyState,S as EnterIcon,C as EraserIcon,w as ExternalLinkIcon,Qn as FileAge,$n as FileBrowser,T as FileIcon,rr as FilePreview,E as FitIcon,sr as FlowGraph,D as FolderIcon,O as ForkIcon,k as Forward10Icon,ua as GREP_COLLAPSED_LINES,A as GearIcon,j as GlobeIcon,M as GridIcon,N as HandIcon,ur as HashlineLines,P as HelpIcon,F as HighlighterIcon,I as HomeIcon,L as IdCardIcon,R as ImageIcon,rn as Input,dr as Kbd,z as KebabIcon,Sa as LINE_TONE_TO_STATUS,hr as Label,B as LanguagesIcon,V as LightbulbIcon,H as ListIcon,ti as LiveDuration,U as LoaderIcon,jn as LoadingState,W as LockIcon,on as MAX_DIGIT_SHORTCUT,Ta as MEDIA_KINDS,ka as MESSAGE_LINE_TONES,nr as Markdown,fr as McpToolFields,pr as McpToolFrame,mr as McpToolOutput,br as MediaPreview,er as MediaViewerDialog,G as MenuIcon,K as MessageIcon,wr as MessageItem,Tr as MessageItemBody,Er as MessageItemGroup,Dr as MessageItemHeader,Or as MessageItemHeaderAccessoryContext,kr as MessageItemStatus,Lr as MessageLines,q as MicIcon,J as MinusIcon,Y as MonitorIcon,Un as NavTab,Wn as NavTabBadge,X as NoteIcon,un as OptionLabel,dn as OptionList,fn as OptionRow,Z as PaletteIcon,tr as PanZoom,En as Panel,Dn as PanelBody,On as PanelHeader,Q as PaperclipIcon,sa as PathText,$ as PauseIcon,vr as PdfPreview,Kr as PickerContent,qr as PickerList,ee as PinIcon,te as PlayCircleIcon,ne as PlayIcon,re as PlusIcon,ie as PointerIcon,zr as Popover,Br as PopoverAnchor,Vr as PopoverClose,Hr as PopoverContent,Ur as PopoverFooter,Wr as PopoverHeader,Gr as PopoverTrigger,Xr as ProfilePicker,ni as Progress,ae as PuzzleIcon,ii as QrCode,oe as QuoteIcon,da as READ_COLLAPSED_LINES,ai as RadioGroup,oi as RadioGroupCard,si as RadioGroupItem,se as RedoIcon,ci as ReferenceChip,ce as RefreshIcon,ui as ReviewCommentDraft,le as RewindIcon,xr as STATUS_EDGE,Ar as STATUS_GLYPH,jr as STATUS_LABEL,Aa as STATUS_TONES,Ca as STATUS_TO_CHIP,wa as STATUS_TO_DOT,di as ScrollArea,fi as ScrollBar,ue as SearchIcon,pi as SectionLabel,mi as Select,hi as SelectContent,gi as SelectGroup,_i as SelectItem,vi as SelectLabel,yi as SelectSeparator,bi as SelectTrigger,xi as SelectValue,de as SendIcon,Si as Separator,fe as ServerIcon,Ci as SettingsActions,wi as SettingsCard,Ti as SettingsDescription,Ei as SettingsField,Di as SettingsHeader,Oi as SettingsNote,ki as SettingsPage,Ai as SettingsRow,ji as SettingsRowDescription,Mi as SettingsRowText,Ni as SettingsRowTitle,Pi as SettingsSection,Fi as SettingsSectionDescription,Ii as SettingsSectionHeader,Li as SettingsSectionTitle,Ri as SettingsTitle,zi as SetupRow,Bi as Sheet,Vi as SheetBody,Hi as SheetClose,Ui as SheetContent,Wi as SheetDescription,Gi as SheetFooter,Ki as SheetHeader,qi as SheetOverlay,Ji as SheetTitle,Yi as SheetTrigger,pe as ShieldIcon,me as ShrinkIcon,he as SidebarIcon,Qt as Skeleton,ge as SlidersIcon,_e as SmartphoneIcon,ve as SparklesIcon,rt as Spinner,Sr as StatusBadge,ye as StepBackIcon,be as StepForwardIcon,xe as StopIcon,Xi as StreamCursor,Zi as Switch,Jt as SyntaxLine,Yt as SyntaxText,Gn as Tabs,Kn as TabsContent,qn as TabsList,Jn as TabsTrigger,Se as TargetIcon,Ce as TaskIcon,we as TerminalIcon,Qi as TerminalView,li as Textarea,$i as Toast,ea as ToastAction,ta as ToastClose,na as ToastDescription,ra as ToastProvider,ia as ToastTitle,aa as ToastViewport,ca as ToolPathLink,Xe as Tooltip,Ze as TooltipContent,Qe as TooltipProvider,$e as TooltipTrigger,Te as TrashIcon,Ee as UndoIcon,De as UnlockIcon,Oe as UserIcon,ke as UsersIcon,gr as ViewableImage,Ae as VolumeIcon,je as WorkflowIcon,Me as WrenchIcon,Mn as ageLabel,qe as agentInitials,Re as ansiSpans,Ye as badgeVariants,ir as boundedFileSource,nt as breadcrumbSegments,gt as buildReviewPrompt,at as buttonVariants,Qr as clockRefreshMs,$r as clockText,Ne as cn,la as collapseLines,fa as compactDetails,_t as defaultReviewHeading,Gt as detectGrammar,ht as dialogFooterVariants,vt as diffGutterWidth,yt as diffRangeOf,Ge as dotVariants,Ht as drawableImageUrl,Rt as dropdownMenuItemVariants,an as fieldVariants,Nn as fileAssetPath,Pn as fileKind,Fn as filePreviewMode,In as fileTree,Ln as filterFiles,ei as formatRunDuration,Bt as grammarKeyOf,ya as groupByDirectory,ba as groupRowLabel,sn as handleOptionListKey,pa as hashlineBody,cr as hashlineGroups,lr as hashlineGroupsKey,Kt as highlightToLines,Jr as inlineProfileIcon,Rn as isFileLayout,Ut as markdownMediaReview,Vt as markdownMediaReviewSlot,_r as mediaKindOf,Mr as messageItemRowVariants,Nr as messageItemStatusVariants,Pr as messageItemVariants,Rr as messageLineVariants,zn as modifiedLabel,Bn as newestFiles,cn as optionListHint,pn as optionListVariants,ln as optionMarker,mn as optionMarkerVariants,hn as optionRowVariants,ma as parseFileHeader,Yr as parseProfileCatalog,ha as parseTaggedLine,ga as presentHashlineLines,ri as qrMatrix,ar as rangedFileBlob,or as readMediaBytes,yr as resolvePdfViewportRegion,_a as resultTextLines,bt as reviewCommentAnchor,Vn as sizeLabel,Hn as sortFiles,Cr as statusBadgeVariants,Wt as svgImageUrl,qt as syntaxStyleOf,Yn as tabBadgeVariants,Xn as tabVariants,va as takeTrailingNotice,oa as toastVariants,Fr as toolTone,xt as trimSnippet,Ir as useMessageItem,Zr as useProfileCatalog,Xt as useSyntaxLines};
|
|
1
|
+
import{ActivityIcon as e,AlertIcon as t,AppWindowIcon as n,ArrowLeftIcon as r,ArrowRightIcon as i,ArrowUpRightIcon as a,AudioLinesIcon as o,Back10Icon as s,BellIcon as c,BookmarkPlusIcon as l,BoxIcon as u,BranchIcon as d,CalendarIcon as f,CheckIcon as p,ChevronDownIcon as m,ChevronRightIcon as h,ChevronUpIcon as g,CloseIcon as _,ConnectorIcon as v,CopyIcon as y,DownloadIcon as b,EditIcon as x,EnterIcon as S,EraserIcon as C,ExternalLinkIcon as w,FileIcon as T,FitIcon as E,FolderIcon as D,ForkIcon as O,Forward10Icon as k,GearIcon as A,GlobeIcon as j,GridIcon as M,HandIcon as N,HelpIcon as P,HighlighterIcon as F,HomeIcon as I,IdCardIcon as L,ImageIcon as R,KebabIcon as z,LanguagesIcon as B,LightbulbIcon as V,ListIcon as H,LoaderIcon as U,LockIcon as W,MenuIcon as G,MessageIcon as K,MicIcon as q,MinusIcon as J,MonitorIcon as Y,NoteIcon as X,PaletteIcon as Z,PaperclipIcon as Q,PauseIcon as $,PinIcon as ee,PlayCircleIcon as te,PlayIcon as ne,PlusIcon as re,PointerIcon as ie,PuzzleIcon as ae,QuoteIcon as oe,RedoIcon as se,RefreshIcon as ce,RewindIcon as le,SearchIcon as ue,SendIcon as de,ServerIcon as fe,ShieldIcon as pe,ShrinkIcon as me,SidebarIcon as he,SlidersIcon as ge,SmartphoneIcon as _e,SparklesIcon as ve,StepBackIcon as ye,StepForwardIcon as be,StopIcon as xe,TargetIcon as Se,TaskIcon as Ce,TerminalIcon as we,TrashIcon as Te,UndoIcon as Ee,UnlockIcon as De,UserIcon as Oe,UsersIcon as ke,VolumeIcon as Ae,WorkflowIcon as je,WrenchIcon as Me}from"./src/icons/icons.mjs";import{cn as Ne}from"./src/lib/cn.mjs";import{Accordion as Pe,AccordionContent as Fe,AccordionItem as Ie,AccordionTrigger as Le}from"./src/components/Accordion.mjs";import{ansiSpans as Re}from"./src/lib/ansiSpans.mjs";import{AnsiLine as ze,AnsiText as Be}from"./src/components/AnsiText.mjs";import{Avatar as Ve,AvatarFallback as He,AvatarImage as Ue}from"./src/components/Avatar.mjs";import{Dot as We,dotVariants as Ge}from"./src/components/Dot.mjs";import{AgentAvatar as Ke,agentInitials as qe}from"./src/components/AgentAvatar.mjs";import{Badge as Je,badgeVariants as Ye}from"./src/components/Badge.mjs";import{Tooltip as Xe,TooltipContent as Ze,TooltipProvider as Qe,TooltipTrigger as $e}from"./src/components/Tooltip.mjs";import{BREADCRUMB_ELLIPSIS as et,Breadcrumb as tt,breadcrumbSegments as nt}from"./src/components/Breadcrumb.mjs";import{Spinner as rt}from"./src/components/Spinner.mjs";import{Button as it,buttonVariants as at}from"./src/components/Button.mjs";import{Dialog as ot,DialogBody as st,DialogClose as ct,DialogContent as lt,DialogDescription as ut,DialogFooter as dt,DialogHeader as ft,DialogTitle as pt,DialogTrigger as mt,dialogFooterVariants as ht}from"./src/components/Dialog.mjs";import{buildReviewPrompt as gt,defaultReviewHeading as _t,diffGutterWidth as vt,diffRangeOf as yt,reviewCommentAnchor as bt,trimSnippet as xt}from"./src/lib/review.mjs";import{DiffView as St}from"./src/components/DiffView.mjs";import{Drawer as Ct}from"./src/components/Drawer.mjs";import{DropdownMenu as wt,DropdownMenuCheckboxItem as Tt,DropdownMenuContent as Et,DropdownMenuGroup as Dt,DropdownMenuItem as Ot,DropdownMenuLabel as kt,DropdownMenuRadioGroup as At,DropdownMenuRadioItem as jt,DropdownMenuSeparator as Mt,DropdownMenuShortcut as Nt,DropdownMenuSub as Pt,DropdownMenuSubContent as Ft,DropdownMenuSubTrigger as It,DropdownMenuTrigger as Lt,dropdownMenuItemVariants as Rt}from"./src/components/DropdownMenu.mjs";import{Checkbox as zt}from"./src/components/Checkbox.mjs";import{grammarKeyOf as Bt}from"./src/lib/editorLanguage.mjs";import{markdownMediaReviewSlot as Vt}from"./src/lib/markdownMediaSlot.mjs";import{drawableImageUrl as Ht,markdownMediaReview as Ut,svgImageUrl as Wt}from"./src/lib/markdownMedia.mjs";import{detectGrammar as Gt,highlightToLines as Kt,syntaxStyleOf as qt}from"./src/lib/syntaxHighlight.mjs";import{SyntaxLine as Jt,SyntaxText as Yt,useSyntaxLines as Xt}from"./src/components/SyntaxText.mjs";import{CodeBlock as Zt}from"./src/components/CodeBlock.mjs";import{Skeleton as Qt}from"./src/components/Skeleton.mjs";import{CodeEditor as $t}from"./src/components/CodeEditor.mjs";import{Collapsible as en,CollapsibleContent as tn,CollapsibleTrigger as nn}from"./src/components/Collapsible.mjs";import{Input as rn,fieldVariants as an}from"./src/components/Input.mjs";import{MAX_DIGIT_SHORTCUT as on,handleOptionListKey as sn,optionListHint as cn,optionMarker as ln}from"./src/lib/optionList.mjs";import{OptionLabel as un,OptionList as dn,OptionRow as fn,optionListVariants as pn,optionMarkerVariants as mn,optionRowVariants as hn}from"./src/components/OptionList.mjs";import{CommandDialog as gn,CommandEmpty as _n,CommandFooter as vn,CommandGroup as yn,CommandGroupLabel as bn,CommandHeader as xn,CommandInput as Sn,CommandItem as Cn,CommandItemLabel as wn,CommandList as Tn}from"./src/components/Command.mjs";import{Panel as En,PanelBody as Dn,PanelHeader as On}from"./src/components/Panel.mjs";import{CtaCard as kn}from"./src/components/CtaCard.mjs";import{EmptyState as An}from"./src/components/EmptyState.mjs";import{LoadingState as jn}from"./src/components/LoadingState.mjs";import{ageLabel as Mn,fileAssetPath as Nn,fileKind as Pn,filePreviewMode as Fn,fileTree as In,filterFiles as Ln,isFileLayout as Rn,modifiedLabel as zn,newestFiles as Bn,sizeLabel as Vn,sortFiles as Hn}from"./src/lib/files.mjs";import{NavTab as Un,NavTabBadge as Wn,Tabs as Gn,TabsContent as Kn,TabsList as qn,TabsTrigger as Jn,tabBadgeVariants as Yn,tabVariants as Xn}from"./src/components/Tabs.mjs";import{DEFAULT_FILE_BROWSER_FILTERS as Zn,FileAge as Qn,FileBrowser as $n}from"./src/components/FileBrowser.mjs";import{MediaViewerDialog as er,PanZoom as tr}from"./src/components/MediaViewerDialog.mjs";import{Markdown as nr}from"./src/components/Markdown.mjs";import{FilePreview as rr}from"./src/components/FilePreview.mjs";import{boundedFileSource as ir,rangedFileBlob as ar,readMediaBytes as or}from"./src/lib/fileDownload.mjs";import{FlowGraph as sr}from"./src/components/FlowGraph.mjs";import{hashlineGroups as cr,hashlineGroupsKey as lr}from"./src/lib/hashlineHighlight.mjs";import{HashlineLines as ur}from"./src/components/HashlineLines.mjs";import{Kbd as dr}from"./src/components/Kbd.mjs";import{McpToolFields as fr,McpToolFrame as pr,McpToolOutput as mr}from"./src/components/McpToolWidget.mjs";import{Label as hr}from"./src/components/Label.mjs";import{ViewableImage as gr}from"./src/components/ViewableImage.mjs";import{mediaKindOf as _r}from"./src/lib/media.mjs";import{PdfPreview as vr,resolvePdfViewportRegion as yr}from"./src/components/PdfPreview.mjs";import{MediaPreview as br}from"./src/components/MediaPreview.mjs";import{STATUS_EDGE as xr,StatusBadge as Sr,statusBadgeVariants as Cr}from"./src/components/StatusBadge.mjs";import{MessageItem as wr,MessageItemBody as Tr,MessageItemGroup as Er,MessageItemHeader as Dr,MessageItemHeaderAccessoryContext as Or,MessageItemStatus as kr,STATUS_GLYPH as Ar,STATUS_LABEL as jr,messageItemRowVariants as Mr,messageItemStatusVariants as Nr,messageItemVariants as Pr,toolTone as Fr,useMessageItem as Ir}from"./src/components/MessageItem.mjs";import{MessageLines as Lr,messageLineVariants as Rr}from"./src/components/MessageLines.mjs";import{Popover as zr,PopoverAnchor as Br,PopoverClose as Vr,PopoverContent as Hr,PopoverFooter as Ur,PopoverHeader as Wr,PopoverTrigger as Gr}from"./src/components/Popover.mjs";import{PickerContent as Kr,PickerList as qr}from"./src/components/Picker.mjs";import{inlineProfileIcon as Jr,launchProfileChoice as Yr,parseProfileCatalog as Xr}from"./src/lib/profilePicker.mjs";import{ProfilePicker as Zr,useProfileCatalog as Qr}from"./src/components/ProfilePicker.mjs";import{clockRefreshMs as $r,clockText as ei,formatRunDuration as ti}from"./src/lib/runDuration.mjs";import{LiveDuration as ni}from"./src/components/LiveDuration.mjs";import{Progress as ri}from"./src/components/Progress.mjs";import{qrMatrix as ii}from"./src/lib/qrMatrix.mjs";import{QrCode as ai}from"./src/components/QrCode.mjs";import{RadioGroup as oi,RadioGroupCard as si,RadioGroupItem as ci}from"./src/components/RadioGroup.mjs";import{ReferenceChip as li}from"./src/components/ReferenceChip.mjs";import{Textarea as ui}from"./src/components/Textarea.mjs";import{ReviewCommentDraft as di}from"./src/components/ReviewCommentDraft.mjs";import{ScrollArea as fi,ScrollBar as pi}from"./src/components/ScrollArea.mjs";import{SectionLabel as mi}from"./src/components/SectionLabel.mjs";import{Select as hi,SelectContent as gi,SelectGroup as _i,SelectItem as vi,SelectLabel as yi,SelectSeparator as bi,SelectTrigger as xi,SelectValue as Si}from"./src/components/Select.mjs";import{Separator as Ci}from"./src/components/Separator.mjs";import{SettingsActions as wi,SettingsCard as Ti,SettingsDescription as Ei,SettingsField as Di,SettingsHeader as Oi,SettingsNote as ki,SettingsPage as Ai,SettingsRow as ji,SettingsRowDescription as Mi,SettingsRowText as Ni,SettingsRowTitle as Pi,SettingsSection as Fi,SettingsSectionDescription as Ii,SettingsSectionHeader as Li,SettingsSectionTitle as Ri,SettingsTitle as zi}from"./src/components/Settings.mjs";import{SetupRow as Bi}from"./src/components/SetupRow.mjs";import{Sheet as Vi,SheetBody as Hi,SheetClose as Ui,SheetContent as Wi,SheetDescription as Gi,SheetFooter as Ki,SheetHeader as qi,SheetOverlay as Ji,SheetTitle as Yi,SheetTrigger as Xi}from"./src/components/Sheet.mjs";import{StreamCursor as Zi}from"./src/components/StreamCursor.mjs";import{Switch as Qi}from"./src/components/Switch.mjs";import{TerminalView as $i}from"./src/components/TerminalView.mjs";import{Toast as ea,ToastAction as ta,ToastClose as na,ToastDescription as ra,ToastProvider as ia,ToastTitle as aa,ToastViewport as oa,toastVariants as sa}from"./src/components/Toast.mjs";import{PathText as ca}from"./src/components/PathText.mjs";import{ToolPathLink as la}from"./src/components/ToolPathLink.mjs";import{collapseLines as ua}from"./src/lib/collapse.mjs";import{GREP_COLLAPSED_LINES as da,READ_COLLAPSED_LINES as fa,compactDetails as pa,hashlineBody as ma,parseFileHeader as ha,parseTaggedLine as ga,presentHashlineLines as _a,resultTextLines as va,takeTrailingNotice as ya}from"./src/lib/hashlineView.mjs";import{groupByDirectory as ba,groupRowLabel as xa}from"./src/lib/pathGroups.mjs";import{CHIP_TO_STATUS as Sa,LINE_TONE_TO_STATUS as Ca,STATUS_TO_CHIP as wa,STATUS_TO_DOT as Ta}from"./src/lib/tone.mjs";import{MEDIA_KINDS as Ea}from"./src/types/editor.mjs";import{ACCENT_TONES as Da,CHIP_TONES as Oa,DOT_TONES as ka,MESSAGE_LINE_TONES as Aa,STATUS_TONES as ja}from"./src/types/tone.mjs";export{Da as ACCENT_TONES,Pe as Accordion,Fe as AccordionContent,Ie as AccordionItem,Le as AccordionTrigger,e as ActivityIcon,Ke as AgentAvatar,t as AlertIcon,ze as AnsiLine,Be as AnsiText,n as AppWindowIcon,r as ArrowLeftIcon,i as ArrowRightIcon,a as ArrowUpRightIcon,o as AudioLinesIcon,Ve as Avatar,He as AvatarFallback,Ue as AvatarImage,et as BREADCRUMB_ELLIPSIS,s as Back10Icon,Je as Badge,c as BellIcon,l as BookmarkPlusIcon,u as BoxIcon,d as BranchIcon,tt as Breadcrumb,it as Button,Oa as CHIP_TONES,Sa as CHIP_TO_STATUS,f as CalendarIcon,p as CheckIcon,zt as Checkbox,m as ChevronDownIcon,h as ChevronRightIcon,g as ChevronUpIcon,_ as CloseIcon,Zt as CodeBlock,$t as CodeEditor,en as Collapsible,tn as CollapsibleContent,nn as CollapsibleTrigger,gn as CommandDialog,_n as CommandEmpty,vn as CommandFooter,yn as CommandGroup,bn as CommandGroupLabel,xn as CommandHeader,Sn as CommandInput,Cn as CommandItem,wn as CommandItemLabel,Tn as CommandList,v as ConnectorIcon,y as CopyIcon,kn as CtaCard,Zn as DEFAULT_FILE_BROWSER_FILTERS,ka as DOT_TONES,ot as Dialog,st as DialogBody,ct as DialogClose,lt as DialogContent,ut as DialogDescription,dt as DialogFooter,ft as DialogHeader,pt as DialogTitle,mt as DialogTrigger,St as DiffView,We as Dot,b as DownloadIcon,Ct as Drawer,wt as DropdownMenu,Tt as DropdownMenuCheckboxItem,Et as DropdownMenuContent,Dt as DropdownMenuGroup,Ot as DropdownMenuItem,kt as DropdownMenuLabel,At as DropdownMenuRadioGroup,jt as DropdownMenuRadioItem,Mt as DropdownMenuSeparator,Nt as DropdownMenuShortcut,Pt as DropdownMenuSub,Ft as DropdownMenuSubContent,It as DropdownMenuSubTrigger,Lt as DropdownMenuTrigger,x as EditIcon,An as EmptyState,S as EnterIcon,C as EraserIcon,w as ExternalLinkIcon,Qn as FileAge,$n as FileBrowser,T as FileIcon,rr as FilePreview,E as FitIcon,sr as FlowGraph,D as FolderIcon,O as ForkIcon,k as Forward10Icon,da as GREP_COLLAPSED_LINES,A as GearIcon,j as GlobeIcon,M as GridIcon,N as HandIcon,ur as HashlineLines,P as HelpIcon,F as HighlighterIcon,I as HomeIcon,L as IdCardIcon,R as ImageIcon,rn as Input,dr as Kbd,z as KebabIcon,Ca as LINE_TONE_TO_STATUS,hr as Label,B as LanguagesIcon,V as LightbulbIcon,H as ListIcon,ni as LiveDuration,U as LoaderIcon,jn as LoadingState,W as LockIcon,on as MAX_DIGIT_SHORTCUT,Ea as MEDIA_KINDS,Aa as MESSAGE_LINE_TONES,nr as Markdown,fr as McpToolFields,pr as McpToolFrame,mr as McpToolOutput,br as MediaPreview,er as MediaViewerDialog,G as MenuIcon,K as MessageIcon,wr as MessageItem,Tr as MessageItemBody,Er as MessageItemGroup,Dr as MessageItemHeader,Or as MessageItemHeaderAccessoryContext,kr as MessageItemStatus,Lr as MessageLines,q as MicIcon,J as MinusIcon,Y as MonitorIcon,Un as NavTab,Wn as NavTabBadge,X as NoteIcon,un as OptionLabel,dn as OptionList,fn as OptionRow,Z as PaletteIcon,tr as PanZoom,En as Panel,Dn as PanelBody,On as PanelHeader,Q as PaperclipIcon,ca as PathText,$ as PauseIcon,vr as PdfPreview,Kr as PickerContent,qr as PickerList,ee as PinIcon,te as PlayCircleIcon,ne as PlayIcon,re as PlusIcon,ie as PointerIcon,zr as Popover,Br as PopoverAnchor,Vr as PopoverClose,Hr as PopoverContent,Ur as PopoverFooter,Wr as PopoverHeader,Gr as PopoverTrigger,Zr as ProfilePicker,ri as Progress,ae as PuzzleIcon,ai as QrCode,oe as QuoteIcon,fa as READ_COLLAPSED_LINES,oi as RadioGroup,si as RadioGroupCard,ci as RadioGroupItem,se as RedoIcon,li as ReferenceChip,ce as RefreshIcon,di as ReviewCommentDraft,le as RewindIcon,xr as STATUS_EDGE,Ar as STATUS_GLYPH,jr as STATUS_LABEL,ja as STATUS_TONES,wa as STATUS_TO_CHIP,Ta as STATUS_TO_DOT,fi as ScrollArea,pi as ScrollBar,ue as SearchIcon,mi as SectionLabel,hi as Select,gi as SelectContent,_i as SelectGroup,vi as SelectItem,yi as SelectLabel,bi as SelectSeparator,xi as SelectTrigger,Si as SelectValue,de as SendIcon,Ci as Separator,fe as ServerIcon,wi as SettingsActions,Ti as SettingsCard,Ei as SettingsDescription,Di as SettingsField,Oi as SettingsHeader,ki as SettingsNote,Ai as SettingsPage,ji as SettingsRow,Mi as SettingsRowDescription,Ni as SettingsRowText,Pi as SettingsRowTitle,Fi as SettingsSection,Ii as SettingsSectionDescription,Li as SettingsSectionHeader,Ri as SettingsSectionTitle,zi as SettingsTitle,Bi as SetupRow,Vi as Sheet,Hi as SheetBody,Ui as SheetClose,Wi as SheetContent,Gi as SheetDescription,Ki as SheetFooter,qi as SheetHeader,Ji as SheetOverlay,Yi as SheetTitle,Xi as SheetTrigger,pe as ShieldIcon,me as ShrinkIcon,he as SidebarIcon,Qt as Skeleton,ge as SlidersIcon,_e as SmartphoneIcon,ve as SparklesIcon,rt as Spinner,Sr as StatusBadge,ye as StepBackIcon,be as StepForwardIcon,xe as StopIcon,Zi as StreamCursor,Qi as Switch,Jt as SyntaxLine,Yt as SyntaxText,Gn as Tabs,Kn as TabsContent,qn as TabsList,Jn as TabsTrigger,Se as TargetIcon,Ce as TaskIcon,we as TerminalIcon,$i as TerminalView,ui as Textarea,ea as Toast,ta as ToastAction,na as ToastClose,ra as ToastDescription,ia as ToastProvider,aa as ToastTitle,oa as ToastViewport,la as ToolPathLink,Xe as Tooltip,Ze as TooltipContent,Qe as TooltipProvider,$e as TooltipTrigger,Te as TrashIcon,Ee as UndoIcon,De as UnlockIcon,Oe as UserIcon,ke as UsersIcon,gr as ViewableImage,Ae as VolumeIcon,je as WorkflowIcon,Me as WrenchIcon,Mn as ageLabel,qe as agentInitials,Re as ansiSpans,Ye as badgeVariants,ir as boundedFileSource,nt as breadcrumbSegments,gt as buildReviewPrompt,at as buttonVariants,$r as clockRefreshMs,ei as clockText,Ne as cn,ua as collapseLines,pa as compactDetails,_t as defaultReviewHeading,Gt as detectGrammar,ht as dialogFooterVariants,vt as diffGutterWidth,yt as diffRangeOf,Ge as dotVariants,Ht as drawableImageUrl,Rt as dropdownMenuItemVariants,an as fieldVariants,Nn as fileAssetPath,Pn as fileKind,Fn as filePreviewMode,In as fileTree,Ln as filterFiles,ti as formatRunDuration,Bt as grammarKeyOf,ba as groupByDirectory,xa as groupRowLabel,sn as handleOptionListKey,ma as hashlineBody,cr as hashlineGroups,lr as hashlineGroupsKey,Kt as highlightToLines,Jr as inlineProfileIcon,Rn as isFileLayout,Yr as launchProfileChoice,Ut as markdownMediaReview,Vt as markdownMediaReviewSlot,_r as mediaKindOf,Mr as messageItemRowVariants,Nr as messageItemStatusVariants,Pr as messageItemVariants,Rr as messageLineVariants,zn as modifiedLabel,Bn as newestFiles,cn as optionListHint,pn as optionListVariants,ln as optionMarker,mn as optionMarkerVariants,hn as optionRowVariants,ha as parseFileHeader,Xr as parseProfileCatalog,ga as parseTaggedLine,_a as presentHashlineLines,ii as qrMatrix,ar as rangedFileBlob,or as readMediaBytes,yr as resolvePdfViewportRegion,va as resultTextLines,bt as reviewCommentAnchor,Vn as sizeLabel,Hn as sortFiles,Cr as statusBadgeVariants,Wt as svgImageUrl,qt as syntaxStyleOf,Yn as tabBadgeVariants,Xn as tabVariants,ya as takeTrailingNotice,sa as toastVariants,Fr as toolTone,xt as trimSnippet,Ir as useMessageItem,Qr as useProfileCatalog,Xt as useSyntaxLines};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"platformRequirements":{},"sourceFiles":["LICENSE","NOTICE","README.md","llms.txt","locales/vi.json","locales/zh-CN.json","package.json","src/components/Accordion.stories.tsx","src/components/Accordion.tsx","src/components/AgentAvatar.stories.tsx","src/components/AgentAvatar.tsx","src/components/AnsiText.stories.tsx","src/components/AnsiText.tsx","src/components/Avatar.stories.tsx","src/components/Avatar.tsx","src/components/Badge.stories.tsx","src/components/Badge.tsx","src/components/BrandPalette.stories.tsx","src/components/Breadcrumb.stories.tsx","src/components/Breadcrumb.tsx","src/components/Button.stories.tsx","src/components/Button.tsx","src/components/Checkbox.stories.tsx","src/components/Checkbox.tsx","src/components/CodeBlock.stories.tsx","src/components/CodeBlock.tsx","src/components/CodeEditor.stories.tsx","src/components/CodeEditor.tsx","src/components/CodeEditorView.stories.tsx","src/components/CodeEditorView.tsx","src/components/Collapsible.stories.tsx","src/components/Collapsible.tsx","src/components/Command.stories.tsx","src/components/Command.tsx","src/components/CopyButton.stories.tsx","src/components/CopyButton.tsx","src/components/CtaCard.stories.tsx","src/components/CtaCard.tsx","src/components/Dialog.stories.tsx","src/components/Dialog.tsx","src/components/DiffView.stories.tsx","src/components/DiffView.tsx","src/components/Dot.stories.tsx","src/components/Dot.tsx","src/components/Drawer.stories.tsx","src/components/Drawer.tsx","src/components/DropdownMenu.stories.tsx","src/components/DropdownMenu.tsx","src/components/EmptyState.stories.tsx","src/components/EmptyState.tsx","src/components/FileBrowser.stories.tsx","src/components/FileBrowser.tsx","src/components/FilePreview.stories.tsx","src/components/FilePreview.tsx","src/components/FlowGraph.stories.tsx","src/components/FlowGraph.tsx","src/components/HashlineLines.stories.tsx","src/components/HashlineLines.tsx","src/components/Input.stories.tsx","src/components/Input.tsx","src/components/Kbd.stories.tsx","src/components/Kbd.tsx","src/components/Label.stories.tsx","src/components/Label.tsx","src/components/LiveDuration.tsx","src/components/LoadingState.stories.tsx","src/components/LoadingState.tsx","src/components/Markdown.stories.tsx","src/components/Markdown.tsx","src/components/McpApp.tsx","src/components/McpToolWidget.stories.tsx","src/components/McpToolWidget.tsx","src/components/MediaPreview.stories.tsx","src/components/MediaPreview.tsx","src/components/MediaViewerDialog.stories.tsx","src/components/MediaViewerDialog.tsx","src/components/MermaidDiagram.stories.tsx","src/components/MermaidDiagram.tsx","src/components/MessageItem.stories.tsx","src/components/MessageItem.tsx","src/components/MessageLines.stories.tsx","src/components/MessageLines.tsx","src/components/OptionList.stories.tsx","src/components/OptionList.tsx","src/components/Panel.stories.tsx","src/components/Panel.tsx","src/components/PathText.stories.tsx","src/components/PathText.tsx","src/components/PdfPreview.stories.tsx","src/components/PdfPreview.tsx","src/components/Picker.stories.tsx","src/components/Picker.tsx","src/components/Popover.stories.tsx","src/components/Popover.tsx","src/components/ProfilePicker.stories.tsx","src/components/ProfilePicker.tsx","src/components/Progress.stories.tsx","src/components/Progress.tsx","src/components/QrCode.stories.tsx","src/components/QrCode.tsx","src/components/RadioGroup.stories.tsx","src/components/RadioGroup.tsx","src/components/ReferenceChip.stories.tsx","src/components/ReferenceChip.tsx","src/components/ReviewCommentDraft.stories.tsx","src/components/ReviewCommentDraft.tsx","src/components/ScrollArea.stories.tsx","src/components/ScrollArea.tsx","src/components/SectionLabel.stories.tsx","src/components/SectionLabel.tsx","src/components/Select.stories.tsx","src/components/Select.tsx","src/components/Separator.stories.tsx","src/components/Separator.tsx","src/components/Settings.tsx","src/components/SetupRow.stories.tsx","src/components/SetupRow.tsx","src/components/Sheet.stories.tsx","src/components/Sheet.tsx","src/components/Skeleton.stories.tsx","src/components/Skeleton.tsx","src/components/Spinner.stories.tsx","src/components/Spinner.tsx","src/components/StatusBadge.stories.tsx","src/components/StatusBadge.tsx","src/components/StreamCursor.stories.tsx","src/components/StreamCursor.tsx","src/components/Switch.stories.tsx","src/components/Switch.tsx","src/components/SyntaxText.stories.tsx","src/components/SyntaxText.tsx","src/components/Tabs.stories.tsx","src/components/Tabs.tsx","src/components/TerminalView.stories.tsx","src/components/TerminalView.tsx","src/components/Textarea.stories.tsx","src/components/Textarea.tsx","src/components/Toast.stories.tsx","src/components/Toast.tsx","src/components/ToolPathLink.stories.tsx","src/components/ToolPathLink.tsx","src/components/Tooltip.stories.tsx","src/components/Tooltip.tsx","src/components/ViewableImage.stories.tsx","src/components/ViewableImage.tsx","src/exports/index.ts","src/exports/markdownMediaSlot.ts","src/exports/mcpAppHost.ts","src/exports/mcpWidget.ts","src/exports/nativeTheme.ts","src/exports/text.ts","src/exports/theme.ts","src/icons/icons.ts","src/lib/ansiSpans.ts","src/lib/cn.ts","src/lib/collapse.ts","src/lib/editorController.ts","src/lib/editorLanguage.ts","src/lib/editorTheme.ts","src/lib/fenceGrammar.ts","src/lib/fileDownload.ts","src/lib/files.ts","src/lib/hashlineHighlight.ts","src/lib/hashlineView.ts","src/lib/markdownMedia.ts","src/lib/markdownMediaSlot.ts","src/lib/markdownReferences.ts","src/lib/mcpAppFrame.ts","src/lib/mcpAppSandbox.ts","src/lib/mcpOpenAiBootstrap.ts","src/lib/media.ts","src/lib/mediaPlayback.ts","src/lib/mermaidDiagram.ts","src/lib/optionList.ts","src/lib/pathGroups.ts","src/lib/picker.ts","src/lib/profilePicker.ts","src/lib/qrMatrix.ts","src/lib/review.ts","src/lib/runDuration.ts","src/lib/syntaxHighlight.ts","src/lib/tone.ts","src/theme/apply.ts","src/theme/builtinThemes.ts","src/theme/derive.ts","src/theme/nativeTheme.ts","src/theme/parse.ts","src/theme/piTheme.ts","src/theme/preference.ts","src/types/diff.ts","src/types/editor.ts","src/types/theme.ts","src/types/tone.ts","styles/mcp.css","styles/preview.css","styles/theme.css","styles/tokens.css","themes/po-nord-dark.json","themes/po-one-light.json","tsdown.config.ts"],"sourceRevision":"8438aa514965b90f69ead861179071bd","manifestRevision":"5c0e3fe1eaaaa9dd909b80abab194cdc","outputFiles":["LICENSE","NOTICE","README.md","dist/_virtual/_rolldown/runtime.cjs","dist/index.cjs","dist/index.mjs","dist/markdownMediaSlot.cjs","dist/markdownMediaSlot.mjs","dist/mcpAppHost.cjs","dist/mcpAppHost.mjs","dist/mcpWidget.cjs","dist/mcpWidget.mjs","dist/nativeTheme.cjs","dist/nativeTheme.mjs","dist/src/components/Accordion.cjs","dist/src/components/Accordion.mjs","dist/src/components/AgentAvatar.cjs","dist/src/components/AgentAvatar.mjs","dist/src/components/AnsiText.cjs","dist/src/components/AnsiText.mjs","dist/src/components/Avatar.cjs","dist/src/components/Avatar.mjs","dist/src/components/Badge.cjs","dist/src/components/Badge.mjs","dist/src/components/Breadcrumb.cjs","dist/src/components/Breadcrumb.mjs","dist/src/components/Button.cjs","dist/src/components/Button.mjs","dist/src/components/Checkbox.cjs","dist/src/components/Checkbox.mjs","dist/src/components/CodeBlock.cjs","dist/src/components/CodeBlock.mjs","dist/src/components/CodeEditor.cjs","dist/src/components/CodeEditor.mjs","dist/src/components/CodeEditorView.cjs","dist/src/components/CodeEditorView.mjs","dist/src/components/Collapsible.cjs","dist/src/components/Collapsible.mjs","dist/src/components/Command.cjs","dist/src/components/Command.mjs","dist/src/components/CopyButton.cjs","dist/src/components/CopyButton.mjs","dist/src/components/CtaCard.cjs","dist/src/components/CtaCard.mjs","dist/src/components/Dialog.cjs","dist/src/components/Dialog.mjs","dist/src/components/DiffView.cjs","dist/src/components/DiffView.mjs","dist/src/components/Dot.cjs","dist/src/components/Dot.mjs","dist/src/components/Drawer.cjs","dist/src/components/Drawer.mjs","dist/src/components/DropdownMenu.cjs","dist/src/components/DropdownMenu.mjs","dist/src/components/EmptyState.cjs","dist/src/components/EmptyState.mjs","dist/src/components/FileBrowser.cjs","dist/src/components/FileBrowser.mjs","dist/src/components/FilePreview.cjs","dist/src/components/FilePreview.mjs","dist/src/components/FlowGraph.cjs","dist/src/components/FlowGraph.mjs","dist/src/components/HashlineLines.cjs","dist/src/components/HashlineLines.mjs","dist/src/components/Input.cjs","dist/src/components/Input.mjs","dist/src/components/Kbd.cjs","dist/src/components/Kbd.mjs","dist/src/components/Label.cjs","dist/src/components/Label.mjs","dist/src/components/LiveDuration.cjs","dist/src/components/LiveDuration.mjs","dist/src/components/LoadingState.cjs","dist/src/components/LoadingState.mjs","dist/src/components/Markdown.cjs","dist/src/components/Markdown.mjs","dist/src/components/McpApp.cjs","dist/src/components/McpApp.mjs","dist/src/components/McpToolWidget.cjs","dist/src/components/McpToolWidget.mjs","dist/src/components/MediaPreview.cjs","dist/src/components/MediaPreview.mjs","dist/src/components/MediaViewerDialog.cjs","dist/src/components/MediaViewerDialog.mjs","dist/src/components/MermaidDiagram.cjs","dist/src/components/MermaidDiagram.mjs","dist/src/components/MessageItem.cjs","dist/src/components/MessageItem.mjs","dist/src/components/MessageLines.cjs","dist/src/components/MessageLines.mjs","dist/src/components/OptionList.cjs","dist/src/components/OptionList.mjs","dist/src/components/Panel.cjs","dist/src/components/Panel.mjs","dist/src/components/PathText.cjs","dist/src/components/PathText.mjs","dist/src/components/PdfPreview.cjs","dist/src/components/PdfPreview.mjs","dist/src/components/Picker.cjs","dist/src/components/Picker.mjs","dist/src/components/Popover.cjs","dist/src/components/Popover.mjs","dist/src/components/ProfilePicker.cjs","dist/src/components/ProfilePicker.mjs","dist/src/components/Progress.cjs","dist/src/components/Progress.mjs","dist/src/components/QrCode.cjs","dist/src/components/QrCode.mjs","dist/src/components/RadioGroup.cjs","dist/src/components/RadioGroup.mjs","dist/src/components/ReferenceChip.cjs","dist/src/components/ReferenceChip.mjs","dist/src/components/ReviewCommentDraft.cjs","dist/src/components/ReviewCommentDraft.mjs","dist/src/components/ScrollArea.cjs","dist/src/components/ScrollArea.mjs","dist/src/components/SectionLabel.cjs","dist/src/components/SectionLabel.mjs","dist/src/components/Select.cjs","dist/src/components/Select.mjs","dist/src/components/Separator.cjs","dist/src/components/Separator.mjs","dist/src/components/Settings.cjs","dist/src/components/Settings.mjs","dist/src/components/SetupRow.cjs","dist/src/components/SetupRow.mjs","dist/src/components/Sheet.cjs","dist/src/components/Sheet.mjs","dist/src/components/Skeleton.cjs","dist/src/components/Skeleton.mjs","dist/src/components/Spinner.cjs","dist/src/components/Spinner.mjs","dist/src/components/StatusBadge.cjs","dist/src/components/StatusBadge.mjs","dist/src/components/StreamCursor.cjs","dist/src/components/StreamCursor.mjs","dist/src/components/Switch.cjs","dist/src/components/Switch.mjs","dist/src/components/SyntaxText.cjs","dist/src/components/SyntaxText.mjs","dist/src/components/Tabs.cjs","dist/src/components/Tabs.mjs","dist/src/components/TerminalView.cjs","dist/src/components/TerminalView.mjs","dist/src/components/Textarea.cjs","dist/src/components/Textarea.mjs","dist/src/components/Toast.cjs","dist/src/components/Toast.mjs","dist/src/components/ToolPathLink.cjs","dist/src/components/ToolPathLink.mjs","dist/src/components/Tooltip.cjs","dist/src/components/Tooltip.mjs","dist/src/components/ViewableImage.cjs","dist/src/components/ViewableImage.mjs","dist/src/icons/icons.cjs","dist/src/icons/icons.mjs","dist/src/lib/ansiSpans.cjs","dist/src/lib/ansiSpans.mjs","dist/src/lib/cn.cjs","dist/src/lib/cn.mjs","dist/src/lib/collapse.cjs","dist/src/lib/collapse.mjs","dist/src/lib/editorController.cjs","dist/src/lib/editorController.mjs","dist/src/lib/editorLanguage.cjs","dist/src/lib/editorLanguage.mjs","dist/src/lib/editorTheme.cjs","dist/src/lib/editorTheme.mjs","dist/src/lib/fenceGrammar.cjs","dist/src/lib/fenceGrammar.mjs","dist/src/lib/fileDownload.cjs","dist/src/lib/fileDownload.mjs","dist/src/lib/files.cjs","dist/src/lib/files.mjs","dist/src/lib/hashlineHighlight.cjs","dist/src/lib/hashlineHighlight.mjs","dist/src/lib/hashlineView.cjs","dist/src/lib/hashlineView.mjs","dist/src/lib/markdownMedia.cjs","dist/src/lib/markdownMedia.mjs","dist/src/lib/markdownMediaSlot.cjs","dist/src/lib/markdownMediaSlot.mjs","dist/src/lib/markdownReferences.cjs","dist/src/lib/markdownReferences.mjs","dist/src/lib/mcpAppFrame.cjs","dist/src/lib/mcpAppFrame.mjs","dist/src/lib/mcpAppSandbox.cjs","dist/src/lib/mcpAppSandbox.mjs","dist/src/lib/mcpOpenAiBootstrap.cjs","dist/src/lib/mcpOpenAiBootstrap.mjs","dist/src/lib/media.cjs","dist/src/lib/media.mjs","dist/src/lib/mediaPlayback.cjs","dist/src/lib/mediaPlayback.mjs","dist/src/lib/mermaidDiagram.cjs","dist/src/lib/mermaidDiagram.mjs","dist/src/lib/optionList.cjs","dist/src/lib/optionList.mjs","dist/src/lib/pathGroups.cjs","dist/src/lib/pathGroups.mjs","dist/src/lib/picker.cjs","dist/src/lib/picker.mjs","dist/src/lib/profilePicker.cjs","dist/src/lib/profilePicker.mjs","dist/src/lib/qrMatrix.cjs","dist/src/lib/qrMatrix.mjs","dist/src/lib/review.cjs","dist/src/lib/review.mjs","dist/src/lib/runDuration.cjs","dist/src/lib/runDuration.mjs","dist/src/lib/syntaxHighlight.cjs","dist/src/lib/syntaxHighlight.mjs","dist/src/lib/tone.cjs","dist/src/lib/tone.mjs","dist/src/theme/apply.cjs","dist/src/theme/apply.mjs","dist/src/theme/builtinThemes.cjs","dist/src/theme/builtinThemes.mjs","dist/src/theme/derive.cjs","dist/src/theme/derive.mjs","dist/src/theme/nativeTheme.cjs","dist/src/theme/nativeTheme.mjs","dist/src/theme/parse.cjs","dist/src/theme/parse.mjs","dist/src/theme/piTheme.cjs","dist/src/theme/piTheme.mjs","dist/src/theme/preference.cjs","dist/src/theme/preference.mjs","dist/src/types/editor.cjs","dist/src/types/editor.mjs","dist/src/types/theme.cjs","dist/src/types/theme.mjs","dist/src/types/tone.cjs","dist/src/types/tone.mjs","dist/text.cjs","dist/text.mjs","dist/theme.cjs","dist/theme.mjs","dist/themes/po-nord-dark.cjs","dist/themes/po-nord-dark.mjs","dist/themes/po-one-light.cjs","dist/themes/po-one-light.mjs","llms.txt","locales/vi.json","locales/zh-CN.json","styles/mcp.css","styles/preview.css","styles/theme.css","styles/tokens.css","themes/po-nord-dark.json","themes/po-one-light.json"],"outputRevision":"c76396b5241b566859453fd30b35c430"}
|
|
1
|
+
{"version":1,"platformRequirements":{},"sourceFiles":["LICENSE","NOTICE","README.md","llms.txt","locales/vi.json","locales/zh-CN.json","package.json","src/components/Accordion.stories.tsx","src/components/Accordion.tsx","src/components/AgentAvatar.stories.tsx","src/components/AgentAvatar.tsx","src/components/AnsiText.stories.tsx","src/components/AnsiText.tsx","src/components/Avatar.stories.tsx","src/components/Avatar.tsx","src/components/Badge.stories.tsx","src/components/Badge.tsx","src/components/BrandPalette.stories.tsx","src/components/Breadcrumb.stories.tsx","src/components/Breadcrumb.tsx","src/components/Button.stories.tsx","src/components/Button.tsx","src/components/Checkbox.stories.tsx","src/components/Checkbox.tsx","src/components/CodeBlock.stories.tsx","src/components/CodeBlock.tsx","src/components/CodeEditor.stories.tsx","src/components/CodeEditor.tsx","src/components/CodeEditorView.stories.tsx","src/components/CodeEditorView.tsx","src/components/Collapsible.stories.tsx","src/components/Collapsible.tsx","src/components/Command.stories.tsx","src/components/Command.tsx","src/components/CopyButton.stories.tsx","src/components/CopyButton.tsx","src/components/CtaCard.stories.tsx","src/components/CtaCard.tsx","src/components/Dialog.stories.tsx","src/components/Dialog.tsx","src/components/DiffView.stories.tsx","src/components/DiffView.tsx","src/components/Dot.stories.tsx","src/components/Dot.tsx","src/components/Drawer.stories.tsx","src/components/Drawer.tsx","src/components/DropdownMenu.stories.tsx","src/components/DropdownMenu.tsx","src/components/EmptyState.stories.tsx","src/components/EmptyState.tsx","src/components/FileBrowser.stories.tsx","src/components/FileBrowser.tsx","src/components/FilePreview.stories.tsx","src/components/FilePreview.tsx","src/components/FlowGraph.stories.tsx","src/components/FlowGraph.tsx","src/components/HashlineLines.stories.tsx","src/components/HashlineLines.tsx","src/components/Input.stories.tsx","src/components/Input.tsx","src/components/Kbd.stories.tsx","src/components/Kbd.tsx","src/components/Label.stories.tsx","src/components/Label.tsx","src/components/LiveDuration.tsx","src/components/LoadingState.stories.tsx","src/components/LoadingState.tsx","src/components/Markdown.stories.tsx","src/components/Markdown.tsx","src/components/McpApp.tsx","src/components/McpToolWidget.stories.tsx","src/components/McpToolWidget.tsx","src/components/MediaPreview.stories.tsx","src/components/MediaPreview.tsx","src/components/MediaViewerDialog.stories.tsx","src/components/MediaViewerDialog.tsx","src/components/MermaidDiagram.stories.tsx","src/components/MermaidDiagram.tsx","src/components/MessageItem.stories.tsx","src/components/MessageItem.tsx","src/components/MessageLines.stories.tsx","src/components/MessageLines.tsx","src/components/OptionList.stories.tsx","src/components/OptionList.tsx","src/components/Panel.stories.tsx","src/components/Panel.tsx","src/components/PathText.stories.tsx","src/components/PathText.tsx","src/components/PdfPreview.stories.tsx","src/components/PdfPreview.tsx","src/components/Picker.stories.tsx","src/components/Picker.tsx","src/components/Popover.stories.tsx","src/components/Popover.tsx","src/components/ProfilePicker.stories.tsx","src/components/ProfilePicker.tsx","src/components/Progress.stories.tsx","src/components/Progress.tsx","src/components/QrCode.stories.tsx","src/components/QrCode.tsx","src/components/RadioGroup.stories.tsx","src/components/RadioGroup.tsx","src/components/ReferenceChip.stories.tsx","src/components/ReferenceChip.tsx","src/components/ReviewCommentDraft.stories.tsx","src/components/ReviewCommentDraft.tsx","src/components/ScrollArea.stories.tsx","src/components/ScrollArea.tsx","src/components/SectionLabel.stories.tsx","src/components/SectionLabel.tsx","src/components/Select.stories.tsx","src/components/Select.tsx","src/components/Separator.stories.tsx","src/components/Separator.tsx","src/components/Settings.tsx","src/components/SetupRow.stories.tsx","src/components/SetupRow.tsx","src/components/Sheet.stories.tsx","src/components/Sheet.tsx","src/components/Skeleton.stories.tsx","src/components/Skeleton.tsx","src/components/Spinner.stories.tsx","src/components/Spinner.tsx","src/components/StatusBadge.stories.tsx","src/components/StatusBadge.tsx","src/components/StreamCursor.stories.tsx","src/components/StreamCursor.tsx","src/components/Switch.stories.tsx","src/components/Switch.tsx","src/components/SyntaxText.stories.tsx","src/components/SyntaxText.tsx","src/components/Tabs.stories.tsx","src/components/Tabs.tsx","src/components/TerminalView.stories.tsx","src/components/TerminalView.tsx","src/components/Textarea.stories.tsx","src/components/Textarea.tsx","src/components/Toast.stories.tsx","src/components/Toast.tsx","src/components/ToolPathLink.stories.tsx","src/components/ToolPathLink.tsx","src/components/Tooltip.stories.tsx","src/components/Tooltip.tsx","src/components/ViewableImage.stories.tsx","src/components/ViewableImage.tsx","src/exports/index.ts","src/exports/markdownMediaSlot.ts","src/exports/mcpAppHost.ts","src/exports/mcpWidget.ts","src/exports/nativeTheme.ts","src/exports/text.ts","src/exports/theme.ts","src/icons/icons.ts","src/lib/ansiSpans.ts","src/lib/cn.ts","src/lib/collapse.ts","src/lib/editorController.ts","src/lib/editorLanguage.ts","src/lib/editorTheme.ts","src/lib/fenceGrammar.ts","src/lib/fileDownload.ts","src/lib/files.ts","src/lib/hashlineHighlight.ts","src/lib/hashlineView.ts","src/lib/markdownMedia.ts","src/lib/markdownMediaSlot.ts","src/lib/markdownReferences.ts","src/lib/mcpAppFrame.ts","src/lib/mcpAppSandbox.ts","src/lib/mcpOpenAiBootstrap.ts","src/lib/media.ts","src/lib/mediaPlayback.ts","src/lib/mermaidDiagram.ts","src/lib/optionList.ts","src/lib/pathGroups.ts","src/lib/picker.ts","src/lib/profilePicker.ts","src/lib/qrMatrix.ts","src/lib/review.ts","src/lib/runDuration.ts","src/lib/syntaxHighlight.ts","src/lib/tone.ts","src/theme/apply.ts","src/theme/builtinThemes.ts","src/theme/derive.ts","src/theme/nativeTheme.ts","src/theme/parse.ts","src/theme/piTheme.ts","src/theme/preference.ts","src/types/diff.ts","src/types/editor.ts","src/types/theme.ts","src/types/tone.ts","styles/mcp.css","styles/preview.css","styles/theme.css","styles/tokens.css","themes/po-nord-dark.json","themes/po-one-light.json","tsdown.config.ts"],"sourceRevision":"6302b60ef3db9e144e6d272946e923d8","manifestRevision":"43164e31d72545cfbe09b709e8d2989f","outputFiles":["LICENSE","NOTICE","README.md","dist/_virtual/_rolldown/runtime.cjs","dist/index.cjs","dist/index.mjs","dist/markdownMediaSlot.cjs","dist/markdownMediaSlot.mjs","dist/mcpAppHost.cjs","dist/mcpAppHost.mjs","dist/mcpWidget.cjs","dist/mcpWidget.mjs","dist/nativeTheme.cjs","dist/nativeTheme.mjs","dist/src/components/Accordion.cjs","dist/src/components/Accordion.mjs","dist/src/components/AgentAvatar.cjs","dist/src/components/AgentAvatar.mjs","dist/src/components/AnsiText.cjs","dist/src/components/AnsiText.mjs","dist/src/components/Avatar.cjs","dist/src/components/Avatar.mjs","dist/src/components/Badge.cjs","dist/src/components/Badge.mjs","dist/src/components/Breadcrumb.cjs","dist/src/components/Breadcrumb.mjs","dist/src/components/Button.cjs","dist/src/components/Button.mjs","dist/src/components/Checkbox.cjs","dist/src/components/Checkbox.mjs","dist/src/components/CodeBlock.cjs","dist/src/components/CodeBlock.mjs","dist/src/components/CodeEditor.cjs","dist/src/components/CodeEditor.mjs","dist/src/components/CodeEditorView.cjs","dist/src/components/CodeEditorView.mjs","dist/src/components/Collapsible.cjs","dist/src/components/Collapsible.mjs","dist/src/components/Command.cjs","dist/src/components/Command.mjs","dist/src/components/CopyButton.cjs","dist/src/components/CopyButton.mjs","dist/src/components/CtaCard.cjs","dist/src/components/CtaCard.mjs","dist/src/components/Dialog.cjs","dist/src/components/Dialog.mjs","dist/src/components/DiffView.cjs","dist/src/components/DiffView.mjs","dist/src/components/Dot.cjs","dist/src/components/Dot.mjs","dist/src/components/Drawer.cjs","dist/src/components/Drawer.mjs","dist/src/components/DropdownMenu.cjs","dist/src/components/DropdownMenu.mjs","dist/src/components/EmptyState.cjs","dist/src/components/EmptyState.mjs","dist/src/components/FileBrowser.cjs","dist/src/components/FileBrowser.mjs","dist/src/components/FilePreview.cjs","dist/src/components/FilePreview.mjs","dist/src/components/FlowGraph.cjs","dist/src/components/FlowGraph.mjs","dist/src/components/HashlineLines.cjs","dist/src/components/HashlineLines.mjs","dist/src/components/Input.cjs","dist/src/components/Input.mjs","dist/src/components/Kbd.cjs","dist/src/components/Kbd.mjs","dist/src/components/Label.cjs","dist/src/components/Label.mjs","dist/src/components/LiveDuration.cjs","dist/src/components/LiveDuration.mjs","dist/src/components/LoadingState.cjs","dist/src/components/LoadingState.mjs","dist/src/components/Markdown.cjs","dist/src/components/Markdown.mjs","dist/src/components/McpApp.cjs","dist/src/components/McpApp.mjs","dist/src/components/McpToolWidget.cjs","dist/src/components/McpToolWidget.mjs","dist/src/components/MediaPreview.cjs","dist/src/components/MediaPreview.mjs","dist/src/components/MediaViewerDialog.cjs","dist/src/components/MediaViewerDialog.mjs","dist/src/components/MermaidDiagram.cjs","dist/src/components/MermaidDiagram.mjs","dist/src/components/MessageItem.cjs","dist/src/components/MessageItem.mjs","dist/src/components/MessageLines.cjs","dist/src/components/MessageLines.mjs","dist/src/components/OptionList.cjs","dist/src/components/OptionList.mjs","dist/src/components/Panel.cjs","dist/src/components/Panel.mjs","dist/src/components/PathText.cjs","dist/src/components/PathText.mjs","dist/src/components/PdfPreview.cjs","dist/src/components/PdfPreview.mjs","dist/src/components/Picker.cjs","dist/src/components/Picker.mjs","dist/src/components/Popover.cjs","dist/src/components/Popover.mjs","dist/src/components/ProfilePicker.cjs","dist/src/components/ProfilePicker.mjs","dist/src/components/Progress.cjs","dist/src/components/Progress.mjs","dist/src/components/QrCode.cjs","dist/src/components/QrCode.mjs","dist/src/components/RadioGroup.cjs","dist/src/components/RadioGroup.mjs","dist/src/components/ReferenceChip.cjs","dist/src/components/ReferenceChip.mjs","dist/src/components/ReviewCommentDraft.cjs","dist/src/components/ReviewCommentDraft.mjs","dist/src/components/ScrollArea.cjs","dist/src/components/ScrollArea.mjs","dist/src/components/SectionLabel.cjs","dist/src/components/SectionLabel.mjs","dist/src/components/Select.cjs","dist/src/components/Select.mjs","dist/src/components/Separator.cjs","dist/src/components/Separator.mjs","dist/src/components/Settings.cjs","dist/src/components/Settings.mjs","dist/src/components/SetupRow.cjs","dist/src/components/SetupRow.mjs","dist/src/components/Sheet.cjs","dist/src/components/Sheet.mjs","dist/src/components/Skeleton.cjs","dist/src/components/Skeleton.mjs","dist/src/components/Spinner.cjs","dist/src/components/Spinner.mjs","dist/src/components/StatusBadge.cjs","dist/src/components/StatusBadge.mjs","dist/src/components/StreamCursor.cjs","dist/src/components/StreamCursor.mjs","dist/src/components/Switch.cjs","dist/src/components/Switch.mjs","dist/src/components/SyntaxText.cjs","dist/src/components/SyntaxText.mjs","dist/src/components/Tabs.cjs","dist/src/components/Tabs.mjs","dist/src/components/TerminalView.cjs","dist/src/components/TerminalView.mjs","dist/src/components/Textarea.cjs","dist/src/components/Textarea.mjs","dist/src/components/Toast.cjs","dist/src/components/Toast.mjs","dist/src/components/ToolPathLink.cjs","dist/src/components/ToolPathLink.mjs","dist/src/components/Tooltip.cjs","dist/src/components/Tooltip.mjs","dist/src/components/ViewableImage.cjs","dist/src/components/ViewableImage.mjs","dist/src/icons/icons.cjs","dist/src/icons/icons.mjs","dist/src/lib/ansiSpans.cjs","dist/src/lib/ansiSpans.mjs","dist/src/lib/cn.cjs","dist/src/lib/cn.mjs","dist/src/lib/collapse.cjs","dist/src/lib/collapse.mjs","dist/src/lib/editorController.cjs","dist/src/lib/editorController.mjs","dist/src/lib/editorLanguage.cjs","dist/src/lib/editorLanguage.mjs","dist/src/lib/editorTheme.cjs","dist/src/lib/editorTheme.mjs","dist/src/lib/fenceGrammar.cjs","dist/src/lib/fenceGrammar.mjs","dist/src/lib/fileDownload.cjs","dist/src/lib/fileDownload.mjs","dist/src/lib/files.cjs","dist/src/lib/files.mjs","dist/src/lib/hashlineHighlight.cjs","dist/src/lib/hashlineHighlight.mjs","dist/src/lib/hashlineView.cjs","dist/src/lib/hashlineView.mjs","dist/src/lib/markdownMedia.cjs","dist/src/lib/markdownMedia.mjs","dist/src/lib/markdownMediaSlot.cjs","dist/src/lib/markdownMediaSlot.mjs","dist/src/lib/markdownReferences.cjs","dist/src/lib/markdownReferences.mjs","dist/src/lib/mcpAppFrame.cjs","dist/src/lib/mcpAppFrame.mjs","dist/src/lib/mcpAppSandbox.cjs","dist/src/lib/mcpAppSandbox.mjs","dist/src/lib/mcpOpenAiBootstrap.cjs","dist/src/lib/mcpOpenAiBootstrap.mjs","dist/src/lib/media.cjs","dist/src/lib/media.mjs","dist/src/lib/mediaPlayback.cjs","dist/src/lib/mediaPlayback.mjs","dist/src/lib/mermaidDiagram.cjs","dist/src/lib/mermaidDiagram.mjs","dist/src/lib/optionList.cjs","dist/src/lib/optionList.mjs","dist/src/lib/pathGroups.cjs","dist/src/lib/pathGroups.mjs","dist/src/lib/picker.cjs","dist/src/lib/picker.mjs","dist/src/lib/profilePicker.cjs","dist/src/lib/profilePicker.mjs","dist/src/lib/qrMatrix.cjs","dist/src/lib/qrMatrix.mjs","dist/src/lib/review.cjs","dist/src/lib/review.mjs","dist/src/lib/runDuration.cjs","dist/src/lib/runDuration.mjs","dist/src/lib/syntaxHighlight.cjs","dist/src/lib/syntaxHighlight.mjs","dist/src/lib/tone.cjs","dist/src/lib/tone.mjs","dist/src/theme/apply.cjs","dist/src/theme/apply.mjs","dist/src/theme/builtinThemes.cjs","dist/src/theme/builtinThemes.mjs","dist/src/theme/derive.cjs","dist/src/theme/derive.mjs","dist/src/theme/nativeTheme.cjs","dist/src/theme/nativeTheme.mjs","dist/src/theme/parse.cjs","dist/src/theme/parse.mjs","dist/src/theme/piTheme.cjs","dist/src/theme/piTheme.mjs","dist/src/theme/preference.cjs","dist/src/theme/preference.mjs","dist/src/types/editor.cjs","dist/src/types/editor.mjs","dist/src/types/theme.cjs","dist/src/types/theme.mjs","dist/src/types/tone.cjs","dist/src/types/tone.mjs","dist/text.cjs","dist/text.mjs","dist/theme.cjs","dist/theme.mjs","dist/themes/po-nord-dark.cjs","dist/themes/po-nord-dark.mjs","dist/themes/po-one-light.cjs","dist/themes/po-one-light.mjs","llms.txt","locales/vi.json","locales/zh-CN.json","styles/mcp.css","styles/preview.css","styles/theme.css","styles/tokens.css","themes/po-nord-dark.json","themes/po-one-light.json"],"outputRevision":"6286bfc714eb2b301116631fe3cad399"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs"),t=require("./Spinner.cjs");let n=require("radix-ui"),r=require("react/jsx-runtime");const i=(0,require("class-variance-authority").cva)(`inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
const e=require("../lib/cn.cjs"),t=require("./Spinner.cjs");let n=require("radix-ui"),r=require("react/jsx-runtime");const i=(0,require("class-variance-authority").cva)(`inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{primary:`bg-po-selected font-semibold text-po-on-selected hover:brightness-110`,secondary:`border border-po-edge-magenta bg-po-tint-magenta font-semibold text-po-magenta hover:brightness-110`,outline:`border border-po-border text-po-dim hover:border-po-green/50 hover:text-po-hi`,ghost:`text-po-dim hover:bg-po-panel hover:text-po-hi`,subtle:`bg-po-panel text-po-dim hover:bg-po-deep hover:text-po-hi`,danger:`bg-po-red font-semibold text-po-rail hover:brightness-110`,"danger-outline":`border border-po-edge-red bg-po-tint-red font-semibold text-po-red hover:brightness-110`,success:`bg-po-green font-semibold text-po-rail hover:brightness-110`,link:`text-po-blue hover:underline`},size:{xs:`h-6 rounded px-1.5 text-sm`,sm:`h-7 px-2.5 text-sm`,md:`h-8 px-3 text-base`,lg:`h-9 px-3.5 text-base`,icon:`h-6 w-6 rounded p-0`,"icon-md":`h-8 w-8 p-0`,card:`h-auto w-full flex-col items-stretch justify-start gap-1 px-[11px] py-2.5 text-left whitespace-normal`}},defaultVariants:{variant:`outline`,size:`md`}});function a({className:a,variant:o,size:s,asChild:c=!1,loading:l=!1,loadingLabel:u,disabled:d,type:f,children:p,...m}){let h=c?n.Slot.Root:`button`,g=!c&&l;return/* @__PURE__ */ (0,r.jsx)(h,{"data-slot":`button`,type:c?void 0:f??`button`,"aria-busy":g?!0:void 0,disabled:c?void 0:d??g,className:e.cn(i({variant:o,size:s}),a),...m,children:c?p:/* @__PURE__ */ (0,r.jsxs)(r.Fragment,{children:[g?/* @__PURE__ */ (0,r.jsx)(t.Spinner,{label:u}):null,p]})})}exports.Button=a,exports.buttonVariants=i;
|
|
2
2
|
//# sourceMappingURL=Button.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","names":["cva","Slot","cn","Spinner","require_cn","require_Spinner","radix_ui","react_jsx_runtime","buttonVariants","Button","props","Component","asChild","busy","loading","type","disabled","className","children","loadingLabel"],"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Spinner } from './Spinner';\n\nexport const buttonVariants = cva(\n 'inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
{"version":3,"file":"Button.cjs","names":["cva","Slot","cn","Spinner","require_cn","require_Spinner","radix_ui","react_jsx_runtime","buttonVariants","Button","props","Component","asChild","busy","loading","type","disabled","className","children","loadingLabel"],"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Spinner } from './Spinner';\n\nexport const buttonVariants = cva(\n 'inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary: 'bg-po-selected font-semibold text-po-on-selected hover:brightness-110',\n /** Rose: the caring second choice (review, adjust a preference), never urgency. */\n secondary:\n 'border border-po-edge-magenta bg-po-tint-magenta font-semibold text-po-magenta hover:brightness-110',\n outline: 'border border-po-border text-po-dim hover:border-po-green/50 hover:text-po-hi',\n ghost: 'text-po-dim hover:bg-po-panel hover:text-po-hi',\n subtle: 'bg-po-panel text-po-dim hover:bg-po-deep hover:text-po-hi',\n danger: 'bg-po-red font-semibold text-po-rail hover:brightness-110',\n 'danger-outline': 'border border-po-edge-red bg-po-tint-red font-semibold text-po-red hover:brightness-110',\n success: 'bg-po-green font-semibold text-po-rail hover:brightness-110',\n link: 'text-po-blue hover:underline',\n },\n size: {\n xs: 'h-6 rounded px-1.5 text-sm',\n sm: 'h-7 px-2.5 text-sm',\n md: 'h-8 px-3 text-base',\n lg: 'h-9 px-3.5 text-base',\n icon: 'h-6 w-6 rounded p-0',\n 'icon-md': 'h-8 w-8 p-0',\n /**\n * A whole card that is one click target: a session in the rail, a run\n * in a panel. It keeps the button's focus ring and cursor and gives up\n * the button's single-line box, which is what a card-shaped <button>\n * would otherwise have to restate.\n */\n card: 'h-auto w-full flex-col items-stretch justify-start gap-1 px-[11px] py-2.5 text-left whitespace-normal',\n },\n },\n defaultVariants: { variant: 'outline', size: 'md' },\n },\n);\n\nexport type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>['variant']>;\nexport type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;\n\nexport interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n /** Render the child element instead of a <button>, passing the classes down (shadcn's asChild). */\n asChild?: boolean;\n /**\n * Work is in flight: the button shows a spinner and stops accepting clicks.\n * Ignored under asChild, where the child owns its own content.\n */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n}\n\n/** The one button: every variant is a theme token, so it recolours with the theme. */\nexport function Button({\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n loadingLabel,\n disabled,\n type,\n children,\n ...props\n}: ButtonProps) {\n const Component = asChild ? Slot.Root : 'button';\n const busy = !asChild && loading;\n return (\n <Component\n data-slot=\"button\"\n type={asChild ? undefined : (type ?? 'button')}\n aria-busy={busy ? true : undefined}\n disabled={asChild ? undefined : (disabled ?? busy)}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {/* Slot takes exactly one child, so asChild hands its element straight through. */}\n {asChild ? (\n children\n ) : (\n <>\n {busy ? <Spinner label={loadingLabel} /> : null}\n {children}\n </>\n )}\n </Component>\n );\n}\n"],"mappings":"A,qHAOA,MAAaQ,GAAA,E,kCAAiBR,CAAAA,CAAAA,IAAAA,CAC5B,0VACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,wEAET,UACE,sGACF,QAAS,gFACT,MAAO,iDACP,OAAQ,4DACR,OAAQ,4DACR,iBAAkB,0FAClB,QAAS,8DACT,KAAM,8BACR,EACA,KAAM,CACJ,GAAI,6BACJ,GAAI,qBACJ,GAAI,qBACJ,GAAI,uBACJ,KAAM,sBACN,UAAW,cAOX,KAAM,uGACR,CACF,EACA,gBAAiB,CAAE,QAAS,UAAW,KAAM,IAAK,CACpD,CACF,EAkBA,SAAgBS,EAAO,CACrB,YACA,UACA,OACA,UAAU,GACV,UAAU,GACV,eACA,WACA,OACA,WACA,GAAGC,GACW,CACd,IAAMC,EAAYC,EAAUX,EAAAA,KAAK,KAAO,SAClCY,EAAO,CAACD,GAAWE,EACzB,MACE,iBAAA,EAAAP,EAAA,IAAA,CAACI,EAAD,CACE,YAAU,SACV,KAAMC,EAAU,IAAA,GAAaG,GAAQ,SACrC,YAAWF,EAAO,GAAO,IAAA,GACzB,SAAUD,EAAU,IAAA,GAAaI,GAAYH,EAC7C,UAAWX,EAAAA,GAAGM,EAAe,CAAE,UAAS,MAAK,CAAC,EAAGS,CAAS,EAC1D,GAAIP,EAGH,SAAAE,EACCM,EAEA,iBAAA,EAAAX,EAAA,KAAA,CAAAA,EAAA,SAAA,CAAA,SAAA,CACGM,EAAO,iBAAA,EAAAN,EAAA,IAAA,CAACJ,EAAAA,QAAD,CAAS,MAAOgB,CAAe,CAAA,EAAI,KAC1CD,CACD,CAAA,CAAA,CAEK,CAAA,CAEf,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../lib/cn.mjs";import{Spinner as t}from"./Spinner.mjs";import{Slot as n}from"radix-ui";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";const s=o(`inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
import{cn as e}from"../lib/cn.mjs";import{Spinner as t}from"./Spinner.mjs";import{Slot as n}from"radix-ui";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";const s=o(`inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{primary:`bg-po-selected font-semibold text-po-on-selected hover:brightness-110`,secondary:`border border-po-edge-magenta bg-po-tint-magenta font-semibold text-po-magenta hover:brightness-110`,outline:`border border-po-border text-po-dim hover:border-po-green/50 hover:text-po-hi`,ghost:`text-po-dim hover:bg-po-panel hover:text-po-hi`,subtle:`bg-po-panel text-po-dim hover:bg-po-deep hover:text-po-hi`,danger:`bg-po-red font-semibold text-po-rail hover:brightness-110`,"danger-outline":`border border-po-edge-red bg-po-tint-red font-semibold text-po-red hover:brightness-110`,success:`bg-po-green font-semibold text-po-rail hover:brightness-110`,link:`text-po-blue hover:underline`},size:{xs:`h-6 rounded px-1.5 text-sm`,sm:`h-7 px-2.5 text-sm`,md:`h-8 px-3 text-base`,lg:`h-9 px-3.5 text-base`,icon:`h-6 w-6 rounded p-0`,"icon-md":`h-8 w-8 p-0`,card:`h-auto w-full flex-col items-stretch justify-start gap-1 px-[11px] py-2.5 text-left whitespace-normal`}},defaultVariants:{variant:`outline`,size:`md`}});function c({className:o,variant:c,size:l,asChild:u=!1,loading:d=!1,loadingLabel:f,disabled:p,type:m,children:h,...g}){let _=u?n.Root:`button`,v=!u&&d;return/* @__PURE__ */ i(_,{"data-slot":`button`,type:u?void 0:m??`button`,"aria-busy":v?!0:void 0,disabled:u?void 0:p??v,className:e(s({variant:c,size:l}),o),...g,children:u?h:/* @__PURE__ */ a(r,{children:[v?/* @__PURE__ */ i(t,{label:f}):null,h]})})}export{c as Button,s as buttonVariants};
|
|
2
2
|
//# sourceMappingURL=Button.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","names":["buttonVariants","cva","Button","props","Component","asChild","Slot","busy","loading","type","disabled","cn","className","children","Fragment","Spinner","loadingLabel"],"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Spinner } from './Spinner';\n\nexport const buttonVariants = cva(\n 'inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":["buttonVariants","cva","Button","props","Component","asChild","Slot","busy","loading","type","disabled","cn","className","children","Fragment","Spinner","loadingLabel"],"sources":["../../../src/components/Button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\nimport { Spinner } from './Spinner';\n\nexport const buttonVariants = cva(\n 'inline-flex min-h-6 min-w-6 shrink-0 cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-[color,background-color,border-color,filter] outline-none focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n primary: 'bg-po-selected font-semibold text-po-on-selected hover:brightness-110',\n /** Rose: the caring second choice (review, adjust a preference), never urgency. */\n secondary:\n 'border border-po-edge-magenta bg-po-tint-magenta font-semibold text-po-magenta hover:brightness-110',\n outline: 'border border-po-border text-po-dim hover:border-po-green/50 hover:text-po-hi',\n ghost: 'text-po-dim hover:bg-po-panel hover:text-po-hi',\n subtle: 'bg-po-panel text-po-dim hover:bg-po-deep hover:text-po-hi',\n danger: 'bg-po-red font-semibold text-po-rail hover:brightness-110',\n 'danger-outline': 'border border-po-edge-red bg-po-tint-red font-semibold text-po-red hover:brightness-110',\n success: 'bg-po-green font-semibold text-po-rail hover:brightness-110',\n link: 'text-po-blue hover:underline',\n },\n size: {\n xs: 'h-6 rounded px-1.5 text-sm',\n sm: 'h-7 px-2.5 text-sm',\n md: 'h-8 px-3 text-base',\n lg: 'h-9 px-3.5 text-base',\n icon: 'h-6 w-6 rounded p-0',\n 'icon-md': 'h-8 w-8 p-0',\n /**\n * A whole card that is one click target: a session in the rail, a run\n * in a panel. It keeps the button's focus ring and cursor and gives up\n * the button's single-line box, which is what a card-shaped <button>\n * would otherwise have to restate.\n */\n card: 'h-auto w-full flex-col items-stretch justify-start gap-1 px-[11px] py-2.5 text-left whitespace-normal',\n },\n },\n defaultVariants: { variant: 'outline', size: 'md' },\n },\n);\n\nexport type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>['variant']>;\nexport type ButtonSize = NonNullable<VariantProps<typeof buttonVariants>['size']>;\n\nexport interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n /** Render the child element instead of a <button>, passing the classes down (shadcn's asChild). */\n asChild?: boolean;\n /**\n * Work is in flight: the button shows a spinner and stops accepting clicks.\n * Ignored under asChild, where the child owns its own content.\n */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n}\n\n/** The one button: every variant is a theme token, so it recolours with the theme. */\nexport function Button({\n className,\n variant,\n size,\n asChild = false,\n loading = false,\n loadingLabel,\n disabled,\n type,\n children,\n ...props\n}: ButtonProps) {\n const Component = asChild ? Slot.Root : 'button';\n const busy = !asChild && loading;\n return (\n <Component\n data-slot=\"button\"\n type={asChild ? undefined : (type ?? 'button')}\n aria-busy={busy ? true : undefined}\n disabled={asChild ? undefined : (disabled ?? busy)}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {/* Slot takes exactly one child, so asChild hands its element straight through. */}\n {asChild ? (\n children\n ) : (\n <>\n {busy ? <Spinner label={loadingLabel} /> : null}\n {children}\n </>\n )}\n </Component>\n );\n}\n"],"mappings":"A,0NAOA,MAAaA,EAAiBC,EAC5B,0VACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,wEAET,UACE,sGACF,QAAS,gFACT,MAAO,iDACP,OAAQ,4DACR,OAAQ,4DACR,iBAAkB,0FAClB,QAAS,8DACT,KAAM,8BACR,EACA,KAAM,CACJ,GAAI,6BACJ,GAAI,qBACJ,GAAI,qBACJ,GAAI,uBACJ,KAAM,sBACN,UAAW,cAOX,KAAM,uGACR,CACF,EACA,gBAAiB,CAAE,QAAS,UAAW,KAAM,IAAK,CACpD,CACF,EAkBA,SAAgBC,EAAO,CACrB,YACA,UACA,OACA,UAAU,GACV,UAAU,GACV,eACA,WACA,OACA,WACA,GAAGC,GACW,CACd,IAAMC,EAAYC,EAAUC,EAAK,KAAO,SAClCC,EAAO,CAACF,GAAWG,EACzB,MACE,kBAACJ,EAAD,CACE,YAAU,SACV,KAAMC,EAAU,IAAA,GAAaI,GAAQ,SACrC,YAAWF,EAAO,GAAO,IAAA,GACzB,SAAUF,EAAU,IAAA,GAAaK,GAAYH,EAC7C,UAAWI,EAAGX,EAAe,CAAE,UAAS,MAAK,CAAC,EAAGY,CAAS,EAC1D,GAAIT,EAGH,SAAAE,EACCQ,EAEA,kBAAAC,EAAA,CAAA,SAAA,CACGP,EAAO,kBAACQ,EAAD,CAAS,MAAOC,CAAe,CAAA,EAAI,KAC1CH,CACD,CAAA,CAAA,CAEK,CAAA,CAEf,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./AgentAvatar.cjs"),n=require("./Spinner.cjs"),r=require("./Button.cjs"),i=require("./Popover.cjs"),a=require("./Picker.cjs"),o=require("../lib/profilePicker.cjs");let s=require("react/jsx-runtime"),c=require("react"),l=require("@agimon-ai/po-core/web"),u=require("lucide-react");function d({profiles:d,status:f,value:p,onChange:m,required:
|
|
1
|
+
require("../icons/icons.cjs");const e=require("../lib/cn.cjs"),t=require("./AgentAvatar.cjs"),n=require("./Spinner.cjs"),r=require("./Button.cjs"),i=require("./Popover.cjs"),a=require("./Picker.cjs"),o=require("../lib/profilePicker.cjs");let s=require("react/jsx-runtime"),c=require("react"),l=require("@agimon-ai/po-core/web"),u=require("lucide-react");function d({profiles:d,status:f,value:p,onChange:m,defaultProfile:h,required:g=!1,disabled:_,defaultOpen:v=!1,id:y,className:b}){let x=(0,l.useT)(),[S,C]=(0,c.useState)(v),w=(0,c.useId)(),T=(0,c.useId)(),E=new Map(d.map(e=>[o.profileValueOf(e.name),e])),D=o.effectiveProfile(void 0,d,h),O=/* @__PURE__ */ (0,s.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,s.jsx)(u.Lock,{"aria-hidden":!0,className:`size-3`}),x(`webComponents.profilePicker.private`,`Private`)]}),k=o.profilePickerItems(d,h).filter(e=>!g||E.has(e.value)).map(e=>{let n=E.get(e.value),r=n?.private??(e.value==="default"&&D?.private);return{...e,...n?{lead:/* @__PURE__ */ (0,s.jsx)(t.AgentAvatar,{name:e.title,seed:n.name,image:o.inlineProfileIcon(n.identity?.icon),size:`sm`})}:{},...r?{trail:O}:{},props:{"data-testid":`profile-option-${e.value}`}}}),A=g&&typeof p!=`string`?void 0:o.effectiveProfile(p,d,h);return/* @__PURE__ */ (0,s.jsxs)(`div`,{"data-slot":`profile-picker`,"data-testid":`profile-picker`,className:e.cn(`flex flex-col gap-1`,b),children:[/* @__PURE__ */ (0,s.jsx)(`span`,{id:w,className:`text-base font-medium text-po-text`,children:g?x(`webComponents.profilePicker.label`,`Profile`):x(`webComponents.profilePicker.labelOptional`,`Profile (optional)`)}),/* @__PURE__ */ (0,s.jsxs)(i.Popover,{open:S,onOpenChange:C,children:[/* @__PURE__ */ (0,s.jsx)(i.PopoverTrigger,{asChild:!0,children:/* @__PURE__ */ (0,s.jsxs)(r.Button,{id:y,variant:`outline`,"data-testid":`profile-picker-trigger`,"aria-haspopup":`listbox`,"aria-expanded":S,"aria-labelledby":w,"aria-describedby":A?.private?T:void 0,disabled:_||g&&d.length===0,className:`w-full justify-between px-2.5 text-po-text`,children:[/* @__PURE__ */ (0,s.jsx)(`span`,{className:`truncate`,children:g&&typeof p!=`string`?x(`webComponents.profilePicker.choose`,`Choose a profile`):o.profileChoiceLabel(p,d,h)}),f===`loading`?/* @__PURE__ */ (0,s.jsx)(n.Spinner,{className:`size-3 shrink-0`}):/* @__PURE__ */ (0,s.jsx)(u.ChevronDown,{className:`size-3.5 shrink-0 opacity-60`})]})}),/* @__PURE__ */ (0,s.jsx)(a.PickerContent,{side:`bottom`,align:`start`,"data-testid":`profile-picker-list`,title:x(`webComponents.profilePicker.label`,`Profile`),meta:f===`loading`?x(`webComponents.profilePicker.metaLoading`,`loading`):x(`webComponents.profilePicker.available`,`{count} available`,{count:d.length}),items:k,value:[o.profileValueOf(p)],filterable:k.length>9,filterPlaceholder:x(`webComponents.profilePicker.filter`,`Filter profiles`),className:`w-[min(360px,calc(100vw-24px))]`,onSelect:e=>{m(o.profileChoiceOf(e)),C(!1)}})]}),A?.private?/* @__PURE__ */ (0,s.jsxs)(`p`,{id:T,"data-testid":`profile-picker-private-note`,className:`flex items-center gap-1 text-sm text-po-dim`,children:[/* @__PURE__ */ (0,s.jsx)(u.Lock,{"aria-hidden":!0,className:`size-3 shrink-0`}),x(`webComponents.profilePicker.privateNote`,`Only you can see sessions started with this profile.`)]}):null,f===`loading`?/* @__PURE__ */ (0,s.jsx)(`p`,{role:`status`,className:`text-sm text-po-dim`,children:x(`webComponents.profilePicker.loading`,`Loading profiles…`)}):f===`unavailable`?/* @__PURE__ */ (0,s.jsxs)(`p`,{role:`status`,"data-testid":`profile-picker-note`,className:`text-sm text-po-dim`,children:[d.length===0?x(`webComponents.profilePicker.loadFailed`,`Profiles could not be loaded.`):x(`webComponents.profilePicker.loadPartial`,`Some profiles could not be loaded.`),` `,g?null:x(`webComponents.profilePicker.unavailableNote`,`You can still start a session without one.`)]}):g&&d.length===0?/* @__PURE__ */ (0,s.jsx)(`p`,{role:`status`,className:`text-sm text-po-dim`,children:x(`webComponents.profilePicker.noneAvailable`,`No profiles are available on this computer yet.`)}):null]})}function f(e,t){let[n,r]=(0,c.useState)(),i=(0,c.useRef)(t);(0,c.useEffect)(()=>{i.current=t});let a=t!==void 0;if((0,c.useEffect)(()=>{if(!a)return;let t=new AbortController;return o.loadProfileCatalog(e=>i.current?.(e)??Promise.resolve(void 0),t.signal).then(t=>{t!==void 0&&r({key:e,state:t})}),()=>t.abort()},[e,a]),a)return n?.key===e?n.state:{status:`loading`,profiles:[]}}exports.ProfilePicker=d,exports.useProfileCatalog=f;
|
|
2
2
|
//# sourceMappingURL=ProfilePicker.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfilePicker.cjs","names":["useT","useState","useId","profileValueOf","profilePickerItems","AgentAvatar","inlineProfileIcon","cn","Popover","PopoverTrigger","Button","profileChoiceLabel","Spinner","ChevronDownIcon","PickerContent","profileChoiceOf","useRef","loadProfileCatalog","require_cn","require_AgentAvatar","require_Spinner","require_Button","require_Popover","require_Picker","require_profilePicker","react_jsx_runtime","react","_agimon_ai_po_core_web","lucide_react","ProfilePicker","t","open","setOpen","labelId","byValue","profiles","profile","items","required","item","className","disabled","value","status","onChange","next","useProfileCatalog","loaded","setLoaded","latest","load","enabled","controller","signal","state","key"],"sources":["../../../src/components/ProfilePicker.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport {\n inlineProfileIcon,\n loadProfileCatalog,\n type ProfileChoice,\n profileChoiceLabel,\n profileChoiceOf,\n type ProfilePickerProfile,\n type ProfilePickerState,\n type ProfilePickerStatus,\n profilePickerItems,\n profileValueOf,\n} from '../lib/profilePicker';\nimport { AgentAvatar } from './AgentAvatar';\nimport { Button } from './Button';\nimport { PickerContent } from './Picker';\nimport { Popover, PopoverTrigger } from './Popover';\nimport { Spinner } from './Spinner';\n\nexport interface ProfilePickerProps {\n profiles: readonly ProfilePickerProfile[];\n status: ProfilePickerStatus;\n /** `undefined`: not chosen. `null`: explicit No profile. A string: that profile. */\n value: ProfileChoice;\n onChange: (choice: ProfileChoice) => void;\n /** Only named profiles, with no default or No profile option. */\n required?: boolean;\n disabled?: boolean;\n id?: string;\n className?: string;\n}\n\n/**\n * Chooses the profile a new session starts with.\n *\n * It never chooses for the person: a launch with nothing picked leaves the\n * workspace default eligible, and No profile is its own explicit row. The\n * list can still be filling in while the person decides, and a source that\n * did not load is said plainly instead of leaving the list quietly short.\n */\nexport function ProfilePicker({\n profiles,\n status,\n value,\n onChange,\n required = false,\n disabled,\n id,\n className,\n}: ProfilePickerProps) {\n const t = useT();\n const [open, setOpen] = useState(false);\n const labelId = useId();\n const byValue = new Map(profiles.map((profile) => [profileValueOf(profile.name), profile]));\n const items = profilePickerItems(profiles)\n .filter((item) => !required || byValue.has(item.value))\n .map((item) => {\n const profile = byValue.get(item.value);\n return {\n ...item,\n // A profile's own face: its inline avatar, otherwise initials. The default and No profile rows have none.\n ...(profile\n ? {\n lead: (\n <AgentAvatar\n name={item.title}\n seed={profile.name}\n image={inlineProfileIcon(profile.identity?.icon)}\n size=\"sm\"\n />\n ),\n }\n : {}),\n props: { 'data-testid': `profile-option-${item.value}` },\n };\n });\n return (\n <div data-slot=\"profile-picker\" data-testid=\"profile-picker\" className={cn('flex flex-col gap-1', className)}>\n <span id={labelId} className=\"text-base font-medium text-po-text\">\n {required\n ? t('webComponents.profilePicker.label', 'Profile')\n : t('webComponents.profilePicker.labelOptional', 'Profile (optional)')}\n </span>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n id={id}\n variant=\"outline\"\n data-testid=\"profile-picker-trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-labelledby={labelId}\n disabled={disabled || (required && profiles.length === 0)}\n className=\"w-full justify-between px-2.5 text-po-text\"\n >\n <span className=\"truncate\">\n {required && typeof value !== 'string'\n ? t('webComponents.profilePicker.choose', 'Choose a profile')\n : profileChoiceLabel(value, profiles)}\n </span>\n {status === 'loading' ? (\n <Spinner className=\"size-3 shrink-0\" />\n ) : (\n <ChevronDownIcon className=\"size-3.5 shrink-0 opacity-60\" />\n )}\n </Button>\n </PopoverTrigger>\n <PickerContent\n side=\"bottom\"\n align=\"start\"\n data-testid=\"profile-picker-list\"\n title={t('webComponents.profilePicker.label', 'Profile')}\n meta={\n status === 'loading'\n ? t('webComponents.profilePicker.metaLoading', 'loading')\n : t('webComponents.profilePicker.available', '{count} available', { count: profiles.length })\n }\n items={items}\n value={[profileValueOf(value)]}\n filterable={items.length > 9}\n filterPlaceholder={t('webComponents.profilePicker.filter', 'Filter profiles')}\n className=\"w-[min(360px,calc(100vw-24px))]\"\n onSelect={(next) => {\n onChange(profileChoiceOf(next));\n setOpen(false);\n }}\n />\n </Popover>\n {status === 'loading' ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.loading', 'Loading profiles…')}\n </p>\n ) : status === 'unavailable' ? (\n <p role=\"status\" data-testid=\"profile-picker-note\" className=\"text-sm text-po-dim\">\n {profiles.length === 0\n ? t('webComponents.profilePicker.loadFailed', 'Profiles could not be loaded.')\n : t('webComponents.profilePicker.loadPartial', 'Some profiles could not be loaded.')}{' '}\n {required\n ? null\n : t('webComponents.profilePicker.unavailableNote', 'You can still start a session without one.')}\n </p>\n ) : required && profiles.length === 0 ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.noneAvailable', 'No profiles are available on this computer yet.')}\n </p>\n ) : null}\n </div>\n );\n}\n\n/**\n * Loads the profile list for one target, such as a workspace, and reloads when `key` changes.\n * Undefined while no loader exists, so a host that offers none shows no picker.\n * Never chooses a profile; an unreachable server is \"unavailable\" with nothing listed.\n */\nexport function useProfileCatalog(\n key: string,\n load: ((signal: AbortSignal) => Promise<unknown>) | undefined,\n): { status: ProfilePickerStatus; profiles: readonly ProfilePickerProfile[] } | undefined {\n const [loaded, setLoaded] = useState<{ key: string; state: ProfilePickerState } | undefined>();\n // The newest loader without restarting the request each time a host rebuilds it; declared first so it runs first.\n const latest = useRef(load);\n useEffect(() => {\n latest.current = load;\n });\n const enabled = load !== undefined;\n useEffect(() => {\n if (!enabled) return;\n const controller = new AbortController();\n const request = (signal: AbortSignal): Promise<unknown> => latest.current?.(signal) ?? Promise.resolve(undefined);\n void loadProfileCatalog(request, controller.signal).then((state) => {\n if (state !== undefined) setLoaded({ key, state });\n });\n return () => controller.abort();\n }, [key, enabled]);\n if (!enabled) return undefined;\n return loaded?.key === key ? loaded.state : { status: 'loading', profiles: [] };\n}\n"],"mappings":"A,kWA4CA,SAAgB6B,EAAc,CAC5B,WACA,SACA,QACA,WACA,WAAW,GACX,WACA,KACA,aACqB,CACrB,IAAMC,GAAA,EAAI9B,EAAAA,KAAAA,CAAK,EACT,CAAC+B,EAAMC,IAAA,EAAW/B,EAAAA,SAAAA,CAAS,EAAK,EAChCgC,GAAA,EAAU/B,EAAAA,MAAAA,CAAM,EAChBgC,EAAU,IAAI,IAAIC,EAAS,IAAK,GAAY,CAAChC,EAAAA,eAAeiC,EAAQ,IAAI,EAAGA,CAAO,CAAC,CAAC,EACpFC,EAAQjC,EAAAA,mBAAmB+B,CAAQ,CAAC,CACvC,OAAQ,GAAS,CAACG,GAAYJ,EAAQ,IAAIK,EAAK,KAAK,CAAC,CAAC,CACtD,IAAK,GAAS,CACb,IAAMH,EAAUF,EAAQ,IAAIK,EAAK,KAAK,EACtC,MAAO,CACL,GAAGA,EAEH,GAAIH,EACA,CACE,KACE,iBAAA,EAAAX,EAAA,IAAA,CAACpB,EAAAA,YAAD,CACE,KAAMkC,EAAK,MACX,KAAMH,EAAQ,KACd,MAAO9B,EAAAA,kBAAkB8B,EAAQ,UAAU,IAAI,EAC/C,KAAK,IACN,CAAA,CAEL,EACA,CAAC,EACL,MAAO,CAAE,cAAe,kBAAkBG,E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AAS,EAC/ED,EAAW,MAAM,CAAC,CAAC,KAAM,GAAU,CAC9DE,IAAU,IAAA,IAAWN,EAAU,CAAE,MAAK,OAAM,CAAC,CACnD,CAAC,MACYI,EAAW,MAAM,CAChC,EAAG,CAACG,EAAKJ,CAAO,CAAC,EACZA,EACL,OAAOJ,GAAQ,MAAQQ,EAAMR,EAAO,MAAQ,CAAE,OAAQ,UAAW,SAAU,CAAC,CAAE,CAChF,C"}
|
|
1
|
+
{"version":3,"file":"ProfilePicker.cjs","names":["useT","useState","useId","profileValueOf","effectiveProfile","LockIcon","profilePickerItems","AgentAvatar","inlineProfileIcon","cn","Popover","PopoverTrigger","Button","profileChoiceLabel","Spinner","ChevronDownIcon","PickerContent","profileChoiceOf","useRef","loadProfileCatalog","require_cn","require_AgentAvatar","require_Spinner","require_Button","require_Popover","require_Picker","require_profilePicker","react_jsx_runtime","react","_agimon_ai_po_core_web","lucide_react","ProfilePicker","t","open","setOpen","defaultOpen","labelId","noteId","byValue","profiles","profile","defaulted","defaultProfile","privateMark","items","required","item","isPrivate","chosen","value","className","disabled","status","onChange","next","useProfileCatalog","loaded","setLoaded","latest","load","enabled","controller","signal","state","key"],"sources":["../../../src/components/ProfilePicker.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { ChevronDownIcon, LockIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport {\n effectiveProfile,\n inlineProfileIcon,\n loadProfileCatalog,\n type ProfileChoice,\n profileChoiceLabel,\n profileChoiceOf,\n type ProfilePickerProfile,\n type ProfilePickerState,\n type ProfilePickerStatus,\n profilePickerItems,\n profileValueOf,\n DEFAULT_PROFILE_VALUE,\n} from '../lib/profilePicker';\nimport { AgentAvatar } from './AgentAvatar';\nimport { Button } from './Button';\nimport { PickerContent } from './Picker';\nimport { Popover, PopoverTrigger } from './Popover';\nimport { Spinner } from './Spinner';\n\nexport interface ProfilePickerProps {\n profiles: readonly ProfilePickerProfile[];\n status: ProfilePickerStatus;\n /** `undefined`: not chosen. `null`: explicit No profile. A string: that profile. */\n value: ProfileChoice;\n onChange: (choice: ProfileChoice) => void;\n /** The listed profile the default resolves to, when the host can say. */\n defaultProfile?: string;\n /** Only named profiles, with no default or No profile option. */\n required?: boolean;\n disabled?: boolean;\n /** Opens the list on first render, for stories. */\n defaultOpen?: boolean;\n id?: string;\n className?: string;\n}\n\n/**\n * Chooses the profile a new session starts with.\n *\n * It never chooses for the person: a launch with nothing picked leaves the\n * workspace default eligible, and No profile is its own explicit row. The\n * list can still be filling in while the person decides, and a source that\n * did not load is said plainly instead of leaving the list quietly short.\n */\nexport function ProfilePicker({\n profiles,\n status,\n value,\n onChange,\n defaultProfile,\n required = false,\n disabled,\n defaultOpen = false,\n id,\n className,\n}: ProfilePickerProps) {\n const t = useT();\n const [open, setOpen] = useState(defaultOpen);\n const labelId = useId();\n const noteId = useId();\n const byValue = new Map(profiles.map((profile) => [profileValueOf(profile.name), profile]));\n const defaulted = effectiveProfile(undefined, profiles, defaultProfile);\n const privateMark = (\n <span className=\"flex items-center gap-1\">\n <LockIcon aria-hidden className=\"size-3\" />\n {t('webComponents.profilePicker.private', 'Private')}\n </span>\n );\n const items = profilePickerItems(profiles, defaultProfile)\n .filter((item) => !required || byValue.has(item.value))\n .map((item) => {\n const profile = byValue.get(item.value);\n const isPrivate = profile?.private ?? (item.value === DEFAULT_PROFILE_VALUE && defaulted?.private);\n return {\n ...item,\n // A profile's own face: its inline avatar, otherwise initials. The default and No profile rows have none.\n ...(profile\n ? {\n lead: (\n <AgentAvatar\n name={item.title}\n seed={profile.name}\n image={inlineProfileIcon(profile.identity?.icon)}\n size=\"sm\"\n />\n ),\n }\n : {}),\n ...(isPrivate ? { trail: privateMark } : {}),\n props: { 'data-testid': `profile-option-${item.value}` },\n };\n });\n const chosen = required && typeof value !== 'string' ? undefined : effectiveProfile(value, profiles, defaultProfile);\n return (\n <div data-slot=\"profile-picker\" data-testid=\"profile-picker\" className={cn('flex flex-col gap-1', className)}>\n <span id={labelId} className=\"text-base font-medium text-po-text\">\n {required\n ? t('webComponents.profilePicker.label', 'Profile')\n : t('webComponents.profilePicker.labelOptional', 'Profile (optional)')}\n </span>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n id={id}\n variant=\"outline\"\n data-testid=\"profile-picker-trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-labelledby={labelId}\n aria-describedby={chosen?.private ? noteId : undefined}\n disabled={disabled || (required && profiles.length === 0)}\n className=\"w-full justify-between px-2.5 text-po-text\"\n >\n <span className=\"truncate\">\n {required && typeof value !== 'string'\n ? t('webComponents.profilePicker.choose', 'Choose a profile')\n : profileChoiceLabel(value, profiles, defaultProfile)}\n </span>\n {status === 'loading' ? (\n <Spinner className=\"size-3 shrink-0\" />\n ) : (\n <ChevronDownIcon className=\"size-3.5 shrink-0 opacity-60\" />\n )}\n </Button>\n </PopoverTrigger>\n <PickerContent\n side=\"bottom\"\n align=\"start\"\n data-testid=\"profile-picker-list\"\n title={t('webComponents.profilePicker.label', 'Profile')}\n meta={\n status === 'loading'\n ? t('webComponents.profilePicker.metaLoading', 'loading')\n : t('webComponents.profilePicker.available', '{count} available', { count: profiles.length })\n }\n items={items}\n value={[profileValueOf(value)]}\n filterable={items.length > 9}\n filterPlaceholder={t('webComponents.profilePicker.filter', 'Filter profiles')}\n className=\"w-[min(360px,calc(100vw-24px))]\"\n onSelect={(next) => {\n onChange(profileChoiceOf(next));\n setOpen(false);\n }}\n />\n </Popover>\n {chosen?.private ? (\n <p\n id={noteId}\n data-testid=\"profile-picker-private-note\"\n className=\"flex items-center gap-1 text-sm text-po-dim\"\n >\n <LockIcon aria-hidden className=\"size-3 shrink-0\" />\n {t('webComponents.profilePicker.privateNote', 'Only you can see sessions started with this profile.')}\n </p>\n ) : null}\n {status === 'loading' ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.loading', 'Loading profiles…')}\n </p>\n ) : status === 'unavailable' ? (\n <p role=\"status\" data-testid=\"profile-picker-note\" className=\"text-sm text-po-dim\">\n {profiles.length === 0\n ? t('webComponents.profilePicker.loadFailed', 'Profiles could not be loaded.')\n : t('webComponents.profilePicker.loadPartial', 'Some profiles could not be loaded.')}{' '}\n {required\n ? null\n : t('webComponents.profilePicker.unavailableNote', 'You can still start a session without one.')}\n </p>\n ) : required && profiles.length === 0 ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.noneAvailable', 'No profiles are available on this computer yet.')}\n </p>\n ) : null}\n </div>\n );\n}\n\n/**\n * Loads the profile list for one target, such as a workspace, and reloads when `key` changes.\n * Undefined while no loader exists, so a host that offers none shows no picker.\n * Never chooses a profile; an unreachable server is \"unavailable\" with nothing listed.\n */\nexport function useProfileCatalog(\n key: string,\n load: ((signal: AbortSignal) => Promise<unknown>) | undefined,\n): { status: ProfilePickerStatus; profiles: readonly ProfilePickerProfile[]; defaultProfile?: string } | undefined {\n const [loaded, setLoaded] = useState<{ key: string; state: ProfilePickerState } | undefined>();\n // The newest loader without restarting the request each time a host rebuilds it; declared first so it runs first.\n const latest = useRef(load);\n useEffect(() => {\n latest.current = load;\n });\n const enabled = load !== undefined;\n useEffect(() => {\n if (!enabled) return;\n const controller = new AbortController();\n const request = (signal: AbortSignal): Promise<unknown> => latest.current?.(signal) ?? Promise.resolve(undefined);\n void loadProfileCatalog(request, controller.signal).then((state) => {\n if (state !== undefined) setLoaded({ key, state });\n });\n return () => controller.abort();\n }, [key, enabled]);\n if (!enabled) return undefined;\n return loaded?.key === key ? loaded.state : { status: 'loading', profiles: [] };\n}\n"],"mappings":"A,kWAkDA,SAAgB+B,EAAc,CAC5B,WACA,SACA,QACA,WACA,iBACA,WAAW,GACX,WACA,cAAc,GACd,KACA,aACqB,CACrB,IAAMC,GAAA,EAAIhC,EAAAA,KAAAA,CAAK,EACT,CAACiC,EAAMC,IAAA,EAAWjC,EAA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EACD,IAAMC,EAAUD,IAAS,IAAA,GAUzB,IATA,EAAA/B,EAAA,UAAA,KAAgB,CACd,GAAI,CAACgC,EAAS,OACd,IAAMC,EAAa,IAAI,gBAKvB,OAHAnC,EAAKP,mBADY,GAA0CuC,EAAO,UAAUI,CAAM,GAAK,QAAQ,QAAQ,IAAA,EAAS,EAC/ED,EAAW,MAAM,CAAC,CAAC,KAAM,GAAU,CAC9DE,IAAU,IAAA,IAAWN,EAAU,CAAE,MAAK,OAAM,CAAC,CACnD,CAAC,MACYI,EAAW,MAAM,CAChC,EAAG,CAACG,EAAKJ,CAAO,CAAC,EACZA,EACL,OAAOJ,GAAQ,MAAQQ,EAAMR,EAAO,MAAQ,CAAE,OAAQ,UAAW,SAAU,CAAC,CAAE,CAChF,C"}
|
|
@@ -6,9 +6,13 @@ export interface ProfilePickerProps {
|
|
|
6
6
|
/** `undefined`: not chosen. `null`: explicit No profile. A string: that profile. */
|
|
7
7
|
value: ProfileChoice;
|
|
8
8
|
onChange: (choice: ProfileChoice) => void;
|
|
9
|
+
/** The listed profile the default resolves to, when the host can say. */
|
|
10
|
+
defaultProfile?: string;
|
|
9
11
|
/** Only named profiles, with no default or No profile option. */
|
|
10
12
|
required?: boolean;
|
|
11
13
|
disabled?: boolean;
|
|
14
|
+
/** Opens the list on first render, for stories. */
|
|
15
|
+
defaultOpen?: boolean;
|
|
12
16
|
id?: string;
|
|
13
17
|
className?: string;
|
|
14
18
|
}
|
|
@@ -20,7 +24,7 @@ export interface ProfilePickerProps {
|
|
|
20
24
|
* list can still be filling in while the person decides, and a source that
|
|
21
25
|
* did not load is said plainly instead of leaving the list quietly short.
|
|
22
26
|
*/
|
|
23
|
-
export declare function ProfilePicker({ profiles, status, value, onChange, required, disabled, id, className }: ProfilePickerProps): import("react").JSX.Element;
|
|
27
|
+
export declare function ProfilePicker({ profiles, status, value, onChange, defaultProfile, required, disabled, defaultOpen, id, className }: ProfilePickerProps): import("react").JSX.Element;
|
|
24
28
|
/**
|
|
25
29
|
* Loads the profile list for one target, such as a workspace, and reloads when `key` changes.
|
|
26
30
|
* Undefined while no loader exists, so a host that offers none shows no picker.
|
|
@@ -29,6 +33,7 @@ export declare function ProfilePicker({ profiles, status, value, onChange, requi
|
|
|
29
33
|
export declare function useProfileCatalog(key: string, load: ((signal: AbortSignal) => Promise<unknown>) | undefined): {
|
|
30
34
|
status: ProfilePickerStatus;
|
|
31
35
|
profiles: readonly ProfilePickerProfile[];
|
|
36
|
+
defaultProfile?: string;
|
|
32
37
|
} | undefined;
|
|
33
38
|
//#endregion
|
|
34
39
|
//# sourceMappingURL=ProfilePicker.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfilePicker.d.mts","names":[],"sources":["../../../src/components/ProfilePicker.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ProfilePicker.d.mts","names":[],"sources":["../../../src/components/ProfilePicker.tsx"],"mappings":";;iBAyBiB;EACf,mBAAmB;EACnB,QAAQ;;EAER,OAAO;EACP,WAAW,QAAQ;;EAEnB;;EAEA;EACA;;EAEA;EACA;EACA;;;;;;;;;;wBAWc,gBACd,UACA,QACA,OACA,UACA,gBACA,UACA,UACA,aACA,IACA,aACC,qCAAkB,IAAA;;;;;;wBAgIL,kBACd,aACA,QAAQ,QAAQ,gBAAgB;EAC7B,QAAQ;EAAqB,mBAAmB;EAAwB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ChevronDownIcon as e}from"../icons/icons.mjs";import{cn as
|
|
1
|
+
import{ChevronDownIcon as e,LockIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{AgentAvatar as r}from"./AgentAvatar.mjs";import{Spinner as i}from"./Spinner.mjs";import{Button as a}from"./Button.mjs";import{Popover as o,PopoverTrigger as s}from"./Popover.mjs";import{PickerContent as c}from"./Picker.mjs";import{effectiveProfile as l,inlineProfileIcon as u,loadProfileCatalog as d,profileChoiceLabel as f,profileChoiceOf as p,profilePickerItems as m,profileValueOf as h}from"../lib/profilePicker.mjs";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useEffect as v,useId as y,useRef as b,useState as x}from"react";import{useT as S}from"@agimon-ai/po-core/web";function C({profiles:d,status:v,value:b,onChange:C,defaultProfile:w,required:T=!1,disabled:E,defaultOpen:D=!1,id:O,className:k}){let A=S(),[j,M]=x(D),N=y(),P=y(),F=new Map(d.map(e=>[h(e.name),e])),I=l(void 0,d,w),L=/* @__PURE__ */ _(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ g(t,{"aria-hidden":!0,className:`size-3`}),A(`webComponents.profilePicker.private`,`Private`)]}),R=m(d,w).filter(e=>!T||F.has(e.value)).map(e=>{let t=F.get(e.value),n=t?.private??(e.value==="default"&&I?.private);return{...e,...t?{lead:/* @__PURE__ */ g(r,{name:e.title,seed:t.name,image:u(t.identity?.icon),size:`sm`})}:{},...n?{trail:L}:{},props:{"data-testid":`profile-option-${e.value}`}}}),z=T&&typeof b!=`string`?void 0:l(b,d,w);return/* @__PURE__ */ _(`div`,{"data-slot":`profile-picker`,"data-testid":`profile-picker`,className:n(`flex flex-col gap-1`,k),children:[/* @__PURE__ */ g(`span`,{id:N,className:`text-base font-medium text-po-text`,children:T?A(`webComponents.profilePicker.label`,`Profile`):A(`webComponents.profilePicker.labelOptional`,`Profile (optional)`)}),/* @__PURE__ */ _(o,{open:j,onOpenChange:M,children:[/* @__PURE__ */ g(s,{asChild:!0,children:/* @__PURE__ */ _(a,{id:O,variant:`outline`,"data-testid":`profile-picker-trigger`,"aria-haspopup":`listbox`,"aria-expanded":j,"aria-labelledby":N,"aria-describedby":z?.private?P:void 0,disabled:E||T&&d.length===0,className:`w-full justify-between px-2.5 text-po-text`,children:[/* @__PURE__ */ g(`span`,{className:`truncate`,children:T&&typeof b!=`string`?A(`webComponents.profilePicker.choose`,`Choose a profile`):f(b,d,w)}),v===`loading`?/* @__PURE__ */ g(i,{className:`size-3 shrink-0`}):/* @__PURE__ */ g(e,{className:`size-3.5 shrink-0 opacity-60`})]})}),/* @__PURE__ */ g(c,{side:`bottom`,align:`start`,"data-testid":`profile-picker-list`,title:A(`webComponents.profilePicker.label`,`Profile`),meta:v===`loading`?A(`webComponents.profilePicker.metaLoading`,`loading`):A(`webComponents.profilePicker.available`,`{count} available`,{count:d.length}),items:R,value:[h(b)],filterable:R.length>9,filterPlaceholder:A(`webComponents.profilePicker.filter`,`Filter profiles`),className:`w-[min(360px,calc(100vw-24px))]`,onSelect:e=>{C(p(e)),M(!1)}})]}),z?.private?/* @__PURE__ */ _(`p`,{id:P,"data-testid":`profile-picker-private-note`,className:`flex items-center gap-1 text-sm text-po-dim`,children:[/* @__PURE__ */ g(t,{"aria-hidden":!0,className:`size-3 shrink-0`}),A(`webComponents.profilePicker.privateNote`,`Only you can see sessions started with this profile.`)]}):null,v===`loading`?/* @__PURE__ */ g(`p`,{role:`status`,className:`text-sm text-po-dim`,children:A(`webComponents.profilePicker.loading`,`Loading profiles…`)}):v===`unavailable`?/* @__PURE__ */ _(`p`,{role:`status`,"data-testid":`profile-picker-note`,className:`text-sm text-po-dim`,children:[d.length===0?A(`webComponents.profilePicker.loadFailed`,`Profiles could not be loaded.`):A(`webComponents.profilePicker.loadPartial`,`Some profiles could not be loaded.`),` `,T?null:A(`webComponents.profilePicker.unavailableNote`,`You can still start a session without one.`)]}):T&&d.length===0?/* @__PURE__ */ g(`p`,{role:`status`,className:`text-sm text-po-dim`,children:A(`webComponents.profilePicker.noneAvailable`,`No profiles are available on this computer yet.`)}):null]})}function w(e,t){let[n,r]=x(),i=b(t);v(()=>{i.current=t});let a=t!==void 0;if(v(()=>{if(!a)return;let t=new AbortController;return d(e=>i.current?.(e)??Promise.resolve(void 0),t.signal).then(t=>{t!==void 0&&r({key:e,state:t})}),()=>t.abort()},[e,a]),a)return n?.key===e?n.state:{status:`loading`,profiles:[]}}export{C as ProfilePicker,w as useProfileCatalog};
|
|
2
2
|
//# sourceMappingURL=ProfilePicker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfilePicker.mjs","names":["ProfilePicker","t","useT","open","setOpen","useState","labelId","useId","byValue","profiles","profileValueOf","profile","items","profilePickerItems","required","item","AgentAvatar","inlineProfileIcon","cn","className","Popover","PopoverTrigger","Button","disabled","value","profileChoiceLabel","status","Spinner","ChevronDownIcon","PickerContent","onChange","profileChoiceOf","next","useProfileCatalog","loaded","setLoaded","latest","useRef","load","useEffect","enabled","controller","loadProfileCatalog","signal","state","key"],"sources":["../../../src/components/ProfilePicker.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport {\n inlineProfileIcon,\n loadProfileCatalog,\n type ProfileChoice,\n profileChoiceLabel,\n profileChoiceOf,\n type ProfilePickerProfile,\n type ProfilePickerState,\n type ProfilePickerStatus,\n profilePickerItems,\n profileValueOf,\n} from '../lib/profilePicker';\nimport { AgentAvatar } from './AgentAvatar';\nimport { Button } from './Button';\nimport { PickerContent } from './Picker';\nimport { Popover, PopoverTrigger } from './Popover';\nimport { Spinner } from './Spinner';\n\nexport interface ProfilePickerProps {\n profiles: readonly ProfilePickerProfile[];\n status: ProfilePickerStatus;\n /** `undefined`: not chosen. `null`: explicit No profile. A string: that profile. */\n value: ProfileChoice;\n onChange: (choice: ProfileChoice) => void;\n /** Only named profiles, with no default or No profile option. */\n required?: boolean;\n disabled?: boolean;\n id?: string;\n className?: string;\n}\n\n/**\n * Chooses the profile a new session starts with.\n *\n * It never chooses for the person: a launch with nothing picked leaves the\n * workspace default eligible, and No profile is its own explicit row. The\n * list can still be filling in while the person decides, and a source that\n * did not load is said plainly instead of leaving the list quietly short.\n */\nexport function ProfilePicker({\n profiles,\n status,\n value,\n onChange,\n required = false,\n disabled,\n id,\n className,\n}: ProfilePickerProps) {\n const t = useT();\n const [open, setOpen] = useState(false);\n const labelId = useId();\n const byValue = new Map(profiles.map((profile) => [profileValueOf(profile.name), profile]));\n const items = profilePickerItems(profiles)\n .filter((item) => !required || byValue.has(item.value))\n .map((item) => {\n const profile = byValue.get(item.value);\n return {\n ...item,\n // A profile's own face: its inline avatar, otherwise initials. The default and No profile rows have none.\n ...(profile\n ? {\n lead: (\n <AgentAvatar\n name={item.title}\n seed={profile.name}\n image={inlineProfileIcon(profile.identity?.icon)}\n size=\"sm\"\n />\n ),\n }\n : {}),\n props: { 'data-testid': `profile-option-${item.value}` },\n };\n });\n return (\n <div data-slot=\"profile-picker\" data-testid=\"profile-picker\" className={cn('flex flex-col gap-1', className)}>\n <span id={labelId} className=\"text-base font-medium text-po-text\">\n {required\n ? t('webComponents.profilePicker.label', 'Profile')\n : t('webComponents.profilePicker.labelOptional', 'Profile (optional)')}\n </span>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n id={id}\n variant=\"outline\"\n data-testid=\"profile-picker-trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-labelledby={labelId}\n disabled={disabled || (required && profiles.length === 0)}\n className=\"w-full justify-between px-2.5 text-po-text\"\n >\n <span className=\"truncate\">\n {required && typeof value !== 'string'\n ? t('webComponents.profilePicker.choose', 'Choose a profile')\n : profileChoiceLabel(value, profiles)}\n </span>\n {status === 'loading' ? (\n <Spinner className=\"size-3 shrink-0\" />\n ) : (\n <ChevronDownIcon className=\"size-3.5 shrink-0 opacity-60\" />\n )}\n </Button>\n </PopoverTrigger>\n <PickerContent\n side=\"bottom\"\n align=\"start\"\n data-testid=\"profile-picker-list\"\n title={t('webComponents.profilePicker.label', 'Profile')}\n meta={\n status === 'loading'\n ? t('webComponents.profilePicker.metaLoading', 'loading')\n : t('webComponents.profilePicker.available', '{count} available', { count: profiles.length })\n }\n items={items}\n value={[profileValueOf(value)]}\n filterable={items.length > 9}\n filterPlaceholder={t('webComponents.profilePicker.filter', 'Filter profiles')}\n className=\"w-[min(360px,calc(100vw-24px))]\"\n onSelect={(next) => {\n onChange(profileChoiceOf(next));\n setOpen(false);\n }}\n />\n </Popover>\n {status === 'loading' ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.loading', 'Loading profiles…')}\n </p>\n ) : status === 'unavailable' ? (\n <p role=\"status\" data-testid=\"profile-picker-note\" className=\"text-sm text-po-dim\">\n {profiles.length === 0\n ? t('webComponents.profilePicker.loadFailed', 'Profiles could not be loaded.')\n : t('webComponents.profilePicker.loadPartial', 'Some profiles could not be loaded.')}{' '}\n {required\n ? null\n : t('webComponents.profilePicker.unavailableNote', 'You can still start a session without one.')}\n </p>\n ) : required && profiles.length === 0 ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.noneAvailable', 'No profiles are available on this computer yet.')}\n </p>\n ) : null}\n </div>\n );\n}\n\n/**\n * Loads the profile list for one target, such as a workspace, and reloads when `key` changes.\n * Undefined while no loader exists, so a host that offers none shows no picker.\n * Never chooses a profile; an unreachable server is \"unavailable\" with nothing listed.\n */\nexport function useProfileCatalog(\n key: string,\n load: ((signal: AbortSignal) => Promise<unknown>) | undefined,\n): { status: ProfilePickerStatus; profiles: readonly ProfilePickerProfile[] } | undefined {\n const [loaded, setLoaded] = useState<{ key: string; state: ProfilePickerState } | undefined>();\n // The newest loader without restarting the request each time a host rebuilds it; declared first so it runs first.\n const latest = useRef(load);\n useEffect(() => {\n latest.current = load;\n });\n const enabled = load !== undefined;\n useEffect(() => {\n if (!enabled) return;\n const controller = new AbortController();\n const request = (signal: AbortSignal): Promise<unknown> => latest.current?.(signal) ?? Promise.resolve(undefined);\n void loadProfileCatalog(request, controller.signal).then((state) => {\n if (state !== undefined) setLoaded({ key, state });\n });\n return () => controller.abort();\n }, [key, enabled]);\n if (!enabled) return undefined;\n return loaded?.key === key ? loaded.state : { status: 'loading', profiles: [] };\n}\n"],"mappings":"A,opBA4CA,SAAgBA,EAAc,CAC5B,WACA,SACA,QACA,WACA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AI,CAACC,EAAS,OACd,IAAMC,EAAa,IAAI,gBAKvB,OAHAC,EADiB,GAA0CN,EAAO,UAAUO,CAAM,GAAK,QAAQ,QAAQ,IAAA,EAAS,EAC/EF,EAAW,MAAM,CAAC,CAAC,KAAM,GAAU,CAC9DG,IAAU,IAAA,IAAWT,EAAU,CAAE,MAAK,OAAM,CAAC,CACnD,CAAC,MACYM,EAAW,MAAM,CAChC,EAAG,CAACI,EAAKL,CAAO,CAAC,EACZA,EACL,OAAON,GAAQ,MAAQW,EAAMX,EAAO,MAAQ,CAAE,OAAQ,UAAW,SAAU,CAAC,CAAE,CAChF,C"}
|
|
1
|
+
{"version":3,"file":"ProfilePicker.mjs","names":["ProfilePicker","t","useT","open","setOpen","useState","defaultOpen","labelId","useId","noteId","byValue","profiles","profileValueOf","profile","defaulted","effectiveProfile","defaultProfile","privateMark","LockIcon","items","profilePickerItems","required","item","isPrivate","AgentAvatar","inlineProfileIcon","chosen","value","cn","className","Popover","PopoverTrigger","Button","disabled","profileChoiceLabel","status","Spinner","ChevronDownIcon","PickerContent","onChange","profileChoiceOf","next","useProfileCatalog","loaded","setLoaded","latest","useRef","load","useEffect","enabled","controller","loadProfileCatalog","signal","state","key"],"sources":["../../../src/components/ProfilePicker.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/web';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { ChevronDownIcon, LockIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport {\n effectiveProfile,\n inlineProfileIcon,\n loadProfileCatalog,\n type ProfileChoice,\n profileChoiceLabel,\n profileChoiceOf,\n type ProfilePickerProfile,\n type ProfilePickerState,\n type ProfilePickerStatus,\n profilePickerItems,\n profileValueOf,\n DEFAULT_PROFILE_VALUE,\n} from '../lib/profilePicker';\nimport { AgentAvatar } from './AgentAvatar';\nimport { Button } from './Button';\nimport { PickerContent } from './Picker';\nimport { Popover, PopoverTrigger } from './Popover';\nimport { Spinner } from './Spinner';\n\nexport interface ProfilePickerProps {\n profiles: readonly ProfilePickerProfile[];\n status: ProfilePickerStatus;\n /** `undefined`: not chosen. `null`: explicit No profile. A string: that profile. */\n value: ProfileChoice;\n onChange: (choice: ProfileChoice) => void;\n /** The listed profile the default resolves to, when the host can say. */\n defaultProfile?: string;\n /** Only named profiles, with no default or No profile option. */\n required?: boolean;\n disabled?: boolean;\n /** Opens the list on first render, for stories. */\n defaultOpen?: boolean;\n id?: string;\n className?: string;\n}\n\n/**\n * Chooses the profile a new session starts with.\n *\n * It never chooses for the person: a launch with nothing picked leaves the\n * workspace default eligible, and No profile is its own explicit row. The\n * list can still be filling in while the person decides, and a source that\n * did not load is said plainly instead of leaving the list quietly short.\n */\nexport function ProfilePicker({\n profiles,\n status,\n value,\n onChange,\n defaultProfile,\n required = false,\n disabled,\n defaultOpen = false,\n id,\n className,\n}: ProfilePickerProps) {\n const t = useT();\n const [open, setOpen] = useState(defaultOpen);\n const labelId = useId();\n const noteId = useId();\n const byValue = new Map(profiles.map((profile) => [profileValueOf(profile.name), profile]));\n const defaulted = effectiveProfile(undefined, profiles, defaultProfile);\n const privateMark = (\n <span className=\"flex items-center gap-1\">\n <LockIcon aria-hidden className=\"size-3\" />\n {t('webComponents.profilePicker.private', 'Private')}\n </span>\n );\n const items = profilePickerItems(profiles, defaultProfile)\n .filter((item) => !required || byValue.has(item.value))\n .map((item) => {\n const profile = byValue.get(item.value);\n const isPrivate = profile?.private ?? (item.value === DEFAULT_PROFILE_VALUE && defaulted?.private);\n return {\n ...item,\n // A profile's own face: its inline avatar, otherwise initials. The default and No profile rows have none.\n ...(profile\n ? {\n lead: (\n <AgentAvatar\n name={item.title}\n seed={profile.name}\n image={inlineProfileIcon(profile.identity?.icon)}\n size=\"sm\"\n />\n ),\n }\n : {}),\n ...(isPrivate ? { trail: privateMark } : {}),\n props: { 'data-testid': `profile-option-${item.value}` },\n };\n });\n const chosen = required && typeof value !== 'string' ? undefined : effectiveProfile(value, profiles, defaultProfile);\n return (\n <div data-slot=\"profile-picker\" data-testid=\"profile-picker\" className={cn('flex flex-col gap-1', className)}>\n <span id={labelId} className=\"text-base font-medium text-po-text\">\n {required\n ? t('webComponents.profilePicker.label', 'Profile')\n : t('webComponents.profilePicker.labelOptional', 'Profile (optional)')}\n </span>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n id={id}\n variant=\"outline\"\n data-testid=\"profile-picker-trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-labelledby={labelId}\n aria-describedby={chosen?.private ? noteId : undefined}\n disabled={disabled || (required && profiles.length === 0)}\n className=\"w-full justify-between px-2.5 text-po-text\"\n >\n <span className=\"truncate\">\n {required && typeof value !== 'string'\n ? t('webComponents.profilePicker.choose', 'Choose a profile')\n : profileChoiceLabel(value, profiles, defaultProfile)}\n </span>\n {status === 'loading' ? (\n <Spinner className=\"size-3 shrink-0\" />\n ) : (\n <ChevronDownIcon className=\"size-3.5 shrink-0 opacity-60\" />\n )}\n </Button>\n </PopoverTrigger>\n <PickerContent\n side=\"bottom\"\n align=\"start\"\n data-testid=\"profile-picker-list\"\n title={t('webComponents.profilePicker.label', 'Profile')}\n meta={\n status === 'loading'\n ? t('webComponents.profilePicker.metaLoading', 'loading')\n : t('webComponents.profilePicker.available', '{count} available', { count: profiles.length })\n }\n items={items}\n value={[profileValueOf(value)]}\n filterable={items.length > 9}\n filterPlaceholder={t('webComponents.profilePicker.filter', 'Filter profiles')}\n className=\"w-[min(360px,calc(100vw-24px))]\"\n onSelect={(next) => {\n onChange(profileChoiceOf(next));\n setOpen(false);\n }}\n />\n </Popover>\n {chosen?.private ? (\n <p\n id={noteId}\n data-testid=\"profile-picker-private-note\"\n className=\"flex items-center gap-1 text-sm text-po-dim\"\n >\n <LockIcon aria-hidden className=\"size-3 shrink-0\" />\n {t('webComponents.profilePicker.privateNote', 'Only you can see sessions started with this profile.')}\n </p>\n ) : null}\n {status === 'loading' ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.loading', 'Loading profiles…')}\n </p>\n ) : status === 'unavailable' ? (\n <p role=\"status\" data-testid=\"profile-picker-note\" className=\"text-sm text-po-dim\">\n {profiles.length === 0\n ? t('webComponents.profilePicker.loadFailed', 'Profiles could not be loaded.')\n : t('webComponents.profilePicker.loadPartial', 'Some profiles could not be loaded.')}{' '}\n {required\n ? null\n : t('webComponents.profilePicker.unavailableNote', 'You can still start a session without one.')}\n </p>\n ) : required && profiles.length === 0 ? (\n <p role=\"status\" className=\"text-sm text-po-dim\">\n {t('webComponents.profilePicker.noneAvailable', 'No profiles are available on this computer yet.')}\n </p>\n ) : null}\n </div>\n );\n}\n\n/**\n * Loads the profile list for one target, such as a workspace, and reloads when `key` changes.\n * Undefined while no loader exists, so a host that offers none shows no picker.\n * Never chooses a profile; an unreachable server is \"unavailable\" with nothing listed.\n */\nexport function useProfileCatalog(\n key: string,\n load: ((signal: AbortSignal) => Promise<unknown>) | undefined,\n): { status: ProfilePickerStatus; profiles: readonly ProfilePickerProfile[]; defaultProfile?: string } | undefined {\n const [loaded, setLoaded] = useState<{ key: string; state: ProfilePickerState } | undefined>();\n // The newest loader without restarting the request each time a host rebuilds it; declared first so it runs first.\n const latest = useRef(load);\n useEffect(() => {\n latest.current = load;\n });\n const enabled = load !== undefined;\n useEffect(() => {\n if (!enabled) return;\n const controller = new AbortController();\n const request = (signal: AbortSignal): Promise<unknown> => latest.current?.(signal) ?? Promise.resolve(undefined);\n void loadProfileCatalog(request, controller.signal).then((state) => {\n if (state !== undefined) setLoaded({ key, state });\n });\n return () => controller.abort();\n }, [key, enabled]);\n if (!enabled) return undefined;\n return loaded?.key === key ? loaded.state : { status: 'loading', profiles: [] };\n}\n"],"mappings":"A,wrBAkDA,SAAgBA,EAAc,CAC5B,WACA,SACA,QACA,WACA,iBACA,WAAW,GACX,WACA,cAAc,GACd,KACA,aACqB,CACrB,IAAMC,EAAIC,EAAK,EACT,CAACC,EAAMC,GAAWC,EAASC,CAAW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A,EACDkC,IAAW,cACb,kBAAC,IAAD,CAAG,KAAK,SAAS,cAAY,sBAAsB,UAAU,sBAA7D,SAAA,CACGxB,EAAS,SAAW,EACjBV,EAAE,yCAA0C,+BAA+B,EAC3EA,EAAE,0CAA2C,oCAAoC,EAAG,IACvFoB,EACG,KACApB,EAAE,8CAA+C,4CAA4C,CAChG,CACD,CAAA,EAAAoB,GAAYV,EAAS,SAAW,EAClC,kBAAC,IAAD,CAAG,KAAK,SAAS,UAAU,sBACxB,SAAAV,EAAE,4CAA6C,iDAAiD,CAChG,CAAA,EACD,IACD,C,EAET,CAOA,SAAgByC,EACd,EACA,EACiH,CACjH,GAAM,CAACC,EAAQC,GAAavC,EAAiE,EAEvFwC,EAASC,EAAOC,CAAI,EAC1BC,MAAgB,CACd,EAAO,QAAUD,CACnB,CAAC,EACD,IAAME,EAAUF,IAAS,IAAA,GAUzB,GATAC,MAAgB,CACd,GAAI,CAACC,EAAS,OACd,IAAMC,EAAa,IAAI,gBAKvB,OAHAC,EADiB,GAA0CN,EAAO,UAAUO,CAAM,GAAK,QAAQ,QAAQ,IAAA,EAAS,EAC/EF,EAAW,MAAM,CAAC,CAAC,KAAM,GAAU,CAC9DG,IAAU,IAAA,IAAWT,EAAU,CAAE,MAAK,OAAM,CAAC,CACnD,CAAC,MACYM,EAAW,MAAM,CAChC,EAAG,CAACI,EAAKL,CAAO,CAAC,EACZA,EACL,OAAON,GAAQ,MAAQW,EAAMX,EAAO,MAAQ,CAAE,OAAQ,UAAW,SAAU,CAAC,CAAE,CAChF,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("lucide-react");function i(e){return/* @__PURE__ */ (0,n.jsx)(t.Select.Root,{"data-slot":`select`,...e})}function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Select.Group,{"data-slot":`select-group`,...e})}function o(e){return/* @__PURE__ */ (0,n.jsx)(t.Select.Value,{"data-slot":`select-value`,...e})}function s({className:i,children:a,...o}){return/* @__PURE__ */ (0,n.jsxs)(t.Select.Trigger,{"data-slot":`select-trigger`,className:e.cn(`flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("lucide-react");function i(e){return/* @__PURE__ */ (0,n.jsx)(t.Select.Root,{"data-slot":`select`,...e})}function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Select.Group,{"data-slot":`select-group`,...e})}function o(e){return/* @__PURE__ */ (0,n.jsx)(t.Select.Value,{"data-slot":`select-value`,...e})}function s({className:i,children:a,...o}){return/* @__PURE__ */ (0,n.jsxs)(t.Select.Trigger,{"data-slot":`select-trigger`,className:e.cn(`flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 data-[placeholder]:text-po-faint *:data-[slot=select-value]:truncate`,i),...o,children:[a,/* @__PURE__ */ (0,n.jsx)(t.Select.Icon,{asChild:!0,children:/* @__PURE__ */ (0,n.jsx)(r.ChevronDown,{className:`h-3 w-3 shrink-0 text-po-faint`})})]})}function c({className:r,position:i=`popper`,sideOffset:a=4,children:o,...s}){return/* @__PURE__ */ (0,n.jsx)(t.Select.Portal,{children:/* @__PURE__ */ (0,n.jsx)(t.Select.Content,{"data-slot":`select-content`,position:i,sideOffset:a,className:e.cn(`z-50 max-h-[320px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded border border-po-border bg-po-panel shadow-xl outline-none data-[state=open]:animate-po-rise`,r),...s,children:/* @__PURE__ */ (0,n.jsx)(t.Select.Viewport,{className:`p-1`,children:o})})})}function l({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Select.Label,{"data-slot":`select-label`,className:e.cn(`px-2 py-1 text-sm font-semibold text-po-dim first-letter:uppercase`,r),...i})}function u({className:i,children:a,...o}){return/* @__PURE__ */ (0,n.jsxs)(t.Select.Item,{"data-slot":`select-item`,className:e.cn(`relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-7 text-base text-po-hi outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-po-deep`,i),...o,children:[/* @__PURE__ */ (0,n.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex h-3 w-3 items-center justify-center`,children:/* @__PURE__ */ (0,n.jsx)(t.Select.ItemIndicator,{children:/* @__PURE__ */ (0,n.jsx)(r.Check,{className:`h-3 w-3 text-po-green`})})}),/* @__PURE__ */ (0,n.jsx)(t.Select.ItemText,{children:a})]})}function d({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Select.Separator,{"data-slot":`select-separator`,className:e.cn(`my-1 h-px bg-po-border-soft`,r),...i})}exports.Select=i,exports.SelectContent=c,exports.SelectGroup=a,exports.SelectItem=u,exports.SelectLabel=l,exports.SelectSeparator=d,exports.SelectTrigger=s,exports.SelectValue=o;
|
|
2
2
|
//# sourceMappingURL=Select.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","names":["SelectPrimitive","cn","ChevronDownIcon","CheckIcon","require_cn","radix_ui","react_jsx_runtime","lucide_react","Select","props","SelectGroup","SelectValue","SelectTrigger","className","children","SelectContent","SelectLabel","SelectItem","SelectSeparator"],"sources":["../../../src/components/Select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CheckIcon, ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/**\n * A single choice from a list, on Radix rather than a native <select>: a\n * native one cannot be styled to the palette on every platform, and the\n * cockpit's model and mode pickers need the same surface a popover has.\n */\nexport function Select(props: ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nexport function SelectGroup(props: ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nexport function SelectValue(props: ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nexport function SelectTrigger({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Trigger>) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n 'flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
{"version":3,"file":"Select.cjs","names":["SelectPrimitive","cn","ChevronDownIcon","CheckIcon","require_cn","radix_ui","react_jsx_runtime","lucide_react","Select","props","SelectGroup","SelectValue","SelectTrigger","className","children","SelectContent","SelectLabel","SelectItem","SelectSeparator"],"sources":["../../../src/components/Select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CheckIcon, ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/**\n * A single choice from a list, on Radix rather than a native <select>: a\n * native one cannot be styled to the palette on every platform, and the\n * cockpit's model and mode pickers need the same surface a popover has.\n */\nexport function Select(props: ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nexport function SelectGroup(props: ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nexport function SelectValue(props: ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nexport function SelectTrigger({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Trigger>) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n 'flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 data-[placeholder]:text-po-faint *:data-[slot=select-value]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"h-3 w-3 shrink-0 text-po-faint\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nexport function SelectContent({\n className,\n position = 'popper',\n sideOffset = 4,\n children,\n ...props\n}: ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n position={position}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 max-h-[320px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded border border-po-border bg-po-panel shadow-xl outline-none data-[state=open]:animate-po-rise',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nexport function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('px-2 py-1 text-sm font-semibold text-po-dim first-letter:uppercase', className)}\n {...props}\n />\n );\n}\n\nexport function SelectItem({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-7 text-base text-po-hi outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-po-deep',\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex h-3 w-3 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-3 w-3 text-po-green\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nexport function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('my-1 h-px bg-po-border-soft', className)}\n {...props}\n />\n );\n}\n"],"mappings":"A,kJAWA,SAAgBQ,EAAO,EAAoD,CACzE,MAAO,iBAAA,EAAAF,EAAA,IAAA,CAACN,EAAAA,OAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAIS,CAAQ,CAAA,CAC9D,CAEA,SAAgBC,EAAY,EAAqD,CAC/E,MAAO,iBAAA,EAAAJ,EAAA,IAAA,CAACN,EAAAA,OAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAIS,CAAQ,CAAA,CACrE,CAEA,SAAgBE,EAAY,EAAqD,CAC/E,MAAO,iBAAA,EAAAL,EAAA,IAAA,CAACN,EAAAA,OAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAIS,CAAQ,CAAA,CACrE,CAEA,SAAgBG,EAAc,CAAE,YAAW,WAAU,GAAGH,GAAyD,CAC/G,MACE,iBAAA,EAAAH,EAAA,KAAA,CAACN,EAAAA,OAAgB,QAAjB,CACE,YAAU,iBACV,UAAWC,EAAAA,GACT,gXACAY,CACF,EACA,GAAIJ,EANN,SAAA,CAQGK,EACD,iBAAA,EAAAR,EAAA,IAAA,CAACN,EAAAA,OAAgB,KAAjB,CAAsB,QAAA,GACpB,SAAA,iBAAA,EAAAM,EAAA,IAAA,CAACJ,EAAAA,YAAD,CAAiB,UAAU,gCAAkC,CAAA,CACzC,CAAA,CACC,C,EAE7B,CAEA,SAAgBa,EAAc,CAC5B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EAAAA,GAAG,8BAA+BY,CAAS,EACtD,GAAIJ,CACL,CAAA,CAEL,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CheckIcon as e,ChevronDownIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{Select as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(e){return/* @__PURE__ */ i(r.Root,{"data-slot":`select`,...e})}function s(e){return/* @__PURE__ */ i(r.Group,{"data-slot":`select-group`,...e})}function c(e){return/* @__PURE__ */ i(r.Value,{"data-slot":`select-value`,...e})}function l({className:e,children:o,...s}){return/* @__PURE__ */ a(r.Trigger,{"data-slot":`select-trigger`,className:n(`flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
import{CheckIcon as e,ChevronDownIcon as t}from"../icons/icons.mjs";import{cn as n}from"../lib/cn.mjs";import{Select as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(e){return/* @__PURE__ */ i(r.Root,{"data-slot":`select`,...e})}function s(e){return/* @__PURE__ */ i(r.Group,{"data-slot":`select-group`,...e})}function c(e){return/* @__PURE__ */ i(r.Value,{"data-slot":`select-value`,...e})}function l({className:e,children:o,...s}){return/* @__PURE__ */ a(r.Trigger,{"data-slot":`select-trigger`,className:n(`flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 data-[placeholder]:text-po-faint *:data-[slot=select-value]:truncate`,e),...s,children:[o,/* @__PURE__ */ i(r.Icon,{asChild:!0,children:/* @__PURE__ */ i(t,{className:`h-3 w-3 shrink-0 text-po-faint`})})]})}function u({className:e,position:t=`popper`,sideOffset:a=4,children:o,...s}){return/* @__PURE__ */ i(r.Portal,{children:/* @__PURE__ */ i(r.Content,{"data-slot":`select-content`,position:t,sideOffset:a,className:n(`z-50 max-h-[320px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded border border-po-border bg-po-panel shadow-xl outline-none data-[state=open]:animate-po-rise`,e),...s,children:/* @__PURE__ */ i(r.Viewport,{className:`p-1`,children:o})})})}function d({className:e,...t}){return/* @__PURE__ */ i(r.Label,{"data-slot":`select-label`,className:n(`px-2 py-1 text-sm font-semibold text-po-dim first-letter:uppercase`,e),...t})}function f({className:t,children:o,...s}){return/* @__PURE__ */ a(r.Item,{"data-slot":`select-item`,className:n(`relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-7 text-base text-po-hi outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-po-deep`,t),...s,children:[/* @__PURE__ */ i(`span`,{className:`pointer-events-none absolute left-2 flex h-3 w-3 items-center justify-center`,children:/* @__PURE__ */ i(r.ItemIndicator,{children:/* @__PURE__ */ i(e,{className:`h-3 w-3 text-po-green`})})}),/* @__PURE__ */ i(r.ItemText,{children:o})]})}function p({className:e,...t}){return/* @__PURE__ */ i(r.Separator,{"data-slot":`select-separator`,className:n(`my-1 h-px bg-po-border-soft`,e),...t})}export{o as Select,u as SelectContent,s as SelectGroup,f as SelectItem,d as SelectLabel,p as SelectSeparator,l as SelectTrigger,c as SelectValue};
|
|
2
2
|
//# sourceMappingURL=Select.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.mjs","names":["Select","SelectPrimitive","Select$1","Select","props","SelectGroup","SelectValue","SelectTrigger","cn","className","children","ChevronDownIcon","SelectContent","SelectLabel","SelectItem","CheckIcon","SelectSeparator"],"sources":["../../../src/components/Select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CheckIcon, ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/**\n * A single choice from a list, on Radix rather than a native <select>: a\n * native one cannot be styled to the palette on every platform, and the\n * cockpit's model and mode pickers need the same surface a popover has.\n */\nexport function Select(props: ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nexport function SelectGroup(props: ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nexport function SelectValue(props: ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nexport function SelectTrigger({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Trigger>) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n 'flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/
|
|
1
|
+
{"version":3,"file":"Select.mjs","names":["Select","SelectPrimitive","Select$1","Select","props","SelectGroup","SelectValue","SelectTrigger","cn","className","children","ChevronDownIcon","SelectContent","SelectLabel","SelectItem","CheckIcon","SelectSeparator"],"sources":["../../../src/components/Select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CheckIcon, ChevronDownIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\n\n/**\n * A single choice from a list, on Radix rather than a native <select>: a\n * native one cannot be styled to the palette on every platform, and the\n * cockpit's model and mode pickers need the same surface a popover has.\n */\nexport function Select(props: ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nexport function SelectGroup(props: ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nexport function SelectValue(props: ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nexport function SelectTrigger({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Trigger>) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n 'flex h-7 cursor-pointer items-center justify-between gap-2 rounded border border-po-border bg-po-deep px-2.5 text-left text-base text-po-hi outline-none transition-colors hover:border-po-green/50 focus-visible:ring-2 focus-visible:ring-po-green/70 disabled:pointer-events-none disabled:opacity-40 data-[placeholder]:text-po-faint *:data-[slot=select-value]:truncate',\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"h-3 w-3 shrink-0 text-po-faint\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nexport function SelectContent({\n className,\n position = 'popper',\n sideOffset = 4,\n children,\n ...props\n}: ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n position={position}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 max-h-[320px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded border border-po-border bg-po-panel shadow-xl outline-none data-[state=open]:animate-po-rise',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nexport function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('px-2 py-1 text-sm font-semibold text-po-dim first-letter:uppercase', className)}\n {...props}\n />\n );\n}\n\nexport function SelectItem({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-7 text-base text-po-hi outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-po-deep',\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex h-3 w-3 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-3 w-3 text-po-green\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nexport function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('my-1 h-px bg-po-border-soft', className)}\n {...props}\n />\n );\n}\n"],"mappings":"A,2LAWA,SAAgBA,EAAO,EAAoD,CACzE,MAAO,kBAACC,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAIG,CAAQ,CAAA,CAC9D,CAEA,SAAgBC,EAAY,EAAqD,CAC/E,MAAO,kBAACJ,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAIG,CAAQ,CAAA,CACrE,CAEA,SAAgBE,EAAY,EAAqD,CAC/E,MAAO,kBAACL,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAIG,CAAQ,CAAA,CACrE,CAEA,SAAgBG,EAAc,CAAE,YAAW,WAAU,GAAGH,GAAyD,CAC/G,MACE,kBAACH,EAAgB,QAAjB,CACE,YAAU,iBACV,UAAWO,EACT,gXACAC,CACF,EACA,GAAIL,EANN,SAAA,CAQGM,EACD,kBAACT,EAAgB,KAAjB,CAAsB,QAAA,GACpB,SAAA,kBAACU,EAAD,CAAiB,UAAU,gCAAkC,CAAA,CACzC,CAAA,CACC,C,EAE7B,CAEA,SAAgBC,EAAc,CAC5B,YACA,WAAW,SACX,aAAa,EACb,WACA,GAAGR,GAC8C,CACjD,MACE,kBAACH,EAAgB,OAAjB,CAAA,SACE,kBAACA,EAAgB,QAAjB,CACE,YAAU,iBACA,WACE,aACZ,UAAWO,EACT,oLACAC,CACF,EACA,GAAIL,EAEJ,SAAA,kBAACH,EAAgB,SAAjB,CAA0B,UAAU,MAAO,UAAmC,CAAA,CACvD,CAAA,CACH,CAAA,CAE5B,CAEA,SAAgBY,EAAY,CAAE,YAAW,GAAGT,GAAuD,CACjG,MACE,kBAACH,EAAgB,MAAjB,CACE,YAAU,eACV,UAAWO,EAAG,qEAAsEC,CAAS,EAC7F,GAAIL,CACL,CAAA,CAEL,CAEA,SAAgBU,EAAW,CAAE,YAAW,WAAU,GAAGV,GAAsD,CACzG,MACE,kBAACH,EAAgB,KAAjB,CACE,YAAU,cACV,UAAWO,EACT,yNACAC,CACF,EACA,GAAIL,EANN,SAAA,CAQE,kBAAC,OAAD,CAAM,UAAU,+EACd,SAAA,kBAACH,EAAgB,cAAjB,CAAA,SACE,kBAACc,EAAD,CAAW,UAAU,uBAAyB,CAAA,CACjB,CAAA,CAC3B,CAAA,EACN,kBAACd,EAAgB,SAAjB,CAA2B,UAAmC,CAAA,CAC1C,C,EAE1B,CAEA,SAAgBe,EAAgB,CAAE,YAAW,GAAGZ,GAA2D,CACzG,MACE,kBAACH,EAAgB,UAAjB,CACE,YAAU,mBACV,UAAWO,EAAG,8BAA+BC,CAAS,EACtD,GAAIL,CACL,CAAA,CAEL,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e=require("@agimon-ai/po-core/web");const t=`default`,n=`none`,r=`profile:`;function i(e){return e===void 0?t:e===null?n:`${r}${e}`}function a(e){if(e===`none`)return null;if(e.startsWith(r))return e.slice(8)}function o(e){return e.identity?.name||e.name}function s(e){return[e.identity?.role,e.identity?.contact].filter(Boolean).join(` · `)||(o(e)===e.name?void 0:e.name)}function c(r){return[{value:t,title:(0,e.t)(`webComponents.profilePicker.default`,`Workspace default`),subtitle:(0,e.t)(`webComponents.profilePicker.defaultSubtitle`,`Use what this workspace sets, if anything`)},{value:n,title:(0,e.t)(`webComponents.profilePicker.none`,`No profile`),subtitle:(0,e.t)(`webComponents.profilePicker.noneSubtitle`,`Start without a profile`)},...r.map(e=>{let t=s(e);return{value:i(e.name),title:o(e),...t===void 0?{}:{subtitle:t}}})]}function l(t,n){if(t===void 0)return(0,e.t)(`webComponents.profilePicker.default`,`Workspace default`)
|
|
1
|
+
let e=require("@agimon-ai/po-core/web");const t=`default`,n=`none`,r=`profile:`;function i(e){return e===void 0?t:e===null?n:`${r}${e}`}function a(e){if(e===`none`)return null;if(e.startsWith(r))return e.slice(8)}function o(e){return e.identity?.name||e.name}function s(e){return[e.identity?.role,e.identity?.contact].filter(Boolean).join(` · `)||(o(e)===e.name?void 0:e.name)}function c(r,a){let c=r.find(e=>e.name===a);return[c?{value:t,title:(0,e.t)(`webComponents.profilePicker.defaultNamed`,`Default`),subtitle:o(c)}:{value:t,title:(0,e.t)(`webComponents.profilePicker.default`,`Workspace default`),subtitle:(0,e.t)(`webComponents.profilePicker.defaultSubtitle`,`Use what this workspace sets, if anything`)},{value:n,title:(0,e.t)(`webComponents.profilePicker.none`,`No profile`),subtitle:(0,e.t)(`webComponents.profilePicker.noneSubtitle`,`Start without a profile`)},...r.map(e=>{let t=s(e);return{value:i(e.name),title:o(e),...t===void 0?{}:{subtitle:t}}})]}function l(e,t,n){let r=e===void 0?n:e;return r==null?void 0:t.find(e=>e.name===r)}function u(e,t,n){return e===void 0?l(e,t,n)?.name:e}function d(t,n,r){if(t===void 0){let i=l(t,n,r);return i?(0,e.t)(`webComponents.profilePicker.defaultLabel`,`Default: {name}`,{name:o(i)}):(0,e.t)(`webComponents.profilePicker.default`,`Workspace default`)}if(t===null)return(0,e.t)(`webComponents.profilePicker.none`,`No profile`);let i=n.find(e=>e.name===t);return i===void 0?t:o(i)}const f=/^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/;function p(e){return typeof e==`string`&&e.length<=262144&&f.test(e)?e:void 0}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){if(!m(e)||typeof e.name!=`string`||e.name===``||typeof e.sourceId!=`string`||e.sourceId===``)return;let t=m(e.identity)?e.identity:void 0,n={};for(let e of[`name`,`icon`,`role`,`contact`]){let r=t?.[e];if(e===`icon`){let e=p(r);e&&(n.icon=e)}else typeof r==`string`&&r!==``&&(n[e]=r)}return{name:e.name,sourceId:e.sourceId,...Object.keys(n).length===0?{}:{identity:n},...e.private===!0?{private:!0}:{}}}function g(e){if(!m(e)||!Array.isArray(e.profiles)||e.readiness!==`ready`&&e.readiness!==`unavailable`)return;let t=/* @__PURE__ */ new Set,n=[];for(let r of e.profiles){let e=h(r);e===void 0||t.has(e.name)||(t.add(e.name),n.push(e))}let r=typeof e.defaultProfile==`string`&&t.has(e.defaultProfile)?e.defaultProfile:void 0;return{profiles:n,readiness:e.readiness,...r===void 0?{}:{defaultProfile:r}}}const _={status:`unavailable`,profiles:[]};async function v(e,t){let n;try{n=await e(t)}catch{n=void 0}if(t.aborted)return;let r=g(n);return r===void 0?_:{status:r.readiness,profiles:r.profiles,...r.defaultProfile===void 0?{}:{defaultProfile:r.defaultProfile}}}exports.DEFAULT_PROFILE_VALUE=t,exports.NO_PROFILE_VALUE=n,exports.effectiveProfile=l,exports.inlineProfileIcon=p,exports.launchProfileChoice=u,exports.loadProfileCatalog=v,exports.parseProfileCatalog=g,exports.profileChoiceLabel=d,exports.profileChoiceOf=a,exports.profilePickerItems=c,exports.profileValueOf=i;
|
|
2
2
|
//# sourceMappingURL=profilePicker.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profilePicker.cjs","names":["t","_agimon_ai_po_core_web","DEFAULT_PROFILE_VALUE","NO_PROFILE_VALUE","PROFILE_PREFIX","profileValueOf","choice","profileChoiceOf","value","titleOf","profile","subtitleOf","profilePickerItems","profiles","subtitle","profileChoiceLabel","candidate","INLINE_ICON","inlineProfileIcon","isRecord","profileOf","identity","presented","key","field","icon","parseProfileCatalog","seen","entry","UNAVAILABLE","loadProfileCatalog","answer","load","signal","catalog"],"sources":["../../../src/lib/profilePicker.ts"],"sourcesContent":["import { t } from '@agimon-ai/po-core/web';\n\nimport type { PickerChoice } from './picker';\n\n/**\n * The launch-time profile choice a person makes before a session exists.\n *\n * `undefined` is \"not chosen\": the workspace default may apply. `null` is an\n * explicit \"No profile\", which no default may override. A string names a profile.\n */\nexport type ProfileChoice = string | null | undefined;\n\n/** What the picker may know about a profile. Never its environment, persona, bindings or secrets. */\nexport interface ProfilePickerProfile {\n readonly name: string;\n /** Presentation only: `role` is what the persona does, `contact` a display-only address its source supplies. */\n readonly identity?: {\n readonly name?: string;\n readonly icon?: string;\n readonly role?: string;\n readonly contact?: string;\n };\n /** `files` for a profile file, otherwise the id of the plugin that contributed it. */\n readonly sourceId: string;\n}\n\nexport interface ProfilePickerCatalog {\n readonly profiles: readonly ProfilePickerProfile[];\n /** `unavailable`: a source did not become ready in time or failed. `profiles` lists what loaded. */\n readonly readiness: 'ready' | 'unavailable';\n}\n\nexport type ProfilePickerStatus = 'loading' | ProfilePickerCatalog['readiness'];\n\nexport interface ProfilePickerState {\n readonly status: Exclude<ProfilePickerStatus, 'loading'>;\n readonly profiles: readonly ProfilePickerProfile[];\n}\n\n/** Row values carry a prefix, so a profile named \"none\" or \"default\" cannot pass for a choice. */\nexport const DEFAULT_PROFILE_VALUE = 'default';\nexport const NO_PROFILE_VALUE = 'none';\nconst PROFILE_PREFIX = 'profile:';\n\nexport const DEFAULT_PROFILE_LABEL = 'Workspace default';\nexport const NO_PROFILE_LABEL = 'No profile';\n\nexport function profileValueOf(choice: ProfileChoice): string {\n if (choice === undefined) return DEFAULT_PROFILE_VALUE;\n if (choice === null) return NO_PROFILE_VALUE;\n return `${PROFILE_PREFIX}${choice}`;\n}\n\nexport function profileChoiceOf(value: string): ProfileChoice {\n if (value === NO_PROFILE_VALUE) return null;\n if (value.startsWith(PROFILE_PREFIX)) return value.slice(PROFILE_PREFIX.length);\n return undefined;\n}\n\nfunction titleOf(profile: ProfilePickerProfile): string {\n return profile.identity?.name || profile.name;\n}\n\n/** Role and contact under the name, otherwise the profile name when the title hides it. */\nfunction subtitleOf(profile: ProfilePickerProfile): string | undefined {\n const presented = [profile.identity?.role, profile.identity?.contact].filter(Boolean).join(' · ');\n if (presented) return presented;\n return titleOf(profile) === profile.name ? undefined : profile.name;\n}\n\n/** The workspace default and No profile first, then every profile in the order given. Nothing is preselected. */\nexport function profilePickerItems(profiles: readonly ProfilePickerProfile[]): PickerChoice[] {\n return [\n {\n value: DEFAULT_PROFILE_VALUE,\n title: t('webComponents.profilePicker.default', 'Workspace default'),\n subtitle: t('webComponents.profilePicker.defaultSubtitle', 'Use what this workspace sets, if anything'),\n },\n {\n value: NO_PROFILE_VALUE,\n title: t('webComponents.profilePicker.none', 'No profile'),\n subtitle: t('webComponents.profilePicker.noneSubtitle', 'Start without a profile'),\n },\n ...profiles.map((profile) => {\n const subtitle = subtitleOf(profile);\n return {\n value: profileValueOf(profile.name),\n title: titleOf(profile),\n ...(subtitle === undefined ? {} : { subtitle }),\n };\n }),\n ];\n}\n\nexport function profileChoiceLabel(choice: ProfileChoice, profiles: readonly ProfilePickerProfile[]): string {\n if (choice === undefined) return t('webComponents.profilePicker.default', 'Workspace default');\n if (choice === null) return t('webComponents.profilePicker.none', 'No profile');\n const profile = profiles.find((candidate) => candidate.name === choice);\n return profile === undefined ? choice : titleOf(profile);\n}\n\nconst INLINE_ICON = /^data:image\\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/;\n/** po-core's `PROFILE_ICON_MAX_DATA_URL_LENGTH`. */\nconst MAX_INLINE_ICON_LENGTH = 262_144;\n\n/**\n * A profile avatar the page may draw: an inline PNG, JPEG, GIF or WebP `data:` URL within po-core's\n * bound, so rendering never contacts a host and never runs an SVG. Anything else is undefined.\n */\nexport function inlineProfileIcon(value: unknown): string | undefined {\n return typeof value === 'string' && value.length <= MAX_INLINE_ICON_LENGTH && INLINE_ICON.test(value)\n ? value\n : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction profileOf(value: unknown): ProfilePickerProfile | undefined {\n if (!isRecord(value) || typeof value.name !== 'string' || value.name === '') return undefined;\n if (typeof value.sourceId !== 'string' || value.sourceId === '') return undefined;\n const identity = isRecord(value.identity) ? value.identity : undefined;\n const presented: Record<string, string> = {};\n for (const key of ['name', 'icon', 'role', 'contact'] as const) {\n const field = identity?.[key];\n if (key === 'icon') {\n const icon = inlineProfileIcon(field);\n if (icon) presented.icon = icon;\n } else if (typeof field === 'string' && field !== '') presented[key] = field;\n }\n return {\n name: value.name,\n sourceId: value.sourceId,\n ...(Object.keys(presented).length === 0 ? {} : { identity: presented }),\n };\n}\n\n/**\n * A server answer reduced to the fields the picker may show, or undefined when it is not a catalog.\n * Any other field is dropped here, so nothing sensitive a server mistakenly adds can reach the page.\n */\nexport function parseProfileCatalog(value: unknown): ProfilePickerCatalog | undefined {\n if (!isRecord(value) || !Array.isArray(value.profiles)) return undefined;\n if (value.readiness !== 'ready' && value.readiness !== 'unavailable') return undefined;\n const seen = new Set<string>();\n const profiles: ProfilePickerProfile[] = [];\n for (const entry of value.profiles) {\n const profile = profileOf(entry);\n if (profile === undefined || seen.has(profile.name)) continue;\n seen.add(profile.name);\n profiles.push(profile);\n }\n return { profiles, readiness: value.readiness };\n}\n\nconst UNAVAILABLE: ProfilePickerState = { status: 'unavailable', profiles: [] };\n\n/**\n * Runs one catalog request. A failed or malformed answer is \"unavailable\" with nothing listed, so a\n * session can still start without a profile. Undefined means the caller gave up on this request.\n */\nexport async function loadProfileCatalog(\n load: (signal: AbortSignal) => Promise<unknown>,\n signal: AbortSignal,\n): Promise<ProfilePickerState | undefined> {\n let answer: unknown;\n try {\n answer = await load(signal);\n } catch {\n answer = undefined;\n }\n if (signal.aborted) return undefined;\n const catalog = parseProfileCatalog(answer);\n return catalog === undefined ? UNAVAILABLE : { status: catalog.readiness, profiles: catalog.profiles };\n}\n"],"mappings":"A,wCAwCA,MAAaE,EA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1C,IAAK,IAAMe,KAASpB,EAAM,SAAU,CAClC,IAAME,EAAUU,EAAUQ,CAAK,EAC3BlB,IAAY,IAAA,IAAaiB,EAAK,IAAIjB,EAAQ,IAAI,IAClDiB,EAAK,IAAIjB,EAAQ,IAAI,EACrBG,EAAS,KAAKH,CAAO,EACvB,CACA,MAAO,CAAE,WAAU,UAAWF,EAAM,SAAU,CAChD,CAEA,MAAMqB,EAAkC,CAAE,OAAQ,cAAe,SAAU,CAAC,CAAE,EAM9E,eAAsBC,EACpB,EACA,EACyC,CACzC,IAAIC,EACJ,GAAI,CACF,EAAS,MAAMC,EAAKC,CAAM,CAC5B,MAAQ,CACN,EAAS,IAAA,EACX,CACA,GAAIA,EAAO,QAAS,OACpB,IAAMC,EAAUR,EAAoBK,CAAM,EAC1C,OAAOG,IAAY,IAAA,GAAYL,EAAc,CAAE,OAAQK,EAAQ,UAAW,SAAUA,EAAQ,QAAS,CACvG,C"}
|
|
1
|
+
{"version":3,"file":"profilePicker.cjs","names":["t","_agimon_ai_po_core_web","DEFAULT_PROFILE_VALUE","NO_PROFILE_VALUE","PROFILE_PREFIX","profileValueOf","choice","profileChoiceOf","value","titleOf","profile","subtitleOf","profilePickerItems","resolved","profiles","defaultProfile","subtitle","effectiveProfile","name","launchProfileChoice","profileChoiceLabel","candidate","INLINE_ICON","inlineProfileIcon","isRecord","profileOf","identity","presented","key","field","icon","parseProfileCatalog","seen","entry","UNAVAILABLE","loadProfileCatalog","answer","load","signal","catalog"],"sources":["../../../src/lib/profilePicker.ts"],"sourcesContent":["import { t } from '@agimon-ai/po-core/web';\n\nimport type { PickerChoice } from './picker';\n\n/**\n * The launch-time profile choice a person makes before a session exists.\n *\n * `undefined` is \"not chosen\": the workspace default may apply. `null` is an\n * explicit \"No profile\", which no default may override. A string names a profile.\n */\nexport type ProfileChoice = string | null | undefined;\n\n/** What the picker may know about a profile. Never its environment, persona, bindings or secrets. */\nexport interface ProfilePickerProfile {\n readonly name: string;\n /** Presentation only: `role` is what the persona does, `contact` a display-only address its source supplies. */\n readonly identity?: {\n readonly name?: string;\n readonly icon?: string;\n readonly role?: string;\n readonly contact?: string;\n };\n /** `files` for a profile file, otherwise the id of the plugin that contributed it. */\n readonly sourceId: string;\n /** Only the person choosing it can see sessions started with it. */\n readonly private?: true;\n}\n\nexport interface ProfilePickerCatalog {\n readonly profiles: readonly ProfilePickerProfile[];\n /** `unavailable`: a source did not become ready in time or failed. `profiles` lists what loaded. */\n readonly readiness: 'ready' | 'unavailable';\n /** The listed profile a launch with nothing chosen would use, when the host can say. */\n readonly defaultProfile?: string;\n}\n\nexport type ProfilePickerStatus = 'loading' | ProfilePickerCatalog['readiness'];\n\nexport interface ProfilePickerState {\n readonly status: Exclude<ProfilePickerStatus, 'loading'>;\n readonly profiles: readonly ProfilePickerProfile[];\n readonly defaultProfile?: string;\n}\n\n/** Row values carry a prefix, so a profile named \"none\" or \"default\" cannot pass for a choice. */\nexport const DEFAULT_PROFILE_VALUE = 'default';\nexport const NO_PROFILE_VALUE = 'none';\nconst PROFILE_PREFIX = 'profile:';\n\nexport const DEFAULT_PROFILE_LABEL = 'Workspace default';\nexport const NO_PROFILE_LABEL = 'No profile';\n\nexport function profileValueOf(choice: ProfileChoice): string {\n if (choice === undefined) return DEFAULT_PROFILE_VALUE;\n if (choice === null) return NO_PROFILE_VALUE;\n return `${PROFILE_PREFIX}${choice}`;\n}\n\nexport function profileChoiceOf(value: string): ProfileChoice {\n if (value === NO_PROFILE_VALUE) return null;\n if (value.startsWith(PROFILE_PREFIX)) return value.slice(PROFILE_PREFIX.length);\n return undefined;\n}\n\nfunction titleOf(profile: ProfilePickerProfile): string {\n return profile.identity?.name || profile.name;\n}\n\n/** Role and contact under the name, otherwise the profile name when the title hides it. */\nfunction subtitleOf(profile: ProfilePickerProfile): string | undefined {\n const presented = [profile.identity?.role, profile.identity?.contact].filter(Boolean).join(' · ');\n if (presented) return presented;\n return titleOf(profile) === profile.name ? undefined : profile.name;\n}\n\n/**\n * The default and No profile first, then every profile in the order given. Nothing is preselected. When the host\n * names the profile the default resolves to, the default row says which one instead of pointing at the workspace.\n */\nexport function profilePickerItems(profiles: readonly ProfilePickerProfile[], defaultProfile?: string): PickerChoice[] {\n const resolved = profiles.find((profile) => profile.name === defaultProfile);\n return [\n resolved\n ? {\n value: DEFAULT_PROFILE_VALUE,\n title: t('webComponents.profilePicker.defaultNamed', 'Default'),\n subtitle: titleOf(resolved),\n }\n : {\n value: DEFAULT_PROFILE_VALUE,\n title: t('webComponents.profilePicker.default', 'Workspace default'),\n subtitle: t('webComponents.profilePicker.defaultSubtitle', 'Use what this workspace sets, if anything'),\n },\n {\n value: NO_PROFILE_VALUE,\n title: t('webComponents.profilePicker.none', 'No profile'),\n subtitle: t('webComponents.profilePicker.noneSubtitle', 'Start without a profile'),\n },\n ...profiles.map((profile) => {\n const subtitle = subtitleOf(profile);\n return {\n value: profileValueOf(profile.name),\n title: titleOf(profile),\n ...(subtitle === undefined ? {} : { subtitle }),\n };\n }),\n ];\n}\n\n/** The listed profile a choice starts with: the named one, or the default's when the host names it. */\nexport function effectiveProfile(\n choice: ProfileChoice,\n profiles: readonly ProfilePickerProfile[],\n defaultProfile?: string,\n): ProfilePickerProfile | undefined {\n const name = choice === undefined ? defaultProfile : choice;\n return name === null || name === undefined ? undefined : profiles.find((profile) => profile.name === name);\n}\n\n/**\n * The choice to submit. A default the picker named is sent as that profile, so the session starts with what the\n * person saw, even if the saved default changes before they create it. An unnamed default stays omitted.\n */\nexport function launchProfileChoice(\n choice: ProfileChoice,\n profiles: readonly ProfilePickerProfile[],\n defaultProfile?: string,\n): ProfileChoice {\n return choice === undefined ? effectiveProfile(choice, profiles, defaultProfile)?.name : choice;\n}\n\nexport function profileChoiceLabel(\n choice: ProfileChoice,\n profiles: readonly ProfilePickerProfile[],\n defaultProfile?: string,\n): string {\n if (choice === undefined) {\n const resolved = effectiveProfile(choice, profiles, defaultProfile);\n return resolved\n ? t('webComponents.profilePicker.defaultLabel', 'Default: {name}', { name: titleOf(resolved) })\n : t('webComponents.profilePicker.default', 'Workspace default');\n }\n if (choice === null) return t('webComponents.profilePicker.none', 'No profile');\n const profile = profiles.find((candidate) => candidate.name === choice);\n return profile === undefined ? choice : titleOf(profile);\n}\n\nconst INLINE_ICON = /^data:image\\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/;\n/** po-core's `PROFILE_ICON_MAX_DATA_URL_LENGTH`. */\nconst MAX_INLINE_ICON_LENGTH = 262_144;\n\n/**\n * A profile avatar the page may draw: an inline PNG, JPEG, GIF or WebP `data:` URL within po-core's\n * bound, so rendering never contacts a host and never runs an SVG. Anything else is undefined.\n */\nexport function inlineProfileIcon(value: unknown): string | undefined {\n return typeof value === 'string' && value.length <= MAX_INLINE_ICON_LENGTH && INLINE_ICON.test(value)\n ? value\n : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction profileOf(value: unknown): ProfilePickerProfile | undefined {\n if (!isRecord(value) || typeof value.name !== 'string' || value.name === '') return undefined;\n if (typeof value.sourceId !== 'string' || value.sourceId === '') return undefined;\n const identity = isRecord(value.identity) ? value.identity : undefined;\n const presented: Record<string, string> = {};\n for (const key of ['name', 'icon', 'role', 'contact'] as const) {\n const field = identity?.[key];\n if (key === 'icon') {\n const icon = inlineProfileIcon(field);\n if (icon) presented.icon = icon;\n } else if (typeof field === 'string' && field !== '') presented[key] = field;\n }\n return {\n name: value.name,\n sourceId: value.sourceId,\n ...(Object.keys(presented).length === 0 ? {} : { identity: presented }),\n ...(value.private === true ? { private: true as const } : {}),\n };\n}\n\n/**\n * A server answer reduced to the fields the picker may show, or undefined when it is not a catalog.\n * Any other field is dropped here, so nothing sensitive a server mistakenly adds can reach the page.\n */\nexport function parseProfileCatalog(value: unknown): ProfilePickerCatalog | undefined {\n if (!isRecord(value) || !Array.isArray(value.profiles)) return undefined;\n if (value.readiness !== 'ready' && value.readiness !== 'unavailable') return undefined;\n const seen = new Set<string>();\n const profiles: ProfilePickerProfile[] = [];\n for (const entry of value.profiles) {\n const profile = profileOf(entry);\n if (profile === undefined || seen.has(profile.name)) continue;\n seen.add(profile.name);\n profiles.push(profile);\n }\n const defaultProfile =\n typeof value.defaultProfile === 'string' && seen.has(value.defaultProfile) ? value.defaultProfile : undefined;\n return { profiles, readiness: value.readiness, ...(defaultProfile === undefined ? {} : { defaultProfile }) };\n}\n\nconst UNAVAILABLE: ProfilePickerState = { status: 'unavailable', profiles: [] };\n\n/**\n * Runs one catalog request. A failed or malformed answer is \"unavailable\" with nothing listed, so a\n * session can still start without a profile. Undefined means the caller gave up on this request.\n */\nexport async function loadProfileCatalog(\n load: (signal: AbortSignal) => Promise<unknown>,\n signal: AbortSignal,\n): Promise<ProfilePickerState | undefined> {\n let answer: unknown;\n try {\n answer = await load(signal);\n } catch {\n answer = undefined;\n }\n if (signal.aborted) return undefined;\n const catalog = parseProfileCatalog(answer);\n if (catalog === undefined) return UNAVAILABLE;\n return {\n status: catalog.readiness,\n profiles: catalog.profiles,\n ...(catalog.defaultProfile === undefined ? {} : { defaultProfile: catalog.defaultProfile }),\n };\n}\n"],"mappings":"A,wCA6CA,MAAaE,EAAwB,UACxBC,EAAmB,OAC1BC,EAAiB,WAKvB,SAAgBC,EAAe,EAA+B,CAG5D,OAFIC,IAAW,IAAA,GAAkBJ,EAC7BI,IAAW,KAAaH,EACrB,GAAGC,IAAiBE,GAC7B,CAEA,SAAgBC,EAAgB,EAA8B,CAC5D,GAAIC,IAAA,OAA4B,OAAO,KACvC,GAAIA,EAAM,WAAWJ,CAAc,EAAG,OAAOI,EAAM,MAAM,CAAqB,CAEhF,CAEA,SAASC,EAAQ,EAAuC,CACtD,OAAOC,EAAQ,UAAU,MAAQA,EAAQ,IAC3C,CAGA,SAASC,EAAW,EAAmD,CAGrE,MAFkB,CAACD,EAAQ,UAAU,KAAMA,EAAQ,UAAU,OAAO,CAAC,CAAC,OAAO,OA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O,CAAE,QAAS,EAAc,EAAI,CAAC,CAC7D,CACF,CAMA,SAAgBuB,EAAoB,EAAkD,CAEpF,GADI,CAACP,EAAShB,CAAK,GAAK,CAAC,MAAM,QAAQA,EAAM,QAAQ,GACjDA,EAAM,YAAc,SAAWA,EAAM,YAAc,cAAe,OACtE,IAAMwB,kBAAO,IAAI,IACXlB,EAAmC,CAAC,EAC1C,IAAK,IAAMmB,KAASzB,EAAM,SAAU,CAClC,IAAME,EAAUe,EAAUQ,CAAK,EAC3BvB,IAAY,IAAA,IAAasB,EAAK,IAAItB,EAAQ,IAAI,IAClDsB,EAAK,IAAItB,EAAQ,IAAI,EACrBI,EAAS,KAAKJ,CAAO,EACvB,CACA,IAAMK,EACJ,OAAOP,EAAM,gBAAmB,UAAYwB,EAAK,IAAIxB,EAAM,cAAc,EAAIA,EAAM,eAAiB,IAAA,GACtG,MAAO,CAAE,WAAU,UAAWA,EAAM,UAAW,GAAIO,IAAmB,IAAA,GAAY,CAAC,EAAI,CAAE,gBAAe,CAAG,CAC7G,CAEA,MAAMmB,EAAkC,CAAE,OAAQ,cAAe,SAAU,CAAC,CAAE,EAM9E,eAAsBC,EACpB,EACA,EACyC,CACzC,IAAIC,EACJ,GAAI,CACF,EAAS,MAAMC,EAAKC,CAAM,CAC5B,MAAQ,CACN,EAAS,IAAA,EACX,CACA,GAAIA,EAAO,QAAS,OACpB,IAAMC,EAAUR,EAAoBK,CAAM,EAE1C,OADIG,IAAY,IAAA,GAAkBL,EAC3B,CACL,OAAQK,EAAQ,UAChB,SAAUA,EAAQ,SAClB,GAAIA,EAAQ,iBAAmB,IAAA,GAAY,CAAC,EAAI,CAAE,eAAgBA,EAAQ,cAAe,CAC3F,CACF,C"}
|
|
@@ -18,17 +18,27 @@ export interface ProfilePickerProfile {
|
|
|
18
18
|
};
|
|
19
19
|
/** `files` for a profile file, otherwise the id of the plugin that contributed it. */
|
|
20
20
|
readonly sourceId: string;
|
|
21
|
+
/** Only the person choosing it can see sessions started with it. */
|
|
22
|
+
readonly private?: true;
|
|
21
23
|
}
|
|
22
24
|
export interface ProfilePickerCatalog {
|
|
23
25
|
readonly profiles: readonly ProfilePickerProfile[];
|
|
24
26
|
/** `unavailable`: a source did not become ready in time or failed. `profiles` lists what loaded. */
|
|
25
27
|
readonly readiness: 'ready' | 'unavailable';
|
|
28
|
+
/** The listed profile a launch with nothing chosen would use, when the host can say. */
|
|
29
|
+
readonly defaultProfile?: string;
|
|
26
30
|
}
|
|
27
31
|
export type ProfilePickerStatus = 'loading' | ProfilePickerCatalog['readiness'];
|
|
28
32
|
export interface ProfilePickerState {
|
|
29
33
|
readonly status: Exclude<ProfilePickerStatus, 'loading'>;
|
|
30
34
|
readonly profiles: readonly ProfilePickerProfile[];
|
|
35
|
+
readonly defaultProfile?: string;
|
|
31
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* The choice to submit. A default the picker named is sent as that profile, so the session starts with what the
|
|
39
|
+
* person saw, even if the saved default changes before they create it. An unnamed default stays omitted.
|
|
40
|
+
*/
|
|
41
|
+
export declare function launchProfileChoice(choice: ProfileChoice, profiles: readonly ProfilePickerProfile[], defaultProfile?: string): ProfileChoice;
|
|
32
42
|
/**
|
|
33
43
|
* A profile avatar the page may draw: an inline PNG, JPEG, GIF or WebP `data:` URL within po-core's
|
|
34
44
|
* bound, so rendering never contacts a host and never runs an SVG. Anything else is undefined.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profilePicker.d.mts","names":[],"sources":["../../../src/lib/profilePicker.ts"],"mappings":";;;;;;;YAUY;;iBAGK;WACN;;WAEA;aACE;aACA;aACA;aACA;;;WAGF;;iBAGM;WACN,mBAAmB;;WAEnB;;YAGC,kCAAkC;iBAE7B;WACN,QAAQ,QAAQ;WAChB,mBAAmB;;;;;;
|
|
1
|
+
{"version":3,"file":"profilePicker.d.mts","names":[],"sources":["../../../src/lib/profilePicker.ts"],"mappings":";;;;;;;YAUY;;iBAGK;WACN;;WAEA;aACE;aACA;aACA;aACA;;;WAGF;;WAEA;;iBAGM;WACN,mBAAmB;;WAEnB;;WAEA;;YAGC,kCAAkC;iBAE7B;WACN,QAAQ,QAAQ;WAChB,mBAAmB;WACnB;;;;;;wBAkFK,oBACd,QAAQ,eACR,mBAAmB,wBACnB,0BACC;;;;;wBA4Ba,kBAAkB;;;;;wBAkClB,oBAAoB,iBAAiB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"@agimon-ai/po-core/web";const t=`default`,n=`none`,r=`profile:`;function i(e){return e===void 0?t:e===null?n:`${r}${e}`}function a(e){if(e===`none`)return null;if(e.startsWith(r))return e.slice(8)}function o(e){return e.identity?.name||e.name}function s(e){return[e.identity?.role,e.identity?.contact].filter(Boolean).join(` · `)||(o(e)===e.name?void 0:e.name)}function c(r){return[{value:t,title:e(`webComponents.profilePicker.default`,`Workspace default`),subtitle:e(`webComponents.profilePicker.defaultSubtitle`,`Use what this workspace sets, if anything`)},{value:n,title:e(`webComponents.profilePicker.none`,`No profile`),subtitle:e(`webComponents.profilePicker.noneSubtitle`,`Start without a profile`)},...r.map(e=>{let t=s(e);return{value:i(e.name),title:o(e),...t===void 0?{}:{subtitle:t}}})]}function l(t,n){if(t===void 0)return e(`webComponents.profilePicker.default`,`Workspace default`)
|
|
1
|
+
import{t as e}from"@agimon-ai/po-core/web";const t=`default`,n=`none`,r=`profile:`;function i(e){return e===void 0?t:e===null?n:`${r}${e}`}function a(e){if(e===`none`)return null;if(e.startsWith(r))return e.slice(8)}function o(e){return e.identity?.name||e.name}function s(e){return[e.identity?.role,e.identity?.contact].filter(Boolean).join(` · `)||(o(e)===e.name?void 0:e.name)}function c(r,a){let c=r.find(e=>e.name===a);return[c?{value:t,title:e(`webComponents.profilePicker.defaultNamed`,`Default`),subtitle:o(c)}:{value:t,title:e(`webComponents.profilePicker.default`,`Workspace default`),subtitle:e(`webComponents.profilePicker.defaultSubtitle`,`Use what this workspace sets, if anything`)},{value:n,title:e(`webComponents.profilePicker.none`,`No profile`),subtitle:e(`webComponents.profilePicker.noneSubtitle`,`Start without a profile`)},...r.map(e=>{let t=s(e);return{value:i(e.name),title:o(e),...t===void 0?{}:{subtitle:t}}})]}function l(e,t,n){let r=e===void 0?n:e;return r==null?void 0:t.find(e=>e.name===r)}function u(e,t,n){return e===void 0?l(e,t,n)?.name:e}function d(t,n,r){if(t===void 0){let i=l(t,n,r);return i?e(`webComponents.profilePicker.defaultLabel`,`Default: {name}`,{name:o(i)}):e(`webComponents.profilePicker.default`,`Workspace default`)}if(t===null)return e(`webComponents.profilePicker.none`,`No profile`);let i=n.find(e=>e.name===t);return i===void 0?t:o(i)}const f=/^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/;function p(e){return typeof e==`string`&&e.length<=262144&&f.test(e)?e:void 0}function m(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function h(e){if(!m(e)||typeof e.name!=`string`||e.name===``||typeof e.sourceId!=`string`||e.sourceId===``)return;let t=m(e.identity)?e.identity:void 0,n={};for(let e of[`name`,`icon`,`role`,`contact`]){let r=t?.[e];if(e===`icon`){let e=p(r);e&&(n.icon=e)}else typeof r==`string`&&r!==``&&(n[e]=r)}return{name:e.name,sourceId:e.sourceId,...Object.keys(n).length===0?{}:{identity:n},...e.private===!0?{private:!0}:{}}}function g(e){if(!m(e)||!Array.isArray(e.profiles)||e.readiness!==`ready`&&e.readiness!==`unavailable`)return;let t=/* @__PURE__ */ new Set,n=[];for(let r of e.profiles){let e=h(r);e===void 0||t.has(e.name)||(t.add(e.name),n.push(e))}let r=typeof e.defaultProfile==`string`&&t.has(e.defaultProfile)?e.defaultProfile:void 0;return{profiles:n,readiness:e.readiness,...r===void 0?{}:{defaultProfile:r}}}const _={status:`unavailable`,profiles:[]};async function v(e,t){let n;try{n=await e(t)}catch{n=void 0}if(t.aborted)return;let r=g(n);return r===void 0?_:{status:r.readiness,profiles:r.profiles,...r.defaultProfile===void 0?{}:{defaultProfile:r.defaultProfile}}}export{t as DEFAULT_PROFILE_VALUE,n as NO_PROFILE_VALUE,l as effectiveProfile,p as inlineProfileIcon,u as launchProfileChoice,v as loadProfileCatalog,g as parseProfileCatalog,d as profileChoiceLabel,a as profileChoiceOf,c as profilePickerItems,i as profileValueOf};
|
|
2
2
|
//# sourceMappingURL=profilePicker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profilePicker.mjs","names":["DEFAULT_PROFILE_VALUE","NO_PROFILE_VALUE","PROFILE_PREFIX","profileValueOf","choice","profileChoiceOf","value","titleOf","profile","subtitleOf","profilePickerItems","t","profiles","subtitle","profileChoiceLabel","candidate","INLINE_ICON","inlineProfileIcon","isRecord","profileOf","identity","presented","key","field","icon","parseProfileCatalog","seen","entry","UNAVAILABLE","loadProfileCatalog","answer","load","signal","catalog"],"sources":["../../../src/lib/profilePicker.ts"],"sourcesContent":["import { t } from '@agimon-ai/po-core/web';\n\nimport type { PickerChoice } from './picker';\n\n/**\n * The launch-time profile choice a person makes before a session exists.\n *\n * `undefined` is \"not chosen\": the workspace default may apply. `null` is an\n * explicit \"No profile\", which no default may override. A string names a profile.\n */\nexport type ProfileChoice = string | null | undefined;\n\n/** What the picker may know about a profile. Never its environment, persona, bindings or secrets. */\nexport interface ProfilePickerProfile {\n readonly name: string;\n /** Presentation only: `role` is what the persona does, `contact` a display-only address its source supplies. */\n readonly identity?: {\n readonly name?: string;\n readonly icon?: string;\n readonly role?: string;\n readonly contact?: string;\n };\n /** `files` for a profile file, otherwise the id of the plugin that contributed it. */\n readonly sourceId: string;\n}\n\nexport interface ProfilePickerCatalog {\n readonly profiles: readonly ProfilePickerProfile[];\n /** `unavailable`: a source did not become ready in time or failed. `profiles` lists what loaded. */\n readonly readiness: 'ready' | 'unavailable';\n}\n\nexport type ProfilePickerStatus = 'loading' | ProfilePickerCatalog['readiness'];\n\nexport interface ProfilePickerState {\n readonly status: Exclude<ProfilePickerStatus, 'loading'>;\n readonly profiles: readonly ProfilePickerProfile[];\n}\n\n/** Row values carry a prefix, so a profile named \"none\" or \"default\" cannot pass for a choice. */\nexport const DEFAULT_PROFILE_VALUE = 'default';\nexport const NO_PROFILE_VALUE = 'none';\nconst PROFILE_PREFIX = 'profile:';\n\nexport const DEFAULT_PROFILE_LABEL = 'Workspace default';\nexport const NO_PROFILE_LABEL = 'No profile';\n\nexport function profileValueOf(choice: ProfileChoice): string {\n if (choice === undefined) return DEFAULT_PROFILE_VALUE;\n if (choice === null) return NO_PROFILE_VALUE;\n return `${PROFILE_PREFIX}${choice}`;\n}\n\nexport function profileChoiceOf(value: string): ProfileChoice {\n if (value === NO_PROFILE_VALUE) return null;\n if (value.startsWith(PROFILE_PREFIX)) return value.slice(PROFILE_PREFIX.length);\n return undefined;\n}\n\nfunction titleOf(profile: ProfilePickerProfile): string {\n return profile.identity?.name || profile.name;\n}\n\n/** Role and contact under the name, otherwise the profile name when the title hides it. */\nfunction subtitleOf(profile: ProfilePickerProfile): string | undefined {\n const presented = [profile.identity?.role, profile.identity?.contact].filter(Boolean).join(' · ');\n if (presented) return presented;\n return titleOf(profile) === profile.name ? undefined : profile.name;\n}\n\n/** The workspace default and No profile first, then every profile in the order given. Nothing is preselected. */\nexport function profilePickerItems(profiles: readonly ProfilePickerProfile[]): PickerChoice[] {\n return [\n {\n value: DEFAULT_PROFILE_VALUE,\n title: t('webComponents.profilePicker.default', 'Workspace default'),\n subtitle: t('webComponents.profilePicker.defaultSubtitle', 'Use what this workspace sets, if anything'),\n },\n {\n value: NO_PROFILE_VALUE,\n title: t('webComponents.profilePicker.none', 'No profile'),\n subtitle: t('webComponents.profilePicker.noneSubtitle', 'Start without a profile'),\n },\n ...profiles.map((profile) => {\n const subtitle = subtitleOf(profile);\n return {\n value: profileValueOf(profile.name),\n title: titleOf(profile),\n ...(subtitle === undefined ? {} : { subtitle }),\n };\n }),\n ];\n}\n\nexport function profileChoiceLabel(choice: ProfileChoice, profiles: readonly ProfilePickerProfile[]): string {\n if (choice === undefined) return t('webComponents.profilePicker.default', 'Workspace default');\n if (choice === null) return t('webComponents.profilePicker.none', 'No profile');\n const profile = profiles.find((candidate) => candidate.name === choice);\n return profile === undefined ? choice : titleOf(profile);\n}\n\nconst INLINE_ICON = /^data:image\\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/;\n/** po-core's `PROFILE_ICON_MAX_DATA_URL_LENGTH`. */\nconst MAX_INLINE_ICON_LENGTH = 262_144;\n\n/**\n * A profile avatar the page may draw: an inline PNG, JPEG, GIF or WebP `data:` URL within po-core's\n * bound, so rendering never contacts a host and never runs an SVG. Anything else is undefined.\n */\nexport function inlineProfileIcon(value: unknown): string | undefined {\n return typeof value === 'string' && value.length <= MAX_INLINE_ICON_LENGTH && INLINE_ICON.test(value)\n ? value\n : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction profileOf(value: unknown): ProfilePickerProfile | undefined {\n if (!isRecord(value) || typeof value.name !== 'string' || value.name === '') return undefined;\n if (typeof value.sourceId !== 'string' || value.sourceId === '') return undefined;\n const identity = isRecord(value.identity) ? value.identity : undefined;\n const presented: Record<string, string> = {};\n for (const key of ['name', 'icon', 'role', 'contact'] as const) {\n const field = identity?.[key];\n if (key === 'icon') {\n const icon = inlineProfileIcon(field);\n if (icon) presented.icon = icon;\n } else if (typeof field === 'string' && field !== '') presented[key] = field;\n }\n return {\n name: value.name,\n sourceId: value.sourceId,\n ...(Object.keys(presented).length === 0 ? {} : { identity: presented }),\n };\n}\n\n/**\n * A server answer reduced to the fields the picker may show, or undefined when it is not a catalog.\n * Any other field is dropped here, so nothing sensitive a server mistakenly adds can reach the page.\n */\nexport function parseProfileCatalog(value: unknown): ProfilePickerCatalog | undefined {\n if (!isRecord(value) || !Array.isArray(value.profiles)) return undefined;\n if (value.readiness !== 'ready' && value.readiness !== 'unavailable') return undefined;\n const seen = new Set<string>();\n const profiles: ProfilePickerProfile[] = [];\n for (const entry of value.profiles) {\n const profile = profileOf(entry);\n if (profile === undefined || seen.has(profile.name)) continue;\n seen.add(profile.name);\n profiles.push(profile);\n }\n return { profiles, readiness: value.readiness };\n}\n\nconst UNAVAILABLE: ProfilePickerState = { status: 'unavailable', profiles: [] };\n\n/**\n * Runs one catalog request. A failed or malformed answer is \"unavailable\" with nothing listed, so a\n * session can still start without a profile. Undefined means the caller gave up on this request.\n */\nexport async function loadProfileCatalog(\n load: (signal: AbortSignal) => Promise<unknown>,\n signal: AbortSignal,\n): Promise<ProfilePickerState | undefined> {\n let answer: unknown;\n try {\n answer = await load(signal);\n } catch {\n answer = undefined;\n }\n if (signal.aborted) return undefined;\n const catalog = parseProfileCatalog(answer);\n return catalog === undefined ? UNAVAILABLE : { status: catalog.readiness, profiles: catalog.profiles };\n}\n"],"mappings":"A,2CAwCA,MAAaA,EAAwB,UACxBC,EAAmB,OAC1BC,EAAiB,WAKvB,SAAgBC,EAAe,EAA+B,CAG5D,OAFIC,IAAW,IAAA,GAAkBJ,EAC7BI,IAAW,KAAaH,EACrB,GAAGC,IAAiBE,GAC7B,CAEA,SAAgBC,EAAgB,EAA8B,CAC5D,GAAIC,IAAA,OAA4B,OAAO,KACvC,GAAIA,EAAM,WAAWJ,CAAc,EAAG,OAAOI,EAAM,MAAM,CAAqB,CAEhF,CAEA,SAASC,EAAQ,EAAuC,CACtD,OAAOC,EAAQ,UAAU,MAAQA,EAAQ,IAC3C,CAGA,SAASC,EAAW,EAAmD,CAGrE,MAFkB,CAACD,EAAQ,UAAU,KAAMA,EAAQ,UAAU,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,KACvF,IACGD,EAAQC,CAAO,IAAMA,EAAQ,KAAO,IAAA,GAAYA,EAAQ,KACjE,CAGA,SAAgBE,EAAmB,EAA2D,CAC5F,MAAO,CACL,CACE,MAAOV,EACP,MAAOW,EAAE,sCAAuC,mBAAmB,EACnE,SAAUA,EAAE,8CAA+C,2CAA2C,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CC,IAAM,EAAU,KAAOA,EAC7B,MAAW,OAAOD,GAAU,UAAYA,IAAU,KAAI,EAAUD,GAAOC,EACzE,CACA,MAAO,CACL,KAAMjB,EAAM,KACZ,SAAUA,EAAM,SAChB,GAAI,OAAO,KAAKe,CAAS,CAAC,CAAC,SAAW,EAAI,CAAC,EAAI,CAAE,SAAUA,CAAU,CACvE,CACF,CAMA,SAAgBI,EAAoB,EAAkD,CAEpF,GADI,CAACP,EAASZ,CAAK,GAAK,CAAC,MAAM,QAAQA,EAAM,QAAQ,GACjDA,EAAM,YAAc,SAAWA,EAAM,YAAc,cAAe,OACtE,IAAMoB,kBAAO,IAAI,IACXd,EAAmC,CAAC,EAC1C,IAAK,IAAMe,KAASrB,EAAM,SAAU,CAClC,IAAME,EAAUW,EAAUQ,CAAK,EAC3BnB,IAAY,IAAA,IAAakB,EAAK,IAAIlB,EAAQ,IAAI,IAClDkB,EAAK,IAAIlB,EAAQ,IAAI,EACrBI,EAAS,KAAKJ,CAAO,EACvB,CACA,MAAO,CAAE,WAAU,UAAWF,EAAM,SAAU,CAChD,CAEA,MAAMsB,EAAkC,CAAE,OAAQ,cAAe,SAAU,CAAC,CAAE,EAM9E,eAAsBC,EACpB,EACA,EACyC,CACzC,IAAIC,EACJ,GAAI,CACF,EAAS,MAAMC,EAAKC,CAAM,CAC5B,MAAQ,CACN,EAAS,IAAA,EACX,CACA,GAAIA,EAAO,QAAS,OACpB,IAAMC,EAAUR,EAAoBK,CAAM,EAC1C,OAAOG,IAAY,IAAA,GAAYL,EAAc,CAAE,OAAQK,EAAQ,UAAW,SAAUA,EAAQ,QAAS,CACvG,C"}
|
|
1
|
+
{"version":3,"file":"profilePicker.mjs","names":["DEFAULT_PROFILE_VALUE","NO_PROFILE_VALUE","PROFILE_PREFIX","profileValueOf","choice","profileChoiceOf","value","titleOf","profile","subtitleOf","profilePickerItems","resolved","profiles","defaultProfile","t","subtitle","effectiveProfile","name","launchProfileChoice","profileChoiceLabel","candidate","INLINE_ICON","inlineProfileIcon","isRecord","profileOf","identity","presented","key","field","icon","parseProfileCatalog","seen","entry","UNAVAILABLE","loadProfileCatalog","answer","load","signal","catalog"],"sources":["../../../src/lib/profilePicker.ts"],"sourcesContent":["import { t } from '@agimon-ai/po-core/web';\n\nimport type { PickerChoice } from './picker';\n\n/**\n * The launch-time profile choice a person makes before a session exists.\n *\n * `undefined` is \"not chosen\": the workspace default may apply. `null` is an\n * explicit \"No profile\", which no default may override. A string names a profile.\n */\nexport type ProfileChoice = string | null | undefined;\n\n/** What the picker may know about a profile. Never its environment, persona, bindings or secrets. */\nexport interface ProfilePickerProfile {\n readonly name: string;\n /** Presentation only: `role` is what the persona does, `contact` a display-only address its source supplies. */\n readonly identity?: {\n readonly name?: string;\n readonly icon?: string;\n readonly role?: string;\n readonly contact?: string;\n };\n /** `files` for a profile file, otherwise the id of the plugin that contributed it. */\n readonly sourceId: string;\n /** Only the person choosing it can see sessions started with it. */\n readonly private?: true;\n}\n\nexport interface ProfilePickerCatalog {\n readonly profiles: readonly ProfilePickerProfile[];\n /** `unavailable`: a source did not become ready in time or failed. `profiles` lists what loaded. */\n readonly readiness: 'ready' | 'unavailable';\n /** The listed profile a launch with nothing chosen would use, when the host can say. */\n readonly defaultProfile?: string;\n}\n\nexport type ProfilePickerStatus = 'loading' | ProfilePickerCatalog['readiness'];\n\nexport interface ProfilePickerState {\n readonly status: Exclude<ProfilePickerStatus, 'loading'>;\n readonly profiles: readonly ProfilePickerProfile[];\n readonly defaultProfile?: string;\n}\n\n/** Row values carry a prefix, so a profile named \"none\" or \"default\" cannot pass for a choice. */\nexport const DEFAULT_PROFILE_VALUE = 'default';\nexport const NO_PROFILE_VALUE = 'none';\nconst PROFILE_PREFIX = 'profile:';\n\nexport const DEFAULT_PROFILE_LABEL = 'Workspace default';\nexport const NO_PROFILE_LABEL = 'No profile';\n\nexport function profileValueOf(choice: ProfileChoice): string {\n if (choice === undefined) return DEFAULT_PROFILE_VALUE;\n if (choice === null) return NO_PROFILE_VALUE;\n return `${PROFILE_PREFIX}${choice}`;\n}\n\nexport function profileChoiceOf(value: string): ProfileChoice {\n if (value === NO_PROFILE_VALUE) return null;\n if (value.startsWith(PROFILE_PREFIX)) return value.slice(PROFILE_PREFIX.length);\n return undefined;\n}\n\nfunction titleOf(profile: ProfilePickerProfile): string {\n return profile.identity?.name || profile.name;\n}\n\n/** Role and contact under the name, otherwise the profile name when the title hides it. */\nfunction subtitleOf(profile: ProfilePickerProfile): string | undefined {\n const presented = [profile.identity?.role, profile.identity?.contact].filter(Boolean).join(' · ');\n if (presented) return presented;\n return titleOf(profile) === profile.name ? undefined : profile.name;\n}\n\n/**\n * The default and No profile first, then every profile in the order given. Nothing is preselected. When the host\n * names the profile the default resolves to, the default row says which one instead of pointing at the workspace.\n */\nexport function profilePickerItems(profiles: readonly ProfilePickerProfile[], defaultProfile?: string): PickerChoice[] {\n const resolved = profiles.find((profile) => profile.name === defaultProfile);\n return [\n resolved\n ? {\n value: DEFAULT_PROFILE_VALUE,\n title: t('webComponents.profilePicker.defaultNamed', 'Default'),\n subtitle: titleOf(resolved),\n }\n : {\n value: DEFAULT_PROFILE_VALUE,\n title: t('webComponents.profilePicker.default', 'Workspace default'),\n subtitle: t('webComponents.profilePicker.defaultSubtitle', 'Use what this workspace sets, if anything'),\n },\n {\n value: NO_PROFILE_VALUE,\n title: t('webComponents.profilePicker.none', 'No profile'),\n subtitle: t('webComponents.profilePicker.noneSubtitle', 'Start without a profile'),\n },\n ...profiles.map((profile) => {\n const subtitle = subtitleOf(profile);\n return {\n value: profileValueOf(profile.name),\n title: titleOf(profile),\n ...(subtitle === undefined ? {} : { subtitle }),\n };\n }),\n ];\n}\n\n/** The listed profile a choice starts with: the named one, or the default's when the host names it. */\nexport function effectiveProfile(\n choice: ProfileChoice,\n profiles: readonly ProfilePickerProfile[],\n defaultProfile?: string,\n): ProfilePickerProfile | undefined {\n const name = choice === undefined ? defaultProfile : choice;\n return name === null || name === undefined ? undefined : profiles.find((profile) => profile.name === name);\n}\n\n/**\n * The choice to submit. A default the picker named is sent as that profile, so the session starts with what the\n * person saw, even if the saved default changes before they create it. An unnamed default stays omitted.\n */\nexport function launchProfileChoice(\n choice: ProfileChoice,\n profiles: readonly ProfilePickerProfile[],\n defaultProfile?: string,\n): ProfileChoice {\n return choice === undefined ? effectiveProfile(choice, profiles, defaultProfile)?.name : choice;\n}\n\nexport function profileChoiceLabel(\n choice: ProfileChoice,\n profiles: readonly ProfilePickerProfile[],\n defaultProfile?: string,\n): string {\n if (choice === undefined) {\n const resolved = effectiveProfile(choice, profiles, defaultProfile);\n return resolved\n ? t('webComponents.profilePicker.defaultLabel', 'Default: {name}', { name: titleOf(resolved) })\n : t('webComponents.profilePicker.default', 'Workspace default');\n }\n if (choice === null) return t('webComponents.profilePicker.none', 'No profile');\n const profile = profiles.find((candidate) => candidate.name === choice);\n return profile === undefined ? choice : titleOf(profile);\n}\n\nconst INLINE_ICON = /^data:image\\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/;\n/** po-core's `PROFILE_ICON_MAX_DATA_URL_LENGTH`. */\nconst MAX_INLINE_ICON_LENGTH = 262_144;\n\n/**\n * A profile avatar the page may draw: an inline PNG, JPEG, GIF or WebP `data:` URL within po-core's\n * bound, so rendering never contacts a host and never runs an SVG. Anything else is undefined.\n */\nexport function inlineProfileIcon(value: unknown): string | undefined {\n return typeof value === 'string' && value.length <= MAX_INLINE_ICON_LENGTH && INLINE_ICON.test(value)\n ? value\n : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction profileOf(value: unknown): ProfilePickerProfile | undefined {\n if (!isRecord(value) || typeof value.name !== 'string' || value.name === '') return undefined;\n if (typeof value.sourceId !== 'string' || value.sourceId === '') return undefined;\n const identity = isRecord(value.identity) ? value.identity : undefined;\n const presented: Record<string, string> = {};\n for (const key of ['name', 'icon', 'role', 'contact'] as const) {\n const field = identity?.[key];\n if (key === 'icon') {\n const icon = inlineProfileIcon(field);\n if (icon) presented.icon = icon;\n } else if (typeof field === 'string' && field !== '') presented[key] = field;\n }\n return {\n name: value.name,\n sourceId: value.sourceId,\n ...(Object.keys(presented).length === 0 ? {} : { identity: presented }),\n ...(value.private === true ? { private: true as const } : {}),\n };\n}\n\n/**\n * A server answer reduced to the fields the picker may show, or undefined when it is not a catalog.\n * Any other field is dropped here, so nothing sensitive a server mistakenly adds can reach the page.\n */\nexport function parseProfileCatalog(value: unknown): ProfilePickerCatalog | undefined {\n if (!isRecord(value) || !Array.isArray(value.profiles)) return undefined;\n if (value.readiness !== 'ready' && value.readiness !== 'unavailable') return undefined;\n const seen = new Set<string>();\n const profiles: ProfilePickerProfile[] = [];\n for (const entry of value.profiles) {\n const profile = profileOf(entry);\n if (profile === undefined || seen.has(profile.name)) continue;\n seen.add(profile.name);\n profiles.push(profile);\n }\n const defaultProfile =\n typeof value.defaultProfile === 'string' && seen.has(value.defaultProfile) ? value.defaultProfile : undefined;\n return { profiles, readiness: value.readiness, ...(defaultProfile === undefined ? {} : { defaultProfile }) };\n}\n\nconst UNAVAILABLE: ProfilePickerState = { status: 'unavailable', profiles: [] };\n\n/**\n * Runs one catalog request. A failed or malformed answer is \"unavailable\" with nothing listed, so a\n * session can still start without a profile. Undefined means the caller gave up on this request.\n */\nexport async function loadProfileCatalog(\n load: (signal: AbortSignal) => Promise<unknown>,\n signal: AbortSignal,\n): Promise<ProfilePickerState | undefined> {\n let answer: unknown;\n try {\n answer = await load(signal);\n } catch {\n answer = undefined;\n }\n if (signal.aborted) return undefined;\n const catalog = parseProfileCatalog(answer);\n if (catalog === undefined) return UNAVAILABLE;\n return {\n status: catalog.readiness,\n profiles: catalog.profiles,\n ...(catalog.defaultProfile === undefined ? {} : { defaultProfile: catalog.defaultProfile }),\n };\n}\n"],"mappings":"A,2CA6CA,MAAaA,EAAwB,UACxBC,EAAmB,OAC1BC,EAAiB,WAKvB,SAAgBC,EAA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,GAAIA,EAAQ,iBAAmB,IAAA,GAAY,CAAC,EAAI,CAAE,eAAgBA,EAAQ,cAAe,CAC3F,CACF,C"}
|
package/locales/vi.json
CHANGED
|
@@ -142,6 +142,8 @@
|
|
|
142
142
|
"webComponents.profilePicker.available": "{count} có sẵn",
|
|
143
143
|
"webComponents.profilePicker.choose": "Chọn hồ sơ vai trò",
|
|
144
144
|
"webComponents.profilePicker.default": "Mặc định của không gian làm việc",
|
|
145
|
+
"webComponents.profilePicker.defaultLabel": "Mặc định: {name}",
|
|
146
|
+
"webComponents.profilePicker.defaultNamed": "Mặc định",
|
|
145
147
|
"webComponents.profilePicker.defaultSubtitle": "Dùng thiết lập của không gian làm việc này, nếu có",
|
|
146
148
|
"webComponents.profilePicker.filter": "Lọc hồ sơ vai trò",
|
|
147
149
|
"webComponents.profilePicker.label": "Hồ sơ vai trò",
|
|
@@ -153,6 +155,8 @@
|
|
|
153
155
|
"webComponents.profilePicker.none": "Không dùng hồ sơ vai trò",
|
|
154
156
|
"webComponents.profilePicker.noneAvailable": "Chưa có hồ sơ vai trò nào trên máy tính này.",
|
|
155
157
|
"webComponents.profilePicker.noneSubtitle": "Bắt đầu mà không dùng hồ sơ vai trò",
|
|
158
|
+
"webComponents.profilePicker.private": "Riêng tư",
|
|
159
|
+
"webComponents.profilePicker.privateNote": "Chỉ bạn thấy được các phiên bắt đầu bằng hồ sơ vai trò này.",
|
|
156
160
|
"webComponents.profilePicker.unavailableNote": "Bạn vẫn có thể bắt đầu phiên mà không cần hồ sơ vai trò.",
|
|
157
161
|
"webComponents.qrCode.label": "Mã QR ghép nối",
|
|
158
162
|
"webComponents.review.add": "Thêm bình luận",
|
package/locales/zh-CN.json
CHANGED
|
@@ -142,6 +142,8 @@
|
|
|
142
142
|
"webComponents.profilePicker.available": "{count} 个可用",
|
|
143
143
|
"webComponents.profilePicker.choose": "选择角色配置",
|
|
144
144
|
"webComponents.profilePicker.default": "工作区默认",
|
|
145
|
+
"webComponents.profilePicker.defaultLabel": "默认:{name}",
|
|
146
|
+
"webComponents.profilePicker.defaultNamed": "默认",
|
|
145
147
|
"webComponents.profilePicker.defaultSubtitle": "使用此工作区的设置(如有)",
|
|
146
148
|
"webComponents.profilePicker.filter": "筛选角色配置",
|
|
147
149
|
"webComponents.profilePicker.label": "角色配置",
|
|
@@ -153,6 +155,8 @@
|
|
|
153
155
|
"webComponents.profilePicker.none": "无角色配置",
|
|
154
156
|
"webComponents.profilePicker.noneAvailable": "此电脑上暂无可用的角色配置。",
|
|
155
157
|
"webComponents.profilePicker.noneSubtitle": "不使用角色配置开始",
|
|
158
|
+
"webComponents.profilePicker.private": "私有",
|
|
159
|
+
"webComponents.profilePicker.privateNote": "只有你能看到使用此角色配置启动的会话。",
|
|
156
160
|
"webComponents.profilePicker.unavailableNote": "不选择也可以开始会话。",
|
|
157
161
|
"webComponents.qrCode.label": "配对二维码",
|
|
158
162
|
"webComponents.review.add": "添加评论",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-web-components",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.214",
|
|
4
4
|
"description": "Shared web components and theme tokens for the Po cockpit and its web plugins: shadcn-style primitives on Radix, tuned to the Po palette, with runtime theme configs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -122,9 +122,9 @@
|
|
|
122
122
|
"tailwind-merge": "3.7.0"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
126
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
127
|
-
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.
|
|
125
|
+
"@agimon-ai/po-build": "0.0.0-alpha.214",
|
|
126
|
+
"@agimon-ai/po-core": "0.0.0-alpha.214",
|
|
127
|
+
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.214",
|
|
128
128
|
"@types/node": "26.6.5",
|
|
129
129
|
"@types/react": "19.3.0",
|
|
130
130
|
"@types/react-dom": "19.3.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"vitest": "5.0.4"
|
|
138
138
|
},
|
|
139
139
|
"peerDependencies": {
|
|
140
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
140
|
+
"@agimon-ai/po-core": "0.0.0-alpha.214",
|
|
141
141
|
"react": "^19.0.0",
|
|
142
142
|
"react-dom": "^19.0.0"
|
|
143
143
|
},
|