dsh-superinput 0.0.0-stage → 0.7.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.
@@ -0,0 +1,6 @@
1
+ # dsh-superinput bundle patch: one host row over the Web or Desktop profile.
2
+ # The row name resolves from the profile's own node_modules where
3
+ # `dsh plugin --profile <profile> add <path>` installed this package.
4
+ - insert:
5
+ - id: superinput
6
+ name: dsh-superinput
package/index.js ADDED
@@ -0,0 +1,34 @@
1
+ /* dsh-superinput 入口:零依赖探针(由 scripts/build-suite.mjs 生成;勿手改)。
2
+ * 静态 import 的失败发生在本文件第一条语句之前(宿主静默),所以核心代码
3
+ * 全部放在 server.js 由这里动态加载——成败都会留下取证记录。 */
4
+ import { appendFileSync, mkdirSync } from 'node:fs'
5
+ import { homedir } from 'node:os'
6
+ import { dirname, join } from 'node:path'
7
+
8
+ const DIAG = join(homedir(), '.dsh', 'superinput-debug.log')
9
+ const trace = (line) => {
10
+ try {
11
+ mkdirSync(dirname(DIAG), { recursive: true })
12
+ appendFileSync(DIAG, `${new Date().toISOString()} ${line}\n`, 'utf8')
13
+ } catch { /* ignore */ }
14
+ }
15
+
16
+ trace(`suite ENTRY pid=${process.pid}`)
17
+
18
+ let core
19
+ try {
20
+ core = await import('./server.js')
21
+ trace(`server.js LOADED pid=${process.pid}`)
22
+ } catch (error) {
23
+ trace(`server.js FAILED: ${String(error?.stack ?? error).slice(0, 600)}`)
24
+ throw error
25
+ }
26
+
27
+ export const name = core.name
28
+ export const inject = core.inject
29
+ export const Config = core.Config
30
+ export function apply(ctx, config) {
31
+ trace(`suite APPLY pid=${process.pid}`)
32
+ return core.apply(ctx, config)
33
+ }
34
+ export default core.default