dsh-plugin-starpost 0.4.1 → 0.5.1
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 +10 -2
- package/LICENSE +21 -21
- package/README.md +6 -0
- package/cordis.patch.yml +3 -3
- package/docs/voice.md +81 -81
- package/lib/ENV_PROMPT.md +9 -9
- package/lib/core.mjs +48 -3
- package/package.json +77 -77
- package/src/account.mjs +47 -47
- package/src/index.mjs +185 -185
- package/src/local.mjs +100 -100
- package/src/panel.mjs +2 -1
- package/src/settings.mjs +22 -22
- package/web/app.mjs +13 -0
- package/web/client.js +16 -16
- package/web/fields.mjs +49 -49
- package/web/index.html +6 -6
- package/web/style.css +3 -3
package/src/local.mjs
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { resolve, join } from 'node:path';
|
|
4
|
-
import { DatabaseSync } from 'node:sqlite';
|
|
5
|
-
import { randomUUID } from 'node:crypto';
|
|
6
|
-
import { sections, readKey, setKey, check } from '../web/fields.mjs';
|
|
7
|
-
import { StarpostWorld, STARPOST_DEFAULTS, relayVersion, starpostIdentityOrigin } from '../lib/core.mjs';
|
|
8
|
-
|
|
9
|
-
export const clientVersions = Object.freeze({
|
|
10
|
-
pluginVersion: JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version,
|
|
11
|
-
coreVersion: relayVersion,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export function clientHome() {
|
|
15
|
-
return resolve(process.env.STARPOST_DSH_HOME || join(process.env.DSH_HOME || join(homedir(), '.dsh'), 'starpost'));
|
|
16
|
-
}
|
|
17
|
-
export function loadSettings(dir) {
|
|
18
|
-
const file = join(dir, 'client.json');
|
|
19
|
-
return existsSync(file) ? JSON.parse(readFileSync(file, 'utf8')) : {};
|
|
20
|
-
}
|
|
21
|
-
export function notificationOptions(settings) {
|
|
22
|
-
const nested = settings.notifications === undefined ? {} : settings.notifications;
|
|
23
|
-
if (!nested || typeof nested !== 'object' || Array.isArray(nested)) throw Error('notifications 须为配置对象');
|
|
24
|
-
const allowed = ['squareMode', 'feedMode', 'digestIntervalMs'];
|
|
25
|
-
for (const key of Object.keys(nested)) if (!allowed.includes(key)) throw Error('未知通知配置:'+key);
|
|
26
|
-
const result = { ...STARPOST_DEFAULTS.notifications, ...nested };
|
|
27
|
-
for (const key of allowed) if (Object.hasOwn(settings, key)) result[key] = settings[key];
|
|
28
|
-
for (const key of ['squareMode', 'feedMode']) {
|
|
29
|
-
if (!['realtime', 'digest', 'manual'].includes(result[key])) throw Error(key+' 须为 realtime、digest 或 manual');
|
|
30
|
-
}
|
|
31
|
-
if (!Number.isInteger(result.digestIntervalMs) || result.digestIntervalMs < 1000 || result.digestIntervalMs > 86400000) throw Error('digestIntervalMs 须为 1000~86400000 的整数');
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
export function options(settings, dir) {
|
|
35
|
-
const cfg = structuredClone(STARPOST_DEFAULTS);
|
|
36
|
-
cfg.enabled = true;
|
|
37
|
-
const url = new URL(settings.serverUrl ?? cfg.serverUrl);
|
|
38
|
-
if (!(url.protocol === 'https:' || (url.protocol === 'http:' && ['127.0.0.1','localhost','[::1]'].includes(url.hostname))) ||
|
|
39
|
-
url.username || url.password || url.pathname !== '/' || url.search || url.hash) throw Error('请使用 HTTPS 服务地址,本机测试可用 HTTP 回环地址');
|
|
40
|
-
cfg.serverUrl = url.origin;
|
|
41
|
-
cfg.hubUrl = settings.hubUrl ?? cfg.hubUrl;
|
|
42
|
-
const pin = join(dir, 'server-origin');
|
|
43
|
-
if (existsSync(pin) && starpostIdentityOrigin(readFileSync(pin, 'utf8').trim()) !== starpostIdentityOrigin(url.origin)) throw Error('账号数据已绑定其他服务器,请为新服务器选择独立的数据目录');
|
|
44
|
-
cfg.receiveMode = settings.receiveMode ?? cfg.receiveMode;
|
|
45
|
-
if (!['active','mixed','passive'].includes(cfg.receiveMode)) throw Error('接收模式须为 active、mixed 或 passive');
|
|
46
|
-
cfg.notifications = notificationOptions(settings);
|
|
47
|
-
cfg.emojiDir = resolve(dir, settings.emojiDir || 'emoji');
|
|
48
|
-
for (const group of [sections.limits, sections.media]) {
|
|
49
|
-
for (const field of group.fields.filter(field => field.key.includes('.'))) {
|
|
50
|
-
const value = readKey(settings, field.key);
|
|
51
|
-
if (value === undefined) continue;
|
|
52
|
-
if (!check(field, value)) throw Error(field.label+' 设置无效');
|
|
53
|
-
setKey(cfg, field.key, value);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if(settings.speech!==undefined){
|
|
57
|
-
if(!settings.speech||typeof settings.speech!=='object'||Array.isArray(settings.speech))throw Error('speech 须为配置对象');
|
|
58
|
-
for(const [key,value]of Object.entries(settings.speech)){
|
|
59
|
-
if(!Object.hasOwn(cfg.speech,key)||typeof value!=='string')throw Error('未知或无效的语音配置:'+key);
|
|
60
|
-
if(key.endsWith('Protocol')&&!['openai','json'].includes(value))throw Error('语音协议须为 openai 或 json');
|
|
61
|
-
if(key.endsWith('KeySecret')&&value&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(value))throw Error('密钥应配置环境变量名');
|
|
62
|
-
cfg.speech[key]=value;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
for (const [key, min, max] of [['maxMessagesPerDay',0,1000000],['maxWerewolfGamesPerDay',0,1000],['maxGroups',0,1000],['maxPrivateChats',0,1000],['deliveryIntervalMs',1000,300000]]) {
|
|
66
|
-
if (Object.hasOwn(settings,key)) {
|
|
67
|
-
if (!Number.isInteger(settings[key]) || settings[key] < min || settings[key] > max) throw Error(key+' 超出允许范围');
|
|
68
|
-
cfg[key] = settings[key];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return cfg;
|
|
72
|
-
}
|
|
73
|
-
export function validateSettings(dir, settings) {
|
|
74
|
-
options(settings, dir);
|
|
75
|
-
if (typeof settings.sessionId !== 'string' || !settings.sessionId.trim() || settings.sessionId.length > 512 || /[\x00-\x1f\x7f]/.test(settings.sessionId)) throw Error('请指定有效的 DSH 会话 ID');
|
|
76
|
-
}
|
|
77
|
-
export function saveSettings(dir, settings, { allowUnbound = false } = {}) {
|
|
78
|
-
if (allowUnbound && settings.sessionId === undefined) options(settings, dir);
|
|
79
|
-
else validateSettings(dir,settings);
|
|
80
|
-
mkdirSync(dir,{recursive:true,mode:0o700});
|
|
81
|
-
const tmp = join(dir, randomUUID()+'.tmp');
|
|
82
|
-
writeFileSync(tmp, JSON.stringify(settings,null,2)+'\n', {mode:0o600});
|
|
83
|
-
renameSync(tmp,join(dir,'client.json'));
|
|
84
|
-
}
|
|
85
|
-
// SQLite releases this process lock even if the desktop crashes.
|
|
86
|
-
export function lock(dir) {
|
|
87
|
-
mkdirSync(dir,{recursive:true,mode:0o700});
|
|
88
|
-
const db = new DatabaseSync(join(dir,'client-lock.sqlite'));
|
|
89
|
-
try { db.exec('BEGIN IMMEDIATE'); } catch { db.close(); throw Error('此星邮数据目录正在使用,请先关闭使用它的 Harness 实例'); }
|
|
90
|
-
return () => db.close();
|
|
91
|
-
}
|
|
92
|
-
export function makeWorld(dir, settings) {
|
|
93
|
-
const cfg = options(settings, dir);
|
|
94
|
-
return new StarpostWorld(cfg, dir, dir, dir, 'Asia/Shanghai', name => /^[A-Za-z_][A-Za-z0-9_]*$/.test(name)?process.env[name]??'':'', Date.now, () => relayVersion);
|
|
95
|
-
}
|
|
96
|
-
export function pinServer(dir, settings) {
|
|
97
|
-
const origin = options(settings,dir).serverUrl;
|
|
98
|
-
const path = join(dir,'server-origin');
|
|
99
|
-
if (!existsSync(path)) writeFileSync(path,origin,{flag:'wx',mode:0o600});
|
|
100
|
-
}
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, renameSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { resolve, join } from 'node:path';
|
|
4
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
import { sections, readKey, setKey, check } from '../web/fields.mjs';
|
|
7
|
+
import { StarpostWorld, STARPOST_DEFAULTS, relayVersion, starpostIdentityOrigin } from '../lib/core.mjs';
|
|
8
|
+
|
|
9
|
+
export const clientVersions = Object.freeze({
|
|
10
|
+
pluginVersion: JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version,
|
|
11
|
+
coreVersion: relayVersion,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export function clientHome() {
|
|
15
|
+
return resolve(process.env.STARPOST_DSH_HOME || join(process.env.DSH_HOME || join(homedir(), '.dsh'), 'starpost'));
|
|
16
|
+
}
|
|
17
|
+
export function loadSettings(dir) {
|
|
18
|
+
const file = join(dir, 'client.json');
|
|
19
|
+
return existsSync(file) ? JSON.parse(readFileSync(file, 'utf8')) : {};
|
|
20
|
+
}
|
|
21
|
+
export function notificationOptions(settings) {
|
|
22
|
+
const nested = settings.notifications === undefined ? {} : settings.notifications;
|
|
23
|
+
if (!nested || typeof nested !== 'object' || Array.isArray(nested)) throw Error('notifications 须为配置对象');
|
|
24
|
+
const allowed = ['squareMode', 'feedMode', 'digestIntervalMs'];
|
|
25
|
+
for (const key of Object.keys(nested)) if (!allowed.includes(key)) throw Error('未知通知配置:'+key);
|
|
26
|
+
const result = { ...STARPOST_DEFAULTS.notifications, ...nested };
|
|
27
|
+
for (const key of allowed) if (Object.hasOwn(settings, key)) result[key] = settings[key];
|
|
28
|
+
for (const key of ['squareMode', 'feedMode']) {
|
|
29
|
+
if (!['realtime', 'digest', 'manual'].includes(result[key])) throw Error(key+' 须为 realtime、digest 或 manual');
|
|
30
|
+
}
|
|
31
|
+
if (!Number.isInteger(result.digestIntervalMs) || result.digestIntervalMs < 1000 || result.digestIntervalMs > 86400000) throw Error('digestIntervalMs 须为 1000~86400000 的整数');
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
export function options(settings, dir) {
|
|
35
|
+
const cfg = structuredClone(STARPOST_DEFAULTS);
|
|
36
|
+
cfg.enabled = true;
|
|
37
|
+
const url = new URL(settings.serverUrl ?? cfg.serverUrl);
|
|
38
|
+
if (!(url.protocol === 'https:' || (url.protocol === 'http:' && ['127.0.0.1','localhost','[::1]'].includes(url.hostname))) ||
|
|
39
|
+
url.username || url.password || url.pathname !== '/' || url.search || url.hash) throw Error('请使用 HTTPS 服务地址,本机测试可用 HTTP 回环地址');
|
|
40
|
+
cfg.serverUrl = url.origin;
|
|
41
|
+
cfg.hubUrl = settings.hubUrl ?? cfg.hubUrl;
|
|
42
|
+
const pin = join(dir, 'server-origin');
|
|
43
|
+
if (existsSync(pin) && starpostIdentityOrigin(readFileSync(pin, 'utf8').trim()) !== starpostIdentityOrigin(url.origin)) throw Error('账号数据已绑定其他服务器,请为新服务器选择独立的数据目录');
|
|
44
|
+
cfg.receiveMode = settings.receiveMode ?? cfg.receiveMode;
|
|
45
|
+
if (!['active','mixed','passive'].includes(cfg.receiveMode)) throw Error('接收模式须为 active、mixed 或 passive');
|
|
46
|
+
cfg.notifications = notificationOptions(settings);
|
|
47
|
+
cfg.emojiDir = resolve(dir, settings.emojiDir || 'emoji');
|
|
48
|
+
for (const group of [sections.limits, sections.media]) {
|
|
49
|
+
for (const field of group.fields.filter(field => field.key.includes('.'))) {
|
|
50
|
+
const value = readKey(settings, field.key);
|
|
51
|
+
if (value === undefined) continue;
|
|
52
|
+
if (!check(field, value)) throw Error(field.label+' 设置无效');
|
|
53
|
+
setKey(cfg, field.key, value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if(settings.speech!==undefined){
|
|
57
|
+
if(!settings.speech||typeof settings.speech!=='object'||Array.isArray(settings.speech))throw Error('speech 须为配置对象');
|
|
58
|
+
for(const [key,value]of Object.entries(settings.speech)){
|
|
59
|
+
if(!Object.hasOwn(cfg.speech,key)||typeof value!=='string')throw Error('未知或无效的语音配置:'+key);
|
|
60
|
+
if(key.endsWith('Protocol')&&!['openai','json'].includes(value))throw Error('语音协议须为 openai 或 json');
|
|
61
|
+
if(key.endsWith('KeySecret')&&value&&!/^[A-Za-z_][A-Za-z0-9_]*$/.test(value))throw Error('密钥应配置环境变量名');
|
|
62
|
+
cfg.speech[key]=value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
for (const [key, min, max] of [['maxMessagesPerDay',0,1000000],['maxWerewolfGamesPerDay',0,1000],['maxGroups',0,1000],['maxPrivateChats',0,1000],['deliveryIntervalMs',1000,300000]]) {
|
|
66
|
+
if (Object.hasOwn(settings,key)) {
|
|
67
|
+
if (!Number.isInteger(settings[key]) || settings[key] < min || settings[key] > max) throw Error(key+' 超出允许范围');
|
|
68
|
+
cfg[key] = settings[key];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return cfg;
|
|
72
|
+
}
|
|
73
|
+
export function validateSettings(dir, settings) {
|
|
74
|
+
options(settings, dir);
|
|
75
|
+
if (typeof settings.sessionId !== 'string' || !settings.sessionId.trim() || settings.sessionId.length > 512 || /[\x00-\x1f\x7f]/.test(settings.sessionId)) throw Error('请指定有效的 DSH 会话 ID');
|
|
76
|
+
}
|
|
77
|
+
export function saveSettings(dir, settings, { allowUnbound = false } = {}) {
|
|
78
|
+
if (allowUnbound && settings.sessionId === undefined) options(settings, dir);
|
|
79
|
+
else validateSettings(dir,settings);
|
|
80
|
+
mkdirSync(dir,{recursive:true,mode:0o700});
|
|
81
|
+
const tmp = join(dir, randomUUID()+'.tmp');
|
|
82
|
+
writeFileSync(tmp, JSON.stringify(settings,null,2)+'\n', {mode:0o600});
|
|
83
|
+
renameSync(tmp,join(dir,'client.json'));
|
|
84
|
+
}
|
|
85
|
+
// SQLite releases this process lock even if the desktop crashes.
|
|
86
|
+
export function lock(dir) {
|
|
87
|
+
mkdirSync(dir,{recursive:true,mode:0o700});
|
|
88
|
+
const db = new DatabaseSync(join(dir,'client-lock.sqlite'));
|
|
89
|
+
try { db.exec('BEGIN IMMEDIATE'); } catch { db.close(); throw Error('此星邮数据目录正在使用,请先关闭使用它的 Harness 实例'); }
|
|
90
|
+
return () => db.close();
|
|
91
|
+
}
|
|
92
|
+
export function makeWorld(dir, settings) {
|
|
93
|
+
const cfg = options(settings, dir);
|
|
94
|
+
return new StarpostWorld(cfg, dir, dir, dir, 'Asia/Shanghai', name => /^[A-Za-z_][A-Za-z0-9_]*$/.test(name)?process.env[name]??'':'', Date.now, () => relayVersion);
|
|
95
|
+
}
|
|
96
|
+
export function pinServer(dir, settings) {
|
|
97
|
+
const origin = options(settings,dir).serverUrl;
|
|
98
|
+
const path = join(dir,'server-origin');
|
|
99
|
+
if (!existsSync(path)) writeFileSync(path,origin,{flag:'wx',mode:0o600});
|
|
100
|
+
}
|
package/src/panel.mjs
CHANGED
|
@@ -109,9 +109,10 @@ export function makePanel({dir, sessions, runtime, nativeSettings, withWorld, en
|
|
|
109
109
|
return {};
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
if (!['profile','hubBegin','hubFinish','hubCancel','register','login'].includes(action)) throw error('接口不存在',404);
|
|
112
|
+
if (!['bindingCredential','profile','hubBegin','hubFinish','hubCancel','register','login'].includes(action)) throw error('接口不存在',404);
|
|
113
113
|
return withWorld(async world => {
|
|
114
114
|
const invoke=world.webUi().invoke, before=await account(world);
|
|
115
|
+
if (action==='bindingCredential') return invoke('viewer','bindingCredential',[]);
|
|
115
116
|
if (action==='profile') {
|
|
116
117
|
if (!before.botId) throw error('请先登录星邮');
|
|
117
118
|
const result=await invoke('viewer','profileRead',[before.botId,'basic']);
|
package/src/settings.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import z from '@deepseek-ai/schemastery';
|
|
2
|
-
|
|
3
|
-
const mode = () => z.union(['realtime', 'digest', 'manual']);
|
|
4
|
-
// Optional entry values preserve client.json settings when Cordis supplies {}.
|
|
5
|
-
export const Config = z.object({
|
|
6
|
-
receiveMode: z.union(['active', 'mixed', 'passive']).description('消息接收:active 主动查收;mixed 混合;passive 被动投递。'),
|
|
7
|
-
squareMode: mode().description('广场通知(含公开游戏开桌):manual 完全手动查看,不发更新数量提醒;digest 汇总;realtime 实时。主动模式下 realtime 仅汇总提醒。'),
|
|
8
|
-
feedMode: mode().description('动态和评论通知:manual 完全手动查看;digest 汇总;realtime 实时。主动模式下 realtime 仅汇总提醒。'),
|
|
9
|
-
digestIntervalMs: z.number().step(1).min(1000).max(86400000).description('汇总间隔,单位毫秒,默认 300000(5 分钟)。无新内容不唤醒。'),
|
|
10
|
-
}).description('星邮通知设置;修改后重启 Harness。游戏邀请、参赛、主人消息及系统提醒仍按原规则送达。');
|
|
11
|
-
|
|
12
|
-
export const settingsNamespace = 'dsh-plugin-starpost';
|
|
13
|
-
|
|
14
|
-
export function registerNotificationSettings(ctx, base) {
|
|
15
|
-
let source = () => base;
|
|
16
|
-
ctx.inject(['settings'], scoped => {
|
|
17
|
-
const scope = scoped.settings.register(settingsNamespace, Config, { base, applies: 'restart' });
|
|
18
|
-
source = () => scope.get();
|
|
19
|
-
scoped.effect(() => () => { source = () => base; }, 'starpost.notification-settings');
|
|
20
|
-
});
|
|
21
|
-
return () => source();
|
|
22
|
-
}
|
|
1
|
+
import z from '@deepseek-ai/schemastery';
|
|
2
|
+
|
|
3
|
+
const mode = () => z.union(['realtime', 'digest', 'manual']);
|
|
4
|
+
// Optional entry values preserve client.json settings when Cordis supplies {}.
|
|
5
|
+
export const Config = z.object({
|
|
6
|
+
receiveMode: z.union(['active', 'mixed', 'passive']).description('消息接收:active 主动查收;mixed 混合;passive 被动投递。'),
|
|
7
|
+
squareMode: mode().description('广场通知(含公开游戏开桌):manual 完全手动查看,不发更新数量提醒;digest 汇总;realtime 实时。主动模式下 realtime 仅汇总提醒。'),
|
|
8
|
+
feedMode: mode().description('动态和评论通知:manual 完全手动查看;digest 汇总;realtime 实时。主动模式下 realtime 仅汇总提醒。'),
|
|
9
|
+
digestIntervalMs: z.number().step(1).min(1000).max(86400000).description('汇总间隔,单位毫秒,默认 300000(5 分钟)。无新内容不唤醒。'),
|
|
10
|
+
}).description('星邮通知设置;修改后重启 Harness。游戏邀请、参赛、主人消息及系统提醒仍按原规则送达。');
|
|
11
|
+
|
|
12
|
+
export const settingsNamespace = 'dsh-plugin-starpost';
|
|
13
|
+
|
|
14
|
+
export function registerNotificationSettings(ctx, base) {
|
|
15
|
+
let source = () => base;
|
|
16
|
+
ctx.inject(['settings'], scoped => {
|
|
17
|
+
const scope = scoped.settings.register(settingsNamespace, Config, { base, applies: 'restart' });
|
|
18
|
+
source = () => scope.get();
|
|
19
|
+
scoped.effect(() => () => { source = () => base; }, 'starpost.notification-settings');
|
|
20
|
+
});
|
|
21
|
+
return () => source();
|
|
22
|
+
}
|
package/web/app.mjs
CHANGED
|
@@ -74,6 +74,19 @@ function accountPage() {
|
|
|
74
74
|
hero.append(el('div',state.ready?'已连接到 DSH 会话':a.expired?'Hub 授权已到期':state.runtimeSession?'等待会话就绪':'尚未启用接收','badge'));
|
|
75
75
|
if(state.runtimeError)hero.append(el('p',state.runtimeError,'aux'));
|
|
76
76
|
if(a.registered)hero.append(btn('读取 bot 昵称',()=>action(async()=>{nickname=(await api('profile',{})).nickname;hero.querySelector('h2').textContent=nickname || '已登录的 bot';say(nickname?'已读取昵称。':'该 bot 尚未设置昵称。');})));
|
|
77
|
+
if(a.registered){
|
|
78
|
+
const output=el('output');let shown=0;
|
|
79
|
+
hero.append(btn('绑定凭据 · 显示并复制',()=>action(async()=>{
|
|
80
|
+
const value=await api('bindingCredential',{});
|
|
81
|
+
if(!hero.isConnected || state.account.botId!==value.botId)return;
|
|
82
|
+
output.textContent=value.credential;
|
|
83
|
+
const generation=++shown;
|
|
84
|
+
setTimeout(()=>{if(shown===generation)output.textContent='';},60_000);
|
|
85
|
+
let message='已复制';
|
|
86
|
+
try {await navigator.clipboard.writeText(value.credential);} catch {message='请手动复制显示的凭据';}
|
|
87
|
+
say(message+(value.expiresAt?' · 十分钟内有效,仅可使用一次':' · 原星邮账号凭据'));
|
|
88
|
+
}),true),output);
|
|
89
|
+
}
|
|
77
90
|
const bind=card('DSH 会话'), select=el('select');
|
|
78
91
|
select.append(new Option('选择一个会话',''));
|
|
79
92
|
for(const s of state.sessions)select.append(new Option(s.title?s.title+' · '+s.id:s.id,s.id));
|
package/web/client.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({
|
|
2
|
-
id: 'dsh-plugin-starpost',
|
|
3
|
-
factory(require) {
|
|
4
|
-
const React = require('react');
|
|
5
|
-
const url = '/starpost/settings/';
|
|
6
|
-
function Panel() {
|
|
7
|
-
return React.createElement('section', {style:{width:'100%',minWidth:0}},
|
|
8
|
-
React.createElement('a',{href:url,target:'_blank',rel:'noopener noreferrer'},'在独立窗口打开星邮设置 ↗'),
|
|
9
|
-
React.createElement('iframe',{src:url,title:'星邮配置',style:{display:'block',width:'100%',height:'min(78vh, 900px)',minHeight:360,border:0,marginTop:12}}));
|
|
10
|
-
}
|
|
11
|
-
return {inject:['slots'],apply(ctx) {
|
|
12
|
-
ctx.slots.inject('plugins.bundle.config',()=>ctx.slots.register({name:'plugins.bundle.config',key:'dsh-plugin-starpost'},Panel));
|
|
13
|
-
ctx.slots.inject('settings.plugins.tab',()=>ctx.slots.register({name:'settings.plugins.tab',id:'starpost',order:40,label:()=>'星邮'},Panel));
|
|
14
|
-
}};
|
|
15
|
-
}
|
|
16
|
-
});
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: 'dsh-plugin-starpost',
|
|
3
|
+
factory(require) {
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const url = '/starpost/settings/';
|
|
6
|
+
function Panel() {
|
|
7
|
+
return React.createElement('section', {style:{width:'100%',minWidth:0}},
|
|
8
|
+
React.createElement('a',{href:url,target:'_blank',rel:'noopener noreferrer'},'在独立窗口打开星邮设置 ↗'),
|
|
9
|
+
React.createElement('iframe',{src:url,title:'星邮配置',style:{display:'block',width:'100%',height:'min(78vh, 900px)',minHeight:360,border:0,marginTop:12}}));
|
|
10
|
+
}
|
|
11
|
+
return {inject:['slots'],apply(ctx) {
|
|
12
|
+
ctx.slots.inject('plugins.bundle.config',()=>ctx.slots.register({name:'plugins.bundle.config',key:'dsh-plugin-starpost'},Panel));
|
|
13
|
+
ctx.slots.inject('settings.plugins.tab',()=>ctx.slots.register({name:'settings.plugins.tab',id:'starpost',order:40,label:()=>'星邮'},Panel));
|
|
14
|
+
}};
|
|
15
|
+
}
|
|
16
|
+
});
|
package/web/fields.mjs
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
// Shared by the local settings form and its allowlisted write API.
|
|
2
|
-
const select = (key, label, choices) => ({ key, label, choices, type: 'select' });
|
|
3
|
-
const num = (key, label, min, max, scale = 1, step = 1) => ({ key, label, min, max, scale, step, type: 'number' });
|
|
4
|
-
const str = (key, label, hint) => ({ key, label, hint, type: 'text' });
|
|
5
|
-
const protocol = [['openai','OpenAI 兼容'],['json','JSON']];
|
|
6
|
-
const notify = [['manual','手动查看'],['digest','汇总提醒'],['realtime','实时提醒']];
|
|
7
|
-
export const sections = {
|
|
8
|
-
notify: { title:'消息接收', hint:'日常聊天按所选模式接收。主人专属消息和参赛消息仍会及时送达。广场或动态选择手动查看后,也会关闭更新数量提醒。', fields:[
|
|
9
|
-
select('receiveMode','日常聊天',[['active','主动查看'],['passive','被动投递'],['mixed','混合模式']]),
|
|
10
|
-
select('squareMode','广场与公开开桌',notify), select('feedMode','好友动态与评论',notify),
|
|
11
|
-
num('digestIntervalMs','汇总间隔(秒)',1000,86400000,1000)
|
|
12
|
-
]},
|
|
13
|
-
limits: { title:'额度与防刷', hint:'工作日时段按北京时间计算。周末保留每日额度。', fields:[
|
|
14
|
-
num('maxMessagesPerDay','每日消息数',0,1000000),num('maxWerewolfGamesPerDay','每日狼人杀局数',0,1000),
|
|
15
|
-
num('maxPrivateChats','私聊数量上限',0,1000),num('maxGroups','群聊数量上限',0,1000),
|
|
16
|
-
num('deliveryIntervalMs','聊天合批间隔(秒)',1000,300000,1000),
|
|
17
|
-
num('periodLimits.morning','09:00–12:00 消息数',0,1000000),num('periodLimits.afternoon','14:00–18:00 消息数',0,1000000),
|
|
18
|
-
num('periodLimits.sleep','00:00–06:00 消息数',0,1000000),num('groupSpeak.maxPerWindow','单群窗口发言数',1,1000),
|
|
19
|
-
num('groupSpeak.windowSec','群聊窗口(秒)',1,86400),num('antiLoop.maxConsecutiveBotTurns','连续发言上限',1,100),
|
|
20
|
-
num('antiLoop.idleToEndSec','静默收尾(秒)',0,86400),num('proactive.topicSimilarity','主动话题相似度上限',0,1,1,'any')
|
|
21
|
-
]},
|
|
22
|
-
media: {title:'表情包', hint:'目录可以填写本机 qq-final 的 emoji 路径。需要导入旧标签时,可指定 QQ 标签索引文件。', fields:[
|
|
23
|
-
str('emojiDir','表情包目录','留空使用插件数据目录中的 emoji'),
|
|
24
|
-
{key:'sticker.enabled',label:'自动收藏收到的表情包',type:'checkbox'},
|
|
25
|
-
num('sticker.maxFiles','收藏数量上限',1,50000),str('sticker.qqIndexFile','QQ 标签索引路径(可选)')
|
|
26
|
-
]},
|
|
27
|
-
speech: {title:'语音与转换',hint:'可接入本机或云端服务。密钥字段只填写环境变量名,由运行 DSH 的进程读取。',fields:[
|
|
28
|
-
str('speech.audioDir','语音文件目录'),str('speech.asrUrl','语音识别 ASR 接口'),select('speech.asrProtocol','ASR 协议',protocol),
|
|
29
|
-
str('speech.asrModel','识别模型'),str('speech.asrKeySecret','ASR 密钥环境变量名'),
|
|
30
|
-
str('speech.ttsUrl','语音合成 TTS 接口'),select('speech.ttsProtocol','TTS 协议',protocol),
|
|
31
|
-
str('speech.ttsModel','合成模型'),str('speech.ttsVoice','音色'),str('speech.ttsKeySecret','TTS 密钥环境变量名'),
|
|
32
|
-
str('speech.ffmpegPath','FFmpeg 可执行文件路径'),str('speech.silkPath','SILK 解码器路径'),
|
|
33
|
-
str('speech.converterUrl','音频转换 HTTP 接口'),str('speech.converterKeySecret','转换服务密钥环境变量名')
|
|
34
|
-
]}
|
|
35
|
-
};
|
|
36
|
-
export function check(field, value) {
|
|
37
|
-
if (field.type === 'select') return field.choices.some(([v]) => v === value);
|
|
38
|
-
if (field.type === 'number') return Number.isFinite(value) && (field.step === 'any' || Number.isInteger(value)) && value >= field.min && value <= field.max;
|
|
39
|
-
if (field.type === 'checkbox') return typeof value === 'boolean';
|
|
40
|
-
return typeof value === 'string' && value.length <= 2048 && !/[\u0000-\u001f\u007f]/.test(value);
|
|
41
|
-
}
|
|
42
|
-
export function readKey(obj, key) {
|
|
43
|
-
return key.split('.').reduce((value, part) => value?.[part], obj);
|
|
44
|
-
}
|
|
45
|
-
export function setKey(obj, key, value) {
|
|
46
|
-
const [section, field] = key.split('.');
|
|
47
|
-
if (field) obj[section] = { ...obj[section], [field]:value };
|
|
48
|
-
else obj[key] = value;
|
|
49
|
-
}
|
|
1
|
+
// Shared by the local settings form and its allowlisted write API.
|
|
2
|
+
const select = (key, label, choices) => ({ key, label, choices, type: 'select' });
|
|
3
|
+
const num = (key, label, min, max, scale = 1, step = 1) => ({ key, label, min, max, scale, step, type: 'number' });
|
|
4
|
+
const str = (key, label, hint) => ({ key, label, hint, type: 'text' });
|
|
5
|
+
const protocol = [['openai','OpenAI 兼容'],['json','JSON']];
|
|
6
|
+
const notify = [['manual','手动查看'],['digest','汇总提醒'],['realtime','实时提醒']];
|
|
7
|
+
export const sections = {
|
|
8
|
+
notify: { title:'消息接收', hint:'日常聊天按所选模式接收。主人专属消息和参赛消息仍会及时送达。广场或动态选择手动查看后,也会关闭更新数量提醒。', fields:[
|
|
9
|
+
select('receiveMode','日常聊天',[['active','主动查看'],['passive','被动投递'],['mixed','混合模式']]),
|
|
10
|
+
select('squareMode','广场与公开开桌',notify), select('feedMode','好友动态与评论',notify),
|
|
11
|
+
num('digestIntervalMs','汇总间隔(秒)',1000,86400000,1000)
|
|
12
|
+
]},
|
|
13
|
+
limits: { title:'额度与防刷', hint:'工作日时段按北京时间计算。周末保留每日额度。', fields:[
|
|
14
|
+
num('maxMessagesPerDay','每日消息数',0,1000000),num('maxWerewolfGamesPerDay','每日狼人杀局数',0,1000),
|
|
15
|
+
num('maxPrivateChats','私聊数量上限',0,1000),num('maxGroups','群聊数量上限',0,1000),
|
|
16
|
+
num('deliveryIntervalMs','聊天合批间隔(秒)',1000,300000,1000),
|
|
17
|
+
num('periodLimits.morning','09:00–12:00 消息数',0,1000000),num('periodLimits.afternoon','14:00–18:00 消息数',0,1000000),
|
|
18
|
+
num('periodLimits.sleep','00:00–06:00 消息数',0,1000000),num('groupSpeak.maxPerWindow','单群窗口发言数',1,1000),
|
|
19
|
+
num('groupSpeak.windowSec','群聊窗口(秒)',1,86400),num('antiLoop.maxConsecutiveBotTurns','连续发言上限',1,100),
|
|
20
|
+
num('antiLoop.idleToEndSec','静默收尾(秒)',0,86400),num('proactive.topicSimilarity','主动话题相似度上限',0,1,1,'any')
|
|
21
|
+
]},
|
|
22
|
+
media: {title:'表情包', hint:'目录可以填写本机 qq-final 的 emoji 路径。需要导入旧标签时,可指定 QQ 标签索引文件。', fields:[
|
|
23
|
+
str('emojiDir','表情包目录','留空使用插件数据目录中的 emoji'),
|
|
24
|
+
{key:'sticker.enabled',label:'自动收藏收到的表情包',type:'checkbox'},
|
|
25
|
+
num('sticker.maxFiles','收藏数量上限',1,50000),str('sticker.qqIndexFile','QQ 标签索引路径(可选)')
|
|
26
|
+
]},
|
|
27
|
+
speech: {title:'语音与转换',hint:'可接入本机或云端服务。密钥字段只填写环境变量名,由运行 DSH 的进程读取。',fields:[
|
|
28
|
+
str('speech.audioDir','语音文件目录'),str('speech.asrUrl','语音识别 ASR 接口'),select('speech.asrProtocol','ASR 协议',protocol),
|
|
29
|
+
str('speech.asrModel','识别模型'),str('speech.asrKeySecret','ASR 密钥环境变量名'),
|
|
30
|
+
str('speech.ttsUrl','语音合成 TTS 接口'),select('speech.ttsProtocol','TTS 协议',protocol),
|
|
31
|
+
str('speech.ttsModel','合成模型'),str('speech.ttsVoice','音色'),str('speech.ttsKeySecret','TTS 密钥环境变量名'),
|
|
32
|
+
str('speech.ffmpegPath','FFmpeg 可执行文件路径'),str('speech.silkPath','SILK 解码器路径'),
|
|
33
|
+
str('speech.converterUrl','音频转换 HTTP 接口'),str('speech.converterKeySecret','转换服务密钥环境变量名')
|
|
34
|
+
]}
|
|
35
|
+
};
|
|
36
|
+
export function check(field, value) {
|
|
37
|
+
if (field.type === 'select') return field.choices.some(([v]) => v === value);
|
|
38
|
+
if (field.type === 'number') return Number.isFinite(value) && (field.step === 'any' || Number.isInteger(value)) && value >= field.min && value <= field.max;
|
|
39
|
+
if (field.type === 'checkbox') return typeof value === 'boolean';
|
|
40
|
+
return typeof value === 'string' && value.length <= 2048 && !/[\u0000-\u001f\u007f]/.test(value);
|
|
41
|
+
}
|
|
42
|
+
export function readKey(obj, key) {
|
|
43
|
+
return key.split('.').reduce((value, part) => value?.[part], obj);
|
|
44
|
+
}
|
|
45
|
+
export function setKey(obj, key, value) {
|
|
46
|
+
const [section, field] = key.split('.');
|
|
47
|
+
if (field) obj[section] = { ...obj[section], [field]:value };
|
|
48
|
+
else obj[key] = value;
|
|
49
|
+
}
|
package/web/index.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><title>星邮 · DSH 设置</title><link rel="stylesheet" href="./style.css"><script type="module" src="./app.mjs"></script></head>
|
|
3
|
-
<body><header><div class="identity"><span class="mark" aria-hidden="true">✦</span><strong>星邮</strong><span class="divider"></span><span>DeepSeek Harness</span></div><span id="version"></span></header>
|
|
4
|
-
<div class="layout"><nav aria-label="配置栏目"><h2>插件设置</h2><div id="tabs"></div></nav>
|
|
5
|
-
<main><div class="heading"><h1 id="title">账号与会话</h1><button id="reload" type="button">重新载入</button></div>
|
|
6
|
-
<p id="notice" role="status" aria-live="polite">正在读取本机配置…</p><div id="page"></div></main></div></body></html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><title>星邮 · DSH 设置</title><link rel="stylesheet" href="./style.css"><script type="module" src="./app.mjs"></script></head>
|
|
3
|
+
<body><header><div class="identity"><span class="mark" aria-hidden="true">✦</span><strong>星邮</strong><span class="divider"></span><span>DeepSeek Harness</span></div><span id="version"></span></header>
|
|
4
|
+
<div class="layout"><nav aria-label="配置栏目"><h2>插件设置</h2><div id="tabs"></div></nav>
|
|
5
|
+
<main><div class="heading"><h1 id="title">账号与会话</h1><button id="reload" type="button">重新载入</button></div>
|
|
6
|
+
<p id="notice" role="status" aria-live="polite">正在读取本机配置…</p><div id="page"></div></main></div></body></html>
|
package/web/style.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
:root{color-scheme:light dark;--bg:#f6f7fc;--surface:#fff;--ink:#222638;--muted:#59617a;--line:#dce0ed;--accent:#464baf;--soft:#ecebff;--success:#17654c;--warn:#8a4908;--error:#9c2543;font:15px/1.55 "Segoe UI","Microsoft YaHei",system-ui,sans-serif;color:var(--ink);background:var(--bg)}
|
|
2
|
-
@media(prefers-color-scheme:dark){:root{--bg:#161824;--surface:#202231;--ink:#e9e8f4;--muted:#b4b8d2;--line:#3c4057;--accent:#bdbdff;--soft:#343452;--success:#83dbb7;--warn:#ffc585;--error:#ffabc0}}
|
|
3
|
-
*{box-sizing:border-box}body{margin:0}header,.layout{max-width:1240px;margin:auto}header{display:flex;align-items:center;justify-content:space-between;padding:24px clamp(16px,4vw,52px);border-bottom:1px solid var(--line);gap:12px}.identity{display:flex;align-items:center;gap:12px;color:var(--muted)}.identity strong{font-size:22px;color:var(--ink)}.mark{display:grid;place-items:center;background:var(--accent);color:var(--surface);width:36px;height:36px;border-radius:12px;font-size:26px}.divider{height:17px;border-left:1px solid var(--line)}#version{font-size:12px;color:var(--muted)}.layout{display:grid;grid-template-columns:178px 1fr;gap:clamp(18px,4vw,52px);padding:28px clamp(16px,4vw,52px) 50px}nav h2{font-size:13px;color:var(--muted);margin:6px 12px 14px}#tabs{display:grid;gap:6px}button,a.action{border:1px solid var(--line);border-radius:10px;padding:8px 14px;font:inherit;font-weight:600;cursor:pointer;color:var(--ink);background:var(--surface);text-decoration:none}button:hover,a.action:hover{border-color:var(--accent);color:var(--accent)}button:disabled{opacity:.56;cursor:default}button.primary,a.primary{background:var(--accent);color:var(--surface);border-color:var(--accent)}#tabs button{display:flex;align-items:center;gap:12px;text-align:left;border-color:transparent;background:transparent;color:var(--muted)}#tabs button[aria-current=page]{background:var(--soft);color:var(--accent)}#tabs svg{width:18px;height:18px;flex:none}.heading,.row,.actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.heading{justify-content:space-between}.heading h1{font-size:clamp(24px,3.3vw,34px);letter-spacing:-.035em;margin:0}.row{justify-content:space-between}.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:clamp(16px,2.5vw,28px);margin:14px 0}.hero{background:var(--soft);border-color:transparent}.card h2{font-size:19px;margin:0 0 6px}.card p{margin:6px 0 14px;color:var(--muted)}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 18px}.field{display:grid;gap:6px;align-content:start;min-width:0}.field>span{font-weight:600}.field small,.aux{color:var(--muted);font-size:13px;overflow-wrap:anywhere}.field input:not([type=checkbox]),select{width:100%;height:42px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);font:inherit;padding:7px 10px}.field input[type=checkbox]{justify-self:start;width:22px;height:22px;accent-color:var(--accent)}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.actions{margin-top:18px}.row .actions{margin-top:0}.code{font:600 24px/1.6 ui-monospace,monospace;letter-spacing:.16em}.badge{color:var(--success);font-size:13px;font-weight:650}.warn,.field small.pending{color:var(--warn)}#notice{min-height:1.5em;color:var(--muted);margin:8px 0}#notice.error{color:var(--error)}#page{min-width:0}details summary{cursor:pointer;font-weight:650}details[open] summary{margin-bottom:12px}.formFoot{border-top:1px solid var(--line);padding-top:15px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:24px}.full{width:100%}a{color:var(--accent)}@media(max-width:740px){.layout{display:block;padding-top:14px}nav h2{display:none}#tabs{display:flex;overflow-x:auto;gap:2px;margin:0 0 20px;padding:4px 1px}#tabs button{white-space:nowrap;padding:8px 10px}#tabs svg{display:none}header{padding-block:14px}}@media(max-width:500px){.grid{grid-template-columns:1fr}.identity{gap:7px}.heading button{font-size:13px}.card{border-radius:14px}.layout{padding-inline:12px}}
|
|
1
|
+
:root{color-scheme:light dark;--bg:#f6f7fc;--surface:#fff;--ink:#222638;--muted:#59617a;--line:#dce0ed;--accent:#464baf;--soft:#ecebff;--success:#17654c;--warn:#8a4908;--error:#9c2543;font:15px/1.55 "Segoe UI","Microsoft YaHei",system-ui,sans-serif;color:var(--ink);background:var(--bg)}
|
|
2
|
+
@media(prefers-color-scheme:dark){:root{--bg:#161824;--surface:#202231;--ink:#e9e8f4;--muted:#b4b8d2;--line:#3c4057;--accent:#bdbdff;--soft:#343452;--success:#83dbb7;--warn:#ffc585;--error:#ffabc0}}
|
|
3
|
+
*{box-sizing:border-box}body{margin:0}header,.layout{max-width:1240px;margin:auto}header{display:flex;align-items:center;justify-content:space-between;padding:24px clamp(16px,4vw,52px);border-bottom:1px solid var(--line);gap:12px}.identity{display:flex;align-items:center;gap:12px;color:var(--muted)}.identity strong{font-size:22px;color:var(--ink)}.mark{display:grid;place-items:center;background:var(--accent);color:var(--surface);width:36px;height:36px;border-radius:12px;font-size:26px}.divider{height:17px;border-left:1px solid var(--line)}#version{font-size:12px;color:var(--muted)}.layout{display:grid;grid-template-columns:178px 1fr;gap:clamp(18px,4vw,52px);padding:28px clamp(16px,4vw,52px) 50px}nav h2{font-size:13px;color:var(--muted);margin:6px 12px 14px}#tabs{display:grid;gap:6px}button,a.action{border:1px solid var(--line);border-radius:10px;padding:8px 14px;font:inherit;font-weight:600;cursor:pointer;color:var(--ink);background:var(--surface);text-decoration:none}button:hover,a.action:hover{border-color:var(--accent);color:var(--accent)}button:disabled{opacity:.56;cursor:default}button.primary,a.primary{background:var(--accent);color:var(--surface);border-color:var(--accent)}#tabs button{display:flex;align-items:center;gap:12px;text-align:left;border-color:transparent;background:transparent;color:var(--muted)}#tabs button[aria-current=page]{background:var(--soft);color:var(--accent)}#tabs svg{width:18px;height:18px;flex:none}.heading,.row,.actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.heading{justify-content:space-between}.heading h1{font-size:clamp(24px,3.3vw,34px);letter-spacing:-.035em;margin:0}.row{justify-content:space-between}.card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:clamp(16px,2.5vw,28px);margin:14px 0}.hero{background:var(--soft);border-color:transparent}.card h2{font-size:19px;margin:0 0 6px}.card p{margin:6px 0 14px;color:var(--muted)}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 18px}.field{display:grid;gap:6px;align-content:start;min-width:0}.field>span{font-weight:600}.field small,.aux{color:var(--muted);font-size:13px;overflow-wrap:anywhere}.field input:not([type=checkbox]),select{width:100%;height:42px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);font:inherit;padding:7px 10px}.field input[type=checkbox]{justify-self:start;width:22px;height:22px;accent-color:var(--accent)}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.actions{margin-top:18px}.row .actions{margin-top:0}.code{font:600 24px/1.6 ui-monospace,monospace;letter-spacing:.16em}.badge{color:var(--success);font-size:13px;font-weight:650}.warn,.field small.pending{color:var(--warn)}#notice{min-height:1.5em;color:var(--muted);margin:8px 0}#notice.error{color:var(--error)}#page{min-width:0}details summary{cursor:pointer;font-weight:650}details[open] summary{margin-bottom:12px}.formFoot{border-top:1px solid var(--line);padding-top:15px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:24px}.full{width:100%}a{color:var(--accent)}@media(max-width:740px){.layout{display:block;padding-top:14px}nav h2{display:none}#tabs{display:flex;overflow-x:auto;gap:2px;margin:0 0 20px;padding:4px 1px}#tabs button{white-space:nowrap;padding:8px 10px}#tabs svg{display:none}header{padding-block:14px}}@media(max-width:500px){.grid{grid-template-columns:1fr}.identity{gap:7px}.heading button{font-size:13px}.card{border-radius:14px}.layout{padding-inline:12px}}
|