dsh-maoying 0.1.7 → 0.1.8
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/index.mjs +9 -17
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -835,29 +835,21 @@ export async function registerCreatorRoutes(ctx) {
|
|
|
835
835
|
} catch { return '[unserializable]' }
|
|
836
836
|
}
|
|
837
837
|
const registryDump = {}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
entry[m] = r && typeof r.then === 'function' ? '[async]' : jsonSafe(r)
|
|
848
|
-
} catch (e) { entry[m] = `throw: ${e?.message ?? e}` }
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
registryDump[svcName] = entry
|
|
852
|
-
} catch { /* 逐个吞错 */ }
|
|
853
|
-
}
|
|
838
|
+
try {
|
|
839
|
+
const svc = typeof ctx.get === 'function' ? ctx.get('agentPresets') : null
|
|
840
|
+
if (svc && typeof svc.list === 'function') {
|
|
841
|
+
// list() 返回每张 preset 的 {id,name,order,broken}——broken 即
|
|
842
|
+
// 面板上显示的逐行激活诊断(注册表自带审计,一行一条不可用原因)。
|
|
843
|
+
const rows = await svc.list()
|
|
844
|
+
registryDump.presets = jsonSafe(rows)
|
|
845
|
+
}
|
|
846
|
+
} catch (e) { registryDump.error = String(e?.message ?? e) }
|
|
854
847
|
json(res, 200, {
|
|
855
848
|
ok: true,
|
|
856
849
|
hostVersion: dbg.version,
|
|
857
850
|
trace: dbg.trace,
|
|
858
851
|
shape,
|
|
859
852
|
registry: registryDump,
|
|
860
|
-
ctxKeys: (() => { try { return Object.keys(ctx).slice(0, 80) } catch { return [] } })(),
|
|
861
853
|
runtime: {
|
|
862
854
|
argv: process.argv,
|
|
863
855
|
execPath: process.execPath,
|