@jiyr0119/dsh-service-console 0.7.1 → 0.8.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/README.md +6 -4
- package/README.zh.md +6 -4
- package/docs/local-debugging.md +1 -1
- package/docs/rc5-upgrade-review.zh.md +182 -0
- package/docs/release-checklist.md +15 -12
- package/icon.svg +8 -0
- package/lib/client/dictionaries.js +159 -0
- package/lib/client/i18n.js +45 -47
- package/lib/client.js +200 -145
- package/lib/host/config.js +1 -2
- package/lib/host/ledger.js +2 -3
- package/lib/host/lifecycle.js +2 -3
- package/lib/host/ownership.js +8 -4
- package/lib/host/process-inspector.js +1 -2
- package/lib/host/protection.js +1 -2
- package/lib/host/redaction.js +1 -2
- package/lib/host/service-registry.js +4 -5
- package/lib/host/service-tool.js +28 -4
- package/lib/index.js +54 -11
- package/lib/types/client/ServiceConsole.d.ts +24 -12
- package/lib/types/client/dictionaries.d.ts +2 -0
- package/lib/types/client/i18n.d.ts +42 -20
- package/lib/types/host/ledger.d.ts +7 -0
- package/lib/types/host/ownership.d.ts +9 -1
- package/lib/types/host/service-registry.d.ts +2 -1
- package/lib/types/host/service-tool.d.ts +7 -2
- package/lib/types/index.d.ts +18 -2
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +24 -30
- package/dsh.plugin.json +0 -16
- package/dynamic/client.js +0 -193
- package/dynamic/host.js +0 -337
- package/manifest.json +0 -24
package/dynamic/client.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
// dsh-service-console · M1 动态原型 Client(v3 = pkg-18 增强版:范围/搜索/配置/i18n)
|
|
2
|
-
// 覆盖任务:T1-9 入口 · T1-10 Overlay+轮询 · T1-11 列表/详情 · T1-12 范围/搜索/筛选
|
|
3
|
-
// T1-13 停止 UI · T1-14 重启 UI · T1-15 URL 打开 · T1-16 配置面板 · T1-17 i18n
|
|
4
|
-
// 说明:纯 JavaScript + React.createElement(无 JSX)。定时器必须用 timer 服务(inject: ['timer'] + ctx.timeout/ctx.interval)。
|
|
5
|
-
|
|
6
|
-
return {
|
|
7
|
-
inject: ['timer'],
|
|
8
|
-
apply(ctx) {
|
|
9
|
-
const slots = ctx.get('slots')
|
|
10
|
-
if (slots === undefined) return
|
|
11
|
-
|
|
12
|
-
const store = { open: false, listeners: new Set() }
|
|
13
|
-
function subscribe(fn) { store.listeners.add(fn); return () => store.listeners.delete(fn) }
|
|
14
|
-
function setOpen(v) { store.open = v; store.listeners.forEach((l) => l(v)) }
|
|
15
|
-
|
|
16
|
-
const TEXTS = {
|
|
17
|
-
zh: {
|
|
18
|
-
title: 'Service Console', scopeConv: '全部本机服务', scopeWs: '全部本机服务', scopeMachine: '全部本机服务',
|
|
19
|
-
search: '搜索服务/端口/路径…', auto: '5s', config: '配置', close: '关闭',
|
|
20
|
-
noSvc: '未发现服务', stop: '停止', restart: '重启', detail: '详情',
|
|
21
|
-
confirmStop: '确认停止?', confirmRestart: '确认重启?', confirmTxt: '确认对 {name} (pid {pid}) 执行{action}?',
|
|
22
|
-
ok: '确认', cancel: '取消', stopped: '已停止', restarted: '已重启',
|
|
23
|
-
evidence: '归属证据', refreshInterval: '自动刷新间隔(ms)', gracefulTimeout: '优雅超时(ms)', forceKill: '允许强制终止',
|
|
24
|
-
},
|
|
25
|
-
en: {
|
|
26
|
-
title: 'Service Console', scopeConv: 'All local services', scopeWs: 'All local services', scopeMachine: 'All local services',
|
|
27
|
-
search: 'Search services/ports/paths…', auto: '5s', config: 'Config', close: 'Close',
|
|
28
|
-
noSvc: 'no services found', stop: 'Stop', restart: 'Restart', detail: 'Detail',
|
|
29
|
-
confirmStop: 'Confirm stop?', confirmRestart: 'Confirm restart?', confirmTxt: 'Run {action} on {name} (pid {pid})?',
|
|
30
|
-
ok: 'OK', cancel: 'Cancel', stopped: 'Stopped', restarted: 'Restarted',
|
|
31
|
-
evidence: 'Ownership evidence', refreshInterval: 'Refresh interval (ms)', gracefulTimeout: 'Graceful timeout (ms)', forceKill: 'Allow force kill',
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
const OWNERSHIP = {
|
|
35
|
-
'conversation-confirmed': { zh: '本次对话', en: 'This chat', color: 'var(--dsw-alias-state-success-primary, #4ade80)' },
|
|
36
|
-
'workspace-inferred': { zh: '工作区推断', en: 'Workspace', color: 'var(--dsw-alias-state-warn-primary, #fbbf24)' },
|
|
37
|
-
'other-local': { zh: '本机其他', en: 'Other local', color: 'var(--dsw-alias-label-secondary, #94a3b8)' },
|
|
38
|
-
'unknown': { zh: '未知', en: 'Unknown', color: 'var(--dsw-alias-state-error-primary, #f87171)' },
|
|
39
|
-
'protected': { zh: '受保护', en: 'Protected', color: 'var(--dsw-alias-state-error-primary, #f87171)' },
|
|
40
|
-
}
|
|
41
|
-
const ERROR_LABEL = {
|
|
42
|
-
PERMISSION_DENIED: ['没有权限读取或控制该服务', 'No permission'], TARGET_GONE: ['该服务已结束', 'Service gone'],
|
|
43
|
-
PID_REUSED: ['进程身份已变化,已取消操作', 'PID reused'], UNKNOWN_OWNERSHIP: ['无法确认来源,不允许控制', 'Unknown ownership'],
|
|
44
|
-
PROTECTED_PROCESS: ['受保护进程,不能操作', 'Protected process'], GRACEFUL_TIMEOUT: ['未在等待时间内退出', 'Graceful timeout'],
|
|
45
|
-
RESTART_UNSAFE: ['缺少安全启动信息,不能重启', 'Cannot restart safely'], PORT_CONFLICT: ['端口仍被占用', 'Port conflict'],
|
|
46
|
-
START_TIMEOUT: ['未在预期时间开始监听', 'Start timeout'],
|
|
47
|
-
}
|
|
48
|
-
const STYLE = {
|
|
49
|
-
panel: { position: 'fixed', top: 72, right: 20, zIndex: 9999, width: 540, maxHeight: 'min(640px, calc(100dvh - 110px))', overflow: 'auto', background: 'var(--dsw-alias-bg-overlay, #262626)', color: 'var(--dsw-alias-label-primary, #eee)', border: '1px solid var(--dsw-alias-border-l1, #444)', borderRadius: 10, padding: 12, boxShadow: '0 8px 32px rgba(0,0,0,.35)', fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace', fontSize: 12, pointerEvents: 'auto' },
|
|
50
|
-
row: { padding: '8px 0', borderBottom: '1px solid var(--dsw-alias-border-l1, #333)' },
|
|
51
|
-
muted: { color: 'var(--dsw-alias-label-secondary, #999)' }, ok: { color: 'var(--dsw-alias-state-success-primary, #4ade80)' },
|
|
52
|
-
err: { color: 'var(--dsw-alias-state-error-primary, #f87171)' }, warn: { color: 'var(--dsw-alias-state-warn-primary, #fbbf24)' },
|
|
53
|
-
btn: { cursor: 'pointer', fontSize: 11, marginLeft: 6, padding: '1px 6px', borderRadius: 4, border: '1px solid var(--dsw-alias-border-l1, #555)', background: 'var(--dsw-alias-bg-layer-1, #333)', color: 'var(--dsw-alias-label-primary, #eee)' },
|
|
54
|
-
badge: { borderRadius: 4, padding: '0 5px', fontSize: 10, border: '1px solid currentColor' },
|
|
55
|
-
input: { background: 'var(--dsw-alias-bg-layer-1, #333)', color: 'var(--dsw-alias-label-primary, #eee)', border: '1px solid var(--dsw-alias-border-l1, #555)', borderRadius: 4, padding: '2px 6px', fontSize: 11 },
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function Entry() {
|
|
59
|
-
const [open, setLocal] = React.useState(store.open)
|
|
60
|
-
React.useEffect(() => subscribe(setLocal), [])
|
|
61
|
-
return React.createElement('button', { onClick: () => setOpen(!store.open), title: 'Service Console', style: { background: 'var(--dsw-alias-bg-layer-1, #333)', color: 'var(--dsw-alias-label-primary, #eee)', border: '1px solid var(--dsw-alias-border-l1, #555)', borderRadius: 6, padding: '2px 8px', fontSize: 12, cursor: 'pointer' } }, open ? '✕' : '🖥 SC')
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function Panel() {
|
|
65
|
-
const [open, setLocal] = React.useState(store.open)
|
|
66
|
-
const locale = ctx.get('locale')
|
|
67
|
-
const [lang, setLang] = React.useState(() => String(locale && locale.getLocale && locale.getLocale().id || '').toLowerCase().startsWith('zh') ? 'zh' : 'en')
|
|
68
|
-
const [query, setQuery] = React.useState('')
|
|
69
|
-
const [showConfig, setShowConfig] = React.useState(false)
|
|
70
|
-
const [configData, setConfigData] = React.useState(null)
|
|
71
|
-
const [view, setView] = React.useState({ phase: 'idle', at: null, data: null, err: null })
|
|
72
|
-
const [confirming, setConfirming] = React.useState(null)
|
|
73
|
-
const [opResult, setOpResult] = React.useState(null)
|
|
74
|
-
const [expanded, setExpanded] = React.useState(null)
|
|
75
|
-
const timeoutRef = React.useRef(null)
|
|
76
|
-
React.useEffect(() => subscribe(setLocal), [])
|
|
77
|
-
React.useEffect(() => locale && locale.subscribe ? locale.subscribe(() => setLang(String(locale.getLocale().id || '').toLowerCase().startsWith('zh') ? 'zh' : 'en')) : undefined, [])
|
|
78
|
-
React.useEffect(() => () => { if (timeoutRef.current) timeoutRef.current() }, [])
|
|
79
|
-
|
|
80
|
-
const T = TEXTS[lang]
|
|
81
|
-
const scan = () => {
|
|
82
|
-
const at = new Date().toLocaleTimeString()
|
|
83
|
-
setView((v) => ({ phase: 'scanning', at, data: v.data, err: null }))
|
|
84
|
-
if (timeoutRef.current) timeoutRef.current()
|
|
85
|
-
timeoutRef.current = ctx.timeout(() => { setView((v) => (v.phase === 'scanning' ? { phase: 'timeout', at, data: v.data, err: 'timeout' } : v)) }, 8000)
|
|
86
|
-
host.call('scan', {}).then((res) => { if (timeoutRef.current) { timeoutRef.current(); timeoutRef.current = null } setView({ phase: 'done', at, data: res && res.data ? res.data : res, err: null }) })
|
|
87
|
-
.catch((e) => { if (timeoutRef.current) { timeoutRef.current(); timeoutRef.current = null } setView({ phase: 'error', at, data: null, err: String((e && e.message) || e) }) })
|
|
88
|
-
}
|
|
89
|
-
const loadConfig = () => {
|
|
90
|
-
host.call('config', {}).then((res) => setConfigData(res && res.data ? res.data.config : null)).catch(() => {})
|
|
91
|
-
}
|
|
92
|
-
React.useEffect(() => {
|
|
93
|
-
if (open && view.phase === 'idle') scan()
|
|
94
|
-
}, [open, view.phase])
|
|
95
|
-
if (!open) return null
|
|
96
|
-
|
|
97
|
-
const runAction = (svc, action) => { setConfirming({ id: svc.id, action }); setOpResult(null) }
|
|
98
|
-
const confirmAction = (svc, action) => {
|
|
99
|
-
setConfirming(null)
|
|
100
|
-
host.call(action, { serviceId: svc.id })
|
|
101
|
-
.then((res) => {
|
|
102
|
-
if (res && res.ok) setOpResult({ id: svc.id, ok: true, text: action === 'stop' ? T.stopped : T.restarted })
|
|
103
|
-
else setOpResult({ id: svc.id, ok: false, text: (res && res.error && (ERROR_LABEL[res.error.code] ? ERROR_LABEL[res.error.code][lang === 'zh' ? 0 : 1] : res.error.message)) || 'ERR' })
|
|
104
|
-
scan()
|
|
105
|
-
})
|
|
106
|
-
.catch((e) => setOpResult({ id: svc.id, ok: false, text: 'RPC error' }))
|
|
107
|
-
}
|
|
108
|
-
const setConfig = (patch) => {
|
|
109
|
-
host.call('config', { action: 'update', patch }).then((res) => { if (res && res.data) setConfigData(res.data.config) })
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Show every listening service; ownership is a safety badge, not a visibility filter.
|
|
113
|
-
let rows = (view.data && view.data.services) || []
|
|
114
|
-
if (query) {
|
|
115
|
-
const q = String(query).toLowerCase()
|
|
116
|
-
rows = rows.filter((s) => String(s.name).toLowerCase().indexOf(q) >= 0 || String(s.pid).indexOf(q) >= 0 || (s.commandSummary || '').toLowerCase().indexOf(q) >= 0 || (s.cwd || '').toLowerCase().indexOf(q) >= 0 || (s.listeners || []).some((l) => String(l.port).indexOf(q) >= 0))
|
|
117
|
-
}
|
|
118
|
-
const status =
|
|
119
|
-
view.phase === 'scanning' ? React.createElement('div', { style: STYLE.warn }, '⏳ ' + view.at)
|
|
120
|
-
: view.phase === 'done' ? React.createElement('div', { style: STYLE.ok }, '✅ ' + view.at + ' · ' + String(view.data.count) + ' · ledger=' + String(view.data.ledgerCount))
|
|
121
|
-
: view.phase === 'error' || view.phase === 'timeout' ? React.createElement('div', { style: STYLE.err }, '⛔ ' + view.err)
|
|
122
|
-
: null
|
|
123
|
-
|
|
124
|
-
return React.createElement('div', { style: STYLE.panel },
|
|
125
|
-
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 6, flexWrap: 'wrap' } },
|
|
126
|
-
React.createElement('strong', null, T.title),
|
|
127
|
-
React.createElement('span', { style: Object.assign({}, STYLE.muted, { padding: '3px 6px', border: '1px solid var(--dsw-alias-border-l1, #444)', borderRadius: 4 }) }, T.scopeMachine),
|
|
128
|
-
React.createElement('button', { onClick: () => { setShowConfig(!showConfig); if (!showConfig) loadConfig() }, style: STYLE.btn }, T.config),
|
|
129
|
-
React.createElement('span', { style: { flex: 1 } }),
|
|
130
|
-
React.createElement('button', { onClick: scan, style: STYLE.btn }, '↻'),
|
|
131
|
-
React.createElement('button', { onClick: () => setOpen(false), style: STYLE.btn }, T.close)
|
|
132
|
-
),
|
|
133
|
-
React.createElement('input', { placeholder: T.search, value: query, onChange: (e) => setQuery(e.target.value), style: Object.assign({}, STYLE.input, { width: '100%', marginBottom: 6 }) }),
|
|
134
|
-
showConfig && configData
|
|
135
|
-
? React.createElement('div', { style: { background: 'var(--dsw-alias-bg-layer-1, #333)', borderRadius: 6, padding: 8, marginBottom: 8 } },
|
|
136
|
-
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
|
|
137
|
-
React.createElement('span', { style: STYLE.muted }, T.refreshInterval),
|
|
138
|
-
React.createElement('input', { type: 'number', defaultValue: configData.refreshInterval, onBlur: (e) => setConfig({ refreshInterval: parseInt(e.target.value, 10) }), style: Object.assign({}, STYLE.input, { width: 80 }) })
|
|
139
|
-
),
|
|
140
|
-
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, marginTop: 4 } },
|
|
141
|
-
React.createElement('span', { style: STYLE.muted }, T.gracefulTimeout),
|
|
142
|
-
React.createElement('input', { type: 'number', defaultValue: configData.gracefulTimeout, onBlur: (e) => setConfig({ gracefulTimeout: parseInt(e.target.value, 10) }), style: Object.assign({}, STYLE.input, { width: 80 }) })
|
|
143
|
-
),
|
|
144
|
-
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 6, marginTop: 4 } },
|
|
145
|
-
React.createElement('input', { type: 'checkbox', checked: !!configData.forceKill, onChange: (e) => setConfig({ forceKill: e.target.checked }) }), T.forceKill
|
|
146
|
-
)
|
|
147
|
-
)
|
|
148
|
-
: null,
|
|
149
|
-
status,
|
|
150
|
-
rows.length === 0 && view.phase === 'done' ? React.createElement('div', { style: STYLE.muted }, T.noSvc)
|
|
151
|
-
: rows.map((svc) => {
|
|
152
|
-
const badge = OWNERSHIP[svc.ownership] || OWNERSHIP.unknown
|
|
153
|
-
const ports = (svc.listeners || []).map((l) => String(l.port)).join(', ')
|
|
154
|
-
const url = (svc.listeners || []).map((l) => l.url).filter(Boolean)[0]
|
|
155
|
-
const canControl = svc.ownership === 'conversation-confirmed' || svc.ownership === 'workspace-inferred' || svc.ownership === 'other-local'
|
|
156
|
-
const isConfirming = confirming && confirming.id === svc.id
|
|
157
|
-
const result = opResult && opResult.id === svc.id ? opResult : null
|
|
158
|
-
return React.createElement('div', { key: svc.id, style: STYLE.row },
|
|
159
|
-
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' } },
|
|
160
|
-
React.createElement('span', { style: STYLE.ok }, '●'),
|
|
161
|
-
React.createElement('span', { style: { fontWeight: 600 } }, String(svc.name)),
|
|
162
|
-
React.createElement('span', { style: STYLE.muted }, ':' + ports + ' · pid ' + String(svc.pid)),
|
|
163
|
-
React.createElement('span', { style: Object.assign({}, STYLE.badge, { color: badge.color }) }, badge[lang] || badge.zh),
|
|
164
|
-
svc.restartable ? React.createElement('span', { style: Object.assign({}, STYLE.badge, { color: STYLE.ok.color }) }, '↻') : null,
|
|
165
|
-
url ? React.createElement('a', { href: url, target: '_blank', rel: 'noreferrer', style: Object.assign({}, STYLE.btn, { textDecoration: 'none' }) }, '🔗') : null,
|
|
166
|
-
React.createElement('span', { style: { flex: 1 } }),
|
|
167
|
-
canControl ? React.createElement('button', { style: STYLE.btn, onClick: () => runAction(svc, 'stop') }, isConfirming && confirming.action === 'stop' ? T.confirmStop : T.stop) : null,
|
|
168
|
-
svc.restartable ? React.createElement('button', { style: STYLE.btn, onClick: () => runAction(svc, 'restart') }, isConfirming && confirming.action === 'restart' ? T.confirmRestart : T.restart) : null,
|
|
169
|
-
React.createElement('button', { style: STYLE.btn, onClick: () => setExpanded(expanded === svc.id ? null : svc.id) }, expanded === svc.id ? '▾' : T.detail)
|
|
170
|
-
),
|
|
171
|
-
React.createElement('div', { style: STYLE.muted }, (svc.commandSummary ? String(svc.commandSummary).slice(0, 100) : '(?)') + (svc.commandSummary && svc.commandSummary.length > 100 ? '…' : '')),
|
|
172
|
-
svc.cwd ? React.createElement('div', { style: STYLE.muted }, svc.cwd) : null,
|
|
173
|
-
result ? React.createElement('div', { style: result.ok ? STYLE.ok : STYLE.err }, (result.ok ? '✅ ' : '⛔ ') + result.text) : null,
|
|
174
|
-
isConfirming ? React.createElement('div', { style: { marginTop: 4 } },
|
|
175
|
-
React.createElement('span', { style: STYLE.muted }, T.confirmTxt.replace('{name}', svc.name).replace('{pid}', String(svc.pid)).replace('{action}', confirming.action === 'stop' ? T.stop : T.restart) + ' '),
|
|
176
|
-
React.createElement('button', { style: Object.assign({}, STYLE.btn, { color: STYLE.err.color }), onClick: () => confirmAction(svc, confirming.action) }, T.ok),
|
|
177
|
-
React.createElement('button', { style: STYLE.btn, onClick: () => setConfirming(null) }, T.cancel)
|
|
178
|
-
) : null,
|
|
179
|
-
expanded === svc.id ? React.createElement('div', { style: { marginTop: 4, background: 'var(--dsw-alias-bg-layer-1, #333)', padding: 6, borderRadius: 6 } },
|
|
180
|
-
React.createElement('div', { style: STYLE.muted }, 'id: ' + svc.id),
|
|
181
|
-
React.createElement('div', { style: STYLE.muted }, 'pgid: ' + String(svc.processGroupId) + ' · ppid: ' + String(svc.parentPid) + ' · startedAt: ' + String(svc.startedAt)),
|
|
182
|
-
React.createElement('div', { style: STYLE.muted }, T.evidence + ':'),
|
|
183
|
-
(svc.ownershipEvidence || []).map((ev, i) => React.createElement('div', { key: i, style: STYLE.muted }, ' · ' + ev))
|
|
184
|
-
) : null
|
|
185
|
-
)
|
|
186
|
-
})
|
|
187
|
-
)
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
slots.inject('conversation.session.header.utilities', () => slots.register({ name: 'conversation.session.header.utilities', id: 'sc-dev-entry' }, () => React.createElement(Entry)))
|
|
191
|
-
slots.inject('shell.overlay', () => slots.register({ name: 'shell.overlay', id: 'sc-dev-panel' }, () => React.createElement(Panel)))
|
|
192
|
-
},
|
|
193
|
-
}
|
package/dynamic/host.js
DELETED
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
// dsh-service-console · M1 动态原型 Host(v12 = pkg-17 对应代码)
|
|
2
|
-
// 覆盖任务:T1-1 ProcessInspector · T1-2 ServiceRegistry · T1-3 会话台账
|
|
3
|
-
// T1-4 归属评分 · T1-5 脱敏 · T1-6 生命周期 · T1-7 API · T1-8 配置
|
|
4
|
-
// 说明:动态 Cordis 插件 Host 半,纯 JavaScript。通过 ctx.get('shell') 执行平台命令,
|
|
5
|
-
// 不依赖 Node child_process(动态 Host 无 process 全局)。
|
|
6
|
-
// 注意:
|
|
7
|
-
// - 动态 Host/Client 均无 setTimeout/setInterval 全局,定时器用 timer 服务(inject: ['timer'] + ctx.timeout/ctx.interval)
|
|
8
|
-
// - fingerprint 用 FNV-1a(动态环境无 crypto),M2 原生包迁移为 node:crypto sha256
|
|
9
|
-
// - 动态工具结果传递在当前 DSH 会话中受限,开发期验证以面板 host.call + bash 链路复现为准
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
inject: ['timer'],
|
|
13
|
-
apply(ctx) {
|
|
14
|
-
const shell = ctx.get('shell')
|
|
15
|
-
if (shell === undefined) return
|
|
16
|
-
const workspaceRegistry = ctx.get('workspaceRegistry')
|
|
17
|
-
|
|
18
|
-
const MONTHS = { Jan: 1, Feb: 2, Mar: 3, Apr: 4, May: 5, Jun: 6, Jul: 7, Aug: 8, Sep: 9, Oct: 10, Nov: 11, Dec: 12 }
|
|
19
|
-
|
|
20
|
-
// ---------- T1-8 Config ----------
|
|
21
|
-
const config = { refreshInterval: 5000, defaultScope: 'workspace', gracefulTimeout: 3000, showUnknown: true, forceKill: false, autoCleanup: false }
|
|
22
|
-
const CONFIG_LIMITS = { refreshInterval: [2000, 30000], gracefulTimeout: [1000, 15000] }
|
|
23
|
-
const actionLog = []
|
|
24
|
-
function logAction(serviceId, action, result, code) {
|
|
25
|
-
actionLog.push({ at: Date.now(), serviceId, action, result, code: code || null })
|
|
26
|
-
if (actionLog.length > 200) actionLog.shift()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// ---------- 工具函数 ----------
|
|
30
|
-
function fnv1a(str) {
|
|
31
|
-
let h = 0x811c9dc5
|
|
32
|
-
for (let i = 0; i < str.length; i++) { h ^= str.charCodeAt(i); h = (h * 0x01000193) >>> 0 }
|
|
33
|
-
return h.toString(36)
|
|
34
|
-
}
|
|
35
|
-
function ok(data) { return { ok: true, data } }
|
|
36
|
-
function err(code, message) { return { ok: false, error: { code, message } } }
|
|
37
|
-
|
|
38
|
-
async function runCommand(command, timeoutMs) {
|
|
39
|
-
try {
|
|
40
|
-
// DSH 0.2.0:ShellExecutor.run()/start() 已移除,统一走 execute() + result();
|
|
41
|
-
// 结果的 stdout/stderr 是 CollectedOutput({ text, truncated })而非字符串。
|
|
42
|
-
const spec = shell.resolve({ command, timeoutMs: timeoutMs || 5000 })
|
|
43
|
-
const execution = await shell.execute(spec)
|
|
44
|
-
const res = await execution.result()
|
|
45
|
-
const pick = (v) => typeof v === 'string' ? v
|
|
46
|
-
: v && typeof v.text === 'string' ? v.text : ''
|
|
47
|
-
const stdout = pick(res.stdout)
|
|
48
|
-
const stderr = pick(res.stderr)
|
|
49
|
-
const code = res.exitCode !== undefined && res.exitCode !== null ? res.exitCode
|
|
50
|
-
: res.code !== undefined ? res.code : null
|
|
51
|
-
return { stdout, stderr, code }
|
|
52
|
-
} catch (e) { return { stdout: '', stderr: String((e && e.message) || e), code: null } }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ps lstart: "Mon Aug 17 19:32:16 2026" → epoch ms(5 个 token:星期 月 日 时间 年)
|
|
56
|
-
function parseLstart(str) {
|
|
57
|
-
const parts = String(str).trim().split(/\s+/)
|
|
58
|
-
if (parts.length < 5) return null
|
|
59
|
-
const mon = MONTHS[parts[1]]
|
|
60
|
-
const day = parseInt(parts[2], 10)
|
|
61
|
-
const year = parseInt(parts[4], 10)
|
|
62
|
-
if (!mon || !day || !year || !parts[3]) return null
|
|
63
|
-
const iso = year + '-' + String(mon).padStart(2, '0') + '-' + String(day).padStart(2, '0') + 'T' + parts[3]
|
|
64
|
-
const t = Date.parse(iso)
|
|
65
|
-
return Number.isFinite(t) ? t : null
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function parseListenRows(stdout) {
|
|
69
|
-
const rows = []
|
|
70
|
-
for (const line of String(stdout).split('\n')) {
|
|
71
|
-
const t = line.trim()
|
|
72
|
-
if (!t || t.startsWith('COMMAND')) continue
|
|
73
|
-
const m = t.match(/^(\S+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$/)
|
|
74
|
-
if (!m) continue
|
|
75
|
-
const name = m[9].trim()
|
|
76
|
-
if (!/\(LISTEN\)$/.test(name)) continue
|
|
77
|
-
rows.push({ command: m[1], pid: parseInt(m[2], 10), user: m[3], fd: m[4], type: m[5], address: name.replace(/\s*\(LISTEN\)$/, '') })
|
|
78
|
-
}
|
|
79
|
-
return rows
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function parsePsRows(stdout) {
|
|
83
|
-
const rows = []
|
|
84
|
-
for (const line of String(stdout).split('\n')) {
|
|
85
|
-
const t = line.trim()
|
|
86
|
-
if (!t) continue
|
|
87
|
-
const parts = t.split(/\s+/)
|
|
88
|
-
const pid = parseInt(parts[0], 10)
|
|
89
|
-
const ppid = parseInt(parts[1], 10)
|
|
90
|
-
if (!Number.isFinite(pid) || !Number.isFinite(ppid)) continue
|
|
91
|
-
const lstart = parts.slice(2, 7).join(' ')
|
|
92
|
-
rows.push({ pid, ppid, lstart, startedAt: parseLstart(lstart), command: parts.slice(7).join(' ') })
|
|
93
|
-
}
|
|
94
|
-
return rows
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function parseAddress(addr) {
|
|
98
|
-
let host = null
|
|
99
|
-
let port = null
|
|
100
|
-
let m = String(addr).match(/^\[([^\]]+)\]:(.+)$/)
|
|
101
|
-
if (m) { host = m[1]; port = parseInt(m[2], 10) }
|
|
102
|
-
else { m = String(addr).match(/^(.+):(\d+)$/); if (m) { host = m[1]; port = parseInt(m[2], 10) } }
|
|
103
|
-
return { host, port }
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function shellQuote(s) { return "'" + String(s).replace(/'/g, "'\\''") + "'" }
|
|
107
|
-
|
|
108
|
-
// ---------- T1-5 Redaction ----------
|
|
109
|
-
const REDACT_RULES = [
|
|
110
|
-
{
|
|
111
|
-
// --token=abc123 / --token abc123 / --token:abc123 → 保留 --token 与分隔符,值脱敏
|
|
112
|
-
re: /(--(?:token|password|passwd|secret|key|api[-_]?key|client[-_]?secret|cookie|session))\s*[=:]\s*(\S+)/gi,
|
|
113
|
-
replace: function (m) { return m.replace(/(?:[=:]\s*|\s+)\S+$/, '=***') },
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
// KEY=value / KEY='value' → 保留 KEY=,值脱敏
|
|
117
|
-
re: /((?:token|password|passwd|secret|api[-_]?key|client[-_]?secret|authorization|set-cookie|connection[-_]?string))\s*=\s*(['"]?)([^\s&'"]+)\2/gi,
|
|
118
|
-
replace: function (m, p1, p2) { return (p1 || '') + '=' + (p2 || '') + '***' },
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
// scheme://user:pass@ → 保留 scheme://,凭据脱敏
|
|
122
|
-
re: /(postgres(?:ql)?|mysql|redis|mongodb)(\+s?)?:\/\/[^\s@]+@/gi,
|
|
123
|
-
replace: function (m, p1) { return (p1 || '') + '://***@' },
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
// JWT
|
|
127
|
-
re: /\b(eyJ[a-zA-Z0-9_-]{10,}\.[a-zA-Z0-9_-]{10,}\.[a-zA-Z0-9_-]{10,})\b/g,
|
|
128
|
-
replace: function () { return '***' },
|
|
129
|
-
},
|
|
130
|
-
]
|
|
131
|
-
function redact(command) {
|
|
132
|
-
if (typeof command !== 'string' || !command) return command
|
|
133
|
-
let out = command
|
|
134
|
-
for (const rule of REDACT_RULES) {
|
|
135
|
-
out = out.replace(rule.re, function () { return rule.replace.apply(null, arguments) })
|
|
136
|
-
}
|
|
137
|
-
return out
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// ---------- T1-3 Session Launch Ledger ----------
|
|
141
|
-
const ledger = []
|
|
142
|
-
const DEV_COMMAND_RE = /(npm (run|start|dev)|pnpm (run|dev|start)|yarn (dev|start)|next dev|vite|uvicorn|gunicorn|flask run|django runserver|cargo run|node (server|app|index)|python3? -m (http.server|uvicorn)|serve|http-server|nodemon|tsx watch|deno run)/
|
|
143
|
-
ctx.on('tools/result', (exec) => {
|
|
144
|
-
try {
|
|
145
|
-
if (!exec || exec.name !== 'bash') return
|
|
146
|
-
const args = exec.args || {}
|
|
147
|
-
const command = String(args.command || '')
|
|
148
|
-
if (!DEV_COMMAND_RE.test(command)) return
|
|
149
|
-
let sessionKey = null
|
|
150
|
-
try { sessionKey = (exec.agent && (exec.agent.id || exec.agent.sessionId)) || null } catch (e) { sessionKey = null }
|
|
151
|
-
ledger.push({ at: Date.now(), command, cwd: args.workdir || null, sessionKey, redacted: redact(command) })
|
|
152
|
-
if (ledger.length > 200) ledger.shift()
|
|
153
|
-
} catch (err) { console.error('ledger error', String((err && err.message) || err)) }
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
// ---------- T1-4 Ownership ----------
|
|
157
|
-
function classifyOwnership(proc, ledgers, workspaces) {
|
|
158
|
-
const cwd = proc.cwd
|
|
159
|
-
const command = proc.command || ''
|
|
160
|
-
const evidence = []
|
|
161
|
-
let ownership = 'unknown'
|
|
162
|
-
let confidence = 'unknown'
|
|
163
|
-
let ledgerEntry = null
|
|
164
|
-
if (cwd && ledgers.length > 0) {
|
|
165
|
-
ledgerEntry = ledgers.find((l) => l.cwd && cwd.indexOf(l.cwd) === 0 && proc.startedAt && Math.abs(proc.startedAt - l.at) < 10 * 60 * 1000)
|
|
166
|
-
}
|
|
167
|
-
if (ledgerEntry) {
|
|
168
|
-
ownership = 'conversation-confirmed'
|
|
169
|
-
confidence = 'confirmed'
|
|
170
|
-
evidence.push('matched session launch ledger: ' + (ledgerEntry.redacted || ledgerEntry.command).slice(0, 60))
|
|
171
|
-
} else if (cwd && workspaces.length > 0) {
|
|
172
|
-
const ws = workspaces.find((w) => w && w.path && cwd.indexOf(w.path) === 0)
|
|
173
|
-
if (ws) { ownership = 'workspace-inferred'; confidence = 'inferred'; evidence.push('cwd under workspace: ' + ws.path) }
|
|
174
|
-
} else if (cwd && !/^(\/usr\/|\/System\/|\/Library\/|\/bin\/|\/sbin\/|\/private\/)/.test(cwd)) {
|
|
175
|
-
ownership = 'other-local'; confidence = 'inferred'; evidence.push('local cwd not in workspace: ' + cwd)
|
|
176
|
-
} else {
|
|
177
|
-
evidence.push('cannot confirm origin (cwd or command unavailable)')
|
|
178
|
-
}
|
|
179
|
-
return { ownership, confidence, evidence, ledgerEntry }
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// ---------- T1-2 ServiceRegistry ----------
|
|
183
|
-
async function buildSnapshot() {
|
|
184
|
-
const partialWarnings = []
|
|
185
|
-
const tcp = await runCommand('lsof -nP -iTCP -sTCP:LISTEN', 5000)
|
|
186
|
-
if (tcp.code !== 0 && tcp.code !== null && tcp.code !== 1) partialWarnings.push('TCP listener scan exit=' + String(tcp.code))
|
|
187
|
-
const rows = parseListenRows(tcp.stdout)
|
|
188
|
-
const pids = [...new Set(rows.map((r) => r.pid))]
|
|
189
|
-
const pidList = pids.join(',')
|
|
190
|
-
|
|
191
|
-
let procByPid = new Map()
|
|
192
|
-
let extraByPid = new Map()
|
|
193
|
-
if (pids.length > 0) {
|
|
194
|
-
const psRes = await runCommand('ps -o pid=,ppid=,lstart=,command= -p ' + pidList, 5000)
|
|
195
|
-
procByPid = new Map(parsePsRows(psRes.stdout).map((r) => [r.pid, r]))
|
|
196
|
-
if (psRes.code !== 0 && psRes.code !== null) partialWarnings.push('ps detail partial')
|
|
197
|
-
const pgidRes = await runCommand('ps -o pid=,pgid= -p ' + pidList, 5000)
|
|
198
|
-
const pgidMap = new Map()
|
|
199
|
-
for (const line of String(pgidRes.stdout).split('\n')) {
|
|
200
|
-
const parts = line.trim().split(/\s+/)
|
|
201
|
-
if (parts.length >= 2) {
|
|
202
|
-
const p = parseInt(parts[0], 10); const g = parseInt(parts[1], 10)
|
|
203
|
-
if (Number.isFinite(p) && Number.isFinite(g)) pgidMap.set(p, g)
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
let cwdByPid = new Map()
|
|
207
|
-
const cwdRes = await runCommand('lsof -a -p ' + pidList + ' -d cwd', 5000)
|
|
208
|
-
for (const line of String(cwdRes.stdout).split('\n')) {
|
|
209
|
-
const t = line.trim()
|
|
210
|
-
if (!t || t.startsWith('COMMAND')) continue
|
|
211
|
-
const m = t.match(/^(\S+)\s+(\d+)\s+(\S+)\s+cwd\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$/)
|
|
212
|
-
if (m) cwdByPid.set(parseInt(m[2], 10), m[8].trim())
|
|
213
|
-
}
|
|
214
|
-
if (cwdRes.code !== 0 && cwdRes.code !== null) partialWarnings.push('cwd scan partial')
|
|
215
|
-
for (const pid of pids) extraByPid.set(pid, { pgid: pgidMap.get(pid) || null, cwd: cwdByPid.get(pid) || null })
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const byPid = new Map()
|
|
219
|
-
for (const r of rows) {
|
|
220
|
-
const { host, port } = parseAddress(r.address)
|
|
221
|
-
if (!byPid.has(r.pid)) byPid.set(r.pid, [])
|
|
222
|
-
byPid.get(r.pid).push({ host, port, protocol: r.type === 'IPv6' ? 'tcp6' : 'tcp' })
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
let workspaces = []
|
|
226
|
-
try { if (workspaceRegistry && workspaceRegistry.list) workspaces = workspaceRegistry.list() } catch (e) { /* ignore */ }
|
|
227
|
-
|
|
228
|
-
const services = []
|
|
229
|
-
for (const [pid, listeners] of byPid) {
|
|
230
|
-
const proc = procByPid.get(pid)
|
|
231
|
-
const ex = extraByPid.get(pid) || {}
|
|
232
|
-
const command = proc ? proc.command : null
|
|
233
|
-
const cwd = ex.cwd
|
|
234
|
-
const name = proc ? proc.name || (command ? String(command).split(/\s+/)[0] : null) : null
|
|
235
|
-
const startedAt = proc ? proc.startedAt : null
|
|
236
|
-
const fpSource = [pid, startedAt, command || '', cwd || '', listeners.map((l) => l.host + ':' + l.port).sort().join(',')].join('|')
|
|
237
|
-
const serviceId = 'svc_' + fnv1a(fpSource)
|
|
238
|
-
const cls = classifyOwnership({ cwd, command, startedAt, pid }, ledger, workspaces)
|
|
239
|
-
const listenersFinal = listeners.map((l) => {
|
|
240
|
-
const isLocalhost = l.host === '127.0.0.1' || l.host === '::1' || l.host === 'localhost'
|
|
241
|
-
return Object.assign({}, l, { url: isLocalhost ? 'http://localhost:' + l.port : null })
|
|
242
|
-
})
|
|
243
|
-
services.push({
|
|
244
|
-
id: serviceId,
|
|
245
|
-
status: 'running',
|
|
246
|
-
ownership: cls.ownership,
|
|
247
|
-
confidence: cls.confidence,
|
|
248
|
-
name: name || 'unknown',
|
|
249
|
-
pid,
|
|
250
|
-
processGroupId: ex.pgid,
|
|
251
|
-
parentPid: proc ? proc.ppid : null,
|
|
252
|
-
commandSummary: command ? redact(String(command)).slice(0, 200) : null,
|
|
253
|
-
cwd,
|
|
254
|
-
startedAt,
|
|
255
|
-
listeners: listenersFinal,
|
|
256
|
-
restartable: !!cls.ledgerEntry,
|
|
257
|
-
protected: false,
|
|
258
|
-
ownershipEvidence: cls.evidence,
|
|
259
|
-
fingerprint: fpSource,
|
|
260
|
-
})
|
|
261
|
-
}
|
|
262
|
-
services.sort((a, b) => (a.ownership === 'conversation-confirmed' ? -1 : 1) - (b.ownership === 'conversation-confirmed' ? -1 : 1))
|
|
263
|
-
return { scannedAt: Date.now(), count: services.length, services, partialWarnings, ledgerCount: ledger.length }
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// ---------- T1-6 Lifecycle ----------
|
|
267
|
-
async function stopService(serviceId, mode) {
|
|
268
|
-
const s = await buildSnapshot()
|
|
269
|
-
const svc = s.services.find((x) => x.id === serviceId)
|
|
270
|
-
if (!svc) return err('TARGET_GONE', '该服务已结束,列表已刷新')
|
|
271
|
-
if (svc.protected) return err('PROTECTED_PROCESS', '该进程受保护,不能通过 Service Console 操作')
|
|
272
|
-
const target = svc.processGroupId ? '-' + svc.processGroupId : String(svc.pid)
|
|
273
|
-
await runCommand('kill -TERM ' + target, 3000)
|
|
274
|
-
const deadline = Date.now() + (config.gracefulTimeout || 3000)
|
|
275
|
-
while (Date.now() < deadline) {
|
|
276
|
-
await ctx.timeout(400)
|
|
277
|
-
const re = await buildSnapshot()
|
|
278
|
-
if (!re.services.some((x) => x.id === serviceId)) {
|
|
279
|
-
logAction(serviceId, 'stop', 'stopped')
|
|
280
|
-
return ok({ result: 'stopped' })
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
if (config.forceKill) {
|
|
284
|
-
await runCommand('kill -KILL ' + target, 3000)
|
|
285
|
-
logAction(serviceId, 'stop', 'force-killed')
|
|
286
|
-
return ok({ result: 'force-killed' })
|
|
287
|
-
}
|
|
288
|
-
logAction(serviceId, 'stop', 'timeout', 'GRACEFUL_TIMEOUT')
|
|
289
|
-
return err('GRACEFUL_TIMEOUT', '服务未在等待时间内退出,可重试或在设置允许时强制终止')
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
async function restartService(serviceId) {
|
|
293
|
-
const s = await buildSnapshot()
|
|
294
|
-
const svc = s.services.find((x) => x.id === serviceId)
|
|
295
|
-
if (!svc) return err('TARGET_GONE', '该服务已结束,列表已刷新')
|
|
296
|
-
if (!svc.restartable) return err('RESTART_UNSAFE', '缺少安全复现启动所需的信息,不能重启')
|
|
297
|
-
const entry = ledger.find((l) => svc.cwd && l.cwd && svc.cwd.indexOf(l.cwd) === 0)
|
|
298
|
-
if (!entry) return err('RESTART_UNSAFE', '缺少启动命令记录,不能重启')
|
|
299
|
-
const stopped = await stopService(serviceId, 'graceful')
|
|
300
|
-
if (!stopped.ok && stopped.error.code !== 'TARGET_GONE') return stopped
|
|
301
|
-
const cmd = 'cd ' + shellQuote(entry.cwd || '.') + ' && ' + entry.command
|
|
302
|
-
await runCommand(cmd + ' >/dev/null 2>&1 &', 3000)
|
|
303
|
-
logAction(serviceId, 'restart', 'started')
|
|
304
|
-
return ok({ result: 'started', command: redact(entry.command) })
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// ---------- T1-7 API 层 ----------
|
|
308
|
-
harness.handle('scan', async () => ok(await buildSnapshot()))
|
|
309
|
-
harness.handle('detail', async (args) => {
|
|
310
|
-
const s = await buildSnapshot()
|
|
311
|
-
const svc = s.services.find((x) => x.id === (args && args.serviceId))
|
|
312
|
-
if (!svc) return err('TARGET_GONE', '服务不存在')
|
|
313
|
-
return ok(Object.assign({}, svc, { recentActions: actionLog.filter((a) => a.serviceId === svc.id).slice(-10) }))
|
|
314
|
-
})
|
|
315
|
-
harness.handle('stop', async (args) => stopService(args && args.serviceId, (args && args.mode) || 'graceful'))
|
|
316
|
-
harness.handle('restart', async (args) => restartService(args && args.serviceId))
|
|
317
|
-
harness.handle('config', async (args) => {
|
|
318
|
-
const a = args || {}
|
|
319
|
-
if (a.action === 'update' && a.patch) {
|
|
320
|
-
const patch = a.patch
|
|
321
|
-
for (const key of Object.keys(patch)) {
|
|
322
|
-
if (!(key in config)) return err('BAD_REQUEST', 'unknown config key: ' + key)
|
|
323
|
-
const v = patch[key]
|
|
324
|
-
if (typeof v === 'boolean') { config[key] = v; continue }
|
|
325
|
-
if (typeof v === 'number' && CONFIG_LIMITS[key]) {
|
|
326
|
-
if (v < CONFIG_LIMITS[key][0] || v > CONFIG_LIMITS[key][1]) return err('BAD_REQUEST', 'config out of range: ' + key)
|
|
327
|
-
config[key] = v; continue
|
|
328
|
-
}
|
|
329
|
-
return err('BAD_REQUEST', 'invalid value for: ' + key)
|
|
330
|
-
}
|
|
331
|
-
return ok({ config })
|
|
332
|
-
}
|
|
333
|
-
return ok({ config })
|
|
334
|
-
})
|
|
335
|
-
harness.handle('actions', async () => ok({ actions: actionLog.slice(-50) }))
|
|
336
|
-
},
|
|
337
|
-
}
|
package/manifest.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "dsh-service-console",
|
|
3
|
-
"name": "服务控制台 (Service Console)",
|
|
4
|
-
"version": "0.7.1",
|
|
5
|
-
"description": "本地开发服务控制台:发现监听端口,识别归属,安全停止/重启",
|
|
6
|
-
"kind": "dynamic-cordis-plugin",
|
|
7
|
-
"platforms": {
|
|
8
|
-
"host": "src/index.ts",
|
|
9
|
-
"client": "src/client/index.tsx"
|
|
10
|
-
},
|
|
11
|
-
"host": {
|
|
12
|
-
"handlers": ["scan", "detail", "stop", "restart", "config", "actions"],
|
|
13
|
-
"services": ["shell", "workspaceRegistry"]
|
|
14
|
-
},
|
|
15
|
-
"client": {
|
|
16
|
-
"slots": [
|
|
17
|
-
"conversation.session.header.utilities",
|
|
18
|
-
"shell.overlay",
|
|
19
|
-
"settings.section"
|
|
20
|
-
],
|
|
21
|
-
"services": ["slots", "timer"]
|
|
22
|
-
},
|
|
23
|
-
"license": "MIT"
|
|
24
|
-
}
|