gyoshu 0.4.17 → 0.4.18
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/package.json +1 -1
- package/src/gyoshu-manifest.json +1 -1
- package/src/index.ts +33 -19
package/package.json
CHANGED
package/src/gyoshu-manifest.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -867,32 +867,46 @@ function autoInstall(): InstallResult {
|
|
|
867
867
|
}
|
|
868
868
|
|
|
869
869
|
export const GyoshuPlugin: Plugin = async (ctx) => {
|
|
870
|
-
|
|
870
|
+
// Always return a valid Hooks object, even on error
|
|
871
|
+
const emptyHooks = {};
|
|
872
|
+
|
|
873
|
+
try {
|
|
874
|
+
const installResult = autoInstall();
|
|
871
875
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
+
if (installResult.fatal) {
|
|
877
|
+
console.error(`❌ Gyoshu: Fatal installation error`);
|
|
878
|
+
for (const error of installResult.errors) {
|
|
879
|
+
console.error(` - ${error}`);
|
|
880
|
+
}
|
|
876
881
|
}
|
|
877
|
-
return GyoshuHooks(ctx);
|
|
878
|
-
}
|
|
879
882
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
+
if (installResult.installed > 0) {
|
|
884
|
+
console.log(`🎓 Gyoshu: Installed ${installResult.installed} files to ~/.config/opencode/`);
|
|
885
|
+
}
|
|
883
886
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
+
if (installResult.updated > 0) {
|
|
888
|
+
console.log(`🎓 Gyoshu: Updated ${installResult.updated} files`);
|
|
889
|
+
}
|
|
887
890
|
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
891
|
+
if (installResult.errors.length > 0) {
|
|
892
|
+
console.warn(`⚠️ Gyoshu: Some issues occurred:`);
|
|
893
|
+
for (const error of installResult.errors) {
|
|
894
|
+
console.warn(` - ${error}`);
|
|
895
|
+
}
|
|
892
896
|
}
|
|
893
|
-
}
|
|
894
897
|
|
|
895
|
-
|
|
898
|
+
// Try to initialize hooks, return empty hooks on failure
|
|
899
|
+
try {
|
|
900
|
+
const hooks = await GyoshuHooks(ctx);
|
|
901
|
+
return hooks || emptyHooks;
|
|
902
|
+
} catch (hooksError) {
|
|
903
|
+
console.error(`❌ Gyoshu: Failed to initialize hooks: ${hooksError instanceof Error ? hooksError.message : String(hooksError)}`);
|
|
904
|
+
return emptyHooks;
|
|
905
|
+
}
|
|
906
|
+
} catch (err) {
|
|
907
|
+
console.error(`❌ Gyoshu: Plugin initialization failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
908
|
+
return emptyHooks;
|
|
909
|
+
}
|
|
896
910
|
};
|
|
897
911
|
|
|
898
912
|
export default GyoshuPlugin;
|