A minimal source-compiled F# plugin for the Hosihikari framework. The F# loader compiles
main.fsx at load with FSharp.Compiler.Service and runs the assembly in a collectible ALC; there is
no build step for the author.
-
Keep this repository outside the server. Rename the plugin: change
hosihikari.jsonname, renameMyFSharpPlugin.conf, and rename the type inmain.fsx. The package directory name must equal the manifestname. -
Pack it with the framework packer, then copy
dist/MyFSharpPlugin/into the server asplugins/MyFSharpPlugin/. The packer needs a siblingPluginManagercheckout, orHOSIHIKARI_PLUGINMANAGERpointing at one:pwsh ./pack.ps1bash ./pack.sh
-
Install the carrier bundle and the F# loader with Seiko:
sk init # once per server root sk add hosihikari-hosting-levilamina # LeviLamina # or: sk add hosihikari-hosting-endstone # or: sk add hosihikari-hosting-selfhosted sk add hosihikari-fsharp
-
Restart the server. The log shows the plugin loading and enabling.
For the self-hosted carriers, sk add hosihikari-hosting-selfhosted selects Windows or Linux; start the server through hosihikari-server (hosihikari-server.exe on Windows). Loaders and plugins still live under plugins/.
hosihikari.json—loader: fsharp, depends onhosihikariandhosihikari-fsharp. The packer writes the LeviLaminamanifest.jsonenvelope from it; that file is an output, not a source.pack.ps1/pack.sh— run the framework packer;dist/MyFSharpPlugin/is the installable package. A project still on the 1.xmanifest.jsonmigrates in the same command (-MigrateOnly/--migrate-onlyrewrites just the metadata).main.fsx— a parameterless type implementingIPlugin. It loadshelper.fsxwith#load.helper.fsx— the second compilation unit, loaded into the entry script.MyFSharpPlugin.conf— package defaults.
- Package defaults:
plugins/<name>/<name>.conf. - Server override:
config/hosihikari/<name>.conf. - Environment variables override the same keys.
- Runtime data:
data/hosihikari/<name>/.
OnLoad runs after dependencies are ready. OnEnable opens the event/timer gate; a refusal keeps
the plugin loaded and disabled. OnUnload releases what the plugin owns. An exception from a hook
is a fault and the host unloads the plugin. Every hook is a ValueTask and receives a
CancellationToken; honour it, and return before awaiting anything you cannot cancel.
See the F# loader for the compilation details.
MIT-0, see LICENSE.md.