@shuning0128/dsh-voice-hotkey 0.0.0-stage → 0.2.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 +67 -0
- package/LICENSE +21 -0
- package/README.en.md +110 -0
- package/README.md +109 -2
- package/client.js +2252 -0
- package/cordis.patch.yml +3 -0
- package/docs/images/composer-keyboard-icon.png +0 -0
- package/icon.svg +6 -0
- package/index.js +53 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +61 -4
package/cordis.patch.yml
ADDED
|
Binary file
|
package/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Voice input hotkey">
|
|
2
|
+
<rect x="24" y="8" width="16" height="30" rx="8" fill="#2b7fff"/>
|
|
3
|
+
<path d="M16 30a16 16 0 0 0 32 0" fill="none" stroke="#2b7fff" stroke-width="4" stroke-linecap="round"/>
|
|
4
|
+
<line x1="32" y1="46" x2="32" y2="54" stroke="#2b7fff" stroke-width="4" stroke-linecap="round"/>
|
|
5
|
+
<line x1="22" y1="54" x2="42" y2="54" stroke="#2b7fff" stroke-width="4" stroke-linecap="round"/>
|
|
6
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host half of the voice-hotkey bundle.
|
|
3
|
+
*
|
|
4
|
+
* The Config is volatile: Settings projects volatile fields into the plugin's
|
|
5
|
+
* auto-generated config form (插件管理 → 详情), and the browser half reads and
|
|
6
|
+
* subscribes through ctx.configForms, so key edits apply without a restart.
|
|
7
|
+
*/
|
|
8
|
+
import z from '@deepseek-ai/schemastery'
|
|
9
|
+
|
|
10
|
+
export const name = '@shuning0128/dsh-voice-hotkey'
|
|
11
|
+
|
|
12
|
+
export const Config = z
|
|
13
|
+
.object({
|
|
14
|
+
hotkey: z
|
|
15
|
+
.string()
|
|
16
|
+
.default('')
|
|
17
|
+
.description(
|
|
18
|
+
'听写触发键位。默认留空,即不绑定:各平台均需录制一次,避免预置组合与既有快捷键或浏览器行为冲突。'
|
|
19
|
+
+ '写法为修饰键加一个按键,以 + 连接;修饰键支持 primary(macOS 为 ⌘,其他平台为 Ctrl)、ctrl、meta、alt、shift。'
|
|
20
|
+
+ '每个键位必须包含 ctrl、alt 或 meta 之一(shift 仅作叠加);可用 F1–F12、字母、数字、符号键、方向键、'
|
|
21
|
+
+ 'Home/End、PgUp/PgDn、Ins/Del、空格、Tab、Enter;小键盘用 num1–num0 与 num+/num-/num*/num//num.;'
|
|
22
|
+
+ '鼠标用 mouse1–mouse5(亦可写 middle/back/forward/right),其中侧键 mouse4、mouse5 可单独使用;桌面版右键 mouse3 也可单按(触发后不弹右键菜单),其余需配修饰键。'
|
|
23
|
+
+ '网页版另拒绝浏览器保留的组合(如 Ctrl+W、Ctrl+Tab、F5、F11/F12)。'
|
|
24
|
+
+ '示例:primary+F8、ctrl+alt+F8、meta+shift+D、ctrl+ArrowUp、ctrl+/。',
|
|
25
|
+
),
|
|
26
|
+
defaultHotkey: z
|
|
27
|
+
.string()
|
|
28
|
+
.default('')
|
|
29
|
+
.description('「恢复默认」回到该键位。留空表示无默认键位,此时恢复默认等同于清空(未绑定)。新安装时此值亦为空。'),
|
|
30
|
+
autoSend: z
|
|
31
|
+
.boolean()
|
|
32
|
+
.default(false)
|
|
33
|
+
.description(
|
|
34
|
+
'识别完成后自动发送(默认关闭)。仅处理由触发键发起的录音;观察到转写阶段且草稿版本前进、内容非空后,才通过当前会话的提交接口提交。录音取消、未识别出文本、无法确认插入或草稿继续变化时均不提交。',
|
|
35
|
+
),
|
|
36
|
+
autoSendDelay: z
|
|
37
|
+
.number()
|
|
38
|
+
.default(0)
|
|
39
|
+
.description('自动发送延时,单位秒:0 表示立即发送,上限 600。延时期间按 Esc 可取消本次发送。'),
|
|
40
|
+
autoSendBusy: z
|
|
41
|
+
.union(['queue', 'enter'])
|
|
42
|
+
.default('queue')
|
|
43
|
+
.description(
|
|
44
|
+
'自动发送在会话繁忙时的行为。queue=排队发送:调用会话的官方提交接口,消息进入队列;'
|
|
45
|
+
+ 'enter=插队发送:模拟按一次回车,与用户按回车同一条路径。'
|
|
46
|
+
+ 'enter 要在繁忙时真正插队,需把 DSH 设置「繁忙时的发送行为」设为「插话发送」,否则效果等同排队。',
|
|
47
|
+
),
|
|
48
|
+
})
|
|
49
|
+
.volatile()
|
|
50
|
+
|
|
51
|
+
export function apply() {}
|
|
52
|
+
|
|
53
|
+
export default { name, Config, apply }
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Voice input hotkey",
|
|
4
|
+
"description": "Trigger voice input from the keyboard or mouse: press once to start recording, press again to stop and transcribe (requires the \"Voice input\" plugin). The key can be changed on the plugin detail page.",
|
|
5
|
+
"detail": "README.en.md"
|
|
6
|
+
}
|
|
7
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuning0128/dsh-voice-hotkey",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "给 DeepSeek Harness 的语音输入加一个可配置的键盘开关:按一次开始录音,再按一次停止并识别,可选择性识别完自动发送。",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/shuning0128/dsh-voice-hotkey.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/shuning0128/dsh-voice-hotkey#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/shuning0128/dsh-voice-hotkey/issues"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"dsh-plugin",
|
|
15
|
+
"voice",
|
|
16
|
+
"dictation",
|
|
17
|
+
"hotkey",
|
|
18
|
+
"speech-to-text"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"author": "shuning0128",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"test": "node test/harness.mjs",
|
|
28
|
+
"check": "node --check index.js && node --check client.js"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"dsh": ">=0.2.1-rc.1 <0.3.0-0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
35
|
+
},
|
|
36
|
+
"exports": {
|
|
37
|
+
".": "./index.js",
|
|
38
|
+
"./client": "./client.js",
|
|
39
|
+
"./locale/*.json": "./locale/*.json",
|
|
40
|
+
"./icon": "./icon.svg"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"index.js",
|
|
44
|
+
"client.js",
|
|
45
|
+
"cordis.patch.yml",
|
|
46
|
+
"locale/*.json",
|
|
47
|
+
"README.md",
|
|
48
|
+
"README.en.md",
|
|
49
|
+
"docs/images/composer-keyboard-icon.png",
|
|
50
|
+
"CHANGELOG.md",
|
|
51
|
+
"icon.svg"
|
|
52
|
+
],
|
|
53
|
+
"dsh": {
|
|
54
|
+
"bundle": {
|
|
55
|
+
"patch": "./cordis.patch.yml"
|
|
56
|
+
},
|
|
57
|
+
"client": {
|
|
58
|
+
"platform": "web",
|
|
59
|
+
"immediately": true,
|
|
60
|
+
"inject": []
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|