summaryrefslogtreecommitdiff
path: root/makima/frontend/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/lib')
-rw-r--r--makima/frontend/src/lib/api.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts
index 43eaa05..458b69d 100644
--- a/makima/frontend/src/lib/api.ts
+++ b/makima/frontend/src/lib/api.ts
@@ -1222,6 +1222,42 @@ export async function restartDaemon(id: string): Promise<RestartDaemonResponse>
}
// =============================================================================
+// Daemon Platform Download
+// =============================================================================
+
+/** A daemon platform with its availability and download URL */
+export interface DaemonPlatform {
+ platform: string;
+ available: boolean;
+ downloadUrl: string;
+}
+
+/** Response from the list daemon platforms endpoint */
+export interface DaemonPlatformsResponse {
+ platforms: DaemonPlatform[];
+}
+
+/**
+ * List available daemon platforms and their download status.
+ * This is an unauthenticated endpoint.
+ */
+export async function listDaemonPlatforms(): Promise<DaemonPlatformsResponse> {
+ const res = await fetch(`${API_BASE}/api/v1/daemon/download/platforms`);
+ if (!res.ok) {
+ throw new Error(`Failed to list daemon platforms: ${res.statusText}`);
+ }
+ return res.json();
+}
+
+/**
+ * Get the full download URL for a daemon binary.
+ * Returns the absolute URL including API_BASE for cross-origin usage.
+ */
+export function getDaemonDownloadUrl(platform: string): string {
+ return `${API_BASE}/api/v1/daemon/download/${platform}`;
+}
+
+// =============================================================================
// Mesh Chat Types for Task Orchestration
// =============================================================================