@flexkit/studio 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/activity-nav-button-AESIPODJ.js +2 -0
  2. package/dist/activity-nav-button-AESIPODJ.js.map +1 -0
  3. package/dist/chat-page-S2YGOKO5.js +4 -0
  4. package/dist/{chat-page-YWENJEUP.js.map → chat-page-S2YGOKO5.js.map} +1 -1
  5. package/dist/chunk-2AHDTE5T.js +2 -0
  6. package/dist/{chunk-OFLU53AC.js.map → chunk-2AHDTE5T.js.map} +1 -1
  7. package/dist/chunk-32ZU4MLE.js +2 -0
  8. package/dist/{chunk-ODORXGGY.js.map → chunk-32ZU4MLE.js.map} +1 -1
  9. package/dist/chunk-3C2EG3SI.js +2 -0
  10. package/dist/{chunk-GW37ZTR2.js.map → chunk-3C2EG3SI.js.map} +1 -1
  11. package/dist/chunk-3TGCCDOR.js +2 -0
  12. package/dist/chunk-3TGCCDOR.js.map +1 -0
  13. package/dist/chunk-6NRQMG26.js +2 -0
  14. package/dist/chunk-6NRQMG26.js.map +1 -0
  15. package/dist/{chunk-LYGHDJ5A.js → chunk-6RDPFMLK.js} +2 -2
  16. package/dist/{chunk-LYGHDJ5A.js.map → chunk-6RDPFMLK.js.map} +1 -1
  17. package/dist/chunk-CKNFYN3O.js +3 -0
  18. package/dist/chunk-CKNFYN3O.js.map +1 -0
  19. package/dist/chunk-J2G4C6I5.js +2 -0
  20. package/dist/chunk-J2G4C6I5.js.map +1 -0
  21. package/dist/{chunk-7ZDMZVDA.js → chunk-KWS3NAYS.js} +5 -5
  22. package/dist/{chunk-7ZDMZVDA.js.map → chunk-KWS3NAYS.js.map} +1 -1
  23. package/dist/chunk-LN55VJ35.js +3 -0
  24. package/dist/chunk-LN55VJ35.js.map +1 -0
  25. package/dist/{chunk-Z6IEBNKV.js → chunk-NOFQHWES.js} +2 -2
  26. package/dist/{chunk-Z6IEBNKV.js.map → chunk-NOFQHWES.js.map} +1 -1
  27. package/dist/chunk-NYKATVPZ.js +4 -0
  28. package/dist/{chunk-3FIKCGSP.js.map → chunk-NYKATVPZ.js.map} +1 -1
  29. package/dist/chunk-PWQPA2QL.js +2 -0
  30. package/dist/chunk-PWQPA2QL.js.map +1 -0
  31. package/dist/chunk-SVZY7ZZD.js +8 -0
  32. package/dist/chunk-SVZY7ZZD.js.map +1 -0
  33. package/dist/chunk-TWMX2IQ2.js +3 -0
  34. package/dist/chunk-TWMX2IQ2.js.map +1 -0
  35. package/dist/chunk-U45E5X3H.js +2 -0
  36. package/dist/chunk-U45E5X3H.js.map +1 -0
  37. package/dist/chunk-USNXQOMJ.js +2 -0
  38. package/dist/chunk-USNXQOMJ.js.map +1 -0
  39. package/dist/chunk-YCCFUGWJ.js +7 -0
  40. package/dist/chunk-YCCFUGWJ.js.map +1 -0
  41. package/dist/index.css +41 -0
  42. package/dist/index.d.ts +11 -1
  43. package/dist/index.js +9 -9
  44. package/dist/index.js.map +1 -1
  45. package/dist/list-PNKQAYUK.js +2 -0
  46. package/dist/{list-3K2PBGML.js.map → list-PNKQAYUK.js.map} +1 -1
  47. package/dist/logo-JAWR6P43.js +2 -0
  48. package/dist/logo-JAWR6P43.js.map +1 -0
  49. package/dist/pages-KHFSZ3PH.js +3 -0
  50. package/dist/pages-KHFSZ3PH.js.map +1 -0
  51. package/dist/plugin-pages-SE52XFFW.js +2 -0
  52. package/dist/{plugin-pages-Q77CBW45.js.map → plugin-pages-SE52XFFW.js.map} +1 -1
  53. package/dist/root-44ZJLA4E.js +2 -0
  54. package/dist/root-44ZJLA4E.js.map +1 -0
  55. package/dist/root-BH3PQS2H.js +31 -0
  56. package/dist/{root-EZWV5VA4.js.map → root-BH3PQS2H.js.map} +1 -1
  57. package/dist/root-LFQA2VSE.js +2 -0
  58. package/dist/{root-4TME2KMP.js.map → root-LFQA2VSE.js.map} +1 -1
  59. package/dist/{root-4ZVGVCYY.js → root-X5NDURAN.js} +10 -10
  60. package/dist/{root-4ZVGVCYY.js.map → root-X5NDURAN.js.map} +1 -1
  61. package/dist/search-Q65IC67C.js +2 -0
  62. package/dist/{search-7NX232AW.js.map → search-Q65IC67C.js.map} +1 -1
  63. package/dist/skills-pages-TWOIIU5J.js +2 -0
  64. package/dist/{skills-pages-SMJ4EWZW.js.map → skills-pages-TWOIIU5J.js.map} +1 -1
  65. package/dist/spec-renderer-EX7SCFWH.js +2 -0
  66. package/dist/{spec-renderer-5YGDRF52.js.map → spec-renderer-EX7SCFWH.js.map} +1 -1
  67. package/dist/ui.js +1 -1
  68. package/dist/user-nav-QZTYBG45.js +2 -0
  69. package/dist/user-nav-QZTYBG45.js.map +1 -0
  70. package/package.json +3 -3
  71. package/dist/chat-page-YWENJEUP.js +0 -4
  72. package/dist/chunk-2FQWBOU6.js +0 -6
  73. package/dist/chunk-2FQWBOU6.js.map +0 -1
  74. package/dist/chunk-3FIKCGSP.js +0 -4
  75. package/dist/chunk-4BX7OJJ6.js +0 -2
  76. package/dist/chunk-4BX7OJJ6.js.map +0 -1
  77. package/dist/chunk-5DHOBLAE.js +0 -2
  78. package/dist/chunk-5DHOBLAE.js.map +0 -1
  79. package/dist/chunk-66N44IKJ.js +0 -3
  80. package/dist/chunk-66N44IKJ.js.map +0 -1
  81. package/dist/chunk-GW37ZTR2.js +0 -2
  82. package/dist/chunk-H6TOYVW2.js +0 -3
  83. package/dist/chunk-H6TOYVW2.js.map +0 -1
  84. package/dist/chunk-ODORXGGY.js +0 -2
  85. package/dist/chunk-OFLU53AC.js +0 -2
  86. package/dist/chunk-YIGEER6B.js +0 -7
  87. package/dist/chunk-YIGEER6B.js.map +0 -1
  88. package/dist/list-3K2PBGML.js +0 -2
  89. package/dist/logo-MU7MGYDH.js +0 -3
  90. package/dist/logo-MU7MGYDH.js.map +0 -1
  91. package/dist/pages-BDZ4ZXBS.js +0 -3
  92. package/dist/pages-BDZ4ZXBS.js.map +0 -1
  93. package/dist/plugin-pages-Q77CBW45.js +0 -2
  94. package/dist/root-4TME2KMP.js +0 -2
  95. package/dist/root-EZWV5VA4.js +0 -31
  96. package/dist/root-YKNISFWH.js +0 -2
  97. package/dist/root-YKNISFWH.js.map +0 -1
  98. package/dist/search-7NX232AW.js +0 -2
  99. package/dist/skills-pages-SMJ4EWZW.js +0 -2
  100. package/dist/spec-renderer-5YGDRF52.js +0 -2
  101. package/dist/user-nav-QZFCICK3.js +0 -2
  102. package/dist/user-nav-QZFCICK3.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import'./index.css';export{c as CatalogHeader,e as InstalledPluginsPage,b as PluginConnectControl,f as PluginDetailPage,d as PluginsPage}from'./chunk-4BX7OJJ6.js';import'./chunk-H6TOYVW2.js';import'./chunk-66N44IKJ.js';import'./chunk-NNA4MLFC.js';import'./chunk-YIGEER6B.js';import'./chunk-ODORXGGY.js';import'./chunk-SZEGGBOC.js';import'./chunk-5DHOBLAE.js';import'./chunk-HDOIOXMP.js';import'./chunk-O2QMYUPS.js';//# sourceMappingURL=plugin-pages-Q77CBW45.js.map
2
- //# sourceMappingURL=plugin-pages-Q77CBW45.js.map
@@ -1,2 +0,0 @@
1
- import'./index.css';import {c}from'./chunk-2DXR5NJV.js';import {f}from'./chunk-66N44IKJ.js';import {h}from'./chunk-NNA4MLFC.js';import {Q,ba,U}from'./chunk-YIGEER6B.js';import'./chunk-ODORXGGY.js';import'./chunk-SZEGGBOC.js';import'./chunk-5DHOBLAE.js';import'./chunk-HDOIOXMP.js';import'./chunk-O2QMYUPS.js';import {Outlet}from'react-router-dom';import {jsxs,jsx}from'react/jsx-runtime';var S="flexkit:sidebar:state";function A(){let[,a]=h(),{currentProject:t}=f(),c$1=t?.schema??[],u=t?.menuGroups??[],p=c(c$1,a.user?.spaces),f$1=document.cookie.split("; ").find(d=>d.startsWith(`${S}=`))?.split("=")[1]!=="false";return jsxs(Q,{defaultOpen:f$1,children:[jsx(ba,{schema:p,menuGroups:u}),jsx(U,{children:jsx(Outlet,{})})]})}export{A as Root};//# sourceMappingURL=root-4TME2KMP.js.map
2
- //# sourceMappingURL=root-4TME2KMP.js.map
@@ -1,31 +0,0 @@
1
- import'./index.css';import {f}from'./chunk-66N44IKJ.js';import'./chunk-NNA4MLFC.js';import {x,y as y$1,la,ma,na,L,M,O,oa,z}from'./chunk-YIGEER6B.js';import {v,w,x as x$1}from'./chunk-ODORXGGY.js';import'./chunk-SZEGGBOC.js';import {d}from'./chunk-5DHOBLAE.js';import'./chunk-HDOIOXMP.js';import'./chunk-O2QMYUPS.js';import {useMemo,useState,useRef,useEffect,Children,useCallback,Fragment as Fragment$1}from'react';import {createGraphiQLFetcher}from'@graphiql/toolkit';import {GraphiQLProvider,useEditorContext,useExecutionContext,useSchemaContext,useStorageContext,usePluginContext,useCopyQuery,useMergeQuery,usePrettifyEditors,useTheme,ToolbarButton,PrettifyIcon,MergeIcon,CopyIcon,Tooltip,UnStyledButton,PlusIcon,ReloadIcon,KeyboardShortcutIcon,SettingsIcon,Tabs,Tab,QueryEditor,ExecuteButton,VariableEditor,Spinner,ResponseEditor,Dialog,ButtonGroup,Button,isMacOs}from'@graphiql/react';import {HISTORY_PLUGIN,HistoryContextProvider}from'@graphiql/plugin-history';import {ChevronsRight,ChevronsLeft}from'lucide-react';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import'@graphiql/react/style.css';import'@graphiql/plugin-history/style.css';function y({dangerouslyAssumeSchemaIsValid:t,confirmCloseTab:i,defaultQuery:n,defaultTabs:l,externalFragments:f,fetcher:s,getDefaultFieldNames:d,headers:E,inputValueDeprecation:k,introspectionQueryName:M,maxHistoryLength:h,onEditOperationName:A,onSchemaChange:O,onTabChange:B,onTogglePluginVisibility:T,operationName:L,plugins:p,query:C,response:v,schema:R,schemaDescription:I,shouldPersistHeaders:Q,storage:z,validationRules:w,variables:F,visiblePlugin:D,defaultHeaders:U,...m}){if(typeof s!="function")throw new TypeError("The `GraphiQL` component requires a `fetcher` function to be passed as prop.");let V=useMemo(()=>{let S=p??[];return S.some($=>$.title===HISTORY_PLUGIN.title)?S:[HISTORY_PLUGIN,...S]},[p]);return jsx(GraphiQLProvider,{getDefaultFieldNames:d,dangerouslyAssumeSchemaIsValid:t,defaultQuery:n,defaultHeaders:U,defaultTabs:l,externalFragments:f,fetcher:s,headers:E,inputValueDeprecation:k,introspectionQueryName:M,onEditOperationName:A,onSchemaChange:O,onTabChange:B,onTogglePluginVisibility:T,plugins:V,visiblePlugin:D,operationName:L,query:C,response:v,schema:R,schemaDescription:I,shouldPersistHeaders:Q,storage:z,validationRules:w,variables:F,children:jsx(HistoryContextProvider,{maxHistoryLength:h,children:jsx(lt,{confirmCloseTab:i,showPersistHeadersSettings:Q!==false,disableTabs:m.disableTabs??false,forcedTheme:m.forcedTheme,...m})})})}y.Toolbar=ge;y.Footer=ye;var at=["light","dark","system"],H="graphiql-session-tab-",pe="flexkit-explorer:layout",me=3;function it(t){if(typeof t=="number")return t;if(typeof t!="object"||t===null||!("asPercentage"in t))return;let i=t.asPercentage;if(typeof i=="number")return i}function ot(t){return !t||typeof t!="object"||Array.isArray(t)?false:Object.values(t).every(i=>typeof i=="number")}function nt(t){if(typeof window>"u")return;let i=window.localStorage.getItem(t);if(i)try{let n=JSON.parse(i);if(ot(n))return n}catch{return}}function rt(t,i){if(!(typeof window>"u"))try{window.localStorage.setItem(t,JSON.stringify(i));}catch{}}function lt(t){let i=useEditorContext({nonNull:true}),n=useExecutionContext({nonNull:true}),l=useSchemaContext({nonNull:true}),f=useStorageContext(),s=usePluginContext(),[d$1,E]=useState(false),k=useRef(null),M$1=useMemo(()=>nt(pe),[]),h=useMemo(()=>t.forcedTheme&&at.includes(t.forcedTheme)?t.forcedTheme:void 0,[t.forcedTheme]),A=useCopyQuery({onCopyQuery:t.onCopyQuery}),O$1=useMergeQuery(),B=usePrettifyEditors(),{setTheme:T}=useTheme(t.defaultTheme);useEffect(()=>{h==="system"?T(null):(h==="light"||h==="dark")&&T(h);},[h,T]),useEffect(()=>{s?.setVisiblePlugin(s.plugins[0]);},[s]);let[L$1,p]=useState(null),[C,v$1]=useState(null),R=Children.toArray(t.children),I=R.find(a=>be(a,y.Toolbar))??jsxs(Fragment,{children:[jsx(ToolbarButton,{onClick:B,label:"Prettify query (Shift-Ctrl-P)",children:jsx(PrettifyIcon,{className:"fk:w-6 fk:h-6 fk:block","aria-hidden":"true"})}),jsx(ToolbarButton,{onClick:O$1,label:"Merge fragments into query (Shift-Ctrl-M)",children:jsx(MergeIcon,{className:"fk:w-6 fk:h-6 fk:block","aria-hidden":"true"})}),jsx(ToolbarButton,{onClick:A,label:"Copy query (Shift-Ctrl-C)",children:jsx(CopyIcon,{className:"fk:w-6 fk:h-6 fk:block","aria-hidden":"true"})}),t.toolbar?.additionalContent,t.toolbar?.additionalComponent&&jsx(t.toolbar.additionalComponent,{})]}),Q=R.find(a=>be(a,y.Footer)),z$1=useCallback(()=>{try{f?.clear(),v$1("success");}catch{v$1("error");}},[f]),w$1=useCallback(a=>{i.setShouldPersistHeaders(a.currentTarget.dataset.value==="true");},[i]),F=()=>{i.addTab();},D=()=>{l.introspect();},U=a=>{i.moveTab(a);},m=useCallback(a=>{p(a.currentTarget.dataset.value);},[]),V=useCallback(a=>{let r=s,u=Number(a.currentTarget.dataset.index);if(!r)return;let x=r.plugins.find((mt,xe)=>u===xe)??null;if(x===r.visiblePlugin){r.setVisiblePlugin(null);return}r.setVisiblePlugin(x);},[s]),S=useCallback(a=>{a||p(null);},[]),$=useCallback(a=>{a||(p(null),v$1(null));},[]),ke=jsx(Tooltip,{label:"Add tab",children:jsx(UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:F,"aria-label":"Add tab",children:jsx(PlusIcon,{"aria-hidden":"true"})})}),Te=t.className?` ${t.className}`:"",_=t.confirmCloseTab,Ce=useCallback(async a=>{let r=a.currentTarget.previousSibling,u=Number(r.id.replace(H,""));(!_||await _(u))&&(i.activeTabIndex===u&&n.stop(),i.closeTab(u));},[_,i,n]),ve=useCallback(a=>{let r=Number(a.currentTarget.id.replace(H,""));n.stop(),i.changeTab(r);},[i,n]),Se=useCallback(a=>{rt(pe,a);},[]);return jsx(Tooltip.Provider,{children:jsxs("div",{className:`graphiql-container${Te}`,children:[jsxs(x,{className:"fk:h-full fk:max-h-full",defaultLayout:M$1,id:"explorer",onLayoutChanged:Se,orientation:"horizontal",children:[jsxs(y$1,{collapsible:true,collapsedSize:`${me}%`,defaultSize:"22%",id:"explorer-sidebar",minSize:"10%",onResize:a=>{let r=k.current;if(r){E(r.isCollapsed());return}let u=it(a);u!==void 0&&E(u<=me);},panelRef:k,children:[jsx("div",{className:"fk:flex fk:w-full fk:h-full fk:pb-6",children:jsxs(la,{className:"fk:w-full",defaultValue:s?.plugins[0].title,children:[jsxs("div",{className:`fk:flex fk:items-center fk:py-1 ${d$1?"":"fk:px-3"}`,children:[jsx(ma,{className:d$1?"fk:hidden":"",children:s?.plugins.map((a,r)=>{let x=`${a===s.visiblePlugin?"Hide":"Show"} ${a.title}`;return jsx(na,{"aria-label":x,className:"fk:text-muted-foreground","data-index":r,onClick:V,value:a.title,children:jsx(a.icon,{"aria-hidden":"true"})},a.title)})}),jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(d,{className:d$1?"fk:ml-1.5":"fk:ml-auto",onClick:()=>{let a=k.current;d$1?a?.expand():a?.collapse();},size:"icon",variant:"ghost",children:d$1?jsxs(Fragment,{children:[jsx(ChevronsRight,{className:"fk:w-4 fk:h-4"}),jsx("span",{className:"fk:sr-only",children:"Expand"})]}):jsxs(Fragment,{children:[jsx(ChevronsLeft,{className:"fk:w-4 fk:h-4"}),jsx("span",{className:"fk:sr-only",children:"Collapse"})]})})}),jsx(O,{children:d$1?"Expand":"Collapse"})]})]}),d$1?null:jsx(v,{}),s?.plugins.map(a=>jsx(oa,{className:`fk:flex fk:w-full fk:max-h-full fk:mt-0 ${d$1?"fk:hidden":""}`,value:a.title,children:jsxs(w,{className:"fk:flex fk:w-full fk:max-h-full fk:overflow-auto fk:pl-3 fk:pr-6 fk:pt-3 fk:pb-6 fk:mb-3 fk:[&>div>div]:block!",children:[jsx(a.content,{}),jsx(x$1,{orientation:"horizontal"})]})},a.title))]})}),jsx(Tooltip,{label:"Re-fetch GraphQL schema",children:jsx(UnStyledButton,{type:"button",disabled:l.isFetching,onClick:D,"aria-label":"Re-fetch GraphQL schema",children:jsx(ReloadIcon,{className:l.isFetching?"graphiql-spin":"","aria-hidden":"true"})})}),jsx(Tooltip,{label:"Open short keys dialog",children:jsx(UnStyledButton,{type:"button","data-value":"short-keys",onClick:m,"aria-label":"Open short keys dialog",children:jsx(KeyboardShortcutIcon,{"aria-hidden":"true"})})}),jsx(Tooltip,{label:"Open settings dialog",children:jsx(UnStyledButton,{type:"button","data-value":"settings",onClick:m,"aria-label":"Open settings dialog",children:jsx(SettingsIcon,{"aria-hidden":"true"})})})]}),jsx(z,{className:"fk:hover:bg-blue-500 fk:transition-colors",withHandle:true}),jsx(y$1,{className:"fk:bg-muted",defaultSize:"40%",id:"explorer-editor",children:jsxs("div",{className:"fk:flex fk:flex-col fk:h-full",children:[jsxs("div",{className:"fk:flex fk:items-center fk:py-1 fk:px-4 fk:gap-6 fk:bg-muted",children:[!t.disableTabs&&jsx(Tabs,{"aria-label":"Select active operation",className:"fk:p-1! fk:bg-muted fk:rounded-md",onReorder:U,values:i.tabs,children:i.tabs.length>0&&jsx(Fragment,{children:i.tabs.map((a,r)=>jsxs(Tab,{isActive:r===i.activeTabIndex,value:a,children:[jsx(Tab.Button,{"aria-controls":"graphiql-session",id:`${H}${r.toString()}`,onClick:ve,children:a.title}),jsx(Tab.Close,{onClick:Ce})]},a.id))})}),ke]}),jsx("div",{role:"tabpanel",id:"graphiql-session",className:"graphiql-session","aria-labelledby":`${H}${i.activeTabIndex}`,children:jsx("div",{className:`graphiql-editors${i.tabs.length===1?" full-height":""}`,children:jsxs(x,{orientation:"vertical",children:[jsxs(y$1,{className:"fk:flex fk:w-full fk:gap-x-4 fk:px-4 fk:py-2",defaultSize:"80%",children:[jsx(QueryEditor,{editorTheme:t.editorTheme,keyMap:t.keyMap,onCopyQuery:t.onCopyQuery,onEdit:t.onEditQuery,readOnly:t.readOnly}),jsxs("div",{className:"graphiql-toolbar",role:"toolbar","aria-label":"Editor Commands",children:[jsx(ExecuteButton,{}),I]})]}),jsx(z,{className:"fk:hover:bg-blue-500 fk:transition-colors",withHandle:true}),jsxs(y$1,{className:"fk:bg-muted fk:px-4 fk:pt-2",defaultSize:"20%",children:[jsx("div",{className:"fk:text-sm fk:font-medium fk:text-muted-foreground",children:"Variables"}),jsx(VariableEditor,{editorTheme:t.editorTheme,isHidden:false,keyMap:t.keyMap,onEdit:t.onEditVariables,readOnly:t.readOnly})]})]})})})]})}),jsx(z,{className:"fk:hover:bg-blue-500 fk:transition-colors",withHandle:true}),jsx(y$1,{className:"fk:px-5 fk:pt-10 fk:relative",defaultSize:"38%",id:"explorer-response",children:jsxs("div",{className:"graphiql-response fk:h-full",children:[n.isFetching?jsx(Spinner,{}):null,jsx(ResponseEditor,{editorTheme:t.editorTheme,responseTooltip:t.responseTooltip,keyMap:t.keyMap}),Q]})})]}),jsxs(Dialog,{open:L$1==="short-keys",onOpenChange:S,children:[jsxs("div",{className:"graphiql-dialog-header",children:[jsx(Dialog.Title,{className:"graphiql-dialog-title",children:"Short Keys"}),jsx(Dialog.Close,{})]}),jsx("div",{className:"graphiql-dialog-section",children:jsx(dt,{keyMap:t.keyMap||"sublime"})})]}),jsxs(Dialog,{open:L$1==="settings",onOpenChange:$,children:[jsxs("div",{className:"graphiql-dialog-header",children:[jsx(Dialog.Title,{className:"graphiql-dialog-title",children:"Settings"}),jsx(Dialog.Close,{})]}),t.showPersistHeadersSettings?jsxs("div",{className:"graphiql-dialog-section",children:[jsxs("div",{children:[jsx("div",{className:"graphiql-dialog-section-title",children:"Persist headers"}),jsxs("div",{className:"graphiql-dialog-section-caption",children:["Save headers upon reloading."," ",jsx("span",{className:"graphiql-warning-text",children:"Only enable if you trust this device."})]})]}),jsxs(ButtonGroup,{children:[jsx(Button,{type:"button",id:"enable-persist-headers",className:i.shouldPersistHeaders?"active":"","data-value":"true",onClick:w$1,children:"On"}),jsx(Button,{type:"button",id:"disable-persist-headers",className:i.shouldPersistHeaders?"":"active",onClick:w$1,children:"Off"})]})]}):null,f?jsxs("div",{className:"graphiql-dialog-section",children:[jsxs("div",{children:[jsx("div",{className:"graphiql-dialog-section-title",children:"Clear storage"}),jsx("div",{className:"graphiql-dialog-section-caption",children:"Remove all locally stored data and start fresh."})]}),jsx(Button,{type:"button",state:C||void 0,disabled:C==="success",onClick:z$1,children:{success:"Cleared data",error:"Failed"}[C]||"Clear data"})]}):null]})]})})}var Y=isMacOs?"\u2318":"Ctrl",st=Object.entries({"Search in editor":[Y,"F"],"Search in documentation":[Y,"K"],"Execute query":[Y,"Enter"],"Prettify editors":["Ctrl","Shift","P"],"Merge fragments definitions into operation definition":["Ctrl","Shift","M"],"Copy query":["Ctrl","Shift","C"],"Re-fetch schema using introspection":["Ctrl","Shift","R"]});function dt({keyMap:t}){return jsxs("div",{children:[jsxs("table",{className:"graphiql-table",children:[jsx("thead",{children:jsxs("tr",{children:[jsx("th",{children:"Short Key"}),jsx("th",{children:"Function"})]})}),jsx("tbody",{children:st.map(([i,n])=>jsxs("tr",{children:[jsx("td",{children:n.map((l,f,s)=>jsxs(Fragment$1,{children:[jsx("code",{className:"graphiql-key",children:l}),f!==s.length-1&&" + "]},l))}),jsx("td",{children:i})]},i))})]}),jsxs("p",{children:["The editors use"," ",jsx("a",{href:"https://codemirror.net/5/doc/manual.html#keymaps",target:"_blank",rel:"noopener noreferrer",children:"CodeMirror Key Maps"})," ","that add more short keys. This instance of Graph",jsx("em",{children:"i"}),"QL uses ",jsx("code",{children:t}),"."]})]})}function ge(t){return jsx(Fragment,{children:t.children})}ge.displayName="GraphiQLToolbar";function ye(t){return jsx("div",{className:"graphiql-footer",children:t.children})}ye.displayName="GraphiQLFooter";function be(t,i){let n=typeof t=="object"&&t!==null?t:null;if(!n)return false;let l=n.type;return typeof l=="object"&&l!==null&&"displayName"in l&&typeof l.displayName=="string"&&l.displayName===i.displayName?true:n.type===i}var ft=`# Welcome to Flexkit Explorer
2
- #
3
- # Explorer is an in-browser tool for writing, validating, and
4
- # testing GraphQL queries against your Flexkit datasource.
5
- #
6
- # Type queries into this side of the screen, and you will see intelligent
7
- # typeaheads aware of the current GraphQL schema and live syntax and
8
- # validation errors highlighted within the text.
9
- #
10
- # GraphQL queries typically start with a "{" character. Lines that start
11
- # with a # are ignored.
12
- #
13
- # An example GraphQL query might look like:
14
- #
15
- # {
16
- # field(arg: "value") {
17
- # subField
18
- # }
19
- # }
20
- #
21
- # Keyboard shortcuts:
22
- #
23
- # Prettify query: Shift-Ctrl-P (or press the prettify button)
24
- #
25
- # Merge fragments: Shift-Ctrl-M (or press the merge button)
26
- #
27
- # Run Query: Ctrl-Enter (or press the play button)
28
- #
29
- # Auto Complete: Ctrl-Space (or just start typing)
30
- #`;function Qt(){let{currentProjectId:t}=f(),i=`/api/flexkit/${t}/graphql`,n=useMemo(()=>createGraphiQLFetcher({url:i}),[i]);return jsx(y,{fetcher:n,forcedTheme:"light",defaultQuery:ft})}export{Qt as Root};//# sourceMappingURL=root-EZWV5VA4.js.map
31
- //# sourceMappingURL=root-EZWV5VA4.js.map
@@ -1,2 +0,0 @@
1
- import'./index.css';import {b,c}from'./chunk-OFLU53AC.js';import'./chunk-2FQWBOU6.js';import {g,f as f$1}from'./chunk-H6TOYVW2.js';import {f}from'./chunk-66N44IKJ.js';import'./chunk-NNA4MLFC.js';import {Q as Q$1,U,R,W,Y,s,V,Z,_,$,T}from'./chunk-YIGEER6B.js';import {b as b$1}from'./chunk-ODORXGGY.js';import'./chunk-SZEGGBOC.js';import'./chunk-5DHOBLAE.js';import'./chunk-HDOIOXMP.js';import'./chunk-O2QMYUPS.js';import {Outlet,useLocation,NavLink}from'react-router-dom';import {useState}from'react';import {SearchIcon,XIcon,SquarePenIcon,BotIcon,HistoryIcon,InboxIcon,PlugIcon}from'lucide-react';import z from'swr';import {jsxs,jsx}from'react/jsx-runtime';var D=300,l=NavLink;function Q(){let{currentProjectId:s}=f(),{data:t}=z(s?g(s).approvalsCount:null,f$1,{refreshInterval:3e4}),a=t?.pendingCount??0;return a===0?null:jsx(b$1,{className:"fk:ml-auto fk:h-5 fk:min-w-5 fk:justify-center fk:rounded-full fk:bg-amber-500/20 fk:px-1.5 fk:text-[0.6875rem] fk:text-amber-600 fk:border-none fk:corner-squircle",children:a>99?"99+":a.toString()})}function y(){let t=useLocation().pathname.replace(/\/$/,""),a=t.endsWith("/ai/agent"),M=t.endsWith("/ai/runs"),w=t.endsWith("/ai/approvals"),B=t.includes("/ai/plugins")||t.includes("/ai/skills"),P=t.includes("/ai/automations"),[p,m]=useState(""),R$1=b(p.trim(),D);return jsxs(R,{collapsible:"icon",variant:"inset",children:[jsx(W,{className:"fk:shrink-0 fk:pb-1.5 fk:group-data-[collapsible=icon]:hidden",children:jsxs(Y,{className:"fk:relative",children:[jsx(SearchIcon,{className:"fk:absolute fk:left-2 fk:top-1/2 fk:size-3.5 fk:-translate-y-1/2 fk:text-muted-foreground"}),jsx(s,{className:"fk:h-8 fk:bg-background fk:pl-7 fk:pr-7 fk:text-sm",placeholder:"Search chats...",value:p,onChange:E=>m(E.target.value)}),p?jsx("button",{"aria-label":"Clear search",className:"fk:absolute fk:right-2 fk:top-1/2 fk:-translate-y-1/2 fk:cursor-pointer fk:text-muted-foreground fk:hover:text-foreground",type:"button",onClick:()=>m(""),children:jsx(XIcon,{className:"fk:size-3.5"})}):null]})}),jsxs(V,{children:[jsx(W,{children:jsxs(Z,{children:[jsx(_,{children:jsx($,{asChild:true,isActive:a,tooltip:"New chat",children:jsxs(l,{to:"agent",children:[jsx(SquarePenIcon,{className:"fk:h-4 fk:w-4",strokeWidth:2}),jsx("span",{children:"New chat"})]})})}),jsx(_,{children:jsx($,{asChild:true,isActive:P,tooltip:"Automations",children:jsxs(l,{to:"automations",children:[jsx(BotIcon,{className:"fk:h-4 fk:w-4",strokeWidth:2}),jsx("span",{children:"Automations"})]})})}),jsx(_,{children:jsx($,{asChild:true,isActive:M,tooltip:"Run History",children:jsxs(l,{to:"runs",children:[jsx(HistoryIcon,{className:"fk:h-4 fk:w-4",strokeWidth:2}),jsx("span",{children:"Run History"})]})})}),jsx(_,{children:jsx($,{asChild:true,isActive:w,tooltip:"Approvals",children:jsxs(l,{to:"approvals",children:[jsx(InboxIcon,{className:"fk:h-4 fk:w-4",strokeWidth:2}),jsx("span",{children:"Approvals"}),jsx(Q,{})]})})}),jsx(_,{children:jsx($,{asChild:true,isActive:B,tooltip:"Plugins",children:jsxs(l,{to:"plugins",children:[jsx(PlugIcon,{className:"fk:size-4"}),jsx("span",{children:"Plugins"})]})})})]})}),jsx(W,{className:"fk:mt-4 fk:group-data-[collapsible=icon]:hidden",children:jsx(Y,{children:jsx(c,{query:R$1})})})]}),jsx(T,{})]})}var K="flexkit:sidebar:state";function fe(){let{currentProjectId:s}=f(),t=document.cookie.split("; ").find(a=>a.startsWith(`${K}=`))?.split("=")[1]!=="false";return s?jsxs(Q$1,{className:"fk:h-full",defaultOpen:t,children:[jsx(y,{}),jsx(U,{className:"fk:min-w-0",children:jsx("div",{className:"fk:flex fk:h-full fk:min-h-0 fk:min-w-0 fk:flex-col fk:overflow-hidden fk:pl-4 fk:pt-3",children:jsx("div",{className:"fk:flex fk:min-h-0 fk:min-w-0 fk:flex-1 fk:flex-col",children:jsx(Outlet,{})})})})]}):jsx("main",{className:"fk:flex fk:h-full fk:flex-1 fk:items-center fk:justify-center fk:p-8 fk:text-sm fk:text-muted-foreground",children:"Select a project to manage automations and skills."})}export{fe as Root};//# sourceMappingURL=root-YKNISFWH.js.map
2
- //# sourceMappingURL=root-YKNISFWH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/apps/ai/sidebar.tsx","../src/apps/ai/root.tsx"],"names":["SEARCH_DEBOUNCE_MS","NavLinkCompat","NavLink","PendingApprovalsBadge","currentProjectId","useConfig","data","useSWR","paths","fetcher","pendingCount","jsx","Badge","AutomationsSidebar","pathname","useLocation","isNewChat","isRunHistory","isApprovals","isPlugins","isAutomations","query","setQuery","useState","debouncedQuery","useDebouncedValue","jsxs","Sidebar","SidebarGroup","SidebarGroupContent","SearchIcon","Input","event","XIcon","SidebarContent","SidebarMenu","SidebarMenuItem","SidebarMenuButton","SquarePenIcon","BotIcon","HistoryIcon","InboxIcon","PlugIcon","AgentChatsSection","SidebarRail","SIDEBAR_COOKIE_NAME","Root","defaultOpen","row","SidebarProvider","SidebarInset","Outlet"],"mappings":"ipBAsBA,IAAMA,CAAAA,CAAqB,GAAA,CAErBC,CAAAA,CAAgBC,OAAAA,CAKtB,SAASC,CAAAA,EAA4C,CACnD,GAAM,CAAE,gBAAA,CAAAC,CAAiB,CAAA,CAAIC,CAAAA,EAAU,CACjC,CAAE,IAAA,CAAAC,CAAK,CAAA,CAAIC,CAAAA,CACfH,CAAAA,CAAmBI,CAAAA,CAAMJ,CAAgB,CAAA,CAAE,cAAA,CAAiB,IAAA,CAC5DK,GAAAA,CACA,CAAE,eAAA,CAAiB,GAAO,CAC5B,CAAA,CACMC,CAAAA,CAAeJ,CAAAA,EAAM,YAAA,EAAgB,CAAA,CAE3C,OAAII,CAAAA,GAAiB,CAAA,CACZ,IAAA,CAIPC,GAAAA,CAACC,GAAAA,CAAA,CAAM,SAAA,CAAU,qKAAA,CACd,QAAA,CAAAF,CAAAA,CAAe,EAAA,CAAK,KAAA,CAAQA,CAAAA,CAAa,QAAA,EAAS,CACrD,CAEJ,CAEO,SAASG,CAAAA,EAAkC,CAEhD,IAAMC,CAAAA,CADWC,WAAAA,EAAY,CACH,QAAA,CAAS,OAAA,CAAQ,KAAA,CAAO,EAAE,CAAA,CAC9CC,CAAAA,CAAYF,CAAAA,CAAS,QAAA,CAAS,WAAW,CAAA,CACzCG,CAAAA,CAAeH,CAAAA,CAAS,QAAA,CAAS,UAAU,CAAA,CAC3CI,CAAAA,CAAcJ,CAAAA,CAAS,QAAA,CAAS,eAAe,CAAA,CAC/CK,CAAAA,CAAYL,CAAAA,CAAS,QAAA,CAAS,aAAa,CAAA,EAAKA,CAAAA,CAAS,SAAS,YAAY,CAAA,CAC9EM,CAAAA,CAAgBN,CAAAA,CAAS,QAAA,CAAS,iBAAiB,CAAA,CACnD,CAACO,CAAAA,CAAOC,CAAQ,CAAA,CAAIC,QAAAA,CAAS,EAAE,CAAA,CAC/BC,GAAAA,CAAiBC,CAAAA,CAAkBJ,CAAAA,CAAM,IAAA,EAAK,CAAGrB,CAAkB,CAAA,CAEzE,OACE0B,IAAAA,CAACC,CAAAA,CAAA,CAAa,WAAA,CAAY,MAAA,CAAO,OAAA,CAAQ,OAAA,CACvC,QAAA,CAAA,CAAAhB,GAAAA,CAACiB,CAAAA,CAAA,CAAa,SAAA,CAAU,+DAAA,CACtB,QAAA,CAAAF,IAAAA,CAACG,CAAAA,CAAA,CAAoB,SAAA,CAAU,aAAA,CAC7B,QAAA,CAAA,CAAAlB,GAAAA,CAACmB,UAAAA,CAAA,CAAW,SAAA,CAAU,2FAAA,CAA4F,CAAA,CAClHnB,GAAAA,CAACoB,CAAAA,CAAA,CACC,SAAA,CAAU,oDAAA,CACV,WAAA,CAAY,iBAAA,CACZ,KAAA,CAAOV,CAAAA,CACP,QAAA,CAAWW,CAAAA,EAAUV,CAAAA,CAASU,CAAAA,CAAM,MAAA,CAAO,KAAK,CAAA,CAClD,CAAA,CACCX,CAAAA,CACCV,GAAAA,CAAC,QAAA,CAAA,CACC,YAAA,CAAW,cAAA,CACX,SAAA,CAAU,2HAAA,CACV,IAAA,CAAK,QAAA,CACL,OAAA,CAAS,IAAMW,CAAAA,CAAS,EAAE,CAAA,CAE1B,QAAA,CAAAX,GAAAA,CAACsB,KAAAA,CAAA,CAAM,SAAA,CAAU,aAAA,CAAc,CAAA,CACjC,CAAA,CACE,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CACAP,IAAAA,CAACQ,CAAAA,CAAA,CACC,QAAA,CAAA,CAAAvB,GAAAA,CAACiB,CAAAA,CAAA,CACC,QAAA,CAAAF,IAAAA,CAACS,CAAAA,CAAA,CACC,QAAA,CAAA,CAAAxB,GAAAA,CAACyB,CAAAA,CAAA,CACC,QAAA,CAAAzB,GAAAA,CAAC0B,CAAAA,CAAA,CAAkB,OAAA,CAAO,IAAA,CAAC,QAAA,CAAUrB,CAAAA,CAAW,OAAA,CAAQ,UAAA,CACtD,QAAA,CAAAU,IAAAA,CAACzB,CAAAA,CAAA,CAAc,EAAA,CAAG,OAAA,CAChB,QAAA,CAAA,CAAAU,GAAAA,CAAC2B,aAAAA,CAAA,CAAc,SAAA,CAAU,eAAA,CAAgB,WAAA,CAAa,EAAG,CAAA,CACzD3B,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,UAAA,CAAQ,CAAA,CAAA,CAChB,CAAA,CACF,CAAA,CACF,CAAA,CACAA,GAAAA,CAACyB,CAAAA,CAAA,CACC,QAAA,CAAAzB,GAAAA,CAAC0B,CAAAA,CAAA,CAAkB,OAAA,CAAO,IAAA,CAAC,QAAA,CAAUjB,CAAAA,CAAe,OAAA,CAAQ,aAAA,CAC1D,QAAA,CAAAM,IAAAA,CAACzB,CAAAA,CAAA,CAAc,EAAA,CAAG,aAAA,CAChB,QAAA,CAAA,CAAAU,GAAAA,CAAC4B,OAAAA,CAAA,CAAQ,SAAA,CAAU,eAAA,CAAgB,WAAA,CAAa,CAAA,CAAG,CAAA,CACnD5B,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,aAAA,CAAW,CAAA,CAAA,CACnB,CAAA,CACF,CAAA,CACF,CAAA,CACAA,GAAAA,CAACyB,CAAAA,CAAA,CACC,QAAA,CAAAzB,GAAAA,CAAC0B,CAAAA,CAAA,CAAkB,OAAA,CAAO,IAAA,CAAC,QAAA,CAAUpB,CAAAA,CAAc,OAAA,CAAQ,aAAA,CACzD,QAAA,CAAAS,IAAAA,CAACzB,CAAAA,CAAA,CAAc,EAAA,CAAG,MAAA,CAChB,QAAA,CAAA,CAAAU,GAAAA,CAAC6B,WAAAA,CAAA,CAAY,SAAA,CAAU,eAAA,CAAgB,WAAA,CAAa,CAAA,CAAG,CAAA,CACvD7B,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,aAAA,CAAW,CAAA,CAAA,CACnB,CAAA,CACF,CAAA,CACF,CAAA,CACAA,GAAAA,CAACyB,CAAAA,CAAA,CACC,QAAA,CAAAzB,GAAAA,CAAC0B,CAAAA,CAAA,CAAkB,OAAA,CAAO,IAAA,CAAC,QAAA,CAAUnB,CAAAA,CAAa,OAAA,CAAQ,WAAA,CACxD,QAAA,CAAAQ,IAAAA,CAACzB,CAAAA,CAAA,CAAc,EAAA,CAAG,WAAA,CAChB,QAAA,CAAA,CAAAU,GAAAA,CAAC8B,SAAAA,CAAA,CAAU,SAAA,CAAU,eAAA,CAAgB,WAAA,CAAa,CAAA,CAAG,CAAA,CACrD9B,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,WAAA,CAAS,CAAA,CACfA,GAAAA,CAACR,CAAAA,CAAA,EAAsB,CAAA,CAAA,CACzB,CAAA,CACF,CAAA,CACF,CAAA,CACAQ,GAAAA,CAACyB,CAAAA,CAAA,CACC,QAAA,CAAAzB,GAAAA,CAAC0B,CAAAA,CAAA,CAAkB,OAAA,CAAO,IAAA,CAAC,QAAA,CAAUlB,CAAAA,CAAW,QAAQ,SAAA,CACtD,QAAA,CAAAO,IAAAA,CAACzB,CAAAA,CAAA,CAAc,EAAA,CAAG,SAAA,CAChB,QAAA,CAAA,CAAAU,GAAAA,CAAC+B,QAAAA,CAAA,CAAS,SAAA,CAAU,WAAA,CAAY,CAAA,CAChC/B,GAAAA,CAAC,MAAA,CAAA,CAAK,QAAA,CAAA,SAAA,CAAO,CAAA,CAAA,CACf,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CACAA,GAAAA,CAACiB,CAAAA,CAAA,CAAa,SAAA,CAAU,iDAAA,CACtB,QAAA,CAAAjB,GAAAA,CAACkB,CAAAA,CAAA,CACC,QAAA,CAAAlB,GAAAA,CAACgC,CAAAA,CAAA,CAAkB,KAAA,CAAOnB,GAAAA,CAAgB,CAAA,CAC5C,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CACAb,GAAAA,CAACiC,CAAAA,CAAA,EAAY,CAAA,CAAA,CACf,CAEJ,CCpIA,IAAMC,CAAAA,CAAsB,uBAAA,CAErB,SAASC,EAAAA,EAAoB,CAClC,GAAM,CAAE,gBAAA,CAAA1C,CAAiB,CAAA,CAAIC,GAAU,CACjC0C,CAAAA,CACJ,QAAA,CAAS,MAAA,CACN,KAAA,CAAM,IAAI,CAAA,CACV,IAAA,CAAMC,CAAAA,EAAQA,CAAAA,CAAI,UAAA,CAAW,CAAA,EAAGH,CAAmB,CAAA,CAAA,CAAG,CAAC,CAAA,EACtD,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,GAAM,OAAA,CAExB,OAAKzC,CAAAA,CASHsB,IAAAA,CAACuB,GAAAA,CAAA,CAAgB,SAAA,CAAU,WAAA,CAAY,WAAA,CAAaF,CAAAA,CAClD,QAAA,CAAA,CAAApC,GAAAA,CAACE,CAAAA,CAAA,EAAmB,CAAA,CACpBF,GAAAA,CAACuC,CAAAA,CAAA,CAAa,SAAA,CAAU,YAAA,CACtB,QAAA,CAAAvC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,wFAAA,CACb,QAAA,CAAAA,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qDAAA,CACb,QAAA,CAAAA,GAAAA,CAACwC,MAAAA,CAAA,EAAO,CAAA,CACV,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAhBExC,GAAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,0GAAA,CAA2G,8DAE3H,CAgBN","file":"root-YKNISFWH.js","sourcesContent":["import type { JSX } from 'react';\nimport { useState } from 'react';\nimport { BotIcon, PlugIcon, HistoryIcon, InboxIcon, SearchIcon, SquarePenIcon, XIcon } from 'lucide-react';\nimport { NavLink, useLocation } from 'react-router-dom';\nimport useSWR from 'swr';\nimport { useConfig } from '../../core/config/config-context';\nimport {\n Badge,\n Input,\n SidebarContent,\n SidebarGroup,\n SidebarGroupContent,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarPanel,\n SidebarRail,\n} from '../../ui';\nimport { fetcher, paths } from './api';\nimport { AgentChatsSection, useDebouncedValue } from './agent/chat-list';\nimport type { AutomationApprovals } from './types';\n\nconst SEARCH_DEBOUNCE_MS = 300;\n\nconst NavLinkCompat = NavLink as unknown as React.ComponentType<{\n children?: React.ReactNode;\n to: string;\n}>;\n\nfunction PendingApprovalsBadge(): JSX.Element | null {\n const { currentProjectId } = useConfig();\n const { data } = useSWR<AutomationApprovals>(\n currentProjectId ? paths(currentProjectId).approvalsCount : null,\n fetcher,\n { refreshInterval: 30_000 }\n );\n const pendingCount = data?.pendingCount ?? 0;\n\n if (pendingCount === 0) {\n return null;\n }\n\n return (\n <Badge className=\"fk:ml-auto fk:h-5 fk:min-w-5 fk:justify-center fk:rounded-full fk:bg-amber-500/20 fk:px-1.5 fk:text-[0.6875rem] fk:text-amber-600 fk:border-none fk:corner-squircle\">\n {pendingCount > 99 ? '99+' : pendingCount.toString()}\n </Badge>\n );\n}\n\nexport function AutomationsSidebar(): JSX.Element {\n const location = useLocation();\n const pathname = location.pathname.replace(/\\/$/, '');\n const isNewChat = pathname.endsWith('/ai/agent');\n const isRunHistory = pathname.endsWith('/ai/runs');\n const isApprovals = pathname.endsWith('/ai/approvals');\n const isPlugins = pathname.includes('/ai/plugins') || pathname.includes('/ai/skills');\n const isAutomations = pathname.includes('/ai/automations');\n const [query, setQuery] = useState('');\n const debouncedQuery = useDebouncedValue(query.trim(), SEARCH_DEBOUNCE_MS);\n\n return (\n <SidebarPanel collapsible=\"icon\" variant=\"inset\">\n <SidebarGroup className=\"fk:shrink-0 fk:pb-1.5 fk:group-data-[collapsible=icon]:hidden\">\n <SidebarGroupContent className=\"fk:relative\">\n <SearchIcon className=\"fk:absolute fk:left-2 fk:top-1/2 fk:size-3.5 fk:-translate-y-1/2 fk:text-muted-foreground\" />\n <Input\n className=\"fk:h-8 fk:bg-background fk:pl-7 fk:pr-7 fk:text-sm\"\n placeholder=\"Search chats...\"\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n />\n {query ? (\n <button\n aria-label=\"Clear search\"\n className=\"fk:absolute fk:right-2 fk:top-1/2 fk:-translate-y-1/2 fk:cursor-pointer fk:text-muted-foreground fk:hover:text-foreground\"\n type=\"button\"\n onClick={() => setQuery('')}\n >\n <XIcon className=\"fk:size-3.5\" />\n </button>\n ) : null}\n </SidebarGroupContent>\n </SidebarGroup>\n <SidebarContent>\n <SidebarGroup>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton asChild isActive={isNewChat} tooltip=\"New chat\">\n <NavLinkCompat to=\"agent\">\n <SquarePenIcon className=\"fk:h-4 fk:w-4\" strokeWidth={2} />\n <span>New chat</span>\n </NavLinkCompat>\n </SidebarMenuButton>\n </SidebarMenuItem>\n <SidebarMenuItem>\n <SidebarMenuButton asChild isActive={isAutomations} tooltip=\"Automations\">\n <NavLinkCompat to=\"automations\">\n <BotIcon className=\"fk:h-4 fk:w-4\" strokeWidth={2} />\n <span>Automations</span>\n </NavLinkCompat>\n </SidebarMenuButton>\n </SidebarMenuItem>\n <SidebarMenuItem>\n <SidebarMenuButton asChild isActive={isRunHistory} tooltip=\"Run History\">\n <NavLinkCompat to=\"runs\">\n <HistoryIcon className=\"fk:h-4 fk:w-4\" strokeWidth={2} />\n <span>Run History</span>\n </NavLinkCompat>\n </SidebarMenuButton>\n </SidebarMenuItem>\n <SidebarMenuItem>\n <SidebarMenuButton asChild isActive={isApprovals} tooltip=\"Approvals\">\n <NavLinkCompat to=\"approvals\">\n <InboxIcon className=\"fk:h-4 fk:w-4\" strokeWidth={2} />\n <span>Approvals</span>\n <PendingApprovalsBadge />\n </NavLinkCompat>\n </SidebarMenuButton>\n </SidebarMenuItem>\n <SidebarMenuItem>\n <SidebarMenuButton asChild isActive={isPlugins} tooltip=\"Plugins\">\n <NavLinkCompat to=\"plugins\">\n <PlugIcon className=\"fk:size-4\" />\n <span>Plugins</span>\n </NavLinkCompat>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarGroup>\n <SidebarGroup className=\"fk:mt-4 fk:group-data-[collapsible=icon]:hidden\">\n <SidebarGroupContent>\n <AgentChatsSection query={debouncedQuery} />\n </SidebarGroupContent>\n </SidebarGroup>\n </SidebarContent>\n <SidebarRail />\n </SidebarPanel>\n );\n}\n","import type { JSX } from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { useConfig } from '../../core/config/config-context';\nimport { SidebarInset, SidebarProvider } from '../../ui';\nimport { AutomationsSidebar } from './sidebar';\n\nconst SIDEBAR_COOKIE_NAME = 'flexkit:sidebar:state';\n\nexport function Root(): JSX.Element {\n const { currentProjectId } = useConfig();\n const defaultOpen =\n document.cookie\n .split('; ')\n .find((row) => row.startsWith(`${SIDEBAR_COOKIE_NAME}=`))\n ?.split('=')[1] !== 'false';\n\n if (!currentProjectId) {\n return (\n <main className=\"fk:flex fk:h-full fk:flex-1 fk:items-center fk:justify-center fk:p-8 fk:text-sm fk:text-muted-foreground\">\n Select a project to manage automations and skills.\n </main>\n );\n }\n\n return (\n <SidebarProvider className=\"fk:h-full\" defaultOpen={defaultOpen}>\n <AutomationsSidebar />\n <SidebarInset className=\"fk:min-w-0\">\n <div className=\"fk:flex fk:h-full fk:min-h-0 fk:min-w-0 fk:flex-col fk:overflow-hidden fk:pl-4 fk:pt-3\">\n <div className=\"fk:flex fk:min-h-0 fk:min-w-0 fk:flex-1 fk:flex-col\">\n <Outlet />\n </div>\n </div>\n </SidebarInset>\n </SidebarProvider>\n );\n}\n"]}
@@ -1,2 +0,0 @@
1
- import'./index.css';import {a}from'./chunk-LYGHDJ5A.js';import'./chunk-P6BZ4QP7.js';import'./chunk-66N44IKJ.js';import'./chunk-NNA4MLFC.js';import {z,m,w,q,p,r,t,b}from'./chunk-ODORXGGY.js';import {d as d$1}from'./chunk-5DHOBLAE.js';import {a as a$1,d,c,e,g}from'./chunk-HDOIOXMP.js';import {a as a$2}from'./chunk-O2QMYUPS.js';import {useState,useMemo,useRef}from'react';import {LoaderCircle,Search,X}from'lucide-react';import {Command}from'cmdk';import {useNavigate}from'react-router-dom';import {jsxs,jsx}from'react/jsx-runtime';var i="all";function ee(t){let n=t.replace(/([A-Z])/g," $1");return n.charAt(0).toUpperCase()+n.slice(1).trim()}function re(t){return t.filter(n=>n.attributes.some(a=>a.searchable))}function te(t,n){return n===i?t.map(a=>a.plural):t.filter(a=>a.plural===n).map(a=>a.plural)}function ne(t,n){return n===i?i:t.some(a=>a.plural===n)?n:i}function ae(t,n){return {searchRequests:{searches:t.map(a=>({collection:a}))},commonParams:{q:n}}}function oe(t){return t.menu?.label??ee(t.plural)}function be({onSelect:t$1,searchPlaceholder:n="Search...",noResultsMsg:a$3="Nothing found",className:_,onSearchChange:y,projectId:V,schema:v}){let[D,l]=useState(false),[s,S]=useState(""),[G,M]=useState(i),f=useMemo(()=>re(v),[v]),m$1=ne(f,G),C=useMemo(()=>te(f,m$1),[f,m$1]),X$1=useMemo(()=>ae(C,s),[C,s]),c$1=useRef(null),{results:k,isLoading:d$2}=a(V,X$1),j=D&&(k.length>0||!d$2),z$1=useNavigate();function F(e){S(e),e.length>0&&l(true),e.length===0&&l(false),y&&y(e);}function J(e){M(e),s.length>0&&l(true);}function U(){S(""),l(false),c$1.current&&(c$1.current.value="");let e=new URL(window.location.href);e.searchParams.has("id")&&(e.searchParams.delete("id"),z$1(e.pathname+e.search));}return jsxs(z,{children:[jsxs(a$1,{onValueChange:J,value:m$1,children:[jsx(d,{"aria-label":"Filter search by entity",className:"fk:w-36 fk:h-9 fk:py-1 fk:rounded-r-none fk:border-border fk:shadow-none fk:corner-squircle",children:jsx(c,{})}),jsxs(e,{children:[jsx(g,{value:i,children:"All"}),f.map(e=>jsx(g,{value:e.plural,children:oe(e)},e.plural))]})]}),jsxs(m,{className:"fk:relative fk:overflow-visible fk:h-auto fk:justify-center fk:rounded-none fk:bg-transparent fk:corner-squircle",onBlur:()=>{setTimeout(()=>{l(false);},300);},onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),l(false));},shouldFilter:false,children:[jsxs("div",{className:a$2("fk:flex fk:items-center fk:border-y fk:border-r fk:border-border fk:rounded-r-md fk:bg-background fk:pl-3 fk:pr-2 fk:h-9 fk:md:w-25 fk:lg:w-75 fk:corner-squircle","fk:outline-none fk:transition-[color,box-shadow] fk:has-[input:focus-visible]:border-ring fk:has-[input:focus-visible]:ring-[3px] fk:has-[input:focus-visible]:ring-ring/50"),children:[d$2?jsx(LoaderCircle,{className:"fk:mr-2 fk:h-4 fk:w-4 fk:shrink-0 fk:opacity-50 fk:animate-spin"}):jsx(Search,{className:"fk:mr-2 fk:h-4 fk:w-4 fk:shrink-0 fk:opacity-50"}),jsx(Command.Input,{className:a$2("fk:flex fk:h-9 fk:w-full fk:rounded-none fk:bg-transparent fk:py-1 fk:text-sm fk:outline-hidden fk:placeholder:text-muted-foreground fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:corner-squircle",_),placeholder:n,onMouseDown:()=>{(c$1.current?.value.length??0)>0&&l(true);},onValueChange:F,ref:c$1,value:s}),s&&jsx(d$1,{"aria-label":"Clear search",className:"fk:flex fk:items-center fk:justify-center fk:ml-2 fk:h-6 fk:w-6 fk:text-muted-foreground fk:hover:text-foreground fk:hover:bg-foreground/10 fk:cursor-pointer fk:rounded-full fk:bg-transparent fk:corner-squircle",onClick:U,type:"button",children:jsx(X,{className:"fk:h-4 fk:w-4"})})]}),jsx("div",{className:"fk:relative fk:max-w-150",children:jsx("div",{className:a$2("fk:mt-1 fk:animate-in fk:fade-in-0 fk:zoom-in-95 fk:absolute fk:top-0 fk:z-50 fk:w-full fk:rounded-md fk:bg-popover fk:outline-hidden fk:drop-shadow-md fk:border fk:border-border fk:corner-squircle",j?"fk:block":"fk:hidden"),children:jsxs(w,{className:"fk:max-h-55 fk:overflow-auto",children:[!d$2&&jsx(q,{children:a$3}),jsx(p,{children:jsxs(r,{children:[k.length>0&&jsx(t,{"aria-hidden":"true",className:"fk:hidden!",value:"-"}),k.map(e=>jsxs(t,{className:"fk:flex",value:e._id,onSelect:H=>{t$1({entityName:e._entityName,entityNamePlural:e._entityNamePlural,entityId:H});},children:[jsx("span",{className:"fk:basis-full",children:e[Object.keys(e)[3]]}),jsx(b,{className:"fk:py-px fk:text-[0.6875rem] fk:leading-3 fk:bg-teal-400",children:e._entityName})]},e._id))]})})]})})})]})]})}export{be as Search};//# sourceMappingURL=search-7NX232AW.js.map
2
- //# sourceMappingURL=search-7NX232AW.js.map
@@ -1,2 +0,0 @@
1
- import'./index.css';import {c}from'./chunk-4BX7OJJ6.js';import {f,g,d as d$2}from'./chunk-H6TOYVW2.js';import {b}from'./chunk-7SK5YPHT.js';import {f as f$1}from'./chunk-66N44IKJ.js';import {h}from'./chunk-NNA4MLFC.js';import {Wc,Yc,s,ra,ta,L,M,S,O,e as e$1,la,ma,na}from'./chunk-YIGEER6B.js';import {v,w,b as b$1}from'./chunk-ODORXGGY.js';import {t}from'./chunk-SZEGGBOC.js';import {d}from'./chunk-5DHOBLAE.js';import {a,d as d$1,c as c$1,e,g as g$1}from'./chunk-HDOIOXMP.js';import'./chunk-O2QMYUPS.js';import {useState,useRef,useMemo,useEffect}from'react';import {Plus,LoaderCircle,Trash2,GraduationCapIcon,ArrowLeft,Info,PenLine,Eye}from'lucide-react';import Pt from'react-markdown';import {useNavigate,Link,useParams}from'react-router-dom';import ve from'swr';import At from'swr/infinite';import {history,defaultKeymap,historyKeymap,indentWithTab}from'@codemirror/commands';import {markdown}from'@codemirror/lang-markdown';import {languages}from'@codemirror/language-data';import {foldGutter,indentOnInput,bracketMatching,foldKeymap}from'@codemirror/language';import {highlightSelectionMatches,searchKeymap}from'@codemirror/search';import {Compartment,EditorState,Prec}from'@codemirror/state';import {EditorView,lineNumbers,highlightActiveLineGutter,highlightSpecialChars,drawSelection,dropCursor,highlightActiveLine,keymap,placeholder}from'@codemirror/view';import {tags}from'@lezer/highlight';import {createTheme}from'@uiw/codemirror-themes';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var je="var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",Q="#212121",Y="#fafafa";function ze(t,i,o){return [t,EditorView.theme({"&":{backgroundColor:i},".cm-scroller":{backgroundColor:i},".cm-gutters":{backgroundColor:o}})]}var ce=ze(createTheme({settings:{background:Q,caret:"#f8f8f0",fontFamily:je,foreground:"#f8f8f2",gutterBackground:Q,gutterBorder:"transparent",gutterForeground:"#6d8a88",lineHighlight:"rgba(255, 255, 255, 0.1)",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)"},styles:[{color:"#6272a4",tag:[tags.comment,tags.quote,tags.strikethrough]},{color:"#6272a4",tag:[tags.meta,tags.processingInstruction]},{color:"#f1fa8c",tag:tags.string},{color:"#f91f6f",tag:[tags.atom,tags.bool,tags.number,tags.heading]},{color:"#ff79c6",tag:[tags.keyword,tags.operator,tags.tagName]},{color:"#8be9fd",tag:[tags.typeName,tags.link,tags.url]},{color:"#009fb8",tag:[tags.className,tags.attributeName,tags.monospace]},{color:"#66d9ef",tag:[tags.propertyName,tags.function(tags.propertyName)]},{color:"#009fb8",tag:[tags.definition(tags.variableName),tags.function(tags.variableName)]},{color:"#0072f5",tag:[tags.strong,tags.emphasis]},{color:"#ff5555",tag:tags.invalid}],theme:"dark"}),Q,Q),de=ze(createTheme({settings:{background:Y,caret:"#526fff",fontFamily:je,foreground:"#383a42",gutterBackground:Y,gutterBorder:"transparent",gutterForeground:"#9d9d9f",lineHighlight:"#383a420c",selection:"#e5e5e6",selectionMatch:"#e5e5e6"},styles:[{color:"#a0a1a7",tag:[tags.comment,tags.quote,tags.strikethrough]},{color:"#a0a1a7",tag:[tags.meta,tags.processingInstruction]},{color:"#50a14f",tag:tags.string},{color:"#986801",tag:[tags.attributeName]},{color:"#a626a4",tag:tags.keyword},{color:"#0072f5",tag:[tags.operator,tags.strong,tags.emphasis]},{color:"#f91f6f",tag:[tags.atom,tags.bool,tags.number,tags.heading]},{color:"#c18401",tag:[tags.typeName,tags.className]},{color:"#009fb8",tag:[tags.tagName,tags.propertyName,tags.monospace]},{color:"#4078f2",tag:[tags.link,tags.url,tags.function(tags.variableName),tags.definition(tags.variableName)]},{color:"#f91f6f",tag:tags.invalid}],theme:"light"}),Y,Y);function me(){let t=document.documentElement;return t.getAttribute("data-theme")==="dark"||t.classList.contains("dark")||t.style.colorScheme==="dark"}var xt=EditorView.theme({"&":{fontSize:"13px",height:"100%",maxHeight:"100%",maxWidth:"100%",minHeight:"0",minWidth:"0",width:"100%"},"&.cm-focused":{outline:"none"},".cm-scroller":{height:"100%",lineHeight:"1.6",minHeight:"0",minWidth:"0",overflow:"auto",width:"100%"},".cm-content":{fontSize:"13px",fontStyle:"normal",fontWeight:"400",minWidth:"0 !important",padding:"12px 0"},".cm-line, .cm-line span":{fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit"},".cm-gutters":{borderRight:"1px solid transparent"},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none"}});function ue(t){return [t?ce:de,xt]}function He(t){return [EditorState.readOnly.of(t),EditorView.editable.of(!t)]}function Oe(t){let i={"aria-multiline":"true",role:"textbox"};return t.ariaLabel&&(i["aria-label"]=t.ariaLabel),t.ariaLabelledBy&&(i["aria-labelledby"]=t.ariaLabelledBy),t.ariaDescribedBy&&(i["aria-describedby"]=t.ariaDescribedBy),t.ariaInvalid&&(i["aria-invalid"]="true"),t.readOnly&&(i["aria-readonly"]="true"),i}function Xe({ariaDescribedBy:t,ariaInvalid:i,ariaLabel:o,ariaLabelledBy:l,className:f,onBlur:d,onChange:k,onSave:u,placeholder:m,readOnly:c=false,value:p}){let h=useRef(null),y=useRef(null),L=useRef(new Compartment),P=useRef(new Compartment),N=useRef(new Compartment),C=useRef(d),w=useRef(k),I=useRef(u),v=useRef(p);return C.current=d,w.current=k,I.current=u,v.current=p,useEffect(()=>{let s=h.current;if(!s)return;let g=new EditorView({parent:s,state:EditorState.create({doc:v.current,extensions:[lineNumbers(),highlightActiveLineGutter(),highlightSpecialChars(),history(),foldGutter(),drawSelection(),dropCursor(),EditorState.allowMultipleSelections.of(true),indentOnInput(),bracketMatching(),highlightActiveLine(),highlightSelectionMatches(),EditorView.lineWrapping,markdown({codeLanguages:languages}),keymap.of([...defaultKeymap,...historyKeymap,...searchKeymap,...foldKeymap,indentWithTab]),Prec.highest(keymap.of([{key:"Mod-s",run:()=>(I.current?.(),true)}])),EditorView.updateListener.of(B=>{B.docChanged&&w.current?.(B.state.doc.toString()),B.focusChanged&&!B.view.hasFocus&&C.current?.();}),L.current.of(ue(me())),P.current.of(He(c)),N.current.of(EditorView.contentAttributes.of(Oe({ariaDescribedBy:t,ariaInvalid:i,ariaLabel:o,ariaLabelledBy:l,readOnly:c}))),...m?[placeholder(m)]:[]]})});y.current=g;let K=new ResizeObserver(()=>{g.requestMeasure();});K.observe(s);let G=new MutationObserver(()=>{g.dispatch({effects:L.current.reconfigure(ue(me()))});});return G.observe(document.documentElement,{attributeFilter:["class","data-theme","style"],attributes:true}),()=>{K.disconnect(),G.disconnect(),g.destroy(),y.current=null;}},[]),useEffect(()=>{let s=y.current;s&&s.dispatch({effects:L.current.reconfigure(ue(me()))});},[de,ce]),useEffect(()=>{let s=y.current;if(!s)return;let g=s.state.doc.toString();g!==p&&s.dispatch({changes:{from:0,to:g.length,insert:p}});},[p]),useEffect(()=>{let s=y.current;s&&s.dispatch({effects:[P.current.reconfigure(He(c)),N.current.reconfigure(EditorView.contentAttributes.of(Oe({ariaDescribedBy:t,ariaInvalid:i,ariaLabel:o,ariaLabelledBy:l,readOnly:c})))]});},[t,i,o,l,c]),jsx("div",{className:f??"fk:h-full fk:min-h-0 fk:min-w-0 fk:w-full fk:overflow-hidden",ref:h})}var Je=25,Bt=[{descriptionWidth:"fk:w-44",id:"skill-a",nameWidth:"fk:w-28"},{descriptionWidth:"fk:w-52",id:"skill-b",nameWidth:"fk:w-20"},{descriptionWidth:"fk:w-40",id:"skill-c",nameWidth:"fk:w-36"},{descriptionWidth:"fk:w-48",id:"skill-d",nameWidth:"fk:w-24"},{descriptionWidth:"fk:w-36",id:"skill-e",nameWidth:"fk:w-32"},{descriptionWidth:"fk:w-56",id:"skill-f",nameWidth:"fk:w-16"}];function Wt(){return jsxs("div",{"aria-busy":"true",className:"fk:grid fk:grid-cols-1 fk:gap-x-16 fk:gap-y-1 fk:lg:grid-cols-2",children:[jsx("span",{className:"fk:sr-only",children:"Loading skills"}),Bt.map(t$1=>jsxs("div",{className:"fk:-mx-3 fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:px-3 fk:py-2",children:[jsx(t,{className:"fk:size-10 fk:shrink-0 fk:rounded-lg"}),jsxs("span",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:flex-col fk:gap-1.5",children:[jsx(t,{className:`fk:h-4 ${t$1.nameWidth}`}),jsx(t,{className:`fk:h-4 ${t$1.descriptionWidth}`})]})]},t$1.id))]})}var Rt={code({children:t,className:i,node:o,...l}){return typeof i=="string"&&i.split(" ").some(d=>d.startsWith("language-"))?jsx("code",{className:i,...l,children:t}):jsx("code",{className:"fk:rounded fk:bg-muted fk:px-1.5 fk:py-0.5 fk:font-mono fk:text-[0.875em] fk:font-medium fk:before:content-none fk:after:content-none fk:corner-squircle",...l,children:t})}};function be(){let{currentProjectId:t}=f$1();return {api:useMemo(()=>t?d$2(t):null,[t]),projectId:t}}function ie({children:t}){return jsx("div",{className:"fk:rounded-md fk:border fk:border-dashed fk:p-8 fk:text-center fk:text-sm fk:text-muted-foreground fk:corner-squircle",children:t})}function jt({onVisible:t}){let i=useRef(null),o=useRef(t);return o.current=t,useEffect(()=>{let l=i.current;if(!l)return;let f=new IntersectionObserver(d=>{d.some(k=>k.isIntersecting)&&o.current();});return f.observe(l),()=>{f.disconnect();}},[]),jsx("div",{"aria-hidden":true,className:"fk:h-px",ref:i})}function zt(t,i){return t.visibility==="space"?(t.spaceId?i.get(t.spaceId):void 0)??"Space":t.visibility==="personal"?"Personal":"Project"}function Dt({skill:t}){return t.logoUrl?jsx("img",{alt:"",className:"fk:size-10 fk:shrink-0 fk:rounded-lg fk:corner-squircle",src:t.logoUrl}):jsx("span",{className:"fk:flex fk:size-10 fk:shrink-0 fk:items-center fk:justify-center fk:rounded-lg fk:bg-muted fk:text-muted-foreground fk:corner-squircle",children:jsx(GraduationCapIcon,{className:"fk:size-5"})})}function hi(){let{api:t,projectId:i}=be(),o=useNavigate(),[l,f$1]=useState(""),d$1=b(),k=l.trim().length>0,u=(s,g$1)=>!i||g$1&&!g$1.hasMore?null:g(i).skills({limit:Je,offset:s*Je,search:l.trim()||void 0}),{data:m,isLoading:c$1,setSize:p,size:h}=At(u,f),y=m?.flatMap(s=>s.skills)??[],P=m?.[m.length-1]?.hasMore??false,N=m!==void 0&&h>m.length,C=c$1&&y.length===0;if(!i||!t)return jsx(ie,{children:"Select a project to view skills."});function w(){p(s=>s+1);}let I="No skills yet.";k&&(I="No skills match your search.");let v=jsx("div",{className:"fk:grid fk:grid-cols-1 fk:gap-x-16 fk:gap-y-1 fk:lg:grid-cols-2",children:y.map(s=>jsxs("button",{type:"button",onClick:()=>o(s.id),className:"fk:-mx-3 fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:rounded-lg fk:px-3 fk:py-2 fk:text-left fk:transition-colors fk:hover:bg-accent fk:focus-visible:bg-accent fk:focus-visible:outline-none fk:corner-squircle",children:[jsx(Dt,{skill:s}),jsxs("span",{className:"fk:min-w-0 fk:flex-1",children:[jsx("span",{className:"fk:block fk:truncate fk:text-sm fk:font-medium",children:s.name}),jsx("span",{className:"fk:block fk:truncate fk:text-sm fk:text-muted-foreground",children:s.description})]})]},s.id))});return C?v=jsx(Wt,{}):y.length===0&&(v=jsx(Wc,{children:jsx(Yc,{children:I})})),jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsx(c,{}),jsx("div",{className:"fk:min-h-0 fk:flex-1 fk:overflow-auto",children:jsxs("div",{className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsxs("div",{children:[jsx("h2",{className:"fk:text-2xl fk:font-semibold",children:"Skills for your agents"}),jsx("p",{className:"fk:mt-2 fk:text-muted-foreground",children:"Reusable Markdown instructions that agents load when relevant, or always when attached to an automation."})]}),jsxs("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-3",children:[jsx(s,{"aria-label":"Search skills",className:"fk:w-full fk:max-w-xs",placeholder:"Search skills\u2026",value:l,onChange:s=>{p(1),f$1(s.target.value);}}),d$1?jsx(d,{asChild:true,className:"fk:ml-auto",size:"sm",children:jsxs(Link,{to:"new",children:[jsx(Plus,{}),"New Skill"]})}):jsx(ra,{disabled:true,children:jsxs(d,{className:"fk:ml-auto",disabled:true,size:"sm",children:[jsx(Plus,{}),"New Skill"]})})]}),v,P&&!N?jsx(jt,{onVisible:w}):null,N?jsxs("div",{className:"fk:flex fk:items-center fk:justify-center fk:gap-2 fk:py-4 fk:text-sm fk:text-muted-foreground",children:[jsx(LoaderCircle,{className:"fk:size-4 fk:animate-spin"}),jsx("span",{children:"Loading more skills..."})]}):null]})})]})}function te({className:t,id:i,message:o}){return jsx("p",{className:`fk:text-sm fk:text-destructive ${t??""}`,id:i,children:o})}function D({children:t,hint:i,htmlFor:o,id:l}){return jsxs("div",{className:"fk:mb-1.5 fk:pl-2.5 fk:flex fk:items-center fk:gap-1",children:[jsx(e$1,{htmlFor:o,id:l,children:t}),jsxs(L,{children:[jsx(M,{asChild:true,children:jsx("button",{"aria-label":`About ${t.toLowerCase()}`,className:"fk:rounded-sm fk:text-muted-foreground hover:fk:text-foreground fk:corner-squircle",type:"button",children:jsx(Info,{className:"fk:size-3.5"})})}),jsx(O,{className:"fk:max-w-xs",children:i})]})]})}function Se({actions:t,title:i}){return jsxs(Fragment,{children:[jsxs("div",{className:"fk:flex fk:shrink-0 fk:items-center fk:gap-2 fk:pr-4",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsx(v,{orientation:"vertical",className:"fk:h-4"}),jsx("h1",{className:"fk:min-w-0 fk:flex-1 fk:truncate fk:text-lg fk:font-semibold fk:leading-none fk:tracking-tight",children:i}),t]}),jsx(d,{asChild:true,className:"fk:shrink-0 fk:w-fit",size:"sm",variant:"ghost",children:jsxs(Link,{relative:"path",to:"..",children:[jsx(ArrowLeft,{className:"fk:mr-2 fk:size-4"}),"Skills"]})})]})}function Ht(){return jsxs("div",{"aria-busy":"true",className:"fk:flex fk:h-full fk:min-h-0 fk:min-w-0 fk:flex-col fk:gap-3 fk:overflow-hidden fk:pb-3",children:[jsx("span",{className:"fk:sr-only",children:"Loading skill"}),jsx(Se,{actions:jsx(t,{className:"fk:h-8 fk:w-24"}),title:jsx(t,{className:"fk:h-5 fk:w-40"})}),jsxs("div",{className:"fk:m-auto fk:flex fk:min-h-0 fk:w-full fk:max-w-6xl fk:flex-1 fk:flex-col fk:gap-8 fk:px-6",children:[jsxs("div",{className:"fk:grid fk:shrink-0 fk:gap-3 fk:lg:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto]",children:[["name","description"].map(t$1=>jsxs("div",{className:"fk:flex fk:flex-col fk:gap-2",children:[jsx(t,{className:"fk:h-4 fk:w-20"}),jsx(t,{className:"fk:h-9 fk:w-full"})]},t$1)),jsxs("div",{className:"fk:flex fk:flex-col fk:gap-2",children:[jsx(t,{className:"fk:h-4 fk:w-20"}),jsx(t,{className:"fk:h-9 fk:w-32"})]})]}),jsxs("div",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col fk:gap-1.5",children:[jsx(t,{className:"fk:h-4 fk:w-16"}),jsx(t,{className:"fk:min-h-48 fk:flex-1 fk:rounded-md"})]})]})]})}function Ke({content:t,onBlur:i,onChange:o,onSave:l,readOnly:f=false,showContentError:d,validationMessage:k}){let[u,m]=useState("write"),c=t.length>5e4,p;return t.trim()?p=jsx(Pt,{components:Rt,children:t}):p=jsx("p",{className:"fk:text-muted-foreground",children:"Nothing to preview."}),jsxs("div",{className:"fk:flex fk:min-h-0 fk:min-w-0 fk:flex-1 fk:flex-col fk:gap-1.5",children:[jsxs("div",{className:"fk:pl-3.25 fk:flex fk:shrink-0 fk:items-center fk:gap-1",children:[jsx(e$1,{htmlFor:"skill-content",id:"skill-content-label",children:"Content"}),jsxs(L,{children:[jsx(M,{asChild:true,children:jsx("button",{"aria-label":"About skill content",className:"fk:rounded-sm fk:text-muted-foreground hover:fk:text-foreground fk:corner-squircle",type:"button",children:jsx(Info,{className:"fk:size-3.5"})})}),jsx(O,{className:"fk:max-w-sm",children:"The skill itself, in Markdown. Write it like instructions for a capable colleague: procedures, rules, examples, and edge cases. Attached skills are always loaded; other visible skills are loaded on demand."})]})]}),jsxs("div",{className:`fk:flex fk:min-h-0 fk:min-w-0 fk:flex-1 fk:flex-col fk:ml-0.75 fk:overflow-hidden fk:rounded-md fk:border ${d?"fk:border-destructive":""} fk:corner-squircle`,children:[jsxs("div",{className:"fk:flex fk:shrink-0 fk:items-center fk:justify-between fk:gap-2 fk:border-b fk:px-2.5 fk:py-1",children:[jsx(la,{value:u,onValueChange:h=>{m(h==="preview"?"preview":"write");},children:jsxs(ma,{children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx("span",{className:"fk:inline-flex",children:jsx(na,{"aria-label":"Write",className:"fk:px-2.5",value:"write",children:jsx(PenLine,{className:"fk:size-3.5"})})})}),jsx(O,{children:"Write"})]}),jsxs(L,{children:[jsx(M,{asChild:true,children:jsx("span",{className:"fk:inline-flex",children:jsx(na,{"aria-label":"Preview",className:"fk:px-2.5",value:"preview",children:jsx(Eye,{className:"fk:size-3.5"})})})}),jsx(O,{children:"Preview"})]})]})}),jsxs("span",{className:c?"fk:text-xs fk:text-destructive":"fk:text-xs fk:text-muted-foreground",children:[t.length.toLocaleString()," / ",5e4.toLocaleString()]})]}),jsx("div",{className:"fk:min-h-0 fk:min-w-0 fk:flex-1 fk:overflow-hidden",hidden:u!=="write",children:jsx(Xe,{ariaDescribedBy:d?"skill-content-error":void 0,ariaInvalid:d,ariaLabelledBy:"skill-content-label",className:"fk:h-full fk:min-h-0 fk:min-w-0 fk:w-full fk:overflow-hidden",readOnly:f,value:t,onBlur:i,onChange:o,onSave:l})}),u==="preview"?jsx(w,{className:"fk:min-h-0 fk:flex-1",children:jsx("div",{className:"fk:prose fk:prose-sm fk:dark:prose-invert fk:max-w-none fk:px-4 fk:py-3",children:p})}):null,d&&k?jsx(te,{className:"fk:border-t fk:px-3 fk:py-2",id:"skill-content-error",message:k}):null]})]})}function Ge({api:t,mode:i,onSaved:o,projectId:l,skill:f$1}){let[d$2,k]=useState(f$1?.name??""),[u,m]=useState(f$1?.description??""),[c,p]=useState(f$1?.content??""),[h$1,y]=useState(f$1?.visibility??"project"),[L,P]=useState(f$1?.spaceId??null),[N,C]=useState(false),w=useRef(false),[I,v]=useState(""),[s$1,g$2]=useState({content:false,description:false,name:false}),K=useNavigate(),{data:G}=ve(g(l).spaces,f),[,B]=h(),H=b(),$e=B.user?.spaces??[],xe=(G?.spaces??[]).filter(a=>$e.includes(a.code)),ne="";c.trim()?c.length>5e4&&(ne=`Content must be at most ${String(5e4)} characters`):ne="Content is required";let b$1={content:ne,description:u.trim()?"":"Description is required",name:d$2.trim()?"":"Name is required",space:h$1==="space"&&!L?"Select a space":""},ae=!b$1.content&&!b$1.description&&!b$1.name&&!b$1.space,$=s$1.name&&!!b$1.name,U=s$1.description&&!!b$1.description,Ue=s$1.content&&!!b$1.content,Ze=i==="create"?"New Skill":f$1?.name??"Skill",se="Update skill";N?se="Saving...":i==="create"&&(se="Create skill");async function ye(){if(!H||w.current)return;if(!ae){g$2({content:true,description:true,name:true});return}w.current=true,C(true),v("");let a={content:c,description:u,name:d$2,spaceId:h$1==="space"?L:null,visibility:h$1};try{let M=i==="create"||!f$1?await t.createSkill(a):await t.updateSkill(f$1.id,a);if(!M.success){v(Array.isArray(M.errorMessage)?M.errorMessage.join(", "):M.errorMessage);return}ta.success(i==="create"||!f$1?"Skill created.":"Skill saved."),o(M.skill);}catch(M){v(M instanceof Error?M.message:"Failed to save skill.");}finally{w.current=false,C(false);}}async function Qe(a){a.preventDefault(),await ye();}async function Ye(){if(!(!f$1||!H||w.current)){w.current=true,C(true),v("");try{let a=await t.deleteSkill(f$1.id);if(!a.success){v(Array.isArray(a.errorMessage)?a.errorMessage.join(", "):a.errorMessage);return}K("..",{relative:"path"});}catch(a){v(a instanceof Error?a.message:"Failed to delete skill.");}finally{w.current=false,C(false);}}}return jsxs("div",{className:"fk:flex fk:h-full fk:min-h-0 fk:min-w-0 fk:flex-col fk:gap-3 fk:pb-3",children:[jsx(Se,{actions:jsxs("div",{className:"fk:flex fk:items-center fk:gap-3",children:[ae?null:jsx("span",{className:"fk:text-xs fk:text-muted-foreground",children:"Complete the required fields to save"}),i==="edit"&&f$1?jsxs(d,{disabled:N||!H,size:"sm",type:"button",variant:"outline",onClick:()=>{Ye();},children:[jsx(Trash2,{}),"Delete"]}):null,jsx(ra,{disabled:!H,children:jsx(d,{disabled:N||!ae||!H,form:"skill-editor-form",size:"sm",type:"submit",children:se})})]}),title:Ze}),I?jsx("div",{className:"fk:shrink-0 fk:rounded-md fk:border fk:border-destructive/30 fk:bg-destructive/5 fk:p-3 fk:text-sm fk:text-destructive fk:corner-squircle",children:I}):null,jsxs("form",{className:"fk:flex fk:min-h-0 fk:min-w-0 fk:flex-1 fk:flex-col fk:gap-6 fk:w-full fk:max-w-6xl fk:m-auto fk:gap-8 fk:px-4",id:"skill-editor-form",onSubmit:a=>{Qe(a);},children:[jsxs("div",{className:"fk:grid fk:min-w-0 fk:shrink-0 fk:gap-3 fk:px-0.75 fk:lg:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto]",children:[jsxs("div",{children:[jsx(D,{hint:"Identifying label for this skill",htmlFor:"skill-name",children:"Name"}),jsx(s,{"aria-describedby":$?"skill-name-error":void 0,"aria-invalid":$,className:$?"fk:border-destructive focus-visible:fk:ring-destructive":"",id:"skill-name",value:d$2,onBlur:()=>g$2(a=>({...a,name:true})),onChange:a=>k(a.target.value)}),$?jsx(te,{id:"skill-name-error",message:b$1.name}):null]}),jsxs("div",{children:[jsx(D,{hint:"One or two sentences describing when to use this skill. Agents rely on it to decide whether the skill applies to their current task.",htmlFor:"skill-description",children:"Description"}),jsx(s,{"aria-describedby":U?"skill-description-error":void 0,"aria-invalid":U,className:U?"fk:border-destructive focus-visible:fk:ring-destructive":"",id:"skill-description",placeholder:"e.g. Rules for writing product descriptions in our brand voice",value:u,onBlur:()=>g$2(a=>({...a,description:true})),onChange:a=>m(a.target.value)}),U?jsx(te,{id:"skill-description-error",message:b$1.description}):null]}),jsxs("div",{children:[jsx(D,{hint:"Who can see and use this skill. Space skills are only visible to members of the selected space and only usable by automations in that space; personal skills are private to you.",htmlFor:"skill-visibility",children:"Visibility"}),jsxs("div",{className:"fk:flex fk:items-center fk:gap-2",children:[jsxs(a,{value:h$1,onValueChange:a=>{y(a==="space"||a==="personal"?a:"project"),a!=="space"&&P(null);},children:[jsx(d$1,{"aria-label":"Visibility",className:"fk:w-fit fk:min-w-26",id:"skill-visibility",children:jsx(c$1,{})}),jsxs(e,{align:"start",children:[jsx(g$1,{value:"project",children:"Project"}),jsx(g$1,{disabled:xe.length===0,value:"space",children:"Space"}),jsx(g$1,{value:"personal",children:"Personal"})]})]}),h$1==="space"?jsxs(a,{value:L??"",onValueChange:a=>{P(a||null);},children:[jsx(d$1,{"aria-label":"Space",className:"fk:w-fit fk:min-w-34",children:jsx(c$1,{placeholder:"Select a space"})}),jsx(e,{align:"start",children:xe.map(a=>jsx(g$1,{value:a.id,children:a.label},a.id))})]}):null]}),h$1==="space"&&b$1.space?jsx(te,{message:b$1.space}):null]})]}),jsx(Ke,{content:c,showContentError:Ue,validationMessage:b$1.content,onBlur:()=>g$2(a=>({...a,content:true})),onChange:p,onSave:()=>{ye();}})]})]})}function Ot({projectId:t,skill:i,spaceLabelById:o}){let l=b(),f=useNavigate(),[d$2,k]=useState(false),[u,m]=useState("");async function c(){k(true),m("");let p;try{p=await fetch(`/api/flexkit/${t}/skills/${i.id}/fork`,{method:"POST",credentials:"include"});}catch{m("Unable to create a copy. Try again."),k(false);return}if(k(false),!p.ok){m("Unable to create a copy. Check your permissions.");return}f("..",{relative:"path"});}return jsxs("div",{className:"fk:flex fk:h-full fk:min-h-0 fk:min-w-0 fk:flex-col fk:gap-3 fk:pb-3",children:[jsx(Se,{actions:jsxs("div",{className:"fk:flex fk:items-center fk:gap-2",children:[jsx(b$1,{variant:"secondary",children:i.source==="plugin"?"Plugin":"Code"}),i.source==="plugin"&&jsx(d,{type:"button",disabled:d$2||!l,onClick:()=>{c();},size:"sm",children:"Edit a copy"})]}),title:i.name}),jsxs("div",{className:"fk:flex fk:flex-col fk:h-full fk:px-4 fk:gap-3 fk:max-w-6xl fk:m-auto",children:[jsxs("div",{className:"fk:shrink-0 fk:rounded-md fk:border fk:bg-muted/30 fk:px-3 fk:py-2 fk:corner-squircle",children:[jsx("p",{className:"fk:text-sm fk:font-medium",children:"Version-controlled skill"}),jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:i.source==="plugin"?"This skill is managed by its plugin. Edit a copy to create a personal Studio skill.":"Edit this skill in your repository and re-sync it from the Custom Tools settings."})]}),jsxs("div",{className:"fk:grid fk:min-w-0 fk:shrink-0 fk:gap-3 fk:lg:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto]",children:[jsxs("div",{children:[jsx(D,{hint:"Identifying label for this skill",htmlFor:"skill-name",children:"Name"}),jsx(s,{className:"fk:opacity-100!",disabled:true,id:"skill-name",value:i.name})]}),jsxs("div",{children:[jsx(D,{hint:"One or two sentences describing when to use this skill. Agents rely on it to decide whether the skill applies to their current task.",htmlFor:"skill-description",children:"Description"}),jsx(s,{className:"fk:opacity-100!",disabled:true,id:"skill-description",placeholder:"e.g. Rules for writing product descriptions in our brand voice",value:i.description})]}),jsxs("div",{children:[jsx(D,{hint:"Who can see and use this skill. Space skills are only visible to members of the selected space and only usable by automations in that space; personal skills are private to you.",htmlFor:"skill-visibility",children:"Visibility"}),jsxs("div",{className:"fk:flex fk:items-center fk:gap-2",children:[jsxs(a,{disabled:true,value:i.visibility,children:[jsx(d$1,{"aria-label":"Visibility",className:"fk:w-fit fk:min-w-26 fk:opacity-100!",id:"skill-visibility",children:jsx(c$1,{})}),jsxs(e,{align:"start",children:[jsx(g$1,{value:"project",children:"Project"}),jsx(g$1,{disabled:!i.spaceId,value:"space",children:"Space"}),jsx(g$1,{value:"personal",children:"Personal"})]})]}),i.visibility==="space"?jsxs(a,{disabled:true,value:i.spaceId??"",children:[jsx(d$1,{"aria-label":"Space",className:"fk:w-fit fk:min-w-34 fk:opacity-100!",children:jsx(c$1,{placeholder:"Select a space"})}),jsx(e,{align:"start",children:jsx(g$1,{value:i.spaceId??"",children:zt(i,o)})})]}):null]})]})]}),u&&jsx("p",{role:"alert",children:u}),jsx(Ke,{content:i.content,readOnly:true})]})]})}function vi(){let{api:t,projectId:i}=be(),o=useNavigate();return !i||!t?jsx(ie,{children:"Select a project to create skills."}):jsx(Ge,{api:t,mode:"create",projectId:i,onSaved:()=>o("..",{relative:"path"})})}function bi(){let{api:t,projectId:i}=be(),{skillId:o}=useParams(),{data:l,error:f$1,isLoading:d,mutate:k}=ve(i&&o?g(i).skill(o):null,f),{data:u}=ve(i?g(i).spaces:null,f);if(!i||!t||!o)return jsx(ie,{children:"Select a skill."});if(f$1)return jsx(ie,{children:"Failed to load skill."});if(d||!l?.skill)return jsx(Ht,{});let m=new Map((u?.spaces??[]).map(c=>[c.id,c.label]));return l.skill.source!=="studio"?jsx(Ot,{projectId:i,skill:l.skill,spaceLabelById:m}):jsx(Ge,{api:t,mode:"edit",projectId:i,skill:l.skill,onSaved:c=>{c?k({skill:c},{revalidate:false}):k();}})}export{vi as CreateSkillPage,bi as SkillDetailPage,Ge as SkillForm,hi as SkillsPage};//# sourceMappingURL=skills-pages-SMJ4EWZW.js.map
2
- //# sourceMappingURL=skills-pages-SMJ4EWZW.js.map
@@ -1,2 +0,0 @@
1
- import'./index.css';import {la,ma,na,da,ka,ea,ha,ia,fa,ja,oa,f}from'./chunk-YIGEER6B.js';import {v as v$1,b as b$1}from'./chunk-ODORXGGY.js';import {t}from'./chunk-SZEGGBOC.js';import'./chunk-5DHOBLAE.js';import'./chunk-HDOIOXMP.js';import'./chunk-O2QMYUPS.js';import {useMemo,useId,useState,useEffect}from'react';import {buildSpecFromParts,StateProvider,VisibilityProvider,ActionProvider,Renderer}from'@json-render/react';import {TrendingUpIcon,TrendingDownIcon,MinusIcon,InfoIcon,OctagonAlertIcon,AlertTriangleIcon,LightbulbIcon,XCircleIcon,CheckCircle2Icon}from'lucide-react';import {PieChart,Tooltip,Pie,Cell,LineChart,CartesianGrid,XAxis,YAxis,Line,BarChart,Bar,ResponsiveContainer}from'recharts';import {jsx,jsxs}from'react/jsx-runtime';var ke={sm:"fk:max-w-sm",md:"fk:max-w-md",lg:"fk:max-w-lg",full:"fk:max-w-full"},pe=({children:e,element:t})=>{let{props:n}=t,s=n.maxWidth?ke[n.maxWidth]:"",a=n.centered?"fk:mx-auto":"";return jsxs("div",{className:`fk:w-full fk:rounded-lg fk:border fk:border-border fk:bg-card fk:p-4 fk:gap-2 fk:flex fk:flex-col ${s} ${a} ${n.className??""} fk:corner-squircle`,children:[n.title&&jsx("div",{className:"fk:text-sm fk:font-medium",children:n.title}),n.description&&jsx("div",{className:"fk:mt-0.5 fk:text-xs fk:text-muted-foreground",children:n.description}),(n.title??n.description)&&e?jsx("div",{className:"fk:mt-3"}):null,e]})},me={none:"fk:gap-0",sm:"fk:gap-2",md:"fk:gap-3",lg:"fk:gap-4",xl:"fk:gap-6"},ge={start:"fk:items-start",center:"fk:items-center",end:"fk:items-end",stretch:"fk:items-stretch"},he={start:"fk:justify-start",center:"fk:justify-center",end:"fk:justify-end",between:"fk:justify-between",around:"fk:justify-around"},be=({children:e,element:t})=>{let{props:n}=t,s=n.direction==="horizontal"?"fk:flex-row fk:flex-wrap":"fk:flex-col",a=me[n.gap??"md"],i=n.align?ge[n.align]:"",l=n.justify?he[n.justify]:"";return jsx("div",{className:`fk:flex fk:w-full ${s} ${a} ${i} ${l} ${n.className??""}`,children:e})},ve={1:"fk:grid-cols-1",2:"fk:grid-cols-2",3:"fk:grid-cols-3",4:"fk:grid-cols-4",5:"fk:grid-cols-5",6:"fk:grid-cols-6"},ye={sm:"fk:gap-2",md:"fk:gap-3",lg:"fk:gap-4",xl:"fk:gap-6"},xe=({children:e,element:t})=>{let{props:n}=t,s=ve[n.columns??1]??"fk:grid-cols-1",a=ye[n.gap??"md"];return jsx("div",{className:`fk:grid fk:w-full ${s} ${a} ${n.className??""}`,children:e})},Ce=({element:e})=>jsx(v$1,{orientation:e.props.orientation??"horizontal"}),Pe={h1:"fk:text-xl fk:font-semibold fk:tracking-tight",h2:"fk:text-lg fk:font-semibold fk:tracking-tight",h3:"fk:text-base fk:font-medium",h4:"fk:text-sm fk:font-medium"},we=({element:e})=>{let t=e.props.level??"h2";return jsx(t,{className:Pe[t],children:e.props.text})},Ne={body:"fk:text-sm",muted:"fk:text-sm fk:text-muted-foreground",caption:"fk:text-xs fk:text-muted-foreground",lead:"fk:text-base",code:"fk:rounded fk:bg-muted fk:px-1 fk:py-0.5 fk:font-mono fk:text-xs fk:corner-squircle"},Se=({element:e})=>jsx("p",{className:Ne[e.props.variant??"body"],children:e.props.text}),Te=({element:e})=>jsx(b$1,{variant:e.props.variant??"default",children:e.props.text});function Re({type:e}){switch(e){case "success":return jsx(CheckCircle2Icon,{className:"fk:size-4 fk:translate-y-0.5"});case "warning":return jsx(AlertTriangleIcon,{className:"fk:size-4 fk:translate-y-0.5"});case "error":return jsx(XCircleIcon,{className:"fk:size-4 fk:translate-y-0.5"});default:return jsx(InfoIcon,{className:"fk:size-4 fk:translate-y-0.5"})}}var Ae=({element:e})=>{let{props:t}=e,n=t.type==="error"?"fk:border-destructive/50 fk:text-destructive":"fk:text-foreground";return jsxs("div",{className:`fk:flex fk:w-full fk:gap-3 fk:rounded-lg fk:border fk:bg-card fk:px-4 fk:py-3 fk:text-sm ${n} fk:corner-squircle`,role:"alert",children:[jsx(Re,{type:t.type}),jsxs("div",{className:"fk:min-w-0",children:[jsx("div",{className:"fk:font-medium",children:t.title}),t.message&&jsx("div",{className:"fk:text-muted-foreground",children:t.message})]})]})},Le=({element:e})=>{let t=e.props.columns??[],n=(e.props.rows??[]).map(s=>s.map(String));return jsx("div",{className:"fk:w-full fk:overflow-hidden fk:rounded-md fk:mt-2 fk:corner-squircle",children:jsxs(da,{children:[e.props.caption&&jsx(ka,{children:e.props.caption}),jsx(ea,{children:jsx(ha,{children:t.map((s,a)=>jsx(ia,{children:s},`${a.toString()}-${s}`))})}),jsx(fa,{children:n.map((s,a)=>jsx(ha,{children:s.map((i,l)=>jsx(ja,{children:i},l))},a))})]})})},ze=({element:e})=>{let{props:t}=e,n=t.max??100,s=n>0?Math.min(100,Math.max(0,t.value/n*100)):0;return jsxs("div",{className:"fk:w-full",children:[t.label&&jsxs("div",{className:"fk:mb-1 fk:flex fk:items-center fk:justify-between fk:text-xs fk:text-muted-foreground",children:[jsx("span",{children:t.label}),jsxs("span",{className:"fk:tabular-nums",children:[Math.round(s),"%"]})]}),jsx("div",{className:"fk:h-2 fk:w-full fk:overflow-hidden fk:rounded-full fk:bg-secondary fk:corner-squircle",children:jsx("div",{className:"fk:h-full fk:rounded-full fk:bg-primary fk:corner-squircle",style:{width:`${s.toString()}%`}})})]})},Ke=({element:e})=>jsx(t,{className:e.props.rounded?"fk:rounded-full fk:corner-squircle":"",style:{height:e.props.height??"1rem",width:e.props.width??"100%"}}),Me=({element:e})=>jsx(f,{href:e.props.href,children:e.props.label}),$e=({element:e})=>e.props.src?jsx("img",{alt:e.props.alt,className:"fk:max-w-full fk:rounded-md fk:corner-squircle",height:e.props.height??void 0,src:e.props.src,width:e.props.width??void 0}):null,Ie=({element:e})=>jsx("div",{className:"fk:w-full fk:divide-y fk:divide-border fk:rounded-md fk:border fk:border-border fk:corner-squircle",children:(e.props.items??[]).map((t,n)=>jsxs("details",{className:"fk:group fk:px-4 fk:py-3",children:[jsx("summary",{className:"fk:cursor-pointer fk:list-none fk:text-sm fk:font-medium",children:t.title}),jsx("p",{className:"fk:mt-2 fk:text-sm fk:text-muted-foreground",children:t.content})]},n))}),Ee=({children:e,element:t})=>{let n=t.props.tabs??[];return jsxs(la,{defaultValue:t.props.value??t.props.defaultValue??n[0]?.value,children:[jsx(ma,{children:n.map(s=>jsx(na,{value:s.value,children:s.label},s.value))}),e]})},qe=({children:e,element:t})=>jsx(oa,{value:t.props.value,children:e}),je={up:"fk:text-success",down:"fk:text-destructive",neutral:"fk:text-muted-foreground"};function Be({trend:e}){return e==="up"?jsx(TrendingUpIcon,{className:"fk:size-4"}):e==="down"?jsx(TrendingDownIcon,{className:"fk:size-4"}):jsx(MinusIcon,{className:"fk:size-4"})}var He=({element:e})=>{let{props:t}=e;return jsxs("div",{className:"fk:w-full fk:rounded-lg fk:border fk:border-border fk:bg-card fk:p-4 fk:corner-squircle",children:[jsx("div",{className:"fk:text-xs fk:font-medium fk:text-muted-foreground",children:t.label}),jsxs("div",{className:"fk:mt-1 fk:flex fk:items-center fk:gap-2",children:[jsx("span",{className:"fk:text-2xl fk:font-semibold fk:tabular-nums fk:tracking-tight",children:t.value}),t.trend&&jsx("span",{className:je[t.trend],children:jsx(Be,{trend:t.trend})})]}),t.detail&&jsx("div",{className:"fk:mt-1 fk:text-xs fk:text-muted-foreground",children:t.detail})]})},Je={info:"fk:border-blue-500/30 fk:bg-blue-500/5 fk:text-blue-700 fk:dark:text-blue-400",tip:"fk:border-emerald-500/30 fk:bg-emerald-500/5 fk:text-emerald-700 fk:dark:text-emerald-400",warning:"fk:border-amber-500/30 fk:bg-amber-500/5 fk:text-amber-700 fk:dark:text-amber-400",important:"fk:border-red-500/30 fk:bg-red-500/5 fk:text-red-700 fk:dark:text-red-400"};function Xe({type:e}){switch(e){case "tip":return jsx(LightbulbIcon,{className:"fk:size-4 fk:shrink-0 fk:translate-y-0.5"});case "warning":return jsx(AlertTriangleIcon,{className:"fk:size-4 fk:shrink-0 fk:translate-y-0.5"});case "important":return jsx(OctagonAlertIcon,{className:"fk:size-4 fk:shrink-0 fk:translate-y-0.5"});default:return jsx(InfoIcon,{className:"fk:size-4 fk:shrink-0 fk:translate-y-0.5"})}}var Fe=({element:e})=>{let{props:t}=e,n=t.type??"info";return jsxs("div",{className:`fk:flex fk:w-full fk:gap-3 fk:rounded-lg fk:border fk:px-4 fk:py-3 fk:text-sm ${Je[n]} fk:corner-squircle`,children:[jsx(Xe,{type:n}),jsxs("div",{className:"fk:min-w-0",children:[t.title&&jsx("div",{className:"fk:font-medium",children:t.title}),jsx("div",{className:"fk:text-foreground",children:t.content})]})]})},Oe={completed:"fk:border-success fk:bg-success",current:"fk:border-primary fk:bg-primary",upcoming:"fk:border-border fk:bg-background"},Ge=({element:e})=>jsx("div",{className:"fk:w-full",children:(e.props.items??[]).map((t,n,s)=>jsxs("div",{className:"fk:relative fk:flex fk:gap-3 fk:pb-4 fk:last:pb-0",children:[n<s.length-1&&jsx("div",{className:"fk:absolute fk:left-[5px] fk:top-4 fk:h-full fk:w-px fk:bg-border"}),jsx("div",{className:`fk:mt-1 fk:size-[11px] fk:shrink-0 fk:rounded-full fk:border-2 ${Oe[t.status??"upcoming"]} fk:corner-squircle`}),jsxs("div",{className:"fk:min-w-0",children:[jsxs("div",{className:"fk:flex fk:flex-wrap fk:items-baseline fk:gap-x-2",children:[jsx("span",{className:"fk:text-sm fk:font-medium",children:t.title}),t.date&&jsx("span",{className:"fk:text-xs fk:text-muted-foreground",children:t.date})]}),t.description&&jsx("div",{className:"fk:text-sm fk:text-muted-foreground",children:t.description})]})]},n))}),c=["#6366f1","#10b981","#f59e0b","#ef4444","#06b6d4"],b={background:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:6,color:"hsl(var(--foreground))",fontSize:12},v={color:"hsl(var(--foreground))"},y={color:"hsl(var(--foreground))"},u={fill:"hsl(var(--muted-foreground))",fontSize:11};function g(e){let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:0}function X(e){let t=e.data??[];if(!e.aggregate)return t.map(s=>({x:String(s[e.xKey]??""),y:g(s[e.yKey])}));let n=new Map;for(let s of t){let a=String(s[e.xKey]??""),i=n.get(a)??{count:0,sum:0};i.count+=1,i.sum+=g(s[e.yKey]),n.set(a,i);}return Array.from(n.entries()).map(([s,a])=>e.aggregate==="count"?{x:s,y:a.count}:e.aggregate==="avg"?{x:s,y:a.count===0?0:a.sum/a.count}:{x:s,y:a.sum})}function x({children:e,height:t,title:n}){return jsxs("div",{className:"fk:w-full",children:[n&&jsx("div",{className:"fk:mb-2 fk:text-sm fk:font-medium",children:n}),jsx("div",{style:{height:t??256},children:jsx(ResponsiveContainer,{height:"100%",width:"100%",children:e})})]})}var We=({element:e})=>{let t=X(e.props),n=e.props.color??c[0];return jsx(x,{height:e.props.height,title:e.props.title,children:jsxs(BarChart,{data:t,children:[jsx(CartesianGrid,{stroke:"hsl(var(--border))",vertical:false}),jsx(XAxis,{axisLine:false,dataKey:"x",tick:u,tickLine:false,tickMargin:8}),jsx(YAxis,{axisLine:false,tick:u,tickLine:false,width:40}),jsx(Tooltip,{contentStyle:b,cursor:{fill:"hsl(var(--muted))"},itemStyle:v,labelStyle:y}),jsx(Bar,{dataKey:"y",fill:n,isAnimationActive:false,name:e.props.yKey,radius:4})]})})},_e=({element:e})=>{let t=X(e.props),n=e.props.color??c[0];return jsx(x,{height:e.props.height,title:e.props.title,children:jsxs(LineChart,{data:t,children:[jsx(CartesianGrid,{stroke:"hsl(var(--border))",vertical:false}),jsx(XAxis,{axisLine:false,dataKey:"x",tick:u,tickLine:false,tickMargin:8}),jsx(YAxis,{axisLine:false,tick:u,tickLine:false,width:40}),jsx(Tooltip,{contentStyle:b,itemStyle:v,labelStyle:y}),jsx(Line,{dataKey:"y",dot:false,isAnimationActive:false,name:e.props.yKey,stroke:n,strokeWidth:2,type:"monotone"})]})})},Ve=({element:e})=>{let t=(e.props.data??[]).map(n=>({name:String(n[e.props.nameKey]??""),value:g(n[e.props.valueKey])}));return jsx(x,{height:e.props.height,title:e.props.title,children:jsxs(PieChart,{children:[jsx(Tooltip,{contentStyle:b,itemStyle:v,labelStyle:y}),jsx(Pie,{data:t,dataKey:"value",innerRadius:"45%",isAnimationActive:false,nameKey:"name",children:t.map((n,s)=>jsx(Cell,{fill:c[s%c.length]},`${n.name}-${s.toString()}`))})]})})},De=({element:e})=>{let{chart:t$1,title:n}=e.props,s=useId().replace(/[^a-zA-Z0-9]/g,""),[a,i]=useState(null),[l,f]=useState(null);return useEffect(()=>{let k=false;return (async()=>{try{let{default:d}=await import('mermaid'),F=document.documentElement.classList.contains("dark");d.initialize({securityLevel:"strict",startOnLoad:!1,theme:F?"dark":"default"});let O=await d.render(`fk-mermaid-${s}`,t$1);k||(i(O.svg),f(null));}catch(d){k||f(d instanceof Error?d.message:"Failed to render the diagram.");}})(),()=>{k=true;}},[t$1,s]),jsxs("div",{className:"fk:w-full fk:rounded-lg fk:border fk:border-border fk:bg-card fk:p-4 fk:corner-squircle",children:[n&&jsx("div",{className:"fk:mb-2 fk:text-sm fk:font-medium",children:n}),l?jsx("pre",{className:"fk:overflow-x-auto fk:whitespace-pre-wrap fk:text-xs fk:text-muted-foreground",children:t$1}):null,!l&&a?jsx("div",{className:"fk:flex fk:justify-center fk:overflow-x-auto",dangerouslySetInnerHTML:{__html:a}}):null,!l&&!a?jsx(t,{className:"fk:h-40 fk:w-full"}):null]})},Ue={Accordion:Ie,Alert:Ae,Badge:Te,BarChart:We,Callout:Fe,Card:pe,Grid:xe,Heading:we,Image:$e,LineChart:_e,Link:Me,Mermaid:De,Metric:He,PieChart:Ve,Progress:ze,Separator:Ce,Skeleton:Ke,Stack:be,TabContent:qe,Table:Le,Tabs:Ee,Text:Se,Timeline:Ge},Ye=({element:e})=>jsxs("div",{className:"fk:rounded-md fk:border fk:border-dashed fk:border-border fk:p-3 fk:text-sm fk:text-muted-foreground fk:corner-squircle",children:["Unsupported component: ",e.type]});function Ze(e,t){let n=new Set,s=[];for(let a of e??[]){let i=String(a);n.has(i)||!t[i]||(n.add(i),s.push(i));}return s}function Qe(e,t){return e.length!==t.length?true:t.some((n,s)=>n!==e[s])}function et(e){if(!e.elements[e.root])return null;let t=false,n={};for(let s of Object.keys(e.elements)){let a=e.elements[s];if(!a)continue;let i=a.children??[],l=Ze(i,e.elements),f=Qe(i,l);f&&(t=true),n[s]=f?{...a,children:l}:a;}return t?{...e,elements:n}:e}var tt="data-spec";function rt(e){let t=new Set,n=[];for(let s of e){if(s.type!==tt)continue;let a=s.data;if(a&&typeof a=="object"&&"type"in a&&a.type==="patch"&&"patch"in a){let i=JSON.stringify(a.patch);if(t.has(i))continue;t.add(i);}n.push(s);}return n}function ft({parts:e}){let t=useMemo(()=>{let s=buildSpecFromParts(rt(e));return s?et(s):null},[e]),n=useMemo(()=>JSON.stringify(t?.state??{}),[t]);return t?jsx(StateProvider,{initialState:t.state,children:jsx(VisibilityProvider,{children:jsx(ActionProvider,{children:jsx(Renderer,{fallback:Ye,registry:Ue,spec:t})})})},n):null}export{ft as RunSpecPart};//# sourceMappingURL=spec-renderer-5YGDRF52.js.map
2
- //# sourceMappingURL=spec-renderer-5YGDRF52.js.map
@@ -1,2 +0,0 @@
1
- import'./index.css';import {h}from'./chunk-NNA4MLFC.js';import {t,e,g,a,b as b$1,c,h as h$1,n,o,k,j,p}from'./chunk-SZEGGBOC.js';import {b,d}from'./chunk-5DHOBLAE.js';import'./chunk-O2QMYUPS.js';import v from'boring-avatars';import {Monitor,Moon,Sun}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';var A=["#06d9b6","#a4f479","#d4d323","#fb468f","#0ec4f1"];function z({projectId:D}){let{theme:a$1,setTheme:t$1}=b(),[C,r]=h();return C?jsx(t,{className:"fk:h-8 fk:w-8 fk:rounded-full fk:corner-squircle"}):jsxs(e,{children:[jsx(g,{asChild:true,children:jsx(d,{className:"fk:relative fk:h-8 fk:w-8 fk:rounded-full fk:corner-squircle",variant:"ghost",children:jsxs(a,{className:"fk:h-8 fk:w-8",children:[r.user?.avatar_url?jsx(b$1,{alt:r.user.display_name,src:r.user.avatar_url}):null,jsx(c,{className:"fk:bg-transparent",children:jsx(v,{className:"fk:size-8",colors:A,name:r.user?.id??"user",size:32,variant:"marble"})})]})})}),jsxs(h$1,{align:"end",className:"fk:w-56",forceMount:true,children:[jsx(n,{className:"font-normal",children:jsxs("div",{className:"fk:flex fk:flex-col fk:space-y-1",children:[jsx("p",{className:"fk:text-sm fk:font-medium fk:leading-none",children:r.user?.display_name}),jsx("p",{className:"fk:text-xs fk:leading-none fk:text-muted-foreground",children:r.user?.email})]})}),jsx(o,{}),jsx(n,{children:"Theme"}),jsxs(k,{checked:a$1==="system",onCheckedChange:()=>{t$1("system");},children:[jsx(Monitor,{className:"fk:mr-2 fk:h-4 fk:w-4"}),jsx("span",{children:"System"})]}),jsxs(k,{checked:a$1==="dark",onCheckedChange:()=>{t$1("dark");},children:[jsx(Moon,{className:"fk:mr-2 fk:h-4 fk:w-4"}),jsx("span",{children:"Dark"})]}),jsxs(k,{checked:a$1==="light",onCheckedChange:()=>{t$1("light");},children:[jsx(Sun,{className:"fk:mr-2 fk:h-4 fk:w-4"}),jsx("span",{children:"Light"})]}),jsx(o,{}),jsxs(j,{onClick:()=>{r.logout(D).then(()=>{}).catch(()=>{});},children:["Log out",jsx(p,{children:"\u21E7\u2318Q"})]})]})]})}export{z as UserNav};//# sourceMappingURL=user-nav-QZFCICK3.js.map
2
- //# sourceMappingURL=user-nav-QZFCICK3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/components/user-nav.tsx"],"names":["AVATAR_COLORS","UserNav","projectId","theme","setTheme","useTheme","isLoading","auth","useAuth","jsx","Skeleton","jsxs","DropdownMenu","DropdownMenuTrigger","Button","Avatar","AvatarImage","AvatarFallback","BoringAvatar","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuCheckboxItem","Monitor","Moon","Sun","DropdownMenuItem","DropdownMenuShortcut"],"mappings":"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","file":"user-nav-QZFCICK3.js","sourcesContent":["import type { JSX } from 'react';\nimport BoringAvatar from 'boring-avatars';\nimport { Monitor, Moon, Sun } from 'lucide-react';\nimport { useTheme } from '../theme-context';\nimport { Avatar, AvatarFallback, AvatarImage } from '../primitives/avatar';\nimport { Button } from '../primitives/button';\nimport { Skeleton } from '../primitives/skeleton';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuTrigger,\n} from '../primitives/dropdown-menu';\nimport { useAuth } from '../../auth/auth-context';\n\nconst AVATAR_COLORS = ['#06d9b6', '#a4f479', '#d4d323', '#fb468f', '#0ec4f1'];\n\ntype Props = {\n projectId: string;\n};\n\nexport function UserNav({ projectId }: Props): JSX.Element {\n const { theme, setTheme } = useTheme();\n const [isLoading, auth] = useAuth();\n\n if (isLoading) {\n return <Skeleton className=\"fk:h-8 fk:w-8 fk:rounded-full fk:corner-squircle\" />;\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button className=\"fk:relative fk:h-8 fk:w-8 fk:rounded-full fk:corner-squircle\" variant=\"ghost\">\n <Avatar className=\"fk:h-8 fk:w-8\">\n {auth.user?.avatar_url ? <AvatarImage alt={auth.user.display_name} src={auth.user.avatar_url} /> : null}\n <AvatarFallback className=\"fk:bg-transparent\">\n <BoringAvatar\n className=\"fk:size-8\"\n colors={AVATAR_COLORS}\n name={auth.user?.id ?? 'user'}\n size={32}\n variant=\"marble\"\n />\n </AvatarFallback>\n </Avatar>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"fk:w-56\" forceMount>\n <DropdownMenuLabel className=\"font-normal\">\n <div className=\"fk:flex fk:flex-col fk:space-y-1\">\n <p className=\"fk:text-sm fk:font-medium fk:leading-none\">{auth.user?.display_name}</p>\n <p className=\"fk:text-xs fk:leading-none fk:text-muted-foreground\">{auth.user?.email}</p>\n </div>\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n <DropdownMenuLabel>Theme</DropdownMenuLabel>\n <DropdownMenuCheckboxItem\n checked={theme === 'system'}\n onCheckedChange={() => {\n setTheme('system');\n }}\n >\n <Monitor className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n <span>System</span>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={theme === 'dark'}\n onCheckedChange={() => {\n setTheme('dark');\n }}\n >\n <Moon className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n <span>Dark</span>\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={theme === 'light'}\n onCheckedChange={() => {\n setTheme('light');\n }}\n >\n <Sun className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n <span>Light</span>\n </DropdownMenuCheckboxItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n auth\n .logout(projectId)\n .then(() => {\n //\n })\n .catch(() => {\n //\n });\n }}\n >\n Log out\n <DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"]}