@bolloon/bolloon-agent 0.3.5 → 0.3.6
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/loading-tui.js +0 -6
- package/dist/index.js +6 -100
- package/dist/web/client.js +27 -13
- package/dist/web/server.js +4 -0
- package/dist/web/ui/message-renderer.js +6 -9
- package/package.json +1 -1
package/dist/cli/loading-tui.js
CHANGED
|
@@ -90,12 +90,6 @@ export class LoadingTUI {
|
|
|
90
90
|
this.write(` ${STEP_SYMBOL[step.status]} ${step.label}\n`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
if (this.ok) {
|
|
94
|
-
this.write(` ${GREEN}✓${RESET} ${CYAN}Bolloon${RESET} ${GRAY}ready${RESET}\n`);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.write(` ${RED}✗${RESET} ${CYAN}Bolloon${RESET} ${GRAY}startup failed${RESET}\n`);
|
|
98
|
-
}
|
|
99
93
|
this.write(SHOW);
|
|
100
94
|
}
|
|
101
95
|
isFinished() {
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import { createSubAgentManager } from './agents/subagent-manager.js';
|
|
|
12
12
|
import { getGlobalSharedContext } from './social/global-shared-context.js';
|
|
13
13
|
import { createBollharnessIntegration } from './bollharness-integration/index.js';
|
|
14
14
|
import * as readline from 'readline';
|
|
15
|
-
import { LoadingTUI } from './cli/loading-tui.js';
|
|
16
15
|
// 启动时自动检查更新已禁用 (改用 --update-check / --update-now 显式触发)
|
|
17
16
|
import { createRequire } from 'module';
|
|
18
17
|
const _require = createRequire(import.meta.url);
|
|
@@ -43,7 +42,7 @@ const HIDE_CURSOR = '\x1b[?25l';
|
|
|
43
42
|
const SHOW_CURSOR = '\x1b[?25h';
|
|
44
43
|
const s = {
|
|
45
44
|
banner: () => {
|
|
46
|
-
const verStr = `
|
|
45
|
+
const verStr = `v${_BOLLOON_VERSION}`;
|
|
47
46
|
const pad = Math.max(0, 39 - 17 - verStr.length);
|
|
48
47
|
const spaces = ' '.repeat(pad);
|
|
49
48
|
console.log(`\n${CYAN}${BOLD}
|
|
@@ -1810,7 +1809,6 @@ function printHelp() {
|
|
|
1810
1809
|
// Entry point
|
|
1811
1810
|
// ---------------------------------------------------------------------------
|
|
1812
1811
|
async function main() {
|
|
1813
|
-
let loading = null;
|
|
1814
1812
|
try {
|
|
1815
1813
|
const args = parseArgs();
|
|
1816
1814
|
if (args.help) {
|
|
@@ -1823,56 +1821,21 @@ async function main() {
|
|
|
1823
1821
|
// 想完全屏蔽 (CI / sandbox): BOLLOON_SKIP_UPDATE=true
|
|
1824
1822
|
const mode = args.web ? 'web' : 'cli';
|
|
1825
1823
|
const isNonInteractive = !!(args.tool || args.prompt);
|
|
1826
|
-
const isTuiMode = mode === 'cli' && !isNonInteractive && args.tui;
|
|
1827
1824
|
const originalLog = console.log;
|
|
1828
1825
|
const originalInfo = console.info;
|
|
1829
1826
|
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
1830
1827
|
const isSdkLog = (msg) => {
|
|
1831
1828
|
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(msg);
|
|
1832
1829
|
};
|
|
1833
|
-
// CLI interactive mode: suppress all startup output, show minimal spinner
|
|
1834
1830
|
const isCLIInteractive = mode === 'cli' && !isNonInteractive;
|
|
1835
|
-
|
|
1836
|
-
if (loading) {
|
|
1837
|
-
loading.setSteps([
|
|
1838
|
-
'LLM provider 检测',
|
|
1839
|
-
'DIAP 身份生成',
|
|
1840
|
-
'DID 发布到 IPFS',
|
|
1841
|
-
'P2P 网络启动',
|
|
1842
|
-
'iroh transport 启动',
|
|
1843
|
-
'Bolloon 上下文 bootstrap',
|
|
1844
|
-
'Web 服务启动',
|
|
1845
|
-
]);
|
|
1846
|
-
loading.start('启动中...');
|
|
1831
|
+
if (isCLIInteractive) {
|
|
1847
1832
|
console.log = () => { };
|
|
1848
1833
|
console.info = () => { };
|
|
1849
1834
|
process.stdout.write = () => true;
|
|
1850
1835
|
}
|
|
1851
|
-
else if (isTuiMode) {
|
|
1852
|
-
console.log = (...args) => {
|
|
1853
|
-
const msg = args.join(' ');
|
|
1854
|
-
if (isSdkLog(msg))
|
|
1855
|
-
return;
|
|
1856
|
-
originalLog.apply(console, args);
|
|
1857
|
-
};
|
|
1858
|
-
console.info = (...args) => {
|
|
1859
|
-
const msg = args.join(' ');
|
|
1860
|
-
if (isSdkLog(msg))
|
|
1861
|
-
return;
|
|
1862
|
-
originalInfo.apply(console, args);
|
|
1863
|
-
};
|
|
1864
|
-
process.stdout.write = (chunk, ...args) => {
|
|
1865
|
-
const msg = String(chunk);
|
|
1866
|
-
if (isSdkLog(msg))
|
|
1867
|
-
return true;
|
|
1868
|
-
return originalStdoutWrite(chunk, ...args);
|
|
1869
|
-
};
|
|
1870
|
-
}
|
|
1871
1836
|
if (isNonInteractive) {
|
|
1872
1837
|
console.error = () => { };
|
|
1873
1838
|
}
|
|
1874
|
-
s.banner();
|
|
1875
|
-
s.section('系统初始化');
|
|
1876
1839
|
const hasOpenAI = !!process.env.OPENAI_API_KEY;
|
|
1877
1840
|
// 2026-06-15: 修复 — 之前 anthropic 401 是因为 shell env 残留的旧 ANTHROPIC_API_KEY 抢了 provider 选择
|
|
1878
1841
|
// 用 BOLLOON_LLM_PROVIDER env 显式覆盖, 否则还是按 env hasXxx 顺序自动选
|
|
@@ -1896,32 +1859,21 @@ async function main() {
|
|
|
1896
1859
|
hasGlm ? 'GLM' :
|
|
1897
1860
|
hasQwen ? 'Qwen' : null;
|
|
1898
1861
|
if (llmProvider) {
|
|
1899
|
-
s.step(0, 4, `LLM: ${llmProvider}`, 'ok');
|
|
1900
|
-
loading?.completeStep(0, 'ok', `LLM: ${llmProvider}`);
|
|
1901
1862
|
initMinimax({ provider: llmProvider.toLowerCase() });
|
|
1902
1863
|
}
|
|
1903
1864
|
else {
|
|
1904
|
-
s.step(0, 4, 'LLM: 未配置', 'warn');
|
|
1905
|
-
loading?.completeStep(0, 'warn', 'LLM: 未配置');
|
|
1906
1865
|
if (isNonInteractive) {
|
|
1907
1866
|
s.warn('未设置任何 LLM API Key,功能受限');
|
|
1908
1867
|
}
|
|
1909
1868
|
}
|
|
1910
|
-
loading?.startStep(1, '生成 DIAP 身份...');
|
|
1911
1869
|
const { keypair, did, name } = await bootstrapIdentity();
|
|
1912
1870
|
agentIdentity = { did, name, publicKey: Buffer.from(keypair.publicKey).toString('hex') };
|
|
1913
|
-
loading?.completeStep(1, 'ok', `身份 ${name}`);
|
|
1914
|
-
loading?.startStep(2, '发布 DID 到 IPFS...');
|
|
1915
1871
|
publishDID(name, keypair).then(({ cid, ipnsName }) => {
|
|
1916
1872
|
if (cid)
|
|
1917
1873
|
agentIdentity.cid = cid;
|
|
1918
1874
|
if (ipnsName)
|
|
1919
1875
|
agentIdentity.ipnsName = ipnsName;
|
|
1920
|
-
|
|
1921
|
-
}).catch(() => {
|
|
1922
|
-
loading?.completeStep(2, 'warn', 'DID 本地模式');
|
|
1923
|
-
});
|
|
1924
|
-
loading?.startStep(3, '启动 P2P 网络...');
|
|
1876
|
+
}).catch(() => { });
|
|
1925
1877
|
const verifier = createVerificationManager();
|
|
1926
1878
|
let comm = null;
|
|
1927
1879
|
try {
|
|
@@ -1933,9 +1885,7 @@ async function main() {
|
|
|
1933
1885
|
agentIdentity.peerId = connections[0].publicKey;
|
|
1934
1886
|
agentIdentity.p2pChannel = 'bolloon-agent-harness';
|
|
1935
1887
|
}
|
|
1936
|
-
loading?.completeStep(3, 'ok', 'P2P 已连接');
|
|
1937
1888
|
}).catch(err => {
|
|
1938
|
-
loading?.completeStep(3, 'warn', 'P2P Web 模式启动失败');
|
|
1939
1889
|
s.warn(`P2P Web 模式启动失败: ${err.message}`);
|
|
1940
1890
|
});
|
|
1941
1891
|
}
|
|
@@ -1946,32 +1896,24 @@ async function main() {
|
|
|
1946
1896
|
agentIdentity.peerId = connections[0].publicKey;
|
|
1947
1897
|
agentIdentity.p2pChannel = 'bolloon-agent-harness';
|
|
1948
1898
|
}
|
|
1949
|
-
loading?.completeStep(3, 'ok', 'P2P 已连接');
|
|
1950
1899
|
}
|
|
1951
1900
|
}
|
|
1952
1901
|
catch (err) {
|
|
1953
1902
|
s.warn(`P2P 初始化失败: ${err.message}`);
|
|
1954
1903
|
s.warn('将使用无 P2P 模式运行');
|
|
1955
|
-
loading?.completeStep(3, 'error', 'P2P 初始化失败');
|
|
1956
1904
|
}
|
|
1957
|
-
loading?.startStep(4, '启动 iroh transport...');
|
|
1958
1905
|
await bootstrapIroh(keypair, name);
|
|
1959
|
-
loading?.completeStep(4, 'ok', 'iroh 已就绪');
|
|
1960
1906
|
// Bolloon Bootstrap: 启动扫描 + Context 收集 + 挂定时任务
|
|
1961
1907
|
// 失败静默 (主流程不被阻塞)
|
|
1962
|
-
loading?.startStep(5, '正在 bootstrap bolloon 上下文...');
|
|
1963
1908
|
try {
|
|
1964
1909
|
const { bootstrapBolloon } = await import('./pi-ecosystem-judgment/human-value-pipeline.js');
|
|
1965
1910
|
s.info('正在 bootstrap bolloon 上下文...');
|
|
1966
1911
|
const bs = await bootstrapBolloon({ cwd: process.cwd() });
|
|
1967
1912
|
s.info(`Bootstrap 完成 (${bs.durationMs}ms, ${bs.errors.length} 个非致命错误)`);
|
|
1968
|
-
loading?.completeStep(5, 'ok', `Bootstrap 完成 (${bs.durationMs}ms)`);
|
|
1969
1913
|
}
|
|
1970
1914
|
catch (err) {
|
|
1971
1915
|
s.warn(`Bootstrap 失败 (非致命, 主流程继续): ${err.message}`);
|
|
1972
|
-
loading?.completeStep(5, 'warn', 'Bootstrap 失败 (已跳过)');
|
|
1973
1916
|
}
|
|
1974
|
-
s.divider();
|
|
1975
1917
|
if (mode === 'web') {
|
|
1976
1918
|
const port = parseInt(process.env.PORT || '54188');
|
|
1977
1919
|
// 2026-06-16: BOLLOON_DEV_MODE=1 或 selfImprove=true 启动项 → 开发者模式, 启用自迭代 (健康监控+自改总线)
|
|
@@ -1981,12 +1923,9 @@ async function main() {
|
|
|
1981
1923
|
console.log('[startup] BOLLOON_DEV_MODE=1, 开发者模式: 自迭代已启用');
|
|
1982
1924
|
}
|
|
1983
1925
|
const { createWebServer, openBrowser } = await import('./web/server.js');
|
|
1984
|
-
loading?.startStep(6, `启动 Web 服务端口 ${port}...`);
|
|
1985
|
-
s.info(`启动 Web 服务端口 ${port}...`);
|
|
1986
1926
|
// 2026-06-24: CLI 默认 loopback bind (安全), LAN 访问需 BOLLOON_HOST=0.0.0.0
|
|
1987
1927
|
const bindHost = process.env.BOLLOON_HOST;
|
|
1988
1928
|
const { port: actualPort } = await createWebServer(port, { selfImprove, ...(bindHost ? { host: bindHost } : {}) });
|
|
1989
|
-
loading?.completeStep(6, 'ok', `Web 服务 :${actualPort}`);
|
|
1990
1929
|
const displayHost = bindHost ?? '127.0.0.1';
|
|
1991
1930
|
s.success(`浏览器已打开 → http://${displayHost}:${actualPort}`);
|
|
1992
1931
|
openBrowser(`http://${displayHost}:${actualPort}`);
|
|
@@ -2005,46 +1944,13 @@ async function main() {
|
|
|
2005
1944
|
}
|
|
2006
1945
|
}
|
|
2007
1946
|
else {
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
console.info = originalInfo;
|
|
2012
|
-
process.stdout.write = originalStdoutWrite;
|
|
2013
|
-
loading.stop(true);
|
|
2014
|
-
}
|
|
2015
|
-
else {
|
|
2016
|
-
// For non-loading TUI CLI mode: apply SDK filtering if needed
|
|
2017
|
-
if (isTuiMode) {
|
|
2018
|
-
console.log = (...args) => {
|
|
2019
|
-
const msg = args.join(' ');
|
|
2020
|
-
if (isSdkLog(msg))
|
|
2021
|
-
return;
|
|
2022
|
-
originalLog.apply(console, args);
|
|
2023
|
-
};
|
|
2024
|
-
console.info = (...args) => {
|
|
2025
|
-
const msg = args.join(' ');
|
|
2026
|
-
if (isSdkLog(msg))
|
|
2027
|
-
return;
|
|
2028
|
-
originalInfo.apply(console, args);
|
|
2029
|
-
};
|
|
2030
|
-
process.stdout.write = (chunk, ...args) => {
|
|
2031
|
-
const msg = String(chunk);
|
|
2032
|
-
if (isSdkLog(msg))
|
|
2033
|
-
return true;
|
|
2034
|
-
return originalStdoutWrite(chunk, ...args);
|
|
2035
|
-
};
|
|
2036
|
-
}
|
|
2037
|
-
else {
|
|
2038
|
-
console.log = originalLog;
|
|
2039
|
-
console.info = originalInfo;
|
|
2040
|
-
process.stdout.write = originalStdoutWrite;
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
1947
|
+
console.log = originalLog;
|
|
1948
|
+
console.info = originalInfo;
|
|
1949
|
+
process.stdout.write = originalStdoutWrite;
|
|
2043
1950
|
startCLI(comm);
|
|
2044
1951
|
}
|
|
2045
1952
|
}
|
|
2046
1953
|
catch (e) {
|
|
2047
|
-
loading?.stop(false);
|
|
2048
1954
|
throw e;
|
|
2049
1955
|
}
|
|
2050
1956
|
}
|
package/dist/web/client.js
CHANGED
|
@@ -871,8 +871,8 @@
|
|
|
871
871
|
cleanContent = cleanContent.substring(0, finalGenIdx).trim();
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
const
|
|
875
|
-
const segments = segmentChatReply(cleanContent, { knownToolNames });
|
|
874
|
+
const knownToolNames2 = ctx && ctx.knownToolNames || /* @__PURE__ */ new Set();
|
|
875
|
+
const segments = segmentChatReply(cleanContent, { knownToolNames: knownToolNames2 });
|
|
876
876
|
if (segments.length === 0) {
|
|
877
877
|
return;
|
|
878
878
|
}
|
|
@@ -1096,6 +1096,7 @@
|
|
|
1096
1096
|
streamingText = "";
|
|
1097
1097
|
mountStepTimeline(streamingMessageEl, currentChannelId2);
|
|
1098
1098
|
container.appendChild(streamingMessageEl);
|
|
1099
|
+
flushStepEventBuffer(currentChannelId2, ctx);
|
|
1099
1100
|
if (typeof ctx.setTimelineState === "function") {
|
|
1100
1101
|
ctx.setTimelineState("streaming");
|
|
1101
1102
|
}
|
|
@@ -1144,16 +1145,12 @@
|
|
|
1144
1145
|
if (!data || !data.type) return;
|
|
1145
1146
|
let target = streamingMessageEl && streamingMessageEl.isConnected ? streamingMessageEl : null;
|
|
1146
1147
|
if (!target) {
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
buf.push(data);
|
|
1152
|
-
stepEventBuffer.set(currentChannelId2, buf);
|
|
1153
|
-
}
|
|
1154
|
-
return;
|
|
1148
|
+
if (currentChannelId2) {
|
|
1149
|
+
const buf = stepEventBuffer.get(currentChannelId2) || [];
|
|
1150
|
+
buf.push(data);
|
|
1151
|
+
stepEventBuffer.set(currentChannelId2, buf);
|
|
1155
1152
|
}
|
|
1156
|
-
|
|
1153
|
+
return;
|
|
1157
1154
|
}
|
|
1158
1155
|
if (!target) return;
|
|
1159
1156
|
const timeline = getStepTimeline(target);
|
|
@@ -1459,20 +1456,25 @@
|
|
|
1459
1456
|
return {};
|
|
1460
1457
|
}
|
|
1461
1458
|
var MR_addMessage = (...args) => _getMR().addMessage?.(...args);
|
|
1459
|
+
var MR_handleStreamTokenEvent = (...args) => _getMR().handleStreamTokenEvent?.(...args);
|
|
1462
1460
|
var MR_finalizeTimelineAsMessage = (...args) => _getMR().finalizeTimelineAsMessage?.(...args);
|
|
1463
1461
|
var MR_handleStepEvent = (...args) => _getMR().handleStepEvent?.(...args);
|
|
1464
1462
|
var MR_escapeHtml = (s) => _getMR().escapeHtml?.(s);
|
|
1465
1463
|
var MR_hasStreamingText = () => _getMR().hasStreamingText?.() ?? false;
|
|
1466
1464
|
var MR_replaceStreamingText = (text) => _getMR().replaceStreamingText?.(text);
|
|
1467
1465
|
var MR_injectRecoveredText = (text, ctx) => _getMR().injectRecoveredText?.(text, ctx ?? getRendererCtx());
|
|
1466
|
+
var knownToolNames = /* @__PURE__ */ new Set();
|
|
1468
1467
|
function getRendererCtx() {
|
|
1469
1468
|
return {
|
|
1470
1469
|
messagesEl,
|
|
1471
1470
|
messagesContainers,
|
|
1472
1471
|
currentChannelId,
|
|
1473
1472
|
lastUsedJudgmentIds,
|
|
1473
|
+
knownToolNames,
|
|
1474
|
+
toolCallCallback: (tool, _hostEl) => {
|
|
1475
|
+
console.log("[toolCall]", tool.name, tool.args);
|
|
1476
|
+
},
|
|
1474
1477
|
openJudgmentsModalWithFilter
|
|
1475
|
-
// 引用 client.js 函数, 通过参数注入避免循环 import
|
|
1476
1478
|
};
|
|
1477
1479
|
}
|
|
1478
1480
|
var messagesEl = document.getElementById("messages");
|
|
@@ -2313,6 +2315,9 @@ ${data.error || "channel not found"}`, "error");
|
|
|
2313
2315
|
function addMessage2(content, type, save = true, container, usedJudgmentIds = [], timestamp = void 0) {
|
|
2314
2316
|
return MR_addMessage(content, type, save, container, usedJudgmentIds, getRendererCtx(), timestamp);
|
|
2315
2317
|
}
|
|
2318
|
+
function handleStreamTokenEvent2(data) {
|
|
2319
|
+
return MR_handleStreamTokenEvent(data, getRendererCtx());
|
|
2320
|
+
}
|
|
2316
2321
|
function finalizeTimelineAsMessage2() {
|
|
2317
2322
|
return MR_finalizeTimelineAsMessage(getRendererCtx());
|
|
2318
2323
|
}
|
|
@@ -2595,7 +2600,7 @@ ${data.error || "channel not found"}`, "error");
|
|
|
2595
2600
|
currentPreviewBubble = newPreview;
|
|
2596
2601
|
}
|
|
2597
2602
|
} else if (data.type === "stream") {
|
|
2598
|
-
|
|
2603
|
+
handleStreamTokenEvent2(data);
|
|
2599
2604
|
} else if (data.type === "regenerating") {
|
|
2600
2605
|
const messages = container.querySelectorAll(".message-ai");
|
|
2601
2606
|
if (messages.length > 0) {
|
|
@@ -3379,6 +3384,15 @@ ${data.error || "channel not found"}`, "error");
|
|
|
3379
3384
|
if (!themeData.agentId) {
|
|
3380
3385
|
await saveTheme(themeData.theme, currentAgentId);
|
|
3381
3386
|
}
|
|
3387
|
+
try {
|
|
3388
|
+
const res = await fetch("/api/tools");
|
|
3389
|
+
if (res.ok) {
|
|
3390
|
+
const toolIds = await res.json();
|
|
3391
|
+
knownToolNames = new Set(toolIds);
|
|
3392
|
+
}
|
|
3393
|
+
} catch (e) {
|
|
3394
|
+
console.warn("[init] \u83B7\u53D6\u5DE5\u5177\u5217\u8868\u5931\u8D25:", e);
|
|
3395
|
+
}
|
|
3382
3396
|
await loadChannels();
|
|
3383
3397
|
await checkApiConfig();
|
|
3384
3398
|
if (channels.length > 0) {
|
package/dist/web/server.js
CHANGED
|
@@ -9,6 +9,7 @@ import * as os from 'os';
|
|
|
9
9
|
import * as crypto from 'crypto';
|
|
10
10
|
import { validateMessageInput, validateChannelInput, healthCheck, } from './input-validator.js';
|
|
11
11
|
import { segmentChatReply } from '../agents/chat-segmenter.js';
|
|
12
|
+
import { listTools } from '../llm/tool-manifest/index.js';
|
|
12
13
|
import { registerJudgmentsRoutes } from './routes-judgments.js';
|
|
13
14
|
import { registerLlmConfigRoutes } from './routes-llm-config.js';
|
|
14
15
|
import { registerTaskRoutes } from './routes-tasks.js';
|
|
@@ -1964,6 +1965,9 @@ export async function createWebServer(port = 3000, options = {}) {
|
|
|
1964
1965
|
app.get('/api/health', (_req, res) => {
|
|
1965
1966
|
res.json(healthCheck(getPackageVersion()));
|
|
1966
1967
|
});
|
|
1968
|
+
app.get('/api/tools', (_req, res) => {
|
|
1969
|
+
res.json(listTools().map(t => t.id));
|
|
1970
|
+
});
|
|
1967
1971
|
// 2026-07-01 (v0.2.6): 前后端分离核心 — 后端切 LLM 输出为结构化 segments
|
|
1968
1972
|
// - POST /api/segment-reply { reply, knownTools }
|
|
1969
1973
|
// - 返回 ChatSegment[] (think / text / env_details / tool_call / final)
|
|
@@ -317,6 +317,7 @@ function handleStreamTokenEvent(data, ctx = { messagesEl: null, messagesContaine
|
|
|
317
317
|
streamingText = "";
|
|
318
318
|
mountStepTimeline(streamingMessageEl, currentChannelId);
|
|
319
319
|
container.appendChild(streamingMessageEl);
|
|
320
|
+
flushStepEventBuffer(currentChannelId, ctx);
|
|
320
321
|
if (typeof ctx.setTimelineState === "function") {
|
|
321
322
|
ctx.setTimelineState("streaming");
|
|
322
323
|
}
|
|
@@ -365,16 +366,12 @@ function handleStepEvent(data, ctx = { messagesEl: null, messagesContainers: /*
|
|
|
365
366
|
if (!data || !data.type) return;
|
|
366
367
|
let target = streamingMessageEl && streamingMessageEl.isConnected ? streamingMessageEl : null;
|
|
367
368
|
if (!target) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
buf.push(data);
|
|
373
|
-
stepEventBuffer.set(currentChannelId, buf);
|
|
374
|
-
}
|
|
375
|
-
return;
|
|
369
|
+
if (currentChannelId) {
|
|
370
|
+
const buf = stepEventBuffer.get(currentChannelId) || [];
|
|
371
|
+
buf.push(data);
|
|
372
|
+
stepEventBuffer.set(currentChannelId, buf);
|
|
376
373
|
}
|
|
377
|
-
|
|
374
|
+
return;
|
|
378
375
|
}
|
|
379
376
|
if (!target) return;
|
|
380
377
|
const timeline = getStepTimeline(target);
|