newmark-agent 0.5.7 → 0.5.9
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/dist/cli-commands.js +3 -3
- package/dist/cli.js +1 -1
- package/dist/conversation-utility-host.bundle.cjs +830 -595
- package/dist/core/agent.d.ts +1 -1
- package/dist/core/agent.js +57 -5
- package/dist/core/agentKernelRunner.js +43 -8
- package/dist/core/emptyResponseRetry.d.ts +16 -0
- package/dist/core/emptyResponseRetry.js +25 -0
- package/dist/core/memoryLab.d.ts +17 -0
- package/dist/core/memoryLab.js +43 -1
- package/dist/core/terminalOutputBuffer.d.ts +24 -0
- package/dist/core/terminalOutputBuffer.js +92 -0
- package/dist/core/toolPolicy.d.ts +1 -0
- package/dist/core/toolPolicy.js +16 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/llm/provider.d.ts +4 -4
- package/dist/llm/provider.js +55 -21
- package/dist/main.js +12 -3
- package/dist/providers/chat-completions.adapter.js +17 -4
- package/dist/providers/provider-events.d.ts +7 -0
- package/dist/providers/provider-events.js +40 -0
- package/dist/providers/responses.adapter.js +23 -9
- package/dist/tools/index.js +42 -10
- package/dist/ui/index.html +73 -19
- package/dist/wsl-agent-host.bundle.cjs +830 -595
- package/package.json +3 -1
package/dist/ui/index.html
CHANGED
|
@@ -2537,9 +2537,12 @@ button.left-ws-item {
|
|
|
2537
2537
|
text-align: left;
|
|
2538
2538
|
cursor: pointer;
|
|
2539
2539
|
font: 600 12px var(--font);
|
|
2540
|
+
transition: none !important;
|
|
2541
|
+
animation: none !important;
|
|
2542
|
+
transform: none !important;
|
|
2540
2543
|
}
|
|
2541
2544
|
|
|
2542
|
-
.conversation-work-run-head:hover { color: var(--text-bright); }
|
|
2545
|
+
.conversation-work-run-head:hover { color: var(--text-bright); filter: none; }
|
|
2543
2546
|
|
|
2544
2547
|
.conversation-work-run-chevron {
|
|
2545
2548
|
width: 8px;
|
|
@@ -2548,7 +2551,7 @@ button.left-ws-item {
|
|
|
2548
2551
|
border-right: 1px solid var(--text-dim);
|
|
2549
2552
|
border-bottom: 1px solid var(--text-dim);
|
|
2550
2553
|
transform: rotate(45deg);
|
|
2551
|
-
transition:
|
|
2554
|
+
transition: none;
|
|
2552
2555
|
}
|
|
2553
2556
|
|
|
2554
2557
|
.conversation-work-run.collapsed .conversation-work-run-chevron { transform: rotate(-45deg); }
|
|
@@ -6408,6 +6411,7 @@ input[type="checkbox"].liquid-switch-dragging::before {
|
|
|
6408
6411
|
<select class="tool-select" id="mode-select">
|
|
6409
6412
|
<option value="build">Build</option>
|
|
6410
6413
|
<option value="plan">Plan</option>
|
|
6414
|
+
<option value="chat">Chat</option>
|
|
6411
6415
|
<option value="goal">Goal</option>
|
|
6412
6416
|
<option value="flow">Flow</option>
|
|
6413
6417
|
</select>
|
|
@@ -6875,6 +6879,7 @@ var NEWMARK_I18N = {
|
|
|
6875
6879
|
'input.next': 'Next',
|
|
6876
6880
|
'mode.build': 'Build',
|
|
6877
6881
|
'mode.plan': 'Plan',
|
|
6882
|
+
'mode.chat': 'Chat',
|
|
6878
6883
|
'mode.goal': 'Goal',
|
|
6879
6884
|
'mode.flow': 'Flow',
|
|
6880
6885
|
'intel.low': 'low',
|
|
@@ -7607,6 +7612,7 @@ var NEWMARK_I18N = {
|
|
|
7607
7612
|
'input.next': 'Next',
|
|
7608
7613
|
'mode.build': 'Build',
|
|
7609
7614
|
'mode.plan': 'Plan',
|
|
7615
|
+
'mode.chat': 'Chat',
|
|
7610
7616
|
'mode.goal': 'Goal',
|
|
7611
7617
|
'mode.flow': 'Flow',
|
|
7612
7618
|
'intel.low': 'low',
|
|
@@ -8339,7 +8345,7 @@ function applyLanguageToUi() {
|
|
|
8339
8345
|
setTitleAndLabel('#lt-ws-icon', t('left.workspaces'));
|
|
8340
8346
|
updateSubmitButtonState();
|
|
8341
8347
|
setTitleAndLabel('#left-collapse-btn', t('left.collapse'));
|
|
8342
|
-
setSelectOptionText('mode-select', { build: t('mode.build'), plan: t('mode.plan'), goal: t('mode.goal'), flow: t('mode.flow') });
|
|
8348
|
+
setSelectOptionText('mode-select', { build: t('mode.build'), plan: t('mode.plan'), chat: t('mode.chat'), goal: t('mode.goal'), flow: t('mode.flow') });
|
|
8343
8349
|
setSelectOptionText('intel-select', { low: t('intel.low'), medium: t('intel.medium'), high: t('intel.high'), xhigh: t('intel.xhigh'), max: t('intel.max'), ultra: t('intel.ultra') });
|
|
8344
8350
|
var guideBtn = document.querySelector('.mode-toggle-btn[data-mode="guide"]');
|
|
8345
8351
|
var nextBtn = document.querySelector('.mode-toggle-btn[data-mode="next"]');
|
|
@@ -12556,7 +12562,7 @@ function renderPendingOptionsInChat(options) {
|
|
|
12556
12562
|
}
|
|
12557
12563
|
|
|
12558
12564
|
function setVisibleMode(mode) {
|
|
12559
|
-
var nextMode = ['build', 'plan', 'goal', 'flow'].indexOf(String(mode || '').toLowerCase()) >= 0
|
|
12565
|
+
var nextMode = ['build', 'plan', 'chat', 'goal', 'flow'].indexOf(String(mode || '').toLowerCase()) >= 0
|
|
12560
12566
|
? String(mode).toLowerCase()
|
|
12561
12567
|
: 'build';
|
|
12562
12568
|
state.mode = nextMode;
|
|
@@ -16524,6 +16530,57 @@ var _terminalCounter = 0;
|
|
|
16524
16530
|
var _terminalTakeoverTabs = {};
|
|
16525
16531
|
var _terminalTakeoverRefreshToken = 0;
|
|
16526
16532
|
var _terminalTakeoverDetached = {};
|
|
16533
|
+
var _terminalOutputLimit = 256 * 1024;
|
|
16534
|
+
|
|
16535
|
+
window.appendTerminalOutput = function(output, text, style) {
|
|
16536
|
+
if (!output || !text) return;
|
|
16537
|
+
var state = output._terminalRenderState;
|
|
16538
|
+
if (!state) state = output._terminalRenderState = { pending: [], frame: 0 };
|
|
16539
|
+
state.pending.push({ text: String(text), style: style || null });
|
|
16540
|
+
if (state.frame) return;
|
|
16541
|
+
state.frame = requestAnimationFrame(function() {
|
|
16542
|
+
state.frame = 0;
|
|
16543
|
+
if (!output.isConnected) { state.pending.length = 0; return; }
|
|
16544
|
+
var nearBottom = output.scrollHeight - output.scrollTop - output.clientHeight <= 32;
|
|
16545
|
+
var fragment = document.createDocumentFragment();
|
|
16546
|
+
for (var i = 0; i < state.pending.length; i++) {
|
|
16547
|
+
var item = state.pending[i];
|
|
16548
|
+
if (item.style) {
|
|
16549
|
+
var span = document.createElement('span');
|
|
16550
|
+
span.textContent = item.text;
|
|
16551
|
+
if (item.style.color) span.style.color = item.style.color;
|
|
16552
|
+
if (item.style.opacity) span.style.opacity = item.style.opacity;
|
|
16553
|
+
fragment.appendChild(span);
|
|
16554
|
+
} else {
|
|
16555
|
+
fragment.appendChild(document.createTextNode(item.text));
|
|
16556
|
+
}
|
|
16557
|
+
}
|
|
16558
|
+
state.pending.length = 0;
|
|
16559
|
+
output.appendChild(fragment);
|
|
16560
|
+
var overflow = output.textContent.length - _terminalOutputLimit;
|
|
16561
|
+
while (overflow > 0 && output.firstChild) {
|
|
16562
|
+
var first = output.firstChild;
|
|
16563
|
+
var length = first.textContent.length;
|
|
16564
|
+
if (length <= overflow) {
|
|
16565
|
+
output.removeChild(first);
|
|
16566
|
+
overflow -= length;
|
|
16567
|
+
} else {
|
|
16568
|
+
first.textContent = first.textContent.slice(overflow);
|
|
16569
|
+
overflow = 0;
|
|
16570
|
+
}
|
|
16571
|
+
}
|
|
16572
|
+
if (nearBottom) output.scrollTop = output.scrollHeight;
|
|
16573
|
+
});
|
|
16574
|
+
};
|
|
16575
|
+
|
|
16576
|
+
window.setTerminalOutput = function(output, text, style) {
|
|
16577
|
+
if (!output) return;
|
|
16578
|
+
var state = output._terminalRenderState;
|
|
16579
|
+
if (state && state.frame) cancelAnimationFrame(state.frame);
|
|
16580
|
+
output._terminalRenderState = { pending: [], frame: 0 };
|
|
16581
|
+
output.textContent = '';
|
|
16582
|
+
window.appendTerminalOutput(output, text, style);
|
|
16583
|
+
};
|
|
16527
16584
|
|
|
16528
16585
|
window.portableTerminalWorkspacePath = function(input) {
|
|
16529
16586
|
var raw = String(input || '').trim().replace(/\\/g, '/').replace(/\/+$/g, '');
|
|
@@ -16606,14 +16663,14 @@ window.terminalSend = function() {
|
|
|
16606
16663
|
if (takeoverSession) {
|
|
16607
16664
|
input.value = '';
|
|
16608
16665
|
if (!api.terminalTakeoverWrite) {
|
|
16609
|
-
if (output) output
|
|
16666
|
+
if (output) window.appendTerminalOutput(output, '\r\n[' + t('terminal.notConnected') + ']', { color:'#ff6666' });
|
|
16610
16667
|
return;
|
|
16611
16668
|
}
|
|
16612
16669
|
var takeoverConversation = pane.getAttribute('data-takeover-conversation') || activeConversationId();
|
|
16613
16670
|
api.terminalTakeoverWrite(takeoverSession, cmd, takeoverConversation).then(function(result) {
|
|
16614
16671
|
if (result && result.ok === false) throw new Error(result.error || 'Terminal write failed');
|
|
16615
16672
|
}).catch(function(err) {
|
|
16616
|
-
if (output) output
|
|
16673
|
+
if (output) window.appendTerminalOutput(output, '\r\n[' + t('common.error') + '] ' + err.message, { color:'#ff6666' });
|
|
16617
16674
|
});
|
|
16618
16675
|
return;
|
|
16619
16676
|
}
|
|
@@ -16632,12 +16689,12 @@ window.terminalSend = function() {
|
|
|
16632
16689
|
input.disabled = false;
|
|
16633
16690
|
var currentPane = window.getActiveTerminalPane();
|
|
16634
16691
|
var currentOutput = (currentPane && currentPane.querySelector('.terminal-output')) || output;
|
|
16635
|
-
if (currentOutput) currentOutput
|
|
16692
|
+
if (currentOutput) window.appendTerminalOutput(currentOutput, '\r\n[' + t('common.error') + '] ' + (err.message || String(err)), { color:'#ff6666' });
|
|
16636
16693
|
});
|
|
16637
16694
|
}
|
|
16638
16695
|
input.value = '';
|
|
16639
16696
|
api.terminalWrite(sessionId, cmd + '\r').catch(function(err) {
|
|
16640
|
-
if (output) output
|
|
16697
|
+
if (output) window.appendTerminalOutput(output, '\r\n[' + t('common.error') + '] ' + err.message, { color:'#ff6666' });
|
|
16641
16698
|
});
|
|
16642
16699
|
};
|
|
16643
16700
|
|
|
@@ -16651,7 +16708,7 @@ window.clearTerminal = function() {
|
|
|
16651
16708
|
api.terminalKill(sessionId, state.terminalInterruptTimeoutMs || 0).catch(function(){});
|
|
16652
16709
|
pane.setAttribute('data-session', '');
|
|
16653
16710
|
}
|
|
16654
|
-
if (output) output
|
|
16711
|
+
if (output) window.setTerminalOutput(output, '');
|
|
16655
16712
|
if (prompt) prompt.textContent = '>';
|
|
16656
16713
|
};
|
|
16657
16714
|
|
|
@@ -16761,12 +16818,12 @@ window.addTerminalTab = function(shellId, options) {
|
|
|
16761
16818
|
var terminalReadyPromise = terminalSpawnPromise.then(function(resp) {
|
|
16762
16819
|
pane.setAttribute('data-session', resp.sessionId);
|
|
16763
16820
|
var out = pane.querySelector('.terminal-output');
|
|
16764
|
-
if (out)
|
|
16821
|
+
if (out) window.setTerminalOutput(out, t('terminal.connected') + ' (' + shellId + ')\r\n', { color:'var(--accent2)' });
|
|
16765
16822
|
state._terminalActiveSession = resp.sessionId;
|
|
16766
16823
|
return resp;
|
|
16767
16824
|
}).catch(function(err) {
|
|
16768
16825
|
var out = pane.querySelector('.terminal-output');
|
|
16769
|
-
if (out) out
|
|
16826
|
+
if (out) window.setTerminalOutput(out, t('terminal.failed') + ': ' + err.message, { color:'#ff6666' });
|
|
16770
16827
|
if (options.required === true) throw err;
|
|
16771
16828
|
return null;
|
|
16772
16829
|
});
|
|
@@ -16881,13 +16938,12 @@ window.applyTerminalTakeoverEvent = function(payload) {
|
|
|
16881
16938
|
var output = pane.querySelector('.terminal-output');
|
|
16882
16939
|
if (!output) return;
|
|
16883
16940
|
if (payload.type === 'started' && session.buffer) {
|
|
16884
|
-
output
|
|
16941
|
+
window.setTerminalOutput(output, session.buffer);
|
|
16885
16942
|
} else if (payload.data) {
|
|
16886
|
-
output
|
|
16943
|
+
window.appendTerminalOutput(output, payload.data);
|
|
16887
16944
|
} else if (payload.type === 'stopped') {
|
|
16888
|
-
output
|
|
16945
|
+
window.appendTerminalOutput(output, '\r\n[Agent takeover stopped]', { color:'var(--text-dim)', opacity:'0.65' });
|
|
16889
16946
|
}
|
|
16890
|
-
output.scrollTop = output.scrollHeight;
|
|
16891
16947
|
if (!active) window.pruneTerminalTakeoverEndedPanes(session.id);
|
|
16892
16948
|
};
|
|
16893
16949
|
|
|
@@ -17007,16 +17063,14 @@ if (api.onTerminalData) {
|
|
|
17007
17063
|
.replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)/g, '')
|
|
17008
17064
|
.replace(/\x1b\[[0-?]*[ -\/]*[@-~]/g, '')
|
|
17009
17065
|
.replace(/\r(?!\n)/g, '');
|
|
17010
|
-
|
|
17011
|
-
output.innerHTML += text;
|
|
17012
|
-
output.scrollTop = output.scrollHeight;
|
|
17066
|
+
window.appendTerminalOutput(output, clean);
|
|
17013
17067
|
});
|
|
17014
17068
|
api.onTerminalExit(function(event, sessionId, code) {
|
|
17015
17069
|
var pane = document.querySelector('.terminal-pane[data-session="' + sessionId + '"]');
|
|
17016
17070
|
if (!pane) return;
|
|
17017
17071
|
pane.setAttribute('data-session', '');
|
|
17018
17072
|
var output = pane.querySelector('.terminal-output');
|
|
17019
|
-
if (output) output
|
|
17073
|
+
if (output) window.appendTerminalOutput(output, '\r\n[Process exited code=' + code + ']', { color:'var(--text-dim)', opacity:'0.5' });
|
|
17020
17074
|
});
|
|
17021
17075
|
}
|
|
17022
17076
|
|