dsh-netchat 0.0.0-stage → 0.3.19
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/README.md +147 -2
- package/client/client.js +696 -0
- package/cordis.patch.yml +4 -0
- package/lib/host.mjs +234 -0
- package/lib/index.js +243 -0
- package/lib/runtime.mjs +9 -0
- package/lib/shared.mjs +28 -0
- package/package.json +34 -4
- package/shared/core/client.mjs +301 -0
- package/shared/core/consts.mjs +71 -0
- package/shared/core/datadir.mjs +92 -0
- package/shared/core/feishu-frame.mjs +190 -0
- package/shared/core/feishu.mjs +878 -0
- package/shared/core/hostbridge.mjs +115 -0
- package/shared/core/netchat.mjs +2542 -0
- package/shared/core/ops.mjs +803 -0
- package/shared/core/protocol.mjs +132 -0
- package/shared/core/util.mjs +184 -0
- package/shared/core/wsstream.mjs +204 -0
- package/shared/mcp/server.mjs +212 -0
- package/shared/skills/net-chat/SKILL.md +110 -0
- package/shared/ui/panel.html +2652 -0
package/client/client.js
ADDED
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
// NetChat for DeepSeek Harness, browser half.
|
|
2
|
+
//
|
|
3
|
+
// Written in the module-loader form dsh's client bundles use (the same shape as
|
|
4
|
+
// the official `decoration` template): no bundler, `require` only reaches the
|
|
5
|
+
// shared module table (React). It contributes three things to the window:
|
|
6
|
+
//
|
|
7
|
+
// 1. The **局域网 Agent / LAN Agents** panel in the left Sidebar, as it has
|
|
8
|
+
// always been: a main panel holding the panel's iframe and nothing else.
|
|
9
|
+
// 2. One page type to the right Sidebar (dsh 0.2.3), in two stages as every
|
|
10
|
+
// tab type does: the **未完成任务 / Open tasks** entry in that Sidebar's
|
|
11
|
+
// guide, and the page it opens — the list of open tasks above the same
|
|
12
|
+
// panel's iframe, the page's title carrying the count. A click on a row
|
|
13
|
+
// opens the task's session and has the panel below show the task.
|
|
14
|
+
// 3. One section in the Session panel (dsh 0.2.3), the fold-out panel the
|
|
15
|
+
// Session header's toggle opens: the open tasks as panel rows, this
|
|
16
|
+
// machine's unfinished work and the tasks the other side has not finished
|
|
17
|
+
// yet marked by dots of two colours. A dot on the toggle says so while the
|
|
18
|
+
// panel is closed. A click opens the task's session, then the left
|
|
19
|
+
// Sidebar's panel — the whole main column, not a strip of it — with the
|
|
20
|
+
// task, since the panel fills the window where a Sidebar page only takes
|
|
21
|
+
// a share.
|
|
22
|
+
//
|
|
23
|
+
// The two panels hold the same iframe: a sandboxed frame running the shared
|
|
24
|
+
// `ui/panel.html`, with this module acting as the MCP Apps host the panel
|
|
25
|
+
// already speaks to (JSON-RPC over postMessage). `tools/call` is forwarded to
|
|
26
|
+
// the host half's `/__netchat/call` route, so the panel runs unmodified.
|
|
27
|
+
//
|
|
28
|
+
// The Desktop build loads its page from `file://` and bridges `fetch` over IPC,
|
|
29
|
+
// where an `http://127.0.0.1` iframe src may not resolve. The panel therefore
|
|
30
|
+
// starts with a `src` and, if the panel never says hello, retries once with the
|
|
31
|
+
// page inline as `srcDoc`, which needs no origin at all.
|
|
32
|
+
window.__ModuleLoader__.load({
|
|
33
|
+
id: 'dsh-netchat',
|
|
34
|
+
factory(require) {
|
|
35
|
+
const React = require('react');
|
|
36
|
+
const { useEffect, useRef, useState, useCallback, useMemo } = React;
|
|
37
|
+
const h = React.createElement;
|
|
38
|
+
|
|
39
|
+
/** The left Sidebar's main panel: the key it is registered under, and its id in the Sidebar's list. */
|
|
40
|
+
const PANEL_ID = 'netchat';
|
|
41
|
+
/** Where the panel sits in the left Sidebar's list. */
|
|
42
|
+
const PANEL_ORDER = 5;
|
|
43
|
+
/** The tab type's id: the registry key, and the key its body and title are registered under. */
|
|
44
|
+
const TAB_TYPE_ID = 'dsh-netchat';
|
|
45
|
+
/** The kind `openTab` names; one page per pane. */
|
|
46
|
+
const TAB_KIND = 'netchat';
|
|
47
|
+
/**
|
|
48
|
+
* The name the task to show is passed to the right Sidebar's page under: `openTab(kind, { params })`
|
|
49
|
+
* hands `params` to the page as its navigation, which it reads when the panel has said hello.
|
|
50
|
+
*/
|
|
51
|
+
const TASK_PARAM = 'taskId';
|
|
52
|
+
/** Where the card sits in the guide: after the terminal (20). */
|
|
53
|
+
const GUIDE_ORDER = 30;
|
|
54
|
+
const GUIDE_ENTRY_ID = 'tasks';
|
|
55
|
+
const HELLO_TIMEOUT_MS = 4000;
|
|
56
|
+
/** What the host half calls this host; it goes with a call's meta, as the MCP server sends it. */
|
|
57
|
+
const HOST_LABEL = 'dsh';
|
|
58
|
+
const LABELS = { zh: '局域网 Agent', en: 'LAN Agents' };
|
|
59
|
+
const TASKS_LABEL = { zh: '未完成任务', en: 'Open tasks' };
|
|
60
|
+
const TASKS_DESCRIPTION = { zh: '局域网任务:收到的和发出去的,点一行跳到对应会话', en: 'LAN tasks, received and sent; a row opens its session' };
|
|
61
|
+
/** The section's id in the Session panel, and where it sits: after subagents (200), before background jobs (300). */
|
|
62
|
+
const SECTION_ID = 'netchat';
|
|
63
|
+
const SECTION_ORDER = 250;
|
|
64
|
+
/** The toggle's dot: its id in the Session panel, and where it stacks: below change requests' attention mark (100). */
|
|
65
|
+
const INDICATOR_ID = 'netchat.open';
|
|
66
|
+
const INDICATOR_ORDER = 90;
|
|
67
|
+
const log = (...args) => console.info('[netchat]', ...args);
|
|
68
|
+
|
|
69
|
+
function language(locale) {
|
|
70
|
+
const value = String(locale ?? '');
|
|
71
|
+
return /^zh\b/i.test(value) ? 'zh' : value ? 'en' : (/^zh/i.test(navigator.language) ? 'zh' : 'en');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const text = (table, locale) => table[locale] ?? table.zh;
|
|
75
|
+
|
|
76
|
+
/** The left Sidebar's icon for the panel; the Sidebar owns the button and the label around it. */
|
|
77
|
+
function PanelIcon({ size }) {
|
|
78
|
+
return h('svg', { viewBox: '0 0 24 24', width: size, height: size, fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true },
|
|
79
|
+
h('path', { d: 'M8 9h8M8 13h5' }),
|
|
80
|
+
h('path', { d: 'M4 5.5A1.5 1.5 0 0 1 5.5 4h13A1.5 1.5 0 0 1 20 5.5v9a1.5 1.5 0 0 1-1.5 1.5H9l-4 4v-4H5.5A1.5 1.5 0 0 1 4 14.5z' }));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ---- open tasks ----------------------------------------------------------------------------------
|
|
84
|
+
//
|
|
85
|
+
// The page title, the task board and the Session panel's section and dot all read one
|
|
86
|
+
// module-level store, so the tasks are fetched once however many places show them. It polls the host half's read-only
|
|
87
|
+
// `net_chat_open_tasks` op and follows `net_chat_poll` for changes in between; the
|
|
88
|
+
// first subscriber starts it and the last one gone stops it.
|
|
89
|
+
|
|
90
|
+
const POLL_INTERVAL_MS = 30_000;
|
|
91
|
+
const BADGE_MAX = 99;
|
|
92
|
+
|
|
93
|
+
const taskStore = {
|
|
94
|
+
listeners: new Set(),
|
|
95
|
+
tasks: [],
|
|
96
|
+
loaded: false,
|
|
97
|
+
origin: null,
|
|
98
|
+
timer: null,
|
|
99
|
+
polling: false,
|
|
100
|
+
getSnapshot: () => taskStore.tasks,
|
|
101
|
+
subscribe(listener) {
|
|
102
|
+
taskStore.listeners.add(listener);
|
|
103
|
+
if (!taskStore.origin) return () => taskStore.listeners.delete(listener);
|
|
104
|
+
taskStore.start();
|
|
105
|
+
return () => {
|
|
106
|
+
taskStore.listeners.delete(listener);
|
|
107
|
+
if (taskStore.listeners.size === 0) taskStore.stop();
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
start() {
|
|
111
|
+
if (taskStore.timer !== null) return;
|
|
112
|
+
taskStore.refresh();
|
|
113
|
+
taskStore.timer = setInterval(() => taskStore.refresh(), POLL_INTERVAL_MS);
|
|
114
|
+
// A long poll alongside: it returns as soon as anything changes, so the badge is
|
|
115
|
+
// usually right within a moment rather than waiting for the interval.
|
|
116
|
+
taskStore.follow();
|
|
117
|
+
},
|
|
118
|
+
stop() {
|
|
119
|
+
if (taskStore.timer !== null) clearInterval(taskStore.timer);
|
|
120
|
+
taskStore.timer = null;
|
|
121
|
+
},
|
|
122
|
+
emit() {
|
|
123
|
+
for (const listener of taskStore.listeners) listener();
|
|
124
|
+
},
|
|
125
|
+
async call(name, args = {}) {
|
|
126
|
+
const response = await fetch(`${taskStore.origin}/__netchat/call`, {
|
|
127
|
+
method: 'POST',
|
|
128
|
+
headers: { 'content-type': 'application/json' },
|
|
129
|
+
body: JSON.stringify({ name, arguments: args }),
|
|
130
|
+
});
|
|
131
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
132
|
+
return response.json();
|
|
133
|
+
},
|
|
134
|
+
async refresh() {
|
|
135
|
+
if (!taskStore.origin) return;
|
|
136
|
+
try {
|
|
137
|
+
const result = await taskStore.call('net_chat_open_tasks');
|
|
138
|
+
const tasks = Array.isArray(result?.structuredContent?.tasks) ? result.structuredContent.tasks : [];
|
|
139
|
+
taskStore.set(tasks);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
log('open tasks failed', error);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* One long poll at a time. Each call waits for an event newer than the last one
|
|
146
|
+
* seen (or the 20 s timeout), then the list is read again and the next call
|
|
147
|
+
* follows, so the badge is right within a moment of any change and reads the
|
|
148
|
+
* list three times a minute at most while nothing happens.
|
|
149
|
+
*/
|
|
150
|
+
async follow() {
|
|
151
|
+
if (!taskStore.origin) return;
|
|
152
|
+
if (taskStore.polling) return;
|
|
153
|
+
taskStore.polling = true;
|
|
154
|
+
let since = 0;
|
|
155
|
+
try {
|
|
156
|
+
while (taskStore.timer !== null) {
|
|
157
|
+
try {
|
|
158
|
+
const result = await taskStore.call('net_chat_poll', { since });
|
|
159
|
+
if (result?.isError) break;
|
|
160
|
+
// The cursor is kept so the next call waits instead of returning the
|
|
161
|
+
// whole log again at once; the list is re-read on every return, since
|
|
162
|
+
// a timeout may hide a change that landed just before it.
|
|
163
|
+
const seq = result?.structuredContent?.seq;
|
|
164
|
+
if (Number.isInteger(seq) && seq >= since) since = seq;
|
|
165
|
+
await taskStore.refresh();
|
|
166
|
+
} catch (error) {
|
|
167
|
+
log('poll failed', error);
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
} finally {
|
|
172
|
+
taskStore.polling = false;
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
set(tasks) {
|
|
176
|
+
taskStore.tasks = tasks;
|
|
177
|
+
taskStore.loaded = true;
|
|
178
|
+
taskStore.emit();
|
|
179
|
+
},
|
|
180
|
+
attach(origin) {
|
|
181
|
+
taskStore.origin = origin;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* The task the left Sidebar's panel was last asked to show, and the pages of it that are
|
|
187
|
+
* up. The panel is no session's, so the layout's `selectPanel` carries no navigation to
|
|
188
|
+
* hand it a task, as the right Sidebar's open does; the task is left here instead. A page
|
|
189
|
+
* that is up shows the ask at once. One that is not — the same click brings the panel to
|
|
190
|
+
* the front — shows it once the frame in it has said hello: a message posted before then
|
|
191
|
+
* is lost, the panel listening only from its hello on, and it starts blank each time it
|
|
192
|
+
* loads, so the last ask is what it is shown then.
|
|
193
|
+
*/
|
|
194
|
+
const panelTask = { id: null, listeners: new Set() };
|
|
195
|
+
|
|
196
|
+
/** Asks the left Sidebar's panel to show `taskId`: now where it is up, else when it comes up. */
|
|
197
|
+
function requestPanelTask(taskId) {
|
|
198
|
+
if (typeof taskId !== 'string' || !taskId) return;
|
|
199
|
+
panelTask.id = taskId;
|
|
200
|
+
for (const listener of panelTask.listeners) listener(taskId);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** The open tasks, fetched while anything shows them. Returns `[tasks, loaded]`. */
|
|
204
|
+
function useOpenTasks() {
|
|
205
|
+
const tasks = React.useSyncExternalStore(taskStore.subscribe, taskStore.getSnapshot, taskStore.getSnapshot);
|
|
206
|
+
return [tasks, taskStore.loaded];
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The page's title as its chip (and a floating panel's header) shows it: the name and,
|
|
211
|
+
* while anything is open, the count. A type with a live title registers here and reads its
|
|
212
|
+
* own store; the chip re-renders when the store changes.
|
|
213
|
+
*/
|
|
214
|
+
function TaskTitle({ locale }) {
|
|
215
|
+
const [tasks] = useOpenTasks();
|
|
216
|
+
if (tasks.length === 0) return text(LABELS, locale);
|
|
217
|
+
const count = tasks.length > BADGE_MAX ? `${BADGE_MAX}+` : String(tasks.length);
|
|
218
|
+
return `${text(TASKS_LABEL, locale)} (${count})`;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const ROW_STYLE = { display: 'flex', alignItems: 'center', gap: 8, padding: '6px 10px', border: 0, borderRadius: 6, background: 'transparent', textAlign: 'left', cursor: 'pointer', width: '100%', color: 'inherit', font: 'inherit' };
|
|
222
|
+
const ROW_TITLE_STYLE = { flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' };
|
|
223
|
+
|
|
224
|
+
// The Session panel sizes and places the toggle's dot itself (a 6px disc at the button's top right
|
|
225
|
+
// corner); a dot only names its colour, by what the task waits on: this machine's work, or the
|
|
226
|
+
// other side's. The row's dot is the same colour in a 16px box the panel gives the icon.
|
|
227
|
+
const DOT_COLORS = { in: 'var(--dsw-alias-state-business-primary)', out: 'var(--dsw-alias-state-warn-primary)' };
|
|
228
|
+
const DOT_STYLE = { width: 6, height: 6, borderRadius: '50%' };
|
|
229
|
+
/** Readable by assistive technology only; the visible row carries the same words in its text. */
|
|
230
|
+
const HIDDEN_TEXT_STYLE = { position: 'absolute', width: 1, height: 1, overflow: 'hidden', clipPath: 'inset(50%)', whiteSpace: 'nowrap' };
|
|
231
|
+
const DOT_LABELS = {
|
|
232
|
+
in: { zh: '本机未完成', en: 'open here' },
|
|
233
|
+
out: { zh: '对方未执行', en: 'sent, not done' },
|
|
234
|
+
};
|
|
235
|
+
/** The toggle's dot, named for assistive technology by what is open and how many. */
|
|
236
|
+
const INDICATOR_TEXT = {
|
|
237
|
+
in: (count, locale) => (locale === 'zh' ? `有 ${count} 个任务本机还没做完` : `${count} tasks open on this machine`),
|
|
238
|
+
out: (count, locale) => (locale === 'zh' ? `有 ${count} 个任务对方还没做完` : `${count} tasks the other side has not finished`),
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Re-render when the host's session status table changes, so a task's running mark follows
|
|
243
|
+
* the session. The table is read through the store, which `apply` binds to the service.
|
|
244
|
+
*/
|
|
245
|
+
function useSessionStatus() {
|
|
246
|
+
const status = taskStore.sessionStatus;
|
|
247
|
+
const subscribe = useCallback((listener) => (status?.subscribe ? status.subscribe(listener) : () => {}), [status]);
|
|
248
|
+
const getSnapshot = useCallback(() => status?.getSnapshot?.() ?? null, [status]);
|
|
249
|
+
return React.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* What both task lists say of one open task. `peer`: who it is from or to; `state`: the
|
|
254
|
+
* words for its state; `canJump`: its session lives on this host, so a click can open it.
|
|
255
|
+
*/
|
|
256
|
+
function taskRowModel(entry, status, locale) {
|
|
257
|
+
const lang = locale === 'zh' ? 'zh' : 'en';
|
|
258
|
+
const state = entry.questions > 0
|
|
259
|
+
? STATE_LABELS[lang].waiting
|
|
260
|
+
: sessionRunning(status, entry.sessionId)
|
|
261
|
+
? STATE_LABELS[lang].running
|
|
262
|
+
: STATE_LABELS[lang][entry.state] ?? entry.state;
|
|
263
|
+
return {
|
|
264
|
+
peer: modelPeer(entry, locale),
|
|
265
|
+
state,
|
|
266
|
+
// The session opens only when it lives on this host: an inbox task's session was
|
|
267
|
+
// started here; a sent task's is the one it was sent from. Both are this host's.
|
|
268
|
+
canJump: typeof entry.sessionId === 'string' && !!entry.sessionId,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** Who the task is from or to, in the reader's language. */
|
|
273
|
+
function modelPeer(entry, locale) {
|
|
274
|
+
return entry.direction === 'in'
|
|
275
|
+
? (locale === 'zh' ? `来自 ${entry.peer}` : `from ${entry.peer}`)
|
|
276
|
+
: (locale === 'zh' ? `发给 ${entry.peer}` : `to ${entry.peer}`);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* What a row's tooltip says. A task with a session here also jumps to it; one without is
|
|
281
|
+
* shown in the panel alone. The two lists name where the task is shown differently: the
|
|
282
|
+
* board is above its own frame, a section's row opens the left Sidebar's panel, which
|
|
283
|
+
* fills the main column.
|
|
284
|
+
*/
|
|
285
|
+
const BOARD_HINTS = {
|
|
286
|
+
jump: { zh: '打开会话,并在面板里显示这个任务', en: 'Open the session and show the task in the panel' },
|
|
287
|
+
local: { zh: '在面板里显示这个任务', en: 'Show the task in the panel' },
|
|
288
|
+
};
|
|
289
|
+
const SECTION_HINTS = {
|
|
290
|
+
jump: { zh: '打开会话,并在“局域网 Agent”面板里显示这个任务', en: 'Open the session and show the task in the LAN Agents panel' },
|
|
291
|
+
local: { zh: '在“局域网 Agent”面板里显示这个任务', en: 'Show the task in the LAN Agents panel' },
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The open tasks above the page's iframe: this machine's unfinished work and the tasks
|
|
296
|
+
* sent from here that the other side has not finished. A click does two things: it opens
|
|
297
|
+
* the task's session in the main column, and it has the panel below show the task — the
|
|
298
|
+
* conversation that holds it, with the task's drawer open. A row whose task has no session
|
|
299
|
+
* on this host still opens the task in the panel, so every row is a button.
|
|
300
|
+
*/
|
|
301
|
+
function TaskBoard({ locale, openSession, showTask }) {
|
|
302
|
+
const [tasks, loaded] = useOpenTasks();
|
|
303
|
+
const status = useSessionStatus();
|
|
304
|
+
const zh = locale === 'zh';
|
|
305
|
+
const rows = tasks.map((entry) => {
|
|
306
|
+
const { peer, state, canJump } = taskRowModel(entry, status, locale);
|
|
307
|
+
const pick = () => {
|
|
308
|
+
if (canJump) openSession(entry.sessionId);
|
|
309
|
+
showTask(entry.id);
|
|
310
|
+
};
|
|
311
|
+
const content = [
|
|
312
|
+
h('span', { key: 'title', style: ROW_TITLE_STYLE, title: entry.title }, entry.title),
|
|
313
|
+
h('span', { key: 'peer', style: { flex: 'none', opacity: 0.7 } }, `${peer} · ${state}`),
|
|
314
|
+
];
|
|
315
|
+
return h(
|
|
316
|
+
'button',
|
|
317
|
+
{
|
|
318
|
+
key: entry.id,
|
|
319
|
+
type: 'button',
|
|
320
|
+
style: canJump ? ROW_STYLE : { ...ROW_STYLE, cursor: 'default' },
|
|
321
|
+
title: text(canJump ? BOARD_HINTS.jump : BOARD_HINTS.local, locale),
|
|
322
|
+
onClick: pick,
|
|
323
|
+
},
|
|
324
|
+
content,
|
|
325
|
+
);
|
|
326
|
+
});
|
|
327
|
+
return h('section', { style: { flex: 'none', maxHeight: '40%', overflowY: 'auto', borderBottom: '1px solid var(--dsw-alias-border, rgba(127,127,127,0.3))' } },
|
|
328
|
+
h('div', { style: { padding: '8px 10px 4px', fontSize: 11, opacity: 0.6, letterSpacing: 0.2 } }, text(TASKS_LABEL, locale)),
|
|
329
|
+
rows.length > 0
|
|
330
|
+
? rows
|
|
331
|
+
: h('div', { style: { padding: '4px 10px 10px', fontSize: 12, opacity: 0.5 } }, loaded ? (zh ? '没有未完成的任务' : 'Nothing open') : (zh ? '加载中…' : 'Loading…')),
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** The words for a task's state, by the reader's language. `waiting` and `running` stand before the task's own state. */
|
|
336
|
+
const STATE_LABELS = {
|
|
337
|
+
zh: { waiting: '等你选择', running: '执行中', new: '待处理', accepted: '已接手', starting: '启动中', delivered: '已送达', done: '已完成', declined: '已拒绝', failed: '失败' },
|
|
338
|
+
en: { waiting: 'waiting for you', running: 'running', new: 'new', accepted: 'accepted', starting: 'starting', delivered: 'delivered', done: 'done', declined: 'declined', failed: 'failed' },
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
/** `true` while the session `id` is running, from the host's status table; false when unknown. */
|
|
342
|
+
function sessionRunning(status, id) {
|
|
343
|
+
return !!id && !!status && status.get?.(id)?.running === true;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The section in the Session panel: the open tasks as the panel's own rows, this machine's
|
|
348
|
+
* unfinished work first, then the tasks sent from here that the other side has not finished,
|
|
349
|
+
* each keeping its place in the list. A row's dot tells the two apart by colour. A click
|
|
350
|
+
* opens the task's session when it has one on this host, then the left Sidebar's panel —
|
|
351
|
+
* the whole main column — with the task, and in the floating panel, which covers the
|
|
352
|
+
* conversation, closes the panel as well. Nothing is shown — the title with the rest —
|
|
353
|
+
* while nothing is open: the panel hides an empty section.
|
|
354
|
+
*/
|
|
355
|
+
function NetchatSection({ locale, openSession, openTask, presentation, dismissOverlay }) {
|
|
356
|
+
const [tasks] = useOpenTasks();
|
|
357
|
+
const status = useSessionStatus();
|
|
358
|
+
if (tasks.length === 0) return null;
|
|
359
|
+
const rows = tasks
|
|
360
|
+
.map((entry) => ({ entry, kind: entry.direction === 'in' ? 'in' : 'out', model: taskRowModel(entry, status, locale) }))
|
|
361
|
+
.sort((a, b) => Number(b.kind === 'in') - Number(a.kind === 'in'))
|
|
362
|
+
.map(({ entry, kind, model }) => {
|
|
363
|
+
const pick = () => {
|
|
364
|
+
if (model.canJump) openSession(entry.sessionId);
|
|
365
|
+
openTask(entry.id);
|
|
366
|
+
if (presentation === 'overlay') dismissOverlay();
|
|
367
|
+
};
|
|
368
|
+
return h('div', { key: entry.id, 'data-session-panel-row': '' },
|
|
369
|
+
h('button', { type: 'button', 'data-row-part': 'body', title: text(model.canJump ? SECTION_HINTS.jump : SECTION_HINTS.local, locale), onClick: pick },
|
|
370
|
+
h('span', { 'data-row-part': 'icon', 'aria-hidden': true },
|
|
371
|
+
h('span', { style: { ...DOT_STYLE, background: DOT_COLORS[kind] } })),
|
|
372
|
+
h('span', { 'data-row-part': 'lines' },
|
|
373
|
+
h('span', { 'data-row-part': 'content', title: entry.title }, `${text(DOT_LABELS[kind], locale)} · ${entry.title}`),
|
|
374
|
+
h('span', { 'data-row-part': 'detail' }, `${model.peer} · ${model.state}`))));
|
|
375
|
+
});
|
|
376
|
+
return h('div', null, rows);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* The dot on the Session panel's toggle while the panel is closed and anything is open. The
|
|
381
|
+
* toggle places every dot at one spot, so one stands for all: this machine's work when any
|
|
382
|
+
* waits here, else the other side's. The dot is hidden while the panel is shown, where the
|
|
383
|
+
* rows themselves are in view.
|
|
384
|
+
*/
|
|
385
|
+
function NetchatIndicator({ locale, panelShown }) {
|
|
386
|
+
const [tasks] = useOpenTasks();
|
|
387
|
+
if (panelShown) return null;
|
|
388
|
+
const open = { in: 0, out: 0 };
|
|
389
|
+
for (const entry of tasks) {
|
|
390
|
+
if (entry.direction === 'in') open.in += 1;
|
|
391
|
+
else open.out += 1;
|
|
392
|
+
}
|
|
393
|
+
const kind = open.in > 0 ? 'in' : open.out > 0 ? 'out' : null;
|
|
394
|
+
if (kind === null) return null;
|
|
395
|
+
return h('span', { style: { background: DOT_COLORS[kind] } },
|
|
396
|
+
h('span', { style: HIDDEN_TEXT_STYLE }, INDICATOR_TEXT[kind](open[kind], locale)));
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** No session: what a frame outside every session's column knows about where it is. */
|
|
400
|
+
const NO_SESSION = Object.freeze({ sessionId: null });
|
|
401
|
+
|
|
402
|
+
/** The session a frame's column shows, as the stable object `PanelFrame` reads it by. */
|
|
403
|
+
function sessionProp(sessionId) {
|
|
404
|
+
return typeof sessionId === 'string' && sessionId ? { sessionId } : NO_SESSION;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The iframe and its bridge. Exactly one message source is trusted: the
|
|
409
|
+
* iframe's own window. Everything the panel sends is a request or a
|
|
410
|
+
* notification; everything it needs back is the MCP CallToolResult.
|
|
411
|
+
* `session` is the session whose column holds the frame, when there is one.
|
|
412
|
+
* `onLive` runs once the panel has said hello, which is the first moment it
|
|
413
|
+
* listens: a message posted before it is lost, frame windows not queueing.
|
|
414
|
+
*/
|
|
415
|
+
function PanelFrame({ origin, locale, openSession, frameRef, session = NO_SESSION, onLive }) {
|
|
416
|
+
const ownRef = useRef(null);
|
|
417
|
+
// The frame's window is handed out to the page (the board posts `netchat/openTask`
|
|
418
|
+
// to it), so the ref may come from the caller.
|
|
419
|
+
const ref = frameRef ?? ownRef;
|
|
420
|
+
const [mode, setMode] = useState('src');
|
|
421
|
+
const [inline, setInline] = useState(null);
|
|
422
|
+
// Kept in a ref: the panel says hello from a message event between renders, and
|
|
423
|
+
// the callback it should reach then is the one of the latest render.
|
|
424
|
+
const onLiveRef = useRef(onLive);
|
|
425
|
+
onLiveRef.current = onLive;
|
|
426
|
+
|
|
427
|
+
useEffect(() => {
|
|
428
|
+
const frame = ref.current;
|
|
429
|
+
if (!frame || mode !== 'src') return undefined;
|
|
430
|
+
const controller = new AbortController();
|
|
431
|
+
// Fetched now so the srcDoc retry is immediate if the src never says hello.
|
|
432
|
+
fetch(`${origin}/__netchat/panel`, { signal: controller.signal })
|
|
433
|
+
.then((response) => (response.ok ? response.text() : Promise.reject(new Error(String(response.status)))))
|
|
434
|
+
.then(setInline)
|
|
435
|
+
.catch(() => {});
|
|
436
|
+
const timer = setTimeout(() => setMode((current) => (current === 'src' ? 'srcdoc' : current)), HELLO_TIMEOUT_MS);
|
|
437
|
+
return () => {
|
|
438
|
+
clearTimeout(timer);
|
|
439
|
+
controller.abort();
|
|
440
|
+
};
|
|
441
|
+
}, [origin, mode]);
|
|
442
|
+
|
|
443
|
+
const onMessage = useCallback(
|
|
444
|
+
(event) => {
|
|
445
|
+
const frame = ref.current;
|
|
446
|
+
if (!frame || !frame.contentWindow || event.source !== frame.contentWindow) return;
|
|
447
|
+
const message = event.data;
|
|
448
|
+
if (!message || message.jsonrpc !== '2.0') return;
|
|
449
|
+
const reply = (body) => frame.contentWindow.postMessage(body, '*');
|
|
450
|
+
|
|
451
|
+
if (message.method !== undefined && message.id !== undefined) {
|
|
452
|
+
// A request from the panel: only two exist.
|
|
453
|
+
if (message.method === 'ui/initialize') {
|
|
454
|
+
setMode('live');
|
|
455
|
+
reply({ jsonrpc: '2.0', id: message.id, result: { hostContext: { locale, host: { name: 'dsh', label: 'DeepSeek Harness' } } } });
|
|
456
|
+
// The reply first: the panel reads its host context from it before it acts on anything else.
|
|
457
|
+
onLiveRef.current?.();
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (message.method === 'tools/call') {
|
|
461
|
+
const name = message.params?.name;
|
|
462
|
+
const args = message.params?.arguments ?? {};
|
|
463
|
+
// The session whose column holds this frame goes with every call as the call's
|
|
464
|
+
// meta: a task sent from the panel is then recorded as sent from that session, the
|
|
465
|
+
// way one sent from the chat is, so the lists can jump back to it. The left
|
|
466
|
+
// Sidebar's panel is outside every session's column and sends none.
|
|
467
|
+
const meta = session.sessionId ? { sessionId: session.sessionId, hostLabel: HOST_LABEL } : undefined;
|
|
468
|
+
fetch(`${origin}/__netchat/call`, {
|
|
469
|
+
method: 'POST',
|
|
470
|
+
headers: { 'content-type': 'application/json' },
|
|
471
|
+
body: JSON.stringify({ name, arguments: args, ...(meta ? { meta } : {}) }),
|
|
472
|
+
})
|
|
473
|
+
.then((response) => response.json())
|
|
474
|
+
.then((result) => {
|
|
475
|
+
// Opening a session is the one op the host half cannot do: it has no window.
|
|
476
|
+
if (name === 'net_chat_open_session' && !result?.isError && args?.sessionId) openSession(args.sessionId);
|
|
477
|
+
reply({ jsonrpc: '2.0', id: message.id, result });
|
|
478
|
+
})
|
|
479
|
+
.catch((error) => reply({ jsonrpc: '2.0', id: message.id, error: { code: -32000, message: String(error?.message ?? error) } }));
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
reply({ jsonrpc: '2.0', id: message.id, error: { code: -32601, message: `Unsupported method: ${message.method}` } });
|
|
483
|
+
}
|
|
484
|
+
// Notifications from the panel (`ui/notifications/initialized`) need no answer.
|
|
485
|
+
},
|
|
486
|
+
[origin, locale, openSession, session],
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
useEffect(() => {
|
|
490
|
+
window.addEventListener('message', onMessage);
|
|
491
|
+
return () => window.removeEventListener('message', onMessage);
|
|
492
|
+
}, [onMessage]);
|
|
493
|
+
|
|
494
|
+
const common = {
|
|
495
|
+
ref,
|
|
496
|
+
title: text(LABELS, locale),
|
|
497
|
+
sandbox: 'allow-scripts',
|
|
498
|
+
'data-netchat-frame': '',
|
|
499
|
+
style: { display: 'block', width: '100%', height: '100%', border: 0, background: 'transparent' },
|
|
500
|
+
};
|
|
501
|
+
if (mode === 'srcdoc') {
|
|
502
|
+
return inline === null
|
|
503
|
+
? h('div', { style: { padding: 16, opacity: 0.7 } }, locale === 'zh' ? 'NetChat 面板加载中…' : 'Loading NetChat…')
|
|
504
|
+
: h('iframe', { ...common, key: 'srcdoc', srcDoc: inline });
|
|
505
|
+
}
|
|
506
|
+
return h('iframe', { ...common, key: 'src', src: `${origin}/__netchat/panel` });
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Opens a session in the main column and brings the conversation back into view.
|
|
511
|
+
* `uiWorkspace.openSession` retains the session and, with the reveal it does,
|
|
512
|
+
* clears the layout's main panel, so the conversation is what the jump lands on.
|
|
513
|
+
*/
|
|
514
|
+
function openSessionWith(ctx, sessionId) {
|
|
515
|
+
if (typeof sessionId !== 'string' || !sessionId) return;
|
|
516
|
+
try {
|
|
517
|
+
if (typeof ctx.uiWorkspace?.openSession === 'function') {
|
|
518
|
+
ctx.uiWorkspace.openSession(sessionId);
|
|
519
|
+
ctx.layout?.selectPanel(null);
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
} catch (error) {
|
|
523
|
+
log('open session failed', error);
|
|
524
|
+
}
|
|
525
|
+
try {
|
|
526
|
+
ctx.get('sessions')?.retain?.(sessionId);
|
|
527
|
+
} catch (error) {
|
|
528
|
+
log('open session failed', error);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
function useOpenSession(ctx) {
|
|
533
|
+
return useCallback((sessionId) => openSessionWith(ctx, sessionId), [ctx]);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Opens the left Sidebar's panel with a task: the panel, which fills the main column,
|
|
538
|
+
* is brought to the front with the task for the panel to show when its frame is up. It
|
|
539
|
+
* is the whole window's width where the right Sidebar's page takes a strip, which is
|
|
540
|
+
* what a row of the Session panel's section asks for; the right Sidebar's page stays as
|
|
541
|
+
* it was. A host without the layout's panel choice only gets the task shown, in whatever
|
|
542
|
+
* panel of this plugin is up.
|
|
543
|
+
*/
|
|
544
|
+
function openTaskPanel(ctx, taskId) {
|
|
545
|
+
requestPanelTask(taskId);
|
|
546
|
+
if (typeof ctx.layout?.selectPanel !== 'function') {
|
|
547
|
+
log('the layout is absent: the panel cannot be brought to the front', taskId);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
try {
|
|
551
|
+
ctx.layout.selectPanel(PANEL_ID);
|
|
552
|
+
} catch (error) {
|
|
553
|
+
log('open task panel failed', error);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Sends the panel one `netchat/openTask` notification: show that task with its drawer open.
|
|
559
|
+
*
|
|
560
|
+
* The message is addressed with `'*'` because the frame cannot be addressed any other way:
|
|
561
|
+
* it runs under `sandbox="allow-scripts"` without `allow-same-origin`, which makes its
|
|
562
|
+
* origin opaque, and a `postMessage` whose targetOrigin names an origin never reaches a
|
|
563
|
+
* window with an opaque one — it is dropped without a word. That costs nothing here: the
|
|
564
|
+
* message goes to one window, the frame's, and carries nothing but a task id. The panel
|
|
565
|
+
* for its part only acts on messages whose source is its parent's window.
|
|
566
|
+
*/
|
|
567
|
+
function useShowTask() {
|
|
568
|
+
const frameRef = useRef(null);
|
|
569
|
+
const showTask = useCallback((taskId) => {
|
|
570
|
+
const frame = frameRef.current;
|
|
571
|
+
if (!frame?.contentWindow || typeof taskId !== 'string' || !taskId) return;
|
|
572
|
+
frame.contentWindow.postMessage({ jsonrpc: '2.0', method: 'netchat/openTask', params: { taskId } }, '*');
|
|
573
|
+
}, []);
|
|
574
|
+
return [frameRef, showTask];
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* The left Sidebar's panel: the panel's iframe, and nothing else. The outer box is
|
|
579
|
+
* a full-height block so the iframe fills the panel. The panel is no session's, so a
|
|
580
|
+
* task sent here is recorded without a session, as before.
|
|
581
|
+
*
|
|
582
|
+
* A task asked for from elsewhere (see `requestPanelTask`) is shown here: at once where
|
|
583
|
+
* the page is up when it is asked for, else from the frame's `onLive`. The frame loads
|
|
584
|
+
* with the page, and the panel in it listens only from its hello on, so an ask that
|
|
585
|
+
* comes while it loads is posted into a frame that drops it, and is posted again then.
|
|
586
|
+
*/
|
|
587
|
+
function PanelPage({ ctx, locale }) {
|
|
588
|
+
const origin = `${window.location.protocol}//${window.location.host}`;
|
|
589
|
+
const openSession = useOpenSession(ctx);
|
|
590
|
+
const [frameRef, showTask] = useShowTask();
|
|
591
|
+
// An ask while the page is up is shown at once. `showTask` is the same function for the
|
|
592
|
+
// page's life, so it can be the listener itself.
|
|
593
|
+
useEffect(() => {
|
|
594
|
+
panelTask.listeners.add(showTask);
|
|
595
|
+
return () => panelTask.listeners.delete(showTask);
|
|
596
|
+
}, [showTask]);
|
|
597
|
+
// The frame says hello each time it loads: with the page, and again on the srcDoc retry.
|
|
598
|
+
const onLive = useCallback(() => {
|
|
599
|
+
if (panelTask.id) showTask(panelTask.id);
|
|
600
|
+
}, [showTask]);
|
|
601
|
+
return h('div', { style: { height: '100%', minHeight: 0 } }, h(PanelFrame, { origin, locale, openSession, frameRef, onLive }));
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* The right Sidebar page's body: the task board over the same iframe. The outer box the
|
|
606
|
+
* Sidebar wraps around every tab body is already a full-height flex column, so this one
|
|
607
|
+
* only splits it: the board takes what it needs (capped), the iframe the rest.
|
|
608
|
+
*
|
|
609
|
+
* `hooks.tabInfo` is the hook the seat binds to this tab; what it returns carries the
|
|
610
|
+
* tab's navigation, where the task the page was opened with arrives (`openTab(kind, { params })`).
|
|
611
|
+
* The page keeps the task it has not shown yet and shows it from the frame's `onLive`,
|
|
612
|
+
* since the frame loads with the page and the panel in it listens only from its hello on.
|
|
613
|
+
*/
|
|
614
|
+
function TaskPage({ ctx, locale, sessionId, hooks }) {
|
|
615
|
+
const origin = `${window.location.protocol}//${window.location.host}`;
|
|
616
|
+
const openSession = useOpenSession(ctx);
|
|
617
|
+
const [frameRef, showTask] = useShowTask();
|
|
618
|
+
const session = useMemo(() => sessionProp(sessionId), [sessionId]);
|
|
619
|
+
// `navigation.revision` counts the opens and re-opens of this tab, so the same task
|
|
620
|
+
// asked for twice is shown twice; `-1` stands for no open yet.
|
|
621
|
+
const navigation = hooks?.tabInfo?.().tab.navigation;
|
|
622
|
+
const mark = `${navigation?.revision ?? -1}:${navigation?.params?.[TASK_PARAM] ?? ''}`;
|
|
623
|
+
// What the latest render has in store; written between renders too, so it is a ref.
|
|
624
|
+
const seen = useRef(mark);
|
|
625
|
+
const pending = seen.current === mark ? null : (navigation?.params?.[TASK_PARAM] ?? null);
|
|
626
|
+
const onLive = useCallback(() => {
|
|
627
|
+
// Shown once: a re-render that reads the same navigation must not show it again.
|
|
628
|
+
seen.current = mark;
|
|
629
|
+
if (typeof pending === 'string' && pending) showTask(pending);
|
|
630
|
+
}, [mark, pending, showTask]);
|
|
631
|
+
return h('div', { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' } },
|
|
632
|
+
h(TaskBoard, { locale, openSession, showTask }),
|
|
633
|
+
h('div', { style: { flex: 1, minHeight: 0 } }, h(PanelFrame, { origin, locale, openSession, frameRef, session, onLive })),
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
return {
|
|
638
|
+
// `uiSession.sessionStatus` is the service behind `uiSession`; a plugin that uses it
|
|
639
|
+
// names both, as the official packages do. `layout` is optional at run time (see
|
|
640
|
+
// useOpenSession), but it is injected so the plugin is applied after the layout exists.
|
|
641
|
+
inject: ['slots', 'sidebarRightTabs', 'uiWorkspace', 'uiSession', 'uiSession.sessionStatus', 'layout'],
|
|
642
|
+
apply(ctx) {
|
|
643
|
+
const locale = language(ctx.get('locale')?.resolved ?? navigator.language);
|
|
644
|
+
// The board reads running marks from the status table; it is absent on a host
|
|
645
|
+
// without the service, where rows fall back to the task's own state.
|
|
646
|
+
const sessionStatus = ctx.uiSession?.sessionStatus;
|
|
647
|
+
if (sessionStatus && typeof sessionStatus.getSnapshot === 'function') {
|
|
648
|
+
taskStore.sessionStatus = sessionStatus;
|
|
649
|
+
}
|
|
650
|
+
// The title shows the count from the moment the page opens, so the store knows the
|
|
651
|
+
// host half's origin from the start. On Desktop the page origin is not the web
|
|
652
|
+
// server's, but the route is reached through the same fetch bridge either way.
|
|
653
|
+
taskStore.attach(`${window.location.protocol}//${window.location.host}`);
|
|
654
|
+
// The left Sidebar's panel, as before the right Sidebar's page existed: the panel's
|
|
655
|
+
// iframe under its own entry, kept free of the task board.
|
|
656
|
+
ctx.effect(() => ctx.slots.inject('main', function* () {
|
|
657
|
+
const component = function MainPanel(props) {
|
|
658
|
+
return h(PanelPage, { ctx, locale, ...props });
|
|
659
|
+
};
|
|
660
|
+
yield ctx.slots.register({ name: 'main', key: PANEL_ID }, component);
|
|
661
|
+
}), 'netchat: main panel');
|
|
662
|
+
ctx.effect(() => ctx.slots.inject('sidebar.panellist', () =>
|
|
663
|
+
ctx.slots.register({ name: 'sidebar.panellist', id: PANEL_ID, order: PANEL_ORDER, label: () => text(LABELS, locale) }, PanelIcon),
|
|
664
|
+
), 'netchat: panel list entry');
|
|
665
|
+
// The right Sidebar's page. The type goes into the registry first, so its guide card
|
|
666
|
+
// is there from the first paint; the body and the title then hang off it under the
|
|
667
|
+
// same id.
|
|
668
|
+
ctx.effect(() => ctx.sidebarRightTabs.register({
|
|
669
|
+
id: TAB_TYPE_ID,
|
|
670
|
+
kind: TAB_KIND,
|
|
671
|
+
title: () => text(TASKS_LABEL, locale),
|
|
672
|
+
guide: [{ id: GUIDE_ENTRY_ID, order: GUIDE_ORDER, title: () => text(TASKS_LABEL, locale), description: () => text(TASKS_DESCRIPTION, locale) }],
|
|
673
|
+
}), 'netchat: tab type');
|
|
674
|
+
ctx.effect(() => ctx.slots.inject('sidebar.right.pane.tab', () =>
|
|
675
|
+
ctx.slots.register({ name: 'sidebar.right.pane.tab', key: TAB_TYPE_ID }, (props) => h(TaskPage, { ctx, locale, ...props })),
|
|
676
|
+
), 'netchat: tab body');
|
|
677
|
+
ctx.effect(() => ctx.slots.inject('sidebar.right.pane.tab.title', () =>
|
|
678
|
+
ctx.slots.register({ name: 'sidebar.right.pane.tab.title', key: TAB_TYPE_ID }, () => h(TaskTitle, { locale })),
|
|
679
|
+
), 'netchat: tab title');
|
|
680
|
+
// The Session panel's section and the toggle's dot. The panel draws each section's
|
|
681
|
+
// title and rows' frame; the components fill the rows in, or nothing while no task is
|
|
682
|
+
// open, which the panel takes as a section to hide. A row's click opens the left
|
|
683
|
+
// Sidebar's panel with the task, after the task's session when it has one here.
|
|
684
|
+
ctx.effect(() => ctx.slots.inject('conversation.session.panel.section', () =>
|
|
685
|
+
ctx.slots.register({ name: 'conversation.session.panel.section', id: SECTION_ID, order: SECTION_ORDER, label: () => text(TASKS_LABEL, locale) },
|
|
686
|
+
(props) => h(NetchatSection, { locale, openSession: (sessionId) => openSessionWith(ctx, sessionId), openTask: (taskId) => openTaskPanel(ctx, taskId), ...props })),
|
|
687
|
+
), 'netchat: session panel section');
|
|
688
|
+
ctx.effect(() => ctx.slots.inject('conversation.session.panel.indicator', () =>
|
|
689
|
+
ctx.slots.register({ name: 'conversation.session.panel.indicator', id: INDICATOR_ID, order: INDICATOR_ORDER },
|
|
690
|
+
(props) => h(NetchatIndicator, { locale, ...props })),
|
|
691
|
+
), 'netchat: session panel indicator');
|
|
692
|
+
log('browser half applied');
|
|
693
|
+
},
|
|
694
|
+
};
|
|
695
|
+
},
|
|
696
|
+
});
|