haillo 0.2.2__tar.gz → 0.2.4__tar.gz
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.
- {haillo-0.2.2/haillo.egg-info → haillo-0.2.4}/PKG-INFO +8 -8
- {haillo-0.2.2 → haillo-0.2.4}/README.rst +4 -4
- {haillo-0.2.2 → haillo-0.2.4}/haillo/haillo.py +11 -20
- {haillo-0.2.2 → haillo-0.2.4}/haillo/package.py +2 -2
- {haillo-0.2.2 → haillo-0.2.4/haillo.egg-info}/PKG-INFO +8 -8
- {haillo-0.2.2 → haillo-0.2.4}/haillo.egg-info/SOURCES.txt +0 -2
- {haillo-0.2.2 → haillo-0.2.4}/haillo.egg-info/requires.txt +1 -1
- {haillo-0.2.2 → haillo-0.2.4}/pyproject.toml +2 -2
- {haillo-0.2.2 → haillo-0.2.4}/requirements.txt +1 -1
- haillo-0.2.2/haillo/static/context.css.backup +0 -213
- haillo-0.2.2/haillo/static/context.js.backup +0 -97
- {haillo-0.2.2 → haillo-0.2.4}/LICENSE.txt +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/MANIFEST.in +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/__init__.py +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/__main__.py +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/config.py +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/data/haillo.1 +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/hutils.py +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/logger.py +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/static/context.css +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/static/context.js +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/static/icons/icon_144x144.png +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/static/manifest.json +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/static/sidebar.css +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/static/sidebar.js +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/templates/chat_history.html +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/templates/index.html +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo/templates/sidebar.html +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo.egg-info/dependency_links.txt +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo.egg-info/entry_points.txt +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/haillo.egg-info/top_level.txt +0 -0
- {haillo-0.2.2 → haillo-0.2.4}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: haillo
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary: Haillo is a web frontend for hai (hcli_hai), the command line AI chat application.
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Haillo is a web frontend for hai (hcli_hai), the HCLI command line AI chat application.
|
|
5
5
|
Author-email: Jeff Michaud <cometaj2@proton.me>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/cometaj2/haillo
|
|
8
|
-
Keywords: web,ui,cli,client,server,connector,hypermedia,rest,generic,development
|
|
8
|
+
Keywords: ai,llm,web,ui,cli,client,server,connector,hypermedia,rest,generic,development
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: Topic :: Software Development
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Description-Content-Type: text/x-rst
|
|
19
19
|
License-File: LICENSE.txt
|
|
20
|
-
Requires-Dist: flask==3.0
|
|
20
|
+
Requires-Dist: flask==3.1.0
|
|
21
21
|
Requires-Dist: huckle<6.0.0,>=5.5.4
|
|
22
22
|
Requires-Dist: hcli_hai<4.0.0,>=3.0.0
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ Requires-Dist: hcli_hai<4.0.0,>=3.0.0
|
|
|
26
26
|
Haillo
|
|
27
27
|
======
|
|
28
28
|
|
|
29
|
-
Haillo is a web frontend for hai (hcli_hai), the command line AI chat application.
|
|
29
|
+
Haillo is a web frontend for hai (hcli_hai), the HCLI command line AI chat application.
|
|
30
30
|
|
|
31
31
|
----
|
|
32
32
|
|
|
@@ -41,11 +41,11 @@ Help shape HCLI and it's ecosystem by raising issues on github!
|
|
|
41
41
|
Related HCLI Projects
|
|
42
42
|
---------------------
|
|
43
43
|
|
|
44
|
-
- hcli_core, an HCLI Connector that can be used to expose a REST API that behaves as a CLI
|
|
44
|
+
- hcli_core, an HCLI Connector that can be used to expose a REST API that behaves as a CLI [2]
|
|
45
45
|
|
|
46
|
-
- huckle is a CLI, and python library, that can act as an impostor for any CLI expressed via hypertext [3]
|
|
46
|
+
- huckle is a CLI, and python library, that can act as an impostor for any CLI expressed via hypertext command line interface (HCLI) semantics [3]
|
|
47
47
|
|
|
48
|
-
-
|
|
48
|
+
- hcli_hai, a python package wrapper that contains an HCLI sample application (hai); hai is an HCLI for interacting with Anthropic's Claude models via terminal input and output streams. [4]
|
|
49
49
|
|
|
50
50
|
[2] https://github.com/cometaj2/hcli_core
|
|
51
51
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Haillo
|
|
4
4
|
======
|
|
5
5
|
|
|
6
|
-
Haillo is a web frontend for hai (hcli_hai), the command line AI chat application.
|
|
6
|
+
Haillo is a web frontend for hai (hcli_hai), the HCLI command line AI chat application.
|
|
7
7
|
|
|
8
8
|
----
|
|
9
9
|
|
|
@@ -18,11 +18,11 @@ Help shape HCLI and it's ecosystem by raising issues on github!
|
|
|
18
18
|
Related HCLI Projects
|
|
19
19
|
---------------------
|
|
20
20
|
|
|
21
|
-
- hcli_core, an HCLI Connector that can be used to expose a REST API that behaves as a CLI
|
|
21
|
+
- hcli_core, an HCLI Connector that can be used to expose a REST API that behaves as a CLI [2]
|
|
22
22
|
|
|
23
|
-
- huckle is a CLI, and python library, that can act as an impostor for any CLI expressed via hypertext [3]
|
|
23
|
+
- huckle is a CLI, and python library, that can act as an impostor for any CLI expressed via hypertext command line interface (HCLI) semantics [3]
|
|
24
24
|
|
|
25
|
-
-
|
|
25
|
+
- hcli_hai, a python package wrapper that contains an HCLI sample application (hai); hai is an HCLI for interacting with Anthropic's Claude models via terminal input and output streams. [4]
|
|
26
26
|
|
|
27
27
|
[2] https://github.com/cometaj2/hcli_core
|
|
28
28
|
|
|
@@ -47,15 +47,6 @@ def parse_context(context_str):
|
|
|
47
47
|
return {'messages': [], 'name': '', 'title': ''}
|
|
48
48
|
|
|
49
49
|
def webapp():
|
|
50
|
-
################################################ CRITICAL ################################################
|
|
51
|
-
# This ensures a clean stdin state before workers fork.
|
|
52
|
-
# Without this, flask/gunicorn can hand off an inconsistent stdin state to huckle which causes
|
|
53
|
-
# Huckle to attempt to stream data when there is none to stream, leading to unexpected stream interruption
|
|
54
|
-
# socket closeout in urllib3's pool and bad file descriptor errors.
|
|
55
|
-
##########################################################################################################
|
|
56
|
-
if not sys.stdin.isatty():
|
|
57
|
-
sys.stdin = io.BytesIO()
|
|
58
|
-
|
|
59
50
|
app = Flask(__name__)
|
|
60
51
|
|
|
61
52
|
@app.route('/')
|
|
@@ -81,7 +72,7 @@ def webapp():
|
|
|
81
72
|
# Convert to a python list
|
|
82
73
|
model = ast.literal_eval(model)[0]
|
|
83
74
|
|
|
84
|
-
# Get
|
|
75
|
+
# Get models list
|
|
85
76
|
chunks = cli(f"hai model ls --json")
|
|
86
77
|
models = ""
|
|
87
78
|
for dest, chunk in chunks: # Now unpacking tuple of (dest, chunk)
|
|
@@ -127,7 +118,7 @@ def webapp():
|
|
|
127
118
|
# Convert to a python list
|
|
128
119
|
model = ast.literal_eval(model)[0]
|
|
129
120
|
|
|
130
|
-
# Get
|
|
121
|
+
# Get models list
|
|
131
122
|
chunks = cli(f"hai model ls --json")
|
|
132
123
|
models = ""
|
|
133
124
|
for dest, chunk in chunks: # Now unpacking tuple of (dest, chunk)
|
|
@@ -150,13 +141,11 @@ def webapp():
|
|
|
150
141
|
@app.route('/context/<context_id>')
|
|
151
142
|
def navigate_context(context_id):
|
|
152
143
|
try:
|
|
153
|
-
# Execute hai set
|
|
154
|
-
cmd_start = time.time()
|
|
155
144
|
logging.info("Switching to context_id " + context_id)
|
|
145
|
+
|
|
156
146
|
chunks = cli(f"hai set {context_id}")
|
|
157
|
-
chunk_count = 0
|
|
158
147
|
for dest, chunk in chunks:
|
|
159
|
-
|
|
148
|
+
pass
|
|
160
149
|
|
|
161
150
|
return redirect(url_for('index'))
|
|
162
151
|
except Exception as error:
|
|
@@ -169,10 +158,11 @@ def webapp():
|
|
|
169
158
|
def delete_context(context_id):
|
|
170
159
|
try:
|
|
171
160
|
logging.info("Removing context_id " + context_id)
|
|
161
|
+
|
|
172
162
|
chunks = cli(f"hai rm {context_id}")
|
|
173
|
-
chunk_count = 0
|
|
174
163
|
for dest, chunk in chunks:
|
|
175
|
-
|
|
164
|
+
pass
|
|
165
|
+
|
|
176
166
|
return redirect(url_for('index'))
|
|
177
167
|
except Exception as error:
|
|
178
168
|
logging.error(f"Context deletion failed: {error}")
|
|
@@ -189,9 +179,8 @@ def webapp():
|
|
|
189
179
|
|
|
190
180
|
with stdin(stream):
|
|
191
181
|
chunks = cli(f"hai")
|
|
192
|
-
chunk_count = 0
|
|
193
182
|
for dest, chunk in chunks:
|
|
194
|
-
|
|
183
|
+
pass
|
|
195
184
|
|
|
196
185
|
return redirect(url_for('index'))
|
|
197
186
|
except Exception as error:
|
|
@@ -205,9 +194,11 @@ def webapp():
|
|
|
205
194
|
try:
|
|
206
195
|
model = request.form.get('model')
|
|
207
196
|
logging.info(f"Setting model to {model}")
|
|
197
|
+
|
|
208
198
|
chunks = cli(f"hai model set {model}")
|
|
209
199
|
for dest, chunk in chunks:
|
|
210
|
-
|
|
200
|
+
pass
|
|
201
|
+
|
|
211
202
|
return redirect(url_for('index'))
|
|
212
203
|
except Exception as error:
|
|
213
204
|
logging.error(f"Model switch failed: {error}")
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: haillo
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary: Haillo is a web frontend for hai (hcli_hai), the command line AI chat application.
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Haillo is a web frontend for hai (hcli_hai), the HCLI command line AI chat application.
|
|
5
5
|
Author-email: Jeff Michaud <cometaj2@proton.me>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/cometaj2/haillo
|
|
8
|
-
Keywords: web,ui,cli,client,server,connector,hypermedia,rest,generic,development
|
|
8
|
+
Keywords: ai,llm,web,ui,cli,client,server,connector,hypermedia,rest,generic,development
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: Topic :: Software Development
|
|
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Description-Content-Type: text/x-rst
|
|
19
19
|
License-File: LICENSE.txt
|
|
20
|
-
Requires-Dist: flask==3.0
|
|
20
|
+
Requires-Dist: flask==3.1.0
|
|
21
21
|
Requires-Dist: huckle<6.0.0,>=5.5.4
|
|
22
22
|
Requires-Dist: hcli_hai<4.0.0,>=3.0.0
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ Requires-Dist: hcli_hai<4.0.0,>=3.0.0
|
|
|
26
26
|
Haillo
|
|
27
27
|
======
|
|
28
28
|
|
|
29
|
-
Haillo is a web frontend for hai (hcli_hai), the command line AI chat application.
|
|
29
|
+
Haillo is a web frontend for hai (hcli_hai), the HCLI command line AI chat application.
|
|
30
30
|
|
|
31
31
|
----
|
|
32
32
|
|
|
@@ -41,11 +41,11 @@ Help shape HCLI and it's ecosystem by raising issues on github!
|
|
|
41
41
|
Related HCLI Projects
|
|
42
42
|
---------------------
|
|
43
43
|
|
|
44
|
-
- hcli_core, an HCLI Connector that can be used to expose a REST API that behaves as a CLI
|
|
44
|
+
- hcli_core, an HCLI Connector that can be used to expose a REST API that behaves as a CLI [2]
|
|
45
45
|
|
|
46
|
-
- huckle is a CLI, and python library, that can act as an impostor for any CLI expressed via hypertext [3]
|
|
46
|
+
- huckle is a CLI, and python library, that can act as an impostor for any CLI expressed via hypertext command line interface (HCLI) semantics [3]
|
|
47
47
|
|
|
48
|
-
-
|
|
48
|
+
- hcli_hai, a python package wrapper that contains an HCLI sample application (hai); hai is an HCLI for interacting with Anthropic's Claude models via terminal input and output streams. [4]
|
|
49
49
|
|
|
50
50
|
[2] https://github.com/cometaj2/hcli_core
|
|
51
51
|
|
|
@@ -19,9 +19,7 @@ haillo.egg-info/requires.txt
|
|
|
19
19
|
haillo.egg-info/top_level.txt
|
|
20
20
|
haillo/data/haillo.1
|
|
21
21
|
haillo/static/context.css
|
|
22
|
-
haillo/static/context.css.backup
|
|
23
22
|
haillo/static/context.js
|
|
24
|
-
haillo/static/context.js.backup
|
|
25
23
|
haillo/static/manifest.json
|
|
26
24
|
haillo/static/sidebar.css
|
|
27
25
|
haillo/static/sidebar.js
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "haillo"
|
|
7
7
|
dynamic = ["version", "dependencies"]
|
|
8
|
-
description = "Haillo is a web frontend for hai (hcli_hai), the command line AI chat application."
|
|
8
|
+
description = "Haillo is a web frontend for hai (hcli_hai), the HCLI command line AI chat application."
|
|
9
9
|
readme = "README.rst"
|
|
10
10
|
authors = [{name = "Jeff Michaud", email = "cometaj2@proton.me"}]
|
|
11
11
|
license = {text = "MIT"}
|
|
@@ -20,7 +20,7 @@ classifiers = [
|
|
|
20
20
|
"Programming Language :: Python :: 3.11",
|
|
21
21
|
"Programming Language :: Python :: 3.12"
|
|
22
22
|
]
|
|
23
|
-
keywords = ["web", "ui", "cli", "client", "server", "connector", "hypermedia", "rest", "generic", "development"]
|
|
23
|
+
keywords = ["ai", "llm", "web", "ui", "cli", "client", "server", "connector", "hypermedia", "rest", "generic", "development"]
|
|
24
24
|
|
|
25
25
|
[project.urls]
|
|
26
26
|
Homepage = "https://github.com/cometaj2/haillo"
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
* {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
margin: 0;
|
|
4
|
-
padding: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
body {
|
|
8
|
-
font-family: Arial, sans-serif;
|
|
9
|
-
line-height: 1.6;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.container {
|
|
13
|
-
display: flex;
|
|
14
|
-
min-height: 100vh;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* Main content area */
|
|
18
|
-
.main-content {
|
|
19
|
-
flex: 1;
|
|
20
|
-
padding: 10px 100px 80px 200px;
|
|
21
|
-
margin-left: 0;
|
|
22
|
-
overflow-y: auto;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Message styles */
|
|
26
|
-
.message {
|
|
27
|
-
margin-bottom: 15px;
|
|
28
|
-
padding: 12px 15px;
|
|
29
|
-
border-radius: 8px;
|
|
30
|
-
max-width: 100%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.user {
|
|
34
|
-
background-color: #e3f2fd;
|
|
35
|
-
color: #1a1a1a;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.assistant {
|
|
39
|
-
background-color: #f8f9fa;
|
|
40
|
-
color: #1a1a1a;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.system {
|
|
44
|
-
background-color: #fff3e0;
|
|
45
|
-
margin: 15px auto;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.message-role {
|
|
49
|
-
font-weight: bold;
|
|
50
|
-
margin-bottom: 5px;
|
|
51
|
-
color: #666;
|
|
52
|
-
font-size: 0.9em;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.message-content {
|
|
56
|
-
white-space: pre-wrap;
|
|
57
|
-
word-wrap: break-word;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Input area styles */
|
|
61
|
-
.input-container {
|
|
62
|
-
position: fixed;
|
|
63
|
-
bottom: 0;
|
|
64
|
-
left: 200px;
|
|
65
|
-
right: 100px;
|
|
66
|
-
background-color: #fff;
|
|
67
|
-
padding: 15px 0;
|
|
68
|
-
z-index: 1000; /* Add this */
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.input-wrapper {
|
|
72
|
-
display: flex;
|
|
73
|
-
gap: 10px;
|
|
74
|
-
margin-bottom: 5px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.chat-input {
|
|
78
|
-
flex-grow: 1;
|
|
79
|
-
padding: 10px;
|
|
80
|
-
border: 1px solid #dee2e6;
|
|
81
|
-
border-radius: 4px;
|
|
82
|
-
font-family: inherit;
|
|
83
|
-
resize: none;
|
|
84
|
-
min-height: 44px;
|
|
85
|
-
max-height: 200px;
|
|
86
|
-
overflow-y: auto;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.send-button {
|
|
90
|
-
padding: 10px 20px;
|
|
91
|
-
background-color: #0066cc;
|
|
92
|
-
color: white;
|
|
93
|
-
border: none;
|
|
94
|
-
border-radius: 4px;
|
|
95
|
-
cursor: pointer;
|
|
96
|
-
font-size: 1em;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.send-button:hover {
|
|
100
|
-
background-color: #0052a3;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.model-display {
|
|
104
|
-
color: #666;
|
|
105
|
-
font-size: 0.85em;
|
|
106
|
-
text-align: right;
|
|
107
|
-
padding-top: 5px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* Code block styles */
|
|
111
|
-
.message-content pre {
|
|
112
|
-
background-color: #1a1a2e;
|
|
113
|
-
border-radius: 4px;
|
|
114
|
-
padding: 15px;
|
|
115
|
-
margin: 10px 0;
|
|
116
|
-
overflow-x: auto;
|
|
117
|
-
font-family: 'Consolas', 'Monaco', 'Andale Mono', monospace;
|
|
118
|
-
font-size: 0.9em;
|
|
119
|
-
line-height: 1.4;
|
|
120
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
121
|
-
border: 1px solid #2a2a4e;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.message-content code {
|
|
125
|
-
background-color: #1a1a2e;
|
|
126
|
-
color: #e0e0e0;
|
|
127
|
-
padding: 0.2em 0.4em;
|
|
128
|
-
border-radius: 3px;
|
|
129
|
-
font-family: 'Consolas', 'Monaco', 'Andale Mono', monospace;
|
|
130
|
-
font-size: 0.9em;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.message-content pre code {
|
|
134
|
-
padding: 0;
|
|
135
|
-
background-color: transparent;
|
|
136
|
-
color: inherit;
|
|
137
|
-
}
|
|
138
|
-
.messages-container {
|
|
139
|
-
flex-grow: 1;
|
|
140
|
-
overflow-y: auto;
|
|
141
|
-
padding: 20px;
|
|
142
|
-
padding-bottom: 20px;
|
|
143
|
-
/* Ensure content doesn't go behind input */
|
|
144
|
-
margin-bottom: 20px;
|
|
145
|
-
}
|
|
146
|
-
.loading-indicator {
|
|
147
|
-
text-align: left;
|
|
148
|
-
padding: 12px 15px;
|
|
149
|
-
width: fit-content;
|
|
150
|
-
background-color: #f8f9fa;
|
|
151
|
-
border-radius: 8px;
|
|
152
|
-
margin-bottom: 15px;
|
|
153
|
-
min-width: 60px; /* Added to ensure background covers all dots */
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.dot-typing {
|
|
157
|
-
position: relative;
|
|
158
|
-
display: inline-block;
|
|
159
|
-
width: 10px;
|
|
160
|
-
height: 10px;
|
|
161
|
-
border-radius: 5px;
|
|
162
|
-
background-color: #666;
|
|
163
|
-
animation: bounce 0.8s infinite;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.dot-typing::before,
|
|
167
|
-
.dot-typing::after {
|
|
168
|
-
content: '';
|
|
169
|
-
position: absolute;
|
|
170
|
-
top: 0;
|
|
171
|
-
width: 10px;
|
|
172
|
-
height: 10px;
|
|
173
|
-
border-radius: 5px;
|
|
174
|
-
background-color: #666;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.dot-typing::before {
|
|
178
|
-
left: 15px;
|
|
179
|
-
animation: bounce 0.8s infinite 0.2s;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.dot-typing::after {
|
|
183
|
-
left: 30px;
|
|
184
|
-
animation: bounce 0.8s infinite 0.4s;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
@keyframes bounce {
|
|
188
|
-
0%, 100% { transform: translateY(0); }
|
|
189
|
-
50% { transform: translateY(-10px); }
|
|
190
|
-
}
|
|
191
|
-
@keyframes dot-typing {
|
|
192
|
-
0% {
|
|
193
|
-
box-shadow: 9984px 0 0 0 #666, 9999px 0 0 0 #666, 10014px 0 0 0 #666;
|
|
194
|
-
}
|
|
195
|
-
16.667% {
|
|
196
|
-
box-shadow: 9984px -10px 0 0 #666, 9999px 0 0 0 #666, 10014px 0 0 0 #666;
|
|
197
|
-
}
|
|
198
|
-
33.333% {
|
|
199
|
-
box-shadow: 9984px 0 0 0 #666, 9999px 0 0 0 #666, 10014px 0 0 0 #666;
|
|
200
|
-
}
|
|
201
|
-
50% {
|
|
202
|
-
box-shadow: 9984px 0 0 0 #666, 9999px -10px 0 0 #666, 10014px 0 0 0 #666;
|
|
203
|
-
}
|
|
204
|
-
66.667% {
|
|
205
|
-
box-shadow: 9984px 0 0 0 #666, 9999px 0 0 0 #666, 10014px 0 0 0 #666;
|
|
206
|
-
}
|
|
207
|
-
83.333% {
|
|
208
|
-
box-shadow: 9984px 0 0 0 #666, 9999px 0 0 0 #666, 10014px -10px 0 0 #666;
|
|
209
|
-
}
|
|
210
|
-
100% {
|
|
211
|
-
box-shadow: 9984px 0 0 0 #666, 9999px 0 0 0 #666, 10014px 0 0 0 #666;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
function scrollToBottom() {
|
|
2
|
-
const messagesContainer = document.querySelector('.messages-container');
|
|
3
|
-
const inputContainer = document.querySelector('.input-container');
|
|
4
|
-
const viewportHeight = window.innerHeight;
|
|
5
|
-
|
|
6
|
-
// Calculate position to scroll to
|
|
7
|
-
const scrollPosition = document.body.scrollHeight - viewportHeight + inputContainer.offsetHeight + 100;
|
|
8
|
-
|
|
9
|
-
window.scrollTo({
|
|
10
|
-
top: scrollPosition,
|
|
11
|
-
behavior: 'smooth'
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function formatCodeBlocks() {
|
|
16
|
-
const messages = document.querySelectorAll('.message-content');
|
|
17
|
-
messages.forEach(message => {
|
|
18
|
-
if (!message.dataset.formatted) {
|
|
19
|
-
const content = message.innerHTML;
|
|
20
|
-
let result = '';
|
|
21
|
-
let codeBlock = '';
|
|
22
|
-
let language = '';
|
|
23
|
-
let isInCodeBlock = false;
|
|
24
|
-
|
|
25
|
-
const lines = content.split('\n');
|
|
26
|
-
for (let i = 0; i < lines.length; i++) {
|
|
27
|
-
const line = lines[i];
|
|
28
|
-
if (line.trim().startsWith('```')) {
|
|
29
|
-
if (!isInCodeBlock) {
|
|
30
|
-
isInCodeBlock = true;
|
|
31
|
-
language = line.trim().slice(3).trim();
|
|
32
|
-
codeBlock = '';
|
|
33
|
-
} else {
|
|
34
|
-
isInCodeBlock = false;
|
|
35
|
-
result += `<pre><code class="language-${language || 'plaintext'}">${codeBlock.trim()}</code></pre>\n`;
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
if (isInCodeBlock) {
|
|
39
|
-
codeBlock += line + '\n';
|
|
40
|
-
} else {
|
|
41
|
-
result += line + '\n';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
message.innerHTML = result;
|
|
46
|
-
message.dataset.formatted = 'true';
|
|
47
|
-
Prism.highlightAllUnder(message);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Auto-resize textarea
|
|
53
|
-
document.querySelector('.chat-input').addEventListener('input', function() {
|
|
54
|
-
this.style.height = 'auto';
|
|
55
|
-
this.style.height = (this.scrollHeight) + 'px';
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// Observer for content changes
|
|
59
|
-
const observer = new MutationObserver((mutations) => {
|
|
60
|
-
mutations.forEach((mutation) => {
|
|
61
|
-
if (mutation.addedNodes.length) {
|
|
62
|
-
formatCodeBlocks();
|
|
63
|
-
setTimeout(scrollToBottom, 100);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// Initialize everything on DOM load
|
|
69
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
70
|
-
formatCodeBlocks();
|
|
71
|
-
scrollToBottom();
|
|
72
|
-
document.querySelector(".chat-input").focus();
|
|
73
|
-
|
|
74
|
-
// Start observing content changes
|
|
75
|
-
observer.observe(document.querySelector('.main-content'), {
|
|
76
|
-
childList: true,
|
|
77
|
-
subtree: true
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Handle Send button click
|
|
81
|
-
document.querySelector('.send-button').addEventListener('click', function(e) {
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
document.querySelector('.loading-indicator').style.display = 'block';
|
|
84
|
-
|
|
85
|
-
const textarea = document.querySelector('.chat-input');
|
|
86
|
-
const enterEvent = new KeyboardEvent('keydown', {
|
|
87
|
-
keyCode: 13,
|
|
88
|
-
which: 13,
|
|
89
|
-
code: 'Enter',
|
|
90
|
-
key: 'Enter',
|
|
91
|
-
shiftKey: false
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
textarea.dispatchEvent(enterEvent);
|
|
95
|
-
setTimeout(scrollToBottom, 100);
|
|
96
|
-
});
|
|
97
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|