@vxnus/siduri 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/builtin-manifests.d.ts +0 -2
- package/dist/builtin-manifests.js +0 -464
- package/dist/clean-machine-e2e.test.d.ts +0 -1
- package/dist/clean-machine-e2e.test.js +0 -230
- package/dist/configurators/behavior.d.ts +0 -2
- package/dist/configurators/behavior.js +0 -36
- package/dist/configurators/body.d.ts +0 -2
- package/dist/configurators/body.js +0 -60
- package/dist/configurators/brain.d.ts +0 -6
- package/dist/configurators/brain.js +0 -80
- package/dist/configurators/ear.d.ts +0 -2
- package/dist/configurators/ear.js +0 -28
- package/dist/configurators/hands.d.ts +0 -2
- package/dist/configurators/hands.js +0 -27
- package/dist/configurators/index.d.ts +0 -23
- package/dist/configurators/index.js +0 -74
- package/dist/configurators/knowledge.d.ts +0 -6
- package/dist/configurators/knowledge.js +0 -100
- package/dist/configurators/memory.d.ts +0 -2
- package/dist/configurators/memory.js +0 -44
- package/dist/configurators/observation.d.ts +0 -2
- package/dist/configurators/observation.js +0 -12
- package/dist/configurators/types.d.ts +0 -12
- package/dist/configurators/types.js +0 -2
- package/dist/configurators/vision.d.ts +0 -2
- package/dist/configurators/vision.js +0 -39
- package/dist/configurators/voice.d.ts +0 -2
- package/dist/configurators/voice.js +0 -363
- package/dist/configurators.test.d.ts +0 -1
- package/dist/configurators.test.js +0 -299
- package/dist/db.d.ts +0 -25
- package/dist/db.js +0 -152
- package/dist/discovery.d.ts +0 -13
- package/dist/discovery.js +0 -87
- package/dist/discovery.test.d.ts +0 -1
- package/dist/discovery.test.js +0 -67
- package/dist/doctor-db.test.d.ts +0 -1
- package/dist/doctor-db.test.js +0 -141
- package/dist/doctor.d.ts +0 -19
- package/dist/doctor.js +0 -225
- package/dist/generator.d.ts +0 -21
- package/dist/generator.js +0 -542
- package/dist/generator.test.d.ts +0 -1
- package/dist/generator.test.js +0 -197
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -401
- package/dist/manifest.d.ts +0 -33
- package/dist/manifest.js +0 -40
- package/dist/providers/knowledge-hub.d.ts +0 -37
- package/dist/providers/knowledge-hub.js +0 -141
- package/dist/providers/openrouter.d.ts +0 -32
- package/dist/providers/openrouter.js +0 -201
- package/dist/release-check.d.ts +0 -9
- package/dist/release-check.js +0 -131
- package/dist/runtime-parity.test.d.ts +0 -1
- package/dist/runtime-parity.test.js +0 -140
- package/dist/web-dist/404/index.html +0 -1
- package/dist/web-dist/404.html +0 -1
- package/dist/web-dist/__next.__PAGE__.txt +0 -34
- package/dist/web-dist/__next._full.txt +0 -31
- package/dist/web-dist/__next._tree.txt +0 -3
- package/dist/web-dist/_next/static/chunks/0bncolc2nuzmo.css +0 -1
- package/dist/web-dist/_next/static/chunks/0cz1d0mv5g_q7.js +0 -1
- package/dist/web-dist/_next/static/chunks/0uwih7sydv413.js +0 -1
- package/dist/web-dist/_next/static/chunks/0xe6aaej0xsj8.js +0 -30
- package/dist/web-dist/_next/static/chunks/10rmct1ax-opq.js +0 -1
- package/dist/web-dist/_next/static/chunks/1_yae15ffa5f6.js +0 -1
- package/dist/web-dist/_next/static/chunks/2kcqevsmv6kh2.js +0 -31
- package/dist/web-dist/_next/static/chunks/2s3d1bfr0l4b0.js +0 -1
- package/dist/web-dist/_next/static/chunks/32z87id9k6i2z.js +0 -22
- package/dist/web-dist/_next/static/chunks/3bx2gs3idjmo1.js +0 -1
- package/dist/web-dist/_next/static/chunks/turbopack-3eipe4c-imn5l.js +0 -1
- package/dist/web-dist/_next/static/media/favicon.2vob68tjqpejf.ico +0 -0
- package/dist/web-dist/_next/static/uvsK8ULhL7fHQMR8sr_JL/_buildManifest.js +0 -11
- package/dist/web-dist/_next/static/uvsK8ULhL7fHQMR8sr_JL/_clientMiddlewareManifest.js +0 -1
- package/dist/web-dist/_next/static/uvsK8ULhL7fHQMR8sr_JL/_ssgManifest.js +0 -1
- package/dist/web-dist/_not-found/__next._full.txt +0 -17
- package/dist/web-dist/_not-found/__next._not-found.__PAGE__.txt +0 -23
- package/dist/web-dist/_not-found/__next._tree.txt +0 -3
- package/dist/web-dist/_not-found/index.html +0 -1
- package/dist/web-dist/_not-found/index.txt +0 -17
- package/dist/web-dist/chat/__next._full.txt +0 -18
- package/dist/web-dist/chat/__next._tree.txt +0 -3
- package/dist/web-dist/chat/__next.chat.__PAGE__.txt +0 -24
- package/dist/web-dist/chat/index.html +0 -1
- package/dist/web-dist/chat/index.txt +0 -18
- package/dist/web-dist/favicon.ico +0 -0
- package/dist/web-dist/index.html +0 -1
- package/dist/web-dist/index.txt +0 -31
- package/dist/web-dist/live2d/live2dcubismcore.min.js +0 -9
- package/dist/web-dist/operator/__next._full.txt +0 -18
- package/dist/web-dist/operator/__next._tree.txt +0 -3
- package/dist/web-dist/operator/__next.operator.__PAGE__.txt +0 -24
- package/dist/web-dist/operator/index.html +0 -1
- package/dist/web-dist/operator/index.txt +0 -18
- package/dist/web-template.d.ts +0 -2
- package/dist/web-template.js +0 -556
package/dist/web-template.js
DELETED
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateWebHtml = generateWebHtml;
|
|
4
|
-
function generateWebHtml(instanceName, manifests) {
|
|
5
|
-
const hasBody = manifests.some((m) => m.organType === 'body');
|
|
6
|
-
const hasVoice = manifests.some((m) => m.organType === 'voice');
|
|
7
|
-
const hasMemory = manifests.some((m) => m.organType === 'memory');
|
|
8
|
-
const hasKnowledge = manifests.some((m) => m.organType === 'knowledge');
|
|
9
|
-
const organBadges = manifests.map((m) => {
|
|
10
|
-
const icon = m.organType === 'brain' ? '🧠'
|
|
11
|
-
: m.organType === 'memory' ? '💾'
|
|
12
|
-
: m.organType === 'voice' ? '🗣️'
|
|
13
|
-
: m.organType === 'body' ? '💃'
|
|
14
|
-
: m.organType === 'knowledge' ? '📚'
|
|
15
|
-
: m.organType === 'hands' ? '🛠️'
|
|
16
|
-
: m.organType === 'vision' ? '👁️'
|
|
17
|
-
: m.organType === 'behavior' ? '⚡'
|
|
18
|
-
: '📦';
|
|
19
|
-
return `<span class="badge">${icon} ${m.displayName.split(' ')[0]}</span>`;
|
|
20
|
-
}).join(' ');
|
|
21
|
-
return `<!DOCTYPE html>
|
|
22
|
-
<html lang="en">
|
|
23
|
-
<head>
|
|
24
|
-
<meta charset="UTF-8" />
|
|
25
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
26
|
-
<title>${instanceName} · Siduri Companion</title>
|
|
27
|
-
<style>
|
|
28
|
-
:root {
|
|
29
|
-
--bg: #0b0f19;
|
|
30
|
-
--card-bg: #111827;
|
|
31
|
-
--card-border: #1f2937;
|
|
32
|
-
--text: #f3f4f6;
|
|
33
|
-
--text-dim: #9ca3af;
|
|
34
|
-
--cyan: #06b6d4;
|
|
35
|
-
--cyan-dim: rgba(6, 182, 212, 0.15);
|
|
36
|
-
--green: #10b981;
|
|
37
|
-
--purple: #8b5cf6;
|
|
38
|
-
--accent: #0ea5e9;
|
|
39
|
-
--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
40
|
-
}
|
|
41
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
42
|
-
body {
|
|
43
|
-
background: var(--bg);
|
|
44
|
-
color: var(--text);
|
|
45
|
-
font-family: var(--font);
|
|
46
|
-
height: 100vh;
|
|
47
|
-
display: flex;
|
|
48
|
-
flex-direction: column;
|
|
49
|
-
overflow: hidden;
|
|
50
|
-
}
|
|
51
|
-
header {
|
|
52
|
-
background: var(--card-bg);
|
|
53
|
-
border-bottom: 1px solid var(--card-border);
|
|
54
|
-
padding: 12px 24px;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
justify-content: space-between;
|
|
58
|
-
}
|
|
59
|
-
.brand {
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
gap: 12px;
|
|
63
|
-
}
|
|
64
|
-
.brand h1 {
|
|
65
|
-
font-size: 1.25rem;
|
|
66
|
-
font-weight: 700;
|
|
67
|
-
color: var(--cyan);
|
|
68
|
-
letter-spacing: -0.5px;
|
|
69
|
-
}
|
|
70
|
-
.badges {
|
|
71
|
-
display: flex;
|
|
72
|
-
gap: 6px;
|
|
73
|
-
flex-wrap: wrap;
|
|
74
|
-
}
|
|
75
|
-
.badge {
|
|
76
|
-
background: var(--cyan-dim);
|
|
77
|
-
color: var(--cyan);
|
|
78
|
-
border: 1px solid rgba(6, 182, 212, 0.3);
|
|
79
|
-
padding: 3px 8px;
|
|
80
|
-
border-radius: 9999px;
|
|
81
|
-
font-size: 0.75rem;
|
|
82
|
-
font-weight: 500;
|
|
83
|
-
}
|
|
84
|
-
.tabs {
|
|
85
|
-
display: flex;
|
|
86
|
-
gap: 8px;
|
|
87
|
-
}
|
|
88
|
-
.tab-btn {
|
|
89
|
-
background: transparent;
|
|
90
|
-
border: 1px solid transparent;
|
|
91
|
-
color: var(--text-dim);
|
|
92
|
-
padding: 6px 14px;
|
|
93
|
-
border-radius: 6px;
|
|
94
|
-
font-size: 0.875rem;
|
|
95
|
-
font-weight: 500;
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
transition: all 0.2s;
|
|
98
|
-
}
|
|
99
|
-
.tab-btn:hover {
|
|
100
|
-
color: var(--text);
|
|
101
|
-
background: rgba(255, 255, 255, 0.05);
|
|
102
|
-
}
|
|
103
|
-
.tab-btn.active {
|
|
104
|
-
color: var(--cyan);
|
|
105
|
-
background: var(--cyan-dim);
|
|
106
|
-
border-color: rgba(6, 182, 212, 0.4);
|
|
107
|
-
}
|
|
108
|
-
main {
|
|
109
|
-
flex: 1;
|
|
110
|
-
display: flex;
|
|
111
|
-
overflow: hidden;
|
|
112
|
-
}
|
|
113
|
-
.tab-content {
|
|
114
|
-
display: none;
|
|
115
|
-
width: 100%;
|
|
116
|
-
height: 100%;
|
|
117
|
-
}
|
|
118
|
-
.tab-content.active {
|
|
119
|
-
display: flex;
|
|
120
|
-
}
|
|
121
|
-
/* Chat & Avatar Layout */
|
|
122
|
-
.chat-layout {
|
|
123
|
-
width: 100%;
|
|
124
|
-
height: 100%;
|
|
125
|
-
display: grid;
|
|
126
|
-
grid-template-columns: 420px 1fr;
|
|
127
|
-
}
|
|
128
|
-
@media (max-width: 860px) {
|
|
129
|
-
.chat-layout { grid-template-columns: 1fr; grid-template-rows: 240px 1fr; }
|
|
130
|
-
}
|
|
131
|
-
.avatar-pane {
|
|
132
|
-
background: radial-gradient(circle at center, #1a2234 0%, #0b0f19 70%);
|
|
133
|
-
border-right: 1px solid var(--card-border);
|
|
134
|
-
display: flex;
|
|
135
|
-
flex-direction: column;
|
|
136
|
-
align-items: center;
|
|
137
|
-
justify-content: center;
|
|
138
|
-
position: relative;
|
|
139
|
-
padding: 20px;
|
|
140
|
-
}
|
|
141
|
-
.avatar-stage {
|
|
142
|
-
width: 100%;
|
|
143
|
-
height: 100%;
|
|
144
|
-
display: flex;
|
|
145
|
-
flex-direction: column;
|
|
146
|
-
align-items: center;
|
|
147
|
-
justify-content: center;
|
|
148
|
-
position: relative;
|
|
149
|
-
}
|
|
150
|
-
.avatar-canvas {
|
|
151
|
-
width: 100%;
|
|
152
|
-
max-height: 480px;
|
|
153
|
-
border-radius: 12px;
|
|
154
|
-
object-fit: contain;
|
|
155
|
-
}
|
|
156
|
-
.avatar-portrait {
|
|
157
|
-
width: 160px;
|
|
158
|
-
height: 160px;
|
|
159
|
-
border-radius: 50%;
|
|
160
|
-
background: linear-gradient(135deg, var(--cyan), var(--purple));
|
|
161
|
-
display: flex;
|
|
162
|
-
align-items: center;
|
|
163
|
-
justify-content: center;
|
|
164
|
-
font-size: 4rem;
|
|
165
|
-
box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
|
|
166
|
-
animation: float 4s ease-in-out infinite;
|
|
167
|
-
}
|
|
168
|
-
@keyframes float {
|
|
169
|
-
0%, 100% { transform: translateY(0px); }
|
|
170
|
-
50% { transform: translateY(-10px); }
|
|
171
|
-
}
|
|
172
|
-
.expression-badge {
|
|
173
|
-
margin-top: 16px;
|
|
174
|
-
background: rgba(0, 0, 0, 0.4);
|
|
175
|
-
border: 1px solid var(--card-border);
|
|
176
|
-
padding: 6px 14px;
|
|
177
|
-
border-radius: 20px;
|
|
178
|
-
font-size: 0.8rem;
|
|
179
|
-
color: var(--text-dim);
|
|
180
|
-
}
|
|
181
|
-
.chat-pane {
|
|
182
|
-
display: flex;
|
|
183
|
-
flex-direction: column;
|
|
184
|
-
height: 100%;
|
|
185
|
-
background: var(--bg);
|
|
186
|
-
}
|
|
187
|
-
.messages-container {
|
|
188
|
-
flex: 1;
|
|
189
|
-
overflow-y: auto;
|
|
190
|
-
padding: 24px;
|
|
191
|
-
display: flex;
|
|
192
|
-
flex-direction: column;
|
|
193
|
-
gap: 16px;
|
|
194
|
-
}
|
|
195
|
-
.message {
|
|
196
|
-
max-width: 80%;
|
|
197
|
-
padding: 12px 16px;
|
|
198
|
-
border-radius: 12px;
|
|
199
|
-
line-height: 1.5;
|
|
200
|
-
font-size: 0.95rem;
|
|
201
|
-
}
|
|
202
|
-
.message.user {
|
|
203
|
-
align-self: flex-end;
|
|
204
|
-
background: var(--cyan);
|
|
205
|
-
color: #000;
|
|
206
|
-
font-weight: 500;
|
|
207
|
-
border-bottom-right-radius: 2px;
|
|
208
|
-
}
|
|
209
|
-
.message.companion {
|
|
210
|
-
align-self: flex-start;
|
|
211
|
-
background: var(--card-bg);
|
|
212
|
-
border: 1px solid var(--card-border);
|
|
213
|
-
color: var(--text);
|
|
214
|
-
border-bottom-left-radius: 2px;
|
|
215
|
-
}
|
|
216
|
-
.message .meta {
|
|
217
|
-
font-size: 0.7rem;
|
|
218
|
-
margin-bottom: 4px;
|
|
219
|
-
color: var(--text-dim);
|
|
220
|
-
}
|
|
221
|
-
.message.user .meta { color: rgba(0, 0, 0, 0.6); }
|
|
222
|
-
.input-area {
|
|
223
|
-
padding: 16px 24px;
|
|
224
|
-
background: var(--card-bg);
|
|
225
|
-
border-top: 1px solid var(--card-border);
|
|
226
|
-
display: flex;
|
|
227
|
-
gap: 12px;
|
|
228
|
-
}
|
|
229
|
-
.input-area input {
|
|
230
|
-
flex: 1;
|
|
231
|
-
background: rgba(0, 0, 0, 0.3);
|
|
232
|
-
border: 1px solid var(--card-border);
|
|
233
|
-
border-radius: 8px;
|
|
234
|
-
padding: 12px 16px;
|
|
235
|
-
color: #fff;
|
|
236
|
-
font-size: 0.95rem;
|
|
237
|
-
outline: none;
|
|
238
|
-
transition: border-color 0.2s;
|
|
239
|
-
}
|
|
240
|
-
.input-area input:focus {
|
|
241
|
-
border-color: var(--cyan);
|
|
242
|
-
}
|
|
243
|
-
.send-btn {
|
|
244
|
-
background: var(--cyan);
|
|
245
|
-
color: #000;
|
|
246
|
-
font-weight: 600;
|
|
247
|
-
border: none;
|
|
248
|
-
padding: 0 20px;
|
|
249
|
-
border-radius: 8px;
|
|
250
|
-
cursor: pointer;
|
|
251
|
-
transition: transform 0.1s, opacity 0.2s;
|
|
252
|
-
}
|
|
253
|
-
.send-btn:hover { opacity: 0.9; }
|
|
254
|
-
.send-btn:active { transform: scale(0.98); }
|
|
255
|
-
|
|
256
|
-
/* Console / Operator Layout */
|
|
257
|
-
.operator-layout {
|
|
258
|
-
width: 100%;
|
|
259
|
-
height: 100%;
|
|
260
|
-
overflow-y: auto;
|
|
261
|
-
padding: 28px;
|
|
262
|
-
display: flex;
|
|
263
|
-
flex-direction: column;
|
|
264
|
-
gap: 24px;
|
|
265
|
-
}
|
|
266
|
-
.card {
|
|
267
|
-
background: var(--card-bg);
|
|
268
|
-
border: 1px solid var(--card-border);
|
|
269
|
-
border-radius: 12px;
|
|
270
|
-
padding: 20px;
|
|
271
|
-
}
|
|
272
|
-
.card-header {
|
|
273
|
-
display: flex;
|
|
274
|
-
justify-content: space-between;
|
|
275
|
-
align-items: center;
|
|
276
|
-
margin-bottom: 16px;
|
|
277
|
-
}
|
|
278
|
-
.card-title {
|
|
279
|
-
font-size: 1.1rem;
|
|
280
|
-
font-weight: 600;
|
|
281
|
-
color: var(--cyan);
|
|
282
|
-
display: flex;
|
|
283
|
-
align-items: center;
|
|
284
|
-
gap: 8px;
|
|
285
|
-
}
|
|
286
|
-
table {
|
|
287
|
-
width: 100%;
|
|
288
|
-
border-collapse: collapse;
|
|
289
|
-
font-size: 0.875rem;
|
|
290
|
-
}
|
|
291
|
-
th {
|
|
292
|
-
text-align: left;
|
|
293
|
-
padding: 10px 12px;
|
|
294
|
-
border-bottom: 1px solid var(--card-border);
|
|
295
|
-
color: var(--text-dim);
|
|
296
|
-
font-weight: 500;
|
|
297
|
-
}
|
|
298
|
-
td {
|
|
299
|
-
padding: 12px;
|
|
300
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
301
|
-
}
|
|
302
|
-
.btn-action {
|
|
303
|
-
background: var(--cyan-dim);
|
|
304
|
-
color: var(--cyan);
|
|
305
|
-
border: 1px solid rgba(6, 182, 212, 0.3);
|
|
306
|
-
padding: 6px 12px;
|
|
307
|
-
border-radius: 6px;
|
|
308
|
-
font-size: 0.8rem;
|
|
309
|
-
cursor: pointer;
|
|
310
|
-
}
|
|
311
|
-
.search-input {
|
|
312
|
-
background: rgba(0, 0, 0, 0.3);
|
|
313
|
-
border: 1px solid var(--card-border);
|
|
314
|
-
border-radius: 6px;
|
|
315
|
-
padding: 6px 12px;
|
|
316
|
-
color: #fff;
|
|
317
|
-
font-size: 0.875rem;
|
|
318
|
-
outline: none;
|
|
319
|
-
}
|
|
320
|
-
</style>
|
|
321
|
-
</head>
|
|
322
|
-
<body>
|
|
323
|
-
<header>
|
|
324
|
-
<div class="brand">
|
|
325
|
-
<h1>◈ SIDURI</h1>
|
|
326
|
-
<span style="font-weight: 600; color: #fff;">${instanceName}</span>
|
|
327
|
-
<div class="badges">
|
|
328
|
-
${organBadges}
|
|
329
|
-
</div>
|
|
330
|
-
</div>
|
|
331
|
-
<div class="tabs">
|
|
332
|
-
<button class="tab-btn active" onclick="switchTab('chat')">💬 Companion Chat</button>
|
|
333
|
-
<button class="tab-btn" onclick="switchTab('operator')">🧠 Memory Console</button>
|
|
334
|
-
<button class="tab-btn" onclick="switchTab('diagnostics')">⚙️ Diagnostics</button>
|
|
335
|
-
</div>
|
|
336
|
-
</header>
|
|
337
|
-
|
|
338
|
-
<main>
|
|
339
|
-
<!-- TAB 1: Chat & Avatar -->
|
|
340
|
-
<div id="tab-chat" class="tab-content active">
|
|
341
|
-
<div class="chat-layout">
|
|
342
|
-
<div class="avatar-pane">
|
|
343
|
-
<div class="avatar-stage">
|
|
344
|
-
<canvas id="live2d-canvas" class="avatar-canvas" style="display: none;"></canvas>
|
|
345
|
-
<div id="avatar-fallback" class="avatar-portrait">✨</div>
|
|
346
|
-
<div id="expression-tag" class="expression-badge">State: Neutral</div>
|
|
347
|
-
</div>
|
|
348
|
-
</div>
|
|
349
|
-
<div class="chat-pane">
|
|
350
|
-
<div id="messages" class="messages-container">
|
|
351
|
-
<div class="message companion">
|
|
352
|
-
<div class="meta">${instanceName}</div>
|
|
353
|
-
Hello! I am your Siduri companion. How can I help you today?
|
|
354
|
-
</div>
|
|
355
|
-
</div>
|
|
356
|
-
<div class="input-area">
|
|
357
|
-
<input id="user-input" type="text" placeholder="Type your message..." autocomplete="off" onkeydown="if(event.key==='Enter') sendMessage()" />
|
|
358
|
-
<button class="send-btn" onclick="sendMessage()">Send ➤</button>
|
|
359
|
-
</div>
|
|
360
|
-
</div>
|
|
361
|
-
</div>
|
|
362
|
-
</div>
|
|
363
|
-
|
|
364
|
-
<!-- TAB 2: Memory & Claims Console -->
|
|
365
|
-
<div id="tab-operator" class="tab-content">
|
|
366
|
-
<div class="operator-layout">
|
|
367
|
-
<div class="card">
|
|
368
|
-
<div class="card-header">
|
|
369
|
-
<div class="card-title">💾 Authoritative Memory Claims (PostgreSQL FTS)</div>
|
|
370
|
-
<input type="text" class="search-input" placeholder="⌕ Filter claims..." oninput="filterClaims(this.value)" />
|
|
371
|
-
</div>
|
|
372
|
-
<table id="claims-table">
|
|
373
|
-
<thead>
|
|
374
|
-
<tr>
|
|
375
|
-
<th>Subject</th>
|
|
376
|
-
<th>Predicate</th>
|
|
377
|
-
<th>Value</th>
|
|
378
|
-
<th>Type</th>
|
|
379
|
-
<th>Provenance</th>
|
|
380
|
-
<th>Asserted</th>
|
|
381
|
-
</tr>
|
|
382
|
-
</thead>
|
|
383
|
-
<tbody id="claims-body">
|
|
384
|
-
<tr>
|
|
385
|
-
<td colspan="6" style="text-align: center; color: var(--text-dim);">Loading memory claims...</td>
|
|
386
|
-
</tr>
|
|
387
|
-
</tbody>
|
|
388
|
-
</table>
|
|
389
|
-
</div>
|
|
390
|
-
|
|
391
|
-
<div class="card">
|
|
392
|
-
<div class="card-header">
|
|
393
|
-
<div class="card-title">⚡ Active Behavioral Directives</div>
|
|
394
|
-
</div>
|
|
395
|
-
<div id="directives-list" style="display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem;">
|
|
396
|
-
<div style="color: var(--text-dim);">Loading directives...</div>
|
|
397
|
-
</div>
|
|
398
|
-
</div>
|
|
399
|
-
</div>
|
|
400
|
-
</div>
|
|
401
|
-
|
|
402
|
-
<!-- TAB 3: Diagnostics -->
|
|
403
|
-
<div id="tab-diagnostics" class="tab-content">
|
|
404
|
-
<div class="operator-layout">
|
|
405
|
-
<div class="card">
|
|
406
|
-
<div class="card-title" style="margin-bottom: 16px;">⚙️ Organ Probes & Diagnostics</div>
|
|
407
|
-
<div id="diagnostics-content" style="display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;">
|
|
408
|
-
<div style="color: var(--text-dim);">Probing runtime state...</div>
|
|
409
|
-
</div>
|
|
410
|
-
</div>
|
|
411
|
-
</div>
|
|
412
|
-
</div>
|
|
413
|
-
</main>
|
|
414
|
-
|
|
415
|
-
<script>
|
|
416
|
-
let currentClaims = [];
|
|
417
|
-
|
|
418
|
-
function switchTab(tabId) {
|
|
419
|
-
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
|
420
|
-
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
|
|
421
|
-
|
|
422
|
-
const btn = Array.from(document.querySelectorAll('.tab-btn')).find(b => b.getAttribute('onclick').includes(tabId));
|
|
423
|
-
if (btn) btn.classList.add('active');
|
|
424
|
-
|
|
425
|
-
const tab = document.getElementById('tab-' + tabId);
|
|
426
|
-
if (tab) tab.classList.add('active');
|
|
427
|
-
|
|
428
|
-
if (tabId === 'operator') loadClaims();
|
|
429
|
-
if (tabId === 'diagnostics') loadDiagnostics();
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
async function sendMessage() {
|
|
433
|
-
const input = document.getElementById('user-input');
|
|
434
|
-
const text = input.value.trim();
|
|
435
|
-
if (!text) return;
|
|
436
|
-
|
|
437
|
-
input.value = '';
|
|
438
|
-
appendMessage('user', 'You', text);
|
|
439
|
-
|
|
440
|
-
try {
|
|
441
|
-
const res = await fetch('/api/chat', {
|
|
442
|
-
method: 'POST',
|
|
443
|
-
headers: { 'Content-Type': 'application/json' },
|
|
444
|
-
body: JSON.stringify({ message: text })
|
|
445
|
-
});
|
|
446
|
-
const data = await res.json();
|
|
447
|
-
|
|
448
|
-
const replyText =
|
|
449
|
-
data.response?.subtitle_en ||
|
|
450
|
-
data.response?.subtitle_ja ||
|
|
451
|
-
data.reply ||
|
|
452
|
-
data.text ||
|
|
453
|
-
'(No response)';
|
|
454
|
-
|
|
455
|
-
appendMessage('companion', '${instanceName}', replyText);
|
|
456
|
-
|
|
457
|
-
const expression = data.expression || data.metadata?.events?.find(e => e.kind === 'avatar')?.expression;
|
|
458
|
-
if (expression) {
|
|
459
|
-
document.getElementById('expression-tag').textContent = 'State: ' + expression;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
const audio = data.response?.audio_url || data.audioUrl;
|
|
463
|
-
if (audio) {
|
|
464
|
-
const audioEl = new Audio(audio);
|
|
465
|
-
audioEl.play().catch(e => console.warn('Audio autoplay blocked:', e));
|
|
466
|
-
}
|
|
467
|
-
} catch (err) {
|
|
468
|
-
appendMessage('companion', '${instanceName}', '⚠️ Error connecting to companion: ' + err.message);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
function appendMessage(role, name, text) {
|
|
473
|
-
const container = document.getElementById('messages');
|
|
474
|
-
const div = document.createElement('div');
|
|
475
|
-
div.className = 'message ' + role;
|
|
476
|
-
div.innerHTML = '<div class="meta">' + name + '</div>' + text.replace(/\\n/g, '<br>');
|
|
477
|
-
container.appendChild(div);
|
|
478
|
-
container.scrollTop = container.scrollHeight;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
async function loadClaims() {
|
|
482
|
-
try {
|
|
483
|
-
const res = await fetch('/api/memory/claims');
|
|
484
|
-
const data = await res.json();
|
|
485
|
-
currentClaims = data.claims || [];
|
|
486
|
-
renderClaims(currentClaims);
|
|
487
|
-
|
|
488
|
-
const dirRes = await fetch('/api/memory/directives');
|
|
489
|
-
const dirData = await dirRes.json();
|
|
490
|
-
renderDirectives(dirData.directives || []);
|
|
491
|
-
} catch (err) {
|
|
492
|
-
document.getElementById('claims-body').innerHTML = '<tr><td colspan="6" style="color: #ef4444;">Failed to load claims: ' + err.message + '</td></tr>';
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
function renderClaims(claims) {
|
|
497
|
-
const tbody = document.getElementById('claims-body');
|
|
498
|
-
if (!claims || claims.length === 0) {
|
|
499
|
-
tbody.innerHTML = '<tr><td colspan="6" style="text-align: center; color: var(--text-dim);">No authoritative claims stored yet. Chat with your companion to build memory.</td></tr>';
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
tbody.innerHTML = claims.map(c => \`
|
|
503
|
-
<tr>
|
|
504
|
-
<td style="color: var(--cyan); font-weight: 500;">\${c.subject || '-'}</td>
|
|
505
|
-
<td>\${c.predicate || '-'}</td>
|
|
506
|
-
<td>\${c.value || '-'}</td>
|
|
507
|
-
<td><span class="badge">\${c.claim_type || c.claimType || 'semantic'}</span></td>
|
|
508
|
-
<td style="color: var(--text-dim); font-size: 0.8rem;">\${c.provenance || 'direct'}</td>
|
|
509
|
-
<td style="color: var(--text-dim); font-size: 0.8rem;">\${c.asserted_at || c.assertedAt || 'recent'}</td>
|
|
510
|
-
</tr>
|
|
511
|
-
\`).join('');
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
function filterClaims(query) {
|
|
515
|
-
const q = query.toLowerCase();
|
|
516
|
-
const filtered = currentClaims.filter(c =>
|
|
517
|
-
(c.subject || '').toLowerCase().includes(q) ||
|
|
518
|
-
(c.predicate || '').toLowerCase().includes(q) ||
|
|
519
|
-
(c.value || '').toLowerCase().includes(q)
|
|
520
|
-
);
|
|
521
|
-
renderClaims(filtered);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
function renderDirectives(directives) {
|
|
525
|
-
const container = document.getElementById('directives-list');
|
|
526
|
-
if (!directives || directives.length === 0) {
|
|
527
|
-
container.innerHTML = '<div style="color: var(--text-dim);">No custom directives set. Using default Active Self compiler.</div>';
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
container.innerHTML = directives.map(d => \`
|
|
531
|
-
<div style="background: rgba(0,0,0,0.2); border: 1px solid var(--card-border); padding: 12px; border-radius: 8px;">
|
|
532
|
-
<div style="font-weight: 600; color: var(--cyan);">\${d.domain || 'core'}: \${d.name || d.directive_id || 'Directive'}</div>
|
|
533
|
-
<div style="color: var(--text-dim); font-size: 0.85rem; margin-top: 4px;">\${d.content || d.value || JSON.stringify(d)}</div>
|
|
534
|
-
</div>
|
|
535
|
-
\`).join('');
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
async function loadDiagnostics() {
|
|
539
|
-
try {
|
|
540
|
-
const res = await fetch('/api/status');
|
|
541
|
-
const data = await res.json();
|
|
542
|
-
const container = document.getElementById('diagnostics-content');
|
|
543
|
-
container.innerHTML = Object.entries(data.organs || {}).map(([key, val]) => \`
|
|
544
|
-
<div style="background: rgba(0,0,0,0.2); border: 1px solid var(--card-border); padding: 16px; border-radius: 8px;">
|
|
545
|
-
<div style="font-weight: 600; color: var(--cyan); font-size: 1rem; margin-bottom: 8px;">\${key.toUpperCase()}</div>
|
|
546
|
-
<pre style="font-size: 0.8rem; color: var(--text-dim); overflow-x: auto;">\${JSON.stringify(val, null, 2)}</pre>
|
|
547
|
-
</div>
|
|
548
|
-
\`).join('');
|
|
549
|
-
} catch (err) {
|
|
550
|
-
document.getElementById('diagnostics-content').innerHTML = '<div style="color: #ef4444;">Failed to fetch diagnostics: ' + err.message + '</div>';
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
</script>
|
|
554
|
-
</body>
|
|
555
|
-
</html>`;
|
|
556
|
-
}
|