agentgui 1.0.865 → 1.0.867
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/CLAUDE.md +1 -0
- package/package.json +1 -1
- package/static/js/client-cache.js +0 -1
- package/static/js/client-scroll.js +4 -4
- package/static/js/client-utils.js +20 -21
- package/static/js/codec.js +4 -0
package/CLAUDE.md
CHANGED
|
@@ -369,3 +369,4 @@ The README.md uses shields.io badges with a consistent pattern:
|
|
|
369
369
|
- **`toolIds` in `server-startup.js` must match `TOOLS` in `tool-manager.js`:** `initializeToolInstallations` runs for each toolId, creating the `tool_installations` row. `tool_install_history` has a FK to `tool_installations(tool_id)`. Any tool omitted from toolIds will cause a FOREIGN KEY constraint failure when the periodic update checker writes history for it.
|
|
370
370
|
- **`JsonlWatcher._read(fp)` override:** Captures `this._currentFp` before calling `super._read(fp)`, making the file path available to `_line()` callbacks for project-directory decoding in `_conv()`. JSONL project dirs are encoded (e.g., `-config-workspace-agentgui`) — decoded via `'/' + dirName.slice(1).replace(/-/g, '/')`.
|
|
371
371
|
- **`createHttpHandler` uses `getWss: () => wss` (lazy getter):** Passing `wss` directly would crash with TDZ since `wss` is declared after `createHttpHandler` is called. The function form defers access until request time when `wss` is initialized.
|
|
372
|
+
- **`_promptPushIfWeOwnRemote` fires after every `streaming_complete`:** `client-streaming4.js` calls `git.check` on the server after each agent turn. If `ownsRemote && (hasChanges || hasUnpushed)`, it auto-sends "Push the changes to the remote repository." to the current conversation. `ownsRemote` is true for non-github remotes, and for github.com remotes only when `GITHUB_USER` env var is set and appears in the URL. Without `GITHUB_USER`, github.com remotes return `ownsRemote=false` (safe default).
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
this.updateBusyPromptArea(conversationId);
|
|
11
|
-
}
|
|
11
|
+
},
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
updateBusyPromptArea(conversationId) {
|
|
@@ -27,7 +27,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
if (this.ui.sendButton) this.ui.sendButton.style.display = isStreaming ? 'none' : '';
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
removeScrollUpDetection() {
|
|
@@ -36,7 +36,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
36
36
|
scrollContainer.removeEventListener('scroll', this._scrollUpHandler);
|
|
37
37
|
this._scrollUpHandler = null;
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
},
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
setupScrollUpDetection(conversationId) {
|
|
@@ -154,7 +154,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
154
154
|
scrollContainer.removeEventListener('scroll', this._scrollUpHandler);
|
|
155
155
|
this._scrollUpHandler = handleScroll;
|
|
156
156
|
scrollContainer.addEventListener('scroll', this._scrollUpHandler, { passive: true });
|
|
157
|
-
}
|
|
157
|
+
},
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
renderMessagesFragment(messages) {
|
|
@@ -4,12 +4,12 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
4
4
|
return '<p class="text-secondary">No messages in this conversation yet</p>';
|
|
5
5
|
}
|
|
6
6
|
return messages.map(msg => `<div class="message message-${msg.role}"><div class="message-role">${msg.role.charAt(0).toUpperCase() + msg.role.slice(1)}</div>${this.renderMessageContent(msg.content)}<div class="message-timestamp">${new Date(msg.created_at).toLocaleString()}</div></div>`).join('');
|
|
7
|
-
}
|
|
7
|
+
},
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
escapeHtml(text) {
|
|
11
11
|
return window._escHtml(text);
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
showError(message) {
|
|
@@ -17,7 +17,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
17
17
|
if (window.UIDialog) {
|
|
18
18
|
window.UIDialog.alert(message, 'Error');
|
|
19
19
|
}
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
on(event, callback) {
|
|
@@ -25,7 +25,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
25
25
|
this.eventHandlers[event] = [];
|
|
26
26
|
}
|
|
27
27
|
this.eventHandlers[event].push(callback);
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
emit(event, data) {
|
|
@@ -38,12 +38,12 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
getEffectiveAgentId() {
|
|
45
45
|
return this.ui.cliSelector?.value || null;
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
getEffectiveSubAgent() {
|
|
@@ -51,12 +51,12 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
51
51
|
return this.ui.agentSelector.value;
|
|
52
52
|
}
|
|
53
53
|
return null;
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
getCurrentAgent() {
|
|
58
58
|
return this.getEffectiveAgentId();
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
saveAgentAndModelToConversation() {
|
|
@@ -66,12 +66,12 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
66
66
|
const subAgent = this.getEffectiveSubAgent();
|
|
67
67
|
const model = this.getCurrentModel();
|
|
68
68
|
window.wsClient.rpc('conv.upd', { id: convId, agentType: agentId, subAgent: subAgent || undefined, model: model || undefined }).catch(() => {});
|
|
69
|
-
}
|
|
69
|
+
},
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
getCurrentModel() {
|
|
73
73
|
return this.ui.modelSelector?.value || null;
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
getMetrics() {
|
|
@@ -81,7 +81,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
81
81
|
eventProcessor: this.eventProcessor.getStats(),
|
|
82
82
|
state: this.state
|
|
83
83
|
};
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
saveDraftPrompt() {
|
|
@@ -93,7 +93,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
93
93
|
localStorage.setItem(`draft-${convId}`, draft);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
},
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
restoreDraftPrompt(conversationId) {
|
|
@@ -106,13 +106,13 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
this.ui.messageInput.value = draft;
|
|
109
|
-
}
|
|
109
|
+
},
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
clearDraft(conversationId) {
|
|
113
113
|
this.draftPrompts.delete(conversationId);
|
|
114
114
|
localStorage.removeItem(`draft-${conversationId}`);
|
|
115
|
-
}
|
|
115
|
+
},
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
updateSendButtonState() {
|
|
@@ -125,11 +125,11 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
125
125
|
if (this.ui.queueButton && this.ui.queueButton.classList.contains('visible')) {
|
|
126
126
|
this.ui.queueButton.disabled = !this.wsManager.isConnected;
|
|
127
127
|
}
|
|
128
|
-
}
|
|
128
|
+
},
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
disablePromptArea() {
|
|
132
|
-
}
|
|
132
|
+
},
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
enablePromptArea() {
|
|
@@ -138,7 +138,7 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
138
138
|
}
|
|
139
139
|
const injectBtn = document.getElementById('injectBtn');
|
|
140
140
|
if (injectBtn) injectBtn.disabled = false;
|
|
141
|
-
}
|
|
141
|
+
},
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
showStreamingPromptButtons() {
|
|
@@ -150,14 +150,14 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
150
150
|
this.ui.queueButton.classList.add('visible');
|
|
151
151
|
this.ui.queueButton.disabled = !this.wsManager.isConnected;
|
|
152
152
|
}
|
|
153
|
-
}
|
|
153
|
+
},
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
ensurePromptAreaAlwaysEnabled() {
|
|
157
157
|
if (this.ui.messageInput) {
|
|
158
158
|
this.ui.messageInput.disabled = false;
|
|
159
159
|
}
|
|
160
|
-
}
|
|
160
|
+
},
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
destroy() {
|
|
@@ -166,10 +166,9 @@ Object.assign(AgentGUIClient.prototype, {
|
|
|
166
166
|
this.wsManager.destroy();
|
|
167
167
|
this.eventHandlers = {};
|
|
168
168
|
}
|
|
169
|
-
}
|
|
169
|
+
});
|
|
170
170
|
|
|
171
171
|
window.__convPerfMetrics = () => {
|
|
172
172
|
const entries = performance.getEntriesByType('measure').filter(e => e.name.startsWith('conv-'));
|
|
173
173
|
return entries.map(e => ({ name: e.name, ms: Math.round(e.duration) }));
|
|
174
174
|
};
|
|
175
|
-
});
|