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.
Files changed (2) hide show
  1. package/index.mjs +9 -17
  2. 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
- for (const svcName of ['agent-preset-registry', 'agentPresets', 'presets']) {
839
- try {
840
- const svc = typeof ctx.get === 'function' ? ctx.get(svcName) : null
841
- if (!svc) continue
842
- const entry = { __type: typeof svc, __keys: Object.keys(svc).slice(0, 60) }
843
- for (const m of ['list', 'read', 'all', 'definitions', 'inventory', 'entries']) {
844
- if (typeof svc[m] === 'function') {
845
- try {
846
- const r = svc[m]()
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-maoying",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "毛颖 — DSH 网文创作辅助插件:主编 + 五帮手编排(大纲/写手/审校/设定/考据),novel/ 结构化文件为数据库",
5
5
  "type": "module",
6
6
  "license": "MIT",