fix(frontend): align skills bootstrap contract to b412 content_ids shape
This commit is contained in:
parent
75f62e7c15
commit
a21cd310ee
|
|
@ -53,7 +53,7 @@ export interface MaterializeSkillYamlResponse {
|
|||
|
||||
export interface BootstrapRemoteSkillRequest {
|
||||
thread_id: string;
|
||||
content_id: number;
|
||||
content_ids: number[];
|
||||
language_type?: number;
|
||||
target_dir?: string;
|
||||
clear_target?: boolean;
|
||||
|
|
@ -62,9 +62,10 @@ export interface BootstrapRemoteSkillRequest {
|
|||
export interface BootstrapRemoteSkillResponse {
|
||||
success: boolean;
|
||||
target_dir: string;
|
||||
content_ids: number[];
|
||||
created_directories: number;
|
||||
created_files: number;
|
||||
sandbox_id: string;
|
||||
sandbox_id: string | null;
|
||||
message: string;
|
||||
}
|
||||
|
||||
|
|
@ -134,14 +135,6 @@ export async function materializeSkillYaml(
|
|||
export async function bootstrapRemoteSkill(
|
||||
request: BootstrapRemoteSkillRequest,
|
||||
): Promise<BootstrapRemoteSkillResponse> {
|
||||
console.log("[skills/api] ========== bootstrapRemoteSkill START ==========");
|
||||
console.log("[skills/api] request:", JSON.stringify(request, null, 2));
|
||||
console.log("[skills/api] thread_id:", request.thread_id);
|
||||
console.log("[skills/api] content_id:", request.content_id);
|
||||
console.log("[skills/api] language_type:", request.language_type);
|
||||
console.log("[skills/api] target_dir:", request.target_dir);
|
||||
console.log("[skills/api] API URL:", `${getBackendBaseURL()}/api/skills/bootstrap-remote`);
|
||||
|
||||
const response = await fetch(
|
||||
`${getBackendBaseURL()}/api/skills/bootstrap-remote`,
|
||||
{
|
||||
|
|
@ -153,22 +146,12 @@ export async function bootstrapRemoteSkill(
|
|||
},
|
||||
);
|
||||
|
||||
console.log("[skills/api] response status:", response.status, response.statusText);
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
const errorMessage =
|
||||
errorData.detail ?? `HTTP ${response.status}: ${response.statusText}`;
|
||||
console.error("[skills/api] bootstrapRemoteSkill FAILED:", errorMessage);
|
||||
console.error("[skills/api] error data:", errorData);
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
console.log("[skills/api] bootstrapRemoteSkill SUCCESS:", result);
|
||||
console.log("[skills/api] created_directories:", result.created_directories);
|
||||
console.log("[skills/api] created_files:", result.created_files);
|
||||
console.log("[skills/api] sandbox_id:", result.sandbox_id);
|
||||
console.log("[skills/api] ========== bootstrapRemoteSkill END ==========");
|
||||
return result;
|
||||
return response.json();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export function useSelectedSkillListener({
|
|||
try {
|
||||
const result = await bootstrapRemoteSkill({
|
||||
thread_id: threadId,
|
||||
content_id: Number(id),
|
||||
content_ids: [Number(id)],
|
||||
language_type: languageType,
|
||||
target_dir: "/mnt/user-data/uploads/skill",
|
||||
clear_target: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue