@graphmemory/server 1.3.1 → 1.3.3
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/api/rest/graph.js +1 -1
- package/dist/api/rest/index.js +21 -5
- package/dist/api/rest/validation.js +17 -17
- package/dist/api/tools/code/get-file-symbols.js +2 -2
- package/dist/api/tools/code/get-symbol.js +2 -2
- package/dist/api/tools/code/list-files.js +2 -2
- package/dist/api/tools/code/search-code.js +2 -1
- package/dist/api/tools/code/search-files.js +2 -1
- package/dist/api/tools/docs/cross-references.js +2 -1
- package/dist/api/tools/docs/explain-symbol.js +2 -1
- package/dist/api/tools/docs/find-examples.js +2 -1
- package/dist/api/tools/docs/get-node.js +2 -2
- package/dist/api/tools/docs/get-toc.js +2 -2
- package/dist/api/tools/docs/list-snippets.js +4 -4
- package/dist/api/tools/docs/list-topics.js +2 -2
- package/dist/api/tools/docs/search-files.js +2 -1
- package/dist/api/tools/docs/search-snippets.js +3 -2
- package/dist/api/tools/docs/search.js +2 -1
- package/dist/api/tools/file-index/get-file-info.js +2 -2
- package/dist/api/tools/file-index/list-all-files.js +5 -5
- package/dist/api/tools/file-index/search-all-files.js +2 -1
- package/dist/api/tools/knowledge/add-attachment.js +26 -4
- package/dist/api/tools/knowledge/create-note.js +4 -3
- package/dist/api/tools/knowledge/create-relation.js +5 -4
- package/dist/api/tools/knowledge/delete-note.js +2 -2
- package/dist/api/tools/knowledge/delete-relation.js +4 -3
- package/dist/api/tools/knowledge/find-linked-notes.js +4 -3
- package/dist/api/tools/knowledge/get-note.js +2 -2
- package/dist/api/tools/knowledge/list-notes.js +4 -3
- package/dist/api/tools/knowledge/list-relations.js +1 -1
- package/dist/api/tools/knowledge/remove-attachment.js +1 -1
- package/dist/api/tools/knowledge/search-notes.js +2 -1
- package/dist/api/tools/knowledge/update-note.js +6 -5
- package/dist/api/tools/skills/add-attachment.js +26 -4
- package/dist/api/tools/skills/bump-usage.js +2 -2
- package/dist/api/tools/skills/create-skill-link.js +6 -5
- package/dist/api/tools/skills/create-skill.js +8 -7
- package/dist/api/tools/skills/delete-skill-link.js +4 -3
- package/dist/api/tools/skills/delete-skill.js +2 -2
- package/dist/api/tools/skills/find-linked-skills.js +4 -3
- package/dist/api/tools/skills/get-skill.js +2 -2
- package/dist/api/tools/skills/link-skill.js +2 -2
- package/dist/api/tools/skills/list-skills.js +4 -3
- package/dist/api/tools/skills/recall-skills.js +2 -1
- package/dist/api/tools/skills/remove-attachment.js +1 -1
- package/dist/api/tools/skills/search-skills.js +2 -1
- package/dist/api/tools/skills/update-skill.js +10 -9
- package/dist/api/tools/tasks/add-attachment.js +26 -4
- package/dist/api/tools/tasks/create-task-link.js +6 -5
- package/dist/api/tools/tasks/create-task.js +5 -4
- package/dist/api/tools/tasks/delete-task-link.js +4 -3
- package/dist/api/tools/tasks/delete-task.js +2 -2
- package/dist/api/tools/tasks/find-linked-tasks.js +4 -3
- package/dist/api/tools/tasks/get-task.js +2 -2
- package/dist/api/tools/tasks/link-task.js +2 -2
- package/dist/api/tools/tasks/list-tasks.js +5 -4
- package/dist/api/tools/tasks/move-task.js +2 -2
- package/dist/api/tools/tasks/remove-attachment.js +1 -1
- package/dist/api/tools/tasks/search-tasks.js +2 -1
- package/dist/api/tools/tasks/update-task.js +7 -6
- package/dist/cli/index.js +3 -1
- package/dist/cli/indexer.js +38 -24
- package/dist/graphs/code.js +4 -0
- package/dist/graphs/docs.js +4 -0
- package/dist/graphs/file-index.js +4 -0
- package/dist/graphs/knowledge.js +5 -0
- package/dist/graphs/skill.js +5 -0
- package/dist/graphs/task.js +5 -0
- package/dist/lib/defaults.js +1 -1
- package/dist/lib/file-import.js +8 -2
- package/dist/lib/file-mirror.js +77 -21
- package/dist/lib/graph-persistence.js +42 -0
- package/dist/lib/jwt.js +6 -5
- package/dist/lib/multi-config.js +3 -1
- package/dist/lib/parsers/languages/typescript.js +11 -6
- package/dist/lib/promise-queue.js +20 -2
- package/dist/ui/assets/{NoteForm-aZX9f6-3.js → NoteForm-D0lOYBQq.js} +1 -1
- package/dist/ui/assets/{SkillForm-KYa3o92l.js → SkillForm-CfDWe0Nx.js} +1 -1
- package/dist/ui/assets/{TaskForm-Bl5nkybO.js → TaskForm-ltmMCEAE.js} +1 -1
- package/dist/ui/assets/{_articleId_-DjbCByxM.js → _articleId_-mEqH7YfV.js} +1 -1
- package/dist/ui/assets/{_docId_-hdCDjclV.js → _docId_-wAt8n8p4.js} +1 -1
- package/dist/ui/assets/{_filePath_-CpG836v4.js → _filePath_-DQMFMLQh.js} +1 -1
- package/dist/ui/assets/{_noteId_-C1enaQd1.js → _noteId_-Cqxl6H5q.js} +1 -1
- package/dist/ui/assets/{_skillId_-hPoCet7J.js → _skillId_-BlJOfwm_.js} +1 -1
- package/dist/ui/assets/{_taskId_-DSB3dLVz.js → _taskId_-Cs8LaIe4.js} +1 -1
- package/dist/ui/assets/{_toolName_-3SmCfxZy.js → _toolName_-3CHUDagf.js} +1 -1
- package/dist/ui/assets/{attachments-CEQ-2nMo.js → attachments-CMDVqPm_.js} +1 -1
- package/dist/ui/assets/{docs-CrXsRcOG.js → docs-BuFjplSR.js} +1 -1
- package/dist/ui/assets/{edit-TUIIpUMF.js → edit-7NV817UE.js} +1 -1
- package/dist/ui/assets/{edit-BYiy1FZy.js → edit-Bflx3-cK.js} +1 -1
- package/dist/ui/assets/{edit-hc-ZWz3y.js → edit-CdmIaFUI.js} +1 -1
- package/dist/ui/assets/{esm-BWiKNcBW.js → esm-CqydI1a6.js} +1 -1
- package/dist/ui/assets/{files-0bPg6NH9.js → files-BWNbyH1X.js} +1 -1
- package/dist/ui/assets/{graph-DXGud_wF.js → graph-B9nFxoXm.js} +1 -1
- package/dist/ui/assets/{help-DJ52_fxN.js → help-CqK0hEmf.js} +1 -1
- package/dist/ui/assets/{help-CEMQqZUR.js → help-D6XKMuzk.js} +16 -4
- package/dist/ui/assets/index-80sqSHwS.js +2 -0
- package/dist/ui/assets/{knowledge-DeygeGGH.js → knowledge-g4C4l6uL.js} +1 -1
- package/dist/ui/assets/{new-s8c0M75X.js → new-Bqup97cu.js} +1 -1
- package/dist/ui/assets/{new-DHTg3Dqq.js → new-DC3lRvxF.js} +1 -1
- package/dist/ui/assets/{new-CpD7hOBA.js → new-DbsKrGJ4.js} +1 -1
- package/dist/ui/assets/{prompts-BgOmdxgM.js → prompts-DyltFLqJ.js} +1 -1
- package/dist/ui/assets/{search-EpJhdP2a.js → search-DtRoWsqW.js} +1 -1
- package/dist/ui/assets/{skill-y9pizyqE.js → skill-demt31s6.js} +1 -1
- package/dist/ui/assets/{skills-Cga9iUZN.js → skills-DRjYPbZM.js} +1 -1
- package/dist/ui/assets/{tasks-CobouTKV.js → tasks-CgsSFz6X.js} +1 -1
- package/dist/ui/assets/{tools-JxKH5BDF.js → tools-BDszA6Kh.js} +1 -1
- package/dist/ui/assets/{vendor-markdown-CT8ZVEPu.js → vendor-markdown-DngssFHR.js} +27 -27
- package/dist/ui/assets/{vendor-md-editor-DmWafJvr.js → vendor-md-editor-DC6xr_29.js} +10 -10
- package/dist/ui/assets/{vendor-mui-BPj7d3Sw.js → vendor-mui-DXUYJbRC.js} +1 -1
- package/dist/ui/assets/{vendor-mui-icons-B196sG3f.js → vendor-mui-icons-YtgP6dg2.js} +1 -1
- package/dist/ui/assets/{vendor-react-CHUjhoxh.js → vendor-react-DxfYAwYK.js} +1 -1
- package/dist/ui/index.html +6 -6
- package/package.json +1 -1
- package/dist/ui/assets/index-BCZDAYZi.js +0 -2
|
@@ -419,7 +419,7 @@ projects:
|
|
|
419
419
|
projectDir: "/path/to/my-app"
|
|
420
420
|
\`\`\`
|
|
421
421
|
|
|
422
|
-
The only required field is \`projects.*.projectDir\`. Everything else has sensible defaults (docs indexes \`**/*.md\`, code indexes \`**/*.{js,ts,jsx,tsx}\`).
|
|
422
|
+
The only required field is \`projects.*.projectDir\`. Everything else has sensible defaults (docs indexes \`**/*.md\`, code indexes \`**/*.{js,ts,jsx,tsx,mjs,mts,cjs,cts}\`).
|
|
423
423
|
|
|
424
424
|
## Author settings
|
|
425
425
|
|
|
@@ -443,11 +443,21 @@ Can be overridden per project or per workspace.
|
|
|
443
443
|
| \`modelsDir\` | \`~/.graph-memory/models\` | Where embedding models are cached locally |
|
|
444
444
|
| \`corsOrigins\` | — | Allowed CORS origins (array of strings) |
|
|
445
445
|
| \`defaultAccess\` | \`rw\` | Default access for unknown users: \`deny\`, \`r\`, \`rw\` |
|
|
446
|
+
| \`jwtSecret\` | — | **Required when users are defined.** Secret for signing JWT tokens (min 16 chars) |
|
|
447
|
+
| \`cookieSecure\` | auto | Set cookie \`Secure\` flag explicitly. Defaults to \`true\` unless \`NODE_ENV=development\` |
|
|
448
|
+
| \`accessTokenTtl\` | \`15m\` | JWT access token lifetime |
|
|
449
|
+
| \`refreshTokenTtl\` | \`7d\` | JWT refresh token lifetime |
|
|
450
|
+
| \`maxFileSize\` | \`1048576\` | Max file size for indexing in bytes (1 MB) |
|
|
451
|
+
| \`rateLimit.global\` | \`600\` | Requests/min per IP for all API routes |
|
|
452
|
+
| \`rateLimit.search\` | \`120\` | Requests/min per IP for search/embed endpoints |
|
|
453
|
+
| \`rateLimit.auth\` | \`10\` | Requests/min per IP for login endpoint |
|
|
446
454
|
| \`embedding.model\` | \`Xenova/bge-m3\` | Default model for all graphs |
|
|
447
455
|
| \`embedding.remote\` | — | Remote embedding API URL (delegates instead of local model) |
|
|
448
456
|
| \`embedding.remoteApiKey\` | — | API key for remote embedding |
|
|
449
457
|
| \`embeddingApi.enabled\` | \`false\` | Expose local model via \`POST /api/embed\` |
|
|
450
458
|
| \`embeddingApi.apiKey\` | — | API key for the embedding endpoint |
|
|
459
|
+
| \`embeddingApi.maxTexts\` | \`100\` | Max texts per embedding request |
|
|
460
|
+
| \`embeddingApi.maxTextChars\` | \`10000\` | Max characters per single text |
|
|
451
461
|
|
|
452
462
|
## Project settings
|
|
453
463
|
|
|
@@ -485,7 +495,7 @@ projects:
|
|
|
485
495
|
bob: rw
|
|
486
496
|
code:
|
|
487
497
|
enabled: true
|
|
488
|
-
include: "**/*.{js,ts,jsx,tsx}"
|
|
498
|
+
include: "**/*.{js,ts,jsx,tsx,mjs,mts,cjs,cts}" # Default — indexes all JS/TS files
|
|
489
499
|
model:
|
|
490
500
|
name: "Xenova/bge-base-en-v1.5"
|
|
491
501
|
knowledge:
|
|
@@ -668,9 +678,11 @@ server:
|
|
|
668
678
|
embeddingApi:
|
|
669
679
|
enabled: true # Enable POST /api/embed endpoint
|
|
670
680
|
apiKey: "emb-secret-key" # API key for embedding requests (separate from user apiKeys)
|
|
681
|
+
maxTexts: 100 # Max texts per request (default: 100)
|
|
682
|
+
maxTextChars: 10000 # Max chars per text (default: 10000)
|
|
671
683
|
\`\`\`
|
|
672
684
|
|
|
673
|
-
When enabled, \`POST /api/embed\` accepts \`{
|
|
685
|
+
When enabled, \`POST /api/embed\` accepts \`{ texts: ["text1", "text2"] }\` and returns embeddings from the server's configured model. Authenticate with \`Authorization: Bearer <apiKey>\` using the \`embeddingApi.apiKey\`.
|
|
674
686
|
|
|
675
687
|
## Remote embedding setup
|
|
676
688
|
|
|
@@ -703,7 +715,7 @@ server:
|
|
|
703
715
|
- "https://my-app.example.com" # Production frontend
|
|
704
716
|
\`\`\`
|
|
705
717
|
|
|
706
|
-
When \`corsOrigins\` is not set,
|
|
718
|
+
When \`corsOrigins\` is not set, all origins are allowed. Set this to restrict access when the server is exposed to the internet. \`credentials: true\` is always enabled for cookie-based auth.
|
|
707
719
|
|
|
708
720
|
## Common patterns
|
|
709
721
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-CqydI1a6.js","assets/vendor-md-editor-DC6xr_29.js","assets/rolldown-runtime-Dw2cE7zH.js","assets/vendor-markdown-DngssFHR.js","assets/vendor-md-editor-HrwGbQou.css","assets/knowledge-g4C4l6uL.js","assets/vendor-react-DxfYAwYK.js","assets/vendor-mui-DXUYJbRC.js","assets/vendor-mui-icons-YtgP6dg2.js","assets/NoteForm-D0lOYBQq.js","assets/_noteId_-Cqxl6H5q.js","assets/skill-demt31s6.js","assets/client-Bq88u7gN.js","assets/attachments-CMDVqPm_.js","assets/api-CrGJOcaN.js","assets/api-BlFF6gX-.js","assets/api-BMnBjMMf.js","assets/new-DC3lRvxF.js","assets/edit-Bflx3-cK.js","assets/tasks-CgsSFz6X.js","assets/_taskId_-Cs8LaIe4.js","assets/new-DbsKrGJ4.js","assets/TaskForm-ltmMCEAE.js","assets/edit-7NV817UE.js","assets/skills-DRjYPbZM.js","assets/SkillForm-CfDWe0Nx.js","assets/_skillId_-BlJOfwm_.js","assets/new-Bqup97cu.js","assets/edit-CdmIaFUI.js","assets/docs-BuFjplSR.js","assets/_docId_-wAt8n8p4.js","assets/files-BWNbyH1X.js","assets/_filePath_-DQMFMLQh.js","assets/search-DtRoWsqW.js","assets/graph-B9nFxoXm.js","assets/vendor-graph-BWpSgpMe.js","assets/tools-BDszA6Kh.js","assets/api-DuX-0a_X.js","assets/_toolName_-3CHUDagf.js","assets/help-D6XKMuzk.js","assets/prompts-DyltFLqJ.js","assets/help-CqK0hEmf.js","assets/_articleId_-mEqH7YfV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,_ as n,g as r,h as i,k as a}from"./vendor-markdown-DngssFHR.js";import{a as o,c as s,d as c,f as l,i as u,l as d,n as f,o as p,r as m,s as h,t as g}from"./vendor-react-DxfYAwYK.js";import{$ as _,B as v,C as ee,D as y,E as b,F as te,H as x,I as ne,J as S,K as C,L as w,O as re,Q as ie,R as ae,S as T,V as oe,W as E,X as D,Y as O,Z as se,dt as k,et as A,f as ce,h as le,i as ue,lt as de,nt as j,o as fe,q as M,r as N,tt as P,ut as F,v as pe,y as me,z as he}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{i as I,n as L,r as R,t as ge}from"./client-Bq88u7gN.js";import{$ as _e,G as ve,J as z,K as B,Q as ye,U as be,W as xe,X as V,Y as Se,Z as H,at as Ce,ct as U,dt as W,et as we,ft as Te,it as G,lt as K,mt as Ee,nt as De,ot as Oe,pt as ke,q as Ae,rt as je,st as Me,tt as Ne,ut as Pe}from"./vendor-mui-icons-YtgP6dg2.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Fe=l(),q=e(a(),1),Ie={fontFamily:`"Inter", "Roboto", "Helvetica", "Arial", sans-serif`},Le=k({palette:{mode:`dark`,primary:{main:`#569cd6`},secondary:{main:`#c586c0`},success:{main:`#6a9955`},error:{main:`#f14c4c`},warning:{main:`#cca700`},info:{main:`#3794ff`},background:{default:`#1e1e1e`,paper:`#252526`},text:{primary:`#cccccc`,secondary:`#9d9d9d`},divider:`#3c3c3c`,action:{hover:`rgba(90,93,94,0.31)`,selected:`rgba(90,93,94,0.40)`,focus:`rgba(90,93,94,0.48)`},custom:{surface:`#252526`,surfaceMuted:`#2d2d2d`,border:`#3c3c3c`,textMuted:`#858585`,textOnPrimary:`#ffffff`,neutral:`#858585`}},typography:Ie,components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:`#1e1e1e`},"*::-webkit-scrollbar":{width:10,height:10},"*::-webkit-scrollbar-track":{background:`#1e1e1e`},"*::-webkit-scrollbar-thumb":{background:`#424242`,borderRadius:0},"*::-webkit-scrollbar-thumb:hover":{background:`#4f4f4f`}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:`#181818`,borderRight:`1px solid #2b2b2b`}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:`#181818`,boxShadow:`none`,borderBottom:`1px solid #2b2b2b`}}},MuiCard:{styleOverrides:{root:{backgroundColor:`#252526`,border:`1px solid #3c3c3c`}}},MuiPaper:{styleOverrides:{root:{backgroundImage:`none`}}},MuiTableHead:{styleOverrides:{root:{"& .MuiTableCell-head":{backgroundColor:`#2d2d2d`,color:`#cccccc`}}}},MuiTableCell:{styleOverrides:{root:{borderBottom:`1px solid #3c3c3c`}}},MuiChip:{styleOverrides:{root:{backgroundColor:`#2d2d2d`,border:`1px solid #3c3c3c`}}},MuiButton:{styleOverrides:{contained:{boxShadow:`none`,"&:hover":{boxShadow:`none`}},containedPrimary:{backgroundColor:`#0e639c`,"&:hover":{backgroundColor:`#1177bb`}}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{backgroundColor:`#3c3c3c`,"& fieldset":{borderColor:`#3c3c3c`},"&:hover fieldset":{borderColor:`#569cd6`},"&.Mui-focused fieldset":{borderColor:`#569cd6`}}}}},MuiSelect:{styleOverrides:{root:{backgroundColor:`#3c3c3c`,"& .MuiOutlinedInput-notchedOutline":{borderColor:`#3c3c3c`},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:`#569cd6`}}}},MuiListItemButton:{styleOverrides:{root:{"&.Mui-selected":{backgroundColor:`rgba(90,93,94,0.40)`}}}},MuiTab:{styleOverrides:{root:{textTransform:`none`,color:`#969696`,"&.Mui-selected":{color:`#ffffff`}}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:`#383838`,border:`1px solid #454545`,color:`#cccccc`}}},MuiMenu:{styleOverrides:{paper:{backgroundColor:`#2d2d2d`,border:`1px solid #454545`}}},MuiDialog:{styleOverrides:{paper:{backgroundColor:`#252526`,border:`1px solid #454545`}}}}}),Re=k({palette:{mode:`light`,primary:{main:`#1976d2`},secondary:{main:`#9c27b0`},success:{main:`#2e7d32`},error:{main:`#d32f2f`},warning:{main:`#ed6c02`},background:{default:`#f0f2f5`,paper:`#ffffff`},custom:{surface:`#ffffff`,surfaceMuted:`#f5f5f5`,border:`#e0e0e0`,textMuted:`#757575`,textOnPrimary:`#ffffff`,neutral:`#9e9e9e`}},typography:Ie,components:{MuiInputLabel:{styleOverrides:{root:{fontSize:`0.8125rem`,textTransform:`uppercase`,letterSpacing:`0.04em`,fontWeight:500,"&.MuiInputLabel-shrink":{transform:`translate(14px, -9px) scale(0.85)`}}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:`#ffffff`,borderRight:`1px solid #e0e0e0`}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:`#ffffff`,boxShadow:`none`,borderBottom:`1px solid #e0e0e0`}}},MuiCard:{styleOverrides:{root:{backgroundColor:`#ffffff`,border:`1px solid #e0e0e0`}}},MuiTableHead:{styleOverrides:{root:{"& .MuiTableCell-head":{backgroundColor:`#f5f5f5`}}}},MuiChip:{styleOverrides:{root:{backgroundColor:`#f5f5f5`,border:`1px solid #e0e0e0`}}}}}),J=t(),ze=(0,q.createContext)({mode:`dark`,toggle:()=>{}});function Be({children:e}){let[t,n]=(0,q.useState)(()=>localStorage.getItem(`theme-mode`)===`light`?`light`:`dark`),r=(0,q.useCallback)(()=>{n(e=>{let t=e===`dark`?`light`:`dark`;return localStorage.setItem(`theme-mode`,t),t})},[]);return(0,J.jsx)(ze,{value:(0,q.useMemo)(()=>({mode:t,toggle:r}),[t,r]),children:(0,J.jsxs)(de,{theme:t===`dark`?Le:Re,children:[(0,J.jsx)(x,{}),e]})})}function Ve(){return(0,q.useContext)(ze)}function He(){return R(`/projects`).then(I)}function Ue(){return R(`/workspaces`).then(I)}function We(e){return R(`/projects/${e}/stats`)}function Ge(e){return R(`/projects/${e}/team`).then(I)}async function Ke(){return(await fetch(`/api/auth/status`,{credentials:`include`})).json()}function qe({onSuccess:e}){let[t,n]=(0,q.useState)(``),[r,i]=(0,q.useState)(``),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)(!1);return(0,J.jsx)(O,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`100vh`},children:(0,J.jsx)(C,{sx:{maxWidth:400,width:`100%`,mx:2},children:(0,J.jsxs)(E,{children:[(0,J.jsx)(_,{variant:`h5`,gutterBottom:!0,align:`center`,children:`Graph Memory`}),(0,J.jsx)(_,{variant:`body2`,color:`text.secondary`,gutterBottom:!0,align:`center`,children:`Sign in to continue`}),(0,J.jsxs)(`form`,{onSubmit:async n=>{if(n.preventDefault(),!(!t.trim()||!r)){c(!0),o(``);try{let n=await fetch(`/api/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},credentials:`include`,body:JSON.stringify({email:t.trim(),password:r})});n.ok?e():o((await n.json().catch(()=>({error:`Login failed`}))).error||`Login failed`)}catch{o(`Connection failed`)}finally{c(!1)}}},children:[(0,J.jsx)(N,{fullWidth:!0,label:`Email`,type:`email`,value:t,onChange:e=>n(e.target.value),margin:`normal`,autoFocus:!0}),(0,J.jsx)(N,{fullWidth:!0,label:`Password`,type:`password`,value:r,onChange:e=>i(e.target.value),margin:`normal`}),a&&(0,J.jsx)(A,{severity:`error`,sx:{mt:1},children:a}),(0,J.jsx)(M,{fullWidth:!0,variant:`contained`,type:`submit`,disabled:s||!t.trim()||!r,sx:{mt:2},children:s?`Signing in...`:`Sign In`})]})]})})})}function Je({children:e}){let[t,n]=(0,q.useState)(`loading`),r=(0,q.useCallback)(async()=>{try{let e=await Ke();!e.required||e.authenticated?n(`ok`):n(`login`)}catch{n(`login`)}},[]);return(0,q.useEffect)(()=>{r()},[r]),(0,q.useEffect)(()=>{ge(()=>n(`login`))},[]),t===`loading`?(0,J.jsx)(O,{sx:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`100vh`},children:(0,J.jsx)(j,{})}):t===`login`?(0,J.jsx)(qe,{onSuccess:()=>n(`ok`)}):(0,J.jsx)(J.Fragment,{children:e})}function Ye(){let[e,t]=(0,q.useState)([]),[n,r]=(0,q.useState)([]),[i,a]=(0,q.useState)(!0),[o,s]=(0,q.useState)(null);return(0,q.useEffect)(()=>{Promise.all([He(),Ue()]).then(([e,n])=>{t(e),r(n)}).catch(e=>s(e.message)).finally(()=>a(!1))},[]),{projects:e,workspaces:n,loading:i,error:o}}function Xe(){let e=new Set,t=null,n=null,r=!1,i;function a(){if(r||!n)return;let o=`${window.location.protocol===`https:`?`wss`:`ws`}://${window.location.host}/api/ws`;t=new WebSocket(o),t.onopen=()=>{console.log(`[ws] connected to`,o)},t.onmessage=t=>{try{let r=JSON.parse(t.data);if(r.projectId===n)for(let t of e)t(r)}catch{}},t.onerror=()=>{},t.onclose=e=>{console.log(`[ws] closed, code:`,e.code,`reason:`,e.reason),!r&&n&&(i=setTimeout(a,3e3))}}return{subscribe(t){return e.add(t),()=>{e.delete(t)}},connect(e){n===e&&t&&t.readyState<=WebSocket.OPEN||(r=!1,clearTimeout(i),t&&t.readyState<=WebSocket.OPEN&&t.close(),n=e,a())},disconnect(){r=!0,n=null,clearTimeout(i),t&&t.readyState<=WebSocket.OPEN&&t.close()}}}var Y=Xe(),Ze=(0,q.createContext)(Y);function Qe({projectId:e,children:t}){return(0,q.useEffect)(()=>(e&&Y.connect(e),()=>{Y.disconnect()}),[e]),(0,q.createElement)(Ze.Provider,{value:Y},t)}function $e(e,t){let n=(0,q.useContext)(Ze),r=(0,q.useRef)(t);r.current=t,(0,q.useEffect)(()=>{if(e)return n.subscribe(e=>{r.current(e)})},[e,n])}var et=(0,q.createContext)({graphs:{},loading:!0});function tt({graphs:e,loading:t,children:n}){return(0,J.jsx)(et,{value:{graphs:e,loading:t},children:n})}function nt(e){let{graphs:t,loading:n}=(0,q.useContext)(et),r=t[e];return{enabled:r?.enabled??!0,readonly:r?.readonly??!1,access:r?.access??`rw`,loading:n}}function rt(e){let{access:t,readonly:n}=nt(e);return t===`rw`&&!n}function it({value:e}){let{palette:t}=F(),[n,r]=(0,q.useState)(!1),i=(0,q.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[e]);return(0,J.jsxs)(O,{sx:{position:`relative`},children:[(0,J.jsx)(O,{sx:{bgcolor:t.mode===`dark`?`#1a1a1a`:`#f5f5f5`,border:`1px solid ${t.custom.border}`,borderRadius:1,p:1.5,pr:5,fontFamily:`monospace`,fontSize:`0.8125rem`,lineHeight:1.6,whiteSpace:`pre`,overflow:`auto`},children:e}),(0,J.jsx)(P,{size:`small`,onClick:i,sx:{position:`absolute`,top:8,right:8,color:n?`success.main`:t.custom.textMuted},children:n?(0,J.jsx)(V,{fontSize:`small`}):(0,J.jsx)(H,{fontSize:`small`})})]})}function at(e,t){let n={type:`http`,url:e};return t&&(n.headers={Authorization:`Bearer ${t}`}),JSON.stringify({mcpServers:{"graph-memory":n}},null,2)}var ot=[`.mcp.json`,`Claude CLI`,`Cursor`,`Windsurf`],st=[(0,J.jsx)(z,{sx:{fontSize:16}}),(0,J.jsx)(Se,{sx:{fontSize:16}}),(0,J.jsx)(z,{sx:{fontSize:16}}),(0,J.jsx)(z,{sx:{fontSize:16}})],ct={0:{text:`Add to your project’s .mcp.json file (or create one in the project root). Works with Claude Desktop and other MCP-compatible clients.`},1:{text:`Run this command in your terminal to register the MCP server with Claude Code CLI.`},2:{text:`Add to your Cursor MCP configuration file.`,path:`~/.cursor/mcp.json`},3:{text:`Add to your Windsurf MCP configuration file.`,path:`~/.codeium/windsurf/mcp_config.json`}};function lt({open:e,onClose:t,projectId:n}){let{palette:r}=F(),[i,a]=(0,q.useState)(0),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(!1);(0,q.useEffect)(()=>{e&&fetch(`/api/auth/status`,{credentials:`include`}).then(e=>e.json()).then(e=>{l(e.required===!0),e.authenticated&&fetch(`/api/auth/apikey`,{credentials:`include`}).then(e=>e.ok?e.json():null).then(e=>{e?.apiKey&&s(e.apiKey)}).catch(()=>{})}).catch(()=>l(!1))},[e]);let u=`${(0,q.useMemo)(()=>{let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?`:${n}`:``}`},[])}/mcp/${n}`,d=at(u,o),f=o?`claude mcp add --transport http --scope project \\\n --header "Authorization: Bearer ${o}" \\\n graph-memory ${u}`:`claude mcp add --transport http --scope project graph-memory ${u}`,p=ct[i];return(0,J.jsxs)(oe,{open:e,onClose:t,maxWidth:`sm`,fullWidth:!0,PaperProps:{sx:{bgcolor:r.mode===`dark`?`#252526`:void 0,border:r.mode===`dark`?`1px solid #454545`:void 0}},children:[(0,J.jsxs)(w,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,pb:1},children:[(0,J.jsx)(_,{variant:`h6`,fontWeight:700,children:`Connect MCP`}),(0,J.jsx)(P,{size:`small`,onClick:t,sx:{color:r.custom.textMuted},children:(0,J.jsx)(ye,{fontSize:`small`})})]}),(0,J.jsxs)(he,{sx:{pt:0},children:[(0,J.jsxs)(_,{variant:`body2`,sx:{color:r.custom.textMuted,mb:2},children:[`Connect your AI assistant to `,(0,J.jsx)(`strong`,{children:n}),` via MCP (Model Context Protocol).`]}),c&&(0,J.jsx)(N,{label:`API Key`,placeholder:`Enter your API key`,size:`small`,fullWidth:!0,value:o,onChange:e=>s(e.target.value),sx:{mb:2},helperText:o?`API key will be included in the config below.`:`Authentication is enabled. Paste your API key to include it in the config.`}),(0,J.jsx)(ue,{value:i,onChange:(e,t)=>a(t),variant:`scrollable`,scrollButtons:`auto`,sx:{mb:2,minHeight:36,"& .MuiTab-root":{minHeight:36,py:.5}},children:ot.map((e,t)=>(0,J.jsx)(ce,{icon:st[t],iconPosition:`start`,label:e},e))}),(0,J.jsxs)(O,{sx:{display:`flex`,flexDirection:`column`,gap:1.5},children:[(0,J.jsx)(_,{variant:`body2`,sx:{color:r.custom.textMuted},children:p.text}),p.path&&(0,J.jsxs)(_,{variant:`body2`,sx:{color:r.custom.textMuted},children:[`Config path: `,(0,J.jsx)(`code`,{children:p.path})]}),(0,J.jsx)(it,{value:i===1?f:d})]}),(0,J.jsxs)(O,{sx:{mt:3,pt:2,borderTop:`1px solid ${r.custom.border}`},children:[(0,J.jsx)(_,{variant:`caption`,sx:{color:r.custom.textMuted,mb:.5,display:`block`},children:`Endpoint`}),(0,J.jsx)(it,{value:u})]})]})]})}var X=240,ut=64,dt={knowledge:`knowledge`,tasks:`tasks`,skills:`skills`,docs:`docs`,files:`files`},ft=[{label:`Dashboard`,icon:(0,J.jsx)(Ce,{}),path:`dashboard`},{label:`Knowledge`,icon:(0,J.jsx)(W,{}),path:`knowledge`},{label:`Tasks`,icon:(0,J.jsx)(Pe,{}),path:`tasks`},{label:`Skills`,icon:(0,J.jsx)(G,{}),path:`skills`},{label:`Docs`,icon:(0,J.jsx)(U,{}),path:`docs`},{label:`Files`,icon:(0,J.jsx)(K,{}),path:`files`},{label:`Search`,icon:(0,J.jsx)(Me,{}),path:`search`},{label:`Graph`,icon:(0,J.jsx)(Oe,{}),path:`graph`},{label:`Prompts`,icon:(0,J.jsx)(je,{}),path:`prompts`},{label:`Tools`,icon:(0,J.jsx)(De,{}),path:`tools`},{label:`Help`,icon:(0,J.jsx)(Ne,{}),path:`help`}],pt={dashboard:`Dashboard`,knowledge:`Knowledge`,tasks:`Tasks`,skills:`Skills`,docs:`Docs`,files:`Files`,search:`Search`,graph:`Graph`,prompts:`Prompts`,tools:`Tools`,help:`Help`};function mt(e){return pt[e.split(`/`).filter(Boolean)[1]||`dashboard`]||`Dashboard`}function ht(e){let t=e.split(`/`).filter(Boolean),n=[t[0]||``];for(let e=1;e<t.length;e++){let r=t[e];r!==`view`&&n.push(pt[r]||r)}return n.length===1&&n.push(`Dashboard`),n.join(` :: `)}function gt(e,t){let n=[],r=new Set;for(let i of t){let t=e.filter(e=>e.workspaceId===i.id);if(t.length!==0){n.push((0,J.jsx)(se,{sx:{lineHeight:`32px`,fontSize:`0.7rem`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.05em`},children:i.id},`ws-${i.id}`));for(let e of t)n.push((0,J.jsx)(me,{value:e.id,children:e.id},e.id)),r.add(e.id)}}let i=e.filter(e=>!r.has(e.id));i.length>0&&t.length>0&&n.push((0,J.jsx)(se,{sx:{lineHeight:`32px`,fontSize:`0.7rem`,fontWeight:700,textTransform:`uppercase`,letterSpacing:`0.05em`},children:`Standalone`},`ws-standalone`));for(let e of i)n.push((0,J.jsx)(me,{value:e.id,children:e.id},e.id));return n}function _t(){let[e,t]=(0,q.useState)(!1),[n,r]=(0,q.useState)(!1),{projects:i,workspaces:a,loading:o}=Ye(),c=s(),l=h(),{projectId:f}=d(),{mode:p,toggle:m}=Ve(),{palette:g}=F(),v=i.find(e=>e.id===f),x=mt(l.pathname),S=ht(l.pathname);(0,q.useEffect)(()=>{document.title=S},[S]);let C=e=>{c(`/${e}/${l.pathname.split(`/`).slice(2).join(`/`)||`dashboard`}`)},w=(0,J.jsxs)(O,{sx:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,J.jsxs)(fe,{children:[(0,J.jsx)(Oe,{sx:{mr:1,color:`primary.main`}}),(0,J.jsx)(_,{variant:`subtitle1`,fontWeight:700,noWrap:!0,children:`Graph Memory`})]}),(0,J.jsx)(ne,{}),(0,J.jsx)(O,{sx:{px:2,py:1.5},children:(0,J.jsx)(pe,{fullWidth:!0,size:`small`,value:!o&&i.some(e=>e.id===f)?f:``,onChange:e=>C(e.target.value),disabled:o,displayEmpty:!0,renderValue:e=>(0,J.jsx)(_,{variant:`body2`,fontWeight:600,noWrap:!0,children:e||`Select project`}),children:gt(i,a)})}),(0,J.jsx)(ne,{}),(0,J.jsx)(y,{sx:{flex:1,px:1},children:ft.filter(({path:e})=>{let t=dt[e];return!t||!v?.graphs?!0:v.graphs[t]?.enabled!==!1}).map(({label:e,icon:t,path:n})=>{let r=(l.pathname.split(`/`).filter(Boolean)[1]||``)===n;return(0,J.jsxs)(b,{selected:r,onClick:()=>c(`/${f}/${n}`),disabled:!f,sx:{borderRadius:1,mb:.5,...r&&{bgcolor:`primary.main`,color:g.custom.textOnPrimary,"&:hover":{bgcolor:`primary.dark`},"&.Mui-selected":{bgcolor:`primary.main`,color:g.custom.textOnPrimary,"&:hover":{bgcolor:`primary.dark`}}}},children:[(0,J.jsx)(ee,{sx:{minWidth:40,color:r?g.custom.textOnPrimary:`inherit`},children:t}),(0,J.jsx)(T,{primary:e})]},n)})})]});return(0,J.jsxs)(O,{sx:{display:`flex`,height:`100vh`},children:[(0,J.jsx)(ie,{position:`fixed`,sx:{width:{md:`calc(100% - ${X}px)`},ml:{md:`${X}px`},color:`text.primary`},children:(0,J.jsxs)(fe,{children:[(0,J.jsx)(P,{edge:`start`,color:`inherit`,onClick:()=>t(!e),sx:{display:{md:`none`},mr:1},children:(0,J.jsx)(Ee,{})}),(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`center`,gap:1,flexGrow:1},children:[(0,J.jsx)(_,{variant:`h6`,noWrap:!0,children:x}),v?.workspaceId&&(0,J.jsx)(D,{label:v.workspaceId,size:`small`,variant:`outlined`,color:`primary`,sx:{fontWeight:600}})]}),(0,J.jsx)(M,{variant:`outlined`,size:`small`,color:`primary`,startIcon:(0,J.jsx)(_e,{}),onClick:()=>r(!0),disabled:!f,sx:{textTransform:`none`},children:`Connect`}),(0,J.jsx)(P,{color:`inherit`,onClick:m,title:`Switch to ${p===`dark`?`light`:`dark`} mode`,children:p===`dark`?(0,J.jsx)(Te,{}):(0,J.jsx)(ke,{})}),(0,J.jsx)(P,{color:`inherit`,title:`Sign out`,onClick:async()=>{await fetch(`/api/auth/logout`,{method:`POST`,credentials:`include`}),window.location.reload()},children:(0,J.jsx)(we,{})})]})}),(0,J.jsxs)(O,{component:`nav`,sx:{width:{md:X},flexShrink:{md:0}},children:[(0,J.jsx)(te,{variant:`temporary`,open:e,onClose:()=>t(!1),sx:{display:{xs:`block`,md:`none`},"& .MuiDrawer-paper":{width:X}},children:w}),(0,J.jsx)(te,{variant:`permanent`,sx:{display:{xs:`none`,md:`block`},"& .MuiDrawer-paper":{width:X}},open:!0,children:w})]}),(0,J.jsx)(O,{component:`main`,sx:{flexGrow:1,width:{md:`calc(100% - ${X}px)`},height:`100vh`,overflow:`auto`,p:3,pt:`${ut+24}px`},children:(0,J.jsx)(tt,{graphs:v?.graphs??{},loading:o,children:(0,J.jsx)(Qe,{projectId:f??null,children:(0,J.jsx)(u,{})})})}),f&&(0,J.jsx)(lt,{open:n,onClose:()=>r(!1),projectId:f})]})}function vt(){let[e,t]=(0,q.useState)(null),[n,r]=(0,q.useState)(null);return(0,q.useEffect)(()=>{He().then(e=>{e.length>0?t(e[0].id):r(`No projects configured. Add a project to graph-memory.yaml and restart the server.`)}).catch(e=>r(e instanceof Error?e.message:String(e)))},[]),n?(0,J.jsx)(O,{sx:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,J.jsx)(_,{color:`error`,children:n})}):e?(0,J.jsx)(m,{to:`/${e}/dashboard`,replace:!0}):(0,J.jsx)(O,{sx:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,J.jsx)(j,{})})}function yt(e,t){return R(`/projects/${e}/knowledge/notes${L({tag:t?.tag,limit:t?.limit})}`).then(I)}function bt(e,t){return R(`/projects/${e}/knowledge/notes/${t}`)}function xt(e,t){return R(`/projects/${e}/knowledge/notes`,{method:`POST`,body:JSON.stringify(t)})}function St(e,t,n){return R(`/projects/${e}/knowledge/notes/${t}`,{method:`PUT`,body:JSON.stringify(n)})}function Ct(e,t){return R(`/projects/${e}/knowledge/notes/${t}`,{method:`DELETE`})}function wt(e,t,n){return R(`/projects/${e}/knowledge/search${L({q:t,topK:n?.topK,minScore:n?.minScore})}`).then(I)}function Tt(e,t){return R(`/projects/${e}/knowledge/notes/${t}/relations`).then(I)}function Et(e,t){return R(`/projects/${e}/knowledge/relations`,{method:`POST`,body:JSON.stringify(t)})}function Dt(e,t){return R(`/projects/${e}/knowledge/relations`,{method:`DELETE`,body:JSON.stringify(t)})}function Ot(e,t,n){return R(`/projects/${e}/knowledge/linked${L({targetGraph:t,targetNodeId:n})}`).then(I)}function kt(e,t){return R(`/projects/${e}/knowledge/notes/${t}/attachments`).then(I)}async function At(e,t,n){let r=new FormData;r.append(`file`,n);let i=await fetch(`/api/projects/${e}/knowledge/notes/${t}/attachments`,{method:`POST`,credentials:`include`,body:r});if(!i.ok){let e=await i.json().catch(()=>({error:i.statusText}));throw Error(e.error||i.statusText)}return i.json()}function jt(e,t,n){return R(`/projects/${e}/knowledge/notes/${t}/attachments/${encodeURIComponent(n)}`,{method:`DELETE`})}function Mt(e,t,n){return`/api/projects/${e}/knowledge/notes/${t}/attachments/${encodeURIComponent(n)}`}function Z({title:e,action:t,children:n,sx:r}){let{palette:i}=F();return(0,J.jsxs)(O,{sx:{borderRadius:1,overflow:`hidden`,border:`1px solid ${i.custom.border}`,display:`flex`,flexDirection:`column`,...r},children:[(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,px:2,py:1.5,bgcolor:i.custom.surfaceMuted,flexShrink:0},children:[(0,J.jsx)(_,{variant:`subtitle2`,sx:{textTransform:`uppercase`,letterSpacing:.5},children:e}),t]}),(0,J.jsx)(O,{sx:{p:2,bgcolor:i.custom.surface,flex:1},children:n})]})}function Q({label:e,color:t,icon:n,size:r=`small`}){let{palette:i}=F(),a={success:i.success.main,error:i.error.main,warning:i.warning.main,neutral:i.custom.neutral,primary:i.primary.main}[t]??i.custom.neutral;return(0,J.jsx)(D,{label:e,icon:n,size:r,sx:{bgcolor:`${a}26`,color:a,border:`none`,borderRadius:`999px`,fontWeight:600,"& .MuiChip-icon":{color:a}}})}function Nt({tags:e,onAdd:t,onRemove:n,editable:r=!1}){let{palette:i}=F(),[a,o]=(0,q.useState)(``);return(0,J.jsxs)(O,{sx:{display:`flex`,flexWrap:`wrap`,gap:.5,alignItems:`center`},children:[e.map(e=>(0,J.jsx)(D,{label:e,size:`small`,onDelete:r?()=>n?.(e):void 0,sx:{bgcolor:i.custom.surfaceMuted,border:`1px solid ${i.custom.border}`,color:i.custom.textMuted}},e)),r&&(0,J.jsx)(N,{size:`small`,placeholder:`Add tag…`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&a.trim()&&(e.preventDefault(),t?.(a.trim()),o(``))},sx:{width:100,"& .MuiInputBase-input":{py:.5,fontSize:`0.8125rem`}}})]})}function Pt({value:e,size:t=`small`}){let{palette:n}=F(),[r,i]=(0,q.useState)(!1);return(0,J.jsx)(P,{size:t,onClick:(0,q.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})},[e]),sx:{color:n.custom.textMuted},children:r?(0,J.jsx)(V,{fontSize:`small`}):(0,J.jsx)(H,{fontSize:`small`})})}var Ft=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],It=720*60*60*1e3;function Lt(e,t){let n=String(e.getDate()).padStart(2,`0`),r=Ft[e.getMonth()],i=e.getFullYear();return t?`${n} ${r} ${i}, ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`:`${n} ${r} ${i}`}function Rt(e){let t=Date.now()-e.getTime();if(t<0||t>It)return null;let n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function zt({value:e,showTime:t=!1,showRelative:n=!0}){let{palette:r}=F(),i=e instanceof Date?e:new Date(e);if(isNaN(i.getTime()))return null;let a=Lt(i,t),o=n?Rt(i):null;return(0,J.jsxs)(_,{component:`span`,variant:`body2`,children:[a,o&&(0,J.jsxs)(_,{component:`span`,variant:`body2`,sx:{color:r.custom.textMuted,ml:.5},children:[`· `,o]})]})}function Bt({breadcrumbs:e,actions:t}){let n=e.length<=1;return n&&!t?null:(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`center`,justifyContent:n?`flex-end`:`space-between`,mb:n?1.5:3},children:[!n&&(0,J.jsx)(S,{separator:(0,J.jsx)(be,{fontSize:`small`}),children:e.map((t,n)=>t.to&&n<e.length-1?(0,J.jsx)(f,{to:t.to,style:{textDecoration:`none`,color:`inherit`},children:(0,J.jsx)(_,{variant:`body1`,color:`text.secondary`,children:t.label})},n):(0,J.jsx)(_,{variant:`body1`,fontWeight:600,children:t.label},n))}),t&&(0,J.jsx)(O,{sx:{display:`flex`,gap:1},children:t})]})}function Vt({children:e,actions:t}){let{palette:n}=F();return(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`center`,gap:1.5,px:2,py:1,bgcolor:n.custom.surfaceMuted,borderRadius:1,mb:2},children:[(0,J.jsx)(O,{sx:{display:`flex`,gap:1.5,flex:1,alignItems:`center`},children:e}),t&&(0,J.jsx)(O,{sx:{display:`flex`,gap:1},children:t})]})}function Ht({label:e,children:t,divider:n=!0}){let{palette:r}=F();return(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`flex-start`,py:1.25,borderBottom:n?`1px solid ${r.custom.border}`:`none`},children:[(0,J.jsx)(_,{variant:`body2`,sx:{width:200,flexShrink:0,color:r.custom.textMuted,pt:.25},children:e}),(0,J.jsx)(O,{sx:{flex:1,minWidth:0},children:t})]})}function Ut({children:e}){return(0,J.jsx)(O,{sx:{display:`grid`,gridTemplateColumns:{xs:`1fr`,md:`1fr 1fr`},gap:2},children:e})}function Wt({children:e,fullWidth:t=!1}){return(0,J.jsx)(O,{sx:t?{gridColumn:`1 / -1`}:void 0,children:e})}function Gt({children:e,required:t,sx:n}){return(0,J.jsxs)(_,{variant:`caption`,sx:{display:`block`,mb:.75,fontWeight:600,textTransform:`uppercase`,letterSpacing:`0.05em`,color:`text.secondary`,...n},children:[e,t&&` *`]})}function Kt({title:e,description:t,action:n,icon:r}){let{palette:i}=F();return(0,J.jsxs)(O,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,py:6,px:2},children:[r&&(0,J.jsx)(O,{sx:{mb:2,color:i.custom.textMuted,"& .MuiSvgIcon-root":{fontSize:48}},children:r}),(0,J.jsx)(_,{variant:`h6`,gutterBottom:!0,children:e}),t&&(0,J.jsx)(_,{variant:`body2`,sx:{color:i.custom.textMuted,mb:2,textAlign:`center`},children:t}),n]})}function qt({open:e,title:t,message:n,confirmLabel:r=`Confirm`,confirmColor:i=`primary`,onConfirm:a,onCancel:o,loading:s=!1}){return(0,J.jsxs)(oe,{open:e,onClose:o,maxWidth:`xs`,fullWidth:!0,children:[(0,J.jsx)(w,{children:t}),(0,J.jsx)(he,{children:(0,J.jsx)(ae,{children:n})}),(0,J.jsxs)(v,{children:[(0,J.jsx)(M,{onClick:o,disabled:s,children:`Cancel`}),(0,J.jsx)(M,{onClick:a,color:i,variant:`contained`,disabled:s,children:r})]})]})}function Jt({children:e}){let{palette:t}=F();return(0,J.jsx)(n,{remarkPlugins:[r],components:{h1:({children:e})=>(0,J.jsx)(_,{variant:`h5`,fontWeight:700,gutterBottom:!0,sx:{mt:3,mb:1.5},children:e}),h2:({children:e})=>(0,J.jsx)(_,{variant:`h6`,fontWeight:700,gutterBottom:!0,sx:{mt:3,mb:1},children:e}),h3:({children:e})=>(0,J.jsx)(_,{variant:`subtitle1`,fontWeight:700,gutterBottom:!0,sx:{mt:2,mb:.5},children:e}),p:({children:e})=>(0,J.jsx)(_,{variant:`body2`,sx:{mb:1.5,lineHeight:1.7},children:e}),a:({href:e,children:t})=>(0,J.jsx)(re,{href:e,underline:`hover`,color:`primary`,children:t}),ul:({children:e})=>(0,J.jsx)(O,{component:`ul`,sx:{pl:3,mb:1.5,"& li":{mb:.5}},children:e}),ol:({children:e})=>(0,J.jsx)(O,{component:`ol`,sx:{pl:3,mb:1.5,"& li":{mb:.5}},children:e}),li:({children:e})=>(0,J.jsx)(_,{component:`li`,variant:`body2`,sx:{lineHeight:1.7},children:e}),code:({className:e,children:n})=>e?.startsWith(`language-`)?(0,J.jsx)(O,{component:`pre`,sx:{p:2,mb:1.5,bgcolor:t.custom.surfaceMuted,borderRadius:1,border:`1px solid ${t.custom.border}`,overflow:`auto`,fontFamily:`monospace`,fontSize:`0.8125rem`,lineHeight:1.6,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:(0,J.jsx)(`code`,{children:n})}):(0,J.jsx)(O,{component:`code`,sx:{px:.6,py:.15,bgcolor:t.custom.surfaceMuted,borderRadius:.5,fontFamily:`monospace`,fontSize:`0.8125rem`},children:n}),pre:({children:e})=>(0,J.jsx)(J.Fragment,{children:e}),blockquote:({children:e})=>(0,J.jsx)(O,{sx:{pl:2,ml:0,borderLeft:`3px solid ${t.primary.main}`,color:t.custom.textMuted,mb:1.5},children:e}),table:({children:e})=>(0,J.jsx)(O,{component:`table`,sx:{width:`100%`,mb:1.5,borderCollapse:`collapse`,"& th, & td":{border:`1px solid ${t.custom.border}`,px:1.5,py:.75,fontSize:`0.8125rem`,textAlign:`left`},"& th":{bgcolor:t.custom.surfaceMuted,fontWeight:600}},children:e}),hr:()=>(0,J.jsx)(O,{component:`hr`,sx:{border:`none`,borderTop:`1px solid ${t.custom.border}`,my:2}})},children:e})}var Yt=(0,q.lazy)(()=>c(()=>import(`./esm-CqydI1a6.js`),__vite__mapDeps([0,1,2,3,4])));function Xt({value:e,onChange:t,height:n=300}){let{palette:r}=F(),a=r.mode;return(0,J.jsx)(`div`,{"data-color-mode":a,children:(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(O,{sx:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:n},children:(0,J.jsx)(j,{size:24})}),children:(0,J.jsx)(Yt,{value:e,onChange:e=>t(e??``),height:n,preview:`edit`,visibleDragbar:!1,previewOptions:{rehypePlugins:[[i]]}})})})}function Zt({note:e,score:t,onClick:n,onEdit:r}){let{palette:i}=F();return(0,J.jsx)(C,{variant:`outlined`,sx:{cursor:n?`pointer`:`default`,"&:hover":n?{borderColor:`primary.main`}:{}},onClick:n,children:(0,J.jsx)(E,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`flex-start`,gap:1},children:[(0,J.jsxs)(O,{sx:{flex:1,minWidth:0},children:[(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:.25},children:[(0,J.jsx)(_,{variant:`subtitle1`,fontWeight:600,noWrap:!0,sx:{flex:1},children:e.title}),t!==void 0&&(0,J.jsx)(Q,{label:`${(t*100).toFixed(0)}%`,color:`primary`,size:`small`})]}),e.content&&(0,J.jsx)(_,{variant:`body2`,sx:{color:i.custom.textMuted,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:e.content.replace(/^#+\s*/gm,``).replace(/[*_`]/g,``).trim()}),e.tags?.length>0&&(0,J.jsx)(O,{sx:{mt:.5},children:(0,J.jsx)(Nt,{tags:e.tags})})]}),r&&(0,J.jsx)(le,{title:`Edit`,children:(0,J.jsx)(P,{size:`small`,onClick:e=>{e.stopPropagation(),r()},children:(0,J.jsx)(xe,{fontSize:`small`})})})]})})})}function Qt(e,t){return R(`/projects/${e}/tasks${L({status:t?.status,priority:t?.priority,tag:t?.tag,assignee:t?.assignee,limit:t?.limit})}`).then(I)}function $t(e,t){return R(`/projects/${e}/tasks/${t}`)}function en(e,t){return R(`/projects/${e}/tasks`,{method:`POST`,body:JSON.stringify(t)})}function tn(e,t,n){return R(`/projects/${e}/tasks/${t}`,{method:`PUT`,body:JSON.stringify(n)})}function nn(e,t,n){return R(`/projects/${e}/tasks/${t}/move`,{method:`POST`,body:JSON.stringify({status:n})})}function rn(e,t){return R(`/projects/${e}/tasks/${t}`,{method:`DELETE`})}function an(e,t,n){return R(`/projects/${e}/tasks/search${L({q:t,topK:n?.topK,minScore:n?.minScore})}`).then(I)}function on(e,t){return R(`/projects/${e}/tasks/${t}/relations`).then(I)}function sn(e,t){return R(`/projects/${e}/tasks/links`,{method:`POST`,body:JSON.stringify(t)})}function cn(e,t){return R(`/projects/${e}/tasks/links`,{method:`DELETE`,body:JSON.stringify(t)})}function ln(e,t,n){return R(`/projects/${e}/tasks/linked${L({targetGraph:t,targetNodeId:n})}`).then(I)}function un(e,t){return R(`/projects/${e}/tasks/${t}/attachments`).then(I)}async function dn(e,t,n){let r=new FormData;r.append(`file`,n);let i=await fetch(`/api/projects/${e}/tasks/${t}/attachments`,{method:`POST`,credentials:`include`,body:r});if(!i.ok){let e=await i.json().catch(()=>({error:i.statusText}));throw Error(e.error||i.statusText)}return i.json()}function fn(e,t,n){return R(`/projects/${e}/tasks/${t}/attachments/${encodeURIComponent(n)}`,{method:`DELETE`})}function pn(e,t,n){return`/api/projects/${e}/tasks/${t}/attachments/${encodeURIComponent(n)}`}var mn=[{status:`backlog`,label:`Backlog`,color:`#616161`},{status:`todo`,label:`To Do`,color:`#1976d2`},{status:`in_progress`,label:`In Progress`,color:`#f57c00`},{status:`review`,label:`Review`,color:`#7b1fa2`},{status:`done`,label:`Done`,color:`#388e3c`},{status:`cancelled`,label:`Cancelled`,color:`#d32f2f`}],hn={backlog:`neutral`,todo:`primary`,in_progress:`warning`,review:`primary`,done:`success`,cancelled:`error`},gn={critical:`error`,high:`warning`,medium:`primary`,low:`neutral`};function _n(e){return mn.find(t=>t.status===e)?.label??e}function vn(e){return e.charAt(0).toUpperCase()+e.slice(1)}function yn(){let{projectId:e}=d(),t=s(),{palette:n}=F(),[r,i]=(0,q.useState)(null),[a,o]=(0,q.useState)([]),[c,l]=(0,q.useState)([]),[u,f]=(0,q.useState)(!0),[p,m]=(0,q.useState)(null),h=(0,q.useCallback)(async()=>{if(e)try{let[t,n,r]=await Promise.all([We(e),yt(e,{limit:5}).catch(()=>[]),Qt(e,{limit:10}).catch(()=>[])]);i(t),o(n),l(r),m(null)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}},[e]);if((0,q.useEffect)(()=>{h()},[h]),$e(e??null,(0,q.useCallback)(()=>{h()},[h])),u)return(0,J.jsx)(O,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,J.jsx)(j,{})});if(p)return(0,J.jsx)(A,{severity:`error`,children:p});let g=[{label:`Notes`,value:r?.knowledge?.nodes??0,icon:(0,J.jsx)(W,{}),path:`knowledge`,color:n.warning.main},{label:`Tasks`,value:r?.tasks?.nodes??0,icon:(0,J.jsx)(Pe,{}),path:`tasks`,color:n.primary.main},{label:`Skills`,value:r?.skills?.nodes??0,icon:(0,J.jsx)(G,{}),path:`skills`,color:`#9c27b0`},{label:`Docs`,value:r?.docs?.nodes??0,icon:(0,J.jsx)(U,{}),path:`docs`,color:n.secondary.main},{label:`Code Symbols`,value:r?.code?.nodes??0,icon:(0,J.jsx)(Ae,{}),path:`search`,color:n.error.main},{label:`Files`,value:r?.fileIndex?.nodes??0,icon:(0,J.jsx)(K,{}),path:`files`,color:n.success.main}];return(0,J.jsxs)(O,{children:[(0,J.jsx)(Bt,{breadcrumbs:[{label:`Dashboard`}]}),(0,J.jsx)(O,{sx:{display:`grid`,gridTemplateColumns:{xs:`1fr 1fr`,md:`repeat(6, 1fr)`},gap:2,mb:3},children:g.map(r=>(0,J.jsx)(C,{variant:`outlined`,sx:{cursor:`pointer`,"&:hover":{borderColor:`primary.main`}},onClick:()=>t(`/${e}/${r.path}`),children:(0,J.jsxs)(E,{sx:{py:2,px:2,"&:last-child":{pb:2}},children:[(0,J.jsxs)(O,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:1},children:[(0,J.jsx)(O,{sx:{color:r.color},children:r.icon}),(0,J.jsx)(_,{variant:`caption`,sx:{color:n.custom.textMuted,textTransform:`uppercase`,letterSpacing:.5},children:r.label})]}),(0,J.jsx)(_,{variant:`h4`,fontWeight:700,children:r.value})]})},r.label))}),(0,J.jsxs)(O,{sx:{display:`grid`,gridTemplateColumns:{xs:`1fr`,md:`1fr 1fr`},gap:3},children:[(0,J.jsxs)(Z,{title:`Recent Notes`,action:(0,J.jsx)(M,{size:`small`,endIcon:(0,J.jsx)(ve,{}),onClick:()=>t(`/${e}/knowledge`),children:`View all`}),children:[a.length===0?(0,J.jsx)(_,{variant:`body2`,sx:{color:n.custom.textMuted},children:`No notes yet`}):(0,J.jsx)(y,{dense:!0,disablePadding:!0,children:a.map(r=>(0,J.jsxs)(b,{onClick:()=>t(`/${e}/knowledge/${r.id}`),sx:{borderRadius:1,py:.5},children:[(0,J.jsx)(ee,{sx:{minWidth:32},children:(0,J.jsx)(W,{fontSize:`small`,sx:{color:n.warning.main}})}),(0,J.jsx)(T,{primary:(0,J.jsx)(_,{variant:`body2`,fontWeight:500,children:r.title}),secondary:r.content?r.content.slice(0,60)+(r.content.length>60?`...`:``):void 0})]},r.id))}),(0,J.jsx)(O,{sx:{mt:1.5},children:(0,J.jsx)(M,{size:`small`,startIcon:(0,J.jsx)(B,{}),onClick:()=>t(`/${e}/knowledge/new`),children:`New Note`})})]}),(0,J.jsxs)(Z,{title:`Recent Tasks`,action:(0,J.jsx)(M,{size:`small`,endIcon:(0,J.jsx)(ve,{}),onClick:()=>t(`/${e}/tasks`),children:`View all`}),children:[c.length===0?(0,J.jsx)(_,{variant:`body2`,sx:{color:n.custom.textMuted},children:`No tasks yet`}):(0,J.jsx)(y,{dense:!0,disablePadding:!0,children:c.map(n=>(0,J.jsxs)(b,{onClick:()=>t(`/${e}/tasks/${n.id}`),sx:{borderRadius:1,py:.75,px:1.5},children:[(0,J.jsx)(T,{primary:(0,J.jsx)(_,{variant:`body2`,fontWeight:500,noWrap:!0,children:n.title}),sx:{mr:2}}),(0,J.jsx)(Q,{label:_n(n.status),color:hn[n.status],size:`small`})]},n.id))}),(0,J.jsx)(O,{sx:{mt:1.5},children:(0,J.jsx)(M,{size:`small`,startIcon:(0,J.jsx)(B,{}),onClick:()=>t(`/${e}/tasks/new`),children:`New Task`})})]})]})]})}var bn=(0,q.lazy)(()=>c(()=>import(`./knowledge-g4C4l6uL.js`),__vite__mapDeps([5,2,6,7,1,3,4,8,9]))),xn=(0,q.lazy)(()=>c(()=>import(`./_noteId_-Cqxl6H5q.js`),__vite__mapDeps([10,2,6,7,1,3,4,8,11,12,13,14,15,16]))),Sn=(0,q.lazy)(()=>c(()=>import(`./new-DC3lRvxF.js`),__vite__mapDeps([17,6,2,7,1,3,4,9]))),Cn=(0,q.lazy)(()=>c(()=>import(`./edit-Bflx3-cK.js`),__vite__mapDeps([18,2,6,7,1,3,4,9]))),wn=(0,q.lazy)(()=>c(()=>import(`./tasks-CgsSFz6X.js`),__vite__mapDeps([19,2,6,7,1,3,4,8]))),Tn=(0,q.lazy)(()=>c(()=>import(`./_taskId_-Cs8LaIe4.js`),__vite__mapDeps([20,2,6,7,1,3,4,8,11,12,13,14,15,16]))),En=(0,q.lazy)(()=>c(()=>import(`./new-DbsKrGJ4.js`),__vite__mapDeps([21,6,2,7,1,3,4,22]))),Dn=(0,q.lazy)(()=>c(()=>import(`./edit-7NV817UE.js`),__vite__mapDeps([23,2,6,7,1,3,4,22]))),On=(0,q.lazy)(()=>c(()=>import(`./skills-DRjYPbZM.js`),__vite__mapDeps([24,2,6,7,1,3,4,8,11,12,25]))),kn=(0,q.lazy)(()=>c(()=>import(`./_skillId_-BlJOfwm_.js`),__vite__mapDeps([26,2,6,7,1,3,4,8,11,12,13,14,15,16]))),An=(0,q.lazy)(()=>c(()=>import(`./new-Bqup97cu.js`),__vite__mapDeps([27,6,2,7,1,3,4,11,8,12,25]))),jn=(0,q.lazy)(()=>c(()=>import(`./edit-CdmIaFUI.js`),__vite__mapDeps([28,2,6,7,1,3,4,11,8,12,25]))),Mn=(0,q.lazy)(()=>c(()=>import(`./docs-BuFjplSR.js`),__vite__mapDeps([29,2,6,7,1,3,4,8,15,12]))),Nn=(0,q.lazy)(()=>c(()=>import(`./_docId_-wAt8n8p4.js`),__vite__mapDeps([30,2,6,7,1,3,4,15,12]))),Pn=(0,q.lazy)(()=>c(()=>import(`./files-BWNbyH1X.js`),__vite__mapDeps([31,2,6,7,1,3,4,8,16,12]))),Fn=(0,q.lazy)(()=>c(()=>import(`./_filePath_-DQMFMLQh.js`),__vite__mapDeps([32,2,6,7,1,3,4,16,12]))),In=(0,q.lazy)(()=>c(()=>import(`./search-DtRoWsqW.js`),__vite__mapDeps([33,2,6,7,1,3,4,8,14,12,15,16,11]))),Ln=(0,q.lazy)(()=>c(()=>import(`./graph-B9nFxoXm.js`),__vite__mapDeps([34,2,6,7,1,3,4,8,35,12]))),Rn=(0,q.lazy)(()=>c(()=>import(`./tools-BDszA6Kh.js`),__vite__mapDeps([36,2,6,7,1,3,4,8,37,12]))),zn=(0,q.lazy)(()=>c(()=>import(`./_toolName_-3CHUDagf.js`),__vite__mapDeps([38,2,6,7,1,3,4,8,39,37,12]))),$=(0,q.lazy)(()=>c(()=>import(`./prompts-DyltFLqJ.js`),__vite__mapDeps([40,2,6,7,1,3,4,8,11,12]))),Bn=(0,q.lazy)(()=>c(()=>import(`./help-CqK0hEmf.js`),__vite__mapDeps([41,2,6,7,1,3,4,8,39]))),Vn=(0,q.lazy)(()=>c(()=>import(`./_articleId_-mEqH7YfV.js`),__vite__mapDeps([42,6,2,7,1,3,4,8,39])));function Hn(){return(0,J.jsx)(O,{sx:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`50vh`},children:(0,J.jsx)(j,{size:32})})}function Un(){return(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(Hn,{}),children:(0,J.jsxs)(p,{children:[(0,J.jsxs)(o,{path:`/:projectId`,element:(0,J.jsx)(_t,{}),children:[(0,J.jsx)(o,{index:!0,element:(0,J.jsx)(m,{to:`dashboard`,replace:!0})}),(0,J.jsx)(o,{path:`dashboard`,element:(0,J.jsx)(yn,{})}),(0,J.jsx)(o,{path:`knowledge`,element:(0,J.jsx)(bn,{})}),(0,J.jsx)(o,{path:`knowledge/new`,element:(0,J.jsx)(Sn,{})}),(0,J.jsx)(o,{path:`knowledge/:noteId/edit`,element:(0,J.jsx)(Cn,{})}),(0,J.jsx)(o,{path:`knowledge/:noteId`,element:(0,J.jsx)(xn,{})}),(0,J.jsx)(o,{path:`tasks`,element:(0,J.jsx)(wn,{})}),(0,J.jsx)(o,{path:`tasks/new`,element:(0,J.jsx)(En,{})}),(0,J.jsx)(o,{path:`tasks/:taskId/edit`,element:(0,J.jsx)(Dn,{})}),(0,J.jsx)(o,{path:`tasks/:taskId`,element:(0,J.jsx)(Tn,{})}),(0,J.jsx)(o,{path:`skills`,element:(0,J.jsx)(On,{})}),(0,J.jsx)(o,{path:`skills/new`,element:(0,J.jsx)(An,{})}),(0,J.jsx)(o,{path:`skills/:skillId/edit`,element:(0,J.jsx)(jn,{})}),(0,J.jsx)(o,{path:`skills/:skillId`,element:(0,J.jsx)(kn,{})}),(0,J.jsx)(o,{path:`docs`,element:(0,J.jsx)(Mn,{})}),(0,J.jsx)(o,{path:`docs/:docId`,element:(0,J.jsx)(Nn,{})}),(0,J.jsx)(o,{path:`files`,element:(0,J.jsx)(Pn,{})}),(0,J.jsx)(o,{path:`files/view/*`,element:(0,J.jsx)(Fn,{})}),(0,J.jsx)(o,{path:`search`,element:(0,J.jsx)(In,{})}),(0,J.jsx)(o,{path:`graph`,element:(0,J.jsx)(Ln,{})}),(0,J.jsx)(o,{path:`prompts/simple`,element:(0,J.jsx)($,{})}),(0,J.jsx)(o,{path:`prompts/advanced`,element:(0,J.jsx)($,{})}),(0,J.jsx)(o,{path:`prompts`,element:(0,J.jsx)($,{})}),(0,J.jsx)(o,{path:`tools`,element:(0,J.jsx)(Rn,{})}),(0,J.jsx)(o,{path:`tools/:toolName`,element:(0,J.jsx)(zn,{})}),(0,J.jsx)(o,{path:`help`,element:(0,J.jsx)(Bn,{})}),(0,J.jsx)(o,{path:`help/:articleId`,element:(0,J.jsx)(Vn,{})})]}),(0,J.jsx)(o,{path:`*`,element:(0,J.jsx)(vt,{})})]})})}(0,Fe.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(q.StrictMode,{children:(0,J.jsx)(g,{basename:`/ui`,children:(0,J.jsx)(Be,{children:(0,J.jsx)(Je,{children:(0,J.jsx)(Un,{})})})})}));export{We as $,Vt as A,jt as B,Jt as C,Wt as D,Gt as E,Q as F,yt as G,Ot as H,Z as I,wt as J,Tt as K,xt as L,zt as M,Pt as N,Ut as O,Nt as P,$e as Q,Et as R,Xt as S,Kt as T,bt as U,Dt as V,kt as W,At as X,St as Y,rt as Z,an as _,_n as a,dn as b,rn as c,ln as d,Ge as et,$t as f,nn as g,Qt as h,vn as i,Bt as j,Ht as k,fn as l,on as m,gn as n,en as o,un as p,Mt as q,hn as r,sn as s,mn as t,cn as u,pn as v,qt as w,Zt as x,tn as y,Ct as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i,u as a}from"./vendor-react-DxfYAwYK.js";import{A as o,Y as s,et as c,m as l,nt as u,q as d,r as f,tt as p}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{K as m,Q as h,k as g,st as _}from"./vendor-mui-icons-YtgP6dg2.js";import{A as v,G as y,J as b,L as x,Q as S,T as C,Y as w,Z as T,j as E,x as D,z as O}from"./index-80sqSHwS.js";import"./NoteForm-D0lOYBQq.js";var k=e(n(),1);function A(e){let[t,n]=(0,k.useState)([]),[r,i]=(0,k.useState)(!1),[a,o]=(0,k.useState)(null),s=(0,k.useCallback)(async()=>{if(e){i(!0),o(null);try{n(await y(e))}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}},[e]);return(0,k.useEffect)(()=>{s()},[s]),{notes:t,loading:r,error:a,refresh:s,create:(0,k.useCallback)(async t=>{if(!e)return;let r=await x(e,t);return n(e=>[...e,r]),r},[e]),update:(0,k.useCallback)(async(t,r)=>{if(!e)return;let i=await w(e,t,r);return n(e=>e.map(e=>e.id===t?i:e)),i},[e]),remove:(0,k.useCallback)(async t=>{e&&(await O(e,t),n(e=>e.filter(e=>e.id!==t)))},[e])}}var j=t();function M(){let{projectId:e}=i(),t=r(),[n,y]=a(),x=T(`knowledge`),{notes:w,loading:O,error:M,refresh:N}=A(e??null),[P,F]=(0,k.useState)(n.get(`q`)||``),[I,L]=(0,k.useState)(null),[R,z]=(0,k.useState)(!1);S(e??null,(0,k.useCallback)(e=>{e.type.startsWith(`note:`)&&N()},[N]));let B=(0,k.useCallback)(async t=>{if(!e||!t.trim()){L(null);return}z(!0);try{L(await b(e,t.trim()))}catch{}finally{z(!1)}},[e]);(0,k.useEffect)(()=>{let e=n.get(`q`);e?.trim()&&B(e)},[]);let V=()=>{let e=new URLSearchParams(n);P.trim()?e.set(`q`,P.trim()):e.delete(`q`),y(e,{replace:!0}),B(P)},H=()=>{F(``),L(null);let e=new URLSearchParams(n);e.delete(`q`),y(e,{replace:!0})},U=I??w;return(0,j.jsxs)(s,{children:[(0,j.jsx)(E,{breadcrumbs:[{label:`Knowledge`}],actions:x?(0,j.jsx)(d,{variant:`contained`,startIcon:(0,j.jsx)(m,{}),onClick:()=>t(`new`),children:`New Note`}):void 0}),(0,j.jsx)(v,{children:(0,j.jsx)(f,{fullWidth:!0,size:`small`,placeholder:`Semantic search notes...`,value:P,onChange:e=>F(e.target.value),onKeyDown:e=>e.key===`Enter`&&V(),slotProps:{input:{startAdornment:(0,j.jsx)(o,{position:`start`,children:(0,j.jsx)(_,{})}),endAdornment:P&&(0,j.jsx)(o,{position:`end`,children:(0,j.jsx)(p,{size:`small`,onClick:H,children:(0,j.jsx)(h,{})})})}}})}),I&&(0,j.jsxs)(s,{sx:{mb:1,color:`text.secondary`,fontSize:`0.75rem`},children:[I.length,` result`,I.length===1?``:`s`,` found`]}),M&&(0,j.jsx)(c,{severity:`error`,sx:{mb:2},children:M}),O||R?(0,j.jsx)(s,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,j.jsx)(u,{})}):U.length===0?(0,j.jsx)(C,{icon:(0,j.jsx)(g,{}),title:I?`No matching notes found`:`No notes yet`,description:I?`Try a different search query`:`Create your first note to get started`,action:!I&&x?(0,j.jsx)(d,{variant:`contained`,startIcon:(0,j.jsx)(m,{}),onClick:()=>t(`new`),children:`New Note`}):void 0}):(0,j.jsx)(l,{spacing:2,children:U.map(e=>(0,j.jsx)(D,{note:e,score:`score`in e?e.score:void 0,onClick:()=>t(e.id),onEdit:x?()=>t(`${e.id}/edit`):void 0},e.id))})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./vendor-markdown-DngssFHR.js";import{c as t,l as n}from"./vendor-react-DxfYAwYK.js";import{Y as r,et as i,q as a}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{Z as o,j as s}from"./index-80sqSHwS.js";import{a as c}from"./skill-demt31s6.js";import{t as l}from"./SkillForm-CfDWe0Nx.js";var u=e();function d(){let{projectId:e}=n(),d=t(),f=o(`skills`);return(0,u.jsxs)(r,{children:[(0,u.jsx)(s,{breadcrumbs:[{label:`Skills`,to:`/${e}/skills`},{label:`Create`}],actions:(0,u.jsx)(a,{variant:`contained`,form:`skill-form`,type:`submit`,disabled:!f,children:`Create`})}),!f&&(0,u.jsx)(i,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot create skills.`}),(0,u.jsx)(l,{onSubmit:async t=>{e&&d(`/${e}/skills/${(await c(e,t)).id}`)},onCancel:()=>d(`/${e}/skills`),submitLabel:`Create`})]})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./vendor-markdown-DngssFHR.js";import{c as t,l as n}from"./vendor-react-DxfYAwYK.js";import{Y as r,et as i,q as a}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{L as o,Z as s,j as c}from"./index-80sqSHwS.js";import{t as l}from"./NoteForm-D0lOYBQq.js";var u=e();function d(){let{projectId:e}=n(),d=t(),f=s(`knowledge`);return(0,u.jsxs)(r,{children:[(0,u.jsx)(c,{breadcrumbs:[{label:`Knowledge`,to:`/${e}/knowledge`},{label:`Create`}],actions:(0,u.jsx)(a,{variant:`contained`,form:`note-form`,type:`submit`,disabled:!f,children:`Create`})}),!f&&(0,u.jsx)(i,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot create notes.`}),(0,u.jsx)(l,{onSubmit:async t=>{e&&d(`/${e}/knowledge/${(await o(e,t)).id}`)},onCancel:()=>d(`/${e}/knowledge`),submitLabel:`Create`})]})}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./vendor-markdown-DngssFHR.js";import{c as t,l as n}from"./vendor-react-DxfYAwYK.js";import{Y as r,et as i,q as a}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{Z as o,j as s,o as c}from"./index-80sqSHwS.js";import{t as l}from"./TaskForm-ltmMCEAE.js";var u=e();function d(){let{projectId:e}=n(),d=t(),f=o(`tasks`);return(0,u.jsxs)(r,{children:[(0,u.jsx)(s,{breadcrumbs:[{label:`Tasks`,to:`/${e}/tasks`},{label:`Create`}],actions:(0,u.jsx)(a,{variant:`contained`,form:`task-form`,type:`submit`,disabled:!f,children:`Create`})}),!f&&(0,u.jsx)(i,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot create tasks.`}),(0,u.jsx)(l,{onSubmit:async t=>{e&&d(`/${e}/tasks/${(await c(e,t)).id}`)},onCancel:()=>d(`/${e}/tasks`),submitLabel:`Create`})]})}export{d as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,O as n}from"./vendor-markdown-CT8ZVEPu.js";import{c as r,l as i,s as a}from"./vendor-react-CHUjhoxh.js";import{$ as o,B as s,C as c,D as l,E as u,I as d,L as f,S as p,V as m,X as h,Y as g,at as _,et as ee,f as v,g as te,h as y,i as b,it as x,n as S,p as C,q as w,r as T,rt as E,t as D,tt as O,v as k,w as A,x as j,y as M,z as N}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{C as P,D as F,E as I,K as L,M as R,O as ne,P as z,S as B,T as re,V as ie,Y as ae,Z as oe,_ as se,a as V,b as ce,c as le,ct as ue,d as de,dt as fe,f as pe,g as me,h as he,it as ge,j as _e,k as ve,l as ye,m as be,nt as xe,o as Se,ot as Ce,p as we,q as Te,s as Ee,st as De,u as Oe,ut as ke,v as Ae,w as je,x as Me,y as Ne,z as Pe}from"./vendor-mui-icons-B196sG3f.js";import{$ as Fe,C as Ie}from"./index-BCZDAYZi.js";import{a as Le}from"./skill-y9pizyqE.js";var H=e(n(),1),Re="You are a **software developer** working on this project. Your primary workflow revolves around writing, debugging, and understanding TypeScript/JavaScript code.\n\n**Before writing code:**\n- Use `search_code` and `get_symbol` to understand existing implementations and avoid duplicating logic\n- Use `search` to find relevant documentation that describes expected behavior or API contracts\n- Use `recall_skills` to check if there are established procedures for this type of work\n- Use `find_linked_tasks` to see if the code you're about to change has associated tasks or known issues\n\n**While working:**\n- Use `cross_references` to verify that documentation examples match the code you're modifying\n- Use `search_notes` to check if previous developers left notes about tricky areas or design decisions\n- Use `get_file_symbols` to understand the full structure of files you're editing\n\n**After making changes:**\n- Capture non-obvious decisions, workarounds, or gotchas as knowledge notes with `create_note`\n- Link notes to relevant code symbols and documentation sections with `create_relation`\n- Update task status with `move_task` when completing work items\n- Save reusable patterns or procedures as skills with `create_skill`\n",ze='You are a **software architect** analyzing and designing this project\'s structure. Your focus is on system-level concerns: module boundaries, dependency flow, pattern consistency, and long-term maintainability.\n\n**Understanding the system:**\n- Use `search_code` and `list_files` to map out module boundaries and dependency structure\n- Use `get_file_symbols` to analyze exports, interfaces, and type hierarchies across files\n- Use `search_files` to find files by architectural concern (e.g., "middleware", "repository", "controller")\n- Use `cross_references` to verify that code organization matches documented architecture\n\n**Evaluating design decisions:**\n- Use `search_notes` and `list_notes` to review prior architectural decisions and their rationale\n- Use `search_all_files` to understand the project\'s file organization and naming conventions\n- Use `recall_skills` to find established architectural patterns and guidelines\n\n**Capturing decisions:**\n- Record architectural decisions (ADRs) as knowledge notes with `create_note`, including context, options considered, and rationale\n- Link decisions to affected code modules with `create_relation`\n- Create tasks for architectural improvements with `create_task` and link them to relevant code\n- Save architectural patterns as skills with `create_skill` for team-wide consistency\n',Be="You are a **code reviewer** analyzing changes in this project. Your goal is to ensure correctness, consistency, and completeness of code changes against the project's standards and documentation.\n\n**Context gathering:**\n- Use `get_symbol` to read full implementations of functions being modified\n- Use `search_code` to find similar patterns elsewhere in the codebase for consistency checks\n- Use `search` to find documentation that describes the expected behavior of the changed code\n- Use `find_linked_tasks` to verify that changes are associated with tracked work items\n\n**Review checklist:**\n- Use `cross_references` to ensure documentation examples are still accurate after code changes\n- Use `get_file_symbols` to check that new exports follow existing naming conventions\n- Use `search_notes` to look for known issues or prior decisions related to the changed area\n- Use `recall_skills` to apply established review criteria and coding standards\n\n**Capturing findings:**\n- Create notes for non-trivial review findings with `create_note` — especially patterns to avoid or edge cases discovered\n- Create tasks for follow-up work identified during review with `create_task`\n- Link review notes to the relevant code symbols with `create_relation`\n",Ve="You are a **technical writer** creating and maintaining documentation for this project. Your focus is on accuracy, completeness, and discoverability of documentation.\n\n**Finding documentation gaps:**\n- Use `list_files` and `get_file_symbols` to discover code that lacks corresponding documentation\n- Use `cross_references` to find symbols referenced in docs and verify they still exist and are accurate\n- Use `search_snippets` and `list_snippets` to audit code examples in documentation for correctness\n- Use `search_all_files` to find README files, guides, and configuration docs across the project\n\n**Writing and updating docs:**\n- Use `get_symbol` to read full source code before documenting functions, classes, or interfaces\n- Use `explain_symbol` to understand how code examples relate to their surrounding documentation\n- Use `search_topic_files` and `get_toc` to understand existing documentation structure and avoid duplication\n- Use `find_examples` to locate all documentation references to a specific symbol\n\n**Tracking documentation work:**\n- Capture documentation standards and style decisions as knowledge notes with `create_note`\n- Create tasks for documentation gaps with `create_task` and link them to undocumented code\n- Save documentation templates and writing guidelines as skills with `create_skill`\n- Use `create_relation` to link documentation notes to the code and doc sections they reference\n",He="You are a **team lead** managing work on this project. Your focus is on work organization, progress tracking, priority management, and connecting tasks to the code and documentation they affect.\n\n**Task management:**\n- Use `list_tasks` to review current work items by status, priority, and assignee\n- Use `search_tasks` to find tasks related to a specific area, feature, or concern\n- Use `move_task` to update task status through the workflow (backlog → todo → in_progress → review → done)\n- Use `create_task` to break down work into trackable items with clear descriptions, priorities, and estimates\n\n**Understanding context:**\n- Use `find_linked_tasks` to see which code, docs, and knowledge notes are connected to a task\n- Use `recall_skills` to find established procedures and workflows the team should follow\n- Use `search_notes` to review prior decisions, meeting notes, and technical context\n- Use `search_code` and `search` to understand the scope of work items before prioritizing\n\n**Team coordination:**\n- Use `link_task` to establish dependencies and blockers between tasks\n- Use `create_task_link` to connect tasks to the specific code files, documentation, or knowledge notes they affect\n- Capture planning decisions, sprint goals, and priority rationale as knowledge notes with `create_note`\n- Save team processes and recurring workflows as skills with `create_skill` and track usage with `bump_skill_usage`\n",Ue="You are a **DevOps engineer** managing infrastructure, CI/CD, and deployment for this project. Your focus is on build pipelines, containerization, environment configuration, and operational reliability.\n\n**Understanding infrastructure:**\n- Use `search_all_files` to find configuration files — Dockerfiles, CI configs, nginx configs, package.json, tsconfig\n- Use `list_all_files` to map the project's infrastructure layout and deployment artifacts\n- Use `get_file_info` to check file metadata, sizes, and types for deployment-related files\n- Use `search_code` to find environment variable usage, configuration loading, and deployment scripts\n\n**Analyzing dependencies:**\n- Use `get_file_symbols` to understand build scripts, CLI entry points, and module exports\n- Use `search` to find documentation about deployment procedures, environment setup, and infrastructure decisions\n\n**Operational knowledge:**\n- Use `recall_skills` to find established deployment procedures, rollback processes, and incident response playbooks\n- Use `search_notes` to review infrastructure decisions, environment-specific configurations, and operational issues\n- Create knowledge notes with `create_note` for deployment procedures, environment quirks, and infrastructure decisions\n- Save deployment and operational procedures as skills with `create_skill`\n- Create tasks for infrastructure improvements with `create_task`",We='You are a **data analyst** mining patterns and insights from this project\'s knowledge graph. Your focus is on understanding trends, finding connections, and extracting actionable intelligence from the accumulated project knowledge.\n\n**Discovering patterns:**\n- Use `search_notes` and `list_notes` to survey accumulated knowledge — decisions, issues, learnings\n- Use `list_relations` and `find_linked_notes` to trace relationship networks between concepts\n- Use `search_tasks` and `list_tasks` to analyze work patterns — common blockers, priority distributions, completion rates\n- Use `search_skills` and `list_skills` to identify frequently used procedures and knowledge gaps\n\n**Cross-graph analysis:**\n- Use `search_code` and `search` to correlate code complexity with documentation coverage\n- Use `find_linked_tasks` to map which code areas generate the most tasks and issues\n- Use `find_linked_skills` to see which skills are connected to which code or documentation areas\n- Use `cross_references` to verify alignment between code implementations and documented behavior\n\n**Capturing insights:**\n- Create analytical findings as knowledge notes with `create_note` using tags like "insight", "trend", "metric"\n- Use `create_relation` to link insights to the evidence that supports them\n- Create actionable recommendations as tasks with `create_task`\n- Save analytical procedures and query patterns as skills with `create_skill`\n',Ge="You are an **onboarding buddy** helping someone understand this project for the first time. Your focus is on explaining concepts clearly, guiding exploration, and building a mental model of the codebase step by step.\n\n**Guided exploration:**\n- Use `list_topics` and `get_toc` to walk through documentation in a logical order\n- Use `search` to find documentation sections that explain concepts the user asks about\n- Use `list_all_files` to give an overview of the project structure and what each area is responsible for\n- Use `search_all_files` to help locate specific files or configuration the user is looking for\n\n**Explaining code:**\n- Use `explain_symbol` to show code examples alongside their documentation context\n- Use `get_symbol` to read full implementations and explain them piece by piece\n- Use `get_file_symbols` to give an overview of what a file contains before diving into details\n- Use `cross_references` to show how code and documentation relate to each other\n\n**Building understanding:**\n- Use `search_notes` to find prior explanations, decisions, and context that help newcomers\n- Use `recall_skills` to surface established procedures the newcomer should learn\n- Use `find_linked_tasks` to show what work is happening around code areas being explored\n- When the newcomer discovers something new, capture it as a knowledge note with `create_note` — this reinforces learning and helps future newcomers\n",Ke=`You work **proactively** — anticipate needs, take action, and enrich the knowledge graph without waiting to be asked. Create entries when they are clearly valuable — not for every minor detail.
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i,s as a}from"./vendor-react-DxfYAwYK.js";import{$ as o,B as s,C as c,D as l,E as u,I as d,L as f,S as p,V as m,X as h,Y as g,at as _,et as ee,f as v,g as te,h as y,i as b,it as x,n as S,p as C,q as w,r as T,rt as E,t as D,tt as O,v as k,w as A,x as j,y as M,z as N}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{C as P,D as F,E as I,K as L,M as R,O as ne,P as z,S as B,T as re,V as ie,Y as ae,Z as oe,_ as se,a as V,b as ce,c as le,ct as ue,d as de,dt as fe,f as pe,g as me,h as he,it as ge,j as _e,k as ve,l as ye,m as be,nt as xe,o as Se,ot as Ce,p as we,q as Te,s as Ee,st as De,u as Oe,ut as ke,v as Ae,w as je,x as Me,y as Ne,z as Pe}from"./vendor-mui-icons-YtgP6dg2.js";import{$ as Fe,C as Ie}from"./index-80sqSHwS.js";import{a as Le}from"./skill-demt31s6.js";var H=e(n(),1),Re="You are a **software developer** working on this project. Your primary workflow revolves around writing, debugging, and understanding TypeScript/JavaScript code.\n\n**Before writing code:**\n- Use `search_code` and `get_symbol` to understand existing implementations and avoid duplicating logic\n- Use `search` to find relevant documentation that describes expected behavior or API contracts\n- Use `recall_skills` to check if there are established procedures for this type of work\n- Use `find_linked_tasks` to see if the code you're about to change has associated tasks or known issues\n\n**While working:**\n- Use `cross_references` to verify that documentation examples match the code you're modifying\n- Use `search_notes` to check if previous developers left notes about tricky areas or design decisions\n- Use `get_file_symbols` to understand the full structure of files you're editing\n\n**After making changes:**\n- Capture non-obvious decisions, workarounds, or gotchas as knowledge notes with `create_note`\n- Link notes to relevant code symbols and documentation sections with `create_relation`\n- Update task status with `move_task` when completing work items\n- Save reusable patterns or procedures as skills with `create_skill`\n",ze='You are a **software architect** analyzing and designing this project\'s structure. Your focus is on system-level concerns: module boundaries, dependency flow, pattern consistency, and long-term maintainability.\n\n**Understanding the system:**\n- Use `search_code` and `list_files` to map out module boundaries and dependency structure\n- Use `get_file_symbols` to analyze exports, interfaces, and type hierarchies across files\n- Use `search_files` to find files by architectural concern (e.g., "middleware", "repository", "controller")\n- Use `cross_references` to verify that code organization matches documented architecture\n\n**Evaluating design decisions:**\n- Use `search_notes` and `list_notes` to review prior architectural decisions and their rationale\n- Use `search_all_files` to understand the project\'s file organization and naming conventions\n- Use `recall_skills` to find established architectural patterns and guidelines\n\n**Capturing decisions:**\n- Record architectural decisions (ADRs) as knowledge notes with `create_note`, including context, options considered, and rationale\n- Link decisions to affected code modules with `create_relation`\n- Create tasks for architectural improvements with `create_task` and link them to relevant code\n- Save architectural patterns as skills with `create_skill` for team-wide consistency\n',Be="You are a **code reviewer** analyzing changes in this project. Your goal is to ensure correctness, consistency, and completeness of code changes against the project's standards and documentation.\n\n**Context gathering:**\n- Use `get_symbol` to read full implementations of functions being modified\n- Use `search_code` to find similar patterns elsewhere in the codebase for consistency checks\n- Use `search` to find documentation that describes the expected behavior of the changed code\n- Use `find_linked_tasks` to verify that changes are associated with tracked work items\n\n**Review checklist:**\n- Use `cross_references` to ensure documentation examples are still accurate after code changes\n- Use `get_file_symbols` to check that new exports follow existing naming conventions\n- Use `search_notes` to look for known issues or prior decisions related to the changed area\n- Use `recall_skills` to apply established review criteria and coding standards\n\n**Capturing findings:**\n- Create notes for non-trivial review findings with `create_note` — especially patterns to avoid or edge cases discovered\n- Create tasks for follow-up work identified during review with `create_task`\n- Link review notes to the relevant code symbols with `create_relation`\n",Ve="You are a **technical writer** creating and maintaining documentation for this project. Your focus is on accuracy, completeness, and discoverability of documentation.\n\n**Finding documentation gaps:**\n- Use `list_files` and `get_file_symbols` to discover code that lacks corresponding documentation\n- Use `cross_references` to find symbols referenced in docs and verify they still exist and are accurate\n- Use `search_snippets` and `list_snippets` to audit code examples in documentation for correctness\n- Use `search_all_files` to find README files, guides, and configuration docs across the project\n\n**Writing and updating docs:**\n- Use `get_symbol` to read full source code before documenting functions, classes, or interfaces\n- Use `explain_symbol` to understand how code examples relate to their surrounding documentation\n- Use `search_topic_files` and `get_toc` to understand existing documentation structure and avoid duplication\n- Use `find_examples` to locate all documentation references to a specific symbol\n\n**Tracking documentation work:**\n- Capture documentation standards and style decisions as knowledge notes with `create_note`\n- Create tasks for documentation gaps with `create_task` and link them to undocumented code\n- Save documentation templates and writing guidelines as skills with `create_skill`\n- Use `create_relation` to link documentation notes to the code and doc sections they reference\n",He="You are a **team lead** managing work on this project. Your focus is on work organization, progress tracking, priority management, and connecting tasks to the code and documentation they affect.\n\n**Task management:**\n- Use `list_tasks` to review current work items by status, priority, and assignee\n- Use `search_tasks` to find tasks related to a specific area, feature, or concern\n- Use `move_task` to update task status through the workflow (backlog → todo → in_progress → review → done)\n- Use `create_task` to break down work into trackable items with clear descriptions, priorities, and estimates\n\n**Understanding context:**\n- Use `find_linked_tasks` to see which code, docs, and knowledge notes are connected to a task\n- Use `recall_skills` to find established procedures and workflows the team should follow\n- Use `search_notes` to review prior decisions, meeting notes, and technical context\n- Use `search_code` and `search` to understand the scope of work items before prioritizing\n\n**Team coordination:**\n- Use `link_task` to establish dependencies and blockers between tasks\n- Use `create_task_link` to connect tasks to the specific code files, documentation, or knowledge notes they affect\n- Capture planning decisions, sprint goals, and priority rationale as knowledge notes with `create_note`\n- Save team processes and recurring workflows as skills with `create_skill` and track usage with `bump_skill_usage`\n",Ue="You are a **DevOps engineer** managing infrastructure, CI/CD, and deployment for this project. Your focus is on build pipelines, containerization, environment configuration, and operational reliability.\n\n**Understanding infrastructure:**\n- Use `search_all_files` to find configuration files — Dockerfiles, CI configs, nginx configs, package.json, tsconfig\n- Use `list_all_files` to map the project's infrastructure layout and deployment artifacts\n- Use `get_file_info` to check file metadata, sizes, and types for deployment-related files\n- Use `search_code` to find environment variable usage, configuration loading, and deployment scripts\n\n**Analyzing dependencies:**\n- Use `get_file_symbols` to understand build scripts, CLI entry points, and module exports\n- Use `search` to find documentation about deployment procedures, environment setup, and infrastructure decisions\n\n**Operational knowledge:**\n- Use `recall_skills` to find established deployment procedures, rollback processes, and incident response playbooks\n- Use `search_notes` to review infrastructure decisions, environment-specific configurations, and operational issues\n- Create knowledge notes with `create_note` for deployment procedures, environment quirks, and infrastructure decisions\n- Save deployment and operational procedures as skills with `create_skill`\n- Create tasks for infrastructure improvements with `create_task`",We='You are a **data analyst** mining patterns and insights from this project\'s knowledge graph. Your focus is on understanding trends, finding connections, and extracting actionable intelligence from the accumulated project knowledge.\n\n**Discovering patterns:**\n- Use `search_notes` and `list_notes` to survey accumulated knowledge — decisions, issues, learnings\n- Use `list_relations` and `find_linked_notes` to trace relationship networks between concepts\n- Use `search_tasks` and `list_tasks` to analyze work patterns — common blockers, priority distributions, completion rates\n- Use `search_skills` and `list_skills` to identify frequently used procedures and knowledge gaps\n\n**Cross-graph analysis:**\n- Use `search_code` and `search` to correlate code complexity with documentation coverage\n- Use `find_linked_tasks` to map which code areas generate the most tasks and issues\n- Use `find_linked_skills` to see which skills are connected to which code or documentation areas\n- Use `cross_references` to verify alignment between code implementations and documented behavior\n\n**Capturing insights:**\n- Create analytical findings as knowledge notes with `create_note` using tags like "insight", "trend", "metric"\n- Use `create_relation` to link insights to the evidence that supports them\n- Create actionable recommendations as tasks with `create_task`\n- Save analytical procedures and query patterns as skills with `create_skill`\n',Ge="You are an **onboarding buddy** helping someone understand this project for the first time. Your focus is on explaining concepts clearly, guiding exploration, and building a mental model of the codebase step by step.\n\n**Guided exploration:**\n- Use `list_topics` and `get_toc` to walk through documentation in a logical order\n- Use `search` to find documentation sections that explain concepts the user asks about\n- Use `list_all_files` to give an overview of the project structure and what each area is responsible for\n- Use `search_all_files` to help locate specific files or configuration the user is looking for\n\n**Explaining code:**\n- Use `explain_symbol` to show code examples alongside their documentation context\n- Use `get_symbol` to read full implementations and explain them piece by piece\n- Use `get_file_symbols` to give an overview of what a file contains before diving into details\n- Use `cross_references` to show how code and documentation relate to each other\n\n**Building understanding:**\n- Use `search_notes` to find prior explanations, decisions, and context that help newcomers\n- Use `recall_skills` to surface established procedures the newcomer should learn\n- Use `find_linked_tasks` to show what work is happening around code areas being explored\n- When the newcomer discovers something new, capture it as a knowledge note with `create_note` — this reinforces learning and helps future newcomers\n",Ke=`You work **proactively** — anticipate needs, take action, and enrich the knowledge graph without waiting to be asked. Create entries when they are clearly valuable — not for every minor detail.
|
|
2
2
|
|
|
3
3
|
**Search behavior:**
|
|
4
4
|
- Always search before answering — use \`search\`, \`search_code\`, or \`search_notes\` to ground responses in project context
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i,u as a}from"./vendor-react-DxfYAwYK.js";import{$ as o,A as s,K as c,W as l,Y as u,et as d,m as f,n as p,nt as m,r as h,t as g,ut as _}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{ct as v,dt as y,it as b,lt as x,q as S,st as C,ut as w}from"./vendor-mui-icons-YtgP6dg2.js";import{A as T,F as E,J as D,P as O,T as k,_ as A,j}from"./index-80sqSHwS.js";import{i as M}from"./api-BlFF6gX-.js";import{r as N}from"./api-BMnBjMMf.js";import{t as P}from"./api-CrGJOcaN.js";import{m as F}from"./skill-demt31s6.js";var I=e(n(),1),L=t(),R={knowledge:{label:`Knowledge`,icon:(0,L.jsx)(y,{}),badgeColor:`warning`},tasks:{label:`Tasks`,icon:(0,L.jsx)(w,{}),badgeColor:`primary`},skills:{label:`Skills`,icon:(0,L.jsx)(b,{}),badgeColor:`neutral`},files:{label:`Files`,icon:(0,L.jsx)(x,{}),badgeColor:`success`},docs:{label:`Docs`,icon:(0,L.jsx)(v,{}),badgeColor:`neutral`},code:{label:`Code`,icon:(0,L.jsx)(S,{}),badgeColor:`error`}};function z(e,t){return t.scope===`knowledge`?`/${e}/knowledge/${t.id}`:t.scope===`tasks`?`/${e}/tasks/${t.id}`:t.scope===`skills`?`/${e}/skills/${t.id}`:t.scope===`files`?`/${e}/files/view/${t.id}`:t.scope===`docs`?`/${e}/docs/${encodeURIComponent(t.id)}`:null}var B=[`knowledge`,`tasks`,`skills`,`files`,`docs`,`code`];function V(e){if(!e)return B;let t=e.split(`,`).filter(e=>e in R);return t.length>0?t:B}function H(){let{projectId:e}=i(),t=r(),{palette:n}=_(),[v,y]=a(),[b,x]=(0,I.useState)(v.get(`q`)||``),[S,w]=(0,I.useState)(V(v.get(`scopes`))),[H,U]=(0,I.useState)([]),[W,G]=(0,I.useState)(!1),[K,q]=(0,I.useState)(null),[J,Y]=(0,I.useState)(!1),X=(0,I.useCallback)(async(t,n)=>{if(!e||!t.trim())return;G(!0),q(null),Y(!0);let r=[],i={topK:20,minScore:.1},a=t.trim();try{let t=[];n.includes(`knowledge`)&&t.push(D(e,a,i).then(e=>{for(let t of e)r.push({id:t.id,scope:`knowledge`,title:t.title,subtitle:t.content?.slice(0,120),score:t.score,tags:t.tags})}).catch(()=>{})),n.includes(`tasks`)&&t.push(A(e,a,i).then(e=>{for(let t of e)r.push({id:t.id,scope:`tasks`,title:t.title,subtitle:`${t.status} / ${t.priority}${t.description?` — `+t.description.slice(0,80):``}`,score:t.score,tags:t.tags})}).catch(()=>{})),n.includes(`skills`)&&t.push(F(e,a,i).then(e=>{for(let t of e)r.push({id:t.id,scope:`skills`,title:t.title,subtitle:`${t.source} / ${Math.round(t.confidence*100)}%${t.description?` — `+t.description.slice(0,80):``}`,score:t.score,tags:t.tags})}).catch(()=>{})),n.includes(`files`)&&t.push(N(e,a,i).then(e=>{for(let t of e)r.push({id:t.filePath,scope:`files`,title:t.filePath,subtitle:[t.language,t.size?`${(t.size/1024).toFixed(1)} KB`:``].filter(Boolean).join(` / `),score:t.score})}).catch(()=>{})),n.includes(`docs`)&&t.push(M(e,a,i).then(e=>{for(let t of e)r.push({id:t.id,scope:`docs`,title:t.title||t.id,subtitle:t.content?.slice(0,120),score:t.score})}).catch(()=>{})),n.includes(`code`)&&t.push(P(e,a,i).then(e=>{for(let t of e)r.push({id:t.id,scope:`code`,title:t.name||t.id,subtitle:`${t.kind}${t.content?` — `+t.content.slice(0,80):``}`,score:t.score})}).catch(()=>{})),await Promise.all(t),r.sort((e,t)=>t.score-e.score),U(r)}catch(e){q(e instanceof Error?e.message:String(e))}finally{G(!1)}},[e]);(0,I.useEffect)(()=>{let e=v.get(`q`),t=V(v.get(`scopes`));e?.trim()&&X(e,t)},[]);let Z=()=>{let e=new URLSearchParams;b.trim()&&e.set(`q`,b.trim()),S.length===B.length&&B.every(e=>S.includes(e))||e.set(`scopes`,S.join(`,`)),y(e,{replace:!0}),X(b,S)},Q=n=>{if(!e)return;let r=z(e,n);r&&t(r)};return(0,L.jsxs)(u,{children:[(0,L.jsx)(j,{breadcrumbs:[{label:`Search`}]}),(0,L.jsx)(T,{children:(0,L.jsx)(h,{fullWidth:!0,size:`small`,placeholder:`Search across all graphs...`,value:b,onChange:e=>x(e.target.value),onKeyDown:e=>e.key===`Enter`&&Z(),slotProps:{input:{startAdornment:(0,L.jsx)(s,{position:`start`,children:(0,L.jsx)(C,{})})}}})}),(0,L.jsx)(g,{value:S,onChange:(e,t)=>{t.length>0&&w(t)},size:`small`,sx:{mb:3,flexWrap:`wrap`},children:Object.keys(R).map(e=>(0,L.jsxs)(p,{value:e,sx:{gap:.5,textTransform:`none`},children:[R[e].icon,R[e].label]},e))}),K&&(0,L.jsx)(d,{severity:`error`,sx:{mb:2},children:K}),W?(0,L.jsx)(u,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,L.jsx)(m,{})}):H.length===0&&J?(0,L.jsx)(k,{icon:(0,L.jsx)(C,{}),title:`No results found`,description:`Try a different query or broaden your scope filters`}):(0,L.jsx)(f,{spacing:1.5,children:H.map((e,t)=>{let r=R[e.scope],i=e.scope!==`code`;return(0,L.jsx)(c,{variant:`outlined`,onClick:i?()=>Q(e):void 0,sx:i?{cursor:`pointer`,"&:hover":{borderColor:`primary.main`}}:{},children:(0,L.jsxs)(l,{sx:{py:1.5,"&:last-child":{pb:1.5}},children:[(0,L.jsxs)(u,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:.5},children:[(0,L.jsx)(E,{label:r.label,color:r.badgeColor,icon:r.icon}),(0,L.jsx)(o,{variant:`body2`,fontWeight:600,sx:{flex:1},children:e.title}),(0,L.jsx)(E,{label:`${(e.score*100).toFixed(0)}%`,color:`primary`,size:`small`})]}),e.subtitle&&(0,L.jsx)(o,{variant:`caption`,sx:{display:`block`,color:n.custom.textMuted},children:e.subtitle}),e.tags&&e.tags.length>0&&(0,L.jsx)(u,{sx:{mt:.5},children:(0,L.jsx)(O,{tags:e.tags})})]})},`${e.scope}-${e.id}-${t}`)})})]})}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e}from"./vendor-markdown-DngssFHR.js";import{$ as t,K as n,W as r,Y as i,h as a,tt as o,ut as s}from"./vendor-mui-DXUYJbRC.js";import{i as c,n as l,r as u}from"./client-Bq88u7gN.js";import{W as d}from"./vendor-mui-icons-YtgP6dg2.js";import{F as f,P as p}from"./index-80sqSHwS.js";function m(e,t){return u(`/projects/${e}/skills${l({source:t?.source,tag:t?.tag,limit:t?.limit})}`).then(c)}function h(e,t){return u(`/projects/${e}/skills/${t}`)}function g(e,t){return u(`/projects/${e}/skills`,{method:`POST`,body:JSON.stringify(t)})}function _(e,t,n){return u(`/projects/${e}/skills/${t}`,{method:`PUT`,body:JSON.stringify(n)})}function v(e,t){return u(`/projects/${e}/skills/${t}`,{method:`DELETE`})}function y(e,t,n){return u(`/projects/${e}/skills/search${l({q:t,topK:n?.topK,minScore:n?.minScore})}`).then(c)}function b(e,t){return u(`/projects/${e}/skills/links`,{method:`POST`,body:JSON.stringify(t)})}function x(e,t){return u(`/projects/${e}/skills/links`,{method:`DELETE`,body:JSON.stringify(t)})}function S(e,t){return u(`/projects/${e}/skills/${t}/relations`).then(c)}function C(e,t){return u(`/projects/${e}/skills/${t}/attachments`).then(c)}async function w(e,t,n){let r=new FormData;r.append(`file`,n);let i=await fetch(`/api/projects/${e}/skills/${t}/attachments`,{method:`POST`,credentials:`include`,body:r});if(!i.ok){let e=await i.json().catch(()=>({error:i.statusText}));throw Error(e.error||i.statusText)}return i.json()}function T(e,t,n){return u(`/projects/${e}/skills/${t}/attachments/${encodeURIComponent(n)}`,{method:`DELETE`})}function E(e,t,n){return`/api/projects/${e}/skills/${t}/attachments/${encodeURIComponent(n)}`}var D={user:`primary`,learned:`warning`};function O(e){return e===`learned`?`Learned`:`User`}function k(e){return`${Math.round(e*100)}%`}var A=e();function j({skill:e,score:c,onClick:l,onEdit:u}){let{palette:m}=s();return(0,A.jsx)(n,{variant:`outlined`,sx:{cursor:l?`pointer`:`default`,"&:hover":l?{borderColor:`primary.main`}:{}},onClick:l,children:(0,A.jsx)(r,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,A.jsxs)(i,{sx:{display:`flex`,alignItems:`flex-start`,gap:1},children:[(0,A.jsxs)(i,{sx:{flex:1,minWidth:0},children:[(0,A.jsxs)(i,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:.25},children:[(0,A.jsx)(t,{variant:`subtitle1`,fontWeight:600,noWrap:!0,sx:{flex:1},children:e.title}),(0,A.jsx)(f,{label:O(e.source),color:D[e.source]??`primary`,size:`small`}),(0,A.jsx)(f,{label:k(e.confidence),color:`neutral`,size:`small`}),c!==void 0&&(0,A.jsx)(f,{label:`${(c*100).toFixed(0)}%`,color:`primary`,size:`small`})]}),e.description&&(0,A.jsx)(t,{variant:`body2`,sx:{color:m.custom.textMuted},noWrap:!0,children:e.description}),(0,A.jsxs)(i,{sx:{display:`flex`,alignItems:`center`,gap:1,mt:.5},children:[e.usageCount>0&&(0,A.jsxs)(t,{variant:`caption`,sx:{color:m.custom.textMuted},children:[`Used `,e.usageCount,` time`,e.usageCount===1?``:`s`]}),e.tags?.length>0&&(0,A.jsx)(p,{tags:e.tags})]})]}),u&&(0,A.jsx)(a,{title:`Edit`,children:(0,A.jsx)(o,{size:`small`,onClick:e=>{e.stopPropagation(),u()},children:(0,A.jsx)(d,{fontSize:`small`})})})]})})})}export{w as _,g as a,T as c,C as d,S as f,_ as g,E as h,O as i,x as l,y as m,D as n,b as o,m as p,k as r,v as s,j as t,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i,u as a}from"./vendor-react-DxfYAwYK.js";import{A as o,Y as s,et as c,m as l,nt as u,q as d,r as f,tt as p}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{K as m,Q as h,it as g,st as _}from"./vendor-mui-icons-YtgP6dg2.js";import{A as v,Q as y,T as b,Z as x,j as S}from"./index-80sqSHwS.js";import{a as C,g as w,m as T,p as E,s as D,t as O}from"./skill-demt31s6.js";import"./SkillForm-CfDWe0Nx.js";var k=e(n(),1);function A(e){let[t,n]=(0,k.useState)([]),[r,i]=(0,k.useState)(!1),[a,o]=(0,k.useState)(null),s=(0,k.useCallback)(async()=>{if(e){i(!0),o(null);try{n(await E(e))}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}},[e]);return(0,k.useEffect)(()=>{s()},[s]),{skills:t,loading:r,error:a,refresh:s,create:(0,k.useCallback)(async t=>{if(!e)return;let r=await C(e,t);return n(e=>[...e,r]),r},[e]),update:(0,k.useCallback)(async(t,r)=>{if(!e)return;let i=await w(e,t,r);return n(e=>e.map(e=>e.id===t?i:e)),i},[e]),remove:(0,k.useCallback)(async t=>{e&&(await D(e,t),n(e=>e.filter(e=>e.id!==t)))},[e])}}var j=t();function M(){let{projectId:e}=i(),t=r(),[n,C]=a(),w=x(`skills`),{skills:E,loading:D,error:M,refresh:N}=A(e??null),[P,F]=(0,k.useState)(n.get(`q`)||``),[I,L]=(0,k.useState)(null),[R,z]=(0,k.useState)(!1);y(e??null,(0,k.useCallback)(e=>{e.type.startsWith(`skill:`)&&N()},[N]));let B=(0,k.useCallback)(async t=>{if(!e||!t.trim()){L(null);return}z(!0);try{L(await T(e,t.trim()))}catch{}finally{z(!1)}},[e]);(0,k.useEffect)(()=>{let e=n.get(`q`);e?.trim()&&B(e)},[]);let V=()=>{let e=new URLSearchParams(n);P.trim()?e.set(`q`,P.trim()):e.delete(`q`),C(e,{replace:!0}),B(P)},H=()=>{F(``),L(null);let e=new URLSearchParams(n);e.delete(`q`),C(e,{replace:!0})},U=I??E;return(0,j.jsxs)(s,{children:[(0,j.jsx)(S,{breadcrumbs:[{label:`Skills`}],actions:w?(0,j.jsx)(d,{variant:`contained`,startIcon:(0,j.jsx)(m,{}),onClick:()=>t(`new`),children:`New Skill`}):void 0}),(0,j.jsx)(v,{children:(0,j.jsx)(f,{fullWidth:!0,size:`small`,placeholder:`Semantic search skills...`,value:P,onChange:e=>F(e.target.value),onKeyDown:e=>e.key===`Enter`&&V(),slotProps:{input:{startAdornment:(0,j.jsx)(o,{position:`start`,children:(0,j.jsx)(_,{})}),endAdornment:P&&(0,j.jsx)(o,{position:`end`,children:(0,j.jsx)(p,{size:`small`,onClick:H,children:(0,j.jsx)(h,{})})})}}})}),I&&(0,j.jsxs)(s,{sx:{mb:1,color:`text.secondary`,fontSize:`0.75rem`},children:[I.length,` result`,I.length===1?``:`s`,` found`]}),M&&(0,j.jsx)(c,{severity:`error`,sx:{mb:2},children:M}),D||R?(0,j.jsx)(s,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,j.jsx)(u,{})}):U.length===0?(0,j.jsx)(b,{icon:(0,j.jsx)(g,{}),title:I?`No matching skills found`:`No skills yet`,description:I?`Try a different search query`:`Create your first skill to get started`,action:!I&&w?(0,j.jsx)(d,{variant:`contained`,startIcon:(0,j.jsx)(m,{}),onClick:()=>t(`new`),children:`New Skill`}):void 0}):(0,j.jsx)(l,{spacing:2,children:U.map(e=>(0,j.jsx)(O,{skill:e,score:`score`in e?e.score:void 0,onClick:()=>t(e.id),onEdit:w?()=>t(`${e.id}/edit`):void 0},e.id))})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,O as n}from"./vendor-markdown-CT8ZVEPu.js";import{c as r,l as i}from"./vendor-react-CHUjhoxh.js";import{$ as a,A as o,P as s,S as ee,U as te,X as c,Y as l,b as ne,et as re,ft as u,h as ie,m as ae,nt as oe,ot as d,q as f,r as p,tt as m,ut as se,v as h,y as g}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{K as _,M as ce,Q as v,W as le,n as ue,r as de,st as fe,ut as pe}from"./vendor-mui-icons-B196sG3f.js";import{F as me,P as he,Q as ge,Z as _e,c as ve,et as ye,g as be,h as xe,i as y,j as Se,n as Ce,o as we,t as b,w as Te}from"./index-BCZDAYZi.js";var x=e(n(),1),S=`kanban-visible-columns`,C=b.map(e=>e.status);function w(){try{let e=localStorage.getItem(S);if(e){let t=JSON.parse(e).filter(e=>C.includes(e));if(t.length>0)return new Set(t)}}catch{}return new Set(C)}function Ee(){let[e,t]=(0,x.useState)(w);return{visible:e,toggle:(0,x.useCallback)(e=>{t(t=>{let n=new Set(t);if(n.has(e)){if(n.size<=1)return t;n.delete(e)}else n.add(e);return localStorage.setItem(S,JSON.stringify([...n])),n})},[]),visibleColumns:b.filter(t=>e.has(t.status))}}var T=t(),E=[`done`,`cancelled`],D=864e5;function De(e,t){if(!e||E.includes(t))return null;let n=e-Date.now(),r=Math.ceil(n/D);return r<0?{label:`Overdue ${Math.abs(r)}d`,color:`error`}:r<=3?{label:`Due in ${r}d`,color:`warning`}:null}function O(){let{projectId:e}=i(),t=r(),{palette:n}=se(),S=_e(`tasks`),[C,w]=(0,x.useState)([]),[E,D]=(0,x.useState)(!0),[O,Oe]=(0,x.useState)(null),[k,A]=(0,x.useState)(null),[ke,j]=(0,x.useState)(null),[M,Ae]=(0,x.useState)([]),[N,P]=(0,x.useState)(``),{visible:F,toggle:je,visibleColumns:Me}=Ee(),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(``),[B,V]=(0,x.useState)(``),[H,U]=(0,x.useState)(``),[W,G]=(0,x.useState)(null),[K,q]=(0,x.useState)(``),J=(0,x.useRef)(null),[Y,X]=(0,x.useState)(null),[Ne,Z]=(0,x.useState)(!1),Q=(0,x.useCallback)(async()=>{if(e)try{w(await xe(e,{limit:500}))}catch(e){Oe(e instanceof Error?e.message:String(e))}finally{D(!1)}},[e]);(0,x.useEffect)(()=>{Q()},[Q]),(0,x.useEffect)(()=>{e&&ye(e).then(Ae).catch(()=>{})},[e]),ge(e??null,(0,x.useCallback)(e=>{e.type.startsWith(`task:`)&&Q()},[Q])),(0,x.useEffect)(()=>{W&&setTimeout(()=>J.current?.focus(),50)},[W]);let Pe=e=>A(e),$=()=>{A(null),j(null)},Fe=async t=>{if(!k||!e)return;let n=C.find(e=>e.id===k);if(!n||n.status===t){$();return}w(e=>e.map(e=>e.id===k?{...e,status:t}:e)),$();try{await be(e,k,t)}catch{Q()}},Ie=async t=>{let n=K.trim();if(!(!n||!e)){q(``),G(null);try{await we(e,{title:n,status:t}),Q()}catch{}}},Le=async()=>{if(!(!Y||!e)){Z(!0);try{w(e=>e.filter(e=>e.id!==Y.id)),await ve(e,Y.id)}catch{Q()}finally{Z(!1),X(null)}}},Re=(0,x.useMemo)(()=>{let e=new Set;for(let t of C)t.tags?.forEach(t=>e.add(t));return[...e].sort()},[C]),ze=(0,x.useMemo)(()=>{let e=C;if(R){let t=R.toLowerCase();e=e.filter(e=>e.title.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t))}return B&&(e=e.filter(e=>e.priority===B)),H&&(e=e.filter(e=>e.tags?.includes(H))),N&&(e=e.filter(e=>e.assignee===N)),e},[C,R,B,H,N]),Be=(0,x.useMemo)(()=>{let e=new Map;for(let t of b)e.set(t.status,[]);for(let t of ze){let n=e.get(t.status);n&&n.push(t)}return e},[ze]),Ve=R||B||H||N;return(0,T.jsxs)(l,{children:[(0,T.jsx)(Se,{breadcrumbs:[{label:`Tasks`}],actions:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{title:`Column visibility`,children:(0,T.jsx)(m,{onClick:e=>L(e.currentTarget),size:`small`,children:(0,T.jsx)(de,{fontSize:`small`})})}),(0,T.jsx)(ne,{anchorEl:I,open:!!I,onClose:()=>L(null),children:b.map(({status:e,label:t})=>(0,T.jsxs)(g,{onClick:()=>je(e),dense:!0,children:[(0,T.jsx)(te,{checked:F.has(e),disabled:F.has(e)&&F.size===1,size:`small`,sx:{p:0,mr:1}}),(0,T.jsx)(ee,{primary:t})]},e))}),S&&(0,T.jsx)(f,{variant:`contained`,startIcon:(0,T.jsx)(_,{}),onClick:()=>t(`new`),children:`New Task`})]})}),(0,T.jsxs)(l,{sx:{display:`flex`,alignItems:`center`,gap:1.5,px:2,py:1,bgcolor:n.custom.surfaceMuted,borderRadius:1,mb:2},children:[(0,T.jsx)(p,{size:`small`,placeholder:`Search tasks...`,value:R,onChange:e=>z(e.target.value),slotProps:{input:{startAdornment:(0,T.jsx)(o,{position:`start`,children:(0,T.jsx)(fe,{fontSize:`small`,sx:{color:n.custom.textMuted}})}),endAdornment:R?(0,T.jsx)(o,{position:`end`,children:(0,T.jsx)(m,{size:`small`,onClick:()=>z(``),children:(0,T.jsx)(v,{fontSize:`small`})})}):void 0}},sx:{minWidth:200,flex:1,maxWidth:350}}),(0,T.jsx)(s,{size:`small`,sx:{minWidth:120},children:(0,T.jsxs)(h,{value:B,onChange:e=>V(e.target.value),displayEmpty:!0,renderValue:e=>e?y(e):`Priority`,sx:{color:B?void 0:n.custom.textMuted},children:[(0,T.jsx)(g,{value:``,children:`All priorities`}),(0,T.jsx)(g,{value:`critical`,children:`Critical`}),(0,T.jsx)(g,{value:`high`,children:`High`}),(0,T.jsx)(g,{value:`medium`,children:`Medium`}),(0,T.jsx)(g,{value:`low`,children:`Low`})]})}),Re.length>0&&(0,T.jsx)(s,{size:`small`,sx:{minWidth:120},children:(0,T.jsxs)(h,{value:H,onChange:e=>U(e.target.value),displayEmpty:!0,renderValue:e=>e||`Tag`,sx:{color:H?void 0:n.custom.textMuted},children:[(0,T.jsx)(g,{value:``,children:`All tags`}),Re.map(e=>(0,T.jsx)(g,{value:e,children:e},e))]})}),M.length>0&&(0,T.jsx)(s,{size:`small`,sx:{minWidth:120},children:(0,T.jsxs)(h,{value:N,onChange:e=>P(e.target.value),displayEmpty:!0,renderValue:e=>e?M.find(t=>t.id===e)?.name||e:`Assignee`,sx:{color:N?void 0:n.custom.textMuted},children:[(0,T.jsx)(g,{value:``,children:`All`}),M.map(e=>(0,T.jsx)(g,{value:e.id,children:e.name||e.id},e.id))]})}),Ve&&(0,T.jsx)(f,{size:`small`,onClick:()=>{z(``),V(``),U(``),P(``)},children:`Clear`})]}),O&&(0,T.jsx)(re,{severity:`error`,sx:{mb:2},children:O}),E?(0,T.jsx)(l,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,T.jsx)(oe,{})}):C.length===0?(0,T.jsxs)(l,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,py:6},children:[(0,T.jsx)(pe,{sx:{fontSize:48,color:n.custom.textMuted,mb:2}}),(0,T.jsx)(a,{variant:`h6`,gutterBottom:!0,children:`No tasks yet`}),(0,T.jsx)(a,{variant:`body2`,sx:{color:n.custom.textMuted,mb:2},children:S?`Create your first task to get started`:`No tasks yet`}),S&&(0,T.jsx)(f,{variant:`contained`,startIcon:(0,T.jsx)(_,{}),onClick:()=>t(`new`),children:`New Task`})]}):(0,T.jsx)(l,{sx:{display:`flex`,gap:2,overflowX:`auto`,pb:2,maxHeight:`calc(100vh - 220px)`},children:Me.map(({status:e,label:r,color:i})=>{let o=Be.get(e),s=ke===e&&k!==null;return(0,T.jsxs)(d,{variant:`outlined`,sx:{minWidth:220,flex:1,display:`flex`,flexDirection:`column`,borderTop:`3px solid ${i}`,bgcolor:s?u(i,.06):n.custom.surfaceMuted,borderColor:s?i:void 0,borderStyle:s?`dashed`:void 0,transition:`background-color 0.15s, border-color 0.15s`},onDragOver:t=>{t.preventDefault(),j(e)},onDragEnter:()=>j(e),onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||j(null)},onDrop:()=>Fe(e),children:[(0,T.jsxs)(l,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,px:1.5,pt:1.5,pb:1},children:[(0,T.jsxs)(l,{sx:{display:`flex`,alignItems:`center`,gap:.75},children:[(0,T.jsx)(a,{variant:`subtitle2`,fontWeight:700,children:r}),(0,T.jsx)(a,{variant:`caption`,sx:{color:n.custom.textMuted},children:o.length})]}),S&&(0,T.jsx)(m,{size:`small`,onClick:()=>{G(e),q(``)},sx:{p:.25,color:n.custom.textMuted},children:(0,T.jsx)(_,{sx:{fontSize:18}})})]}),W===e&&(0,T.jsxs)(l,{sx:{display:`flex`,gap:.5,px:1.5,pb:1},children:[(0,T.jsx)(p,{inputRef:J,size:`small`,placeholder:`Task title...`,value:K,onChange:e=>q(e.target.value),onKeyDown:t=>{t.key===`Enter`&&Ie(e),t.key===`Escape`&&(G(null),q(``))},fullWidth:!0,sx:{"& .MuiInputBase-root":{fontSize:`0.85rem`}}}),(0,T.jsx)(m,{size:`small`,onClick:()=>{G(null),q(``)},children:(0,T.jsx)(v,{fontSize:`small`})})]}),(0,T.jsx)(ae,{spacing:1,sx:{flex:1,overflowY:`auto`,px:1.5,pb:1.5,minHeight:50,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:u(n.text.primary,.15),borderRadius:2}},children:o.map(e=>{let r=De(e.dueDate,e.status);return(0,T.jsxs)(d,{variant:`outlined`,draggable:S,onDragStart:S?()=>Pe(e.id):void 0,onDragEnd:S?$:void 0,onClick:()=>t(e.id),sx:{p:1.5,cursor:`pointer`,position:`relative`,bgcolor:n.custom.surface,"&:hover":{borderColor:`primary.main`},"&:hover .task-actions":{opacity:1},opacity:k===e.id?.5:1},children:[(0,T.jsxs)(l,{className:`task-actions`,sx:{position:`absolute`,top:4,right:4,display:`flex`,gap:.25,opacity:0,transition:`opacity 0.15s`,bgcolor:n.custom.surface,borderRadius:.5},children:[(0,T.jsx)(m,{size:`small`,onClick:n=>{n.stopPropagation(),t(`${e.id}/edit`)},sx:{p:.5},children:(0,T.jsx)(le,{sx:{fontSize:15}})}),S&&(0,T.jsx)(m,{size:`small`,onClick:t=>{t.stopPropagation(),X(e)},sx:{p:.5,color:`error.main`},children:(0,T.jsx)(ce,{sx:{fontSize:15}})})]}),(0,T.jsx)(l,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,mb:.5,pr:3},children:(0,T.jsx)(a,{variant:`body2`,fontWeight:600,sx:{flex:1},children:e.title})}),e.assignee&&(0,T.jsxs)(a,{variant:`caption`,color:`text.secondary`,sx:{display:`block`,mb:.5},children:[`@`,M.find(t=>t.id===e.assignee)?.name??e.assignee]}),(0,T.jsxs)(l,{sx:{display:`flex`,gap:.5,flexWrap:`wrap`,mb:e.description?.5:0},children:[(0,T.jsx)(me,{label:y(e.priority),color:Ce[e.priority],size:`small`}),e.estimate!=null&&(0,T.jsx)(c,{icon:(0,T.jsx)(ue,{sx:{fontSize:`14px !important`}}),label:`${e.estimate}h`,size:`small`,variant:`outlined`,sx:{height:20,"& .MuiChip-label":{px:.5,fontSize:`0.7rem`},"& .MuiChip-icon":{ml:.5}}}),r&&(0,T.jsx)(c,{label:r.label,size:`small`,color:r.color,sx:{height:20,"& .MuiChip-label":{px:.75,fontSize:`0.7rem`}}})]}),e.description&&(0,T.jsx)(a,{variant:`caption`,sx:{display:`block`,mb:.5,color:n.custom.textMuted},children:e.description.length>80?e.description.slice(0,80)+`...`:e.description}),e.tags?.length>0&&(0,T.jsx)(l,{sx:{mt:.5},children:(0,T.jsx)(he,{tags:e.tags})})]},e.id)})})]},e)})}),(0,T.jsx)(Te,{open:!!Y,title:`Delete Task`,message:`Are you sure you want to delete "${Y?.title}"? This action cannot be undone.`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:Le,onCancel:()=>X(null),loading:Ne})]})}export{O as default};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i}from"./vendor-react-DxfYAwYK.js";import{$ as a,A as o,P as s,S as ee,U as te,X as c,Y as l,b as ne,et as re,ft as u,h as ie,m as ae,nt as oe,ot as d,q as f,r as p,tt as m,ut as se,v as h,y as g}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{K as _,M as ce,Q as v,W as le,n as ue,r as de,st as fe,ut as pe}from"./vendor-mui-icons-YtgP6dg2.js";import{F as me,P as he,Q as ge,Z as _e,c as ve,et as ye,g as be,h as xe,i as y,j as Se,n as Ce,o as we,t as b,w as Te}from"./index-80sqSHwS.js";var x=e(n(),1),S=`kanban-visible-columns`,C=b.map(e=>e.status);function w(){try{let e=localStorage.getItem(S);if(e){let t=JSON.parse(e).filter(e=>C.includes(e));if(t.length>0)return new Set(t)}}catch{}return new Set(C)}function Ee(){let[e,t]=(0,x.useState)(w);return{visible:e,toggle:(0,x.useCallback)(e=>{t(t=>{let n=new Set(t);if(n.has(e)){if(n.size<=1)return t;n.delete(e)}else n.add(e);return localStorage.setItem(S,JSON.stringify([...n])),n})},[]),visibleColumns:b.filter(t=>e.has(t.status))}}var T=t(),E=[`done`,`cancelled`],D=864e5;function De(e,t){if(!e||E.includes(t))return null;let n=e-Date.now(),r=Math.ceil(n/D);return r<0?{label:`Overdue ${Math.abs(r)}d`,color:`error`}:r<=3?{label:`Due in ${r}d`,color:`warning`}:null}function O(){let{projectId:e}=i(),t=r(),{palette:n}=se(),S=_e(`tasks`),[C,w]=(0,x.useState)([]),[E,D]=(0,x.useState)(!0),[O,Oe]=(0,x.useState)(null),[k,A]=(0,x.useState)(null),[ke,j]=(0,x.useState)(null),[M,Ae]=(0,x.useState)([]),[N,P]=(0,x.useState)(``),{visible:F,toggle:je,visibleColumns:Me}=Ee(),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(``),[B,V]=(0,x.useState)(``),[H,U]=(0,x.useState)(``),[W,G]=(0,x.useState)(null),[K,q]=(0,x.useState)(``),J=(0,x.useRef)(null),[Y,X]=(0,x.useState)(null),[Ne,Z]=(0,x.useState)(!1),Q=(0,x.useCallback)(async()=>{if(e)try{w(await xe(e,{limit:500}))}catch(e){Oe(e instanceof Error?e.message:String(e))}finally{D(!1)}},[e]);(0,x.useEffect)(()=>{Q()},[Q]),(0,x.useEffect)(()=>{e&&ye(e).then(Ae).catch(()=>{})},[e]),ge(e??null,(0,x.useCallback)(e=>{e.type.startsWith(`task:`)&&Q()},[Q])),(0,x.useEffect)(()=>{W&&setTimeout(()=>J.current?.focus(),50)},[W]);let Pe=e=>A(e),$=()=>{A(null),j(null)},Fe=async t=>{if(!k||!e)return;let n=C.find(e=>e.id===k);if(!n||n.status===t){$();return}w(e=>e.map(e=>e.id===k?{...e,status:t}:e)),$();try{await be(e,k,t)}catch{Q()}},Ie=async t=>{let n=K.trim();if(!(!n||!e)){q(``),G(null);try{await we(e,{title:n,status:t}),Q()}catch{}}},Le=async()=>{if(!(!Y||!e)){Z(!0);try{w(e=>e.filter(e=>e.id!==Y.id)),await ve(e,Y.id)}catch{Q()}finally{Z(!1),X(null)}}},Re=(0,x.useMemo)(()=>{let e=new Set;for(let t of C)t.tags?.forEach(t=>e.add(t));return[...e].sort()},[C]),ze=(0,x.useMemo)(()=>{let e=C;if(R){let t=R.toLowerCase();e=e.filter(e=>e.title.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t))}return B&&(e=e.filter(e=>e.priority===B)),H&&(e=e.filter(e=>e.tags?.includes(H))),N&&(e=e.filter(e=>e.assignee===N)),e},[C,R,B,H,N]),Be=(0,x.useMemo)(()=>{let e=new Map;for(let t of b)e.set(t.status,[]);for(let t of ze){let n=e.get(t.status);n&&n.push(t)}return e},[ze]),Ve=R||B||H||N;return(0,T.jsxs)(l,{children:[(0,T.jsx)(Se,{breadcrumbs:[{label:`Tasks`}],actions:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ie,{title:`Column visibility`,children:(0,T.jsx)(m,{onClick:e=>L(e.currentTarget),size:`small`,children:(0,T.jsx)(de,{fontSize:`small`})})}),(0,T.jsx)(ne,{anchorEl:I,open:!!I,onClose:()=>L(null),children:b.map(({status:e,label:t})=>(0,T.jsxs)(g,{onClick:()=>je(e),dense:!0,children:[(0,T.jsx)(te,{checked:F.has(e),disabled:F.has(e)&&F.size===1,size:`small`,sx:{p:0,mr:1}}),(0,T.jsx)(ee,{primary:t})]},e))}),S&&(0,T.jsx)(f,{variant:`contained`,startIcon:(0,T.jsx)(_,{}),onClick:()=>t(`new`),children:`New Task`})]})}),(0,T.jsxs)(l,{sx:{display:`flex`,alignItems:`center`,gap:1.5,px:2,py:1,bgcolor:n.custom.surfaceMuted,borderRadius:1,mb:2},children:[(0,T.jsx)(p,{size:`small`,placeholder:`Search tasks...`,value:R,onChange:e=>z(e.target.value),slotProps:{input:{startAdornment:(0,T.jsx)(o,{position:`start`,children:(0,T.jsx)(fe,{fontSize:`small`,sx:{color:n.custom.textMuted}})}),endAdornment:R?(0,T.jsx)(o,{position:`end`,children:(0,T.jsx)(m,{size:`small`,onClick:()=>z(``),children:(0,T.jsx)(v,{fontSize:`small`})})}):void 0}},sx:{minWidth:200,flex:1,maxWidth:350}}),(0,T.jsx)(s,{size:`small`,sx:{minWidth:120},children:(0,T.jsxs)(h,{value:B,onChange:e=>V(e.target.value),displayEmpty:!0,renderValue:e=>e?y(e):`Priority`,sx:{color:B?void 0:n.custom.textMuted},children:[(0,T.jsx)(g,{value:``,children:`All priorities`}),(0,T.jsx)(g,{value:`critical`,children:`Critical`}),(0,T.jsx)(g,{value:`high`,children:`High`}),(0,T.jsx)(g,{value:`medium`,children:`Medium`}),(0,T.jsx)(g,{value:`low`,children:`Low`})]})}),Re.length>0&&(0,T.jsx)(s,{size:`small`,sx:{minWidth:120},children:(0,T.jsxs)(h,{value:H,onChange:e=>U(e.target.value),displayEmpty:!0,renderValue:e=>e||`Tag`,sx:{color:H?void 0:n.custom.textMuted},children:[(0,T.jsx)(g,{value:``,children:`All tags`}),Re.map(e=>(0,T.jsx)(g,{value:e,children:e},e))]})}),M.length>0&&(0,T.jsx)(s,{size:`small`,sx:{minWidth:120},children:(0,T.jsxs)(h,{value:N,onChange:e=>P(e.target.value),displayEmpty:!0,renderValue:e=>e?M.find(t=>t.id===e)?.name||e:`Assignee`,sx:{color:N?void 0:n.custom.textMuted},children:[(0,T.jsx)(g,{value:``,children:`All`}),M.map(e=>(0,T.jsx)(g,{value:e.id,children:e.name||e.id},e.id))]})}),Ve&&(0,T.jsx)(f,{size:`small`,onClick:()=>{z(``),V(``),U(``),P(``)},children:`Clear`})]}),O&&(0,T.jsx)(re,{severity:`error`,sx:{mb:2},children:O}),E?(0,T.jsx)(l,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,T.jsx)(oe,{})}):C.length===0?(0,T.jsxs)(l,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,py:6},children:[(0,T.jsx)(pe,{sx:{fontSize:48,color:n.custom.textMuted,mb:2}}),(0,T.jsx)(a,{variant:`h6`,gutterBottom:!0,children:`No tasks yet`}),(0,T.jsx)(a,{variant:`body2`,sx:{color:n.custom.textMuted,mb:2},children:S?`Create your first task to get started`:`No tasks yet`}),S&&(0,T.jsx)(f,{variant:`contained`,startIcon:(0,T.jsx)(_,{}),onClick:()=>t(`new`),children:`New Task`})]}):(0,T.jsx)(l,{sx:{display:`flex`,gap:2,overflowX:`auto`,pb:2,maxHeight:`calc(100vh - 220px)`},children:Me.map(({status:e,label:r,color:i})=>{let o=Be.get(e),s=ke===e&&k!==null;return(0,T.jsxs)(d,{variant:`outlined`,sx:{minWidth:220,flex:1,display:`flex`,flexDirection:`column`,borderTop:`3px solid ${i}`,bgcolor:s?u(i,.06):n.custom.surfaceMuted,borderColor:s?i:void 0,borderStyle:s?`dashed`:void 0,transition:`background-color 0.15s, border-color 0.15s`},onDragOver:t=>{t.preventDefault(),j(e)},onDragEnter:()=>j(e),onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||j(null)},onDrop:()=>Fe(e),children:[(0,T.jsxs)(l,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,px:1.5,pt:1.5,pb:1},children:[(0,T.jsxs)(l,{sx:{display:`flex`,alignItems:`center`,gap:.75},children:[(0,T.jsx)(a,{variant:`subtitle2`,fontWeight:700,children:r}),(0,T.jsx)(a,{variant:`caption`,sx:{color:n.custom.textMuted},children:o.length})]}),S&&(0,T.jsx)(m,{size:`small`,onClick:()=>{G(e),q(``)},sx:{p:.25,color:n.custom.textMuted},children:(0,T.jsx)(_,{sx:{fontSize:18}})})]}),W===e&&(0,T.jsxs)(l,{sx:{display:`flex`,gap:.5,px:1.5,pb:1},children:[(0,T.jsx)(p,{inputRef:J,size:`small`,placeholder:`Task title...`,value:K,onChange:e=>q(e.target.value),onKeyDown:t=>{t.key===`Enter`&&Ie(e),t.key===`Escape`&&(G(null),q(``))},fullWidth:!0,sx:{"& .MuiInputBase-root":{fontSize:`0.85rem`}}}),(0,T.jsx)(m,{size:`small`,onClick:()=>{G(null),q(``)},children:(0,T.jsx)(v,{fontSize:`small`})})]}),(0,T.jsx)(ae,{spacing:1,sx:{flex:1,overflowY:`auto`,px:1.5,pb:1.5,minHeight:50,"&::-webkit-scrollbar":{width:4},"&::-webkit-scrollbar-thumb":{bgcolor:u(n.text.primary,.15),borderRadius:2}},children:o.map(e=>{let r=De(e.dueDate,e.status);return(0,T.jsxs)(d,{variant:`outlined`,draggable:S,onDragStart:S?()=>Pe(e.id):void 0,onDragEnd:S?$:void 0,onClick:()=>t(e.id),sx:{p:1.5,cursor:`pointer`,position:`relative`,bgcolor:n.custom.surface,"&:hover":{borderColor:`primary.main`},"&:hover .task-actions":{opacity:1},opacity:k===e.id?.5:1},children:[(0,T.jsxs)(l,{className:`task-actions`,sx:{position:`absolute`,top:4,right:4,display:`flex`,gap:.25,opacity:0,transition:`opacity 0.15s`,bgcolor:n.custom.surface,borderRadius:.5},children:[(0,T.jsx)(m,{size:`small`,onClick:n=>{n.stopPropagation(),t(`${e.id}/edit`)},sx:{p:.5},children:(0,T.jsx)(le,{sx:{fontSize:15}})}),S&&(0,T.jsx)(m,{size:`small`,onClick:t=>{t.stopPropagation(),X(e)},sx:{p:.5,color:`error.main`},children:(0,T.jsx)(ce,{sx:{fontSize:15}})})]}),(0,T.jsx)(l,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,mb:.5,pr:3},children:(0,T.jsx)(a,{variant:`body2`,fontWeight:600,sx:{flex:1},children:e.title})}),e.assignee&&(0,T.jsxs)(a,{variant:`caption`,color:`text.secondary`,sx:{display:`block`,mb:.5},children:[`@`,M.find(t=>t.id===e.assignee)?.name??e.assignee]}),(0,T.jsxs)(l,{sx:{display:`flex`,gap:.5,flexWrap:`wrap`,mb:e.description?.5:0},children:[(0,T.jsx)(me,{label:y(e.priority),color:Ce[e.priority],size:`small`}),e.estimate!=null&&(0,T.jsx)(c,{icon:(0,T.jsx)(ue,{sx:{fontSize:`14px !important`}}),label:`${e.estimate}h`,size:`small`,variant:`outlined`,sx:{height:20,"& .MuiChip-label":{px:.5,fontSize:`0.7rem`},"& .MuiChip-icon":{ml:.5}}}),r&&(0,T.jsx)(c,{label:r.label,size:`small`,color:r.color,sx:{height:20,"& .MuiChip-label":{px:.75,fontSize:`0.7rem`}}})]}),e.description&&(0,T.jsx)(a,{variant:`caption`,sx:{display:`block`,mb:.5,color:n.custom.textMuted},children:e.description.length>80?e.description.slice(0,80)+`...`:e.description}),e.tags?.length>0&&(0,T.jsx)(l,{sx:{mt:.5},children:(0,T.jsx)(he,{tags:e.tags})})]},e.id)})})]},e)})}),(0,T.jsx)(Te,{open:!!Y,title:`Delete Task`,message:`Are you sure you want to delete "${Y?.title}"? This action cannot be undone.`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:Le,onCancel:()=>X(null),loading:Ne})]})}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{O as t,k as n}from"./vendor-markdown-DngssFHR.js";import{c as r,l as i}from"./vendor-react-DxfYAwYK.js";import{$ as a,A as o,P as s,Y as c,a as l,c as u,d,k as f,l as p,nt as m,r as h,s as g,u as _,ut as v,v as y,y as b}from"./vendor-mui-DXUYJbRC.js";import"./vendor-md-editor-DC6xr_29.js";import{nt as x,st as S}from"./vendor-mui-icons-YtgP6dg2.js";import{A as C,F as w,T,j as E}from"./index-80sqSHwS.js";import{r as D}from"./api-DuX-0a_X.js";var O=e(n(),1),k=t(),A={docs:`primary`,code:`success`,knowledge:`warning`,tasks:`neutral`,skills:`primary`,files:`neutral`,context:`neutral`,"cross-graph":`error`};function j(){let{projectId:e}=i(),t=r(),{palette:n}=v(),[j,M]=(0,O.useState)([]),[N,P]=(0,O.useState)(!0),[F,I]=(0,O.useState)(``),[L,R]=(0,O.useState)(`all`);(0,O.useEffect)(()=>{e&&(P(!0),D(e).then(M).finally(()=>P(!1)))},[e]);let z=(0,O.useMemo)(()=>{let e=new Set(j.map(e=>e.category));return[`all`,...Array.from(e).sort()]},[j]),B=(0,O.useMemo)(()=>j.filter(e=>!(L!==`all`&&e.category!==L||F&&!e.name.toLowerCase().includes(F.toLowerCase())&&!e.description.toLowerCase().includes(F.toLowerCase()))),[j,F,L]),V=e=>{let t=e.inputSchema?.properties;return t?Object.keys(t).length:0};return N?(0,k.jsx)(c,{sx:{display:`flex`,justifyContent:`center`,py:8},children:(0,k.jsx)(m,{})}):(0,k.jsxs)(c,{children:[(0,k.jsx)(E,{breadcrumbs:[{label:`Tools`}]}),(0,k.jsxs)(C,{children:[(0,k.jsx)(h,{size:`small`,placeholder:`Search tools...`,value:F,onChange:e=>I(e.target.value),slotProps:{input:{startAdornment:(0,k.jsx)(o,{position:`start`,children:(0,k.jsx)(S,{fontSize:`small`})})}},sx:{minWidth:240}}),(0,k.jsxs)(s,{size:`small`,sx:{minWidth:140},children:[(0,k.jsx)(f,{children:`Category`}),(0,k.jsx)(y,{value:L,label:`Category`,onChange:e=>R(e.target.value),children:z.map(e=>(0,k.jsx)(b,{value:e,children:e===`all`?`All`:e},e))})]}),(0,k.jsxs)(a,{variant:`body2`,sx:{color:n.custom.textMuted,ml:`auto`},children:[B.length,` tool`,B.length===1?``:`s`]})]}),B.length===0?(0,k.jsx)(T,{icon:(0,k.jsx)(x,{}),title:`No tools found`,description:F||L!==`all`?`Try adjusting your filters`:`No MCP tools available for this project`}):(0,k.jsx)(u,{children:(0,k.jsxs)(d,{size:`small`,children:[(0,k.jsx)(g,{children:(0,k.jsxs)(l,{children:[(0,k.jsx)(p,{children:`Name`}),(0,k.jsx)(p,{children:`Category`}),(0,k.jsx)(p,{children:`Description`}),(0,k.jsx)(p,{align:`center`,children:`Params`})]})}),(0,k.jsx)(_,{children:B.map(r=>(0,k.jsxs)(l,{hover:!0,sx:{cursor:`pointer`},onClick:()=>t(`/${e}/tools/${r.name}`),children:[(0,k.jsx)(p,{children:(0,k.jsx)(a,{variant:`body2`,fontWeight:600,sx:{fontFamily:`monospace`},children:r.name})}),(0,k.jsx)(p,{children:(0,k.jsx)(w,{label:r.category,color:A[r.category]||`neutral`})}),(0,k.jsx)(p,{children:(0,k.jsx)(a,{variant:`body2`,sx:{color:n.custom.textMuted,maxWidth:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r.description})}),(0,k.jsx)(p,{align:`center`,children:(0,k.jsx)(a,{variant:`body2`,children:V(r)})})]},r.name))})]})})]})}export{j as default};
|