@graphmemory/server 1.3.1 → 1.3.2
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/index.js +21 -4
- package/dist/cli/index.js +3 -1
- package/dist/cli/indexer.js +36 -24
- package/dist/lib/jwt.js +2 -2
- package/dist/lib/multi-config.js +3 -1
- package/dist/lib/parsers/languages/typescript.js +11 -6
- package/dist/ui/assets/{NoteForm-aZX9f6-3.js → NoteForm-SQ0b93i0.js} +1 -1
- package/dist/ui/assets/{SkillForm-KYa3o92l.js → SkillForm-BVsGrNPb.js} +1 -1
- package/dist/ui/assets/{TaskForm-Bl5nkybO.js → TaskForm-DgPVeiI9.js} +1 -1
- package/dist/ui/assets/{_articleId_-DjbCByxM.js → _articleId_-FqdaSeYS.js} +1 -1
- package/dist/ui/assets/{_docId_-hdCDjclV.js → _docId_-Q0Wmjtp6.js} +1 -1
- package/dist/ui/assets/{_filePath_-CpG836v4.js → _filePath_-BR0gOT_z.js} +1 -1
- package/dist/ui/assets/{_noteId_-C1enaQd1.js → _noteId_-BMWd415J.js} +1 -1
- package/dist/ui/assets/{_skillId_-hPoCet7J.js → _skillId_-CsHgildJ.js} +1 -1
- package/dist/ui/assets/{_taskId_-DSB3dLVz.js → _taskId_-xDHTfbQw.js} +1 -1
- package/dist/ui/assets/{_toolName_-3SmCfxZy.js → _toolName_-BSa2uNSu.js} +1 -1
- package/dist/ui/assets/{attachments-CEQ-2nMo.js → attachments-NSvN5_0A.js} +1 -1
- package/dist/ui/assets/{docs-CrXsRcOG.js → docs-iUK8E40J.js} +1 -1
- package/dist/ui/assets/{edit-TUIIpUMF.js → edit-BzIJy_Oo.js} +1 -1
- package/dist/ui/assets/{edit-BYiy1FZy.js → edit-Dnc067B2.js} +1 -1
- package/dist/ui/assets/{edit-hc-ZWz3y.js → edit-U_UEI361.js} +1 -1
- package/dist/ui/assets/{files-0bPg6NH9.js → files-B4svJUZh.js} +1 -1
- package/dist/ui/assets/{graph-DXGud_wF.js → graph-CcNP1ckP.js} +1 -1
- package/dist/ui/assets/{help-DJ52_fxN.js → help-BJZZtKAR.js} +1 -1
- package/dist/ui/assets/{help-CEMQqZUR.js → help-D6XKMuzk.js} +16 -4
- package/dist/ui/assets/index-CEweXD9O.js +2 -0
- package/dist/ui/assets/{knowledge-DeygeGGH.js → knowledge-CV99ToEV.js} +1 -1
- package/dist/ui/assets/{new-CpD7hOBA.js → new-BypesKiP.js} +1 -1
- package/dist/ui/assets/{new-s8c0M75X.js → new-Dcx8wlp4.js} +1 -1
- package/dist/ui/assets/{new-DHTg3Dqq.js → new-Sq3NY2oa.js} +1 -1
- package/dist/ui/assets/{prompts-BgOmdxgM.js → prompts-DbsIe3Pm.js} +1 -1
- package/dist/ui/assets/{search-EpJhdP2a.js → search-D87r7lIL.js} +1 -1
- package/dist/ui/assets/{skill-y9pizyqE.js → skill-BltAsz7M.js} +1 -1
- package/dist/ui/assets/{skills-Cga9iUZN.js → skills-Dtmg2kDA.js} +1 -1
- package/dist/ui/assets/{tasks-CobouTKV.js → tasks-BRqIwKCG.js} +1 -1
- package/dist/ui/assets/{tools-JxKH5BDF.js → tools-CM3gQ4TK.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/index-BCZDAYZi.js +0 -2
package/dist/api/rest/index.js
CHANGED
|
@@ -47,7 +47,7 @@ function createRestApp(projectManager, options) {
|
|
|
47
47
|
const users = options?.users ?? {};
|
|
48
48
|
const hasUsers = Object.keys(users).length > 0;
|
|
49
49
|
const corsOrigins = serverConfig?.corsOrigins;
|
|
50
|
-
app.use((0, cors_1.default)(corsOrigins?.length ? { origin: corsOrigins, credentials: true } : {}));
|
|
50
|
+
app.use((0, cors_1.default)(corsOrigins?.length ? { origin: corsOrigins, credentials: true } : { credentials: true }));
|
|
51
51
|
app.use(express_1.default.json({ limit: '10mb' }));
|
|
52
52
|
app.use((0, cookie_parser_1.default)());
|
|
53
53
|
// Security headers
|
|
@@ -76,6 +76,7 @@ function createRestApp(projectManager, options) {
|
|
|
76
76
|
app.use('/api/auth/login', (0, express_rate_limit_1.default)({ windowMs: defaults_1.RATE_LIMIT_WINDOW_MS, max: rl.auth, standardHeaders: true, legacyHeaders: false, message: rateLimitMsg }));
|
|
77
77
|
}
|
|
78
78
|
const jwtSecret = serverConfig?.jwtSecret;
|
|
79
|
+
const cookieSecure = serverConfig?.cookieSecure;
|
|
79
80
|
const accessTokenTtl = serverConfig?.accessTokenTtl ?? '15m';
|
|
80
81
|
const refreshTokenTtl = serverConfig?.refreshTokenTtl ?? '7d';
|
|
81
82
|
// --- Auth endpoints (before auth middleware — always accessible) ---
|
|
@@ -90,7 +91,7 @@ function createRestApp(projectManager, options) {
|
|
|
90
91
|
const payload = (0, jwt_1.verifyToken)(accessToken, jwtSecret);
|
|
91
92
|
if (payload?.type === 'access' && users[payload.userId]) {
|
|
92
93
|
const user = users[payload.userId];
|
|
93
|
-
return res.json({ required: true, authenticated: true, userId: payload.userId, name: user.name
|
|
94
|
+
return res.json({ required: true, authenticated: true, userId: payload.userId, name: user.name });
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}
|
|
@@ -103,6 +104,22 @@ function createRestApp(projectManager, options) {
|
|
|
103
104
|
}
|
|
104
105
|
return res.json({ required: true, authenticated: false });
|
|
105
106
|
});
|
|
107
|
+
// API key retrieval: requires valid JWT cookie (not exposed in /status)
|
|
108
|
+
app.get('/api/auth/apikey', (req, res) => {
|
|
109
|
+
if (!hasUsers || !jwtSecret) {
|
|
110
|
+
return res.status(400).json({ error: 'Authentication not configured' });
|
|
111
|
+
}
|
|
112
|
+
const accessToken = (0, jwt_1.getAccessToken)(req);
|
|
113
|
+
if (!accessToken) {
|
|
114
|
+
return res.status(401).json({ error: 'Authentication required' });
|
|
115
|
+
}
|
|
116
|
+
const payload = (0, jwt_1.verifyToken)(accessToken, jwtSecret);
|
|
117
|
+
if (!payload || payload.type !== 'access' || !users[payload.userId]) {
|
|
118
|
+
return res.status(401).json({ error: 'Invalid or expired token' });
|
|
119
|
+
}
|
|
120
|
+
const user = users[payload.userId];
|
|
121
|
+
res.json({ apiKey: user.apiKey ?? null });
|
|
122
|
+
});
|
|
106
123
|
// Login: email + password → set JWT cookies
|
|
107
124
|
app.post('/api/auth/login', async (req, res) => {
|
|
108
125
|
if (!hasUsers || !jwtSecret) {
|
|
@@ -122,7 +139,7 @@ function createRestApp(projectManager, options) {
|
|
|
122
139
|
}
|
|
123
140
|
const accessToken = (0, jwt_1.signAccessToken)(result.userId, jwtSecret, accessTokenTtl);
|
|
124
141
|
const refreshToken = (0, jwt_1.signRefreshToken)(result.userId, jwtSecret, refreshTokenTtl);
|
|
125
|
-
(0, jwt_1.setAuthCookies)(res, accessToken, refreshToken, accessTokenTtl, refreshTokenTtl);
|
|
142
|
+
(0, jwt_1.setAuthCookies)(res, accessToken, refreshToken, accessTokenTtl, refreshTokenTtl, cookieSecure);
|
|
126
143
|
res.json({ userId: result.userId, name: result.user.name });
|
|
127
144
|
});
|
|
128
145
|
// Refresh: refresh cookie → new access cookie
|
|
@@ -145,7 +162,7 @@ function createRestApp(projectManager, options) {
|
|
|
145
162
|
}
|
|
146
163
|
const newAccessToken = (0, jwt_1.signAccessToken)(payload.userId, jwtSecret, accessTokenTtl);
|
|
147
164
|
const newRefreshToken = (0, jwt_1.signRefreshToken)(payload.userId, jwtSecret, refreshTokenTtl);
|
|
148
|
-
(0, jwt_1.setAuthCookies)(res, newAccessToken, newRefreshToken, accessTokenTtl, refreshTokenTtl);
|
|
165
|
+
(0, jwt_1.setAuthCookies)(res, newAccessToken, newRefreshToken, accessTokenTtl, refreshTokenTtl, cookieSecure);
|
|
149
166
|
res.json({ userId: payload.userId, name: users[payload.userId].name });
|
|
150
167
|
});
|
|
151
168
|
// Logout: clear cookies
|
package/dist/cli/index.js
CHANGED
|
@@ -16,10 +16,12 @@ const embedder_1 = require("../lib/embedder");
|
|
|
16
16
|
const index_1 = require("../api/index");
|
|
17
17
|
const defaults_1 = require("../lib/defaults");
|
|
18
18
|
const program = new commander_1.Command();
|
|
19
|
+
const pkgJsonPath = path_1.default.resolve(__dirname, '../../package.json');
|
|
20
|
+
const pkgVersion = JSON.parse(fs_1.default.readFileSync(pkgJsonPath, 'utf-8')).version;
|
|
19
21
|
program
|
|
20
22
|
.name('graphmemory')
|
|
21
23
|
.description('MCP server for semantic graph memory from markdown docs and source code')
|
|
22
|
-
.version(
|
|
24
|
+
.version(pkgVersion);
|
|
23
25
|
const parseIntArg = (v) => parseInt(v, 10);
|
|
24
26
|
// ---------------------------------------------------------------------------
|
|
25
27
|
// Helper: load config from file, or fall back to default (cwd as single project)
|
package/dist/cli/indexer.js
CHANGED
|
@@ -208,7 +208,9 @@ function createProjectIndexer(docGraph, codeGraph, config, knowledgeGraph, fileI
|
|
|
208
208
|
}
|
|
209
209
|
function dispatchAdd(absolutePath) {
|
|
210
210
|
const rel = path_1.default.relative(config.projectDir, absolutePath);
|
|
211
|
-
if (config.docsInclude && !isExcluded(rel, docsExclude) && micromatch_1.default.isMatch(rel, config.docsInclude)) {
|
|
211
|
+
if (docGraph && config.docsInclude && !isExcluded(rel, docsExclude) && micromatch_1.default.isMatch(rel, config.docsInclude)) {
|
|
212
|
+
if (rel.endsWith('.md'))
|
|
213
|
+
(0, docs_1.clearWikiIndexCache)(config.projectDir);
|
|
212
214
|
enqueueDoc(() => indexDocFile(absolutePath));
|
|
213
215
|
}
|
|
214
216
|
if (codeGraph && config.codeInclude && !isExcluded(rel, codeExclude) && micromatch_1.default.isMatch(rel, config.codeInclude)) {
|
|
@@ -221,33 +223,43 @@ function createProjectIndexer(docGraph, codeGraph, config, knowledgeGraph, fileI
|
|
|
221
223
|
function dispatchRemove(absolutePath) {
|
|
222
224
|
const rel = path_1.default.relative(config.projectDir, absolutePath);
|
|
223
225
|
if (docGraph && config.docsInclude && !isExcluded(rel, docsExclude) && micromatch_1.default.isMatch(rel, config.docsInclude)) {
|
|
224
|
-
(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
(0,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
if (rel.endsWith('.md'))
|
|
227
|
+
(0, docs_1.clearWikiIndexCache)(config.projectDir);
|
|
228
|
+
// Enqueue removal to avoid racing with in-flight indexDocFile tasks
|
|
229
|
+
enqueueDoc(async () => {
|
|
230
|
+
(0, docs_2.removeFile)(docGraph, rel);
|
|
231
|
+
if (knowledgeGraph)
|
|
232
|
+
(0, knowledge_1.cleanupProxies)(knowledgeGraph, 'docs', docGraph, config.projectId);
|
|
233
|
+
if (taskGraph)
|
|
234
|
+
(0, task_1.cleanupProxies)(taskGraph, 'docs', docGraph, config.projectId);
|
|
235
|
+
if (skillGraph)
|
|
236
|
+
(0, skill_1.cleanupProxies)(skillGraph, 'docs', docGraph, config.projectId);
|
|
237
|
+
process.stderr.write(`[indexer] removed doc ${rel}\n`);
|
|
238
|
+
});
|
|
232
239
|
}
|
|
233
240
|
if (codeGraph && config.codeInclude && !isExcluded(rel, codeExclude) && micromatch_1.default.isMatch(rel, config.codeInclude)) {
|
|
234
|
-
(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
enqueueCode(async () => {
|
|
242
|
+
(0, code_2.removeCodeFile)(codeGraph, rel);
|
|
243
|
+
if (knowledgeGraph)
|
|
244
|
+
(0, knowledge_1.cleanupProxies)(knowledgeGraph, 'code', codeGraph, config.projectId);
|
|
245
|
+
if (taskGraph)
|
|
246
|
+
(0, task_1.cleanupProxies)(taskGraph, 'code', codeGraph, config.projectId);
|
|
247
|
+
if (skillGraph)
|
|
248
|
+
(0, skill_1.cleanupProxies)(skillGraph, 'code', codeGraph, config.projectId);
|
|
249
|
+
process.stderr.write(`[indexer] removed code ${rel}\n`);
|
|
250
|
+
});
|
|
242
251
|
}
|
|
243
252
|
if (fileIndexGraph && !isExcluded(rel, filesExclude)) {
|
|
244
|
-
(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
253
|
+
enqueueFile(async () => {
|
|
254
|
+
(0, file_index_1.removeFileEntry)(fileIndexGraph, rel);
|
|
255
|
+
if (knowledgeGraph)
|
|
256
|
+
(0, knowledge_1.cleanupProxies)(knowledgeGraph, 'files', fileIndexGraph, config.projectId);
|
|
257
|
+
if (taskGraph)
|
|
258
|
+
(0, task_1.cleanupProxies)(taskGraph, 'files', fileIndexGraph, config.projectId);
|
|
259
|
+
if (skillGraph)
|
|
260
|
+
(0, skill_1.cleanupProxies)(skillGraph, 'files', fileIndexGraph, config.projectId);
|
|
261
|
+
process.stderr.write(`[indexer] removed file ${rel}\n`);
|
|
262
|
+
});
|
|
251
263
|
}
|
|
252
264
|
}
|
|
253
265
|
// ---------------------------------------------------------------------------
|
package/dist/lib/jwt.js
CHANGED
|
@@ -107,8 +107,8 @@ function verifyToken(token, secret) {
|
|
|
107
107
|
// ---------------------------------------------------------------------------
|
|
108
108
|
const ACCESS_COOKIE = 'mgm_access';
|
|
109
109
|
const REFRESH_COOKIE = 'mgm_refresh';
|
|
110
|
-
function setAuthCookies(res, accessToken, refreshToken, accessTtl, refreshTtl) {
|
|
111
|
-
const secure = process.env.NODE_ENV !== 'development';
|
|
110
|
+
function setAuthCookies(res, accessToken, refreshToken, accessTtl, refreshTtl, secureCookie) {
|
|
111
|
+
const secure = secureCookie ?? process.env.NODE_ENV !== 'development';
|
|
112
112
|
res.cookie(ACCESS_COOKIE, accessToken, {
|
|
113
113
|
httpOnly: true,
|
|
114
114
|
secure,
|
package/dist/lib/multi-config.js
CHANGED
|
@@ -100,6 +100,7 @@ const serverSchema = zod_1.z.object({
|
|
|
100
100
|
defaultAccess: accessLevelSchema.optional(),
|
|
101
101
|
access: accessMapSchema,
|
|
102
102
|
jwtSecret: zod_1.z.string().min(16).optional(),
|
|
103
|
+
cookieSecure: zod_1.z.boolean().optional(),
|
|
103
104
|
accessTokenTtl: zod_1.z.string().optional(),
|
|
104
105
|
refreshTokenTtl: zod_1.z.string().optional(),
|
|
105
106
|
rateLimit: rateLimitSchema.optional(),
|
|
@@ -196,7 +197,7 @@ const SERVER_DEFAULTS = {
|
|
|
196
197
|
};
|
|
197
198
|
const PROJECT_DEFAULTS = {
|
|
198
199
|
docsInclude: '**/*.md',
|
|
199
|
-
codeInclude: '**/*.{js,ts,jsx,tsx}',
|
|
200
|
+
codeInclude: '**/*.{js,ts,jsx,tsx,mjs,mts,cjs,cts}',
|
|
200
201
|
chunkDepth: 4,
|
|
201
202
|
};
|
|
202
203
|
/** Parse comma-separated exclude string into array of patterns. */
|
|
@@ -268,6 +269,7 @@ function loadMultiConfig(yamlPath) {
|
|
|
268
269
|
defaultAccess: srv.defaultAccess ?? SERVER_DEFAULTS.defaultAccess,
|
|
269
270
|
access: srv.access ?? undefined,
|
|
270
271
|
jwtSecret: srv.jwtSecret,
|
|
272
|
+
cookieSecure: srv.cookieSecure,
|
|
271
273
|
accessTokenTtl: srv.accessTokenTtl ?? SERVER_DEFAULTS.accessTokenTtl,
|
|
272
274
|
refreshTokenTtl: srv.refreshTokenTtl ?? SERVER_DEFAULTS.refreshTokenTtl,
|
|
273
275
|
rateLimit: {
|
|
@@ -33,14 +33,19 @@ function sliceBeforeBody(outerNode, bodyNode) {
|
|
|
33
33
|
const relativeRow = bodyStartRow - outerStartRow;
|
|
34
34
|
const beforeBody = lines.slice(0, relativeRow);
|
|
35
35
|
const bodyLine = lines[relativeRow] ?? '';
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
// Use bodyNode.startPosition.column to find the exact body brace position,
|
|
37
|
+
// avoiding false matches on '{' in parameter destructuring or type annotations.
|
|
38
|
+
const col = bodyNode.startPosition.column;
|
|
39
|
+
if (col > 0)
|
|
40
|
+
beforeBody.push(bodyLine.slice(0, col));
|
|
39
41
|
return beforeBody.join('\n');
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
// Single-line case: body starts on the same line as the declaration.
|
|
44
|
+
// Use column offset to slice precisely instead of indexOf('{') which
|
|
45
|
+
// would match '{' in destructured params like `({ data }) => {`.
|
|
46
|
+
const col = bodyNode.startPosition.column - outerNode.startPosition.column;
|
|
47
|
+
if (col > 0)
|
|
48
|
+
return text.slice(0, col);
|
|
44
49
|
return null;
|
|
45
50
|
}
|
|
46
51
|
/**
|
|
@@ -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{Y as r,nt as i,q as a,r as o}from"./vendor-mui-BPj7d3Sw.js";import{D as s,E as c,I as l,O as u,P as d,S as f}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,O as n}from"./vendor-markdown-CT8ZVEPu.js";import{Y as r,nt as i,q as a,r as o}from"./vendor-mui-BPj7d3Sw.js";import{D as s,E as c,I as l,O as u,P as d,S as f}from"./index-CEweXD9O.js";var p=e(n(),1),m=t();function h({note:e,onSubmit:t,onCancel:n,submitLabel:h=`Save`}){let[g,_]=(0,p.useState)(``),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)([]),[S,C]=(0,p.useState)(!1),[w,T]=(0,p.useState)(!1);(0,p.useEffect)(()=>{e&&(_(e.title),y(e.content),x(e.tags??[]))},[e]);let E=async()=>{if(!g.trim()){T(!0);return}C(!0);try{await t({title:g.trim(),content:v.trim(),tags:b})}finally{C(!1)}};return(0,m.jsxs)(r,{component:`form`,id:`note-form`,onSubmit:e=>{e.preventDefault(),E()},sx:{display:`flex`,flexDirection:`column`,gap:3},children:[(0,m.jsx)(l,{title:`Details`,children:(0,m.jsxs)(u,{children:[(0,m.jsxs)(s,{fullWidth:!0,children:[(0,m.jsx)(c,{required:!0,children:`Title`}),(0,m.jsx)(o,{autoFocus:!0,fullWidth:!0,value:g,onChange:e=>{_(e.target.value),T(!1)},error:w,helperText:w?`Title is required`:void 0})]}),(0,m.jsxs)(s,{fullWidth:!0,children:[(0,m.jsx)(c,{children:`Content`}),(0,m.jsx)(f,{value:v,onChange:y,height:300})]}),(0,m.jsx)(s,{fullWidth:!0,children:(0,m.jsx)(d,{tags:b,editable:!0,onAdd:e=>x(t=>t.includes(e)?t:[...t,e]),onRemove:e=>x(t=>t.filter(t=>t!==e))})})]})}),(0,m.jsxs)(r,{sx:{display:`flex`,gap:1,justifyContent:`flex-end`},children:[(0,m.jsx)(a,{onClick:n,children:`Cancel`}),(0,m.jsx)(a,{variant:`contained`,onClick:E,disabled:S||!g.trim(),children:S?(0,m.jsx)(i,{size:20}):h})]})]})}export{h as t};
|
|
@@ -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{$ as r,Y as i,_ as a,nt as o,q as s,r as c,tt as l,v as u,y as d}from"./vendor-mui-BPj7d3Sw.js";import{K as f,i as p}from"./vendor-mui-icons-B196sG3f.js";import{D as m,E as h,I as g,O as _,P as v,S as y}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,O as n}from"./vendor-markdown-CT8ZVEPu.js";import{$ as r,Y as i,_ as a,nt as o,q as s,r as c,tt as l,v as u,y as d}from"./vendor-mui-BPj7d3Sw.js";import{K as f,i as p}from"./vendor-mui-icons-B196sG3f.js";import{D as m,E as h,I as g,O as _,P as v,S as y}from"./index-CEweXD9O.js";var b=e(n(),1),x=t();function S({skill:e,onSubmit:t,onCancel:n,submitLabel:S=`Save`}){let[C,w]=(0,b.useState)(``),[T,E]=(0,b.useState)(``),[D,O]=(0,b.useState)([``]),[k,A]=(0,b.useState)([]),[j,M]=(0,b.useState)([]),[N,P]=(0,b.useState)([]),[F,I]=(0,b.useState)([]),[L,R]=(0,b.useState)(`user`),[z,B]=(0,b.useState)(1),[V,H]=(0,b.useState)(!1),[U,W]=(0,b.useState)(!1);(0,b.useEffect)(()=>{e&&(w(e.title),E(e.description),O(e.steps.length>0?e.steps:[``]),A(e.triggers??[]),M(e.inputHints??[]),P(e.filePatterns??[]),I(e.tags??[]),R(e.source),B(e.confidence))},[e]);let G=async()=>{if(!C.trim()){W(!0);return}H(!0);try{await t({title:C.trim(),description:T.trim(),steps:D.map(e=>e.trim()).filter(Boolean),triggers:k,inputHints:j,filePatterns:N,tags:F,source:L,confidence:z})}finally{H(!1)}},K=(e,t)=>{O(n=>n.map((n,r)=>r===e?t:n))},q=()=>{O(e=>[...e,``])},J=e=>{O(t=>t.filter((t,n)=>n!==e))};return(0,x.jsxs)(i,{component:`form`,id:`skill-form`,onSubmit:e=>{e.preventDefault(),G()},sx:{display:`flex`,flexDirection:`column`,gap:3},children:[(0,x.jsx)(g,{title:`Details`,children:(0,x.jsxs)(_,{children:[(0,x.jsxs)(m,{fullWidth:!0,children:[(0,x.jsx)(h,{required:!0,children:`Title`}),(0,x.jsx)(c,{autoFocus:!0,fullWidth:!0,value:C,onChange:e=>{w(e.target.value),W(!1)},error:U,helperText:U?`Title is required`:void 0})]}),(0,x.jsxs)(m,{fullWidth:!0,children:[(0,x.jsx)(h,{children:`Description`}),(0,x.jsx)(y,{value:T,onChange:E,height:200})]})]})}),(0,x.jsx)(g,{title:`Steps`,children:(0,x.jsxs)(i,{sx:{display:`flex`,flexDirection:`column`,gap:1},children:[D.map((e,t)=>(0,x.jsxs)(i,{sx:{display:`flex`,gap:1,alignItems:`center`},children:[(0,x.jsxs)(r,{variant:`body2`,sx:{minWidth:24,color:`text.secondary`},children:[t+1,`.`]}),(0,x.jsx)(c,{fullWidth:!0,size:`small`,value:e,onChange:e=>K(t,e.target.value),placeholder:`Step ${t+1}`}),D.length>1&&(0,x.jsx)(l,{size:`small`,onClick:()=>J(t),color:`error`,children:(0,x.jsx)(p,{fontSize:`small`})})]},t)),(0,x.jsx)(s,{size:`small`,startIcon:(0,x.jsx)(f,{}),onClick:q,sx:{alignSelf:`flex-start`},children:`Add Step`})]})}),(0,x.jsx)(g,{title:`Matching`,children:(0,x.jsxs)(_,{children:[(0,x.jsxs)(m,{fullWidth:!0,children:[(0,x.jsx)(h,{children:`Triggers`}),(0,x.jsx)(v,{tags:k,editable:!0,onAdd:e=>A(t=>t.includes(e)?t:[...t,e]),onRemove:e=>A(t=>t.filter(t=>t!==e))})]}),(0,x.jsxs)(m,{fullWidth:!0,children:[(0,x.jsx)(h,{children:`Input Hints`}),(0,x.jsx)(v,{tags:j,editable:!0,onAdd:e=>M(t=>t.includes(e)?t:[...t,e]),onRemove:e=>M(t=>t.filter(t=>t!==e))})]}),(0,x.jsxs)(m,{fullWidth:!0,children:[(0,x.jsx)(h,{children:`File Patterns`}),(0,x.jsx)(v,{tags:N,editable:!0,onAdd:e=>P(t=>t.includes(e)?t:[...t,e]),onRemove:e=>P(t=>t.filter(t=>t!==e))})]})]})}),(0,x.jsx)(g,{title:`Properties`,children:(0,x.jsxs)(_,{children:[(0,x.jsxs)(m,{children:[(0,x.jsx)(h,{children:`Source`}),(0,x.jsxs)(u,{fullWidth:!0,value:L,onChange:e=>R(e.target.value),children:[(0,x.jsx)(d,{value:`user`,children:`User`}),(0,x.jsx)(d,{value:`learned`,children:`Learned`})]})]}),(0,x.jsx)(m,{children:(0,x.jsxs)(i,{sx:{px:1},children:[(0,x.jsxs)(h,{children:[`Confidence: `,Math.round(z*100),`%`]}),(0,x.jsx)(a,{value:z,onChange:(e,t)=>B(t),min:0,max:1,step:.01,valueLabelDisplay:`auto`,valueLabelFormat:e=>`${Math.round(e*100)}%`})]})}),(0,x.jsx)(m,{fullWidth:!0,children:(0,x.jsx)(v,{tags:F,editable:!0,onAdd:e=>I(t=>t.includes(e)?t:[...t,e]),onRemove:e=>I(t=>t.filter(t=>t!==e))})})]})}),(0,x.jsxs)(i,{sx:{display:`flex`,gap:1,justifyContent:`flex-end`},children:[(0,x.jsx)(s,{onClick:n,children:`Cancel`}),(0,x.jsx)(s,{variant:`contained`,onClick:G,disabled:V||!C.trim(),children:V?(0,x.jsx)(o,{size:20}):S})]})]})}export{S as t};
|
|
@@ -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{l as r}from"./vendor-react-CHUjhoxh.js";import{Y as i,nt as a,q as o,r as s,v as c,y as l}from"./vendor-mui-BPj7d3Sw.js";import{D as u,E as d,I as f,O as p,P as m,S as h,et as g,t as _}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{D as t,O as n}from"./vendor-markdown-CT8ZVEPu.js";import{l as r}from"./vendor-react-CHUjhoxh.js";import{Y as i,nt as a,q as o,r as s,v as c,y as l}from"./vendor-mui-BPj7d3Sw.js";import{D as u,E as d,I as f,O as p,P as m,S as h,et as g,t as _}from"./index-CEweXD9O.js";var v=e(n(),1),y=t();function b({task:e,onSubmit:t,onCancel:n,submitLabel:b=`Save`}){let{projectId:x}=r(),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(`todo`),[O,k]=(0,v.useState)(`medium`),[A,j]=(0,v.useState)([]),[M,N]=(0,v.useState)(``),[P,F]=(0,v.useState)(``),[I,L]=(0,v.useState)(``),[R,z]=(0,v.useState)([]),[B,V]=(0,v.useState)(!1),[H,U]=(0,v.useState)(!1);(0,v.useEffect)(()=>{e&&(C(e.title),T(e.description),D(e.status),k(e.priority),j(e.tags??[]),N(e.dueDate?new Date(e.dueDate).toISOString().split(`T`)[0]:``),F(e.estimate==null?``:String(e.estimate)),L(e.assignee??``))},[e]),(0,v.useEffect)(()=>{x&&g(x).then(z).catch(()=>{})},[x]);let W=async()=>{if(!S.trim()){U(!0);return}V(!0);try{await t({title:S.trim(),description:w.trim(),status:E,priority:O,tags:A,dueDate:M?new Date(M).getTime():null,estimate:P?Number(P):null,assignee:I||null})}finally{V(!1)}};return(0,y.jsxs)(i,{component:`form`,id:`task-form`,onSubmit:e=>{e.preventDefault(),W()},sx:{display:`flex`,flexDirection:`column`,gap:3},children:[(0,y.jsx)(f,{title:`Details`,children:(0,y.jsxs)(p,{children:[(0,y.jsxs)(u,{fullWidth:!0,children:[(0,y.jsx)(d,{required:!0,children:`Title`}),(0,y.jsx)(s,{autoFocus:!0,fullWidth:!0,value:S,onChange:e=>{C(e.target.value),U(!1)},error:H,helperText:H?`Title is required`:void 0})]}),(0,y.jsxs)(u,{fullWidth:!0,children:[(0,y.jsx)(d,{children:`Description`}),(0,y.jsx)(h,{value:w,onChange:T,height:250})]})]})}),(0,y.jsx)(f,{title:`Properties`,children:(0,y.jsxs)(p,{children:[(0,y.jsxs)(u,{children:[(0,y.jsx)(d,{children:`Status`}),(0,y.jsx)(c,{fullWidth:!0,value:E,onChange:e=>D(e.target.value),children:_.map(e=>(0,y.jsx)(l,{value:e.status,children:e.label},e.status))})]}),(0,y.jsxs)(u,{children:[(0,y.jsx)(d,{children:`Priority`}),(0,y.jsxs)(c,{fullWidth:!0,value:O,onChange:e=>k(e.target.value),children:[(0,y.jsx)(l,{value:`critical`,children:`Critical`}),(0,y.jsx)(l,{value:`high`,children:`High`}),(0,y.jsx)(l,{value:`medium`,children:`Medium`}),(0,y.jsx)(l,{value:`low`,children:`Low`})]})]}),(0,y.jsxs)(u,{children:[(0,y.jsx)(d,{children:`Due Date`}),(0,y.jsx)(s,{fullWidth:!0,type:`date`,value:M,onChange:e=>N(e.target.value)})]}),(0,y.jsxs)(u,{children:[(0,y.jsx)(d,{children:`Estimate (hours)`}),(0,y.jsx)(s,{fullWidth:!0,type:`number`,value:P,onChange:e=>F(e.target.value),slotProps:{input:{inputProps:{min:0,step:.5}}}})]}),(0,y.jsxs)(u,{children:[(0,y.jsx)(d,{children:`Assignee`}),(0,y.jsxs)(c,{fullWidth:!0,value:I,onChange:e=>L(e.target.value),displayEmpty:!0,renderValue:e=>e?R.find(t=>t.id===e)?.name||e:`Unassigned`,children:[(0,y.jsx)(l,{value:``,children:`Unassigned`}),R.map(e=>(0,y.jsx)(l,{value:e.id,children:e.name||e.id},e.id))]})]}),(0,y.jsx)(u,{fullWidth:!0,children:(0,y.jsx)(m,{tags:A,editable:!0,onAdd:e=>j(t=>t.includes(e)?t:[...t,e]),onRemove:e=>j(t=>t.filter(t=>t!==e))})})]})}),(0,y.jsxs)(i,{sx:{display:`flex`,gap:1,justifyContent:`flex-end`},children:[(0,y.jsx)(o,{onClick:n,children:`Cancel`}),(0,y.jsx)(o,{variant:`contained`,onClick:W,disabled:B||!S.trim(),children:B?(0,y.jsx)(a,{size:20}):b})]})]})}export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e}from"./vendor-markdown-CT8ZVEPu.js";import{c as t,l as n}from"./vendor-react-CHUjhoxh.js";import{$ as r,X as i,Y as a,ut as o}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{nt as s,tt as c}from"./vendor-mui-icons-B196sG3f.js";import{C as l,F as u,I as d,T as f,j as p}from"./index-
|
|
1
|
+
import{D as e}from"./vendor-markdown-CT8ZVEPu.js";import{c as t,l as n}from"./vendor-react-CHUjhoxh.js";import{$ as r,X as i,Y as a,ut as o}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{nt as s,tt as c}from"./vendor-mui-icons-B196sG3f.js";import{C as l,F as u,I as d,T as f,j as p}from"./index-CEweXD9O.js";import{t as m}from"./help-D6XKMuzk.js";var h=e(),g={overview:`primary`,concept:`warning`,guide:`success`};function _(){let{projectId:e,articleId:_}=n(),v=t(),{palette:y}=o(),b=_?m(_):void 0;return b?(0,h.jsxs)(a,{children:[(0,h.jsx)(p,{breadcrumbs:[{label:`Help`,to:`/${e}/help`},{label:b.title}]}),(0,h.jsxs)(a,{sx:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,h.jsxs)(a,{sx:{display:`flex`,alignItems:`center`,gap:1.5,mb:1},children:[(0,h.jsx)(u,{label:b.category===`overview`?`Overview`:b.category===`concept`?`Concept`:`Guide`,color:g[b.category]||`primary`}),(0,h.jsx)(r,{variant:`body2`,sx:{color:y.custom.textMuted},children:b.summary})]}),(0,h.jsx)(d,{title:`Article`,children:(0,h.jsx)(l,{children:b.content})}),b.relatedTools.length>0&&(0,h.jsx)(d,{title:`Related Tools`,children:(0,h.jsx)(a,{sx:{display:`flex`,flexWrap:`wrap`,gap:1},children:b.relatedTools.map(t=>(0,h.jsx)(i,{icon:(0,h.jsx)(s,{}),label:t,size:`small`,variant:`outlined`,clickable:!0,onClick:()=>v(`/${e}/tools/${t}`),sx:{fontFamily:`monospace`}},t))})})]})]}):(0,h.jsxs)(a,{children:[(0,h.jsx)(p,{breadcrumbs:[{label:`Help`,to:`/${e}/help`},{label:`Not Found`}]}),(0,h.jsx)(f,{icon:(0,h.jsx)(c,{}),title:`Article not found`})]})}export{_ 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,D as o,E as s,O as c,S as l,Y as u,et as d,nt as f,ut as p}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{I as m,N as h,P as g,j as _,k as v}from"./index-
|
|
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,D as o,E as s,O as c,S as l,Y as u,et as d,nt as f,ut as p}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{I as m,N as h,P as g,j as _,k as v}from"./index-CEweXD9O.js";import{n as y,t as b}from"./api-BlFF6gX-.js";var x=e(n(),1),S=t();function C(){let{projectId:e,docId:t}=i(),n=r(),{palette:C}=p(),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)([]),[O,k]=(0,x.useState)(!0),[A,j]=(0,x.useState)(null);if((0,x.useEffect)(()=>{if(!e||!t)return;k(!0);let n=decodeURIComponent(t);Promise.all([b(e,n),b(e,n).then(t=>y(e,t.fileId).catch(()=>[]))]).then(([e,t])=>{T(e),D(t),j(null)}).catch(e=>j(e instanceof Error?e.message:String(e))).finally(()=>k(!1))},[e,t]),O)return(0,S.jsx)(u,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,S.jsx)(f,{})});if(A||!w)return(0,S.jsx)(d,{severity:`error`,children:A||`Doc node not found`});let M=decodeURIComponent(t);return(0,S.jsxs)(u,{children:[(0,S.jsx)(_,{breadcrumbs:[{label:`Docs`,to:`/${e}/docs`},{label:w.title||w.id}]}),(0,S.jsxs)(m,{title:`Details`,sx:{mb:3},children:[(0,S.jsx)(v,{label:`ID`,children:(0,S.jsxs)(u,{sx:{display:`flex`,alignItems:`center`,gap:.5},children:[(0,S.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:w.id}),(0,S.jsx)(h,{value:w.id})]})}),(0,S.jsx)(v,{label:`File`,children:(0,S.jsx)(c,{component:`button`,variant:`body2`,onClick:()=>n(`/${e}/docs`),children:w.fileId})}),(0,S.jsx)(v,{label:`Level`,children:(0,S.jsx)(a,{variant:`body2`,children:w.level})}),w.language&&(0,S.jsx)(v,{label:`Language`,children:(0,S.jsx)(a,{variant:`body2`,children:w.language})}),w.symbols&&w.symbols.length>0&&(0,S.jsx)(v,{label:`Symbols`,divider:!1,children:(0,S.jsx)(g,{tags:w.symbols})})]}),w.content&&(0,S.jsx)(m,{title:`Content`,sx:{mb:3},children:(0,S.jsx)(a,{variant:`body2`,sx:{whiteSpace:`pre-wrap`,fontFamily:w.language?`monospace`:`inherit`,fontSize:w.language?`0.85rem`:void 0},children:w.content})}),E.length>1&&(0,S.jsx)(m,{title:`In this file`,children:(0,S.jsx)(o,{dense:!0,disablePadding:!0,children:E.map(t=>(0,S.jsx)(s,{selected:t.id===M,onClick:()=>n(`/${e}/docs/${encodeURIComponent(t.id)}`),sx:{borderRadius:1,py:.25,...t.id===M&&{bgcolor:`${C.primary.main}14`}},children:(0,S.jsx)(l,{primary:(0,S.jsx)(a,{variant:`body2`,sx:{pl:(t.level-1)*2},fontWeight:t.id===M?700:400,children:t.title||t.id})})},t.id))})})]})}export{C 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,O as o,Y as s,et as c,m as l,nt as u,ut as d}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{F as f,H as p,I as m,N as h,a as g,d as _,j as v,k as y,r as b}from"./index-
|
|
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,O as o,Y as s,et as c,m as l,nt as u,ut as d}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{F as f,H as p,I as m,N as h,a as g,d as _,j as v,k as y,r as b}from"./index-CEweXD9O.js";import{t as x}from"./api-BMnBjMMf.js";var S=e(n(),1),C=t();function w(e){return e==null?`—`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function T(){let{projectId:e,"*":t}=i(),n=r(),{palette:T}=d(),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)([]),[A,j]=(0,S.useState)([]),[M,N]=(0,S.useState)(!0),[P,F]=(0,S.useState)(null);if((0,S.useEffect)(()=>{!e||!t||(N(!0),Promise.all([x(e,t),p(e,`files`,t).catch(()=>[]),_(e,`files`,t).catch(()=>[])]).then(([e,t,n])=>{D(e),k(t),j(n),F(null)}).catch(e=>F(e instanceof Error?e.message:String(e))).finally(()=>N(!1)))},[e,t]),M)return(0,C.jsx)(s,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,C.jsx)(u,{})});if(P||!E)return(0,C.jsx)(c,{severity:`error`,children:P||`File not found`});let I=t.split(`/`).slice(0,-1).join(`/`)||`.`;return(0,C.jsxs)(s,{children:[(0,C.jsx)(v,{breadcrumbs:[{label:`Files`,to:`/${e}/files`},{label:E.fileName}]}),(0,C.jsxs)(m,{title:`Metadata`,sx:{mb:3},children:[(0,C.jsx)(y,{label:`Path`,children:(0,C.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:.5},children:[(0,C.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:E.filePath}),(0,C.jsx)(h,{value:E.filePath})]})}),(0,C.jsx)(y,{label:`Size`,children:(0,C.jsx)(a,{variant:`body2`,children:w(E.size)})}),E.language&&(0,C.jsx)(y,{label:`Language`,children:(0,C.jsx)(a,{variant:`body2`,children:E.language})}),E.mimeType&&(0,C.jsx)(y,{label:`MIME Type`,children:(0,C.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:E.mimeType})}),E.extension&&(0,C.jsx)(y,{label:`Extension`,children:(0,C.jsx)(a,{variant:`body2`,children:E.extension})}),(0,C.jsx)(y,{label:`Directory`,divider:!1,children:(0,C.jsx)(o,{component:`button`,variant:`body2`,onClick:()=>n(`/${e}/files?dir=${I}`),children:I})})]}),(0,C.jsx)(m,{title:`Linked Notes`,sx:{mb:3},children:O.length===0?(0,C.jsx)(a,{variant:`body2`,sx:{color:T.custom.textMuted},children:`No linked notes`}):(0,C.jsx)(l,{spacing:.5,children:O.map(t=>(0,C.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,C.jsx)(f,{label:t.kind,color:`neutral`,size:`small`}),(0,C.jsx)(o,{component:`button`,variant:`body2`,onClick:()=>n(`/${e}/knowledge/${t.noteId}`),children:t.title})]},t.noteId))})}),(0,C.jsx)(m,{title:`Linked Tasks`,children:A.length===0?(0,C.jsx)(a,{variant:`body2`,sx:{color:T.custom.textMuted},children:`No linked tasks`}):(0,C.jsx)(l,{spacing:.5,children:A.map(t=>(0,C.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,C.jsx)(f,{label:g(t.status),color:b[t.status]??`neutral`,size:`small`}),(0,C.jsx)(o,{component:`button`,variant:`body2`,onClick:()=>n(`/${e}/tasks/${t.taskId}`),children:t.title})]},t.taskId))})})]})}export{T 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,Y as o,et as s,nt as c,q as l}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{M as u,W as d}from"./vendor-mui-icons-B196sG3f.js";import{B as f,C as p,I as m,K as h,M as g,N as _,P as v,Q as y,U as b,W as x,X as S,Z as C,j as w,k as T,q as E,w as D,z as O}from"./index-
|
|
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,Y as o,et as s,nt as c,q as l}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{M as u,W as d}from"./vendor-mui-icons-B196sG3f.js";import{B as f,C as p,I as m,K as h,M as g,N as _,P as v,Q as y,U as b,W as x,X as S,Z as C,j as w,k as T,q as E,w as D,z as O}from"./index-CEweXD9O.js";import"./skill-BltAsz7M.js";import{n as k,t as A}from"./attachments-NSvN5_0A.js";var j=e(n(),1),M=t();function N(){let{projectId:e,noteId:t}=i(),n=r(),N=C(`knowledge`),[P,F]=(0,j.useState)(null),[I,L]=(0,j.useState)([]),[R,z]=(0,j.useState)([]),[B,V]=(0,j.useState)(!0),[H,U]=(0,j.useState)(null),[W,G]=(0,j.useState)(!1),K=(0,j.useCallback)(async()=>{if(!(!e||!t))try{let[n,r,i]=await Promise.all([b(e,t),h(e,t),x(e,t)]);F(n),L(r),z(i),U(null)}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(!1)}},[e,t]);return(0,j.useEffect)(()=>{K()},[K]),y(e??null,(0,j.useCallback)(e=>{e.type.startsWith(`note:`)&&K()},[K])),B?(0,M.jsx)(o,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,M.jsx)(c,{})}):H||!P?(0,M.jsx)(s,{severity:`error`,children:H||`Note not found`}):(0,M.jsxs)(o,{children:[(0,M.jsx)(w,{breadcrumbs:[{label:`Knowledge`,to:`/${e}/knowledge`},{label:P.title}],actions:N?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(l,{variant:`contained`,color:`success`,startIcon:(0,M.jsx)(d,{}),onClick:()=>n(`/${e}/knowledge/${t}/edit`),children:`Edit`}),(0,M.jsx)(l,{color:`error`,startIcon:(0,M.jsx)(u,{}),onClick:()=>G(!0),children:`Delete`})]}):void 0}),(0,M.jsxs)(m,{title:`Details`,sx:{mb:3},children:[(0,M.jsx)(T,{label:`ID`,children:(0,M.jsxs)(o,{sx:{display:`flex`,alignItems:`center`,gap:.5},children:[(0,M.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:P.id}),(0,M.jsx)(_,{value:P.id})]})}),(0,M.jsx)(T,{label:`Version`,children:(0,M.jsxs)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:[`v`,P.version]})}),(0,M.jsx)(T,{label:`Tags`,children:P.tags.length>0?(0,M.jsx)(v,{tags:P.tags}):(0,M.jsx)(a,{variant:`body2`,color:`text.secondary`,children:`—`})}),P.createdBy&&(0,M.jsx)(T,{label:`Created by`,children:(0,M.jsx)(a,{variant:`body2`,children:P.createdBy})}),P.updatedBy&&P.updatedBy!==P.createdBy&&(0,M.jsx)(T,{label:`Updated by`,children:(0,M.jsx)(a,{variant:`body2`,children:P.updatedBy})}),(0,M.jsx)(T,{label:`Created`,children:(0,M.jsx)(g,{value:P.createdAt,showTime:!0,showRelative:!0})}),(0,M.jsx)(T,{label:`Updated`,divider:!P.content,children:(0,M.jsx)(g,{value:P.updatedAt,showTime:!0,showRelative:!0})}),P.content&&(0,M.jsx)(T,{label:`Content`,divider:!1,children:(0,M.jsx)(p,{children:P.content})})]}),(0,M.jsx)(m,{title:`Attachments`,sx:{mb:3},children:(0,M.jsx)(A,{attachments:R,getUrl:n=>E(e,t,n),onUpload:async n=>{await S(e,t,n),z(await x(e,t))},onDelete:async n=>{await f(e,t,n),z(await x(e,t))},readOnly:!N})}),(0,M.jsx)(m,{title:`Relations`,children:(0,M.jsx)(k,{projectId:e,entityId:t,entityType:`knowledge`,relations:I,onRefresh:K})}),(0,M.jsx)(D,{open:W,title:`Delete Note`,message:`Are you sure you want to delete "${P.title}"? This cannot be undone.`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:async()=>{!e||!t||(await O(e,t),n(`/${e}/knowledge`))},onCancel:()=>G(!1)})]})}export{N 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,X as o,Y as s,et as c,nt as l,q as u}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{M as d,W as f}from"./vendor-mui-icons-B196sG3f.js";import{C as p,F as m,I as h,N as g,P as _,Q as v,Z as y,j as b,k as x,w as S}from"./index-
|
|
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,X as o,Y as s,et as c,nt as l,q as u}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{M as d,W as f}from"./vendor-mui-icons-B196sG3f.js";import{C as p,F as m,I as h,N as g,P as _,Q as v,Z as y,j as b,k as x,w as S}from"./index-CEweXD9O.js";import{_ as C,c as w,d as T,f as E,h as D,i as O,n as k,r as A,s as j,u as M}from"./skill-BltAsz7M.js";import{n as N,t as P}from"./attachments-NSvN5_0A.js";var F=e(n(),1),I=t();function L(){let{projectId:e,skillId:t}=i(),n=r(),L=y(`skills`),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)([]),[H,U]=(0,F.useState)([]),[W,G]=(0,F.useState)(!0),[K,q]=(0,F.useState)(null),[J,Y]=(0,F.useState)(!1),X=(0,F.useCallback)(async()=>{if(!(!e||!t))try{let[n,r,i]=await Promise.all([M(e,t),E(e,t),T(e,t)]);z(n),V(r),U(i),q(null)}catch(e){q(e instanceof Error?e.message:String(e))}finally{G(!1)}},[e,t]);return(0,F.useEffect)(()=>{X()},[X]),v(e??null,(0,F.useCallback)(e=>{e.type.startsWith(`skill:`)&&X()},[X])),W?(0,I.jsx)(s,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,I.jsx)(l,{})}):K||!R?(0,I.jsx)(c,{severity:`error`,children:K||`Skill not found`}):(0,I.jsxs)(s,{children:[(0,I.jsx)(b,{breadcrumbs:[{label:`Skills`,to:`/${e}/skills`},{label:R.title}],actions:L?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u,{variant:`contained`,color:`success`,startIcon:(0,I.jsx)(f,{}),onClick:()=>n(`/${e}/skills/${t}/edit`),children:`Edit`}),(0,I.jsx)(u,{color:`error`,startIcon:(0,I.jsx)(d,{}),onClick:()=>Y(!0),children:`Delete`})]}):void 0}),(0,I.jsxs)(h,{title:`Details`,sx:{mb:3},children:[(0,I.jsx)(x,{label:`ID`,children:(0,I.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:.5},children:[(0,I.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:R.id}),(0,I.jsx)(g,{value:R.id})]})}),(0,I.jsx)(x,{label:`Version`,children:(0,I.jsxs)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:[`v`,R.version]})}),(0,I.jsx)(x,{label:`Source`,children:(0,I.jsx)(m,{label:O(R.source),color:k[R.source]??`primary`})}),(0,I.jsx)(x,{label:`Confidence`,children:(0,I.jsx)(a,{variant:`body2`,children:A(R.confidence)})}),(0,I.jsx)(x,{label:`Usage Count`,children:(0,I.jsx)(a,{variant:`body2`,children:R.usageCount})}),R.lastUsedAt&&(0,I.jsx)(x,{label:`Last Used`,children:(0,I.jsx)(a,{variant:`body2`,children:new Date(R.lastUsedAt).toLocaleString()})}),R.createdBy&&(0,I.jsx)(x,{label:`Created by`,children:(0,I.jsx)(a,{variant:`body2`,children:R.createdBy})}),R.updatedBy&&R.updatedBy!==R.createdBy&&(0,I.jsx)(x,{label:`Updated by`,children:(0,I.jsx)(a,{variant:`body2`,children:R.updatedBy})}),(0,I.jsx)(x,{label:`Created`,children:(0,I.jsx)(a,{variant:`body2`,children:new Date(R.createdAt).toLocaleString()})}),(0,I.jsx)(x,{label:`Updated`,children:(0,I.jsx)(a,{variant:`body2`,children:new Date(R.updatedAt).toLocaleString()})}),(0,I.jsx)(x,{label:`Tags`,children:R.tags.length>0?(0,I.jsx)(_,{tags:R.tags}):(0,I.jsx)(a,{variant:`body2`,color:`text.secondary`,children:`—`})}),R.description&&(0,I.jsx)(x,{label:`Description`,divider:!1,children:(0,I.jsx)(p,{children:R.description})})]}),R.steps.length>0&&(0,I.jsx)(h,{title:`Steps`,sx:{mb:3},children:(0,I.jsx)(s,{component:`ol`,sx:{m:0,pl:2.5},children:R.steps.map((e,t)=>(0,I.jsx)(a,{component:`li`,variant:`body2`,sx:{mb:.5},children:e},t))})}),R.triggers.length>0&&(0,I.jsx)(h,{title:`Triggers`,sx:{mb:3},children:(0,I.jsx)(s,{sx:{display:`flex`,flexWrap:`wrap`,gap:.5},children:R.triggers.map((e,t)=>(0,I.jsx)(o,{label:e,size:`small`,variant:`outlined`},t))})}),R.inputHints.length>0&&(0,I.jsx)(h,{title:`Input Hints`,sx:{mb:3},children:(0,I.jsx)(s,{sx:{display:`flex`,flexWrap:`wrap`,gap:.5},children:R.inputHints.map((e,t)=>(0,I.jsx)(o,{label:e,size:`small`,variant:`outlined`},t))})}),R.filePatterns.length>0&&(0,I.jsx)(h,{title:`File Patterns`,sx:{mb:3},children:(0,I.jsx)(s,{sx:{display:`flex`,flexWrap:`wrap`,gap:.5},children:R.filePatterns.map((e,t)=>(0,I.jsx)(o,{label:e,size:`small`,variant:`outlined`,sx:{fontFamily:`monospace`}},t))})}),(0,I.jsx)(h,{title:`Attachments`,sx:{mb:3},children:(0,I.jsx)(P,{attachments:H,getUrl:n=>D(e,t,n),onUpload:async n=>{await C(e,t,n),U(await T(e,t))},onDelete:async n=>{await w(e,t,n),U(await T(e,t))},readOnly:!L})}),(0,I.jsx)(h,{title:`Relations`,children:(0,I.jsx)(N,{projectId:e,entityId:t,entityType:`skills`,relations:B,onRefresh:X})}),(0,I.jsx)(S,{open:J,title:`Delete Skill`,message:`Are you sure you want to delete "${R.title}"? This cannot be undone.`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:async()=>{!e||!t||(await j(e,t),n(`/${e}/skills`))},onCancel:()=>Y(!1)})]})}export{L 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,O as o,P as s,Y as c,et as ee,k as te,m as l,nt as u,q as d,v as f,y as p}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{M as ne,W as m}from"./vendor-mui-icons-B196sG3f.js";import{C as h,F as g,I as _,M as v,N as re,P as ie,Q as ae,Z as oe,a as y,b,c as x,et as S,f as C,g as w,i as T,j as E,k as D,l as O,m as k,n as A,p as j,r as M,t as N,v as P,w as F}from"./index-
|
|
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,O as o,P as s,Y as c,et as ee,k as te,m as l,nt as u,q as d,v as f,y as p}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{M as ne,W as m}from"./vendor-mui-icons-B196sG3f.js";import{C as h,F as g,I as _,M as v,N as re,P as ie,Q as ae,Z as oe,a as y,b,c as x,et as S,f as C,g as w,i as T,j as E,k as D,l as O,m as k,n as A,p as j,r as M,t as N,v as P,w as F}from"./index-CEweXD9O.js";import"./skill-BltAsz7M.js";import{n as I,t as L}from"./attachments-NSvN5_0A.js";var R=e(n(),1),z=t();function B(){let{projectId:e,taskId:t}=i(),n=r(),B=oe(`tasks`),[V,H]=(0,R.useState)(null),[U,W]=(0,R.useState)([]),[G,K]=(0,R.useState)([]),[q,se]=(0,R.useState)([]),[ce,le]=(0,R.useState)(!0),[J,Y]=(0,R.useState)(null),[X,Z]=(0,R.useState)(!1),Q=(0,R.useCallback)(async()=>{if(!(!e||!t))try{let[n,r,i,a]=await Promise.all([C(e,t),k(e,t),j(e,t),S(e).catch(()=>[])]);H(n),W(r),K(i),se(a),Y(null)}catch(e){Y(e instanceof Error?e.message:String(e))}finally{le(!1)}},[e,t]);(0,R.useEffect)(()=>{Q()},[Q]),ae(e??null,(0,R.useCallback)(e=>{e.type.startsWith(`task:`)&&Q()},[Q]));let ue=async()=>{!e||!t||(await x(e,t),n(`/${e}/tasks`))},de=async n=>{!e||!t||(await w(e,t,n),Q())};if(ce)return(0,z.jsx)(c,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,z.jsx)(u,{})});if(J||!V)return(0,z.jsx)(ee,{severity:`error`,children:J||`Task not found`});let $=(t,r)=>!r||r.length===0?null:(0,z.jsx)(D,{label:t,children:(0,z.jsx)(l,{spacing:.5,children:r.map(t=>(0,z.jsxs)(c,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,z.jsx)(g,{label:y(t.status),color:M[t.status],size:`small`}),(0,z.jsx)(o,{component:`button`,variant:`body2`,onClick:()=>n(`/${e}/tasks/${t.id}`),children:t.title})]},t.id))})}),fe=!!(V.subtasks?.length||V.blockedBy?.length||V.blocks?.length||V.related?.length);return(0,z.jsxs)(c,{children:[(0,z.jsx)(E,{breadcrumbs:[{label:`Tasks`,to:`/${e}/tasks`},{label:V.title}],actions:B?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(d,{variant:`contained`,color:`success`,startIcon:(0,z.jsx)(m,{}),onClick:()=>n(`/${e}/tasks/${t}/edit`),children:`Edit`}),(0,z.jsx)(d,{color:`error`,startIcon:(0,z.jsx)(ne,{}),onClick:()=>Z(!0),children:`Delete`})]}):void 0}),(0,z.jsxs)(_,{title:`Properties`,sx:{mb:3},children:[(0,z.jsx)(D,{label:`ID`,children:(0,z.jsxs)(c,{sx:{display:`flex`,alignItems:`center`,gap:.5},children:[(0,z.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:V.id}),(0,z.jsx)(re,{value:V.id})]})}),(0,z.jsx)(D,{label:`Version`,children:(0,z.jsxs)(a,{variant:`body2`,sx:{fontFamily:`monospace`},children:[`v`,V.version]})}),(0,z.jsx)(D,{label:`Status`,children:(0,z.jsxs)(c,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,z.jsx)(g,{label:y(V.status),color:M[V.status]}),B&&(0,z.jsxs)(s,{size:`small`,sx:{minWidth:140},children:[(0,z.jsx)(te,{children:`Move to`}),(0,z.jsx)(f,{value:``,label:`Move to`,onChange:e=>de(e.target.value),children:N.filter(e=>e.status!==V.status).map(e=>(0,z.jsx)(p,{value:e.status,children:e.label},e.status))})]})]})}),(0,z.jsx)(D,{label:`Priority`,children:(0,z.jsx)(g,{label:T(V.priority),color:A[V.priority]})}),(0,z.jsx)(D,{label:`Tags`,children:V.tags.length>0?(0,z.jsx)(ie,{tags:V.tags}):(0,z.jsx)(a,{variant:`body2`,color:`text.secondary`,children:`—`})}),V.dueDate!=null&&(0,z.jsx)(D,{label:`Due Date`,children:(0,z.jsx)(v,{value:V.dueDate,showRelative:!0})}),V.estimate!=null&&(0,z.jsx)(D,{label:`Estimate`,children:(0,z.jsxs)(a,{variant:`body2`,children:[V.estimate,`h`]})}),V.assignee&&(0,z.jsx)(D,{label:`Assignee`,children:(0,z.jsx)(a,{variant:`body2`,children:q.find(e=>e.id===V.assignee)?.name??V.assignee})}),V.completedAt!=null&&(0,z.jsx)(D,{label:`Completed`,children:(0,z.jsx)(v,{value:V.completedAt,showTime:!0,showRelative:!0})}),V.createdBy&&(0,z.jsx)(D,{label:`Created by`,children:(0,z.jsx)(a,{variant:`body2`,children:V.createdBy})}),V.updatedBy&&V.updatedBy!==V.createdBy&&(0,z.jsx)(D,{label:`Updated by`,children:(0,z.jsx)(a,{variant:`body2`,children:V.updatedBy})}),(0,z.jsx)(D,{label:`Created`,children:(0,z.jsx)(v,{value:V.createdAt,showTime:!0,showRelative:!0})}),(0,z.jsx)(D,{label:`Updated`,divider:!1,children:(0,z.jsx)(v,{value:V.updatedAt,showTime:!0,showRelative:!0})})]}),V.description&&(0,z.jsx)(_,{title:`Description`,sx:{mb:3},children:(0,z.jsx)(h,{children:V.description})}),fe&&(0,z.jsxs)(_,{title:`Dependencies`,sx:{mb:3},children:[$(`Subtasks`,V.subtasks),$(`Blocked by`,V.blockedBy),$(`Blocks`,V.blocks),$(`Related`,V.related)]}),(0,z.jsx)(_,{title:`Attachments`,sx:{mb:3},children:(0,z.jsx)(L,{attachments:G,getUrl:n=>P(e,t,n),onUpload:async n=>{await b(e,t,n),K(await j(e,t))},onDelete:async n=>{await O(e,t,n),K(await j(e,t))},readOnly:!B})}),(0,z.jsx)(_,{title:`Cross-graph Links`,children:(0,z.jsx)(I,{projectId:e,entityId:t,entityType:`tasks`,relations:U,onRefresh:Q})}),(0,z.jsx)(F,{open:X,title:`Delete Task`,message:`Are you sure you want to delete "${V.title}"? This cannot be undone.`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:ue,onCancel:()=>Z(!1)})]})}export{B as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
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,X as o,Y as s,a as c,c as l,d as u,et as d,l as f,nt as p,p as m,q as h,r as g,s as _,u as v,ut as y}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{nt as b,t as x,tt as S}from"./vendor-mui-icons-B196sG3f.js";import{E as C,F as w,I as T,N as E,T as D,j as O}from"./index-
|
|
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,X as o,Y as s,a as c,c as l,d as u,et as d,l as f,nt as p,p as m,q as h,r as g,s as _,u as v,ut as y}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{nt as b,t as x,tt as S}from"./vendor-mui-icons-B196sG3f.js";import{E as C,F as w,I as T,N as E,T as D,j as O}from"./index-CEweXD9O.js";import{n as k}from"./help-D6XKMuzk.js";import{n as A,t as j}from"./api-DuX-0a_X.js";var M=e(n(),1),N=t(),P={docs:`primary`,code:`success`,knowledge:`warning`,tasks:`neutral`,skills:`primary`,files:`neutral`,context:`neutral`,"cross-graph":`error`};function F(e){let t={},n=e.inputSchema?.properties||{};for(let[e,r]of Object.entries(n))r.default===void 0?t[e]=``:t[e]=String(r.default);return t}function I(e,t){let n=e.trim();if(n!==``){if(t.type===`number`||t.type===`integer`){let e=Number(n);return isNaN(e)?void 0:e}if(t.type===`boolean`)return n===`true`;if(t.type===`array`)try{return JSON.parse(n)}catch{return n.split(`,`).map(e=>e.trim()).filter(Boolean)}if(t.type===`object`)try{return JSON.parse(n)}catch{return}return n}}function L(e){return e.enum?e.enum.join(` | `):e.type===`array`&&e.items?.type?`${e.items.type}[]`:e.type||`any`}function R(){let{projectId:e,toolName:t}=i(),n=r(),{palette:R}=y(),[z,B]=(0,M.useState)(null),[V,H]=(0,M.useState)(!0),[U,W]=(0,M.useState)({}),[G,K]=(0,M.useState)(!1),[q,J]=(0,M.useState)(null);(0,M.useEffect)(()=>{!e||!t||(H(!0),A(e,t).then(e=>{B(e),W(F(e))}).finally(()=>H(!1)))},[e,t]);let Y=(0,M.useCallback)(async()=>{if(!(!e||!t||!z)){K(!0),J(null);try{let n=z.inputSchema?.properties||{},r={};for(let[e,t]of Object.entries(U)){let i=I(t,n[e]||{});i!==void 0&&(r[e]=i)}J(await j(e,t,r))}catch(e){J({result:[{type:`text`,text:e instanceof Error?e.message:`Unknown error`}],isError:!0,duration:0})}finally{K(!1)}}},[e,t,z,U]);if(V)return(0,N.jsx)(s,{sx:{display:`flex`,justifyContent:`center`,py:8},children:(0,N.jsx)(p,{})});if(!z)return(0,N.jsx)(D,{icon:(0,N.jsx)(b,{}),title:`Tool not found`});let X=z.inputSchema?.properties||{},Z=new Set(z.inputSchema?.required||[]),Q=q?q.result.map(e=>e.text||``).join(`
|
|
2
2
|
`):``,$=Q;try{$=JSON.stringify(JSON.parse(Q),null,2)}catch{}return(0,N.jsxs)(s,{children:[(0,N.jsx)(O,{breadcrumbs:[{label:`Tools`,to:`/${e}/tools`},{label:z.name}]}),(0,N.jsxs)(s,{sx:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,N.jsx)(T,{title:`Info`,children:(0,N.jsxs)(s,{sx:{display:`flex`,flexDirection:`column`,gap:1.5},children:[(0,N.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:1.5},children:[(0,N.jsx)(a,{variant:`h6`,fontWeight:700,sx:{fontFamily:`monospace`},children:z.name}),(0,N.jsx)(w,{label:z.category,color:P[z.category]||`neutral`}),(0,N.jsx)(E,{value:z.name})]}),(0,N.jsx)(a,{variant:`body2`,sx:{color:R.custom.textMuted},children:z.description})]})}),(0,N.jsx)(T,{title:`Parameters (${Object.keys(X).length})`,children:Object.keys(X).length===0?(0,N.jsx)(a,{variant:`body2`,sx:{color:R.custom.textMuted},children:`This tool takes no parameters.`}):(0,N.jsx)(l,{children:(0,N.jsxs)(u,{size:`small`,children:[(0,N.jsx)(_,{children:(0,N.jsxs)(c,{children:[(0,N.jsx)(f,{children:`Name`}),(0,N.jsx)(f,{children:`Type`}),(0,N.jsx)(f,{children:`Required`}),(0,N.jsx)(f,{children:`Description`})]})}),(0,N.jsx)(v,{children:Object.entries(X).map(([e,t])=>(0,N.jsxs)(c,{children:[(0,N.jsx)(f,{children:(0,N.jsx)(a,{variant:`body2`,sx:{fontFamily:`monospace`,fontWeight:600},children:e})}),(0,N.jsx)(f,{children:(0,N.jsx)(o,{label:L(t),size:`small`,variant:`outlined`})}),(0,N.jsx)(f,{children:Z.has(e)?(0,N.jsx)(a,{variant:`body2`,color:`error`,fontWeight:600,children:`Yes`}):(0,N.jsx)(a,{variant:`body2`,sx:{color:R.custom.textMuted},children:`No`})}),(0,N.jsx)(f,{children:(0,N.jsx)(a,{variant:`body2`,sx:{color:R.custom.textMuted},children:t.description||`-`})})]},e))})]})})}),(0,N.jsx)(T,{title:`Playground`,action:(0,N.jsx)(h,{variant:`contained`,size:`small`,startIcon:G?(0,N.jsx)(p,{size:16,color:`inherit`}):(0,N.jsx)(x,{}),onClick:Y,disabled:G,children:G?`Running...`:`Execute`}),children:(0,N.jsx)(s,{sx:{display:`flex`,flexDirection:`column`,gap:1.5},children:Object.keys(X).length===0?(0,N.jsx)(a,{variant:`body2`,sx:{color:R.custom.textMuted},children:`No parameters required. Click Execute to run.`}):Object.entries(X).map(([e,t])=>{if(t.type===`boolean`)return(0,N.jsxs)(s,{children:[(0,N.jsx)(C,{children:e}),(0,N.jsx)(m,{checked:U[e]===`true`,onChange:t=>W(n=>({...n,[e]:String(t.target.checked)})),size:`small`})]},e);let n=t.type===`array`||t.type===`object`||e===`content`||e===`description`;return(0,N.jsxs)(s,{children:[(0,N.jsx)(C,{required:Z.has(e),children:e}),(0,N.jsx)(g,{value:U[e]||``,onChange:t=>W(n=>({...n,[e]:t.target.value})),size:`small`,fullWidth:!0,multiline:n,minRows:n?2:void 0,helperText:t.description,placeholder:t.enum?t.enum.join(` | `):t.type===`array`?`["item1", "item2"] or item1, item2`:t.type===`number`||t.type===`integer`?`0`:void 0,slotProps:{input:{sx:{fontFamily:`monospace`,fontSize:`0.875rem`}}}})]},e)})})}),q&&(0,N.jsxs)(T,{title:`Response`,action:(0,N.jsxs)(s,{sx:{display:`flex`,alignItems:`center`,gap:1.5},children:[(0,N.jsxs)(a,{variant:`caption`,sx:{color:R.custom.textMuted},children:[q.duration,`ms`]}),Q&&(0,N.jsx)(E,{value:$})]}),children:[q.isError&&(0,N.jsx)(d,{severity:`error`,sx:{mb:1.5},children:`Tool returned an error`}),(0,N.jsx)(s,{component:`pre`,sx:{m:0,p:1.5,bgcolor:R.custom.surfaceMuted,borderRadius:1,overflow:`auto`,maxHeight:500,fontFamily:`monospace`,fontSize:`0.8125rem`,lineHeight:1.5,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:$||`(empty response)`})]}),t&&k(t).length>0&&(0,N.jsx)(T,{title:`Related Guides`,children:(0,N.jsx)(s,{sx:{display:`flex`,flexWrap:`wrap`,gap:1},children:k(t).map(t=>(0,N.jsx)(o,{icon:(0,N.jsx)(S,{}),label:t.title,size:`small`,variant:`outlined`,clickable:!0,onClick:()=>n(`/${e}/help/${t.id}`)},t.id))})})]})]})}export{R 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,C as o,D as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,Y as h,et as ee,h as g,j as _,k as v,nt as y,ot as b,q as x,r as S,tt as C,ut as w,v as T,w as E,y as D}from"./vendor-mui-BPj7d3Sw.js";import{A as O,J as k,K as A,M as j,j as M,st as N}from"./vendor-mui-icons-B196sG3f.js";import{F as P,J as F,R as I,V as L,_ as te,s as ne,u as re,w as ie}from"./index-
|
|
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,C as o,D as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,Y as h,et as ee,h as g,j as _,k as v,nt as y,ot as b,q as x,r as S,tt as C,ut as w,v as T,w as E,y as D}from"./vendor-mui-BPj7d3Sw.js";import{A as O,J as k,K as A,M as j,j as M,st as N}from"./vendor-mui-icons-B196sG3f.js";import{F as P,J as F,R as I,V as L,_ as te,s as ne,u as re,w as ie}from"./index-CEweXD9O.js";import{i as ae}from"./api-BlFF6gX-.js";import{r as oe}from"./api-BMnBjMMf.js";import{t as se}from"./api-CrGJOcaN.js";import{l as ce,m as le,o as ue}from"./skill-BltAsz7M.js";var R=e(n(),1),z=t(),de=[`knowledge`,`tasks`,`skills`,`docs`,`code`,`files`],fe={knowledge:`warning`,tasks:`primary`,skills:`neutral`,files:`success`,docs:`neutral`,code:`error`};function B(e,t){return e.fromId===t?e.toId:e.fromId}function V(e,t,n){return t===`knowledge`?`/${e}/knowledge/${n}`:t===`tasks`?`/${e}/tasks/${n}`:t===`skills`?`/${e}/skills/${n}`:t===`files`?`/${e}/files/view/${n}`:t===`docs`?`/${e}/docs/${encodeURIComponent(n)}`:t===`code`?`/${e}/graph?focus=${encodeURIComponent(n)}&scope=code`:null}function H({projectId:e,entityId:t,entityType:n,relations:o,onRefresh:l}){let u=r(),{palette:m}=w(),{projectId:ee}=i(),g=ee||e,[_,O]=(0,R.useState)(!1),[k,M]=(0,R.useState)(`knowledge`),[H,U]=(0,R.useState)(``),[W,G]=(0,R.useState)([]),[K,q]=(0,R.useState)(!1),[J,Y]=(0,R.useState)(null),[X,pe]=(0,R.useState)(`relates_to`),[me,Z]=(0,R.useState)(!1),[Q,$]=(0,R.useState)(null),he=async()=>{if(H.trim()){q(!0),Y(null);try{let t=[],n=H.trim();k===`knowledge`?t=(await F(e,n,{topK:10})).map(e=>({id:e.id,label:e.title,score:e.score})):k===`tasks`?t=(await te(e,n,{topK:10})).map(e=>({id:e.id,label:e.title,score:e.score})):k===`docs`?t=(await ae(e,n,{topK:10})).map(e=>({id:e.id,label:e.title||e.id,score:e.score})):k===`code`?t=(await se(e,n,{topK:10})).map(e=>({id:e.id,label:e.name||e.id,score:e.score})):k===`skills`?t=(await le(e,n,{topK:10})).map(e=>({id:e.id,label:e.title,score:e.score})):k===`files`&&(t=(await oe(e,n,{topK:10})).map(e=>({id:e.filePath,label:e.filePath,score:e.score}))),G(t)}catch{}finally{q(!1)}}},ge=async()=>{if(J){Z(!0);try{let r=k===n?void 0:k;n===`knowledge`?await I(e,{fromId:t,toId:J.id,kind:X,targetGraph:r}):n===`skills`?await ue(e,{fromId:t,toId:J.id,kind:X,targetGraph:r}):await ne(e,{fromId:t,toId:J.id,kind:X,targetGraph:r}),O(!1),U(``),G([]),Y(null),pe(`relates_to`),l()}finally{Z(!1)}}},_e=async()=>{if(!Q)return;let t=Q;$(null);try{n===`knowledge`?await L(e,{fromId:t.fromId,toId:t.toId,targetGraph:t.targetGraph}):n===`skills`?await ce(e,{fromId:t.fromId,toId:t.toId,targetGraph:t.targetGraph}):await re(e,{fromId:t.fromId,toId:t.toId,targetGraph:t.targetGraph}),l()}catch{}},ve=(e,t)=>{let n=V(g,e,t);n&&u(n)};return(0,z.jsxs)(h,{children:[(0,z.jsxs)(h,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:1},children:[(0,z.jsx)(a,{variant:`subtitle2`,sx:{color:m.custom.textMuted},children:`Relations`}),(0,z.jsx)(x,{size:`small`,startIcon:(0,z.jsx)(A,{}),onClick:()=>O(!_),children:_?`Cancel`:`Add`})]}),o.length===0&&!_&&(0,z.jsx)(a,{variant:`body2`,sx:{color:m.custom.textMuted},children:`No relations`}),o.length>0&&(0,z.jsx)(s,{dense:!0,disablePadding:!0,children:o.map((e,r)=>{let i=B(e,t),o=e.targetGraph||n,s=V(g,o,i),c=e.title||i;return(0,z.jsx)(E,{disablePadding:!0,secondaryAction:(0,z.jsx)(C,{size:`small`,onClick:()=>$(e),children:(0,z.jsx)(j,{fontSize:`small`})}),sx:{py:.5},children:(0,z.jsx)(p,{primary:(0,z.jsxs)(h,{sx:{display:`flex`,alignItems:`center`,gap:.5,flexWrap:`wrap`},children:[(0,z.jsx)(P,{label:e.kind,color:`neutral`,size:`small`}),(0,z.jsx)(P,{label:o,color:fe[o]??`neutral`,size:`small`}),s?(0,z.jsx)(d,{href:s,variant:`body2`,underline:`hover`,onClick:e=>{e.preventDefault(),e.stopPropagation(),ve(o,i)},children:c}):(0,z.jsx)(a,{variant:`body2`,children:c})]})})},`${e.fromId}-${e.toId}-${r}`)})}),(0,z.jsx)(ie,{open:Q!==null,title:`Delete Relation`,message:`Remove ${Q?.kind} link to ${Q?Q.title||B(Q,t):``}?`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:_e,onCancel:()=>$(null)}),_&&(0,z.jsxs)(b,{variant:`outlined`,sx:{p:2,mt:1},children:[(0,z.jsxs)(h,{sx:{display:`flex`,gap:1,mb:1.5},children:[(0,z.jsxs)(f,{size:`small`,sx:{minWidth:140},children:[(0,z.jsx)(v,{children:`Graph`}),(0,z.jsx)(T,{value:k,label:`Graph`,onChange:e=>{M(e.target.value),G([]),Y(null)},children:de.map(e=>(0,z.jsx)(D,{value:e,children:e},e))})]}),(0,z.jsx)(S,{size:`small`,fullWidth:!0,placeholder:`Search...`,value:H,onChange:e=>U(e.target.value),onKeyDown:e=>e.key===`Enter`&&he()}),(0,z.jsx)(C,{onClick:he,disabled:K,children:K?(0,z.jsx)(y,{size:20}):(0,z.jsx)(N,{})})]}),W.length>0&&(0,z.jsx)(h,{sx:{maxHeight:200,overflow:`auto`,mb:1.5},children:W.map(e=>(0,z.jsxs)(h,{onClick:()=>Y(e),sx:{p:.75,cursor:`pointer`,borderRadius:1,backgroundColor:J?.id===e.id?`action.selected`:`transparent`,"&:hover":{backgroundColor:`action.hover`},display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,z.jsx)(a,{variant:`body2`,noWrap:!0,sx:{flex:1},children:e.label}),(0,z.jsx)(P,{label:`${(e.score*100).toFixed(0)}%`,color:`primary`,size:`small`})]},e.id))}),J&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{sx:{my:1}}),(0,z.jsxs)(h,{sx:{display:`flex`,gap:1,alignItems:`center`},children:[(0,z.jsx)(P,{label:J.label,color:`primary`}),(0,z.jsx)(S,{size:`small`,label:`Kind`,value:X,onChange:e=>pe(e.target.value),sx:{width:160}}),(0,z.jsx)(x,{variant:`contained`,size:`small`,onClick:ge,disabled:me||!X.trim(),children:me?(0,z.jsx)(y,{size:16}):`Link`})]})]})]})]})}function U(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function W(e){return e.startsWith(`image/`)}function G({attachments:e,getUrl:t,onUpload:n,onDelete:r,readOnly:i}){let{palette:c}=w(),[d,f]=(0,R.useState)(!1),[v,b]=(0,R.useState)(null),[x,S]=(0,R.useState)(!1),[T,D]=(0,R.useState)(null),A=(0,R.useRef)(null),N=(0,R.useCallback)(async e=>{if(!(!e||e.length===0)){f(!0),b(null);try{for(let t=0;t<e.length;t++)await n(e[t])}catch(e){b(e instanceof Error?e.message:String(e))}finally{f(!1),A.current&&(A.current.value=``)}}},[n]),P=(0,R.useCallback)(e=>{e.preventDefault(),S(!1),N(e.dataTransfer.files)},[N]),F=(0,R.useCallback)(async()=>{if(T){b(null);try{await r(T)}catch(e){b(e instanceof Error?e.message:String(e))}finally{D(null)}}},[T,r]),I=e.filter(e=>W(e.mimeType)),L=e.filter(e=>!W(e.mimeType));return(0,z.jsxs)(h,{children:[v&&(0,z.jsx)(ee,{severity:`error`,sx:{mb:2},onClose:()=>b(null),children:v}),I.length>0&&(0,z.jsx)(u,{cols:3,gap:8,sx:{mb:2},children:I.map(e=>(0,z.jsxs)(l,{sx:{borderRadius:1,overflow:`hidden`,border:`1px solid ${c.divider}`},children:[(0,z.jsx)(`a`,{href:t(e.filename),target:`_blank`,rel:`noopener noreferrer`,children:(0,z.jsx)(`img`,{src:t(e.filename),alt:e.filename,loading:`lazy`,style:{width:`100%`,height:140,objectFit:`cover`,display:`block`}})}),(0,z.jsx)(_,{title:e.filename,subtitle:U(e.size),actionIcon:i?void 0:(0,z.jsx)(C,{size:`small`,sx:{color:`white`},onClick:()=>D(e.filename),children:(0,z.jsx)(j,{fontSize:`small`})})})]},e.filename))}),L.length>0&&(0,z.jsx)(s,{dense:!0,sx:{mb:1},children:L.map(e=>(0,z.jsxs)(E,{sx:{borderBottom:`1px solid ${c.divider}`},children:[(0,z.jsx)(o,{sx:{minWidth:36},children:(0,z.jsx)(k,{fontSize:`small`,color:`action`})}),(0,z.jsx)(p,{primary:e.filename,secondary:`${U(e.size)} — ${e.mimeType}`,primaryTypographyProps:{variant:`body2`},secondaryTypographyProps:{variant:`caption`}}),(0,z.jsxs)(m,{children:[(0,z.jsx)(g,{title:`Download`,children:(0,z.jsx)(C,{size:`small`,href:t(e.filename),download:e.filename,children:(0,z.jsx)(M,{fontSize:`small`})})}),!i&&(0,z.jsx)(g,{title:`Delete`,children:(0,z.jsx)(C,{size:`small`,onClick:()=>D(e.filename),children:(0,z.jsx)(j,{fontSize:`small`})})})]})]},e.filename))}),e.length===0&&(0,z.jsx)(a,{variant:`body2`,color:`text.secondary`,sx:{mb:2},children:`No attachments yet`}),!i&&(0,z.jsxs)(h,{onDragOver:e=>{e.preventDefault(),S(!0)},onDragLeave:()=>S(!1),onDrop:P,sx:{border:`2px dashed ${x?c.primary.main:c.divider}`,borderRadius:1,p:2,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1,bgcolor:x?c.mode===`dark`?`rgba(144,202,249,0.08)`:`rgba(25,118,210,0.04)`:`transparent`,transition:`all 0.2s`,cursor:`pointer`},onClick:()=>!d&&A.current?.click(),children:[d?(0,z.jsx)(y,{size:20}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(O,{color:`action`,fontSize:`small`}),(0,z.jsx)(a,{variant:`body2`,color:`text.secondary`,children:`Drop files here or click to upload`})]}),(0,z.jsx)(`input`,{ref:A,type:`file`,multiple:!0,hidden:!0,onChange:e=>N(e.target.files)})]}),(0,z.jsx)(ie,{open:T!==null,title:`Delete Attachment`,message:`Are you sure you want to delete "${T}"?`,confirmLabel:`Delete`,confirmColor:`error`,onConfirm:F,onCancel:()=>D(null)})]})}export{H as n,G as t};
|
|
@@ -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,C as s,D as c,E as l,S as u,Y as d,et as f,m as p,nt as m,r as h,st as g,tt as _,ut as v}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{B as y,H as b,Q as x,V as S,ct as C,st as w}from"./vendor-mui-icons-B196sG3f.js";import{A as T,F as E,T as D,j as O}from"./index-
|
|
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,C as s,D as c,E as l,S as u,Y as d,et as f,m as p,nt as m,r as h,st as g,tt as _,ut as v}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{B as y,H as b,Q as x,V as S,ct as C,st as w}from"./vendor-mui-icons-B196sG3f.js";import{A as T,F as E,T as D,j as O}from"./index-CEweXD9O.js";import{i as k,n as A,r as j}from"./api-BlFF6gX-.js";var M=e(n(),1),N=t();function P(){let{projectId:e}=i(),t=r(),{palette:n}=v(),[P,F]=(0,M.useState)([]),[I,L]=(0,M.useState)(!0),[R,z]=(0,M.useState)(null),[B,V]=(0,M.useState)(null),[H,U]=(0,M.useState)([]),[W,G]=(0,M.useState)(!1),[K,q]=(0,M.useState)(``),[J,Y]=(0,M.useState)(null),[X,Z]=(0,M.useState)(!1),Q=(0,M.useCallback)(async()=>{if(e){L(!0);try{F(await j(e,{limit:200})),z(null)}catch(e){z(e instanceof Error?e.message:String(e))}finally{L(!1)}}},[e]);(0,M.useEffect)(()=>{Q()},[Q]);let $=async t=>{if(B===t){V(null);return}V(t),G(!0);try{U(await A(e,t))}catch{U([])}finally{G(!1)}},ee=async()=>{if(!e||!K.trim()){Y(null);return}Z(!0);try{Y(await k(e,K.trim(),{topK:20,minScore:.1}))}catch{}finally{Z(!1)}};return(0,N.jsxs)(d,{children:[(0,N.jsx)(O,{breadcrumbs:[{label:`Docs`}],actions:(0,N.jsxs)(a,{variant:`body2`,sx:{color:n.custom.textMuted},children:[P.length,` files`]})}),(0,N.jsx)(T,{children:(0,N.jsx)(h,{fullWidth:!0,size:`small`,placeholder:`Semantic search docs...`,value:K,onChange:e=>q(e.target.value),onKeyDown:e=>e.key===`Enter`&&ee(),slotProps:{input:{startAdornment:(0,N.jsx)(o,{position:`start`,children:(0,N.jsx)(w,{})}),endAdornment:K&&(0,N.jsx)(o,{position:`end`,children:(0,N.jsx)(_,{size:`small`,onClick:()=>{q(``),Y(null)},children:(0,N.jsx)(x,{})})})}}})}),J&&(0,N.jsxs)(a,{variant:`caption`,sx:{color:n.custom.textMuted,mb:1,display:`block`},children:[J.length,` result`,J.length===1?``:`s`,` found`]}),R&&(0,N.jsx)(f,{severity:`error`,sx:{mb:2},children:R}),I||X?(0,N.jsx)(d,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,N.jsx)(m,{})}):J?(0,N.jsx)(c,{disablePadding:!0,children:J.map(e=>(0,N.jsxs)(l,{onClick:()=>t(encodeURIComponent(e.id)),sx:{borderRadius:1,mb:.5},children:[(0,N.jsx)(s,{sx:{minWidth:36},children:(0,N.jsx)(y,{fontSize:`small`,color:`secondary`})}),(0,N.jsx)(u,{primary:(0,N.jsxs)(d,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,N.jsx)(a,{variant:`body2`,fontWeight:600,children:e.title||e.id}),(0,N.jsx)(E,{label:`${(e.score*100).toFixed(0)}%`,color:`primary`,size:`small`})]}),secondary:(0,N.jsxs)(a,{variant:`caption`,sx:{color:n.custom.textMuted},noWrap:!0,children:[e.fileId,` · level `,e.level,e.content?` · ${e.content.slice(0,100)}`:``]})})]},e.id))}):P.length===0?(0,N.jsx)(D,{icon:(0,N.jsx)(C,{}),title:`No docs indexed`,description:`Configure docsPattern in graph-memory.yaml to start indexing documentation`}):(0,N.jsx)(c,{disablePadding:!0,children:P.map(e=>(0,N.jsxs)(d,{children:[(0,N.jsxs)(l,{onClick:()=>$(e.fileId),sx:{borderRadius:1},children:[(0,N.jsx)(s,{sx:{minWidth:36},children:B===e.fileId?(0,N.jsx)(S,{}):(0,N.jsx)(b,{})}),(0,N.jsx)(s,{sx:{minWidth:36},children:(0,N.jsx)(C,{fontSize:`small`,color:`secondary`})}),(0,N.jsx)(u,{primary:(0,N.jsx)(a,{variant:`body2`,fontWeight:600,children:e.title||e.fileId}),secondary:(0,N.jsxs)(a,{variant:`caption`,sx:{color:n.custom.textMuted},children:[e.fileId,` · `,e.chunks,` chunks`]})})]}),(0,N.jsx)(g,{in:B===e.fileId,timeout:`auto`,unmountOnExit:!0,children:W?(0,N.jsx)(d,{sx:{pl:9,py:1},children:(0,N.jsx)(m,{size:16})}):(0,N.jsx)(c,{disablePadding:!0,sx:{pl:4},children:H.map(e=>(0,N.jsxs)(l,{onClick:()=>t(encodeURIComponent(e.id)),sx:{borderRadius:1,py:.5},children:[(0,N.jsx)(s,{sx:{minWidth:36},children:(0,N.jsx)(y,{fontSize:`small`,sx:{opacity:.5}})}),(0,N.jsx)(u,{primary:(0,N.jsxs)(p,{direction:`row`,spacing:1,alignItems:`center`,children:[(0,N.jsx)(a,{variant:`body2`,sx:{pl:(e.level-1)*2},children:e.title||e.id}),e.language&&(0,N.jsx)(E,{label:e.language,color:`primary`,size:`small`})]})})]},e.id))})})]},e.fileId))})]})}export{P 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{Y as a,et as o,nt as s,q as c}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{Z as l,f as u,j as d,y as f}from"./index-
|
|
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{Y as a,et as o,nt as s,q as c}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{Z as l,f as u,j as d,y as f}from"./index-CEweXD9O.js";import{t as p}from"./TaskForm-DgPVeiI9.js";var m=e(n(),1),h=t();function g(){let{projectId:e,taskId:t}=i(),n=r(),g=l(`tasks`),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!0),[x,S]=(0,m.useState)(null);return(0,m.useEffect)(()=>{!e||!t||u(e,t).then(v).catch(e=>S(e instanceof Error?e.message:String(e))).finally(()=>b(!1))},[e,t]),y?(0,h.jsx)(a,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,h.jsx)(s,{})}):x||!_?(0,h.jsx)(o,{severity:`error`,children:x||`Task not found`}):(0,h.jsxs)(a,{children:[(0,h.jsx)(d,{breadcrumbs:[{label:`Tasks`,to:`/${e}/tasks`},{label:_.title,to:`/${e}/tasks/${t}`},{label:`Edit`}],actions:(0,h.jsx)(c,{variant:`contained`,form:`task-form`,type:`submit`,disabled:!g,children:`Save`})}),!g&&(0,h.jsx)(o,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot edit tasks.`}),(0,h.jsx)(p,{task:_,onSubmit:async r=>{!e||!t||(await f(e,t,r),n(`/${e}/tasks/${t}`))},onCancel:()=>n(`/${e}/tasks/${t}`)})]})}export{g 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{Y as a,et as o,nt as s,q as c}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{U as l,Y as u,Z as d,j as f}from"./index-
|
|
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{Y as a,et as o,nt as s,q as c}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{U as l,Y as u,Z as d,j as f}from"./index-CEweXD9O.js";import{t as p}from"./NoteForm-SQ0b93i0.js";var m=e(n(),1),h=t();function g(){let{projectId:e,noteId:t}=i(),n=r(),g=d(`knowledge`),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!0),[x,S]=(0,m.useState)(null);return(0,m.useEffect)(()=>{!e||!t||l(e,t).then(v).catch(e=>S(e instanceof Error?e.message:String(e))).finally(()=>b(!1))},[e,t]),y?(0,h.jsx)(a,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,h.jsx)(s,{})}):x||!_?(0,h.jsx)(o,{severity:`error`,children:x||`Note not found`}):(0,h.jsxs)(a,{children:[(0,h.jsx)(f,{breadcrumbs:[{label:`Knowledge`,to:`/${e}/knowledge`},{label:_.title,to:`/${e}/knowledge/${t}`},{label:`Edit`}],actions:(0,h.jsx)(c,{variant:`contained`,form:`note-form`,type:`submit`,disabled:!g,children:`Save`})}),!g&&(0,h.jsx)(o,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot edit notes.`}),(0,h.jsx)(p,{note:_,onSubmit:async r=>{!e||!t||(await u(e,t,r),n(`/${e}/knowledge/${t}`))},onCancel:()=>n(`/${e}/knowledge/${t}`)})]})}export{g 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{Y as a,et as o,nt as s,q as c}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{Z as l,j as u}from"./index-
|
|
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{Y as a,et as o,nt as s,q as c}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{Z as l,j as u}from"./index-CEweXD9O.js";import{g as d,u as f}from"./skill-BltAsz7M.js";import{t as p}from"./SkillForm-BVsGrNPb.js";var m=e(n(),1),h=t();function g(){let{projectId:e,skillId:t}=i(),n=r(),g=l(`skills`),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!0),[x,S]=(0,m.useState)(null);return(0,m.useEffect)(()=>{!e||!t||f(e,t).then(v).catch(e=>S(e instanceof Error?e.message:String(e))).finally(()=>b(!1))},[e,t]),y?(0,h.jsx)(a,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,h.jsx)(s,{})}):x||!_?(0,h.jsx)(o,{severity:`error`,children:x||`Skill not found`}):(0,h.jsxs)(a,{children:[(0,h.jsx)(u,{breadcrumbs:[{label:`Skills`,to:`/${e}/skills`},{label:_.title,to:`/${e}/skills/${t}`},{label:`Edit`}],actions:(0,h.jsx)(c,{variant:`contained`,form:`skill-form`,type:`submit`,disabled:!g,children:`Save`})}),!g&&(0,h.jsx)(o,{severity:`warning`,sx:{mb:2},children:`Read-only access — you cannot edit skills.`}),(0,h.jsx)(p,{skill:_,onSubmit:async r=>{!e||!t||(await d(e,t,r),n(`/${e}/skills/${t}`))},onCancel:()=>n(`/${e}/skills/${t}`)})]})}export{g 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,u as a}from"./vendor-react-CHUjhoxh.js";import{$ as o,A as s,C as c,D as l,E as u,J as d,O as f,S as p,X as m,Y as h,et as g,m as ee,nt as te,ot as _,r as v,ut as y}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{J as b,R as ne,lt as x,st as S,z as C}from"./vendor-mui-icons-B196sG3f.js";import{A as re,F as w,T,j as E}from"./index-
|
|
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,u as a}from"./vendor-react-CHUjhoxh.js";import{$ as o,A as s,C as c,D as l,E as u,J as d,O as f,S as p,X as m,Y as h,et as g,m as ee,nt as te,ot as _,r as v,ut as y}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{J as b,R as ne,lt as x,st as S,z as C}from"./vendor-mui-icons-B196sG3f.js";import{A as re,F as w,T,j as E}from"./index-CEweXD9O.js";import{n as D,r as O}from"./api-BMnBjMMf.js";var k=e(n(),1),A=t();function j(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function M(){let{projectId:e}=i(),t=r(),{palette:n}=y(),[M,N]=a(),[P,F]=(0,k.useState)([]),[I,L]=(0,k.useState)(!0),[R,z]=(0,k.useState)(null),[B,V]=(0,k.useState)(M.get(`dir`)||`.`),[H,U]=(0,k.useState)(null),[W,G]=(0,k.useState)(!1),[K,q]=(0,k.useState)(M.get(`q`)||``),J=e=>{let t=new URLSearchParams(M);e&&e!==`.`?t.set(`dir`,e):t.delete(`dir`),t.delete(`q`),N(t,{replace:!0})},Y=(0,k.useCallback)(async t=>{if(e){L(!0),z(null);try{F(await D(e,{directory:t||`.`})),V(t)}catch(e){z(e instanceof Error?e.message:String(e))}finally{L(!1)}}},[e]);(0,k.useEffect)(()=>{Y(M.get(`dir`)||`.`)},[Y]);let X=(0,k.useCallback)(async t=>{if(!e||!t.trim()){U(null);return}G(!0);try{U(await O(e,t.trim()))}catch{}finally{G(!1)}},[e]);(0,k.useEffect)(()=>{let e=M.get(`q`);e?.trim()&&X(e)},[]);let ie=()=>{let e=new URLSearchParams(M);K.trim()?e.set(`q`,K.trim()):e.delete(`q`),N(e,{replace:!0}),X(K)},ae=n=>{n.kind===`directory`?(U(null),J(n.filePath),Y(n.filePath)):t(`/${e}/files/view/${n.filePath}`)},Z=e=>{U(null),J(e),Y(e)},oe=()=>{let e=B.split(`/`).slice(0,-1);Z(e.length>0?e.join(`/`):`.`)},Q=B&&B!==`.`?B.split(`/`):[],$=[...H??P].sort((e,t)=>e.kind===`directory`&&t.kind!==`directory`?-1:e.kind!==`directory`&&t.kind===`directory`?1:e.filePath.localeCompare(t.filePath));return(0,A.jsxs)(h,{children:[(0,A.jsx)(E,{breadcrumbs:[{label:`Files`}]}),(0,A.jsx)(re,{children:(0,A.jsx)(v,{fullWidth:!0,size:`small`,placeholder:`Search files...`,value:K,onChange:e=>q(e.target.value),onKeyDown:e=>e.key===`Enter`&&ie(),slotProps:{input:{startAdornment:(0,A.jsx)(s,{position:`start`,children:(0,A.jsx)(S,{})})}}})}),!H&&(0,A.jsxs)(h,{sx:{display:`flex`,alignItems:`center`,gap:1,mb:2},children:[B&&B!==`.`&&(0,A.jsx)(m,{icon:(0,A.jsx)(C,{}),label:`Up`,size:`small`,onClick:oe,clickable:!0}),(0,A.jsxs)(d,{children:[(0,A.jsx)(f,{component:`button`,variant:`body2`,underline:`hover`,onClick:()=>Z(`.`),color:!B||B===`.`?`text.primary`:`inherit`,children:`root`}),Q.map((e,t)=>{let n=Q.slice(0,t+1).join(`/`),r=t===Q.length-1;return(0,A.jsx)(f,{component:`button`,variant:`body2`,underline:r?`none`:`hover`,onClick:()=>!r&&Z(n),color:r?`text.primary`:`inherit`,children:e},n)})]})]}),H&&(0,A.jsxs)(o,{variant:`caption`,sx:{color:n.custom.textMuted,mb:1,display:`block`},children:[H.length,` result`,H.length===1?``:`s`,` `,(0,A.jsx)(f,{component:`button`,onClick:()=>{q(``),U(null);let e=new URLSearchParams(M);e.delete(`q`),N(e,{replace:!0})},children:`clear`})]}),R&&(0,A.jsx)(g,{severity:`error`,sx:{mb:2},children:R}),I||W?(0,A.jsx)(h,{sx:{display:`flex`,justifyContent:`center`,py:4},children:(0,A.jsx)(te,{})}):$.length===0?(0,A.jsx)(T,{icon:(0,A.jsx)(ne,{}),title:H?`No files found`:`Empty directory`,description:H?`Try a different search query`:void 0}):(0,A.jsx)(_,{variant:`outlined`,children:(0,A.jsx)(l,{dense:!0,disablePadding:!0,children:$.map(e=>(0,A.jsxs)(u,{onClick:()=>ae(e),sx:{borderBottom:`1px solid ${n.custom.border}`},children:[(0,A.jsx)(c,{sx:{minWidth:36},children:e.kind===`directory`?(0,A.jsx)(x,{sx:{color:`#f9a825`}}):(0,A.jsx)(b,{sx:{color:n.custom.textMuted}})}),(0,A.jsx)(p,{primary:(0,A.jsxs)(h,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,A.jsx)(`span`,{children:H?e.filePath:e.fileName}),`score`in e&&(0,A.jsx)(w,{label:`${(e.score*100).toFixed(0)}%`,color:`primary`,size:`small`})]})}),(0,A.jsxs)(ee,{direction:`row`,spacing:1,alignItems:`center`,children:[e.language&&(0,A.jsx)(o,{variant:`caption`,sx:{color:n.custom.textMuted},children:e.language}),(0,A.jsx)(o,{variant:`caption`,sx:{color:n.custom.textMuted,minWidth:60,textAlign:`right`},children:e.kind===`directory`?e.fileCount>0?`${e.fileCount} files`:``:j(e.size)})]})]},e.filePath))})})]})}export{M as default};
|