[nexus] fix: resolve rebase artifacts — duplicate function, missing import, stale SDK types
This commit is contained in:
parent
3abe91ab43
commit
f85cab192a
2 changed files with 1 additions and 18 deletions
|
|
@ -30,6 +30,7 @@ import { loadConfig } from "./config.js";
|
||||||
import { logger } from "./middleware/logger.js";
|
import { logger } from "./middleware/logger.js";
|
||||||
import { setupLiveEventsWebSocketServer } from "./realtime/live-events-ws.js";
|
import { setupLiveEventsWebSocketServer } from "./realtime/live-events-ws.js";
|
||||||
import {
|
import {
|
||||||
|
agentService,
|
||||||
feedbackService,
|
feedbackService,
|
||||||
heartbeatService,
|
heartbeatService,
|
||||||
reconcilePersistedRuntimeServicesOnStartup,
|
reconcilePersistedRuntimeServicesOnStartup,
|
||||||
|
|
|
||||||
|
|
@ -25,24 +25,6 @@ async function resolveSkillsDirForAgent(db: Db, agentId: string): Promise<string
|
||||||
return config.skillDir.replace(/^~/, os.homedir());
|
return config.skillDir.replace(/^~/, os.homedir());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolves the agentSkillsDir for a given agentId by looking up the agent's
|
|
||||||
* adapter type and calling resolveAdapterSkillConfig. Throws with a status
|
|
||||||
* property so route handlers can forward the correct HTTP status code.
|
|
||||||
*/
|
|
||||||
async function resolveSkillsDirForAgent(db: Db, agentId: string): Promise<string> {
|
|
||||||
const agent = await agentService(db).getById(agentId);
|
|
||||||
if (!agent) throw Object.assign(new Error("Agent not found"), { status: 404 });
|
|
||||||
const config = resolveAdapterSkillConfig(agent.adapterType);
|
|
||||||
if (!config.supportsInstall || !config.skillDir) {
|
|
||||||
throw Object.assign(
|
|
||||||
new Error(config.unsupportedReason ?? "Adapter does not support skill install"),
|
|
||||||
{ status: 422 },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return config.skillDir.replace(/^~/, os.homedir());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* REST routes for skill groups.
|
* REST routes for skill groups.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue