agentgui 1.0.238 → 1.0.239
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/server.js +4 -2
- package/static/js/client.js +7 -14
- package/static/js/voice.js +13 -1
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1773,10 +1773,12 @@ const server = http.createServer(async (req, res) => {
|
|
|
1773
1773
|
const remoteUrl = result.trim();
|
|
1774
1774
|
const statusResult = execSync('git status --porcelain', { encoding: 'utf-8', cwd: STARTUP_CWD });
|
|
1775
1775
|
const hasChanges = statusResult.trim().length > 0;
|
|
1776
|
+
const unpushedResult = execSync('git rev-list --count --not --remotes 2>/dev/null', { encoding: 'utf-8', cwd: STARTUP_CWD });
|
|
1777
|
+
const hasUnpushed = parseInt(unpushedResult.trim() || '0', 10) > 0;
|
|
1776
1778
|
const ownsRemote = !remoteUrl.includes('github.com/') || remoteUrl.includes(process.env.GITHUB_USER || '');
|
|
1777
|
-
sendJSON(req, res, 200, { ownsRemote, hasChanges, remoteUrl });
|
|
1779
|
+
sendJSON(req, res, 200, { ownsRemote, hasChanges, hasUnpushed, remoteUrl });
|
|
1778
1780
|
} catch {
|
|
1779
|
-
sendJSON(req, res, 200, { ownsRemote: false, hasChanges: false, remoteUrl: '' });
|
|
1781
|
+
sendJSON(req, res, 200, { ownsRemote: false, hasChanges: false, hasUnpushed: false, remoteUrl: '' });
|
|
1780
1782
|
}
|
|
1781
1783
|
return;
|
|
1782
1784
|
}
|
package/static/js/client.js
CHANGED
|
@@ -788,28 +788,21 @@ class AgentGUIClient {
|
|
|
788
788
|
this.enableControls();
|
|
789
789
|
this.emit('streaming:complete', data);
|
|
790
790
|
|
|
791
|
-
|
|
792
|
-
this._promptPushIfWeOwnRemote();
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
_isACPAgent(agentId) {
|
|
797
|
-
const acpAgents = ['opencode', 'gemini', 'goose', 'openhands', 'augment', 'cline', 'kimi', 'qwen', 'codex', 'mistral', 'kiro', 'fast-agent'];
|
|
798
|
-
return acpAgents.includes(agentId);
|
|
791
|
+
this._promptPushIfWeOwnRemote();
|
|
799
792
|
}
|
|
800
793
|
|
|
801
794
|
async _promptPushIfWeOwnRemote() {
|
|
802
795
|
try {
|
|
803
796
|
const result = await fetch(window.__BASE_URL + '/api/git/check-remote-ownership');
|
|
804
|
-
const { ownsRemote, hasChanges, remoteUrl } = await result.json();
|
|
805
|
-
if (ownsRemote && hasChanges) {
|
|
806
|
-
const
|
|
807
|
-
if (
|
|
808
|
-
|
|
797
|
+
const { ownsRemote, hasChanges, hasUnpushed, remoteUrl } = await result.json();
|
|
798
|
+
if (ownsRemote && (hasChanges || hasUnpushed)) {
|
|
799
|
+
const conv = this.state.currentConversation;
|
|
800
|
+
if (conv) {
|
|
801
|
+
this.streamToConversation(conv.id, 'Push the changes to the remote repository.', conv.agentId);
|
|
809
802
|
}
|
|
810
803
|
}
|
|
811
804
|
} catch (e) {
|
|
812
|
-
console.warn('
|
|
805
|
+
console.warn('Auto-push check failed:', e);
|
|
813
806
|
}
|
|
814
807
|
}
|
|
815
808
|
|
package/static/js/voice.js
CHANGED
|
@@ -296,7 +296,19 @@
|
|
|
296
296
|
if (!ttsEnabled) return;
|
|
297
297
|
var clean = text.replace(/<[^>]*>/g, '').trim();
|
|
298
298
|
if (!clean) return;
|
|
299
|
-
|
|
299
|
+
var parts = [];
|
|
300
|
+
if (typeof agentGUIClient !== 'undefined' && agentGUIClient && typeof agentGUIClient.parseMarkdownCodeBlocks === 'function') {
|
|
301
|
+
parts = agentGUIClient.parseMarkdownCodeBlocks(clean);
|
|
302
|
+
} else {
|
|
303
|
+
parts = [{ type: 'text', content: clean }];
|
|
304
|
+
}
|
|
305
|
+
parts.forEach(function(part) {
|
|
306
|
+
if (part.type === 'code') return;
|
|
307
|
+
var segment = part.content.trim();
|
|
308
|
+
if (segment) {
|
|
309
|
+
speechQueue.push(segment);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
300
312
|
processQueue();
|
|
301
313
|
}
|
|
302
314
|
|