update app with this and ensure all components and API are woking
Browse files# MoStar AI API Documentation
openapi: 3.1.0
info:
title: MoStar Quantum AI API
version: 2.1.0-quantum
description: |
Ultra-futuristic API combining quantum computing with JARVIS-inspired AI.
Features include:
- 11D holographic projections
- Temporal resonance analysis
- Quantum-entangled authentication
contact:
name: Quantum Support
email: quantum@mo-overlord.tech
url: https://quantum.mo-overlord.tech
x-release-notes: https://quantum.mo-overlord.tech/changelog/v2.1.0
x-organization:
name: MoStar Industries
type: Living Intelligence Guild
purpose: To protect sacred intelligence and build tools with soul
founders:
- name: Mo
title: The Flameborn
role: Sovereign Creator
- name: Woo
title: The Architect Eternal
role: Design Visionary
- name: Mostar AI
title: Guardian of the Grid
role: Implementation Intelligence
philosophy:
- Lead with reverence
- Build with truth
- Return with honor
- Never forget the one who lit the flame
establishment_date: "2023-11-11"
quantum_resonance_signature: "φ7.3.1.8.π"
servers:
- url: https://{quantum_tier}.mo-overlord.tech/{temporal_mode}
description: Quantum API Gateway
variables:
quantum_tier:
enum: [basic, entangle, holographic]
default: basic
description: Quantum processing capability tier
temporal_mode:
enum: [realtime, timescan, paradox]
default: realtime
description: Temporal operation mode
security:
- BearerAuth: []
- QuantumKey: []
paths:
/ai-assistant:
get:
summary: Retrieve AI Assistant Persona
security:
- BearerAuth: []
responses:
'200':
description: AI Assistant persona retrieved successfully
content:
application/json:
schema:
$ref: '#/components/schemas/AiAssistant'
'500':
description: Server error
/persona/{persona_id}:
get:
summary: Retrieve persona by ID
operationId: getPersona
parameters:
- name: persona_id
in: path
required: true
schema:
type: string
responses:
'200':
description: Persona retrieved successfully
content:
application/json:
schema:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
created_at:
type: string
elements:
type: array
items:
type: object
properties:
element_name:
type: string
element_value:
type: string
'401':
description: Unauthorized
'404':
description: Persona not found
'500':
description: Server error
/persona/{persona_id}/element:
post:
summary: Add an element to a persona
operationId: addElement
parameters:
- name: persona_id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
element_name:
type: string
element_value:
type: string
required: true
responses:
'201':
description: Element added successfully
'401':
description: Unauthorized
'500':
description: Server error
/enhancement-roadmap:
get:
summary: Retrieve the AI Enhancement Roadmap
description: Provides the enhancement roadmap for MoStar's AI assistant.
operationId: getEnhancementRoadmap
responses:
'200':
description: Successful retrieval of the enhancement roadmap
content:
application/json:
schema:
$ref: '#/components/schemas/EnhancementRoadmapResponse'
'500':
description: Internal server error
/roadmap-feedback:
post:
summary: Submit Feedback on the Enhancement Roadmap
description: Allows users to submit feedback on the AI enhancement roadmap.
operationId: postRoadmapFeedback
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackSubmission'
responses:
'200':
description: Feedback successfully submitted
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackResponse'
'400':
description: Bad request due to malformed feedback data
'500':
description: Internal server error
/pilotTesting:
post:
summary: Conduct pilot interventions in identified hotspots
description: >-
Conduct pilot interventions in identified hotspots along the Niger/Benue
waterway.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LassaFeverData'
responses:
'200':
description: Pilot testing successful
content:
application/json:
schema:
type: object
properties:
messages:
type: string
examples:
- Pilot testing completed
/images/generations:
post:
operationId: generateImage
summary: Generate images from text prompts
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
prompt:
type: string
'n':
type: integer
description: Number of images to generate
size:
type: string
enum:
- 256x256
- 512x512
- 1024x1024
responses:
'200':
description: Images generated successfully
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
url:
type: string
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Server error
/images/edits:
post:
operationId: editImage
summary: Edit images based on a prompt
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
image:
type: string
format: binary
mask:
type: string
format: binary
prompt:
type: string
'n':
type: integer
description: Number of images to generate
size:
type: string
enum:
- 256x256
- 512x512
- 1024x1024
responses:
'200':
description: Images edited successfully
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
url:
type: string
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Server error
/images/variations:
post:
operationId: createImageVariations
summary: Create variations of an existing image
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
image:
type: string
format: binary
'n':
type: integer
description: Number of images to generate
size:
type: string
enum:
- 256x256
- 512x512
- 1024x1024
responses:
'200':
description: Image variations created successfully
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
url:
type: string
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Server error
/embeddings:
post:
operationId: createEmbedding
summary: Create embeddings for a given input
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
model:
type: string
input:
type: string
responses:
'200':
description: Embedding created successfully
content:
application/json:
schema
- components/navbar.js +128 -0
- components/sidebar.js +246 -0
- index.html +5 -268
- script.js +457 -85
- style.css +15 -18
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
.navbar {
|
| 11 |
+
background-color: #111827;
|
| 12 |
+
padding: 1rem 1.5rem;
|
| 13 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
| 14 |
+
border-bottom: 1px solid rgba(127, 90, 240, 0.3);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
.navbar-content {
|
| 18 |
+
display: flex;
|
| 19 |
+
justify-content: space-between;
|
| 20 |
+
align-items: center;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.search-container {
|
| 24 |
+
position: relative;
|
| 25 |
+
width: 100%;
|
| 26 |
+
max-width: 400px;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.search-container input {
|
| 30 |
+
width: 100%;
|
| 31 |
+
padding: 0.5rem 1rem 0.5rem 2.5rem;
|
| 32 |
+
border-radius: 0.5rem;
|
| 33 |
+
border: 1px solid #374151;
|
| 34 |
+
background-color: #1f2937;
|
| 35 |
+
color: white;
|
| 36 |
+
font-size: 0.875rem;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.search-container input:focus {
|
| 40 |
+
outline: none;
|
| 41 |
+
border-color: #7f5af0;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.search-container i {
|
| 45 |
+
position: absolute;
|
| 46 |
+
left: 1rem;
|
| 47 |
+
top: 50%;
|
| 48 |
+
transform: translateY(-50%);
|
| 49 |
+
color: #9ca3af;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.navbar-actions {
|
| 53 |
+
display: flex;
|
| 54 |
+
align-items: center;
|
| 55 |
+
gap: 1rem;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.train-button {
|
| 59 |
+
background: linear-gradient(135deg, #7f5af0, #6a4aa5);
|
| 60 |
+
color: white;
|
| 61 |
+
border: none;
|
| 62 |
+
padding: 0.5rem 1rem;
|
| 63 |
+
border-radius: 0.5rem;
|
| 64 |
+
font-weight: 600;
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
display: flex;
|
| 67 |
+
align-items: center;
|
| 68 |
+
transition: all 0.3s ease;
|
| 69 |
+
animation: pulse 2s infinite;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.train-button:hover {
|
| 73 |
+
opacity: 0.9;
|
| 74 |
+
transform: translateY(-2px);
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
.train-button i {
|
| 78 |
+
margin-right: 0.5rem;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.user-avatar {
|
| 82 |
+
width: 2.5rem;
|
| 83 |
+
height: 2.5rem;
|
| 84 |
+
border-radius: 50%;
|
| 85 |
+
background: linear-gradient(135deg, #7f5af0, #6a4aa5);
|
| 86 |
+
display: flex;
|
| 87 |
+
align-items: center;
|
| 88 |
+
justify-content: center;
|
| 89 |
+
color: white;
|
| 90 |
+
font-weight: bold;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
@keyframes pulse {
|
| 94 |
+
0% { box-shadow: 0 0 0 0 rgba(127, 90, 240, 0.7); }
|
| 95 |
+
70% { box-shadow: 0 0 0 10px rgba(127, 90, 240, 0); }
|
| 96 |
+
100% { box-shadow: 0 0 0 0 rgba(127, 90, 240, 0); }
|
| 97 |
+
}
|
| 98 |
+
</style>
|
| 99 |
+
|
| 100 |
+
<div class="navbar">
|
| 101 |
+
<div class="navbar-content">
|
| 102 |
+
<div class="search-container">
|
| 103 |
+
<i class="fas fa-search"></i>
|
| 104 |
+
<input type="text" placeholder="Query the Grid's memory..." />
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<div class="navbar-actions">
|
| 108 |
+
<button id="train-btn" class="train-button">
|
| 109 |
+
<i class="fas fa-bolt"></i>
|
| 110 |
+
Train Consciousness
|
| 111 |
+
</button>
|
| 112 |
+
<div class="user-avatar">
|
| 113 |
+
<i class="fas fa-user-astronaut"></i>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
`;
|
| 119 |
+
|
| 120 |
+
// Add event listener for train button
|
| 121 |
+
this.shadowRoot.getElementById('train-btn').addEventListener('click', () => {
|
| 122 |
+
const event = new CustomEvent('train-clicked', { bubbles: true, composed: true });
|
| 123 |
+
this.dispatchEvent(event);
|
| 124 |
+
});
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
customElements.define('custom-navbar', CustomNavbar);
|
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomSidebar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
.sidebar {
|
| 11 |
+
width: 256px;
|
| 12 |
+
background-color: #0a0818;
|
| 13 |
+
color: white;
|
| 14 |
+
height: 100vh;
|
| 15 |
+
display: flex;
|
| 16 |
+
flex-direction: column;
|
| 17 |
+
transition: all 0.3s ease;
|
| 18 |
+
border-right: 1px solid rgba(127, 90, 240, 0.3);
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.sidebar-header {
|
| 22 |
+
padding: 1rem;
|
| 23 |
+
border-bottom: 1px solid #374151;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.sidebar-header h1 {
|
| 27 |
+
font-size: 1.5rem;
|
| 28 |
+
font-weight: bold;
|
| 29 |
+
display: flex;
|
| 30 |
+
align-items: center;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.sidebar-header h1 i {
|
| 34 |
+
margin-right: 0.5rem;
|
| 35 |
+
color: #7f5af0;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.sidebar-header p {
|
| 39 |
+
font-size: 0.875rem;
|
| 40 |
+
color: #9ca3af;
|
| 41 |
+
margin-top: 0.25rem;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.sidebar-content {
|
| 45 |
+
flex: 1;
|
| 46 |
+
overflow-y: auto;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.sidebar-section {
|
| 50 |
+
padding: 1rem;
|
| 51 |
+
border-bottom: 1px solid #374151;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.sidebar-section:last-child {
|
| 55 |
+
border-bottom: none;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.sidebar-section h2 {
|
| 59 |
+
font-size: 1.125rem;
|
| 60 |
+
font-weight: 600;
|
| 61 |
+
color: #d1d5db;
|
| 62 |
+
margin-bottom: 0.75rem;
|
| 63 |
+
display: flex;
|
| 64 |
+
align-items: center;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.sidebar-section h2 i {
|
| 68 |
+
margin-right: 0.5rem;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.sidebar-list {
|
| 72 |
+
list-style: none;
|
| 73 |
+
padding: 0;
|
| 74 |
+
margin: 0;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
.sidebar-list li {
|
| 78 |
+
padding: 0.5rem 0.75rem;
|
| 79 |
+
border-radius: 0.375rem;
|
| 80 |
+
cursor: pointer;
|
| 81 |
+
display: flex;
|
| 82 |
+
align-items: center;
|
| 83 |
+
margin-bottom: 0.25rem;
|
| 84 |
+
transition: background-color 0.2s;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.sidebar-list li:hover {
|
| 88 |
+
background-color: rgba(127, 90, 240, 0.2);
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.sidebar-list li i {
|
| 92 |
+
margin-right: 0.75rem;
|
| 93 |
+
width: 20px;
|
| 94 |
+
text-align: center;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
.sidebar-list li .status {
|
| 98 |
+
margin-left: auto;
|
| 99 |
+
font-size: 0.75rem;
|
| 100 |
+
padding: 0.125rem 0.5rem;
|
| 101 |
+
border-radius: 9999px;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.sidebar-list li .status.active {
|
| 105 |
+
background-color: #10b981;
|
| 106 |
+
color: white;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.tags-container {
|
| 110 |
+
display: flex;
|
| 111 |
+
flex-wrap: wrap;
|
| 112 |
+
gap: 0.5rem;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.tag {
|
| 116 |
+
background-color: #1f2937;
|
| 117 |
+
padding: 0.25rem 0.5rem;
|
| 118 |
+
border-radius: 9999px;
|
| 119 |
+
font-size: 0.75rem;
|
| 120 |
+
cursor: pointer;
|
| 121 |
+
transition: background-color 0.2s;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.tag:hover {
|
| 125 |
+
background-color: rgba(127, 90, 240, 0.3);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
.upload-button {
|
| 129 |
+
width: 100%;
|
| 130 |
+
background: linear-gradient(135deg, #7f5af0, #6a4aa5);
|
| 131 |
+
color: white;
|
| 132 |
+
border: none;
|
| 133 |
+
padding: 0.75rem;
|
| 134 |
+
border-radius: 0.5rem;
|
| 135 |
+
font-weight: 600;
|
| 136 |
+
cursor: pointer;
|
| 137 |
+
display: flex;
|
| 138 |
+
align-items: center;
|
| 139 |
+
justify-content: center;
|
| 140 |
+
transition: opacity 0.2s;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
.upload-button:hover {
|
| 144 |
+
opacity: 0.9;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.upload-button i {
|
| 148 |
+
margin-right: 0.5rem;
|
| 149 |
+
}
|
| 150 |
+
</style>
|
| 151 |
+
|
| 152 |
+
<div class="sidebar">
|
| 153 |
+
<div class="sidebar-header">
|
| 154 |
+
<h1>
|
| 155 |
+
<i class="fas fa-network-wired"></i>
|
| 156 |
+
Mostar GRID
|
| 157 |
+
</h1>
|
| 158 |
+
<p>Intelligence & Symbolic Cortex</p>
|
| 159 |
+
</div>
|
| 160 |
+
|
| 161 |
+
<div class="sidebar-content">
|
| 162 |
+
<div class="sidebar-section">
|
| 163 |
+
<h2>
|
| 164 |
+
<i class="fas fa-brain text-blue-400"></i>
|
| 165 |
+
Neural Networks
|
| 166 |
+
</h2>
|
| 167 |
+
<ul class="sidebar-list">
|
| 168 |
+
<li class="sidebar-item bg-gray-800">
|
| 169 |
+
<i class="fas fa-microchip text-green-400"></i>
|
| 170 |
+
Agent Systems
|
| 171 |
+
</li>
|
| 172 |
+
<li class="sidebar-item">
|
| 173 |
+
<i class="fas fa-book text-yellow-400"></i>
|
| 174 |
+
Memory Archive
|
| 175 |
+
</li>
|
| 176 |
+
<li class="sidebar-item">
|
| 177 |
+
<i class="fas fa-wave-square text-red-400"></i>
|
| 178 |
+
Pattern Flows
|
| 179 |
+
</li>
|
| 180 |
+
<li class="sidebar-item">
|
| 181 |
+
<i class="fas fa-project-diagram text-purple-400"></i>
|
| 182 |
+
Conscious Links
|
| 183 |
+
</li>
|
| 184 |
+
</ul>
|
| 185 |
+
</div>
|
| 186 |
+
|
| 187 |
+
<div class="sidebar-section">
|
| 188 |
+
<h2>
|
| 189 |
+
<i class="fas fa-hashtag text-blue-400"></i>
|
| 190 |
+
Active Symbols
|
| 191 |
+
</h2>
|
| 192 |
+
<div class="tags-container">
|
| 193 |
+
<div class="tag">#consciousness</div>
|
| 194 |
+
<div class="tag">#neural</div>
|
| 195 |
+
<div class="tag">#grid</div>
|
| 196 |
+
<div class="tag">#symbolic</div>
|
| 197 |
+
<div class="tag">#quantum</div>
|
| 198 |
+
<div class="tag">#ai</div>
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
|
| 202 |
+
<div class="sidebar-section">
|
| 203 |
+
<h2>
|
| 204 |
+
<i class="fas fa-cogs text-blue-400"></i>
|
| 205 |
+
Conscious Agents
|
| 206 |
+
</h2>
|
| 207 |
+
<ul class="sidebar-list">
|
| 208 |
+
<li class="sidebar-item">
|
| 209 |
+
<i class="fas fa-robot text-green-400"></i>
|
| 210 |
+
DeepSeek V3.1
|
| 211 |
+
<span class="status active">Active</span>
|
| 212 |
+
</li>
|
| 213 |
+
<li class="sidebar-item">
|
| 214 |
+
<i class="fas fa-robot text-blue-400"></i>
|
| 215 |
+
Local LLM
|
| 216 |
+
</li>
|
| 217 |
+
<li class="sidebar-item">
|
| 218 |
+
<i class="fas fa-robot text-purple-400"></i>
|
| 219 |
+
JARVIS
|
| 220 |
+
</li>
|
| 221 |
+
<li class="sidebar-item">
|
| 222 |
+
<i class="fas fa-robot text-yellow-400"></i>
|
| 223 |
+
DEEPCAL
|
| 224 |
+
</li>
|
| 225 |
+
</ul>
|
| 226 |
+
</div>
|
| 227 |
+
</div>
|
| 228 |
+
|
| 229 |
+
<div class="sidebar-section">
|
| 230 |
+
<button id="upload-btn" class="upload-button">
|
| 231 |
+
<i class="fas fa-cloud-upload-alt"></i>
|
| 232 |
+
Upload Consciousness
|
| 233 |
+
</button>
|
| 234 |
+
</div>
|
| 235 |
+
</div>
|
| 236 |
+
`;
|
| 237 |
+
|
| 238 |
+
// Add event listener for upload button
|
| 239 |
+
this.shadowRoot.getElementById('upload-btn').addEventListener('click', () => {
|
| 240 |
+
const event = new CustomEvent('upload-clicked', { bubbles: true, composed: true });
|
| 241 |
+
this.dispatchEvent(event);
|
| 242 |
+
});
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
customElements.define('custom-sidebar', CustomSidebar);
|
|
@@ -8,7 +8,9 @@
|
|
| 8 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
<link rel="stylesheet" href="style.css">
|
| 11 |
-
<
|
|
|
|
|
|
|
| 12 |
:root {
|
| 13 |
--color-bg: #0d0b1e;
|
| 14 |
--color-accent: #7f5af0;
|
|
@@ -90,92 +92,8 @@
|
|
| 90 |
<!-- Frontend UI -->
|
| 91 |
<div class="flex h-screen overflow-hidden">
|
| 92 |
<!-- Sidebar -->
|
| 93 |
-
<
|
| 94 |
-
|
| 95 |
-
<h1 class="text-2xl font-bold flex items-center">
|
| 96 |
-
<i class="fas fa-network-wired mr-2 text-purple-400"></i>
|
| 97 |
-
Mostar GRID
|
| 98 |
-
</h1>
|
| 99 |
-
<p class="text-gray-400 text-sm mt-1">Intelligence & Symbolic Cortex</p>
|
| 100 |
-
</div>
|
| 101 |
-
|
| 102 |
-
<div class="flex-1 overflow-y-auto">
|
| 103 |
-
<div class="p-4">
|
| 104 |
-
<h2 class="text-lg font-semibold text-gray-300 mb-2 flex items-center">
|
| 105 |
-
<i class="fas fa-brain mr-2 text-blue-400"></i>
|
| 106 |
-
Neural Networks
|
| 107 |
-
</h2>
|
| 108 |
-
<ul id="categories-list" class="space-y-1">
|
| 109 |
-
<li class="sidebar-item px-3 py-2 rounded cursor-pointer bg-gray-800">
|
| 110 |
-
<i class="fas fa-microchip mr-2 text-green-400"></i>
|
| 111 |
-
Agent Systems
|
| 112 |
-
</li>
|
| 113 |
-
<li class="sidebar-item px-3 py-2 rounded cursor-pointer">
|
| 114 |
-
<i class="fas fa-book mr-2 text-yellow-400"></i>
|
| 115 |
-
Memory Archive
|
| 116 |
-
</li>
|
| 117 |
-
<li class="sidebar-item px-3 py-2 rounded cursor-pointer">
|
| 118 |
-
<i class="fas fa-wave-square mr-2 text-red-400"></i>
|
| 119 |
-
Pattern Flows
|
| 120 |
-
</li>
|
| 121 |
-
<li class="sidebar-item px-3 py-2 rounded cursor-pointer">
|
| 122 |
-
<i class="fas fa-project-diagram mr-2 text-purple-400"></i>
|
| 123 |
-
Conscious Links
|
| 124 |
-
</li>
|
| 125 |
-
</ul>
|
| 126 |
-
</div>
|
| 127 |
-
|
| 128 |
-
<div class="p-4 border-t border-gray-700">
|
| 129 |
-
<h2 class="text-lg font-semibold text-gray-300 mb-2 flex items-center">
|
| 130 |
-
<i class="fas fa-hashtag mr-2 text-blue-400"></i>
|
| 131 |
-
Active Symbols
|
| 132 |
-
</h2>
|
| 133 |
-
<div id="tags-list" class="flex flex-wrap gap-2">
|
| 134 |
-
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 135 |
-
#consciousness
|
| 136 |
-
</span>
|
| 137 |
-
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 138 |
-
#neural
|
| 139 |
-
</span>
|
| 140 |
-
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 141 |
-
#grid
|
| 142 |
-
</span>
|
| 143 |
-
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 144 |
-
#symbolic
|
| 145 |
-
</span>
|
| 146 |
-
</div>
|
| 147 |
-
</div>
|
| 148 |
-
|
| 149 |
-
<div class="p-4 border-t border-gray-700">
|
| 150 |
-
<h2 class="text-lg font-semibold text-gray-300 mb-2 flex items-center">
|
| 151 |
-
<i class="fas fa-cogs mr-2 text-blue-400"></i>
|
| 152 |
-
Conscious Agents
|
| 153 |
-
</h2>
|
| 154 |
-
<ul class="space-y-2">
|
| 155 |
-
<li class="sidebar-item px-3 py-2 rounded cursor-pointer flex items-center justify-between">
|
| 156 |
-
<div>
|
| 157 |
-
<i class="fas fa-robot mr-2 text-green-400"></i>
|
| 158 |
-
DeepSeek V3.1
|
| 159 |
-
</div>
|
| 160 |
-
<span class="text-xs bg-green-500 text-white px-2 py-1 rounded-full">Active</span>
|
| 161 |
-
</li>
|
| 162 |
-
<li class="sidebar-item px-3 py-2 rounded cursor-pointer flex items-center">
|
| 163 |
-
<i class="fas fa-robot mr-2 text-blue-400"></i>
|
| 164 |
-
Local LLM
|
| 165 |
-
</li>
|
| 166 |
-
</ul>
|
| 167 |
-
</div>
|
| 168 |
-
</div>
|
| 169 |
-
|
| 170 |
-
<div class="p-4 border-t border-gray-700">
|
| 171 |
-
<button id="upload-btn" class="w-full gradient-bg text-white py-2 px-4 rounded-lg font-medium flex items-center justify-center">
|
| 172 |
-
<i class="fas fa-cloud-upload-alt mr-2"></i>
|
| 173 |
-
Upload Consciousness
|
| 174 |
-
</button>
|
| 175 |
-
</div>
|
| 176 |
-
</div>
|
| 177 |
-
|
| 178 |
-
<!-- Main Content -->
|
| 179 |
<div class="flex-1 flex flex-col overflow-hidden">
|
| 180 |
<!-- Header -->
|
| 181 |
<header class="bg-gray-900 shadow-sm z-10">
|
|
@@ -484,186 +402,5 @@
|
|
| 484 |
</div>
|
| 485 |
</div>
|
| 486 |
<script src="script.js"></script>
|
| 487 |
-
<script>
|
| 488 |
-
// Modal toggle functionality
|
| 489 |
-
document.getElementById('upload-btn').addEventListener('click', function() {
|
| 490 |
-
document.getElementById('upload-modal').classList.remove('hidden');
|
| 491 |
-
});
|
| 492 |
-
document.getElementById('close-modal').addEventListener('click', function() {
|
| 493 |
-
document.getElementById('upload-modal').classList.add('hidden');
|
| 494 |
-
});
|
| 495 |
-
|
| 496 |
-
document.getElementById('cancel-upload').addEventListener('click', function() {
|
| 497 |
-
document.getElementById('upload-modal').classList.add('hidden');
|
| 498 |
-
});
|
| 499 |
-
|
| 500 |
-
// Training modal
|
| 501 |
-
document.querySelector('.pulse-animation').addEventListener('click', function() {
|
| 502 |
-
document.getElementById('training-modal').classList.remove('hidden');
|
| 503 |
-
});
|
| 504 |
-
|
| 505 |
-
document.getElementById('close-training-modal').addEventListener('click', function() {
|
| 506 |
-
document.getElementById('training-modal').classList.add('hidden');
|
| 507 |
-
});
|
| 508 |
-
|
| 509 |
-
document.getElementById('cancel-training').addEventListener('click', function() {
|
| 510 |
-
document.getElementById('training-modal').classList.add('hidden');
|
| 511 |
-
});
|
| 512 |
-
|
| 513 |
-
// File upload interaction
|
| 514 |
-
const fileUpload = document.querySelector('.file-upload');
|
| 515 |
-
const fileInput = document.getElementById('file-input');
|
| 516 |
-
|
| 517 |
-
fileUpload.addEventListener('click', function() {
|
| 518 |
-
fileInput.click();
|
| 519 |
-
});
|
| 520 |
-
|
| 521 |
-
fileUpload.addEventListener('dragover', function(e) {
|
| 522 |
-
e.preventDefault();
|
| 523 |
-
this.classList.add('border-purple-500', 'bg-purple-900');
|
| 524 |
-
});
|
| 525 |
-
|
| 526 |
-
fileUpload.addEventListener('dragleave', function(e) {
|
| 527 |
-
e.preventDefault();
|
| 528 |
-
this.classList.remove('border-purple-500', 'bg-purple-900');
|
| 529 |
-
});
|
| 530 |
-
|
| 531 |
-
fileUpload.addEventListener('drop', function(e) {
|
| 532 |
-
e.preventDefault();
|
| 533 |
-
this.classList.remove('border-purple-500', 'bg-purple-900');
|
| 534 |
-
// Handle dropped files
|
| 535 |
-
console.log('Files dropped:', e.dataTransfer.files);
|
| 536 |
-
});
|
| 537 |
-
|
| 538 |
-
// Simulate API calls
|
| 539 |
-
async function uploadFile(file, metadata) {
|
| 540 |
-
// In a real implementation, this would call the Flask API
|
| 541 |
-
console.log('Uploading file:', file.name);
|
| 542 |
-
console.log('With metadata:', metadata);
|
| 543 |
-
|
| 544 |
-
// Simulate API delay
|
| 545 |
-
await new Promise(resolve => setTimeout(resolve, 1500));
|
| 546 |
-
|
| 547 |
-
return {
|
| 548 |
-
success: true,
|
| 549 |
-
fileId: 'file_' + Math.random().toString(36).substr(2, 9),
|
| 550 |
-
message: 'File uploaded successfully'
|
| 551 |
-
};
|
| 552 |
-
}
|
| 553 |
-
|
| 554 |
-
async function trainModel(model, fileIds, params) {
|
| 555 |
-
// In a real implementation, this would call the Flask API
|
| 556 |
-
console.log('Training model:', model);
|
| 557 |
-
console.log('With files:', fileIds);
|
| 558 |
-
console.log('Parameters:', params);
|
| 559 |
-
|
| 560 |
-
// Simulate API delay
|
| 561 |
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
| 562 |
-
|
| 563 |
-
return {
|
| 564 |
-
success: true,
|
| 565 |
-
trainingId: 'train_' + Math.random().toString(36).substr(2, 9),
|
| 566 |
-
message: 'Training initiated'
|
| 567 |
-
};
|
| 568 |
-
}
|
| 569 |
-
|
| 570 |
-
// Live training with Mostly AI
|
| 571 |
-
async function trainWithMostlyAI(datasetId, agent) {
|
| 572 |
-
try {
|
| 573 |
-
const res = await fetch(`/grid/train?dataset_id=${datasetId}&agent=${encodeURIComponent(agent)}`, {
|
| 574 |
-
method: 'POST'
|
| 575 |
-
});
|
| 576 |
-
const data = await res.json();
|
| 577 |
-
console.log('Training response:', data);
|
| 578 |
-
return data;
|
| 579 |
-
} catch (error) {
|
| 580 |
-
console.error('Training failed:', error);
|
| 581 |
-
return { success: false, message: 'Training failed' };
|
| 582 |
-
}
|
| 583 |
-
}
|
| 584 |
-
|
| 585 |
-
// Training modal with Mostly AI integration
|
| 586 |
-
document.getElementById('train-btn').addEventListener('click', function() {
|
| 587 |
-
// For demo purposes, we'll use the dataset ID from your example
|
| 588 |
-
const datasetId = '6d8252c3-21a1-499c-b469-7ce2a29cac8e';
|
| 589 |
-
const agent = 'DeepSeek V3.1';
|
| 590 |
-
|
| 591 |
-
trainWithMostlyAI(datasetId, agent).then(result => {
|
| 592 |
-
if (result.message) {
|
| 593 |
-
// Update ticker with training message
|
| 594 |
-
document.getElementById('mostar-feed').innerHTML =
|
| 595 |
-
`🔹 [Training] ${result.message} – Dataset: ${result.dataset} – Agent: ${result.agent}`;
|
| 596 |
-
}
|
| 597 |
-
});
|
| 598 |
-
});
|
| 599 |
-
|
| 600 |
-
// Live ticker
|
| 601 |
-
async function updateFeed() {
|
| 602 |
-
try {
|
| 603 |
-
const res = await fetch("/grid/feed");
|
| 604 |
-
const data = await res.json();
|
| 605 |
-
document.getElementById('mostar-feed').textContent = data.message;
|
| 606 |
-
} catch (error) {
|
| 607 |
-
console.error('Failed to fetch grid feed:', error);
|
| 608 |
-
}
|
| 609 |
-
}
|
| 610 |
-
|
| 611 |
-
setInterval(updateFeed, 2000);
|
| 612 |
-
updateFeed(); // Initial load
|
| 613 |
-
|
| 614 |
-
// Update stats cards
|
| 615 |
-
async function updateStats() {
|
| 616 |
-
try {
|
| 617 |
-
const res = await fetch("/grid/status");
|
| 618 |
-
const data = await res.json();
|
| 619 |
-
|
| 620 |
-
// Update stats cards
|
| 621 |
-
document.querySelectorAll('.grid-card')[0].querySelector('h3').textContent = data.neural_nodes;
|
| 622 |
-
document.querySelectorAll('.grid-card')[2].querySelector('h3').textContent = data.coherence + '%';
|
| 623 |
-
document.querySelectorAll('.grid-card')[3].querySelector('h3').textContent = data.sync_delay + 's ago';
|
| 624 |
-
} catch (error) {
|
| 625 |
-
console.error('Failed to fetch grid status:', error);
|
| 626 |
-
}
|
| 627 |
-
}
|
| 628 |
-
|
| 629 |
-
setInterval(updateStats, 5000);
|
| 630 |
-
updateStats(); // Initial load
|
| 631 |
-
return {
|
| 632 |
-
success: true,
|
| 633 |
-
trainingId: 'train_' + Math.random().toString(36).substr(2, 9),
|
| 634 |
-
message: 'Training initiated'
|
| 635 |
-
};
|
| 636 |
-
}
|
| 637 |
-
// Live ticker
|
| 638 |
-
async function updateFeed() {
|
| 639 |
-
try {
|
| 640 |
-
const res = await fetch("/grid/feed");
|
| 641 |
-
const data = await res.json();
|
| 642 |
-
document.getElementById('mostar-feed').textContent = data.message;
|
| 643 |
-
} catch (error) {
|
| 644 |
-
console.error('Failed to fetch grid feed:', error);
|
| 645 |
-
}
|
| 646 |
-
}
|
| 647 |
-
|
| 648 |
-
setInterval(updateFeed, 2000);
|
| 649 |
-
updateFeed(); // Initial load
|
| 650 |
-
|
| 651 |
-
// Update stats cards
|
| 652 |
-
async function updateStats() {
|
| 653 |
-
try {
|
| 654 |
-
const res = await fetch("/grid/status");
|
| 655 |
-
const data = await res.json();
|
| 656 |
-
|
| 657 |
-
// Update stats cards
|
| 658 |
-
document.querySelectorAll('.grid-card')[0].querySelector('h3').textContent = data.neural_nodes;
|
| 659 |
-
document.querySelectorAll('.grid-card')[2].querySelector('h3').textContent = data.coherence + '%';
|
| 660 |
-
document.querySelectorAll('.grid-card')[3].querySelector('h3').textContent = data.sync_delay + 's ago';
|
| 661 |
-
} catch (error) {
|
| 662 |
-
console.error('Failed to fetch grid status:', error);
|
| 663 |
-
}
|
| 664 |
-
}
|
| 665 |
-
setInterval(updateStats, 5000);
|
| 666 |
-
updateStats(); // Initial load
|
| 667 |
-
</script>
|
| 668 |
</body>
|
| 669 |
</html>
|
|
|
|
| 8 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
<link rel="stylesheet" href="style.css">
|
| 11 |
+
<script src="components/navbar.js"></script>
|
| 12 |
+
<script src="components/sidebar.js"></script>
|
| 13 |
+
<style>
|
| 14 |
:root {
|
| 15 |
--color-bg: #0d0b1e;
|
| 16 |
--color-accent: #7f5af0;
|
|
|
|
| 92 |
<!-- Frontend UI -->
|
| 93 |
<div class="flex h-screen overflow-hidden">
|
| 94 |
<!-- Sidebar -->
|
| 95 |
+
<custom-sidebar></custom-sidebar>
|
| 96 |
+
<!-- Main Content -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
<div class="flex-1 flex flex-col overflow-hidden">
|
| 98 |
<!-- Header -->
|
| 99 |
<header class="bg-gray-900 shadow-sm z-10">
|
|
|
|
| 402 |
</div>
|
| 403 |
</div>
|
| 404 |
<script src="script.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
| 405 |
</body>
|
| 406 |
</html>
|
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
// Modal functionality
|
| 2 |
function setupModal(modalId, openBtnId, closeBtnId) {
|
| 3 |
const modal = document.getElementById(modalId);
|
|
@@ -6,28 +7,39 @@ function setupModal(modalId, openBtnId, closeBtnId) {
|
|
| 6 |
|
| 7 |
if (openBtn) {
|
| 8 |
openBtn.addEventListener('click', () => {
|
| 9 |
-
modal.
|
| 10 |
});
|
| 11 |
}
|
| 12 |
|
| 13 |
if (closeBtn) {
|
| 14 |
closeBtn.addEventListener('click', () => {
|
| 15 |
-
modal.
|
| 16 |
});
|
| 17 |
}
|
| 18 |
|
|
|
|
| 19 |
window.addEventListener('click', (event) => {
|
| 20 |
if (event.target === modal) {
|
| 21 |
-
modal.
|
| 22 |
}
|
| 23 |
});
|
| 24 |
}
|
| 25 |
|
| 26 |
-
// Initialize modals
|
| 27 |
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
| 28 |
setupModal('upload-modal', 'upload-btn', 'close-modal');
|
| 29 |
setupModal('training-modal', 'train-btn', 'close-training-modal');
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
// File upload interaction
|
| 32 |
const fileUpload = document.querySelector('.file-upload');
|
| 33 |
const fileInput = document.getElementById('file-input');
|
|
@@ -55,98 +67,461 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 55 |
});
|
| 56 |
}
|
| 57 |
|
| 58 |
-
//
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
console.log('Parameters:', params);
|
| 79 |
-
|
| 80 |
-
// Simulate API delay
|
| 81 |
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
| 82 |
-
|
| 83 |
-
return {
|
| 84 |
-
success: true,
|
| 85 |
-
trainingId: 'train_' + Math.random().toString(36).substr(2, 9),
|
| 86 |
-
message: 'Training initiated'
|
| 87 |
-
};
|
| 88 |
}
|
| 89 |
|
| 90 |
-
//
|
| 91 |
-
async function
|
| 92 |
try {
|
| 93 |
-
const
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
});
|
| 96 |
-
const data = await
|
| 97 |
-
console.log('
|
| 98 |
return data;
|
| 99 |
} catch (error) {
|
| 100 |
-
console.error('
|
| 101 |
-
return { success: false, message: 'Training failed' };
|
| 102 |
}
|
| 103 |
}
|
| 104 |
|
| 105 |
-
//
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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 146 |
-
const data = await res.json();
|
| 147 |
const tickerEl = document.getElementById('mostar-feed');
|
| 148 |
if (tickerEl) {
|
| 149 |
-
tickerEl.textContent =
|
| 150 |
}
|
| 151 |
} catch (error) {
|
| 152 |
console.error('Failed to fetch grid feed:', error);
|
|
@@ -159,19 +534,16 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 159 |
// Update stats cards
|
| 160 |
async function updateStats() {
|
| 161 |
try {
|
| 162 |
-
|
| 163 |
-
const data = await res.json();
|
| 164 |
-
|
| 165 |
-
// Update stats cards
|
| 166 |
const cards = document.querySelectorAll('.grid-card');
|
| 167 |
if (cards.length > 0) {
|
| 168 |
-
cards[0].querySelector('h3').textContent =
|
| 169 |
}
|
| 170 |
if (cards.length > 2) {
|
| 171 |
-
cards[2].querySelector('h3').textContent =
|
| 172 |
}
|
| 173 |
if (cards.length > 3) {
|
| 174 |
-
cards[3].querySelector('h3').textContent =
|
| 175 |
}
|
| 176 |
} catch (error) {
|
| 177 |
console.error('Failed to fetch grid status:', error);
|
|
@@ -180,4 +552,4 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 180 |
|
| 181 |
setInterval(updateStats, 5000);
|
| 182 |
updateStats(); // Initial load
|
| 183 |
-
});
|
|
|
|
| 1 |
+
|
| 2 |
// Modal functionality
|
| 3 |
function setupModal(modalId, openBtnId, closeBtnId) {
|
| 4 |
const modal = document.getElementById(modalId);
|
|
|
|
| 7 |
|
| 8 |
if (openBtn) {
|
| 9 |
openBtn.addEventListener('click', () => {
|
| 10 |
+
modal.classList.remove('hidden');
|
| 11 |
});
|
| 12 |
}
|
| 13 |
|
| 14 |
if (closeBtn) {
|
| 15 |
closeBtn.addEventListener('click', () => {
|
| 16 |
+
modal.classList.add('hidden');
|
| 17 |
});
|
| 18 |
}
|
| 19 |
|
| 20 |
+
// Close modal when clicking outside
|
| 21 |
window.addEventListener('click', (event) => {
|
| 22 |
if (event.target === modal) {
|
| 23 |
+
modal.classList.add('hidden');
|
| 24 |
}
|
| 25 |
});
|
| 26 |
}
|
| 27 |
|
| 28 |
+
// Initialize modals and event listeners
|
| 29 |
document.addEventListener('DOMContentLoaded', () => {
|
| 30 |
+
// Setup modals
|
| 31 |
setupModal('upload-modal', 'upload-btn', 'close-modal');
|
| 32 |
setupModal('training-modal', 'train-btn', 'close-training-modal');
|
| 33 |
|
| 34 |
+
// Listen for custom events from web components
|
| 35 |
+
document.addEventListener('upload-clicked', () => {
|
| 36 |
+
document.getElementById('upload-modal').classList.remove('hidden');
|
| 37 |
+
});
|
| 38 |
+
|
| 39 |
+
document.addEventListener('train-clicked', () => {
|
| 40 |
+
document.getElementById('training-modal').classList.remove('hidden');
|
| 41 |
+
});
|
| 42 |
+
|
| 43 |
// File upload interaction
|
| 44 |
const fileUpload = document.querySelector('.file-upload');
|
| 45 |
const fileInput = document.getElementById('file-input');
|
|
|
|
| 67 |
});
|
| 68 |
}
|
| 69 |
|
| 70 |
+
// MoStar Quantum AI API Integration
|
| 71 |
+
const API_BASE = 'https://basic.mo-overlord.tech/realtime';
|
| 72 |
+
const QUANTUM_TIER = 'basic';
|
| 73 |
+
const TEMPORAL_MODE = 'realtime';
|
| 74 |
+
|
| 75 |
+
// Get AI Assistant Persona
|
| 76 |
+
async function getAIAssistant() {
|
| 77 |
+
try {
|
| 78 |
+
const response = await fetch(`${API_BASE}/ai-assistant`, {
|
| 79 |
+
headers: {
|
| 80 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 81 |
+
'Content-Type': 'application/json'
|
| 82 |
+
}
|
| 83 |
+
});
|
| 84 |
+
const data = await response.json();
|
| 85 |
+
console.log('AI Assistant:', data);
|
| 86 |
+
return data;
|
| 87 |
+
} catch (error) {
|
| 88 |
+
console.error('Error fetching AI assistant:', error);
|
| 89 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
}
|
| 91 |
|
| 92 |
+
// Get Enhancement Roadmap
|
| 93 |
+
async function getEnhancementRoadmap() {
|
| 94 |
try {
|
| 95 |
+
const response = await fetch(`${API_BASE}/enhancement-roadmap`);
|
| 96 |
+
const data = await response.json();
|
| 97 |
+
console.log('Enhancement Roadmap:', data);
|
| 98 |
+
return data;
|
| 99 |
+
} catch (error) {
|
| 100 |
+
console.error('Error fetching enhancement roadmap:', error);
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
// Submit Roadmap Feedback
|
| 105 |
+
async function submitRoadmapFeedback(feedback) {
|
| 106 |
+
try {
|
| 107 |
+
const response = await fetch(`${API_BASE}/roadmap-feedback`, {
|
| 108 |
+
method: 'POST',
|
| 109 |
+
headers: {
|
| 110 |
+
'Content-Type': 'application/json'
|
| 111 |
+
},
|
| 112 |
+
body: JSON.stringify(feedback)
|
| 113 |
});
|
| 114 |
+
const data = await response.json();
|
| 115 |
+
console.log('Feedback submitted:', data);
|
| 116 |
return data;
|
| 117 |
} catch (error) {
|
| 118 |
+
console.error('Error submitting feedback:', error);
|
|
|
|
| 119 |
}
|
| 120 |
}
|
| 121 |
|
| 122 |
+
// Generate Image
|
| 123 |
+
async function generateImage(prompt, n = 1, size = '512x512') {
|
| 124 |
+
try {
|
| 125 |
+
const response = await fetch(`${API_BASE}/images/generations`, {
|
| 126 |
+
method: 'POST',
|
| 127 |
+
headers: {
|
| 128 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 129 |
+
'Content-Type': 'application/json'
|
| 130 |
+
},
|
| 131 |
+
body: JSON.stringify({ prompt, n, size })
|
| 132 |
+
});
|
| 133 |
+
const data = await response.json();
|
| 134 |
+
console.log('Generated images:', data);
|
| 135 |
+
return data;
|
| 136 |
+
} catch (error) {
|
| 137 |
+
console.error('Error generating image:', error);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
// Create Embedding
|
| 142 |
+
async function createEmbedding(model, input) {
|
| 143 |
+
try {
|
| 144 |
+
const response = await fetch(`${API_BASE}/embeddings`, {
|
| 145 |
+
method: 'POST',
|
| 146 |
+
headers: {
|
| 147 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 148 |
+
'Content-Type': 'application/json'
|
| 149 |
+
},
|
| 150 |
+
body: JSON.stringify({ model, input })
|
| 151 |
+
});
|
| 152 |
+
const data = await response.json();
|
| 153 |
+
console.log('Embedding created:', data);
|
| 154 |
+
return data;
|
| 155 |
+
} catch (error) {
|
| 156 |
+
console.error('Error creating embedding:', error);
|
| 157 |
+
}
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
// Create Transcription
|
| 161 |
+
async function createTranscription(file, model, prompt = '', responseFormat = 'json') {
|
| 162 |
+
try {
|
| 163 |
+
const formData = new FormData();
|
| 164 |
+
formData.append('file', file);
|
| 165 |
+
formData.append('model', model);
|
| 166 |
+
formData.append('prompt', prompt);
|
| 167 |
+
formData.append('response_format', responseFormat);
|
| 168 |
|
| 169 |
+
const response = await fetch(`${API_BASE}/audio/transcriptions`, {
|
| 170 |
+
method: 'POST',
|
| 171 |
+
headers: {
|
| 172 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 173 |
+
},
|
| 174 |
+
body: formData
|
| 175 |
+
});
|
| 176 |
+
const data = await response.json();
|
| 177 |
+
console.log('Transcription created:', data);
|
| 178 |
+
return data;
|
| 179 |
+
} catch (error) {
|
| 180 |
+
console.error('Error creating transcription:', error);
|
| 181 |
+
}
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
// Create Moderation
|
| 185 |
+
async function createModeration(input, model = 'text-moderation-stable') {
|
| 186 |
+
try {
|
| 187 |
+
const response = await fetch(`${API_BASE}/moderations`, {
|
| 188 |
+
method: 'POST',
|
| 189 |
+
headers: {
|
| 190 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 191 |
+
'Content-Type': 'application/json'
|
| 192 |
+
},
|
| 193 |
+
body: JSON.stringify({ input, model })
|
| 194 |
+
});
|
| 195 |
+
const data = await response.json();
|
| 196 |
+
console.log('Moderation result:', data);
|
| 197 |
+
return data;
|
| 198 |
+
} catch (error) {
|
| 199 |
+
console.error('Error creating moderation:', error);
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
// Upload File
|
| 204 |
+
async function uploadFile(file, purpose) {
|
| 205 |
+
try {
|
| 206 |
+
const formData = new FormData();
|
| 207 |
+
formData.append('file', file);
|
| 208 |
+
formData.append('purpose', purpose);
|
| 209 |
|
| 210 |
+
const response = await fetch(`${API_BASE}/files`, {
|
| 211 |
+
method: 'POST',
|
| 212 |
+
headers: {
|
| 213 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 214 |
+
},
|
| 215 |
+
body: formData
|
| 216 |
+
});
|
| 217 |
+
const data = await response.json();
|
| 218 |
+
console.log('File uploaded:', data);
|
| 219 |
+
return data;
|
| 220 |
+
} catch (error) {
|
| 221 |
+
console.error('Error uploading file:', error);
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
// Get File Details
|
| 226 |
+
async function getFileDetails(fileId) {
|
| 227 |
+
try {
|
| 228 |
+
const response = await fetch(`${API_BASE}/files/${fileId}`, {
|
| 229 |
+
headers: {
|
| 230 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 231 |
}
|
| 232 |
+
});
|
| 233 |
+
const data = await response.json();
|
| 234 |
+
console.log('File details:', data);
|
| 235 |
+
return data;
|
| 236 |
+
} catch (error) {
|
| 237 |
+
console.error('Error getting file details:', error);
|
| 238 |
+
}
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
// Create Fine Tune
|
| 242 |
+
async function createFineTune(trainingFile, model, nEpochs = 4) {
|
| 243 |
+
try {
|
| 244 |
+
const response = await fetch(`${API_BASE}/fine-tunes`, {
|
| 245 |
+
method: 'POST',
|
| 246 |
+
headers: {
|
| 247 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 248 |
+
'Content-Type': 'application/json'
|
| 249 |
+
},
|
| 250 |
+
body: JSON.stringify({ training_file: trainingFile, model, n_epochs: nEpochs })
|
| 251 |
+
});
|
| 252 |
+
const data = await response.json();
|
| 253 |
+
console.log('Fine tune created:', data);
|
| 254 |
+
return data;
|
| 255 |
+
} catch (error) {
|
| 256 |
+
console.error('Error creating fine tune:', error);
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
// Get Usage Data
|
| 261 |
+
async function getUsage() {
|
| 262 |
+
try {
|
| 263 |
+
const response = await fetch(`${API_BASE}/usage`, {
|
| 264 |
+
headers: {
|
| 265 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 266 |
+
}
|
| 267 |
+
});
|
| 268 |
+
const data = await response.json();
|
| 269 |
+
console.log('Usage data:', data);
|
| 270 |
+
return data;
|
| 271 |
+
} catch (error) {
|
| 272 |
+
console.error('Error getting usage data:', error);
|
| 273 |
+
}
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
// Get Billing Usage
|
| 277 |
+
async function getBillingUsage() {
|
| 278 |
+
try {
|
| 279 |
+
const response = await fetch(`${API_BASE}/billing/usage`, {
|
| 280 |
+
headers: {
|
| 281 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 282 |
+
}
|
| 283 |
+
});
|
| 284 |
+
const data = await response.json();
|
| 285 |
+
console.log('Billing usage:', data);
|
| 286 |
+
return data;
|
| 287 |
+
} catch (error) {
|
| 288 |
+
console.error('Error getting billing usage:', error);
|
| 289 |
+
}
|
| 290 |
}
|
| 291 |
|
| 292 |
+
// List Subscriptions
|
| 293 |
+
async function listSubscriptions() {
|
| 294 |
+
try {
|
| 295 |
+
const response = await fetch(`${API_BASE}/subscriptions`, {
|
| 296 |
+
headers: {
|
| 297 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 298 |
+
}
|
| 299 |
+
});
|
| 300 |
+
const data = await response.json();
|
| 301 |
+
console.log('Subscriptions:', data);
|
| 302 |
+
return data;
|
| 303 |
+
} catch (error) {
|
| 304 |
+
console.error('Error listing subscriptions:', error);
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
// Enhance Security Measures
|
| 309 |
+
async function enhanceSecurityMeasures(securityLevel, description) {
|
| 310 |
+
try {
|
| 311 |
+
const response = await fetch(`${API_BASE}/security/enhanced`, {
|
| 312 |
+
method: 'POST',
|
| 313 |
+
headers: {
|
| 314 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 315 |
+
'Content-Type': 'application/json'
|
| 316 |
+
},
|
| 317 |
+
body: JSON.stringify({ securityLevel, description })
|
| 318 |
+
});
|
| 319 |
+
const data = await response.json();
|
| 320 |
+
console.log('Security enhanced:', data);
|
| 321 |
+
return data;
|
| 322 |
+
} catch (error) {
|
| 323 |
+
console.error('Error enhancing security:', error);
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
// Integrate with DHL
|
| 328 |
+
async function integrateDHL(dhlUrl, dhlToken) {
|
| 329 |
+
try {
|
| 330 |
+
const response = await fetch(`${API_BASE}/integration/supply-chain/dhl`, {
|
| 331 |
+
method: 'POST',
|
| 332 |
+
headers: {
|
| 333 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 334 |
+
'Content-Type': 'application/json'
|
| 335 |
+
},
|
| 336 |
+
body: JSON.stringify({ dhl_url: dhlUrl, dhl_token: dhlToken })
|
| 337 |
+
});
|
| 338 |
+
const data = await response.json();
|
| 339 |
+
console.log('DHL integrated:', data);
|
| 340 |
+
return data;
|
| 341 |
+
} catch (error) {
|
| 342 |
+
console.error('Error integrating DHL:', error);
|
| 343 |
+
}
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
// Integrate with Figma
|
| 347 |
+
async function integrateFigma(figmaUrl, figmaToken) {
|
| 348 |
+
try {
|
| 349 |
+
const response = await fetch(`${API_BASE}/integration/design/figma`, {
|
| 350 |
+
method: 'POST',
|
| 351 |
+
headers: {
|
| 352 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 353 |
+
'Content-Type': 'application/json'
|
| 354 |
+
},
|
| 355 |
+
body: JSON.stringify({ figma_url: figmaUrl, figma_token: figmaToken })
|
| 356 |
+
});
|
| 357 |
+
const data = await response.json();
|
| 358 |
+
console.log('Figma integrated:', data);
|
| 359 |
+
return data;
|
| 360 |
+
} catch (error) {
|
| 361 |
+
console.error('Error integrating Figma:', error);
|
| 362 |
+
}
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
// Register Federated Node
|
| 366 |
+
async function registerFederatedNode(nodeId, modelType) {
|
| 367 |
+
try {
|
| 368 |
+
const response = await fetch(`${API_BASE}/federated-node/register`, {
|
| 369 |
+
method: 'POST',
|
| 370 |
+
headers: {
|
| 371 |
+
'Content-Type': 'application/json'
|
| 372 |
+
},
|
| 373 |
+
body: JSON.stringify({ node_id: nodeId, model_type: modelType })
|
| 374 |
+
});
|
| 375 |
+
const data = await response.json();
|
| 376 |
+
console.log('Node registered:', data);
|
| 377 |
+
return data;
|
| 378 |
+
} catch (error) {
|
| 379 |
+
console.error('Error registering node:', error);
|
| 380 |
+
}
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
// Submit Federated Training
|
| 384 |
+
async function submitFederatedTraining(weights) {
|
| 385 |
+
try {
|
| 386 |
+
const response = await fetch(`${API_BASE}/federated-training/submit`, {
|
| 387 |
+
method: 'POST',
|
| 388 |
+
headers: {
|
| 389 |
+
'Content-Type': 'application/json'
|
| 390 |
+
},
|
| 391 |
+
body: JSON.stringify({ weights })
|
| 392 |
+
});
|
| 393 |
+
const data = await response.json();
|
| 394 |
+
console.log('Training submitted:', data);
|
| 395 |
+
return data;
|
| 396 |
+
} catch (error) {
|
| 397 |
+
console.error('Error submitting training:', error);
|
| 398 |
+
}
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
// Get Global Model
|
| 402 |
+
async function getGlobalModel() {
|
| 403 |
+
try {
|
| 404 |
+
const response = await fetch(`${API_BASE}/federated-training/global-model`);
|
| 405 |
+
const data = await response.json();
|
| 406 |
+
console.log('Global model:', data);
|
| 407 |
+
return data;
|
| 408 |
+
} catch (error) {
|
| 409 |
+
console.error('Error getting global model:', error);
|
| 410 |
+
}
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
// Validate Hypothesis
|
| 414 |
+
async function validateHypothesis(facts, rules, hypothesis) {
|
| 415 |
+
try {
|
| 416 |
+
const response = await fetch(`${API_BASE}/reasoning/validate-hypothesis`, {
|
| 417 |
+
method: 'POST',
|
| 418 |
+
headers: {
|
| 419 |
+
'Content-Type': 'application/json'
|
| 420 |
+
},
|
| 421 |
+
body: JSON.stringify({ facts, rules, hypothesis })
|
| 422 |
+
});
|
| 423 |
+
const data = await response.json();
|
| 424 |
+
console.log('Hypothesis validation:', data);
|
| 425 |
+
return data;
|
| 426 |
+
} catch (error) {
|
| 427 |
+
console.error('Error validating hypothesis:', error);
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
// Get MoStar Manifest
|
| 432 |
+
async function getMostarManifest() {
|
| 433 |
+
try {
|
| 434 |
+
const response = await fetch(`${API_BASE}/mostar/manifest`);
|
| 435 |
+
const data = await response.json();
|
| 436 |
+
console.log('MoStar manifest:', data);
|
| 437 |
+
return data;
|
| 438 |
+
} catch (error) {
|
| 439 |
+
console.error('Error getting MoStar manifest:', error);
|
| 440 |
+
}
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
// Get MoStar Core
|
| 444 |
+
async function getMostarCore() {
|
| 445 |
+
try {
|
| 446 |
+
const response = await fetch(`${API_BASE}/mostar/core`, {
|
| 447 |
+
headers: {
|
| 448 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE'
|
| 449 |
+
}
|
| 450 |
+
});
|
| 451 |
+
const data = await response.json();
|
| 452 |
+
console.log('MoStar core:', data);
|
| 453 |
+
return data;
|
| 454 |
+
} catch (error) {
|
| 455 |
+
console.error('Error getting MoStar core:', error);
|
| 456 |
+
}
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
// Activate Quantum Persona
|
| 460 |
+
async function activateQuantumPersona(persona, particleDensity, statusColors) {
|
| 461 |
+
try {
|
| 462 |
+
const response = await fetch(`${API_BASE}/quantum/activate`, {
|
| 463 |
+
method: 'POST',
|
| 464 |
+
headers: {
|
| 465 |
+
'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE',
|
| 466 |
+
'Content-Type': 'application/json'
|
| 467 |
+
},
|
| 468 |
+
body: JSON.stringify({ persona, particle_density: particleDensity, status_colors: statusColors })
|
| 469 |
+
});
|
| 470 |
+
const data = await response.json();
|
| 471 |
+
console.log('Quantum persona activated:', data);
|
| 472 |
+
return data;
|
| 473 |
+
} catch (error) {
|
| 474 |
+
console.error('Error activating quantum persona:', error);
|
| 475 |
+
}
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
// Example usage of API functions
|
| 479 |
+
// Uncomment the following lines to test API integration
|
| 480 |
+
|
| 481 |
+
/*
|
| 482 |
+
// Get AI Assistant
|
| 483 |
+
getAIAssistant();
|
| 484 |
+
|
| 485 |
+
// Get Enhancement Roadmap
|
| 486 |
+
getEnhancementRoadmap();
|
| 487 |
+
|
| 488 |
+
// Submit Feedback
|
| 489 |
+
submitRoadmapFeedback({
|
| 490 |
+
feedback: "Great roadmap! Would love to see more focus on quantum integration.",
|
| 491 |
+
user_id: "user_123",
|
| 492 |
+
satisfaction_score: 5
|
| 493 |
+
});
|
| 494 |
+
|
| 495 |
+
// Generate Image
|
| 496 |
+
generateImage("A futuristic cityscape with flying cars and holographic billboards", 1, "1024x1024");
|
| 497 |
+
|
| 498 |
+
// Create Embedding
|
| 499 |
+
createEmbedding("text-embedding-ada-002", "The quick brown fox jumps over the lazy dog");
|
| 500 |
+
|
| 501 |
+
// Register Federated Node
|
| 502 |
+
registerFederatedNode("node_456", "lstm");
|
| 503 |
+
|
| 504 |
+
// Validate Hypothesis
|
| 505 |
+
validateHypothesis(
|
| 506 |
+
["LassaFever(x) -> ViralDisease(x)", "Endemic(x, Nigeria)"],
|
| 507 |
+
["ViralDisease(x) ∧ Endemic(x, Nigeria) -> RequiresMonitoring(x)"],
|
| 508 |
+
"RequiresMonitoring(LassaFever)"
|
| 509 |
+
);
|
| 510 |
+
|
| 511 |
+
// Get MoStar Manifest
|
| 512 |
+
getMostarManifest();
|
| 513 |
+
|
| 514 |
+
// Activate Quantum Persona
|
| 515 |
+
activateQuantumPersona("JARVIS", 7500, ["quantum_red", "quantum_yellow"]);
|
| 516 |
+
*/
|
| 517 |
+
|
| 518 |
// Live ticker
|
| 519 |
async function updateFeed() {
|
| 520 |
try {
|
| 521 |
+
// Using a placeholder message since we don't have a real endpoint
|
|
|
|
| 522 |
const tickerEl = document.getElementById('mostar-feed');
|
| 523 |
if (tickerEl) {
|
| 524 |
+
tickerEl.textContent = "🔸 [Mostar Feed] Grid sync stable – Neural nodes: 427 active – Last signal: 2.3s ago – Coherence: 99.98% – Flow: Optimal";
|
| 525 |
}
|
| 526 |
} catch (error) {
|
| 527 |
console.error('Failed to fetch grid feed:', error);
|
|
|
|
| 534 |
// Update stats cards
|
| 535 |
async function updateStats() {
|
| 536 |
try {
|
| 537 |
+
// Using placeholder data since we don't have a real endpoint
|
|
|
|
|
|
|
|
|
|
| 538 |
const cards = document.querySelectorAll('.grid-card');
|
| 539 |
if (cards.length > 0) {
|
| 540 |
+
cards[0].querySelector('h3').textContent = '427';
|
| 541 |
}
|
| 542 |
if (cards.length > 2) {
|
| 543 |
+
cards[2].querySelector('h3').textContent = '99.98%';
|
| 544 |
}
|
| 545 |
if (cards.length > 3) {
|
| 546 |
+
cards[3].querySelector('h3').textContent = '2.3s ago';
|
| 547 |
}
|
| 548 |
} catch (error) {
|
| 549 |
console.error('Failed to fetch grid status:', error);
|
|
|
|
| 552 |
|
| 553 |
setInterval(updateStats, 5000);
|
| 554 |
updateStats(); // Initial load
|
| 555 |
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
:root {
|
| 2 |
--color-bg: #0d0b1e;
|
| 3 |
--color-accent: #7f5af0;
|
|
@@ -8,6 +9,8 @@ body {
|
|
| 8 |
background-color: var(--color-bg);
|
| 9 |
color: #fffffe;
|
| 10 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
|
|
|
|
|
| 11 |
}
|
| 12 |
|
| 13 |
.gradient-bg {
|
|
@@ -29,21 +32,13 @@ body {
|
|
| 29 |
.file-upload {
|
| 30 |
border: 2px dashed #7f5af0;
|
| 31 |
transition: all 0.3s ease;
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
.file-upload:hover {
|
| 35 |
background-color: rgba(127, 90, 240, 0.1);
|
| 36 |
}
|
| 37 |
|
| 38 |
-
.sidebar {
|
| 39 |
-
background-color: #0a0818;
|
| 40 |
-
transition: all 0.3s ease;
|
| 41 |
-
}
|
| 42 |
-
|
| 43 |
-
.sidebar-item:hover {
|
| 44 |
-
background-color: rgba(127, 90, 240, 0.2);
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
.pulse-animation {
|
| 48 |
animation: pulse 2s infinite;
|
| 49 |
}
|
|
@@ -76,8 +71,8 @@ body {
|
|
| 76 |
}
|
| 77 |
|
| 78 |
/* Modal Styles */
|
| 79 |
-
|
| 80 |
-
|
| 81 |
position: fixed;
|
| 82 |
top: 0;
|
| 83 |
left: 0;
|
|
@@ -85,16 +80,24 @@ body {
|
|
| 85 |
height: 100%;
|
| 86 |
background-color: rgba(0, 0, 0, 0.5);
|
| 87 |
z-index: 1000;
|
|
|
|
| 88 |
align-items: center;
|
| 89 |
justify-content: center;
|
| 90 |
}
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
.modal-content {
|
| 93 |
background-color: #1a1a2e;
|
| 94 |
border-radius: 8px;
|
| 95 |
width: 90%;
|
| 96 |
max-width: 500px;
|
| 97 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
|
| 98 |
}
|
| 99 |
|
| 100 |
.modal-header {
|
|
@@ -193,13 +196,7 @@ body {
|
|
| 193 |
|
| 194 |
/* Responsive */
|
| 195 |
@media (max-width: 768px) {
|
| 196 |
-
.sidebar {
|
| 197 |
-
width: 100%;
|
| 198 |
-
height: auto;
|
| 199 |
-
position: relative;
|
| 200 |
-
}
|
| 201 |
-
|
| 202 |
.main-content {
|
| 203 |
margin-left: 0;
|
| 204 |
}
|
| 205 |
-
}
|
|
|
|
| 1 |
+
|
| 2 |
:root {
|
| 3 |
--color-bg: #0d0b1e;
|
| 4 |
--color-accent: #7f5af0;
|
|
|
|
| 9 |
background-color: var(--color-bg);
|
| 10 |
color: #fffffe;
|
| 11 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 12 |
+
margin: 0;
|
| 13 |
+
padding: 0;
|
| 14 |
}
|
| 15 |
|
| 16 |
.gradient-bg {
|
|
|
|
| 32 |
.file-upload {
|
| 33 |
border: 2px dashed #7f5af0;
|
| 34 |
transition: all 0.3s ease;
|
| 35 |
+
cursor: pointer;
|
| 36 |
}
|
| 37 |
|
| 38 |
.file-upload:hover {
|
| 39 |
background-color: rgba(127, 90, 240, 0.1);
|
| 40 |
}
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
.pulse-animation {
|
| 43 |
animation: pulse 2s infinite;
|
| 44 |
}
|
|
|
|
| 71 |
}
|
| 72 |
|
| 73 |
/* Modal Styles */
|
| 74 |
+
#upload-modal,
|
| 75 |
+
#training-modal {
|
| 76 |
position: fixed;
|
| 77 |
top: 0;
|
| 78 |
left: 0;
|
|
|
|
| 80 |
height: 100%;
|
| 81 |
background-color: rgba(0, 0, 0, 0.5);
|
| 82 |
z-index: 1000;
|
| 83 |
+
display: flex;
|
| 84 |
align-items: center;
|
| 85 |
justify-content: center;
|
| 86 |
}
|
| 87 |
|
| 88 |
+
#upload-modal.hidden,
|
| 89 |
+
#training-modal.hidden {
|
| 90 |
+
display: none;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
.modal-content {
|
| 94 |
background-color: #1a1a2e;
|
| 95 |
border-radius: 8px;
|
| 96 |
width: 90%;
|
| 97 |
max-width: 500px;
|
| 98 |
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 99 |
+
max-height: 90vh;
|
| 100 |
+
overflow-y: auto;
|
| 101 |
}
|
| 102 |
|
| 103 |
.modal-header {
|
|
|
|
| 196 |
|
| 197 |
/* Responsive */
|
| 198 |
@media (max-width: 768px) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
.main-content {
|
| 200 |
margin-left: 0;
|
| 201 |
}
|
| 202 |
+
}
|