mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:56:44 +00:00
Go-live runtime sync and control plane hardening (#1)
* Implement Mika runtime sync and go-live controls * Add CI validation workflow * Align CI with validated runtime checks * Fix Mika CI install workflow
This commit is contained in:
parent
cb54fa4666
commit
d87ea2657c
31 changed files with 4019 additions and 95 deletions
35
src/lib/ollama-models.ts
Normal file
35
src/lib/ollama-models.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
export const DEFAULT_OLLAMA_PROVIDER = "ollama-cloud";
|
||||
export const DEFAULT_OLLAMA_MODEL = "gemma4:31b-cloud";
|
||||
|
||||
const LEGACY_MODEL_ALIASES: Record<string, string> = {
|
||||
"openrouter/google/gemma-4-27b-a4b-it": DEFAULT_OLLAMA_MODEL,
|
||||
"openrouter/google/gemma-4-31b-it": DEFAULT_OLLAMA_MODEL,
|
||||
"ollama-cloud/gemma4:31b-cloud": DEFAULT_OLLAMA_MODEL,
|
||||
};
|
||||
|
||||
export function normalizeOllamaModelSelection(value?: string | null): string {
|
||||
const trimmed = (value ?? "").trim();
|
||||
if (!trimmed) return DEFAULT_OLLAMA_MODEL;
|
||||
|
||||
const mapped = LEGACY_MODEL_ALIASES[trimmed];
|
||||
if (mapped) return mapped;
|
||||
|
||||
if (trimmed.includes("/") && trimmed.includes(":")) {
|
||||
const candidate = trimmed.split("/").pop()?.trim();
|
||||
if (candidate) return candidate;
|
||||
}
|
||||
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
export function formatOllamaModelLabel(modelName: string): string {
|
||||
if (modelName === DEFAULT_OLLAMA_MODEL) {
|
||||
return "Gemma 4 31B Cloud — Padrão Mika";
|
||||
}
|
||||
|
||||
if (modelName.startsWith("gemma4:")) {
|
||||
return modelName.replace("gemma4:", "Gemma 4 ");
|
||||
}
|
||||
|
||||
return modelName;
|
||||
}
|
||||
24
src/lib/sync-agent-runtime.ts
Normal file
24
src/lib/sync-agent-runtime.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { invokeFunction } from "@/lib/invoke-function";
|
||||
|
||||
type RuntimeSyncScope = "cronjobs" | "integrations" | "all";
|
||||
|
||||
export async function syncAgentRuntime(
|
||||
agentInstanceId: string,
|
||||
scope: RuntimeSyncScope = "all",
|
||||
) {
|
||||
return await invokeFunction<{
|
||||
success: boolean;
|
||||
agent_instance_id: string;
|
||||
public_url: string;
|
||||
public_domain: string;
|
||||
cronjobs_synced_count: number;
|
||||
integrations_synced_count: number;
|
||||
runtime_responses: {
|
||||
cronjobs: unknown;
|
||||
integrations: unknown;
|
||||
};
|
||||
}>("sync-agent-runtime", {
|
||||
agent_instance_id: agentInstanceId,
|
||||
scope,
|
||||
});
|
||||
}
|
||||
18
src/lib/sync-agent-skills.ts
Normal file
18
src/lib/sync-agent-skills.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
"use client";
|
||||
|
||||
import { invokeFunction } from "@/lib/invoke-function";
|
||||
|
||||
export interface SyncAgentSkillsResponse {
|
||||
success?: boolean;
|
||||
agent_instance_id?: string;
|
||||
public_url?: string;
|
||||
public_domain?: string;
|
||||
synced_count?: number;
|
||||
runtime_response?: unknown;
|
||||
}
|
||||
|
||||
export async function syncAgentSkills(agentInstanceId: string) {
|
||||
return await invokeFunction<SyncAgentSkillsResponse>("sync-agent-skills", {
|
||||
agent_instance_id: agentInstanceId,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue