xinyu-pro 0.22.1 → 0.22.2
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/app/api/plugins/route.ts +4 -1
- package/lib/plugin-runtime.ts +3 -3
- package/package.json +1 -1
- package/plugins/xinyu.auto-start-and-choices.xye +0 -0
- package/plugins/xinyu.bag-system.xye +0 -0
- package/plugins/xinyu.cache-optimizer.xye +0 -0
- package/plugins/xinyu.character-studio.xye +0 -0
- package/plugins/xinyu.dice-arbiter.xye +0 -0
- package/plugins/xinyu.markdown-render.xye +0 -0
- package/plugins/xinyu.slot-ui-beautify.xye +0 -0
- package/plugins/xinyu.world-info.xye +0 -0
- package/version.json +1 -1
package/app/api/plugins/route.ts
CHANGED
|
@@ -54,7 +54,10 @@ function rowToPlugin(row: Record<string, unknown>) {
|
|
|
54
54
|
uiSlots: parseJsonField(row.ui_slots),
|
|
55
55
|
...perms,
|
|
56
56
|
publicExports: parseJsonField(row.public_exports),
|
|
57
|
-
dependencies:
|
|
57
|
+
dependencies: (() => {
|
|
58
|
+
const parsed = parseJsonField(row.dependencies);
|
|
59
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
60
|
+
})(),
|
|
58
61
|
createdAt: row.created_at,
|
|
59
62
|
updatedAt: row.updated_at,
|
|
60
63
|
};
|
package/lib/plugin-runtime.ts
CHANGED
|
@@ -774,7 +774,7 @@ class PluginRuntimeEngine {
|
|
|
774
774
|
if (!callerInstance) {
|
|
775
775
|
throw new Error(`[PluginRuntime] 调用方插件 ${callerPluginId} 未加载`);
|
|
776
776
|
}
|
|
777
|
-
const callerDeps = callerInstance.manifest.dependencies
|
|
777
|
+
const callerDeps = Array.isArray(callerInstance.manifest.dependencies) ? callerInstance.manifest.dependencies : [];
|
|
778
778
|
const hasDeclaredDep = callerDeps.some(d => d.pluginId === targetPluginId);
|
|
779
779
|
if (!hasDeclaredDep) {
|
|
780
780
|
throw new Error(`[PluginRuntime] 插件 ${callerPluginId} 未声明对 ${targetPluginId} 的依赖,请在 manifest.dependencies 中添加`);
|
|
@@ -844,7 +844,7 @@ class PluginRuntimeEngine {
|
|
|
844
844
|
|
|
845
845
|
/** 检查插件的依赖状态 */
|
|
846
846
|
checkDependencies(manifest: PluginManifest): DependencyStatus[] {
|
|
847
|
-
const deps = manifest.dependencies
|
|
847
|
+
const deps = Array.isArray(manifest.dependencies) ? manifest.dependencies : [];
|
|
848
848
|
return deps.map(dep => {
|
|
849
849
|
const targetInstance = this.state.instances.get(dep.pluginId);
|
|
850
850
|
if (!targetInstance) {
|
|
@@ -897,7 +897,7 @@ class PluginRuntimeEngine {
|
|
|
897
897
|
visiting.add(id);
|
|
898
898
|
|
|
899
899
|
const manifest = manifestMap.get(id);
|
|
900
|
-
if (manifest?.dependencies) {
|
|
900
|
+
if (Array.isArray(manifest?.dependencies)) {
|
|
901
901
|
for (const dep of manifest.dependencies) {
|
|
902
902
|
if (manifestMap.has(dep.pluginId)) {
|
|
903
903
|
visit(dep.pluginId);
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/version.json
CHANGED