Skip to main content
Glama
system_status.store.ts1.49 kB
import { defineStore } from "pinia"; import { ApiRequest } from "@si/vue-lib/pinia"; import { useRealtimeStore } from "./realtime/realtime.store"; export const useSystemStatusStore = () => { const realtimeStore = useRealtimeStore(); return defineStore("system-status", { state: () => ({ // returns shorthand git sha from API apiGitBranch: null as string | null, // not supported on backend yet... apiGitSha: null as string | null, // TODO: currently set up to only work in dev mode, but probably always want this available /* eslint-disable @typescript-eslint/ban-ts-comment */ // TODO: ideally these would be injected into import.meta? // @ts-ignore webGitBranch: __VITE_GIT_BRANCH__, // @ts-ignore webGitSha: __VITE_GIT_SHA__, }), getters: {}, actions: { async CHECK_CURRENT_API_VERSION() { // does not actually return branch yet return new ApiRequest<{ sha: string; branch: string }>({ url: "/dev/get_current_git_sha", onSuccess: (response) => { this.apiGitSha = response.sha; this.apiGitBranch = response.branch || "main"; }, }); }, registerRequestsBegin(requestUlid: string, actionName: string) { realtimeStore.inflightRequests.set(requestUlid, actionName); }, registerRequestsEnd(requestUlid: string) { realtimeStore.inflightRequests.delete(requestUlid); }, }, })(); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server