| use axum::{extract::State, Json}; |
| use serde::Serialize; |
|
|
| use crate::app_state::AppState; |
|
|
| const MASTER_MODEL: &str = "Maris Core Reasoning"; |
|
|
| #[derive(Serialize, Clone)] |
| pub struct MasterModelInfo { |
| pub name: &'static str, |
| pub role: &'static str, |
| pub routing_strategy: &'static str, |
| pub primary_capabilities: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct SpecialistBranch { |
| pub capability: &'static str, |
| pub branch: &'static str, |
| pub kind: &'static str, |
| pub profile: &'static str, |
| pub model: &'static str, |
| pub endpoint: &'static str, |
| pub studio: &'static str, |
| pub description: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct VisionModule { |
| pub capability: &'static str, |
| pub title: &'static str, |
| pub stage: &'static str, |
| pub outputs: Vec<&'static str>, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct CapabilityEntry { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub surface: &'static str, |
| pub runtime: &'static str, |
| pub lifecycle: &'static str, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct CapabilityDomain { |
| pub domain: &'static str, |
| pub description: &'static str, |
| pub capabilities: Vec<CapabilityEntry>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct GovernanceSection { |
| pub tenancy_model: Vec<&'static str>, |
| pub permissions_model: Vec<&'static str>, |
| pub audit_model: Vec<&'static str>, |
| pub policy_model: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct EventModel { |
| pub timeline_stream: &'static str, |
| pub event_types: Vec<&'static str>, |
| pub metrics: Vec<&'static str>, |
| pub usage_dimensions: Vec<&'static str>, |
| pub cost_dimensions: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct MemoryMode { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub inputs: Vec<&'static str>, |
| pub controls: Vec<&'static str>, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct MemoryManifest { |
| pub graph_model: &'static str, |
| pub ingestion_pipeline: Vec<&'static str>, |
| pub retrieval_policies: Vec<&'static str>, |
| pub modes: Vec<MemoryMode>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct ToolManifest { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub version: &'static str, |
| pub category: &'static str, |
| pub runtime: &'static str, |
| pub permissions: Vec<&'static str>, |
| pub sandbox: &'static str, |
| pub quota: &'static str, |
| pub health: &'static str, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct ToolingManifest { |
| pub runtime_contract: Vec<&'static str>, |
| pub discovery: Vec<&'static str>, |
| pub tools: Vec<ToolManifest>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct AutonomousRuntimeManifest { |
| pub stream_transport: &'static str, |
| pub operator_surfaces: Vec<&'static str>, |
| pub agent_roles: Vec<&'static str>, |
| pub replay_features: Vec<&'static str>, |
| pub approval_features: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct EvalSuiteManifest { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub focus: &'static str, |
| pub cadence: &'static str, |
| pub automation: &'static str, |
| pub signals: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct RegressionSuiteManifest { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub scope: &'static str, |
| pub trigger: &'static str, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct OutcomeMetricManifest { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub weight_percent: u8, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct ClosedLoopManifest { |
| pub failure_sources: Vec<&'static str>, |
| pub recommendation_targets: Vec<&'static str>, |
| pub safe_optimization_controls: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct LeaderboardManifest { |
| pub title: &'static str, |
| pub ranking_dimensions: Vec<&'static str>, |
| pub refresh_policy: &'static str, |
| pub benchmark_surfaces: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct SelfImprovementManifest { |
| pub eval_suites: Vec<EvalSuiteManifest>, |
| pub regression_suites: Vec<RegressionSuiteManifest>, |
| pub outcome_metrics: Vec<OutcomeMetricManifest>, |
| pub closed_loop: ClosedLoopManifest, |
| pub leaderboard: LeaderboardManifest, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct RuntimeCapability { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub scope: &'static str, |
| pub summary: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct ProcessRuntimeManifest { |
| pub runtime_surfaces: Vec<&'static str>, |
| pub background_capabilities: Vec<RuntimeCapability>, |
| pub secrets_handling: Vec<&'static str>, |
| pub environment_profiles: Vec<&'static str>, |
| pub artifact_store: Vec<&'static str>, |
| pub workspace_model: Vec<&'static str>, |
| pub operations_console: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct PluginPlatformManifest { |
| pub manifest_contract: Vec<&'static str>, |
| pub review_process: Vec<&'static str>, |
| pub signature_trust: Vec<&'static str>, |
| pub permissions_model: Vec<&'static str>, |
| pub billing_hooks: Vec<&'static str>, |
| pub lifecycle_management: Vec<&'static str>, |
| pub admin_approval_model: Vec<&'static str>, |
| pub listing_metadata: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct TranslationLayerManifest { |
| pub translation_planes: Vec<&'static str>, |
| pub locale_aware_ux: Vec<&'static str>, |
| pub prompt_normalization: Vec<&'static str>, |
| pub cross_lingual_memory: Vec<&'static str>, |
| pub multimodal_consistency: Vec<&'static str>, |
| pub terminology_dictionaries: Vec<&'static str>, |
| pub persona_localization: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct PlatformContractObject { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub summary: &'static str, |
| pub primary_store: &'static str, |
| pub api_contract: &'static str, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct PlatformContractsManifest { |
| pub schema_path: &'static str, |
| pub sdk_contracts: Vec<&'static str>, |
| pub timeline_model: Vec<&'static str>, |
| pub core_objects: Vec<PlatformContractObject>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct HealthSignalManifest { |
| pub id: &'static str, |
| pub title: &'static str, |
| pub track: &'static str, |
| pub recovery_levers: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct DiagnosticsManifest { |
| pub incident_fields: Vec<&'static str>, |
| pub health_signals: Vec<HealthSignalManifest>, |
| pub guardrail_actions: Vec<&'static str>, |
| pub degradation_modes: Vec<&'static str>, |
| pub recovery_actions: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct CloudCapabilityManifest { |
| pub identity_objects: Vec<&'static str>, |
| pub access_controls: Vec<&'static str>, |
| pub billing_objects: Vec<&'static str>, |
| pub compliance_controls: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct RoboticsCapabilityManifest { |
| pub separation_boundary: Vec<&'static str>, |
| pub device_registry: Vec<&'static str>, |
| pub execution_plane: Vec<&'static str>, |
| pub safety_controls: Vec<&'static str>, |
| pub simulator_workflow: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct OperatorOsManifest { |
| pub centers: Vec<&'static str>, |
| pub shared_models: Vec<&'static str>, |
| pub shell_properties: Vec<&'static str>, |
| pub external_contracts: Vec<&'static str>, |
| } |
|
|
| #[derive(Serialize, Clone)] |
| pub struct SystemInfo { |
| pub name: &'static str, |
| pub description: &'static str, |
| pub capabilities: Vec<&'static str>, |
| pub model: &'static str, |
| pub author: String, |
| pub orchestration_mode: &'static str, |
| pub master_model: MasterModelInfo, |
| pub branches: Vec<SpecialistBranch>, |
| pub vision_stack: Vec<VisionModule>, |
| pub vision_guardrails: Vec<&'static str>, |
| pub capability_registry: Vec<CapabilityDomain>, |
| pub governance: GovernanceSection, |
| pub event_model: EventModel, |
| pub memory_manifest: MemoryManifest, |
| pub tooling_manifest: ToolingManifest, |
| pub autonomous_runtime: AutonomousRuntimeManifest, |
| pub self_improvement: SelfImprovementManifest, |
| pub process_runtime: ProcessRuntimeManifest, |
| pub plugin_platform: PluginPlatformManifest, |
| pub translation_layer: TranslationLayerManifest, |
| pub platform_contracts: PlatformContractsManifest, |
| pub diagnostics: DiagnosticsManifest, |
| pub cloud: CloudCapabilityManifest, |
| pub robotics: RoboticsCapabilityManifest, |
| pub operator_os: OperatorOsManifest, |
| } |
|
|
| pub async fn system_info(State(state): State<AppState>) -> Json<SystemInfo> { |
| Json(build_platform_manifest(build_author(&state))) |
| } |
|
|
| pub fn build_author(state: &AppState) -> String { |
| format!( |
| "{} — {}", |
| state |
| .settings |
| .owner_display_name |
| .clone() |
| .unwrap_or_else(|| "Māris".to_string()), |
| state.settings.owner_title |
| ) |
| } |
|
|
| pub fn build_platform_manifest(author: String) -> SystemInfo { |
| let branches = vec![ |
| SpecialistBranch { |
| capability: "text_chat", |
| branch: "master", |
| kind: "master", |
| profile: "general", |
| model: MASTER_MODEL, |
| endpoint: "/api/chat", |
| studio: "/chat", |
| description: "Galvenais reasoning un sarunu atzars ikdienas dialogam.", |
| }, |
| SpecialistBranch { |
| capability: "code_generation", |
| branch: "coder", |
| kind: "adapter", |
| profile: "coder", |
| model: MASTER_MODEL, |
| endpoint: "/api/code", |
| studio: "/code", |
| description: "Programmēšanas atzars tehniskiem uzdevumiem un koda ģenerēšanai.", |
| }, |
| SpecialistBranch { |
| capability: "autonomous_tasks", |
| branch: "planner", |
| kind: "adapter", |
| profile: "planner", |
| model: MASTER_MODEL, |
| endpoint: "/api/autonomous/start", |
| studio: "/autonomous", |
| description: "Plānošanas atzars ilgākiem mērķiem un secīgiem uzdevumiem.", |
| }, |
| SpecialistBranch { |
| capability: "voice_conversation", |
| branch: "voice", |
| kind: "specialist_model", |
| profile: "voice", |
| model: "Maris Voice Runtime", |
| endpoint: "/api/voice/synthesize", |
| studio: "/voice", |
| description: "Balss atzars STT/TTS darbībām un runas sesijām.", |
| }, |
| SpecialistBranch { |
| capability: "image_generation", |
| branch: "vision", |
| kind: "specialist_model", |
| profile: "image", |
| model: "Maris Vision Canvas", |
| endpoint: "/api/images", |
| studio: "/images", |
| description: "Attēlu ģenerēšanas modelis vizuālajai produkcijai.", |
| }, |
| SpecialistBranch { |
| capability: "music_generation", |
| branch: "music", |
| kind: "specialist_model", |
| profile: "music", |
| model: "Maris Audio Composer", |
| endpoint: "/api/music", |
| studio: "/music", |
| description: "Mūzikas ģenerēšanas modelis audio kompozīcijai.", |
| }, |
| SpecialistBranch { |
| capability: "video_generation", |
| branch: "video", |
| kind: "specialist_model", |
| profile: "video", |
| model: "Maris Motion Studio", |
| endpoint: "/api/video", |
| studio: "/video", |
| description: "Video ģenerēšanas modelis renderiem un klipiem.", |
| }, |
| ]; |
|
|
| let vision_stack = vec![ |
| VisionModule { |
| capability: "object_detection", |
| title: "Object detection", |
| stage: "core", |
| outputs: vec!["bounding boxes", "classes", "confidence"], |
| summary: "Atrod cilvēkus, mašīnas, telefonus, krēslus un citus objektus vienā kadrā.", |
| }, |
| VisionModule { |
| capability: "object_tracking", |
| title: "Object tracking", |
| stage: "core", |
| outputs: vec!["track IDs", "trajectories", "speed hints"], |
| summary: "Seko objektiem laikā un saglabā identitāti starp kadriem.", |
| }, |
| VisionModule { |
| capability: "segmentation", |
| title: "Segmentation", |
| stage: "core", |
| outputs: vec!["instance masks", "semantic masks", "polygons"], |
| summary: "Dod precīzas objektu formas, ne tikai rāmjus ap tiem.", |
| }, |
| VisionModule { |
| capability: "pose_estimation", |
| title: "Pose estimation", |
| stage: "core", |
| outputs: vec!["body keypoints", "hand keypoints", "skeleton graph"], |
| summary: "Atpazīst ķermeņa pozu, žestus, pointing un skatiena virziena kontekstu.", |
| }, |
| VisionModule { |
| capability: "face_detection", |
| title: "Face detection", |
| stage: "core", |
| outputs: vec!["face boxes", "landmarks", "quality score"], |
| summary: "Atrod sejas un novērtē to kvalitāti tālākai analīzei.", |
| }, |
| VisionModule { |
| capability: "face_recognition", |
| title: "Face recognition", |
| stage: "restricted", |
| outputs: vec!["identity match", "embedding", "audit event"], |
| summary: "Atšķir cilvēkus tikai ar skaidru piekrišanu, audit trail un juridisku kontroli.", |
| }, |
| VisionModule { |
| capability: "action_recognition", |
| title: "Action recognition", |
| stage: "core", |
| outputs: vec!["action label", "temporal window", "confidence"], |
| summary: "Nosaka darbības, piemēram, skrien, sēž, ceļ, met, filmē vai runā.", |
| }, |
| VisionModule { |
| capability: "scene_understanding", |
| title: "Scene understanding", |
| stage: "core", |
| outputs: vec![ |
| "relationship graph", |
| "natural language summary", |
| "risk tags", |
| ], |
| summary: "Sasaista objektus, darbības un telpiskās attiecības vienotā aprakstā.", |
| }, |
| VisionModule { |
| capability: "ocr_document_ai", |
| title: "OCR + document understanding", |
| stage: "advanced", |
| outputs: vec!["recognized text", "layout blocks", "structured fields"], |
| summary: "Izlasa tekstu no bildēm, dokumentiem, ekrāniem un plakātiem.", |
| }, |
| VisionModule { |
| capability: "visual_grounding", |
| title: "Visual grounding", |
| stage: "advanced", |
| outputs: vec!["phrase-to-region links", "point targets", "evidence regions"], |
| summary: "Savieno tekstu ar precīzu vietu attēlā, lai AI zinātu par ko runā.", |
| }, |
| VisionModule { |
| capability: "depth_estimation", |
| title: "Depth estimation", |
| stage: "advanced", |
| outputs: vec!["depth map", "distance bands", "3D cues"], |
| summary: "Novērtē attālumu, dziļumu un 3D telpas struktūru no kadra.", |
| }, |
| VisionModule { |
| capability: "anomaly_detection", |
| title: "Anomaly detection", |
| stage: "advanced", |
| outputs: vec!["anomaly score", "hotspots", "alert label"], |
| summary: "Pamana neparastus notikumus, kustības vai bīstamas situācijas.", |
| }, |
| VisionModule { |
| capability: "re_identification", |
| title: "Re-identification", |
| stage: "advanced", |
| outputs: vec!["cross-camera match", "track continuity", "confidence"], |
| summary: "Savieno vienu un to pašu cilvēku vai objektu starp dažādām kamerām.", |
| }, |
| VisionModule { |
| capability: "multi_camera_fusion", |
| title: "Multi-camera fusion", |
| stage: "advanced", |
| outputs: vec!["global scene map", "cross-view tracks", "coverage gaps"], |
| summary: "Apvieno vairākas kameras vienā kopīgā telpas un notikumu skatā.", |
| }, |
| ]; |
|
|
| let capability_registry = vec![ |
| CapabilityDomain { |
| domain: "agents", |
| description: "Vienota agentu sistēma ar planner, executor, reviewer un operator lomām.", |
| capabilities: vec![ |
| CapabilityEntry { |
| id: "autonomous_sessions", |
| title: "Autonomous sessions", |
| surface: "/api/autonomous/*", |
| runtime: "backend-rust + core-python", |
| lifecycle: "streaming", |
| summary: "Live goal planning, task graph, timeline replay un checkpoint resume.", |
| }, |
| CapabilityEntry { |
| id: "persona_routing", |
| title: "Persona routing", |
| surface: "/api/chat + /api/autonomous/start", |
| runtime: "backend-rust + core-python", |
| lifecycle: "request + stream", |
| summary: "Chat un autonomous sesijās izmanto konsekventus persona-aware modeļus.", |
| }, |
| ], |
| }, |
| CapabilityDomain { |
| domain: "memory", |
| description: "Multimodāls atmiņas grafiks ar sesijām, embeddings un operatora kontroli.", |
| capabilities: vec![ |
| CapabilityEntry { |
| id: "short_term_memory", |
| title: "Short-term memory", |
| surface: "memory/short_term", |
| runtime: "python", |
| lifecycle: "session-scoped", |
| summary: "Ātrs konteksta buferis aktīvām sesijām un agent replay stāvoklim.", |
| }, |
| CapabilityEntry { |
| id: "long_term_memory", |
| title: "Long-term memory", |
| surface: "memory/long_term + Postgres", |
| runtime: "python + postgres", |
| lifecycle: "persistent", |
| summary: "Persistenta atmiņa ar provenance, metadata un retrieval policy slāni.", |
| }, |
| CapabilityEntry { |
| id: "vector_memory", |
| title: "Vector memory", |
| surface: "memory/vector_store", |
| runtime: "python", |
| lifecycle: "semantic", |
| summary: "Embedding meklēšana tekstam, audio, attēliem un notikumu reprezentācijām.", |
| }, |
| ], |
| }, |
| CapabilityDomain { |
| domain: "tools", |
| description: "Standardizēts tool runtime ar permission, quota, sandbox un tracing līgumu.", |
| capabilities: vec![ |
| CapabilityEntry { |
| id: "browser_automation", |
| title: "Browser automation", |
| surface: "core-python browser automation", |
| runtime: "python + playwright", |
| lifecycle: "interactive", |
| summary: "Navigate, click, fill, screenshot un extraction darbības ar drošības kontroli.", |
| }, |
| CapabilityEntry { |
| id: "repo_editor", |
| title: "Repo editor", |
| surface: "tools/code/repo_editor.py", |
| runtime: "python", |
| lifecycle: "sandboxed", |
| summary: "Repo read/write darbības ar future plugin SDK-ready manifestu.", |
| }, |
| CapabilityEntry { |
| id: "filesystem_ops", |
| title: "Filesystem ops", |
| surface: "tools/filesystem/fs_ops.py", |
| runtime: "python", |
| lifecycle: "sandboxed", |
| summary: "Drošas failu sistēmas darbības ar atļauto direktoriju un quotas konceptu.", |
| }, |
| ], |
| }, |
| CapabilityDomain { |
| domain: "modalities", |
| description: "Voice, vision, code un creative studijas vienotā capability reģistrā.", |
| capabilities: vec![ |
| CapabilityEntry { |
| id: "voice_runtime", |
| title: "Voice runtime", |
| surface: "/api/voice/* + voice-rust", |
| runtime: "rust + python", |
| lifecycle: "realtime", |
| summary: "STT/TTS un emotion-aware voice sesijas ar websocket runtime.", |
| }, |
| CapabilityEntry { |
| id: "vision_stack", |
| title: "Vision stack", |
| surface: "/api/vision/*", |
| runtime: "backend-rust + python", |
| lifecycle: "event-driven", |
| summary: "Vision inference, eventing un guardrails zem viena sistēmas manifests slāņa.", |
| }, |
| CapabilityEntry { |
| id: "code_studio", |
| title: "Code studio", |
| surface: "/api/code", |
| runtime: "backend-rust + python", |
| lifecycle: "request", |
| summary: "Programmēšanas ģenerēšana un labošana ar routing uz specializēto branch.", |
| }, |
| ], |
| }, |
| ]; |
|
|
| let governance = GovernanceSection { |
| tenancy_model: vec![ |
| "Owner-only admin identitāte ar skaidru bootstrap ceļu.", |
| "Sesijas, lietotāji, agent runs un usage events ir tenant-ready paplašināšanai.", |
| "Frontend un backend izmanto vienotu command center virsmu visiem moduļiem.", |
| ], |
| permissions_model: vec![ |
| "JWT access + refresh session modelis ar role, scopes un owner flag.", |
| "Tooling un vision spējas tiek projektētas ar explicit permission un sandbox līgumu.", |
| "High-risk darbības paredz human-in-the-loop approval un operator visibility.", |
| ], |
| audit_model: vec![ |
| "Audit logi, credential audit un system events glabā actor, entity un izmaiņu kontekstu.", |
| "Usage un tool telemetry tiek sasaistīta ar sesiju un feature dimensijām.", |
| "Face recognition un sensitīvie scenāriji pieprasa audit trail un policy enforcement.", |
| ], |
| policy_model: vec![ |
| "Policy slānis definē datu minimizāciju, encryption un operator escalation noteikumus.", |
| "Autonomous runtime izmanto checkpoint + resume kā drošu failover politiku.", |
| "Manifestā tiek publicēti sandbox, quota un approval nosacījumi katram tool.", |
| ], |
| }; |
|
|
| let event_model = EventModel { |
| timeline_stream: "/api/autonomous/status/:id/stream", |
| event_types: vec![ |
| "session.started", |
| "task_graph.ready", |
| "task.started", |
| "task.completed", |
| "task.retrying", |
| "approval.requested", |
| "session.completed", |
| "session.interrupt", |
| ], |
| metrics: vec![ |
| "latency_ms", |
| "queue_depth", |
| "attempts", |
| "progress_percent", |
| "transport_mode", |
| ], |
| usage_dimensions: vec![ |
| "feature_name", |
| "model_name", |
| "tokens_in", |
| "tokens_out", |
| "latency_ms", |
| ], |
| cost_dimensions: vec![ |
| "tool_calls", |
| "model_runtime", |
| "media_generation", |
| "operator_review", |
| "storage", |
| ], |
| }; |
|
|
| let memory_manifest = MemoryManifest { |
| graph_model: "short-term + episodic + semantic + procedural + operator memory graph", |
| ingestion_pipeline: vec![ |
| "chat + voice transcripts", |
| "image/video outputs", |
| "tool call request/response traces", |
| "autonomous timeline events", |
| "system and usage events", |
| ], |
| retrieval_policies: vec![ |
| "salience scoring", |
| "deduplication", |
| "entity linking", |
| "persona-aware retrieval", |
| "operator forget/delete control", |
| ], |
| modes: vec![ |
| MemoryMode { |
| id: "short_term", |
| title: "Short-term", |
| inputs: vec!["chat turns", "task state", "voice context"], |
| controls: vec!["ttl", "session reset", "context budget"], |
| summary: "Aktīvās sesijas darba atmiņa ātrai reasoning un streaming plūsmai.", |
| }, |
| MemoryMode { |
| id: "episodic", |
| title: "Episodic", |
| inputs: vec!["sessions", "agent runs", "timeline replay"], |
| controls: vec!["session replay", "checkpoint history", "delete"], |
| summary: "Saglabā pilnas sesijas un autonomous replay artefaktus ar provenance.", |
| }, |
| MemoryMode { |
| id: "semantic", |
| title: "Semantic", |
| inputs: vec!["embeddings", "documents", "summaries"], |
| controls: vec!["retrieval policy", "ranking", "re-embed"], |
| summary: "Semantiskā meklēšana starp zināšanām, faktiem un multimodāliem artefaktiem.", |
| }, |
| MemoryMode { |
| id: "procedural", |
| title: "Procedural", |
| inputs: vec!["tool manifests", "playbooks", "validation flows"], |
| controls: vec!["versioning", "rollout", "policy gates"], |
| summary: "Saglabā izpildes playbookus, tool contracts un operatora procedūras.", |
| }, |
| MemoryMode { |
| id: "operator", |
| title: "Operator", |
| inputs: vec!["approvals", "annotations", "audit evidence"], |
| controls: vec!["forget", "delete", "approval status"], |
| summary: "Operatora lēmumi un anotācijas, kas ietekmē sesijas drošību un pārskatāmību.", |
| }, |
| ], |
| }; |
|
|
| let tooling_manifest = ToolingManifest { |
| runtime_contract: vec![ |
| "manifest + schema", |
| "permissions + quota", |
| "sandbox level", |
| "health + tracing", |
| "cost accounting", |
| ], |
| discovery: vec![ |
| "platform manifest catalog", |
| "tool versioning", |
| "operator visibility", |
| "future plugin SDK surface", |
| ], |
| tools: vec![ |
| ToolManifest { |
| id: "browser_automation", |
| title: "Browser Automation", |
| version: "2.0", |
| category: "operations", |
| runtime: "core-python", |
| permissions: vec![ |
| "browser.navigate", |
| "browser.click", |
| "browser.fill", |
| "browser.capture", |
| ], |
| sandbox: "interactive", |
| quota: "session-scoped", |
| health: "stream-aware", |
| summary: "Live browser operator tooling ar traceable step-by-step darbībām.", |
| }, |
| ToolManifest { |
| id: "repo_editor", |
| title: "Repo Editor", |
| version: "1.0", |
| category: "developer", |
| runtime: "python", |
| permissions: vec!["repo.read", "repo.write"], |
| sandbox: "workspace", |
| quota: "artifact-scoped", |
| health: "policy-gated", |
| summary: "Koda rediģēšanas virsma ar auditējamu izcelsmi un plugin-ready contract.", |
| }, |
| ToolManifest { |
| id: "filesystem_ops", |
| title: "Filesystem Ops", |
| version: "1.0", |
| category: "operations", |
| runtime: "python", |
| permissions: vec!["fs.read", "fs.write", "fs.list"], |
| sandbox: "safe_dirs", |
| quota: "directory-scoped", |
| health: "guarded", |
| summary: "Drošas FS darbības ar direktoriju politiku un nākotnes quota enforcement.", |
| }, |
| ToolManifest { |
| id: "web_search", |
| title: "Web Search", |
| version: "1.0", |
| category: "research", |
| runtime: "python", |
| permissions: vec!["network.search"], |
| sandbox: "outbound_http", |
| quota: "request-scoped", |
| health: "fallback-capable", |
| summary: "Research rīks ar izsekojamu request/response footprintu.", |
| }, |
| ], |
| }; |
|
|
| let autonomous_runtime = AutonomousRuntimeManifest { |
| stream_transport: "SSE with polling fallback and replay cursor metadata", |
| operator_surfaces: vec![ |
| "live trace", |
| "task graph", |
| "approval queue", |
| "checkpoint replay", |
| ], |
| agent_roles: vec!["planner", "executor", "reviewer", "operator"], |
| replay_features: vec![ |
| "timeline cursor", |
| "session checkpoints", |
| "resume token", |
| "failover mode", |
| ], |
| approval_features: vec![ |
| "interruptible events", |
| "operator review", |
| "auto-approved local runtime", |
| "recovery checkpoint", |
| ], |
| }; |
|
|
| let self_improvement = SelfImprovementManifest { |
| eval_suites: vec![ |
| EvalSuiteManifest { |
| id: "agent_quality_eval", |
| title: "Agent quality evals", |
| focus: "Correctness, policy adherence un operator satisfaction katram aģentam.", |
| cadence: "per task outcome + nightly sweeps", |
| automation: "auto-scored with human override", |
| signals: vec![ |
| "task outcome score", |
| "approval interventions", |
| "policy incidents", |
| "operator rating", |
| ], |
| }, |
| EvalSuiteManifest { |
| id: "tool_runtime_eval", |
| title: "Tool runtime evals", |
| focus: "Latency, reliability un sandbox compliance katram rīkam.", |
| cadence: "streaming + release gates", |
| automation: "trace-driven", |
| signals: vec![ |
| "latency_ms", |
| "retry rate", |
| "error budget", |
| "artifact completeness", |
| ], |
| }, |
| ], |
| regression_suites: vec![ |
| RegressionSuiteManifest { |
| id: "task_regression_grid", |
| title: "Task regression grid", |
| scope: "prompt + tool + policy + memory changes", |
| trigger: "every release candidate and failed-session cluster", |
| summary: "Stabila benchmark matrica ar zelta uzdevumiem, drošības pārbaudēm un persona režīmiem.", |
| }, |
| RegressionSuiteManifest { |
| id: "cross_modal_regressions", |
| title: "Cross-modal regressions", |
| scope: "chat, voice, autonomous un vision plūsmas", |
| trigger: "schema or routing changes", |
| summary: "Pārbauda tulkošanas un multimodālās konsekvences degradāciju starp virsmām.", |
| }, |
| ], |
| outcome_metrics: vec![ |
| OutcomeMetricManifest { |
| id: "correctness", |
| title: "Correctness", |
| weight_percent: 40, |
| summary: "Vai aģents sasniedza uzdevuma mērķi bez būtiskām kļūdām.", |
| }, |
| OutcomeMetricManifest { |
| id: "reliability", |
| title: "Reliability", |
| weight_percent: 20, |
| summary: "Vai plūsma izpildījās bez retry spirālēm un regressijām.", |
| }, |
| OutcomeMetricManifest { |
| id: "tool_efficiency", |
| title: "Tool efficiency", |
| weight_percent: 20, |
| summary: "Vai izmantotie rīki un resursi bija ekonomiski un pamatoti.", |
| }, |
| OutcomeMetricManifest { |
| id: "operator_trust", |
| title: "Operator trust", |
| weight_percent: 20, |
| summary: "Cik daudz approval, pārredzamības un uzticības signālu bija nepieciešams.", |
| }, |
| ], |
| closed_loop: ClosedLoopManifest { |
| failure_sources: vec![ |
| "failed sessions", |
| "approval escalations", |
| "tool regressions", |
| "memory misses", |
| ], |
| recommendation_targets: vec!["prompt", "policy", "tool", "memory"], |
| safe_optimization_controls: vec![ |
| "shadow deployment", |
| "human review threshold", |
| "rollback-ready variants", |
| "policy envelope tests", |
| ], |
| }, |
| leaderboard: LeaderboardManifest { |
| title: "Agent + tool leaderboard", |
| ranking_dimensions: vec![ |
| "avg outcome score", |
| "stability", |
| "latency", |
| "regression pass rate", |
| ], |
| refresh_policy: "near-real-time with release benchmark snapshots", |
| benchmark_surfaces: vec![ |
| "operations console", |
| "admin studio", |
| "system manifest", |
| "future public benchmarks", |
| ], |
| }, |
| }; |
|
|
| let process_runtime = ProcessRuntimeManifest { |
| runtime_surfaces: vec![ |
| "browser", |
| "filesystem", |
| "repo editor", |
| "background jobs", |
| "queues", |
| "schedulers", |
| ], |
| background_capabilities: vec![ |
| RuntimeCapability { |
| id: "job_runtime", |
| title: "Job runtime", |
| scope: "interactive + background", |
| summary: "Pilns process/job runtime ar queued, running, completed un failed stāvokļiem.", |
| }, |
| RuntimeCapability { |
| id: "artifact_store", |
| title: "Artifact store", |
| scope: "session + workspace", |
| summary: "Artefaktu glabāšana ar metadatiem, retention un provenance pēdu.", |
| }, |
| RuntimeCapability { |
| id: "workspace_sessions", |
| title: "Long-lived workspace sessions", |
| scope: "resource-governed", |
| summary: "Ilgdzīvojošas darba telpas ar resursu limitiem, profiliem un restartējamu stāvokli.", |
| }, |
| ], |
| secrets_handling: vec![ |
| "env-backed secrets", |
| "owner-only visibility", |
| "rotation-aware credentials", |
| "audit-friendly access", |
| ], |
| environment_profiles: vec![ |
| "local sandbox", |
| "railway production", |
| "gpu worker", |
| "autonomous operator", |
| ], |
| artifact_store: vec![ |
| "session outputs", |
| "timeline snapshots", |
| "tool traces", |
| "benchmark evidence", |
| ], |
| workspace_model: vec![ |
| "session affinity", |
| "quota enforcement", |
| "background resumption", |
| "resource budget tracking", |
| ], |
| operations_console: vec![ |
| "queue health", |
| "leaderboard", |
| "recommendations", |
| "runtime telemetry", |
| "plugin governance", |
| ], |
| }; |
|
|
| let plugin_platform = PluginPlatformManifest { |
| manifest_contract: vec![ |
| "plugin manifest", |
| "declared permissions", |
| "lifecycle hooks", |
| "version metadata", |
| ], |
| review_process: vec![ |
| "submission review", |
| "policy scan", |
| "signature verification", |
| "admin approval", |
| ], |
| signature_trust: vec![ |
| "first-party signatures", |
| "trusted publisher chain", |
| "revocation list", |
| "install-time integrity check", |
| ], |
| permissions_model: vec![ |
| "capability scoped", |
| "install-time grants", |
| "runtime enforcement", |
| "audit visibility", |
| ], |
| billing_hooks: vec![ |
| "usage metering", |
| "subscription hooks", |
| "quota accounting", |
| "support plan metadata", |
| ], |
| lifecycle_management: vec![ |
| "install", |
| "update", |
| "remove", |
| "disable", |
| "rollback", |
| ], |
| admin_approval_model: vec![ |
| "owner approval for sensitive plugins", |
| "workspace-level allowlists", |
| "org policy overrides", |
| ], |
| listing_metadata: vec![ |
| "docs", |
| "ratings", |
| "telemetry", |
| "support contacts", |
| "publisher profile", |
| ], |
| }; |
|
|
| let translation_layer = TranslationLayerManifest { |
| translation_planes: vec![ |
| "human language ↔ tool schemas", |
| "agent intents ↔ runtime actions", |
| "multimodal inputs ↔ normalized prompts", |
| ], |
| locale_aware_ux: vec![ |
| "localized labels", |
| "format-aware timestamps", |
| "region-friendly defaults", |
| "persona-sensitive tone", |
| ], |
| prompt_normalization: vec![ |
| "intent extraction", |
| "schema normalization", |
| "domain terminology expansion", |
| "safety canonicalization", |
| ], |
| cross_lingual_memory: vec![ |
| "language-tagged memories", |
| "semantic retrieval across locales", |
| "translation-linked evidence chains", |
| ], |
| multimodal_consistency: vec![ |
| "chat", |
| "voice", |
| "autonomous", |
| "vision", |
| "shared translation contract", |
| ], |
| terminology_dictionaries: vec![ |
| "product glossary", |
| "domain-specific lexicons", |
| "operator playbook terms", |
| ], |
| persona_localization: vec![ |
| "persona-aware localization", |
| "style-preserving translation", |
| "locale-specific prompt overlays", |
| ], |
| }; |
|
|
| let platform_contracts = PlatformContractsManifest { |
| schema_path: "/shared/schemas/platform_contract_schema.json", |
| sdk_contracts: vec![ |
| "manifest-first API/SDK contract", |
| "timeline event envelope shared by diagnostics, billing un robotics", |
| "workspace/session/artifact identity propagation", |
| ], |
| timeline_model: vec![ |
| "event_id + parent_event_id", |
| "workspace/session/task/tool correlation", |
| "diagnostic + billing + robotics provenance tags", |
| "recovery and approval actions on the same timeline", |
| ], |
| core_objects: vec![ |
| PlatformContractObject { |
| id: "identity", |
| title: "Cross-module identity", |
| summary: "Users, orgs, teams, service accounts un scoped access vienā modelī.", |
| primary_store: "PostgreSQL identity + access tables", |
| api_contract: "identity.v1", |
| }, |
| PlatformContractObject { |
| id: "session_task_tool", |
| title: "Session / task / tool execution", |
| summary: "Agent runtime ieraksti ar confidence, uncertainty, failure_reason un next_best_action.", |
| primary_store: "agent_sessions, agent_tasks, agent_tool_calls", |
| api_contract: "runtime.execution.v1", |
| }, |
| PlatformContractObject { |
| id: "workspace_artifact", |
| title: "Workspace + artifact", |
| summary: "Ilgdzīvojošas darba telpas, artefakti, retention un notifications operator OS virskārtai.", |
| primary_store: "workspaces, workspace_artifacts, operator_notifications", |
| api_contract: "workspace.v1", |
| }, |
| PlatformContractObject { |
| id: "diagnostics_billing_robotics", |
| title: "Diagnostics / billing / fleet events", |
| summary: "Persistēts event/timeline modelis ar incidentiem, ledger ierakstiem un fleet asset metadatiem.", |
| primary_store: "diagnostic_*, billing_ledger_events, fleet_assets", |
| api_contract: "platform.events.v1", |
| }, |
| ], |
| }; |
|
|
| let diagnostics = DiagnosticsManifest { |
| incident_fields: vec![ |
| "confidence", |
| "uncertainty", |
| "failure_reason", |
| "next_best_action", |
| "root_cause_summary", |
| "recovery_action", |
| ], |
| health_signals: vec![ |
| HealthSignalManifest { |
| id: "model_drift", |
| title: "Model drift", |
| track: "Eval quality, branch score deviations un outcome regression clusters.", |
| recovery_levers: vec![ |
| "shadow rollback", |
| "eval gate tightening", |
| "persona/prompt variant isolation", |
| ], |
| }, |
| HealthSignalManifest { |
| id: "latency_spikes", |
| title: "Latency spikes", |
| track: "Tool latency, queue backlog un degraded runtime windows.", |
| recovery_levers: vec![ |
| "throughput limiting", |
| "fallback routing", |
| "priority-based scheduling", |
| ], |
| }, |
| HealthSignalManifest { |
| id: "memory_quality", |
| title: "Memory quality", |
| track: "Memory misses, retrieval confidence un stale-context incidents.", |
| recovery_levers: vec![ |
| "memory refresh", |
| "evidence pinning", |
| "retrieval policy tuning", |
| ], |
| }, |
| HealthSignalManifest { |
| id: "tool_instability", |
| title: "Tool instability", |
| track: "Retry bursts, tool failures un guardrail-triggered disablements.", |
| recovery_levers: vec![ |
| "tool disable", |
| "approval escalation", |
| "safe-mode routing", |
| ], |
| }, |
| ], |
| guardrail_actions: vec![ |
| "fallback mode", |
| "tool disable", |
| "approval escalation", |
| "throughput limiting", |
| "safe-mode", |
| ], |
| degradation_modes: vec![ |
| "observing", |
| "degraded", |
| "recovering", |
| "operator-approval-only", |
| ], |
| recovery_actions: vec![ |
| "reroute to healthy model branch", |
| "pause unstable tool", |
| "rebuild memory context", |
| "require simulator-first execution", |
| ], |
| }; |
|
|
| let cloud = CloudCapabilityManifest { |
| identity_objects: vec![ |
| "organizations", |
| "teams", |
| "memberships", |
| "service accounts", |
| "scoped API keys", |
| ], |
| access_controls: vec![ |
| "usage plans", |
| "feature entitlements", |
| "workspace quotas", |
| "audit-ready role grants", |
| ], |
| billing_objects: vec![ |
| "billing accounts", |
| "ledger events", |
| "subscriptions", |
| "invoices", |
| "cost visibility", |
| ], |
| compliance_controls: vec![ |
| "audit trail", |
| "data export", |
| "retention controls", |
| "provider-ready payment metadata", |
| ], |
| }; |
|
|
| let robotics = RoboticsCapabilityManifest { |
| separation_boundary: vec![ |
| "robotics capability layer outside core chat", |
| "dedicated policy boundary", |
| "simulator-first execution path", |
| ], |
| device_registry: vec![ |
| "fleet asset registry", |
| "device identity", |
| "telemetry metadata", |
| "operator ownership", |
| ], |
| execution_plane: vec![ |
| "command bus", |
| "telemetry ingestion", |
| "sensor fusion", |
| "remote supervision", |
| ], |
| safety_controls: vec![ |
| "safety interlocks", |
| "operator approvals", |
| "runtime guardrails", |
| "incident-linked shutdown paths", |
| ], |
| simulator_workflow: vec![ |
| "simulate", |
| "review", |
| "approve", |
| "physical execution", |
| ], |
| }; |
|
|
| let operator_os = OperatorOsManifest { |
| centers: vec![ |
| "command center", |
| "memory center", |
| "agent studio", |
| "tool store", |
| "diagnostics", |
| "billing", |
| "fleet management", |
| ], |
| shared_models: vec![ |
| "identity", |
| "workspace", |
| "session", |
| "notifications", |
| "artifacts", |
| ], |
| shell_properties: vec![ |
| "shared global nav", |
| "workspace persistence", |
| "context switching", |
| "cross-module alerts", |
| ], |
| external_contracts: vec![ |
| "public API", |
| "SDK", |
| "manifest contract", |
| "ecosystem integration hooks", |
| ], |
| }; |
|
|
| SystemInfo { |
| name: "Maris AI", |
| description: "Dzīvs platformas manifests ar capability registry, governance slāņiem un operatora runtime karti.", |
| capabilities: vec![ |
| "text_chat", |
| "voice_conversation", |
| "image_generation", |
| "music_generation", |
| "video_generation", |
| "code_generation", |
| "autonomous_tasks", |
| "memory_graph", |
| "tool_runtime", |
| ], |
| model: MASTER_MODEL, |
| author, |
| orchestration_mode: "platform_manifest_with_specialist_branches", |
| master_model: MasterModelInfo { |
| name: MASTER_MODEL, |
| role: "Galvenais reasoning, governance un koordinācijas modelis", |
| routing_strategy: "platform_manifest_with_specialist_branches", |
| primary_capabilities: vec![ |
| "conversation", |
| "reasoning", |
| "planning", |
| "tool_routing", |
| "memory_context", |
| "policy_awareness", |
| "operator_escalation", |
| ], |
| }, |
| branches, |
| vision_stack, |
| vision_guardrails: vec![ |
| "Face recognition jāizmanto tikai ar skaidru juridisku pamatu, piekrišanu un audit trail.", |
| "Biometriskos un sensitīvos datus jāglabā minimāli, šifrēti un ar piekļuves kontroli.", |
| "Augsta riska scenārijos vajag human-in-the-loop pārbaudi pirms automātiskas rīcības.", |
| "Raw video pēc noklusējuma jāminimizē; priekšroka dodama eventiem, snapshotiem un timeline artefaktiem.", |
| ], |
| capability_registry, |
| governance, |
| event_model, |
| memory_manifest, |
| tooling_manifest, |
| autonomous_runtime, |
| self_improvement, |
| process_runtime, |
| plugin_platform, |
| translation_layer, |
| platform_contracts, |
| diagnostics, |
| cloud, |
| robotics, |
| operator_os, |
| } |
| } |
|
|