refactor: jsc-mod 改名 jsc-mod-statusline、jsc-companion 改名 jsc-mod-companion,指令拆成獨立指令
- jsc-mod-statusline:/jsc-mod-statusline:enable、compact、disable - jsc-mod-companion:/jsc-mod-companion:status、switch、disable、setup、todo、quiet - 同步更新 plugin.json、marketplace.json 與各 README - 補上 statusline band 測試缺少的 ui.render 底層處理 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
0e7636c185
commit
ea17f1cb2d
@@ -0,0 +1,26 @@
|
||||
import type { Fs } from './fs'
|
||||
|
||||
// hooks 沙箱沒有 node:fs,改用引擎的 $.fs;它沒有 rename,所以不提供(writeAtomic 會直接覆寫)
|
||||
type EngineFs = {
|
||||
read(path: string): Promise<string>
|
||||
write(path: string, text: string): Promise<void>
|
||||
list(path?: string): Promise<{ name: string }[]>
|
||||
}
|
||||
|
||||
export const engineFs = (fs: EngineFs): Fs => ({
|
||||
async read(path) {
|
||||
try {
|
||||
return await fs.read(path)
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
},
|
||||
write: (path, data) => fs.write(path, data),
|
||||
async list(dir) {
|
||||
try {
|
||||
return (await fs.list(dir)).map(e => e.name).filter(n => !n.endsWith('.tmp')).sort()
|
||||
} catch {
|
||||
return []
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user