@vibedev-si/dsh-island 0.0.0-stage → 0.2.0
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 +63 -0
- package/LICENSE +27 -0
- package/THIRD-PARTY-NOTICES.txt +8458 -0
- package/approvals.js +125 -0
- package/attention.js +123 -0
- package/bin/win32-x64/vibedev-island.exe +0 -0
- package/changelog.js +80 -0
- package/client.js +2809 -0
- package/contributions.js +261 -0
- package/contributor-display.js +68 -0
- package/contributor-entry.js +49 -0
- package/cordis.patch.yml +6 -0
- package/diagnostics.js +92 -0
- package/events.js +89 -0
- package/executable.js +37 -0
- package/icon.svg +21 -0
- package/index.js +1291 -0
- package/island-items.js +191 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/log.js +53 -0
- package/openers.js +77 -0
- package/outbox.js +78 -0
- package/package.json +80 -4
- package/recent.js +194 -0
- package/requests.js +84 -0
- package/routes.js +201 -0
- package/selection.js +78 -0
- package/sessions.js +258 -0
- package/settings.js +344 -0
- package/third-party.json +1666 -0
- package/translate.js +53 -0
- package/wechat.js +53 -0
- package/README.md +0 -3
package/island-items.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 别的插件直接放到小岛上的东西:`ctx.island.status / task / page / notify / remove`。
|
|
3
|
+
* (带开始、更新、结束的后台任务走 `contributor()`,在 contributions.js。)
|
|
4
|
+
*
|
|
5
|
+
* 别的插件通过它在小岛上放状态项、后台任务、一页进度和会自己消失的通知。每一条都记着是哪个插件放的
|
|
6
|
+
* (小岛上会写出来),那个插件停用时一起撤下。用户可以在设置里关掉整个入口,或者单独关掉某个插件。
|
|
7
|
+
*
|
|
8
|
+
* 限流:每个插件的通知一分钟最多 3 条;更新得再快,每个插件半秒才往小岛发一次,只发每一条的最新样子;
|
|
9
|
+
* 每个插件最多同时挂 12 条。
|
|
10
|
+
*
|
|
11
|
+
* 纯逻辑:不碰宿主也不碰协议,`send(method, params)` 由 index.js 传进来。
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const NOTICES_PER_MINUTE = 3
|
|
15
|
+
export const MAX_ITEMS_PER_PLUGIN = 12
|
|
16
|
+
export const FLUSH_MS = 500
|
|
17
|
+
const MINUTE_MS = 60_000
|
|
18
|
+
const KINDS = ['status', 'task', 'page']
|
|
19
|
+
|
|
20
|
+
const clip = (value, limit) =>
|
|
21
|
+
typeof value === 'string' && value.trim() !== '' ? value.trim().slice(0, limit) : undefined
|
|
22
|
+
|
|
23
|
+
const fraction = (value) =>
|
|
24
|
+
typeof value === 'number' && Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : null
|
|
25
|
+
|
|
26
|
+
/** 一条贡献的内容;不像样的返回 undefined。 */
|
|
27
|
+
export function contributionOf(kind, input) {
|
|
28
|
+
if (!KINDS.includes(kind) || input === null || typeof input !== 'object') return undefined
|
|
29
|
+
const id = clip(input.id, 64)
|
|
30
|
+
const title = clip(input.title, 80)
|
|
31
|
+
if (id === undefined || title === undefined) return undefined
|
|
32
|
+
const item = { kind, id, title }
|
|
33
|
+
const detail = clip(input.detail, 200)
|
|
34
|
+
if (detail !== undefined) item.detail = detail
|
|
35
|
+
if (kind === 'task') item.progress = fraction(input.progress)
|
|
36
|
+
if (kind === 'page') {
|
|
37
|
+
const rows = (Array.isArray(input.rows) ? input.rows : [])
|
|
38
|
+
.slice(0, 8)
|
|
39
|
+
.map((row) => ({
|
|
40
|
+
label: clip(row?.label, 60),
|
|
41
|
+
progress: fraction(row?.progress),
|
|
42
|
+
...(row?.state === 'failed' || row?.state === 'done' ? { state: row.state } : undefined),
|
|
43
|
+
}))
|
|
44
|
+
.filter((row) => row.label !== undefined)
|
|
45
|
+
if (rows.length === 0) return undefined
|
|
46
|
+
item.rows = rows
|
|
47
|
+
}
|
|
48
|
+
return item
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** 一条通知;不像样的返回 undefined。 */
|
|
52
|
+
export function noticeOf(input) {
|
|
53
|
+
const title = clip(input?.title, 80)
|
|
54
|
+
if (title === undefined) return undefined
|
|
55
|
+
const notice = { title }
|
|
56
|
+
const body = clip(input?.body, 200)
|
|
57
|
+
if (body !== undefined) notice.body = body
|
|
58
|
+
if (typeof input?.durationMs === 'number' && Number.isFinite(input.durationMs)) {
|
|
59
|
+
notice.durationMs = Math.min(15_000, Math.max(2_000, input.durationMs))
|
|
60
|
+
}
|
|
61
|
+
return notice
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @param options.send 发给岛屿:`(method, params) => void`
|
|
66
|
+
* @param options.allowed 这个插件现在能不能放:`(plugin) => boolean`
|
|
67
|
+
*/
|
|
68
|
+
export function createIslandItems({
|
|
69
|
+
send,
|
|
70
|
+
allowed,
|
|
71
|
+
displayOf = (plugin) => ({ title: plugin, icon: 'box' }),
|
|
72
|
+
setTimer = setTimeout,
|
|
73
|
+
clearTimer = clearTimeout,
|
|
74
|
+
now = Date.now,
|
|
75
|
+
log = () => undefined,
|
|
76
|
+
}) {
|
|
77
|
+
/** 插件名 → `{ items, pending, timer, notices, lastAt }` */
|
|
78
|
+
const plugins = new Map()
|
|
79
|
+
|
|
80
|
+
const stateOf = (plugin) => {
|
|
81
|
+
let state = plugins.get(plugin)
|
|
82
|
+
if (state === undefined) {
|
|
83
|
+
state = { items: new Map(), pending: new Map(), timer: undefined, notices: [], lastAt: 0, full: false }
|
|
84
|
+
plugins.set(plugin, state)
|
|
85
|
+
}
|
|
86
|
+
return state
|
|
87
|
+
}
|
|
88
|
+
const islandId = (plugin, id) => `plugin:${plugin}:${id}`
|
|
89
|
+
const message = (plugin, item) => {
|
|
90
|
+
const display = displayOf(plugin)
|
|
91
|
+
return { ...item, id: islandId(plugin, item.id), owner: plugin, source: display.title, icon: display.icon }
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const flush = (plugin) => {
|
|
95
|
+
const state = plugins.get(plugin)
|
|
96
|
+
if (state === undefined) return
|
|
97
|
+
state.timer = undefined
|
|
98
|
+
for (const [id, item] of state.pending) {
|
|
99
|
+
if (item === null) send('contrib/remove', { id: islandId(plugin, id) })
|
|
100
|
+
else send('contrib/upsert', message(plugin, item))
|
|
101
|
+
}
|
|
102
|
+
state.pending.clear()
|
|
103
|
+
}
|
|
104
|
+
const schedule = (plugin, state) => {
|
|
105
|
+
if (state.timer === undefined) state.timer = setTimer(() => flush(plugin), FLUSH_MS)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
/** 放上或更新一条(`kind` 是 status / task / page)。返回收下了没有。 */
|
|
110
|
+
put(plugin, kind, input) {
|
|
111
|
+
if (!allowed(plugin)) return false
|
|
112
|
+
const item = contributionOf(kind, input)
|
|
113
|
+
if (item === undefined) return false
|
|
114
|
+
const state = stateOf(plugin)
|
|
115
|
+
if (!state.items.has(item.id) && state.items.size >= MAX_ITEMS_PER_PLUGIN) {
|
|
116
|
+
if (!state.full) log(`contrib: ${plugin} already has ${MAX_ITEMS_PER_PLUGIN} items; ignoring new ones`)
|
|
117
|
+
state.full = true
|
|
118
|
+
return false
|
|
119
|
+
}
|
|
120
|
+
state.full = false
|
|
121
|
+
state.items.set(item.id, item)
|
|
122
|
+
state.pending.set(item.id, item)
|
|
123
|
+
state.lastAt = now()
|
|
124
|
+
schedule(plugin, state)
|
|
125
|
+
return true
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
/** 撤下这个插件自己的一条。 */
|
|
129
|
+
remove(plugin, id) {
|
|
130
|
+
const state = plugins.get(plugin)
|
|
131
|
+
const key = clip(id, 64)
|
|
132
|
+
if (state === undefined || key === undefined || !state.items.has(key)) return false
|
|
133
|
+
state.items.delete(key)
|
|
134
|
+
state.pending.set(key, null)
|
|
135
|
+
schedule(plugin, state)
|
|
136
|
+
return true
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 一条会自己消失的通知。一分钟超过 3 条的不发。
|
|
141
|
+
* @param {string} plugin
|
|
142
|
+
* @param {unknown} input `{ title, body?, durationMs? }`
|
|
143
|
+
* @param {string} [openId] 通知上的「查看」被点了时报回来的编号(openers.js);没有就不带按钮
|
|
144
|
+
*/
|
|
145
|
+
notify(plugin, input, openId) {
|
|
146
|
+
if (!allowed(plugin)) return false
|
|
147
|
+
const notice = noticeOf(input)
|
|
148
|
+
if (notice === undefined) return false
|
|
149
|
+
const state = stateOf(plugin)
|
|
150
|
+
const at = now()
|
|
151
|
+
state.notices = state.notices.filter((time) => at - time < MINUTE_MS)
|
|
152
|
+
if (state.notices.length >= NOTICES_PER_MINUTE) return false
|
|
153
|
+
state.notices.push(at)
|
|
154
|
+
state.lastAt = at
|
|
155
|
+
const source = displayOf(plugin).title
|
|
156
|
+
send('notify', {
|
|
157
|
+
...notice,
|
|
158
|
+
body: notice.body === undefined ? `来自 ${source}` : `${notice.body}(${source})`,
|
|
159
|
+
...(typeof openId === 'string' ? { openId } : {}),
|
|
160
|
+
})
|
|
161
|
+
return true
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/** 这个插件放的全部撤下:它停用了,或者被用户关掉了。 */
|
|
165
|
+
clear(plugin) {
|
|
166
|
+
const state = plugins.get(plugin)
|
|
167
|
+
if (state === undefined) return
|
|
168
|
+
clearTimer(state.timer)
|
|
169
|
+
state.timer = undefined
|
|
170
|
+
state.pending.clear()
|
|
171
|
+
for (const id of state.items.keys()) send('contrib/remove', { id: islandId(plugin, id) })
|
|
172
|
+
state.items.clear()
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
/** 岛屿刚连上:把现在挂着的全部重发一次。 */
|
|
176
|
+
replay() {
|
|
177
|
+
for (const [plugin, state] of plugins)
|
|
178
|
+
for (const item of state.items.values()) send('contrib/upsert', message(plugin, item))
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
/** 这次运行里放过东西的插件(设置页上列出来,可以单独关掉)。 */
|
|
182
|
+
summary() {
|
|
183
|
+
return Array.from(plugins, ([name, state]) => ({ name, items: state.items.size, lastAt: state.lastAt }))
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
dispose() {
|
|
187
|
+
for (const state of plugins.values()) clearTimer(state.timer)
|
|
188
|
+
plugins.clear()
|
|
189
|
+
},
|
|
190
|
+
}
|
|
191
|
+
}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "VibeDev Island",
|
|
4
|
+
"description": "An always-on status surface at the top of the screen: VibeDev session progress, approvals and questions waiting for you, plugin background tasks, plus todos, clipboard, music and screenshots. The island is a separate native program that this plugin starts and manages; enabling the plugin runs it, disabling the plugin quits it. Windows only."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
ADDED
package/log.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件日志:临时目录下的一个文件,超过上限就换到 `.1`。
|
|
3
|
+
*
|
|
4
|
+
* 启动时和每写一段都检查一次大小。以前没有上限,一次定时器泄漏就让它每 5 秒涨两行、
|
|
5
|
+
* 一直涨下去。
|
|
6
|
+
*/
|
|
7
|
+
import { appendFileSync, renameSync, rmSync, statSync } from 'node:fs'
|
|
8
|
+
import { join } from 'node:path'
|
|
9
|
+
import { tmpdir } from 'node:os'
|
|
10
|
+
|
|
11
|
+
export const LOG_FILE = join(tmpdir(), 'vibedev-island-plugin.log')
|
|
12
|
+
/** 单个日志文件的上限;加上一份 `.1` 备份,总共不超过两倍。 */
|
|
13
|
+
export const MAX_LOG_BYTES = 1 << 20
|
|
14
|
+
/** 每写这么多行检查一次大小,免得每行都去查文件。 */
|
|
15
|
+
const CHECK_EVERY = 200
|
|
16
|
+
|
|
17
|
+
/** 文件超过上限时把它换成 `<path>.1`(覆盖上一份)。返回是否换了。 */
|
|
18
|
+
export function rotateIfLarge(path, maxBytes = MAX_LOG_BYTES) {
|
|
19
|
+
try {
|
|
20
|
+
if (statSync(path).size <= maxBytes) return false
|
|
21
|
+
rmSync(`${path}.1`, { force: true })
|
|
22
|
+
renameSync(path, `${path}.1`)
|
|
23
|
+
return true
|
|
24
|
+
} catch {
|
|
25
|
+
// 文件不存在或被占用:下次再试,不影响调用方。
|
|
26
|
+
return false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param path 日志文件,默认在临时目录
|
|
32
|
+
* @param limits 可选:`maxBytes`、`checkEvery`(测试用)
|
|
33
|
+
* @returns 写一行日志的函数;任何失败都被吞掉,不影响主流程
|
|
34
|
+
*/
|
|
35
|
+
export function createLog(path = LOG_FILE, limits) {
|
|
36
|
+
const maxBytes = limits?.maxBytes ?? MAX_LOG_BYTES
|
|
37
|
+
const checkEvery = limits?.checkEvery ?? CHECK_EVERY
|
|
38
|
+
rotateIfLarge(path, maxBytes)
|
|
39
|
+
let sinceCheck = 0
|
|
40
|
+
|
|
41
|
+
return (message) => {
|
|
42
|
+
try {
|
|
43
|
+
sinceCheck += 1
|
|
44
|
+
if (sinceCheck >= checkEvery) {
|
|
45
|
+
sinceCheck = 0
|
|
46
|
+
rotateIfLarge(path, maxBytes)
|
|
47
|
+
}
|
|
48
|
+
appendFileSync(path, `${new Date().toISOString()} ${message}\n`)
|
|
49
|
+
} catch {
|
|
50
|
+
// 日志失败不影响主流程。
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
package/openers.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通知上的「查看」:插件发通知时给的 `open`。
|
|
3
|
+
*
|
|
4
|
+
* 函数留在宿主这边,岛上的通知只带一个编号(`openId`);用户点了「查看」,岛屿把编号报回来
|
|
5
|
+
* (`contrib/open`),这里调用对应的函数。通知早就消失了,所以编号只记一阵子(默认 10 分钟),
|
|
6
|
+
* 每个插件最多记 20 个;插件停用或被关掉时它的全部作废。
|
|
7
|
+
*
|
|
8
|
+
* 纯逻辑:时钟和日志由调用方给。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const OPEN_TTL_MS = 10 * 60_000
|
|
12
|
+
export const OPENERS_PER_PLUGIN = 20
|
|
13
|
+
|
|
14
|
+
const nothing = () => undefined
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {object} [options]
|
|
18
|
+
* @param {() => number} [options.now]
|
|
19
|
+
* @param {(line: string) => void} [options.log]
|
|
20
|
+
*/
|
|
21
|
+
export function createOpeners(options = {}) {
|
|
22
|
+
const now = options.now ?? Date.now
|
|
23
|
+
const log = options.log ?? nothing
|
|
24
|
+
/** 编号 → `{ owner, open, until }`,按登记的先后排。 */
|
|
25
|
+
const entries = new Map()
|
|
26
|
+
let sequence = 0
|
|
27
|
+
|
|
28
|
+
const prune = () => {
|
|
29
|
+
const at = now()
|
|
30
|
+
for (const [id, entry] of entries) if (entry.until <= at) entries.delete(id)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
/**
|
|
35
|
+
* 记下一个 `open`,返回岛上用的编号。
|
|
36
|
+
* @param {string} owner 插件名
|
|
37
|
+
* @param {() => void} open
|
|
38
|
+
*/
|
|
39
|
+
register(owner, open) {
|
|
40
|
+
prune()
|
|
41
|
+
const mine = Array.from(entries).filter(([, entry]) => entry.owner === owner)
|
|
42
|
+
for (const [id] of mine.slice(0, Math.max(0, mine.length - OPENERS_PER_PLUGIN + 1))) entries.delete(id)
|
|
43
|
+
sequence += 1
|
|
44
|
+
const id = `notice:${owner}:${sequence}`
|
|
45
|
+
entries.set(id, { owner, open, until: now() + OPEN_TTL_MS })
|
|
46
|
+
return id
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 用户点了「查看」:调用对应的函数。返回这个编号是不是这里的。
|
|
51
|
+
* @param {string} id
|
|
52
|
+
*/
|
|
53
|
+
run(id) {
|
|
54
|
+
prune()
|
|
55
|
+
const entry = entries.get(id)
|
|
56
|
+
if (entry === undefined) return typeof id === 'string' && id.startsWith('notice:')
|
|
57
|
+
try {
|
|
58
|
+
entry.open()
|
|
59
|
+
log(`notice: ${entry.owner} opened`)
|
|
60
|
+
} catch (error) {
|
|
61
|
+
log(`notice: ${entry.owner} failed to open: ${error}`)
|
|
62
|
+
}
|
|
63
|
+
return true
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
/** 这个插件的全部作废。 */
|
|
67
|
+
clear(owner) {
|
|
68
|
+
for (const [id, entry] of entries) if (entry.owner === owner) entries.delete(id)
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
/** 现在记着几个。 */
|
|
72
|
+
size: () => {
|
|
73
|
+
prune()
|
|
74
|
+
return entries.size
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
}
|
package/outbox.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 发送到会话:岛屿要发给某个会话的东西,放在这里等 VibeDev 的页面来取。
|
|
3
|
+
*
|
|
4
|
+
* 岛屿把内容告诉插件(`session/send`),插件给页面一个只带编号的动作(`send-to-session`),
|
|
5
|
+
* 页面来取内容(`GET /api/dsh-island/outbox?id=`),用会话自己的接口发出去。只能取一次:
|
|
6
|
+
* 开着几个 VibeDev 窗口时只有先取到的那个发,不会发两遍。
|
|
7
|
+
*
|
|
8
|
+
* 纯逻辑;读图片文件、接线在 index.js。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** 放进来之后多久没人取就作废。 */
|
|
12
|
+
export const OUTBOX_TTL_MS = 2 * 60_000
|
|
13
|
+
|
|
14
|
+
const IMAGE_TYPES = new Map([
|
|
15
|
+
['png', 'image/png'],
|
|
16
|
+
['jpg', 'image/jpeg'],
|
|
17
|
+
['jpeg', 'image/jpeg'],
|
|
18
|
+
['webp', 'image/webp'],
|
|
19
|
+
['gif', 'image/gif'],
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
/** 图片文件的类型;不是认得的图片返回 undefined。 */
|
|
23
|
+
export function mediaTypeOf(path) {
|
|
24
|
+
const match = /\.([A-Za-z0-9]+)$/.exec(typeof path === 'string' ? path : '')
|
|
25
|
+
return match === null ? undefined : IMAGE_TYPES.get(match[1].toLowerCase())
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const text = (value) => (typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined)
|
|
29
|
+
|
|
30
|
+
/** `session/send` 的参数 → 一份待发的内容;不像样的返回 undefined。 */
|
|
31
|
+
export function sendRequest(params) {
|
|
32
|
+
const sessionId = text(params?.sessionId)
|
|
33
|
+
if (sessionId === undefined) return undefined
|
|
34
|
+
const note = text(params?.note) ?? ''
|
|
35
|
+
const body = text(params?.text)
|
|
36
|
+
const imagePath = text(params?.imagePath)
|
|
37
|
+
if (imagePath !== undefined && mediaTypeOf(imagePath) === undefined) return undefined
|
|
38
|
+
if (note === '' && body === undefined && imagePath === undefined) return undefined
|
|
39
|
+
return { sessionId, note, text: body, imagePath }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 发给会话的文字:附言在前,复制的文字在后。 */
|
|
43
|
+
export function promptText(entry) {
|
|
44
|
+
return [entry.note, entry.text].filter((part) => typeof part === 'string' && part !== '').join('\n\n')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function createOutbox({ now = Date.now, ttlMs = OUTBOX_TTL_MS } = {}) {
|
|
48
|
+
const entries = new Map()
|
|
49
|
+
let next = 0
|
|
50
|
+
|
|
51
|
+
const sweep = () => {
|
|
52
|
+
for (const [id, entry] of entries) if (now() - entry.at > ttlMs) entries.delete(id)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
/** 放进一份,返回取它用的编号。 */
|
|
57
|
+
put(entry) {
|
|
58
|
+
sweep()
|
|
59
|
+
next += 1
|
|
60
|
+
const id = `${next}-${Math.random().toString(36).slice(2, 10)}`
|
|
61
|
+
entries.set(id, { entry, at: now() })
|
|
62
|
+
return id
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
/** 取走一份;没有、过期或者已经被取走了返回 undefined。 */
|
|
66
|
+
take(id) {
|
|
67
|
+
sweep()
|
|
68
|
+
const found = entries.get(id)
|
|
69
|
+
if (found === undefined) return undefined
|
|
70
|
+
entries.delete(id)
|
|
71
|
+
return found.entry
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
clear() {
|
|
75
|
+
entries.clear()
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedev-si/dsh-island",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "VibeDev 岛屿:在屏幕顶部常驻显示 VibeDev 会话进度、等你处理的审批和提问、插件后台任务,以及待办、剪贴板、音乐与截图。岛屿是独立的原生程序,由本插件启动和管理;仅支持 Windows · VibeDev Island: an always-on status surface for VibeDev, started and managed by this plugin (Windows only)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"icon": "./icon.svg",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./client": "./client.js",
|
|
11
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
12
|
+
"./locale/*.json": "./locale/*.json",
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"client.js",
|
|
18
|
+
"settings.js",
|
|
19
|
+
"routes.js",
|
|
20
|
+
"sessions.js",
|
|
21
|
+
"requests.js",
|
|
22
|
+
"translate.js",
|
|
23
|
+
"events.js",
|
|
24
|
+
"selection.js",
|
|
25
|
+
"approvals.js",
|
|
26
|
+
"outbox.js",
|
|
27
|
+
"island-items.js",
|
|
28
|
+
"diagnostics.js",
|
|
29
|
+
"third-party.json",
|
|
30
|
+
"log.js",
|
|
31
|
+
"cordis.patch.yml",
|
|
32
|
+
"locale",
|
|
33
|
+
"icon.svg",
|
|
34
|
+
"changelog.js",
|
|
35
|
+
"attention.js",
|
|
36
|
+
"wechat.js",
|
|
37
|
+
"contributions.js",
|
|
38
|
+
"executable.js",
|
|
39
|
+
"contributor-display.js",
|
|
40
|
+
"contributor-entry.js",
|
|
41
|
+
"recent.js",
|
|
42
|
+
"openers.js",
|
|
43
|
+
"CHANGELOG.md",
|
|
44
|
+
"LICENSE",
|
|
45
|
+
"bin",
|
|
46
|
+
"THIRD-PARTY-NOTICES.txt"
|
|
47
|
+
],
|
|
48
|
+
"keywords": [
|
|
49
|
+
"dsh",
|
|
50
|
+
"dsh-plugin",
|
|
51
|
+
"deepseek-harness",
|
|
52
|
+
"vibedev",
|
|
53
|
+
"island"
|
|
54
|
+
],
|
|
55
|
+
"author": "VibeDev",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"homepage": "https://github.com/VibeDev-Si/dsh-island#readme",
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/VibeDev-Si/dsh-island.git"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=20",
|
|
64
|
+
"dsh": ">=0.2.2-rc.2 <0.3.0-0"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public",
|
|
68
|
+
"registry": "https://registry.npmjs.org/"
|
|
69
|
+
},
|
|
70
|
+
"dsh": {
|
|
71
|
+
"bundle": {
|
|
72
|
+
"patch": "./cordis.patch.yml"
|
|
73
|
+
},
|
|
74
|
+
"client": {
|
|
75
|
+
"platform": "web",
|
|
76
|
+
"immediately": true,
|
|
77
|
+
"inject": [
|
|
78
|
+
"@deepseek-ai/dsh-client-locale"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|