feat(plugins): 提示词备份文件读写模块 + promptlib 1.5.9 同步

This commit is contained in:
qiqi committed 2026-11-22 17:14:47 +08:00
1 parent 4bdf6d0313
commit 404aa08cc6
8 files changed
+155 -6

No files matched your search

+3
View File
@@ -64,6 +64,9 @@
fileList: fileOp('list'),
fileRemove: fileOp('remove'),
fileStat: fileOp('stat'),
// 备份文件读写(宿主的另存为/打开对话框)
exportText: function (name, text) { const B = (typeof global !== 'undefined') ? global.IWBPromptlibBackup : null; return (B && typeof B.saveText === 'function') ? B.saveText(text, name) : Promise.reject(new Error('备份能力未就绪')) },
importText: function () { const B = (typeof global !== 'undefined') ? global.IWBPromptlibBackup : null; return (B && typeof B.pickText === 'function') ? B.pickText() : Promise.reject(new Error('备份能力未就绪')) },
onChanged: function (fn) {
if (typeof fn !== 'function') return function () {}
listeners.push(fn)