agentgui 1.0.684 → 1.0.686
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/static/index.html +10 -4
- package/static/js/codec.js +2 -47
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -3233,13 +3233,19 @@
|
|
|
3233
3233
|
</button>
|
|
3234
3234
|
</div>
|
|
3235
3235
|
<button class="inject-btn" id="injectBtn" title="Steer or inject into running agent" aria-label="Steer/Inject">
|
|
3236
|
-
<svg viewBox="0 0 24 24" fill="currentColor" width="18" height="18">
|
|
3237
|
-
<
|
|
3236
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18">
|
|
3237
|
+
<polyline points="23 4 23 10 17 10"></polyline>
|
|
3238
|
+
<path d="M20.49 15a9 9 0 1 1 .12-14.85"></path>
|
|
3238
3239
|
</svg>
|
|
3239
3240
|
</button>
|
|
3240
3241
|
<button class="queue-btn" id="queueBtn" title="Queue message for running agent" aria-label="Queue message">
|
|
3241
|
-
<svg viewBox="0 0 24 24" fill="currentColor" width="18" height="18">
|
|
3242
|
-
<
|
|
3242
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="18" height="18">
|
|
3243
|
+
<line x1="8" y1="6" x2="21" y2="6"></line>
|
|
3244
|
+
<line x1="8" y1="12" x2="21" y2="12"></line>
|
|
3245
|
+
<line x1="8" y1="18" x2="21" y2="18"></line>
|
|
3246
|
+
<line x1="3" y1="6" x2="3.01" y2="6"></line>
|
|
3247
|
+
<line x1="3" y1="12" x2="3.01" y2="12"></line>
|
|
3248
|
+
<line x1="3" y1="18" x2="3.01" y2="18"></line>
|
|
3243
3249
|
</svg>
|
|
3244
3250
|
</button>
|
|
3245
3251
|
<button class="stop-btn" id="stopBtn" title="Stop running agent (emergency)" aria-label="Stop agent">
|
package/static/js/codec.js
CHANGED
|
@@ -1,47 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* msgpackr (global from msgpackr.min.js) + GPT tokenizer BPE compression.
|
|
4
|
-
*/
|
|
5
|
-
import { encode as tokEncode, decode as tokDecode } from 'https://esm.sh/gpt-tokenizer';
|
|
6
|
-
|
|
7
|
-
const THRESHOLD = 200;
|
|
8
|
-
const COMPRESSIBLE = new Set(['content', 'text', 'output', 'response', 'prompt', 'input', 'data']);
|
|
9
|
-
|
|
10
|
-
function compressText(str) {
|
|
11
|
-
return { __tok: true, d: tokEncode(str) };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function decompressText(val) {
|
|
15
|
-
return tokDecode(val.d);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function encodeObj(obj) {
|
|
19
|
-
if (!obj || typeof obj !== 'object') return obj;
|
|
20
|
-
if (Array.isArray(obj)) return obj.map(encodeObj);
|
|
21
|
-
const out = {};
|
|
22
|
-
for (const k of Object.keys(obj)) {
|
|
23
|
-
const v = obj[k];
|
|
24
|
-
if (COMPRESSIBLE.has(k) && typeof v === 'string' && v.length > THRESHOLD) {
|
|
25
|
-
out[k] = compressText(v);
|
|
26
|
-
} else if (v && typeof v === 'object' && !(v instanceof ArrayBuffer) && !ArrayBuffer.isView(v)) {
|
|
27
|
-
out[k] = encodeObj(v);
|
|
28
|
-
} else {
|
|
29
|
-
out[k] = v;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return out;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function decodeObj(obj) {
|
|
36
|
-
if (!obj || typeof obj !== 'object') return obj;
|
|
37
|
-
if (Array.isArray(obj)) return obj.map(decodeObj);
|
|
38
|
-
if (obj.__tok && obj.d) return decompressText(obj);
|
|
39
|
-
const out = {};
|
|
40
|
-
for (const k of Object.keys(obj)) {
|
|
41
|
-
out[k] = decodeObj(obj[k]);
|
|
42
|
-
}
|
|
43
|
-
return out;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function encode(obj) { return msgpackr.pack(encodeObj(obj)); }
|
|
47
|
-
export function decode(buf) { return decodeObj(msgpackr.unpack(new Uint8Array(buf instanceof ArrayBuffer ? buf : buf))); }
|
|
1
|
+
export function encode(obj) { return msgpackr.pack(obj); }
|
|
2
|
+
export function decode(buf) { return msgpackr.unpack(new Uint8Array(buf instanceof ArrayBuffer ? buf : buf)); }
|