@geminilight/mindos 0.6.23 → 0.6.25
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/app/app/.well-known/agent-card.json/route.ts +34 -0
- package/app/app/api/a2a/route.ts +100 -0
- package/app/components/Backlinks.tsx +2 -2
- package/app/components/Breadcrumb.tsx +1 -1
- package/app/components/CsvView.tsx +41 -19
- package/app/components/DirView.tsx +2 -2
- package/app/components/GuideCard.tsx +6 -2
- package/app/components/HomeContent.tsx +1 -1
- package/app/components/SearchModal.tsx +3 -3
- package/app/components/SyncStatusBar.tsx +2 -2
- package/app/components/ask/AskContent.tsx +1 -1
- package/app/components/ask/MentionPopover.tsx +2 -2
- package/app/components/ask/SlashCommandPopover.tsx +1 -1
- package/app/components/explore/UseCaseCard.tsx +2 -2
- package/app/components/help/HelpContent.tsx +6 -1
- package/app/components/panels/AgentsPanelAgentDetail.tsx +2 -2
- package/app/components/panels/DiscoverPanel.tsx +3 -3
- package/app/components/panels/PanelNavRow.tsx +2 -2
- package/app/components/panels/PluginsPanel.tsx +1 -1
- package/app/components/panels/SearchPanel.tsx +3 -3
- package/app/components/renderers/summary/SummaryRenderer.tsx +1 -1
- package/app/components/settings/AiTab.tsx +4 -4
- package/app/components/settings/KnowledgeTab.tsx +1 -1
- package/app/components/settings/McpTab.tsx +22 -4
- package/app/components/settings/UpdateTab.tsx +1 -1
- package/app/components/setup/index.tsx +9 -3
- package/app/components/walkthrough/WalkthroughProvider.tsx +2 -2
- package/app/lib/a2a/agent-card.ts +107 -0
- package/app/lib/a2a/index.ts +23 -0
- package/app/lib/a2a/task-handler.ts +228 -0
- package/app/lib/a2a/types.ts +158 -0
- package/bin/cli.js +10 -0
- package/bin/commands/agent.js +18 -0
- package/bin/commands/api.js +58 -0
- package/bin/commands/search.js +51 -0
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { bold, dim, cyan, red } from '../lib/colors.js';
|
|
2
|
+
import { loadConfig } from '../lib/config.js';
|
|
3
|
+
import { output, isJsonMode } from '../lib/command.js';
|
|
4
|
+
|
|
5
|
+
export const meta = {
|
|
6
|
+
name: 'search', group: 'Knowledge',
|
|
7
|
+
summary: 'Search knowledge base via API',
|
|
8
|
+
usage: 'mindos search "<query>"',
|
|
9
|
+
examples: ['mindos search "meeting notes"', 'mindos search "RAG" --limit 5 --json'],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export async function run(args, flags) {
|
|
13
|
+
const query = args.join(' ');
|
|
14
|
+
if (!query || flags.help || flags.h) {
|
|
15
|
+
console.log(bold('mindos search') + ' — Knowledge base search');
|
|
16
|
+
console.log('');
|
|
17
|
+
console.log('Usage: mindos search "<query>"');
|
|
18
|
+
console.log('Flags: --limit <n> (default 20), --json');
|
|
19
|
+
console.log('Note: MindOS must be running. Offline: mindos file search "<query>"');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
loadConfig();
|
|
23
|
+
const port = flags.port || process.env.MINDOS_WEB_PORT || '3456';
|
|
24
|
+
const token = process.env.MINDOS_AUTH_TOKEN || '';
|
|
25
|
+
const limit = parseInt(flags.limit) || 20;
|
|
26
|
+
const headers = {};
|
|
27
|
+
if (token) headers['Authorization'] = 'Bearer ' + token;
|
|
28
|
+
try {
|
|
29
|
+
const res = await fetch('http://localhost:' + port + '/api/search?q=' + encodeURIComponent(query) + '&limit=' + limit, { headers });
|
|
30
|
+
if (!res.ok) throw new Error('API error (' + res.status + ')');
|
|
31
|
+
const data = await res.json();
|
|
32
|
+
const results = data.results || data || [];
|
|
33
|
+
if (isJsonMode(flags)) { output({ query, count: results.length, results }, flags); return; }
|
|
34
|
+
if (results.length === 0) { console.log(dim('No results for "' + query + '"')); return; }
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log(bold('Search: "' + query + '" (' + results.length + ' results)'));
|
|
37
|
+
console.log('');
|
|
38
|
+
for (const r of results) {
|
|
39
|
+
const path = r.path || r.filePath || r.name || 'unknown';
|
|
40
|
+
const snippet = r.snippet || r.preview || r.excerpt || '';
|
|
41
|
+
const score = r.score ? dim(' (' + (r.score * 100).toFixed(0) + '%)') : '';
|
|
42
|
+
console.log(' ' + cyan(path) + score);
|
|
43
|
+
if (snippet) { for (const line of snippet.split('\n').slice(0, 2)) { console.log(' ' + dim(line.trim().slice(0, 100))); } }
|
|
44
|
+
}
|
|
45
|
+
console.log('');
|
|
46
|
+
} catch (err) {
|
|
47
|
+
if (err.cause && err.cause.code === 'ECONNREFUSED') { console.error(red('MindOS not running. Offline: mindos file search "' + query + '"')); }
|
|
48
|
+
else { console.error(red(err.message)); }
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
package/package.json
CHANGED