Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions dashboard/src/api/modules/hostApps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { request } from "../request";

export interface HostAppItem {
id: string;
name: string;
path?: string;
kind: string;
format?: string;
transport?: string;
command?: string;
args?: string[];
url?: string;
source_path?: string;
enabled?: boolean;
}

export interface HostAppReport {
id: string;
label: string;
installed: boolean;
paths_checked: string[];
paths_found: string[];
skills: HostAppItem[];
plugins: HostAppItem[];
mcp: HostAppItem[];
notes: string;
}

export const hostAppsApi = {
list: () =>
request<{ hosts: HostAppReport[]; readonly: boolean }>("/host-apps"),
importItem: (body: {
host_id: string;
item_id: string;
kind: "skill" | "plugin" | "mcp";
}) =>
request<Record<string, unknown>>("/host-apps/import", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
}),
};
65 changes: 65 additions & 0 deletions dashboard/src/api/modules/knowledgeBases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,69 @@ export const knowledgeBasesApi = {
body: JSON.stringify({ new_name: newName }),
},
),

getMount: (id: string) =>
request<{
mounted: boolean;
readonly?: boolean;
kind?: "local" | "cloud";
source_path?: string;
distill_path?: string;
cloud_url?: string;
cloud_provider?: string;
entries: Array<{
path: string;
name: string;
is_dir: boolean;
size: number;
}>;
}>(`/knowledge-bases/${id}/mount`),

setMount: (
id: string,
source_path: string,
distill_path?: string,
extra?: {
kind?: "local" | "cloud";
cloud_url?: string;
cloud_provider?: string;
},
) =>
request<{
mounted: boolean;
source_path: string;
distill_path: string;
entries: Array<{
path: string;
name: string;
is_dir: boolean;
size: number;
}>;
}>(`/knowledge-bases/${id}/mount`, {
method: "PUT",
body: JSON.stringify({
source_path,
distill_path: distill_path || "",
kind: extra?.kind || "local",
cloud_url: extra?.cloud_url || "",
cloud_provider: extra?.cloud_provider || "",
}),
}),

clearMount: (id: string) =>
request<{ ok: boolean }>(`/knowledge-bases/${id}/mount`, {
method: "DELETE",
}),

distillMount: (id: string, distill_path: string) =>
request<{
source_path: string;
distill_path: string;
copied: number;
skipped: number;
readonly_source: boolean;
}>(`/knowledge-bases/${id}/mount/distill`, {
method: "POST",
body: JSON.stringify({ distill_path }),
}),
};
43 changes: 43 additions & 0 deletions dashboard/src/api/modules/localModels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { request } from "../request";

export interface LocalHardware {
os: string;
arch: string;
cpu_count: number;
ram_gb: number;
gpu: string;
ollama_binary: boolean;
ollama_reachable: boolean;
}

export interface LocalInstalledModel {
name: string;
path: string;
size: number;
source: string;
}

export interface LocalRecommendedModel {
id: string;
reason: string;
install: string;
}

export interface LocalProbe {
hardware: LocalHardware;
installed: LocalInstalledModel[];
recommended: LocalRecommendedModel[];
}

export const localModelsApi = {
probe: () => request<LocalProbe>("/local-models/probe"),
install: (name: string) =>
request<{ ok: boolean; name: string; size: number; source: string }>(
"/local-models/install",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name }),
},
),
};
16 changes: 16 additions & 0 deletions dashboard/src/api/modules/orgModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface OrgOverview {
last_loop: Record<string, unknown> | null;
notes: string[];
catalog: OrgCapability[];
module_toggles?: Record<string, boolean>;
}

export interface OrgSidecarStart {
Expand Down Expand Up @@ -139,4 +140,19 @@ export const orgModuleApi = {
headers: { "Content-Type": "application/json" },
body: JSON.stringify({}),
}),
setModules: (updates: Record<string, boolean>) =>
request<{ updates: Record<string, boolean> }>("/org-module/modules", {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ updates }),
}),
downloadSource: (dest: string) =>
request<{ ok: boolean; path: string; source: string }>(
"/org-module/source/download",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ dest }),
},
),
};
53 changes: 53 additions & 0 deletions dashboard/src/api/modules/projects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { request } from "../request";

export interface ProjectLink {
id: string;
title: string;
agent_id?: string;
}

export interface Project {
id: string;
name: string;
work_dir: string;
owner_user_id: number;
conversation_ids: string[];
task_ids: string[];
conversations?: ProjectLink[];
tasks?: ProjectLink[];
created_at: number;
updated_at: number;
}

export const projectsApi = {
list: () => request<{ projects: Project[] }>("/projects"),
create: (body: { name: string; work_dir?: string }) =>
request<Project>("/projects", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
}),
get: (id: string) => request<Project>(`/projects/${id}`),
update: (
id: string,
body: {
name?: string;
work_dir?: string;
conversation_ids?: string[];
task_ids?: string[];
},
) =>
request<Project>(`/projects/${id}`, {
method: "PATCH",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
}),
remove: (id: string) =>
request<{ ok: boolean }>(`/projects/${id}`, { method: "DELETE" }),
link: (id: string, kind: "conversation" | "task", ref_id: string) =>
request<Project>(`/projects/${id}/links`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ kind, ref_id }),
}),
};
28 changes: 28 additions & 0 deletions dashboard/src/layouts/Sidebar.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,34 @@
}
}

.composeRow {
display: flex;
flex-direction: column;
gap: 4px;
padding: 4px 12px 8px;
}

.composeBtn {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
border: none;
border-radius: var(--fn-radius-md);
background: color-mix(in srgb, var(--fn-accent, #0033ff) 8%, transparent);
color: var(--fn-text-secondary);
font-size: 12px;
line-height: 1.3;
text-align: left;
padding: 7px 10px;
cursor: pointer;
}

.composeBtn:hover {
background: color-mix(in srgb, var(--fn-accent, #0033ff) 14%, transparent);
color: var(--fn-text-primary);
}

.minimalPaneToggleCollapsed {
display: flex;
flex-direction: column;
Expand Down
Loading
Loading