@misterscan/sesi 1.2.3 → 1.3.2
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/.agents/rules/sesi-must-read.md +116 -0
- package/.agents/workflows/create-sesi-script.md +44 -0
- package/.agents/workflows/fix-sesi-script.md +14 -0
- package/.github/prompts/MakeInSesi.prompt.md +79 -0
- package/README.md +163 -51
- package/bin/sesi.js +196 -38
- package/chatbot/chatbot.html +488 -0
- package/{main → chatbot}/chatbot.sesi +1 -2
- package/chatbot/chatbot_server.py +105 -0
- package/chatbot/sesi_db_chatbot.sesi +278 -0
- package/dist/ai-runtime.js +2 -2
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +199 -5
- package/dist/builtins.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -6
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +21 -2
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +201 -92
- package/dist/interpreter.js.map +1 -1
- package/dist/lexer.d.ts.map +1 -1
- package/dist/lexer.js +8 -4
- package/dist/lexer.js.map +1 -1
- package/dist/parser.d.ts +1 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +21 -12
- package/dist/parser.js.map +1 -1
- package/dist/sesi.bundled.js +2526 -1487
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +33 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +21 -13
- package/docs/BUILTINS.md +136 -19
- package/docs/CLI.md +200 -0
- package/docs/COMPARISON.md +16 -13
- package/docs/IMAGE_GENERATION.md +13 -14
- package/docs/IMPLEMENTATION_SUMMARY.md +174 -110
- package/docs/QUICKSTART.md +173 -39
- package/docs/README.md +202 -54
- package/docs/{SYSTEMS_REASONING.md → REASONING.md} +115 -120
- package/docs/ROADMAP.md +51 -47
- package/docs/SKILLS.md +73 -98
- package/docs/SPECIFICATION.md +59 -40
- package/examples/03_functions.sesi +30 -1
- package/examples/07_prompts.sesi +27 -3
- package/examples/08_model_call.sesi +6 -4
- package/examples/09_structured_output.sesi +19 -3
- package/examples/10_code_generation.sesi +6 -4
- package/examples/11_memory_conversation.sesi +47 -15
- package/examples/12_classification.sesi +62 -7
- package/examples/13_data_pipeline.sesi +55 -28
- package/examples/14_folder_explainer.sesi +52 -51
- package/examples/15_image_generation.sesi +15 -14
- package/examples/16_modules.sesi +27 -27
- package/examples/19_search_web.sesi +18 -2
- package/examples/20_model_aliases.sesi +22 -0
- package/examples/21_custom_tools.sesi +27 -0
- package/examples/22_reasoning_plus_custom_tools.sesi +19 -0
- package/main/tests/test-args.sesi +7 -0
- package/main/tests/test_args.sesi +7 -0
- package/main/tests/test_general_modules.sesi +127 -0
- package/main/tests/test_grounding.sesi +2 -0
- package/package.json +26 -22
- package/docs/DISTRIBUTED_SYSTEMS.md +0 -71
- package/docs/sesi_ai_chronicles.md +0 -209
- package/main/conversational_classifier_weights.json +0 -45
- package/main/conversational_sentences.json +0 -304
- package/main/epochs.sesi +0 -94
- package/main/gpu_orchestrator.sesi +0 -36
- package/main/hardware_diagnostics.sesi +0 -118
- package/main/inference.sesi +0 -54
- package/main/native_chatbot.sesi +0 -180
- package/main/native_synthesizer.sesi +0 -83
- package/main/nn_personas_trainer.sesi +0 -302
- package/main/nn_responses_trainer.sesi +0 -269
- package/main/nn_sentences_trainer.sesi +0 -330
- package/main/orchestrator.sesi +0 -15
- package/main/personas.json +0 -124
- package/main/personas_classifier_weights.json +0 -45
- package/main/playground.sesi +0 -3
- package/main/predictive_typing.sesi +0 -127
- package/main/query_brain.sesi +0 -45
- package/main/response_classifier_weights.json +0 -45
- package/main/retro_chat.html +0 -239
- package/main/retro_chat_generator.sesi +0 -745
- package/main/sesi_ai.sesi +0 -158
- package/main/sesi_db_chatbot.sesi +0 -280
- package/main/setup_swarm.sesi +0 -5
- package/main/start.sesi +0 -13
- package/main/terminal.log +0 -56
- package/main/terminal_chat.py +0 -385
- package/main/unified_sesi_ai.sesi +0 -334
- package/main/varied_responses.json +0 -304
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset='UTF-8'>
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Sesi Support Chatbot | The Future of Programming</title>
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
--bg-base: #030811;
|
|
11
|
+
--bg-grid: #0a1526;
|
|
12
|
+
--accent-cyan: #00e5ff;
|
|
13
|
+
--accent-blue: #0077ff;
|
|
14
|
+
--accent-green: #39ff14;
|
|
15
|
+
--silver-light: #e2e8f0;
|
|
16
|
+
--silver-mid: #94a3b8;
|
|
17
|
+
--silver-dark: #475569;
|
|
18
|
+
--glass-bg: rgba(15, 23, 42, 0.65);
|
|
19
|
+
--glass-border: rgba(255, 255, 255, 0.15);
|
|
20
|
+
--glass-highlight: rgba(255, 255, 255, 0.3);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
* {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
body {
|
|
30
|
+
background-color: var(--bg-base);
|
|
31
|
+
background-image:
|
|
32
|
+
linear-gradient(0deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px),
|
|
33
|
+
linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px),
|
|
34
|
+
radial-gradient(circle at 50% 0%, #0f2540 0%, transparent 60%);
|
|
35
|
+
background-size: 24px 24px, 24px 24px, 100% 100%;
|
|
36
|
+
background-attachment: fixed;
|
|
37
|
+
color: var(--silver-light);
|
|
38
|
+
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
|
39
|
+
line-height: 1.6;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
overflow-x: hidden;
|
|
42
|
+
padding: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Y2K Scanline Overlay */
|
|
46
|
+
body::after {
|
|
47
|
+
content: "";
|
|
48
|
+
position: fixed;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
width: 100vw;
|
|
52
|
+
height: 100vh;
|
|
53
|
+
background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
|
|
54
|
+
background-size: 100% 4px;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
z-index: 9999;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.container {
|
|
60
|
+
max-width: 1200px;
|
|
61
|
+
margin: 0 auto;
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: 320px 1fr;
|
|
64
|
+
gap: 30px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
header {
|
|
68
|
+
grid-column: 1 / -1;
|
|
69
|
+
padding: 20px 0;
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
align-items: center;
|
|
73
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
74
|
+
background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.05), transparent);
|
|
75
|
+
margin-bottom: 30px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
h1 {
|
|
79
|
+
font-family: 'Arial Black', Impact, sans-serif;
|
|
80
|
+
text-transform: uppercase;
|
|
81
|
+
letter-spacing: -0.5px;
|
|
82
|
+
font-size: 24px;
|
|
83
|
+
background: linear-gradient(180deg, #fff 0%, var(--silver-mid) 100%);
|
|
84
|
+
-webkit-background-clip: text;
|
|
85
|
+
background-clip: text;
|
|
86
|
+
-webkit-text-fill-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.glow-text {
|
|
90
|
+
color: #fff;
|
|
91
|
+
text-shadow: 0 0 10px var(--accent-cyan), 0 0 20px var(--accent-blue);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Glassmorphism Panels */
|
|
95
|
+
.panel {
|
|
96
|
+
background: var(--glass-bg);
|
|
97
|
+
border: 1px solid var(--glass-border);
|
|
98
|
+
border-top: 1px solid var(--glass-highlight);
|
|
99
|
+
border-left: 1px solid var(--glass-highlight);
|
|
100
|
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 15px rgba(255, 255, 255, 0.05);
|
|
101
|
+
backdrop-filter: blur(12px);
|
|
102
|
+
-webkit-backdrop-filter: blur(12px);
|
|
103
|
+
border-radius: 16px;
|
|
104
|
+
position: relative;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Sidebar / Telemetry */
|
|
109
|
+
.sidebar {
|
|
110
|
+
padding: 20px;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
height: 600px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.panel-title {
|
|
117
|
+
font-family: 'Arial Black', sans-serif;
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
text-transform: uppercase;
|
|
120
|
+
color: var(--accent-cyan);
|
|
121
|
+
margin-bottom: 15px;
|
|
122
|
+
border-bottom: 1px solid var(--glass-border);
|
|
123
|
+
padding-bottom: 8px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.log-stream {
|
|
127
|
+
flex-grow: 1;
|
|
128
|
+
font-family: 'Consolas', 'Monaco', monospace;
|
|
129
|
+
font-size: 11px;
|
|
130
|
+
color: var(--silver-mid);
|
|
131
|
+
overflow-y: auto;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.log-entry {
|
|
135
|
+
margin-bottom: 10px;
|
|
136
|
+
padding-left: 8px;
|
|
137
|
+
border-left: 1px solid var(--accent-blue);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.log-time {
|
|
141
|
+
color: var(--accent-blue);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Chat Console */
|
|
145
|
+
.chat-console {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
height: 600px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.terminal-header {
|
|
152
|
+
background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
|
|
153
|
+
padding: 10px 15px;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
border-bottom: 1px solid #000;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.term-btn {
|
|
160
|
+
width: 10px;
|
|
161
|
+
height: 10px;
|
|
162
|
+
border-radius: 50%;
|
|
163
|
+
margin-right: 6px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.term-btn.r {
|
|
167
|
+
background: #ff5f56;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.term-btn.y {
|
|
171
|
+
background: #ffbd2e;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.term-btn.g {
|
|
175
|
+
background: #27c93f;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.chat-status {
|
|
179
|
+
margin-left: 15px;
|
|
180
|
+
font-size: 11px;
|
|
181
|
+
font-family: monospace;
|
|
182
|
+
color: var(--silver-mid);
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: 8px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.status-dot {
|
|
189
|
+
width: 8px;
|
|
190
|
+
height: 8px;
|
|
191
|
+
background: var(--accent-green);
|
|
192
|
+
border-radius: 50%;
|
|
193
|
+
box-shadow: 0 0 8px var(--accent-green);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.status-dot.loading {
|
|
197
|
+
background: var(--accent-cyan);
|
|
198
|
+
box-shadow: 0 0 8px var(--accent-cyan);
|
|
199
|
+
animation: pulse 1.2s infinite;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes pulse {
|
|
203
|
+
0% {
|
|
204
|
+
opacity: 0.4;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
50% {
|
|
208
|
+
opacity: 1;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
100% {
|
|
212
|
+
opacity: 0.4;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.chat-messages {
|
|
217
|
+
flex-grow: 1;
|
|
218
|
+
padding: 20px;
|
|
219
|
+
overflow-y: auto;
|
|
220
|
+
display: flex;
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
gap: 15px;
|
|
223
|
+
background: rgba(0, 0, 0, 0.2);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.message {
|
|
227
|
+
max-width: 85%;
|
|
228
|
+
padding: 12px 16px;
|
|
229
|
+
border-radius: 8px;
|
|
230
|
+
font-size: 13px;
|
|
231
|
+
position: relative;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.message.system {
|
|
235
|
+
background: rgba(255, 255, 255, 0.05);
|
|
236
|
+
border: 1px solid var(--glass-border);
|
|
237
|
+
align-self: flex-start;
|
|
238
|
+
color: var(--silver-light);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.message.user {
|
|
242
|
+
background: linear-gradient(135deg, rgba(0, 119, 255, 0.2), rgba(0, 229, 255, 0.1));
|
|
243
|
+
border: 1px solid var(--accent-blue);
|
|
244
|
+
align-self: flex-end;
|
|
245
|
+
color: #fff;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.message pre {
|
|
249
|
+
background: #000;
|
|
250
|
+
padding: 10px;
|
|
251
|
+
border: 1px solid var(--silver-dark);
|
|
252
|
+
border-radius: 4px;
|
|
253
|
+
margin-top: 10px;
|
|
254
|
+
font-family: 'Consolas', monospace;
|
|
255
|
+
font-size: 12px;
|
|
256
|
+
color: #a6accd;
|
|
257
|
+
overflow-x: auto;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.message code {
|
|
261
|
+
color: var(--accent-cyan);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* Input Area */
|
|
265
|
+
.input-area {
|
|
266
|
+
padding: 20px;
|
|
267
|
+
background: rgba(0, 0, 0, 0.3);
|
|
268
|
+
display: flex;
|
|
269
|
+
gap: 10px;
|
|
270
|
+
border-top: 1px solid var(--glass-border);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.query-input {
|
|
274
|
+
flex-grow: 1;
|
|
275
|
+
background: #000;
|
|
276
|
+
border: 1px solid var(--silver-dark);
|
|
277
|
+
border-radius: 20px;
|
|
278
|
+
padding: 10px 20px;
|
|
279
|
+
color: var(--accent-cyan);
|
|
280
|
+
font-family: 'Consolas', monospace;
|
|
281
|
+
outline: none;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.query-input:focus {
|
|
285
|
+
border-color: var(--accent-cyan);
|
|
286
|
+
box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* Glossy Button */
|
|
290
|
+
.btn {
|
|
291
|
+
display: inline-block;
|
|
292
|
+
background: linear-gradient(180deg, #1e293b 0%, #0f172a 49%, #020617 50%, #0f172a 100%);
|
|
293
|
+
border: 1px solid var(--silver-dark);
|
|
294
|
+
border-top: 1px solid var(--silver-mid);
|
|
295
|
+
color: var(--accent-cyan);
|
|
296
|
+
text-transform: uppercase;
|
|
297
|
+
font-weight: bold;
|
|
298
|
+
letter-spacing: 1px;
|
|
299
|
+
padding: 10px 24px;
|
|
300
|
+
border-radius: 20px;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
|
|
303
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 10px rgba(0, 0, 0, 0.6);
|
|
304
|
+
transition: all 0.2s ease;
|
|
305
|
+
position: relative;
|
|
306
|
+
overflow: hidden;
|
|
307
|
+
font-size: 12px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.btn::after {
|
|
311
|
+
content: '';
|
|
312
|
+
position: absolute;
|
|
313
|
+
top: 0;
|
|
314
|
+
left: 10%;
|
|
315
|
+
width: 80%;
|
|
316
|
+
height: 40%;
|
|
317
|
+
background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
|
|
318
|
+
border-radius: 20px 20px 0 0;
|
|
319
|
+
pointer-events: none;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.btn:hover {
|
|
323
|
+
background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 49%, #0f766e 50%, #115e59 100%);
|
|
324
|
+
color: #fff;
|
|
325
|
+
border-color: var(--accent-cyan);
|
|
326
|
+
text-shadow: 0 0 10px #fff;
|
|
327
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.4);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.btn:disabled {
|
|
331
|
+
opacity: 0.5;
|
|
332
|
+
cursor: not-allowed;
|
|
333
|
+
filter: grayscale(1);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@media (max-width: 900px) {
|
|
337
|
+
.container {
|
|
338
|
+
grid-template-columns: 1fr;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.sidebar {
|
|
342
|
+
height: 200px;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
</style>
|
|
346
|
+
</head>
|
|
347
|
+
|
|
348
|
+
<body>
|
|
349
|
+
<div class='container'>
|
|
350
|
+
<header>
|
|
351
|
+
<div class="logo" style="display: flex; align-items: center; gap: 8px;">
|
|
352
|
+
<img src="favicon.ico" alt="Sesi logo" width="30px" height="30px">
|
|
353
|
+
<h1>SESI <span class="glow-text">SUPPORT</span></h1>
|
|
354
|
+
</div>
|
|
355
|
+
<nav style="display: flex; gap: 10px;">
|
|
356
|
+
<div style="font-size: 10px; color: var(--silver-dark); text-align: right;">
|
|
357
|
+
SYSTEM STATUS: <span style="color: var(--accent-green);">ONLINE</span><br>
|
|
358
|
+
VERSION: 1.3.1
|
|
359
|
+
</div>
|
|
360
|
+
</nav>
|
|
361
|
+
</header>
|
|
362
|
+
|
|
363
|
+
<!-- Left Column: Compiler Telemetry -->
|
|
364
|
+
<div class='panel sidebar'>
|
|
365
|
+
<div class='panel-title'>Server logs</div>
|
|
366
|
+
<div class='log-stream' id='logStream'>
|
|
367
|
+
<div class='log-entry'>
|
|
368
|
+
<span class='log-time'>[08:00:01]</span><br>
|
|
369
|
+
[SYSTEM] Sesi Support Chatbot server booted.
|
|
370
|
+
</div>
|
|
371
|
+
<div class='log-entry'>
|
|
372
|
+
<span class='log-time'>[08:00:02]</span><br>
|
|
373
|
+
[WMI] Binding physical display controller...
|
|
374
|
+
</div>
|
|
375
|
+
<div class='log-entry'>
|
|
376
|
+
<span class='log-time'>[08:00:05]</span><br>
|
|
377
|
+
[SESI] Model active: YES.
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
<!-- Right Column: Interactive Console -->
|
|
383
|
+
<div class='panel chat-console'>
|
|
384
|
+
<div class='terminal-header'>
|
|
385
|
+
<div class='term-btn r'></div>
|
|
386
|
+
<div class='term-btn y'></div>
|
|
387
|
+
<div class='term-btn g'></div>
|
|
388
|
+
<div class='chat-status'>
|
|
389
|
+
<div class='status-dot' id='statusDot'></div>
|
|
390
|
+
<span id='statusText'>Sesi Support</span>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
|
|
394
|
+
<div class='chat-messages' id='chatMessages'>
|
|
395
|
+
<div class='message system'>
|
|
396
|
+
Hello, I am <strong class="glow-text">Sesi Support</strong>, the official chatbot for the Sesi
|
|
397
|
+
Programming Language.
|
|
398
|
+
<br><br>
|
|
399
|
+
How can I assist you today?
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
<div class='input-area'>
|
|
404
|
+
<input type='text' id='queryInput' class='query-input' placeholder='Enter command or question...'
|
|
405
|
+
autocomplete='off' />
|
|
406
|
+
<button id='sendBtn' class='btn'>ASK</button>
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
|
|
411
|
+
<script>
|
|
412
|
+
const queryInput = document.getElementById('queryInput');
|
|
413
|
+
const sendBtn = document.getElementById('sendBtn');
|
|
414
|
+
const chatMessages = document.getElementById('chatMessages');
|
|
415
|
+
const logStream = document.getElementById('logStream');
|
|
416
|
+
const statusDot = document.getElementById('statusDot');
|
|
417
|
+
const statusText = document.getElementById('statusText');
|
|
418
|
+
|
|
419
|
+
function appendLog(message, tag = "SYSTEM") {
|
|
420
|
+
const now = new Date().toTimeString().split(' ')[0];
|
|
421
|
+
const logEntry = document.createElement('div');
|
|
422
|
+
logEntry.className = 'log-entry';
|
|
423
|
+
logEntry.innerHTML = `<span class='log-time'>[${now}]</span><br>[${tag}] ${message}`;
|
|
424
|
+
logStream.appendChild(logEntry);
|
|
425
|
+
logStream.scrollTop = logStream.scrollHeight;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
function appendMessage(text, isUser = false) {
|
|
429
|
+
const msgDiv = document.createElement('div');
|
|
430
|
+
msgDiv.className = `message ${isUser ? 'user' : 'system'}`;
|
|
431
|
+
|
|
432
|
+
let formattedText = text
|
|
433
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong class="glow-text">$1</strong>')
|
|
434
|
+
.replace(/`([^`]+)`/g, '<code>$1</code>')
|
|
435
|
+
.replace(/```([\s\S]+?)```/g, '<pre>$1</pre>')
|
|
436
|
+
.replace(/\n/g, '<br>');
|
|
437
|
+
|
|
438
|
+
msgDiv.innerHTML = formattedText;
|
|
439
|
+
chatMessages.appendChild(msgDiv);
|
|
440
|
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
async function performQuery() {
|
|
444
|
+
const query = queryInput.value.trim();
|
|
445
|
+
if (!query) return;
|
|
446
|
+
|
|
447
|
+
queryInput.value = '';
|
|
448
|
+
queryInput.disabled = true;
|
|
449
|
+
sendBtn.disabled = true;
|
|
450
|
+
|
|
451
|
+
appendMessage(query, true);
|
|
452
|
+
appendLog(`Query received: "${query}"`, "USER");
|
|
453
|
+
|
|
454
|
+
statusDot.className = 'status-dot loading';
|
|
455
|
+
statusText.innerText = 'Compiling reasoning context...';
|
|
456
|
+
appendLog("Invoking model('gemini-3.1')...", "COMPILER");
|
|
457
|
+
|
|
458
|
+
try {
|
|
459
|
+
const response = await fetch(`http://localhost:8000/chat?q=${encodeURIComponent(query)}`);
|
|
460
|
+
const data = await response.json();
|
|
461
|
+
|
|
462
|
+
if (data.error) {
|
|
463
|
+
appendMessage(`Error: ${data.details || data.error}`);
|
|
464
|
+
appendLog(`Execution error: ${data.error}`, "ERROR");
|
|
465
|
+
} else {
|
|
466
|
+
appendMessage(data.response);
|
|
467
|
+
appendLog("Response rendered successfully.", "UI");
|
|
468
|
+
}
|
|
469
|
+
} catch (error) {
|
|
470
|
+
appendMessage("Failed to connect to the Sesi Support Gateway. Ensure the local server is running on port 8000.");
|
|
471
|
+
appendLog("Gateway connection timeout.", "ERROR");
|
|
472
|
+
} finally {
|
|
473
|
+
queryInput.disabled = false;
|
|
474
|
+
sendBtn.disabled = false;
|
|
475
|
+
queryInput.focus();
|
|
476
|
+
statusDot.className = 'status-dot';
|
|
477
|
+
statusText.innerText = 'Sesi Support Active';
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
sendBtn.addEventListener('click', performQuery);
|
|
482
|
+
queryInput.addEventListener('keydown', (e) => {
|
|
483
|
+
if (e.key === 'Enter') performQuery();
|
|
484
|
+
});
|
|
485
|
+
</script>
|
|
486
|
+
</body>
|
|
487
|
+
|
|
488
|
+
</html>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Sesi Script: chatbot.sesi
|
|
2
|
-
// Pure-Sesi AI Chatbot Core
|
|
3
2
|
// Compiles full repository documentation and uses Sesi's native reasoning models to answer user queries!
|
|
4
3
|
|
|
5
4
|
// 1. Read the user's active query
|
|
@@ -24,7 +23,7 @@ let docs_list = list_dir("docs")
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
// 3. Assemble full system context
|
|
27
|
-
let system_context = "You are Sesi
|
|
26
|
+
let system_context = "You are Sesi Support, the official support bot for the Sesi Programming Language. Below is the official reference documentation and native codebase of Sesi: " + sesiDocs + "Use this data to answer the user's question with absolute technical precision. Maintain Sesi's programming rules. Be helpful, highly structured, and technical."
|
|
28
27
|
|
|
29
28
|
print "🚀 Querying Sesi's native gemini-3.1-flash-lite reasoning model..."
|
|
30
29
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Sesi AI Chatbot Local Server
|
|
2
|
+
# Handles visual dashboard requests and executes pure Sesi model queries offline!
|
|
3
|
+
|
|
4
|
+
import http.server
|
|
5
|
+
import socketserver
|
|
6
|
+
import urllib.parse
|
|
7
|
+
import json
|
|
8
|
+
import subprocess
|
|
9
|
+
import os
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
# Force UTF-8 encoding on standard streams to prevent Windows console encoding crashes
|
|
13
|
+
if hasattr(sys.stdout, 'reconfigure'):
|
|
14
|
+
sys.stdout.reconfigure(encoding='utf-8')
|
|
15
|
+
if hasattr(sys.stderr, 'reconfigure'):
|
|
16
|
+
sys.stderr.reconfigure(encoding='utf-8')
|
|
17
|
+
|
|
18
|
+
PORT = 8000
|
|
19
|
+
|
|
20
|
+
class ChatbotHandler(http.server.SimpleHTTPRequestHandler):
|
|
21
|
+
def end_headers(self):
|
|
22
|
+
# Allow cross-origin requests for safety
|
|
23
|
+
self.send_header('Access-Control-Allow-Origin', '*')
|
|
24
|
+
self.send_header('Access-Control-Allow-Methods', 'GET, OPTIONS')
|
|
25
|
+
self.send_header('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type')
|
|
26
|
+
super().end_headers()
|
|
27
|
+
|
|
28
|
+
def do_OPTIONS(self):
|
|
29
|
+
self.send_response(200)
|
|
30
|
+
self.end_headers()
|
|
31
|
+
|
|
32
|
+
def do_GET(self):
|
|
33
|
+
parsed_url = urllib.parse.urlparse(self.path)
|
|
34
|
+
|
|
35
|
+
# Route API Chat queries
|
|
36
|
+
if parsed_url.path == '/chat':
|
|
37
|
+
query_params = urllib.parse.parse_qs(parsed_url.query)
|
|
38
|
+
user_query = query_params.get('q', [''])[0]
|
|
39
|
+
|
|
40
|
+
if not user_query:
|
|
41
|
+
self.send_response(400)
|
|
42
|
+
self.send_header('Content-type', 'application/json')
|
|
43
|
+
self.end_headers()
|
|
44
|
+
self.wfile.write(json.dumps({"error": "Empty query parameter 'q'"}).encode('utf-8'))
|
|
45
|
+
return
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
# 1. Write the query to query.txt for Sesi to read
|
|
49
|
+
with open("query.txt", "w", encoding="utf-8") as f:
|
|
50
|
+
f.write(user_query)
|
|
51
|
+
|
|
52
|
+
print(f"[SERVER] Active query logged: '{user_query}'")
|
|
53
|
+
|
|
54
|
+
# 2. Execute Sesi chatbot script using cross-platform execution (with Powershell bypass on Windows if needed)
|
|
55
|
+
if sys.platform == "win32":
|
|
56
|
+
cmd = 'powershell -ExecutionPolicy Bypass -Command "npx dotenvx run -- node bin/sesi.js chatbot/chatbot.sesi"'
|
|
57
|
+
else:
|
|
58
|
+
cmd = 'npx dotenvx run -- node bin/sesi.js chatbot/chatbot.sesi'
|
|
59
|
+
print(f"[SERVER] Spawning native Sesi AI compiler engine...")
|
|
60
|
+
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, encoding='utf-8')
|
|
61
|
+
|
|
62
|
+
if result.returncode != 0:
|
|
63
|
+
print(f"[SERVER ERROR] Sesi compiler failed: {result.stderr}")
|
|
64
|
+
self.send_response(500)
|
|
65
|
+
self.send_header('Content-type', 'application/json')
|
|
66
|
+
self.end_headers()
|
|
67
|
+
self.wfile.write(json.dumps({"error": "Sesi compiler failed to execute", "details": result.stderr}).encode('utf-8'))
|
|
68
|
+
return
|
|
69
|
+
|
|
70
|
+
# 3. Read the generated response.txt
|
|
71
|
+
response_content = "Sorry, no response could be generated."
|
|
72
|
+
if os.path.exists("response.txt"):
|
|
73
|
+
with open("response.txt", "r", encoding="utf-8") as f:
|
|
74
|
+
response_content = f.read()
|
|
75
|
+
|
|
76
|
+
# 4. Respond to browser with the reasoning output!
|
|
77
|
+
self.send_response(200)
|
|
78
|
+
self.send_header('Content-type', 'application/json')
|
|
79
|
+
self.end_headers()
|
|
80
|
+
self.wfile.write(json.dumps({"response": response_content}).encode('utf-8'))
|
|
81
|
+
print("[SERVER] Response successfully sent to visual console!")
|
|
82
|
+
|
|
83
|
+
except Exception as e:
|
|
84
|
+
print(f"[SERVER ERROR] Exception raised: {str(e)}")
|
|
85
|
+
self.send_response(500)
|
|
86
|
+
self.send_header('Content-type', 'application/json')
|
|
87
|
+
self.end_headers()
|
|
88
|
+
self.wfile.write(json.dumps({"error": str(e)}).encode('utf-8'))
|
|
89
|
+
|
|
90
|
+
else:
|
|
91
|
+
# Fallback to serving static files (for chatbot.html dashboard!)
|
|
92
|
+
super().do_GET()
|
|
93
|
+
|
|
94
|
+
# Ensure we run strictly on Port 8000
|
|
95
|
+
socketserver.TCPServer.allow_reuse_address = True
|
|
96
|
+
with socketserver.TCPServer(("", PORT), ChatbotHandler) as httpd:
|
|
97
|
+
print(f"==================================================")
|
|
98
|
+
print(f"[GATEWAY] Sesi AI Chatbot Local Gateway Active!")
|
|
99
|
+
print(f"[URL] Serving console on: http://localhost:{PORT}/chatbot.html")
|
|
100
|
+
print(f"==================================================")
|
|
101
|
+
try:
|
|
102
|
+
httpd.serve_forever()
|
|
103
|
+
except KeyboardInterrupt:
|
|
104
|
+
print("\n[SERVER] Gateway safely closed.")
|
|
105
|
+
sys.exit(0)
|