5.1.0 — Hive Search command (Meilisearch commander_hive)
This commit is contained in:
parent
3306a33e53
commit
11f9623906
14
.vsixmanifest
Normal file
14
.vsixmanifest
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="alfred-commander" Version="5.0.0" Publisher="gositeme"/>
|
||||
<DisplayName>Alfred Commander</DisplayName>
|
||||
<Description>Alfred Commander 5.0.0</Description>
|
||||
<Tags>alfred</Tags>
|
||||
<Categories>Other</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
</Metadata>
|
||||
<Installation><InstallationTarget Id="Microsoft.VisualStudio.Code"/></Installation>
|
||||
<Dependencies/>
|
||||
<Assets><Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true"/></Assets>
|
||||
</PackageManifest>
|
||||
48
extension.js
48
extension.js
@ -1164,6 +1164,54 @@ function activate(context) {
|
||||
});
|
||||
})
|
||||
);
|
||||
// ===== Hive Search (Meilisearch commander_hive index) =====
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand('alfred-commander.hiveSearch', async () => {
|
||||
const http = require('http');
|
||||
const q = await vscode.window.showInputBox({
|
||||
prompt: 'Hive Search — search 174k+ indexed docs',
|
||||
placeHolder: 'e.g. vault key, reunion protocol, sabbath, custody',
|
||||
ignoreFocusOut: true
|
||||
});
|
||||
if (!q) return;
|
||||
const KEY = '885a895594cd2fa973ef1956547c2c25';
|
||||
const body = JSON.stringify({ q: q, limit: 30, attributesToRetrieve: ['title','path','snippet','folder','kind','ext'] });
|
||||
const opts = {
|
||||
hostname:'127.0.0.1', port:7700, method:'POST',
|
||||
path:'/indexes/commander_hive/search',
|
||||
headers:{ 'Authorization':'Bearer '+KEY, 'Content-Type':'application/json', 'Content-Length':Buffer.byteLength(body) }
|
||||
};
|
||||
const hits = await new Promise((resolve, reject) => {
|
||||
const req = http.request(opts, res => {
|
||||
let buf=''; res.setEncoding('utf8');
|
||||
res.on('data', d => buf += d);
|
||||
res.on('end', () => { try { resolve(JSON.parse(buf).hits || []); } catch (e) { reject(e); } });
|
||||
});
|
||||
req.on('error', reject);
|
||||
req.write(body); req.end();
|
||||
}).catch(err => { vscode.window.showErrorMessage('Hive: '+err.message); return []; });
|
||||
if (!hits.length) { vscode.window.showInformationMessage('Hive: no results for "'+q+'"'); return; }
|
||||
const items = hits.map(h => ({
|
||||
label: '$(search) ' + (h.title || h.path || '(untitled)'),
|
||||
description: (h.folder ? '['+h.folder+'] ' : '') + (h.kind || h.ext || ''),
|
||||
detail: (h.snippet || '').slice(0, 240).replace(/\s+/g,' '),
|
||||
_path: h.path
|
||||
}));
|
||||
const pick = await vscode.window.showQuickPick(items, {
|
||||
placeHolder: 'Hive: '+hits.length+' results — pick to open',
|
||||
matchOnDescription: true, matchOnDetail: true
|
||||
});
|
||||
if (!pick || !pick._path) return;
|
||||
try {
|
||||
const doc = await vscode.workspace.openTextDocument(pick._path);
|
||||
await vscode.window.showTextDocument(doc);
|
||||
} catch (e) {
|
||||
vscode.env.clipboard.writeText(pick._path);
|
||||
vscode.window.showWarningMessage('Hive: could not open ('+e.message+'). Path copied to clipboard.');
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
const statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100);
|
||||
statusBar.text = '$(mic) Alfred';
|
||||
statusBar.tooltip = 'Alfred — Toggle mic (Ctrl+Shift+Alt+A)';
|
||||
|
||||
10
package.json
10
package.json
@ -2,7 +2,7 @@
|
||||
"name": "alfred-commander",
|
||||
"displayName": "Alfred IDE Assistant \u2014 Full IDE Chat & Voice",
|
||||
"description": "Alfred Commander v5 Kingdom Edition \u2014 AI chat, voice AI, model routing, memory engine, cost tracking, session persistence, fleet commander. The sovereign IDE brain.",
|
||||
"version": "5.0.0",
|
||||
"version": "5.1.0",
|
||||
"publisher": "gositeme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -62,8 +62,8 @@
|
||||
"title": "Alfred: Kingdom Vault"
|
||||
},
|
||||
{
|
||||
"command": "alfred-commander.vaultPanel",
|
||||
"title": "Alfred: Kingdom Vault"
|
||||
"command": "alfred-commander.hiveSearch",
|
||||
"title": "Alfred: Hive Search"
|
||||
}
|
||||
],
|
||||
"keybindings": [
|
||||
@ -161,8 +161,8 @@
|
||||
]
|
||||
},
|
||||
"__metadata": {
|
||||
"installedTimestamp": 1774281381634,
|
||||
"installedTimestamp": 1777392313978,
|
||||
"targetPlatform": "undefined",
|
||||
"size": 75665
|
||||
"size": 250117
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user