feat(quick-pane): refine spotlight workflow
This commit is contained in:
@@ -1205,6 +1205,16 @@ export function createAgentRegistry({
|
||||
if (!runtime.ephemeral) throw new Error("runtime is not a quick runtime");
|
||||
return closeRuntime(runtimeId);
|
||||
},
|
||||
async getModelCatalog() {
|
||||
const runtime = [...runtimesByAgentId.values()].find(
|
||||
(candidate) => candidate.adapter,
|
||||
);
|
||||
if (!runtime?.adapter) return [];
|
||||
const response = await enqueue(runtime, () =>
|
||||
runtime.adapter.send({ type: "get_available_models" }),
|
||||
);
|
||||
return response?.data?.models ?? [];
|
||||
},
|
||||
listAgents() {
|
||||
return [...runtimesByAgentId.values()]
|
||||
.map(publicAgent)
|
||||
|
||||
@@ -40,6 +40,8 @@ export async function startBridgeService({
|
||||
return registry.getWorkspace();
|
||||
case "get_workspace_summary":
|
||||
return registry.getWorkspaceSummary();
|
||||
case "get_model_catalog":
|
||||
return { models: await registry.getModelCatalog() };
|
||||
case "create_session_runtime":
|
||||
return {
|
||||
runtime: await registry.createSessionRuntime(
|
||||
|
||||
@@ -11,6 +11,7 @@ const requestOperations = new Map([
|
||||
["forget_directory", { agent: false, payload: "worktree" }],
|
||||
["get_workspace", { agent: false, payload: "none" }],
|
||||
["get_workspace_summary", { agent: false, payload: "none" }],
|
||||
["get_model_catalog", { agent: false, payload: "none" }],
|
||||
["create_session_runtime", { agent: false, payload: "worktree" }],
|
||||
["create_quick_runtime", { agent: false, payload: "worktree" }],
|
||||
["open_session_runtime", { agent: false, payload: "worktreeSession" }],
|
||||
|
||||
Reference in New Issue
Block a user