Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4098,6 +4098,14 @@ <h3>Whisper Messaging</h3>
<p>Private encrypted communications</p>
<div class="card-status">whisper.zhtp</div>
</div>

<!-- Ren AI Card -->
<div class="dashboard-card" data-action="ren">
<div class="card-icon">🤖</div>
<h3>Ren AI</h3>
<p>Your AI assistant for the Sovereign Network</p>
<div class="card-status" id="renStatus">ren.zhtp</div>
</div>
</div>

<!-- Network Status -->
Expand Down Expand Up @@ -4995,6 +5003,22 @@ <h2 class="modal-title">Whisper Messaging</h2>
</div>
</div>

<!-- Ren AI Modal -->
<div id="renModal" class="modal">
<div class="modal-content modal-large">
<div class="modal-header">
<h2 class="modal-title">Ren AI</h2>
<button class="close-btn" onclick="closeModal('renModal')">&times;</button>
</div>
<div id="renContent" style="height: 500px;">
<!-- Ren Chat Panel will be rendered here -->
</div>
</div>
</div>

<!-- Ren Client Script -->
<script type="module" src="./src/ren/ren-client.js"></script>

<!-- API Scripts -->
<script type="module" src="./src/api/zhtp-api.js"></script>

Expand Down
35 changes: 33 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1495,9 +1495,37 @@ Examples:
const modal = document.getElementById(modalId);
if (modal) {
modal.style.display = 'flex';
console.log('📂 Modal opened:', modalId);
console.log('Modal opened:', modalId);
} else {
console.warn('⚠️ Modal not found:', modalId);
console.warn('Modal not found:', modalId);
}
}

// Open Ren AI Chat
openRenChat() {
console.log('Opening Ren AI chat...');

// Initialize Ren client if not already done
if (!window.renClient) {
window.renClient = new window.RenClient({
zkDidManager: this.zkdidManager
});
}

// Initialize Ren panel if not already done
if (!window.renPanel) {
window.renPanel = new window.RenChatPanel({
client: window.renClient
});
}

// Open the modal
this.openModal('renModal');

// Render the chat panel into the modal content
const renContent = document.getElementById('renContent');
if (renContent && window.renPanel) {
window.renPanel.render(renContent);
}
}

Expand Down Expand Up @@ -1699,6 +1727,9 @@ Examples:
case 'whisper':
this.navigateToUrl('zhtp://whisper.zhtp');
break;
case 'ren':
this.openRenChat();
break;
default:
console.log('Unknown action:', action);
}
Expand Down
Loading