-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactive_chrome_ai.yaml
More file actions
135 lines (113 loc) · 3.34 KB
/
active_chrome_ai.yaml
File metadata and controls
135 lines (113 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
"manifest_version": 3,
"name": "Archangel HUD AI",
"version": "1.0",
"permissions": ["aiOriginTrial", "tabs", "activeTab"],
"action": {
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"]
}
]
}
async function initializeArchangelAI() {
// Check if the model is available on the device
const { available } = await ai.assistant.capabilities();
if (available !== 'no') {
const session = await ai.assistant.create({
systemPrompt: "You are an AI assistant with the wisdom of the 7 archangels. Provide concise, accurate, and protective guidance."
});
const input = document.getElementById('user-input').value;
const response = await session.prompt(input);
// Display in the HUD
document.getElementById('hud-display').innerText = response;
} else {
console.error("Gemini Nano not enabled in this Chrome instance.");
}
}
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: rgba(0, 10, 20, 0.9);
color: #00f2ff;
font-family: 'Courier New', monospace;
width: 300px;
border: 1px solid #00f2ff;
box-shadow: 0 0 15px #00f2ff;
}
.hud-container {
padding: 15px;
border-left: 5px solid #00f2ff;
}
input {
background: transparent;
border: 1px solid #00f2ff;
color: white;
width: 100%;
}
.glitch-text {
text-transform: uppercase;
font-weight: bold;
letter-spacing: 2px;
}
</style>
</head>
<body>
<div class="hud-container">
<div class="glitch-text">ARCHANGEL_CORE_V1</div>
<hr>
<div id="hud-display">Awaiting input...</div>
<input type="text" id="user-input" placeholder="Command...">
<button onclick="initializeArchangelAI()">EXECUTE</button>
</div>
<script src="popup.js"></script>
</body>
</html>
{
"manifest_version": 3,
"name": "Archangel HUD | Pro",
"version": "2.0.0",
"permissions": ["aiOriginTrial", "sidePanel", "storage", "tabs"],
"host_permissions": ["<all_urls>"],
"side_panel": { "default_path": "hud.html" },
"background": { "service_worker": "service-worker.js" }
}
// High-performance AI Controller
class ArchangelCore {
constructor() {
this.session = null;
this.outputElement = document.getElementById('hud-stream');
}
async initialize() {
const capabilities = await ai.assistant.capabilities();
if (capabilities.available === 'no') throw new Error("AI Core Offline");
// Kaizen: Reusing sessions for speed
this.session = await ai.assistant.create({
systemPrompt: "You are the Archangel AI. Provide HD scientific reasoning. Format output for HUD display."
});
}
async executeStream(prompt) {
if (!this.session) await this.initialize();
this.outputElement.innerHTML = ''; // Clear HUD
const stream = this.session.promptStreaming(prompt);
for await (const chunk of stream) {
// Stream directly to the 3D HUD
this.outputElement.append(chunk);
this.scrollHUD();
}
}
scrollHUD() {
const container = document.getElementById('hud-container');
container.scrollTop = container.scrollHeight;
}
}
const Core = new ArchangelCore();
document.getElementById('send-btn').addEventListener('click', () => {
const input = document.getElementById('user-input').value;
Core.executeStream(input);
});