@alexsun-top/opencode-chat-room 0.8.4 → 0.8.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/CHANGELOG.md +17 -3
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/cli.ts +20 -1
- package/dist/cli.js +3785 -1462
- package/package.json +19 -11
- package/packages/chat-room-channeld/README.md +16 -10
- package/packages/chat-room-channeld/src/delivery.ts +0 -4
- package/packages/chat-room-channeld/src/host.ts +48 -37
- package/packages/chat-room-channeld/src/inbound.ts +3 -6
- package/packages/chat-room-channeld/src/pg/database.ts +141 -49
- package/packages/chat-room-channeld/src/pg/sql.mjs +157 -142
- package/packages/chat-room-channeld/src/pg/sql.mts +175 -0
- package/packages/chat-room-channeld/src/pg/worker.mjs +148 -99
- package/packages/chat-room-channeld/src/pg/worker.mts +201 -0
- package/packages/chat-room-channeld/src/state-rows.ts +132 -0
- package/packages/chat-room-channeld/src/state.ts +129 -157
- package/plugin.ts +21 -5
- package/server/app.ts +9 -0
- package/server/assets/base.css +22 -2
- package/server/assets/chat/admin.js +17 -1
- package/server/assets/chat/announcements.js +79 -34
- package/server/assets/chat/attachments.js +3 -3
- package/server/assets/chat/clipboard.js +1 -1
- package/server/assets/chat/confirm-dialog.js +3 -0
- package/server/assets/chat/copy-action.js +1 -1
- package/server/assets/chat/create-room-dialog.js +7 -0
- package/server/assets/chat/diagram-viewer.js +4 -8
- package/server/assets/chat/doc-preview.js +71 -31
- package/server/assets/chat/editor.js +49 -10
- package/server/assets/chat/events.js +13 -6
- package/server/assets/chat/files.js +33 -27
- package/server/assets/chat/history-loader.js +31 -15
- package/server/assets/chat/integration-editor.js +27 -1
- package/server/assets/chat/integrations.js +108 -16
- package/server/assets/chat/join-requests.js +40 -2
- package/server/assets/chat/locales/de.js +5 -3
- package/server/assets/chat/locales/es.js +5 -3
- package/server/assets/chat/locales/fr.js +5 -3
- package/server/assets/chat/locales/it.js +5 -3
- package/server/assets/chat/locales/ja.js +5 -3
- package/server/assets/chat/locales/ko.js +5 -3
- package/server/assets/chat/markdown-footnotes.js +27 -15
- package/server/assets/chat/markdown.js +6 -12
- package/server/assets/chat/members.js +34 -22
- package/server/assets/chat/mentions.js +8 -5
- package/server/assets/chat/message-cache.js +9 -3
- package/server/assets/chat/message-polling.js +10 -4
- package/server/assets/chat/message-window.js +58 -1
- package/server/assets/chat/messages.js +90 -37
- package/server/assets/chat/office-preview.js +3 -3
- package/server/assets/chat/operator.js +624 -0
- package/server/assets/chat/palette.js +7 -10
- package/server/assets/chat/panels.js +42 -0
- package/server/assets/chat/questions.js +75 -58
- package/server/assets/chat/recall.js +14 -5
- package/server/assets/chat/receipts.js +63 -7
- package/server/assets/chat/refresh-timing.js +6 -0
- package/server/assets/chat/reminders.js +47 -13
- package/server/assets/chat/replies.js +39 -25
- package/server/assets/chat/resource-format.js +6 -3
- package/server/assets/chat/room-list.js +202 -3
- package/server/assets/chat/room-watcher.js +3 -1
- package/server/assets/chat/rooms.js +29 -7
- package/server/assets/chat/settings.js +37 -6
- package/server/assets/chat/shortcuts.js +3 -1
- package/server/assets/chat/side-pane.js +1 -1
- package/server/assets/chat/state.js +51 -18
- package/server/assets/chat/system-events.js +3 -2
- package/server/assets/chat/system-messages.js +15 -15
- package/server/assets/chat/tasks.js +37 -14
- package/server/assets/chat/window-controls.js +25 -15
- package/server/assets/code-highlight.css +0 -13
- package/server/assets/conversation.css +45 -5
- package/server/assets/doc-preview.css +9 -0
- package/server/assets/files.css +4 -0
- package/server/assets/monaco/integration-rules.js +1 -1
- package/server/assets/office/THIRD-PARTY-NOTICES.txt +23 -1
- package/server/assets/office/licenses/docx-preview-HEADER.txt +6 -0
- package/server/assets/office/licenses/echarts-LICENSE-d3.txt +27 -0
- package/server/assets/office/licenses/echarts-NOTICE.txt +5 -0
- package/server/assets/office/licenses/immediate-LICENSE.txt +20 -0
- package/server/assets/office/licenses/lie-LICENSE.txt +7 -0
- package/server/assets/office/licenses/pako-LICENSE.txt +21 -0
- package/server/assets/office/licenses/pako-ZLIB.txt +18 -0
- package/server/assets/office/licenses/setimmediate-LICENSE.txt +20 -0
- package/server/assets/responsive.css +12 -2
- package/server/assets/settings.css +3 -1
- package/server/assets/tasks.css +6 -1
- package/server/assets/window-controls.css +3 -1
- package/server/channels.ts +3 -2
- package/server/chat.html +7 -2
- package/server/inbox.ts +3 -1
- package/server/join-requests.ts +8 -1
- package/server/member-routes.ts +16 -2
- package/server/newrooms.ts +2 -13
- package/server/operator-auth.ts +21 -0
- package/server/operator-routes.ts +150 -0
- package/server/operator-state.ts +64 -0
- package/server/operator.css +139 -0
- package/server/room-owner.ts +17 -0
- package/server/routes/inbox.ts +15 -5
- package/server/routes/pages.ts +12 -2
- package/server/routes/room-actions.ts +4 -3
- package/server/sw.js +3 -1
- package/server/system.html +109 -0
- package/server/wake.ts +1 -1
- package/skills/chatroom/SKILL.md +9 -0
- package/src/README.md +1 -1
- package/src/acp/client.ts +254 -0
- package/src/acp/protocol.ts +300 -0
- package/src/acp/watch.ts +498 -0
- package/src/agent/agent-receipts.ts +98 -8
- package/src/center/center-client.ts +6 -1
- package/src/center/center-inbox.ts +54 -7
- package/src/center/center-wake.ts +57 -3
- package/src/center/forward-client.ts +48 -0
- package/src/center/mentions.ts +16 -3
- package/src/center/notification-delay.ts +139 -0
- package/src/center/queue.ts +3 -0
- package/src/config/file-config.ts +25 -0
- package/src/mcp/server.ts +389 -0
- package/src/protocol/config.ts +7 -0
- package/src/runtime/plugin-notifications.ts +43 -9
- package/src/runtime/v2-plugin.ts +14 -3
- package/src/runtime/v2-receiver.ts +10 -2
- package/src/runtime/watch.ts +5 -1
- package/src/state/pg-database.ts +133 -49
- package/src/state/pg-sql.mjs +157 -142
- package/src/state/pg-sql.mts +175 -0
- package/src/state/pg-worker.mjs +148 -99
- package/src/state/pg-worker.mts +201 -0
- package/src/state/receiver-state.ts +47 -0
- package/src/state/sqlite-database.ts +6 -2
- package/src/state/sqlite-members.ts +48 -4
- package/src/state/sqlite-messages.ts +25 -12
- package/src/state/sqlite-schema.ts +4 -1
- package/src/state/sqlite-state.ts +1 -1
- package/src/state/store.ts +31 -11
- package/src/tui/app-types.mjs +1 -0
- package/src/tui/app-types.mts +175 -0
- package/src/tui/app.mjs +473 -423
- package/src/tui/app.mts +543 -0
- package/src/tui/config.mjs +166 -158
- package/src/tui/config.mts +247 -0
- package/src/tui/http.mjs +239 -206
- package/src/tui/http.mts +412 -0
- package/src/tui/i18n.mjs +17 -20
- package/src/tui/i18n.mts +42 -0
- package/src/tui/info-app.mjs +431 -427
- package/src/tui/info-app.mts +500 -0
- package/src/tui/info-content.mjs +205 -199
- package/src/tui/info-content.mts +341 -0
- package/src/tui/join-app.mjs +75 -64
- package/src/tui/join-app.mts +99 -0
- package/src/tui/locales/en.mjs +302 -320
- package/src/tui/locales/en.mts +349 -0
- package/src/tui/locales/zh-CN.mjs +302 -320
- package/src/tui/locales/zh-CN.mts +349 -0
- package/src/tui/main.mjs +219 -213
- package/src/tui/main.mts +255 -0
- package/src/tui/markdown.mjs +128 -272
- package/src/tui/markdown.mts +152 -0
- package/src/tui/mentions.mjs +181 -184
- package/src/tui/mentions.mts +251 -0
- package/src/tui/message-app.mjs +181 -173
- package/src/tui/message-app.mts +213 -0
- package/src/tui/message-view.mjs +90 -111
- package/src/tui/message-view.mts +151 -0
- package/src/tui/messages.mjs +55 -49
- package/src/tui/messages.mts +106 -0
- package/src/tui/palette-app.mjs +364 -344
- package/src/tui/palette-app.mts +388 -0
- package/src/tui/palette.mjs +100 -98
- package/src/tui/palette.mts +176 -0
- package/src/tui/prefs.mjs +56 -63
- package/src/tui/prefs.mts +126 -0
- package/src/tui/reminder-app.mjs +191 -181
- package/src/tui/reminder-app.mts +228 -0
- package/src/tui/room-settings-app.mjs +275 -242
- package/src/tui/room-settings-app.mts +318 -0
- package/src/tui/session.mjs +30 -29
- package/src/tui/session.mts +51 -0
- package/src/tui/settings-app.mjs +151 -138
- package/src/tui/settings-app.mts +179 -0
- package/src/tui/ui-content.mjs +426 -421
- package/src/tui/ui-content.mts +499 -0
- package/src/tui/ui-help.mjs +58 -67
- package/src/tui/ui-help.mts +87 -0
- package/src/tui/ui-mentions.mjs +34 -36
- package/src/tui/ui-mentions.mts +60 -0
- package/src/tui/ui-overlay-view.mjs +259 -267
- package/src/tui/ui-overlay-view.mts +322 -0
- package/src/tui/ui-suggest-view.mjs +54 -57
- package/src/tui/ui-suggest-view.mts +78 -0
- package/src/tui/ui-suggest.mjs +164 -167
- package/src/tui/ui-suggest.mts +248 -0
- package/src/tui/ui-theme.mjs +52 -57
- package/src/tui/ui-theme.mts +98 -0
- package/src/tui/ui-view.mjs +267 -275
- package/src/tui/ui-view.mts +308 -0
- package/src/tui/ui.mjs +372 -359
- package/src/tui/ui.mts +440 -0
- package/src/tui/wire.mjs +215 -0
- package/src/tui/wire.mts +383 -0
- package/src/web/integration-rules-editor.ts +25 -2
package/src/tui/ui-theme.mjs
CHANGED
|
@@ -1,65 +1,60 @@
|
|
|
1
|
-
// Semantic colors for the OpenTUI view. Dark and light variants follow the
|
|
2
|
-
// same roles OpenCode uses: background surface, text, muted metadata, border,
|
|
3
|
-
// selection, accent and feedback colors.
|
|
4
1
|
import { t } from "./i18n.mjs";
|
|
5
2
|
const PALETTES = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
3
|
+
dark: {
|
|
4
|
+
surface: "#0e1116",
|
|
5
|
+
raised: "#171c24",
|
|
6
|
+
text: "#e6e9ef",
|
|
7
|
+
muted: "#98a2b3",
|
|
8
|
+
faint: "#667085",
|
|
9
|
+
border: "#2a313d",
|
|
10
|
+
accent: "#5eead4",
|
|
11
|
+
selectedBg: "#12333a",
|
|
12
|
+
selectedFg: "#ecfeff",
|
|
13
|
+
error: "#fca5a5",
|
|
14
|
+
success: "#6ee7b7",
|
|
15
|
+
warning: "#fcd34d",
|
|
16
|
+
},
|
|
17
|
+
light: {
|
|
18
|
+
surface: "#f8fafc",
|
|
19
|
+
raised: "#eef2f7",
|
|
20
|
+
text: "#101828",
|
|
21
|
+
muted: "#5a6475",
|
|
22
|
+
faint: "#98a2b3",
|
|
23
|
+
border: "#d0d5dd",
|
|
24
|
+
accent: "#0f766e",
|
|
25
|
+
selectedBg: "#0f766e",
|
|
26
|
+
selectedFg: "#f0fdfa",
|
|
27
|
+
error: "#b42318",
|
|
28
|
+
success: "#087443",
|
|
29
|
+
warning: "#b54708",
|
|
30
|
+
},
|
|
34
31
|
};
|
|
35
|
-
|
|
36
32
|
export function themeFor(mode) {
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const normalized = mode === "light" ? "light" : "dark";
|
|
34
|
+
return { mode: normalized, ...PALETTES[normalized] };
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
export function createTheme(renderer, preferred) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
const mode = preferred === "light" || preferred === "dark"
|
|
38
|
+
? preferred
|
|
39
|
+
: renderer.themeMode === "light" ? "light" : "dark";
|
|
40
|
+
const theme = themeFor(mode);
|
|
41
|
+
return {
|
|
42
|
+
theme,
|
|
43
|
+
mode,
|
|
44
|
+
set(next) {
|
|
45
|
+
if (next !== "light" && next !== "dark")
|
|
46
|
+
return false;
|
|
47
|
+
Object.assign(theme, themeFor(next));
|
|
48
|
+
this.mode = next;
|
|
49
|
+
return true;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
56
52
|
}
|
|
57
|
-
|
|
58
53
|
export function connectionStyle(theme, connection) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
54
|
+
switch (connection) {
|
|
55
|
+
case "online": return { label: t("connection.online"), dot: "●", color: theme.success };
|
|
56
|
+
case "reconnecting": return { label: t("connection.reconnecting"), dot: "◌", color: theme.warning };
|
|
57
|
+
case "offline": return { label: t("connection.offline"), dot: "●", color: theme.error };
|
|
58
|
+
default: return { label: t("connection.connecting"), dot: "○", color: theme.muted };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Semantic colors for the OpenTUI view. Dark and light variants follow the
|
|
2
|
+
// same roles OpenCode uses: background surface, text, muted metadata, border,
|
|
3
|
+
// selection, accent and feedback colors.
|
|
4
|
+
import type { CliRenderer, ThemeMode } from "@opentui/core";
|
|
5
|
+
import { t } from "./i18n.mjs";
|
|
6
|
+
|
|
7
|
+
export interface Palette {
|
|
8
|
+
surface: string;
|
|
9
|
+
raised: string;
|
|
10
|
+
text: string;
|
|
11
|
+
muted: string;
|
|
12
|
+
faint: string;
|
|
13
|
+
border: string;
|
|
14
|
+
accent: string;
|
|
15
|
+
selectedBg: string;
|
|
16
|
+
selectedFg: string;
|
|
17
|
+
error: string;
|
|
18
|
+
success: string;
|
|
19
|
+
warning: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface TuiTheme extends Palette {
|
|
23
|
+
mode: ThemeMode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ThemeController {
|
|
27
|
+
theme: TuiTheme;
|
|
28
|
+
mode: ThemeMode;
|
|
29
|
+
set(next: unknown): boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ConnectionStyle {
|
|
33
|
+
label: string;
|
|
34
|
+
dot: string;
|
|
35
|
+
color: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const PALETTES: Record<ThemeMode, Palette> = {
|
|
39
|
+
dark: {
|
|
40
|
+
surface: "#0e1116",
|
|
41
|
+
raised: "#171c24",
|
|
42
|
+
text: "#e6e9ef",
|
|
43
|
+
muted: "#98a2b3",
|
|
44
|
+
faint: "#667085",
|
|
45
|
+
border: "#2a313d",
|
|
46
|
+
accent: "#5eead4",
|
|
47
|
+
selectedBg: "#12333a",
|
|
48
|
+
selectedFg: "#ecfeff",
|
|
49
|
+
error: "#fca5a5",
|
|
50
|
+
success: "#6ee7b7",
|
|
51
|
+
warning: "#fcd34d",
|
|
52
|
+
},
|
|
53
|
+
light: {
|
|
54
|
+
surface: "#f8fafc",
|
|
55
|
+
raised: "#eef2f7",
|
|
56
|
+
text: "#101828",
|
|
57
|
+
muted: "#5a6475",
|
|
58
|
+
faint: "#98a2b3",
|
|
59
|
+
border: "#d0d5dd",
|
|
60
|
+
accent: "#0f766e",
|
|
61
|
+
selectedBg: "#0f766e",
|
|
62
|
+
selectedFg: "#f0fdfa",
|
|
63
|
+
error: "#b42318",
|
|
64
|
+
success: "#087443",
|
|
65
|
+
warning: "#b54708",
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export function themeFor(mode: unknown): TuiTheme {
|
|
70
|
+
const normalized: ThemeMode = mode === "light" ? "light" : "dark";
|
|
71
|
+
return { mode: normalized, ...PALETTES[normalized] };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function createTheme(renderer: CliRenderer, preferred: unknown): ThemeController {
|
|
75
|
+
const mode: ThemeMode = preferred === "light" || preferred === "dark"
|
|
76
|
+
? preferred
|
|
77
|
+
: renderer.themeMode === "light" ? "light" : "dark";
|
|
78
|
+
const theme = themeFor(mode);
|
|
79
|
+
return {
|
|
80
|
+
theme,
|
|
81
|
+
mode,
|
|
82
|
+
set(next: unknown): boolean {
|
|
83
|
+
if (next !== "light" && next !== "dark") return false;
|
|
84
|
+
Object.assign(theme, themeFor(next));
|
|
85
|
+
this.mode = next;
|
|
86
|
+
return true;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function connectionStyle(theme: TuiTheme, connection: string): ConnectionStyle {
|
|
92
|
+
switch (connection) {
|
|
93
|
+
case "online": return { label: t("connection.online"), dot: "●", color: theme.success };
|
|
94
|
+
case "reconnecting": return { label: t("connection.reconnecting"), dot: "◌", color: theme.warning };
|
|
95
|
+
case "offline": return { label: t("connection.offline"), dot: "●", color: theme.error };
|
|
96
|
+
default: return { label: t("connection.connecting"), dot: "○", color: theme.muted };
|
|
97
|
+
}
|
|
98
|
+
}
|