@graphmemory/server 1.2.0 → 1.3.1
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/LICENSE +84 -12
- package/README.md +7 -1
- package/dist/api/index.js +151 -54
- package/dist/api/rest/code.js +2 -1
- package/dist/api/rest/docs.js +2 -1
- package/dist/api/rest/embed.js +8 -1
- package/dist/api/rest/index.js +39 -18
- package/dist/api/rest/knowledge.js +4 -2
- package/dist/api/rest/skills.js +2 -1
- package/dist/api/rest/tasks.js +2 -1
- package/dist/api/rest/tools.js +8 -1
- package/dist/api/rest/validation.js +41 -40
- package/dist/api/rest/websocket.js +24 -7
- package/dist/api/tools/code/search-code.js +12 -9
- package/dist/api/tools/code/search-files.js +1 -1
- package/dist/api/tools/docs/cross-references.js +3 -2
- 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/search-files.js +1 -1
- package/dist/api/tools/docs/search-snippets.js +1 -1
- package/dist/api/tools/docs/search.js +5 -4
- package/dist/api/tools/file-index/search-all-files.js +1 -1
- package/dist/api/tools/knowledge/add-attachment.js +15 -3
- package/dist/api/tools/knowledge/remove-attachment.js +5 -1
- package/dist/api/tools/knowledge/search-notes.js +5 -4
- package/dist/api/tools/skills/add-attachment.js +15 -3
- package/dist/api/tools/skills/recall-skills.js +1 -1
- package/dist/api/tools/skills/remove-attachment.js +5 -1
- package/dist/api/tools/skills/search-skills.js +6 -5
- package/dist/api/tools/tasks/add-attachment.js +15 -3
- package/dist/api/tools/tasks/remove-attachment.js +5 -1
- package/dist/api/tools/tasks/search-tasks.js +5 -4
- package/dist/cli/index.js +63 -52
- package/dist/cli/indexer.js +62 -29
- package/dist/graphs/attachment-types.js +5 -0
- package/dist/graphs/code.js +99 -10
- package/dist/graphs/docs.js +20 -5
- package/dist/graphs/file-index.js +22 -6
- package/dist/graphs/file-lang.js +1 -1
- package/dist/graphs/knowledge.js +31 -7
- package/dist/graphs/skill.js +35 -9
- package/dist/graphs/task.js +35 -9
- package/dist/lib/defaults.js +78 -0
- package/dist/lib/embedder.js +11 -12
- package/dist/lib/embedding-codec.js +63 -0
- package/dist/lib/graph-persistence.js +68 -0
- package/dist/lib/jwt.js +4 -4
- package/dist/lib/mirror-watcher.js +4 -3
- package/dist/lib/multi-config.js +6 -1
- package/dist/lib/parsers/code.js +158 -31
- package/dist/lib/parsers/codeblock.js +11 -6
- package/dist/lib/parsers/docs.js +60 -31
- package/dist/lib/parsers/languages/registry.js +2 -2
- package/dist/lib/parsers/languages/typescript.js +214 -46
- package/dist/lib/project-manager.js +21 -11
- package/dist/lib/search/bm25.js +23 -5
- package/dist/lib/search/code.js +13 -3
- package/dist/lib/search/docs.js +2 -1
- package/dist/lib/search/file-index.js +2 -1
- package/dist/lib/search/files.js +3 -2
- package/dist/lib/search/knowledge.js +2 -1
- package/dist/lib/search/skills.js +2 -1
- package/dist/lib/search/tasks.js +2 -1
- package/dist/ui/assets/NoteForm-aZX9f6-3.js +1 -0
- package/dist/ui/assets/SkillForm-KYa3o92l.js +1 -0
- package/dist/ui/assets/TaskForm-Bl5nkybO.js +1 -0
- package/dist/ui/assets/_articleId_-DjbCByxM.js +1 -0
- package/dist/ui/assets/_docId_-hdCDjclV.js +1 -0
- package/dist/ui/assets/_filePath_-CpG836v4.js +1 -0
- package/dist/ui/assets/_noteId_-C1enaQd1.js +1 -0
- package/dist/ui/assets/_skillId_-hPoCet7J.js +1 -0
- package/dist/ui/assets/_taskId_-DSB3dLVz.js +1 -0
- package/dist/ui/assets/_toolName_-3SmCfxZy.js +2 -0
- package/dist/ui/assets/api-BMnBjMMf.js +1 -0
- package/dist/ui/assets/api-BlFF6gX-.js +1 -0
- package/dist/ui/assets/api-CrGJOcaN.js +1 -0
- package/dist/ui/assets/api-DuX-0a_X.js +1 -0
- package/dist/ui/assets/attachments-CEQ-2nMo.js +1 -0
- package/dist/ui/assets/client-Bq88u7gN.js +1 -0
- package/dist/ui/assets/docs-CrXsRcOG.js +1 -0
- package/dist/ui/assets/edit-BYiy1FZy.js +1 -0
- package/dist/ui/assets/edit-TUIIpUMF.js +1 -0
- package/dist/ui/assets/edit-hc-ZWz3y.js +1 -0
- package/dist/ui/assets/esm-BWiKNcBW.js +1 -0
- package/dist/ui/assets/files-0bPg6NH9.js +1 -0
- package/dist/ui/assets/graph-DXGud_wF.js +1 -0
- package/dist/ui/assets/help-CEMQqZUR.js +891 -0
- package/dist/ui/assets/help-DJ52_fxN.js +1 -0
- package/dist/ui/assets/index-BCZDAYZi.js +2 -0
- package/dist/ui/assets/index-D6zSNtzo.css +1 -0
- package/dist/ui/assets/knowledge-DeygeGGH.js +1 -0
- package/dist/ui/assets/new-CpD7hOBA.js +1 -0
- package/dist/ui/assets/new-DHTg3Dqq.js +1 -0
- package/dist/ui/assets/new-s8c0M75X.js +1 -0
- package/dist/ui/assets/prompts-BgOmdxgM.js +295 -0
- package/dist/ui/assets/rolldown-runtime-Dw2cE7zH.js +1 -0
- package/dist/ui/assets/search-EpJhdP2a.js +1 -0
- package/dist/ui/assets/skill-y9pizyqE.js +1 -0
- package/dist/ui/assets/skills-Cga9iUZN.js +1 -0
- package/dist/ui/assets/tasks-CobouTKV.js +1 -0
- package/dist/ui/assets/tools-JxKH5BDF.js +1 -0
- package/dist/ui/assets/vendor-graph-BWpSgpMe.js +321 -0
- package/dist/ui/assets/vendor-markdown-CT8ZVEPu.js +50 -0
- package/dist/ui/assets/vendor-md-editor-DmWafJvr.js +44 -0
- package/dist/ui/assets/{index-kKd4mVrh.css → vendor-md-editor-HrwGbQou.css} +1 -1
- package/dist/ui/assets/vendor-mui-BPj7d3Sw.js +139 -0
- package/dist/ui/assets/vendor-mui-icons-B196sG3f.js +1 -0
- package/dist/ui/assets/vendor-react-CHUjhoxh.js +11 -0
- package/dist/ui/index.html +11 -3
- package/package.json +6 -3
- package/dist/ui/assets/index-0hRezICt.js +0 -1702
package/dist/lib/search/bm25.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.BM25Index = void 0;
|
|
8
8
|
exports.tokenize = tokenize;
|
|
9
9
|
exports.rrfFuse = rrfFuse;
|
|
10
|
+
const defaults_1 = require("../../lib/defaults");
|
|
10
11
|
// ---------------------------------------------------------------------------
|
|
11
12
|
// Tokenizer
|
|
12
13
|
// ---------------------------------------------------------------------------
|
|
@@ -15,6 +16,23 @@ exports.rrfFuse = rrfFuse;
|
|
|
15
16
|
* "getUserById" → ["get", "user", "by", "id"]
|
|
16
17
|
* "JWT tokens" → ["jwt", "tokens"]
|
|
17
18
|
*/
|
|
19
|
+
/**
|
|
20
|
+
* Minimal stop words for code/doc search.
|
|
21
|
+
* Only articles, conjunctions, prepositions, and pronouns — words that never
|
|
22
|
+
* carry meaning in code search. Excludes programming-significant words like
|
|
23
|
+
* `for`, `do`, `if`, `not`, `is`, `has`, `all`, `can`, `no`.
|
|
24
|
+
*/
|
|
25
|
+
const STOP_WORDS = new Set([
|
|
26
|
+
'a', 'an', 'the', // articles
|
|
27
|
+
'and', 'or', 'but', 'nor', // conjunctions
|
|
28
|
+
'of', 'with', 'by', 'from', 'as', 'at', 'on', 'in', 'to', 'into', 'onto', // prepositions
|
|
29
|
+
'it', 'its', 'he', 'she', 'we', 'they', 'i', 'me', // pronouns
|
|
30
|
+
'my', 'you', 'your', 'his', 'her', 'our', 'their', // possessives
|
|
31
|
+
'this', 'that', 'these', 'those', // demonstratives
|
|
32
|
+
'been', 'being', 'were', 'was', 'are', // be-forms (but not 'be', 'is')
|
|
33
|
+
'would', 'could', 'should', 'shall', 'might', // modals (but not 'can', 'may', 'will', 'do')
|
|
34
|
+
'than', 'such', 'very', 'just', 'also', 'about', // fillers
|
|
35
|
+
]);
|
|
18
36
|
function tokenize(text) {
|
|
19
37
|
if (!text)
|
|
20
38
|
return [];
|
|
@@ -24,7 +42,7 @@ function tokenize(text) {
|
|
|
24
42
|
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2') // XMLParser → XML Parser
|
|
25
43
|
.split(/[^a-zA-Z0-9]+/)
|
|
26
44
|
.map(t => t.toLowerCase())
|
|
27
|
-
.filter(t => t.length > 0);
|
|
45
|
+
.filter(t => t.length > 0 && !STOP_WORDS.has(t));
|
|
28
46
|
return parts;
|
|
29
47
|
}
|
|
30
48
|
// ---------------------------------------------------------------------------
|
|
@@ -39,8 +57,8 @@ class BM25Index {
|
|
|
39
57
|
textExtractor;
|
|
40
58
|
constructor(textExtractor, opts) {
|
|
41
59
|
this.textExtractor = textExtractor;
|
|
42
|
-
this.k1 = opts?.k1 ??
|
|
43
|
-
this.b = opts?.b ??
|
|
60
|
+
this.k1 = opts?.k1 ?? defaults_1.BM25_K1;
|
|
61
|
+
this.b = opts?.b ?? defaults_1.BM25_B;
|
|
44
62
|
}
|
|
45
63
|
get size() {
|
|
46
64
|
return this.docs.size;
|
|
@@ -112,7 +130,7 @@ class BM25Index {
|
|
|
112
130
|
continue;
|
|
113
131
|
const docFreq = this.df.get(term) ?? 0;
|
|
114
132
|
// IDF: log((N - df + 0.5) / (df + 0.5) + 1)
|
|
115
|
-
const idf = Math.log((N - docFreq +
|
|
133
|
+
const idf = Math.log((N - docFreq + defaults_1.BM25_IDF_OFFSET) / (docFreq + defaults_1.BM25_IDF_OFFSET) + 1);
|
|
116
134
|
// TF saturation: (tf * (k1 + 1)) / (tf + k1 * (1 - b + b * dl/avgdl))
|
|
117
135
|
const tfNorm = (tf * (this.k1 + 1)) / (tf + this.k1 * (1 - this.b + this.b * doc.length / avgDl));
|
|
118
136
|
docScore += idf * tfNorm;
|
|
@@ -134,7 +152,7 @@ exports.BM25Index = BM25Index;
|
|
|
134
152
|
*
|
|
135
153
|
* Nodes appearing in only one list get rank = Infinity for the other → only 1/(k+rank) from one source.
|
|
136
154
|
*/
|
|
137
|
-
function rrfFuse(vectorScores, bm25Scores, k =
|
|
155
|
+
function rrfFuse(vectorScores, bm25Scores, k = defaults_1.RRF_K) {
|
|
138
156
|
// Build ranked lists (sorted desc by score, rank starts at 1)
|
|
139
157
|
const vectorRank = buildRankMap(vectorScores);
|
|
140
158
|
const bm25Rank = buildRankMap(bm25Scores);
|
package/dist/lib/search/code.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.searchCode = searchCode;
|
|
4
4
|
const embedder_1 = require("../../lib/embedder");
|
|
5
5
|
const bm25_1 = require("../../lib/search/bm25");
|
|
6
|
+
const defaults_1 = require("../../lib/defaults");
|
|
6
7
|
/**
|
|
7
8
|
* Semantic search over the code graph.
|
|
8
9
|
*
|
|
@@ -12,7 +13,7 @@ const bm25_1 = require("../../lib/search/bm25");
|
|
|
12
13
|
* 4. De-duplicate, re-filter, sort, cap at `maxResults`.
|
|
13
14
|
*/
|
|
14
15
|
function searchCode(graph, queryEmbedding, options = {}) {
|
|
15
|
-
const { topK =
|
|
16
|
+
const { topK = defaults_1.SEARCH_TOP_K, bfsDepth = defaults_1.SEARCH_BFS_DEPTH, maxResults = defaults_1.SEARCH_MAX_RESULTS, minScore = defaults_1.SEARCH_MIN_SCORE_CODE, bfsDecay = defaults_1.SEARCH_BFS_DECAY, includeBody = false, queryText, bm25Index, searchMode = 'hybrid', rrfK = defaults_1.RRF_K } = options;
|
|
16
17
|
const useVector = searchMode !== 'keyword';
|
|
17
18
|
const useBm25 = searchMode !== 'vector' && !!queryText && !!bm25Index;
|
|
18
19
|
// --- 1. Score all nodes ---
|
|
@@ -74,8 +75,14 @@ function searchCode(graph, queryEmbedding, options = {}) {
|
|
|
74
75
|
if (item.score * bfsDecay < minS)
|
|
75
76
|
continue;
|
|
76
77
|
const nextScore = item.score * bfsDecay;
|
|
78
|
+
// Follow all outgoing edges (contains, imports, extends, implements)
|
|
77
79
|
graph.outNeighbors(item.id).forEach(n => queue.push({ id: n, depth: item.depth + 1, score: nextScore }));
|
|
78
|
-
|
|
80
|
+
// Follow incoming edges, but NOT reverse imports (avoids noise from popular utility files)
|
|
81
|
+
graph.forEachInEdge(item.id, (_edge, attrs, source) => {
|
|
82
|
+
if (attrs.kind !== 'imports') {
|
|
83
|
+
queue.push({ id: source, depth: item.depth + 1, score: nextScore });
|
|
84
|
+
}
|
|
85
|
+
});
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
for (const seed of seeds) {
|
|
@@ -86,7 +93,7 @@ function searchCode(graph, queryEmbedding, options = {}) {
|
|
|
86
93
|
.filter(([, score]) => score >= minS)
|
|
87
94
|
.map(([id, score]) => {
|
|
88
95
|
const attrs = graph.getNodeAttributes(id);
|
|
89
|
-
|
|
96
|
+
const result = {
|
|
90
97
|
id,
|
|
91
98
|
fileId: attrs.fileId,
|
|
92
99
|
kind: attrs.kind,
|
|
@@ -97,6 +104,9 @@ function searchCode(graph, queryEmbedding, options = {}) {
|
|
|
97
104
|
endLine: attrs.endLine,
|
|
98
105
|
score,
|
|
99
106
|
};
|
|
107
|
+
if (includeBody)
|
|
108
|
+
result.body = attrs.body;
|
|
109
|
+
return result;
|
|
100
110
|
})
|
|
101
111
|
.sort((a, b) => b.score - a.score)
|
|
102
112
|
.slice(0, maxResults);
|
package/dist/lib/search/docs.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.search = search;
|
|
4
4
|
const embedder_1 = require("../../lib/embedder");
|
|
5
5
|
const bm25_1 = require("../../lib/search/bm25");
|
|
6
|
+
const defaults_1 = require("../../lib/defaults");
|
|
6
7
|
/**
|
|
7
8
|
* Semantic search over the graph.
|
|
8
9
|
*
|
|
@@ -15,7 +16,7 @@ const bm25_1 = require("../../lib/search/bm25");
|
|
|
15
16
|
* 5. De-duplicate and return results sorted by score, capped at `maxResults`.
|
|
16
17
|
*/
|
|
17
18
|
function search(graph, queryEmbedding, options = {}) {
|
|
18
|
-
const { topK =
|
|
19
|
+
const { topK = defaults_1.SEARCH_TOP_K, bfsDepth = defaults_1.SEARCH_BFS_DEPTH, maxResults = defaults_1.SEARCH_MAX_RESULTS, minScore = defaults_1.SEARCH_MIN_SCORE, bfsDecay = defaults_1.SEARCH_BFS_DECAY, queryText, bm25Index, searchMode = 'hybrid', rrfK = defaults_1.RRF_K } = options;
|
|
19
20
|
const useVector = searchMode !== 'keyword';
|
|
20
21
|
const useBm25 = searchMode !== 'vector' && !!queryText && !!bm25Index;
|
|
21
22
|
// --- 1. Score all nodes ---
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchFileIndex = searchFileIndex;
|
|
4
4
|
const embedder_1 = require("../../lib/embedder");
|
|
5
|
+
const defaults_1 = require("../../lib/defaults");
|
|
5
6
|
/**
|
|
6
7
|
* Semantic search over file nodes by path embedding.
|
|
7
8
|
* Only searches file nodes (directories have empty embeddings).
|
|
8
9
|
* Pure cosine similarity, no BFS expansion.
|
|
9
10
|
*/
|
|
10
11
|
function searchFileIndex(graph, queryEmbedding, options = {}) {
|
|
11
|
-
const { topK =
|
|
12
|
+
const { topK = defaults_1.FILE_SEARCH_TOP_K, minScore = defaults_1.SEARCH_MIN_SCORE_FILES } = options;
|
|
12
13
|
const scored = [];
|
|
13
14
|
graph.forEachNode((_, attrs) => {
|
|
14
15
|
if (attrs.kind !== 'file' || attrs.embedding.length === 0)
|
package/dist/lib/search/files.js
CHANGED
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.searchDocFiles = searchDocFiles;
|
|
4
4
|
exports.searchCodeFiles = searchCodeFiles;
|
|
5
5
|
const embedder_1 = require("../../lib/embedder");
|
|
6
|
+
const defaults_1 = require("../../lib/defaults");
|
|
6
7
|
function searchDocFiles(graph, queryEmbedding, options = {}) {
|
|
7
|
-
const { topK =
|
|
8
|
+
const { topK = defaults_1.FILE_SEARCH_TOP_K, minScore = defaults_1.SEARCH_MIN_SCORE_FILES } = options;
|
|
8
9
|
// Collect root chunks (level=1) that have a fileEmbedding
|
|
9
10
|
const scored = [];
|
|
10
11
|
graph.forEachNode((_, attrs) => {
|
|
@@ -33,7 +34,7 @@ function searchDocFiles(graph, queryEmbedding, options = {}) {
|
|
|
33
34
|
}));
|
|
34
35
|
}
|
|
35
36
|
function searchCodeFiles(graph, queryEmbedding, options = {}) {
|
|
36
|
-
const { topK =
|
|
37
|
+
const { topK = defaults_1.FILE_SEARCH_TOP_K, minScore = defaults_1.SEARCH_MIN_SCORE_FILES } = options;
|
|
37
38
|
// Collect file nodes that have a fileEmbedding
|
|
38
39
|
const scored = [];
|
|
39
40
|
graph.forEachNode((_, attrs) => {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.searchKnowledge = searchKnowledge;
|
|
4
4
|
const embedder_1 = require("../../lib/embedder");
|
|
5
5
|
const bm25_1 = require("../../lib/search/bm25");
|
|
6
|
+
const defaults_1 = require("../../lib/defaults");
|
|
6
7
|
/**
|
|
7
8
|
* Semantic search over the knowledge graph.
|
|
8
9
|
*
|
|
@@ -12,7 +13,7 @@ const bm25_1 = require("../../lib/search/bm25");
|
|
|
12
13
|
* 4. De-duplicate, re-filter, sort, cap at `maxResults`.
|
|
13
14
|
*/
|
|
14
15
|
function searchKnowledge(graph, queryEmbedding, options = {}) {
|
|
15
|
-
const { topK =
|
|
16
|
+
const { topK = defaults_1.SEARCH_TOP_K, bfsDepth = defaults_1.SEARCH_BFS_DEPTH, maxResults = defaults_1.SEARCH_MAX_RESULTS, minScore = defaults_1.SEARCH_MIN_SCORE, bfsDecay = defaults_1.SEARCH_BFS_DECAY, queryText, bm25Index, searchMode = 'hybrid', rrfK = defaults_1.RRF_K } = options;
|
|
16
17
|
const useVector = searchMode !== 'keyword';
|
|
17
18
|
const useBm25 = searchMode !== 'vector' && !!queryText && !!bm25Index;
|
|
18
19
|
// --- 1. Score all nodes (skip proxy nodes) ---
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.searchSkills = searchSkills;
|
|
4
4
|
const embedder_1 = require("../../lib/embedder");
|
|
5
5
|
const bm25_1 = require("../../lib/search/bm25");
|
|
6
|
+
const defaults_1 = require("../../lib/defaults");
|
|
6
7
|
/**
|
|
7
8
|
* Semantic search over the skill graph.
|
|
8
9
|
*
|
|
@@ -12,7 +13,7 @@ const bm25_1 = require("../../lib/search/bm25");
|
|
|
12
13
|
* 4. De-duplicate, re-filter, sort, cap at `maxResults`.
|
|
13
14
|
*/
|
|
14
15
|
function searchSkills(graph, queryEmbedding, options = {}) {
|
|
15
|
-
const { topK =
|
|
16
|
+
const { topK = defaults_1.SEARCH_TOP_K, bfsDepth = defaults_1.SEARCH_BFS_DEPTH, maxResults = defaults_1.SEARCH_MAX_RESULTS, minScore = defaults_1.SEARCH_MIN_SCORE, bfsDecay = defaults_1.SEARCH_BFS_DECAY, queryText, bm25Index, searchMode = 'hybrid', rrfK = defaults_1.RRF_K } = options;
|
|
16
17
|
const useVector = searchMode !== 'keyword';
|
|
17
18
|
const useBm25 = searchMode !== 'vector' && !!queryText && !!bm25Index;
|
|
18
19
|
// --- 1. Score all nodes (skip proxy nodes) ---
|
package/dist/lib/search/tasks.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.searchTasks = searchTasks;
|
|
4
4
|
const embedder_1 = require("../../lib/embedder");
|
|
5
5
|
const bm25_1 = require("../../lib/search/bm25");
|
|
6
|
+
const defaults_1 = require("../../lib/defaults");
|
|
6
7
|
/**
|
|
7
8
|
* Semantic search over the task graph.
|
|
8
9
|
*
|
|
@@ -12,7 +13,7 @@ const bm25_1 = require("../../lib/search/bm25");
|
|
|
12
13
|
* 4. De-duplicate, re-filter, sort, cap at `maxResults`.
|
|
13
14
|
*/
|
|
14
15
|
function searchTasks(graph, queryEmbedding, options = {}) {
|
|
15
|
-
const { topK =
|
|
16
|
+
const { topK = defaults_1.SEARCH_TOP_K, bfsDepth = defaults_1.SEARCH_BFS_DEPTH, maxResults = defaults_1.SEARCH_MAX_RESULTS, minScore = defaults_1.SEARCH_MIN_SCORE, bfsDecay = defaults_1.SEARCH_BFS_DECAY, queryText, bm25Index, searchMode = 'hybrid', rrfK = defaults_1.RRF_K } = options;
|
|
16
17
|
const useVector = searchMode !== 'keyword';
|
|
17
18
|
const useBm25 = searchMode !== 'vector' && !!queryText && !!bm25Index;
|
|
18
19
|
// --- 1. Score all nodes (skip proxy nodes) ---
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import{t as m}from"./help-CEMQqZUR.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};
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import"./skill-y9pizyqE.js";import{n as k,t as A}from"./attachments-CEQ-2nMo.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};
|
|
@@ -0,0 +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-BCZDAYZi.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-y9pizyqE.js";import{n as N,t as P}from"./attachments-CEQ-2nMo.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import"./skill-y9pizyqE.js";import{n as I,t as L}from"./attachments-CEQ-2nMo.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import{n as k}from"./help-CEMQqZUR.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
|
+
`):``,$=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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n}from"./client-Bq88u7gN.js";function r(r,i){return n(`/projects/${r}/files${t({directory:i?.directory,extension:i?.extension,language:i?.language,filter:i?.filter,limit:i?.limit})}`).then(e)}function i(r,i,a){return n(`/projects/${r}/files/search${t({q:i,topK:a?.topK,minScore:a?.minScore})}`).then(e)}function a(e,r){return n(`/projects/${e}/files/info${t({path:r})}`)}export{r as n,i as r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n}from"./client-Bq88u7gN.js";function r(r,i){return n(`/projects/${r}/docs/topics${t({filter:i?.filter,limit:i?.limit})}`).then(e)}function i(t,r){return n(`/projects/${t}/docs/toc/${r}`).then(e)}function a(e,t){return n(`/projects/${e}/docs/nodes/${t}`)}function o(r,i,a){return n(`/projects/${r}/docs/search${t({q:i,topK:a?.topK,minScore:a?.minScore})}`).then(e)}export{o as i,i as n,r,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t,r as n}from"./client-Bq88u7gN.js";function r(r,i,a){return n(`/projects/${r}/code/search${t({q:i,topK:a?.topK,minScore:a?.minScore})}`).then(e)}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./client-Bq88u7gN.js";function n(n){return t(`/projects/${n}/tools`).then(e)}function r(e,n){return t(`/projects/${e}/tools/${n}`)}function i(e,n,r){return t(`/projects/${e}/tools/${n}/call`,{method:`POST`,body:JSON.stringify({arguments:r})})}export{r as n,n as r,i as t};
|
|
@@ -0,0 +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-BCZDAYZi.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-y9pizyqE.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`/api`,t=null;function n(e){t=e}async function r(){try{return(await fetch(`${e}/auth/refresh`,{method:`POST`,credentials:`include`})).ok}catch{return!1}}async function i(n,i){let a={"Content-Type":`application/json`,...i?.headers},o=()=>fetch(`${e}${n}`,{...i,headers:a,credentials:`include`}),s=await o();if(s.status===401)if(await r())s=await o();else throw t?.(),Error(`Session expired`);if(!s.ok){let e=await s.json().catch(()=>({error:s.statusText}));throw Error(e.error||s.statusText)}if(s.status!==204)return s.json()}function a(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!=null&&r!==``&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}function o(e){return e.results}export{o as i,a as n,i as r,n as t};
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import{t as p}from"./NoteForm-aZX9f6-3.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import{t as p}from"./TaskForm-Bl5nkybO.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};
|
|
@@ -0,0 +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-BCZDAYZi.js";import{g as d,u as f}from"./skill-y9pizyqE.js";import{t as p}from"./SkillForm-KYa3o92l.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./vendor-markdown-CT8ZVEPu.js";import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,b as k,c as A,d as j,et as M,f as N,g as P,h as F,i as I,j as L,k as R,l as z,m as B,n as V,nt as H,o as U,p as W,q as G,r as K,rt as q,s as J,t as Y,tt as X,u as Z,v as Q,w as $,x as ee,y as te,z as ne}from"./vendor-md-editor-DmWafJvr.js";export{H as EditorContext,E as MarkdownUtil,K as TextAreaCommandOrchestrator,I as TextAreaTextApi,s as bold,p as checkedListCommand,x as code,C as codeBlock,R as codeEdit,t as codeLive,L as codePreview,O as commands,c as comment,Y as default,S as divider,d as executeCommand,n as fullscreen,G as getBreaksNeededForEmptyLineAfter,u as getBreaksNeededForEmptyLineBefore,U as getCommands,J as getExtraCommands,A as getStateFromTextArea,T as getSurroundingWord,ne as group,V as handleKeyDown,y as heading,b as heading1,k as heading2,Q as heading3,P as heading4,B as heading5,N as heading6,r as headingExecute,z as help,v as hr,f as image,w as insertBeforeEachLine,M as insertTextAtPosition,Z as issue,l as italic,o as link,m as orderedListCommand,h as quote,q as reducer,_ as selectLine,e as selectWord,X as shortcuts,i as strikethrough,j as table,$ as title,a as title1,ee as title2,te as title3,D as title4,F as title5,W as title6,g as unorderedListCommand};
|
|
@@ -0,0 +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-BCZDAYZi.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};
|
|
@@ -0,0 +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,u as i}from"./vendor-react-CHUjhoxh.js";import{$ as a,A as o,X as s,Y as c,et as ee,h as l,n as u,nt as te,ot as ne,r as d,t as f,tt as p,ut as m}from"./vendor-mui-BPj7d3Sw.js";import"./vendor-md-editor-DmWafJvr.js";import{n as h,r as g}from"./client-Bq88u7gN.js";import{F as re,I as _,L as v,ct as y,dt as b,it as x,lt as S,q as C,st as w,ut as T}from"./vendor-mui-icons-B196sG3f.js";import{F as E,I as D,N as O,j as k,k as A}from"./index-BCZDAYZi.js";import{n as j,t as M}from"./vendor-graph-BWpSgpMe.js";function ie(e,t=`all`){return g(`/projects/${e}/graph${h({scope:t})}`)}var N=e(n(),1),P=e(M(),1),F=t();j.use(P.default);var I={knowledge:`#f9a825`,tasks:`#1976d2`,skills:`#9c27b0`,files:`#388e3c`,docs:`#7b1fa2`,code:`#f57c00`},L={knowledge:`warning`,tasks:`primary`,skills:`neutral`,files:`success`,docs:`neutral`,code:`error`},R=[{scope:`all`,label:`All`,icon:null},{scope:`knowledge`,label:`Knowledge`,icon:(0,F.jsx)(b,{sx:{fontSize:16}})},{scope:`tasks`,label:`Tasks`,icon:(0,F.jsx)(T,{sx:{fontSize:16}})},{scope:`skills`,label:`Skills`,icon:(0,F.jsx)(x,{sx:{fontSize:16}})},{scope:`files`,label:`Files`,icon:(0,F.jsx)(S,{sx:{fontSize:16}})},{scope:`docs`,label:`Docs`,icon:(0,F.jsx)(y,{sx:{fontSize:16}})},{scope:`code`,label:`Code`,icon:(0,F.jsx)(C,{sx:{fontSize:16}})}];function z(e){return e.title||e.name||e.path||e.id}function B(e){return I[e.graph]||`#569cd6`}function V(e,t){return e.length>t?e.slice(0,t)+`...`:e}function H(){let{projectId:e}=r(),[t,n]=i(),{palette:h}=m(),g=(0,N.useRef)(null),y=(0,N.useRef)(null),b=t.get(`focus`),[x,S]=(0,N.useState)(t.get(`scope`)||`all`),[C,T]=(0,N.useState)(!0),[M,P]=(0,N.useState)(null),[H,U]=(0,N.useState)({nodes:0,edges:0}),[W,G]=(0,N.useState)(null),[K,q]=(0,N.useState)(``),J=h.mode===`dark`,ae=J?`#e0e0e0`:`#333`,oe=J?`#444`:`#ccc`,Y=J?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.1)`,se=J?`rgba(255,255,255,0.03)`:`rgba(0,0,0,0.04)`,X=h.primary.main,ce=J?`#1e1e1e`:`#f5f5f5`,Z=(0,N.useCallback)((e,t)=>{let n=e.getElementById(t);if(n.length===0)return;let r=n.neighborhood().add(n);e.elements().not(r).addClass(`dimmed`),r.addClass(`highlighted`),n.addClass(`selected-node`)},[]),Q=(0,N.useCallback)(e=>{e.elements().removeClass(`dimmed highlighted selected-node`)},[]),le=(e,t)=>{if(!g.current)return;y.current&&y.current.destroy();let r=[],i=new Map;for(let e of t)i.set(e.source,(i.get(e.source)||0)+1),i.set(e.target,(i.get(e.target)||0)+1);let a=Math.max(1,...i.values());for(let t of e){let{id:e,...n}=t,o=i.get(t.id)||0,s=12+Math.round(o/a*28);r.push({data:{id:t.id,label:V(z(t),25),color:B(t),graphType:t.graph,nodeSize:s,...n}})}for(let e of t)r.push({data:{source:e.source,target:e.target,label:e.kind||``,graphType:e.graph}});let o=j({container:g.current,elements:r,style:[{selector:`node`,style:{"background-color":`data(color)`,label:`data(label)`,color:ae,"font-size":`9px`,"text-valign":`bottom`,"text-halign":`center`,"text-margin-y":3,width:`data(nodeSize)`,height:`data(nodeSize)`,"border-width":1,"border-color":oe,"text-max-width":`80px`,"text-wrap":`ellipsis`,"text-opacity":.85,"transition-property":`opacity, border-width, border-color, width, height`,"transition-duration":`0.15s`}},{selector:`edge`,style:{width:.5,"line-color":Y,"target-arrow-color":Y,"target-arrow-shape":`triangle`,"curve-style":`bezier`,"arrow-scale":.4,opacity:.6,"transition-property":`opacity, line-color, width`,"transition-duration":`0.15s`}},{selector:`node.dimmed`,style:{opacity:.1,"text-opacity":0}},{selector:`edge.dimmed`,style:{opacity:.03,"line-color":se}},{selector:`node.highlighted`,style:{opacity:1,"text-opacity":1,"border-width":2,"border-color":X}},{selector:`edge.highlighted`,style:{opacity:1,width:2,"line-color":X,"target-arrow-color":X,label:`data(label)`,"font-size":`7px`,color:X,"text-rotation":`autorotate`,"text-margin-y":-8}},{selector:`node.selected-node`,style:{"border-width":3,"border-color":`#fff`,"z-index":999}},{selector:`node.search-match`,style:{"border-width":3,"border-color":`#ff0`,"text-opacity":1,opacity:1,"z-index":999}}],layout:{name:`fcose`,animate:!1,quality:e.length>500?`default`:`proof`,nodeSeparation:e.length>500?120:75,nodeRepulsion:()=>e.length>500?8e3:4500,idealEdgeLength:()=>e.length>500?120:80,gravity:.25,gravityRange:3.8,numIter:e.length>500?1500:2500,tilingPaddingVertical:20,tilingPaddingHorizontal:20,uniformNodeDimensions:!1,packComponents:!0},minZoom:.05,maxZoom:8,wheelSensitivity:.3,pixelRatio:1});if(o.on(`mouseover`,`node`,e=>{Z(o,e.target.id())}),o.on(`mouseout`,`node`,()=>{Q(o),W&&Z(o,W.id)}),o.on(`tap`,`node`,e=>{let t=e.target.data();Q(o),Z(o,t.id),G(t)}),o.on(`tap`,e=>{e.target===o&&(Q(o),G(null))}),b){let e=o.getElementById(b);e.length>0&&(o.animate({center:{eles:e},zoom:2},{duration:300}),Z(o,b),G(e.data())),n(e=>{let t=new URLSearchParams(e);return t.delete(`focus`),t.delete(`scope`),t},{replace:!0})}y.current=o},$=(0,N.useCallback)(async t=>{if(e){T(!0),P(null),G(null),q(``);try{let n=await ie(e,t),r=n.nodes.filter(e=>!e.id.startsWith(`@`)),i=new Set(r.map(e=>e.id)),a=n.edges.filter(e=>i.has(e.source)&&i.has(e.target));U({nodes:r.length,edges:a.length}),le(r,a)}catch(e){P(e instanceof Error?e.message:String(e))}finally{T(!1)}}},[e]);(0,N.useEffect)(()=>($(x),()=>{y.current&&=(y.current.destroy(),null)}),[$,x]);let ue=e=>{q(e);let t=y.current;if(!t||(t.elements().removeClass(`search-match dimmed`),!e.trim()))return;let n=e.trim().toLowerCase(),r=t.nodes().filter(e=>{let t=e.data();return(t.label||``).toLowerCase().includes(n)||(t.id||``).toLowerCase().includes(n)||(t.title||``).toLowerCase().includes(n)||(t.name||``).toLowerCase().includes(n)});r.length>0&&(t.elements().not(r).addClass(`dimmed`),r.addClass(`search-match`),t.animate({fit:{eles:r,padding:40}},{duration:300}))},de=()=>{y.current?.animate({fit:{eles:y.current.elements(),padding:30}},{duration:200})},fe=()=>{let e=y.current;e&&e.animate({zoom:{level:e.zoom()*1.4,position:{x:e.width()/2,y:e.height()/2}}},{duration:150})},pe=()=>{let e=y.current;e&&e.animate({zoom:{level:e.zoom()/1.4,position:{x:e.width()/2,y:e.height()/2}}},{duration:150})},me=W?(()=>{let e=new Set([`id`,`label`,`color`,`graphType`,`graph`,`embedding`,`fileEmbedding`,`nodeSize`]),t=[];for(let[n,r]of Object.entries(W)){if(e.has(n)||r==null||r===``||typeof r==`object`&&!Array.isArray(r))continue;let i;if(Array.isArray(r)){if(r.length===0)continue;i=r.join(`, `)}else i=String(r);t.push((0,F.jsx)(A,{label:n,divider:!1,children:(0,F.jsx)(a,{variant:`body2`,sx:{wordBreak:`break-word`},children:i.length>200?i.slice(0,200)+`…`:i})},n))}return t})():[];return(0,F.jsxs)(c,{sx:{display:`flex`,flexDirection:`column`,height:`calc(100vh - 112px)`},children:[(0,F.jsx)(k,{breadcrumbs:[{label:`Graph`}],actions:(0,F.jsxs)(a,{variant:`body2`,sx:{color:h.custom.textMuted},children:[H.nodes,` nodes · `,H.edges,` edges`]})}),(0,F.jsxs)(c,{sx:{display:`flex`,gap:1,mb:2,alignItems:`center`,flexWrap:`wrap`},children:[(0,F.jsx)(f,{exclusive:!0,value:x,onChange:(e,t)=>{t&&S(t)},size:`small`,children:R.map(({scope:e,label:t,icon:n})=>(0,F.jsxs)(u,{value:e,sx:{gap:.5,textTransform:`none`},children:[n,t]},e))}),(0,F.jsx)(d,{size:`small`,placeholder:`Find node...`,value:K,onChange:e=>ue(e.target.value),sx:{width:200},slotProps:{input:{startAdornment:(0,F.jsx)(o,{position:`start`,children:(0,F.jsx)(w,{fontSize:`small`})})}}}),(0,F.jsxs)(c,{sx:{display:`flex`,gap:.25},children:[(0,F.jsx)(l,{title:`Zoom in`,children:(0,F.jsx)(p,{size:`small`,onClick:fe,children:(0,F.jsx)(_,{fontSize:`small`})})}),(0,F.jsx)(l,{title:`Zoom out`,children:(0,F.jsx)(p,{size:`small`,onClick:pe,children:(0,F.jsx)(re,{fontSize:`small`})})}),(0,F.jsx)(l,{title:`Fit to screen`,children:(0,F.jsx)(p,{size:`small`,onClick:de,children:(0,F.jsx)(v,{fontSize:`small`})})})]})]}),M&&(0,F.jsx)(ee,{severity:`error`,sx:{mb:2},children:M}),(0,F.jsxs)(c,{sx:{display:`flex`,flex:1,gap:2,minHeight:0},children:[(0,F.jsxs)(ne,{variant:`outlined`,sx:{flex:1,position:`relative`,overflow:`hidden`,minHeight:400,bgcolor:ce},children:[C&&(0,F.jsx)(c,{sx:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%,-50%)`,zIndex:1},children:(0,F.jsx)(te,{})}),(0,F.jsx)(`div`,{ref:g,style:{width:`100%`,height:`100%`}}),(0,F.jsx)(c,{sx:{position:`absolute`,bottom:8,left:8,display:`flex`,gap:.5,flexWrap:`wrap`},children:Object.entries(I).map(([e,t])=>(0,F.jsx)(s,{label:e,size:`small`,sx:{height:22,fontSize:10,fontWeight:600,bgcolor:`${t}33`,color:t,border:`1px solid ${t}66`,opacity:x===`all`||x===e?1:.3}},e))})]}),W&&(0,F.jsx)(c,{sx:{width:280,flexShrink:0,overflow:`auto`},children:(0,F.jsxs)(D,{title:`Node Inspector`,children:[(0,F.jsx)(c,{sx:{mb:1},children:(0,F.jsx)(E,{label:W.graphType,color:L[W.graphType]??`neutral`})}),(0,F.jsx)(a,{variant:`body1`,fontWeight:600,gutterBottom:!0,children:z(W)}),(0,F.jsxs)(c,{sx:{display:`flex`,alignItems:`center`,gap:.5,mb:1},children:[(0,F.jsx)(a,{variant:`caption`,sx:{wordBreak:`break-all`,color:h.custom.textMuted},children:W.id}),(0,F.jsx)(O,{value:W.id})]}),me]})})]})]})}export{H as default};
|