Compare commits
1 Commits
mimo/code/
...
mimo/creat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5099a18c6 |
@@ -1,4 +1,4 @@
|
|||||||
const giteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1';
|
const GiteaApiUrl = 'https://forge.alexanderwhitestone.com/api/v1';
|
||||||
const token = process.env.GITEA_TOKEN; // Should be stored securely in environment variables
|
const token = process.env.GITEA_TOKEN; // Should be stored securely in environment variables
|
||||||
const repos = ['hermes-agent', 'the-nexus', 'timmy-home', 'timmy-config'];
|
const repos = ['hermes-agent', 'the-nexus', 'timmy-home', 'timmy-config'];
|
||||||
|
|
||||||
@@ -13,6 +13,31 @@ const branchProtectionSettings = {
|
|||||||
// Special handling for the-nexus (CI disabled)
|
// Special handling for the-nexus (CI disabled)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
async function applyBranchProtection(repo) {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `token ${token}`,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
...branchProtectionSettings,
|
||||||
|
// Special handling for the-nexus (CI disabled)
|
||||||
|
requiredStatusChecks: repo === 'the-nexus' ? false : true
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error(`Failed to apply branch protection to ${repo}: ${await response.text()}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`✅ Branch protection applied to ${repo}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`❌ Error applying branch protection to ${repo}: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function applyBranchProtection(repo) {
|
async function applyBranchProtection(repo) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
|
const response = await fetch(`${giteaApiUrl}/repos/Timmy_Foundation/${repo}/branches/main/protection`, {
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ from nexus.perception_adapter import (
|
|||||||
)
|
)
|
||||||
from nexus.experience_store import ExperienceStore
|
from nexus.experience_store import ExperienceStore
|
||||||
from nexus.groq_worker import GroqWorker
|
from nexus.groq_worker import GroqWorker
|
||||||
|
from nexus.heartbeat import write_heartbeat
|
||||||
from nexus.trajectory_logger import TrajectoryLogger
|
from nexus.trajectory_logger import TrajectoryLogger
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
@@ -286,6 +287,13 @@ class NexusMind:
|
|||||||
|
|
||||||
self.cycle_count += 1
|
self.cycle_count += 1
|
||||||
|
|
||||||
|
# Write heartbeat — watchdog knows the mind is alive
|
||||||
|
write_heartbeat(
|
||||||
|
cycle=self.cycle_count,
|
||||||
|
model=self.model,
|
||||||
|
status="thinking",
|
||||||
|
)
|
||||||
|
|
||||||
# Periodically distill old memories
|
# Periodically distill old memories
|
||||||
if self.cycle_count % 50 == 0 and self.cycle_count > 0:
|
if self.cycle_count % 50 == 0 and self.cycle_count > 0:
|
||||||
await self._distill_memories()
|
await self._distill_memories()
|
||||||
@@ -383,6 +391,13 @@ class NexusMind:
|
|||||||
salience=1.0,
|
salience=1.0,
|
||||||
))
|
))
|
||||||
|
|
||||||
|
# Write initial heartbeat — mind is online
|
||||||
|
write_heartbeat(
|
||||||
|
cycle=0,
|
||||||
|
model=self.model,
|
||||||
|
status="thinking",
|
||||||
|
)
|
||||||
|
|
||||||
while self.running:
|
while self.running:
|
||||||
try:
|
try:
|
||||||
await self.think_once()
|
await self.think_once()
|
||||||
@@ -423,6 +438,13 @@ class NexusMind:
|
|||||||
log.info("Nexus Mind shutting down...")
|
log.info("Nexus Mind shutting down...")
|
||||||
self.running = False
|
self.running = False
|
||||||
|
|
||||||
|
# Final heartbeat — mind is going down cleanly
|
||||||
|
write_heartbeat(
|
||||||
|
cycle=self.cycle_count,
|
||||||
|
model=self.model,
|
||||||
|
status="idle",
|
||||||
|
)
|
||||||
|
|
||||||
# Final stats
|
# Final stats
|
||||||
stats = self.trajectory_logger.get_session_stats()
|
stats = self.trajectory_logger.get_session_stats()
|
||||||
log.info(f"Session stats: {json.dumps(stats, indent=2)}")
|
log.info(f"Session stats: {json.dumps(stats, indent=2)}")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const ASSETS_TO_CACHE = [
|
|||||||
|
|
||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(CACHE_NAME).then(cache => {
|
caches.open(CachedName).then(cache => {
|
||||||
return cache.addAll(ASSETS_TO_CACHE);
|
return cache.addAll(ASSETS_TO_CACHE);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user