{"url":"https://levimc.org/mods/github.com/HosihikariFramework/PluginManagement/","id":"github.com/HosihikariFramework/PluginManagement","name":"星光 · 核心","description":"星光框架的托管核心：插件发现、依赖排序、隔离装载、生命周期与打包器","owner":"HosihikariFramework","logo":"https://levimc.org/mods/icons/8d4fda4c8cf46320-288.webp","repository":"https://github.com/HosihikariFramework/PluginManager","issues":"https://github.com/HosihikariFramework/PluginManager/issues","releases":"https://github.com/HosihikariFramework/PluginManager/releases","stars":0,"downloads":163,"updated":"2026-11-09T10:48:41Z","published":"2026-10-21T01:35:53Z","created":"2026-10-16T08:09:09Z","license":"LGPL-3.0","side":["server","client"],"platform":["linux-x64","win-x64"],"gameVersions":[],"tags":["platform:levilamina","platform:endstone","platform:linux","type:mod"],"latest":{"variant":"","version":"0.7.2","install":"lip install github.com/HosihikariFramework/PluginManagement@0.7.2"},"readmes":[{"file":"README.md","lang":"en","text":"# Hosihikari.PluginManager\n\n[English](README.md) | [简体中文](README.zh_hans.md)\n\nThe **core** of the Hosihikari framework: it discovers plugin packages, loads them in dependency\norder, puts each one in its own collectible ALC, drives its lifecycle, and — when any step fails —\ntakes down only that plugin.\n\nThe plugin contract lives in another repository and another package:\n[`Hosihikari.Abstractions`](https://www.nuget.org/packages/Hosihikari.Abstractions).\n\n## What is in this repository\n\n| | |\n|---|---|\n| `src/` | The core: discovery, dependency graph, the assembly Provider, lifecycle, failure isolation |\n| `tools/Pack/` | The packaging tool: assembles plugin packages and rejects the rules whose failure would otherwise surface far from their cause |\n| `test/Foo`, `test/Bar` | Two test plugins — and the packaging tool's first two users |\n| `host/` | The assertion host: a plain .NET console, **touching no BDS, no Shim, no carrier** |\n\n## Running it\n\n```\ndotnet run --project host/Hosihikari.PluginManager.Host.csproj -c Release\n```\n\nIt runs the whole assertion list and exits non-zero if any of them fails. **`-c Release` is\nrequired** — a Debug build keeps local variable references alive and makes the unload verification\nfail spuriously.\n\nThat command is what CI runs, and it gets the contract from nuget.org the same way an external\nplugin author does.\n\n## How the contract is obtained\n\nThe projects under `src/` and `test/` pick between two references automatically, depending on\nwhether the sibling checkout exists:\n\n- **Both repositories side by side** → `ProjectReference`. Changing the contract needs no repack.\n\nThe RID-first native library probe uses the McMaster fork; check that out as a sibling too (CI does).\n- **This repository alone** (CI, and any external consumer) → `PackageReference`, pinned to an exact\n  version.\n\n## As a lip package\n\nA `v*` tag builds `hosihikari-core-<version>.zip` and publishes it as\n`github.com/HosihikariFramework/PluginManagement`. The package installs the managed core under\n`plugins/hosihikari/`; the native Shim package declares a compatible Core version as a lip\ndependency. The native and managed sides check `HostingContractVersion` at startup.\n\nFor a source deployment, `bash ./pack.sh <version>` builds the same archive locally.\n\n## What is not here\n\n- **The Shim** — the native layer that hosts the CLR inside the BDS process — is its own repository.\n- **The out-of-process bridge (exception first-class provider)** — RpcProvider is an official provider;\n  it runs plugins in child processes instead of AOT-compiling source to IL. The core knows the Provider contract and nothing about the child process beyond it.\n- **Any BDS-specific capability** — worlds, entities, commands and game events are outside the\n  framework's capability surface.\n\n## Licence\n\nLGPL-3.0-or-later, see [LICENSE.md](LICENSE.md).\n"},{"file":"README.zh_hans.md","lang":"zh-Hans","text":"# Hosihikari.PluginManager\n\n[English](README.md) | [简体中文](README.zh_hans.md)\n\n星光框架的**核心**：把插件包发现出来、按依赖图装载、各自关进一个可回收的 ALC、驱动它的生命周期，并在任何一环失败时只让它自己倒下。\n\n插件契约在另一个仓与另一个包：[`Hosihikari.Abstractions`](https://www.nuget.org/packages/Hosihikari.Abstractions)。\n\n## 这个仓里有什么\n\n| | |\n|---|---|\n| `src/` | 核心：发现、依赖图、程序集型 Provider、生命周期、失败隔离 |\n| `tools/Pack/` | 打包工具：装配插件包，并在打包期拦下几条报错点离病因很远的规则 |\n| `test/Foo`、`test/Bar` | 两个测试插件 —— 它们也是打包工具的头两个用户 |\n| `host/` | 断言宿主：普通 .NET 控制台，**不碰 BDS、Shim、任何载体** |\n\n## 跑一遍\n\n```\ndotnet run --project host/Hosihikari.PluginManager.Host.csproj -c Release\n```\n\n它把整份断言清单跑一遍，任一条不过就以非零退出。**必须 `-c Release`** —— Debug 保留局部变量引用，会让卸载验证假失败。\n\nCI 跑的就是这一条命令，走的也是外部插件作者拿到契约的那条路（从 nuget.org 取包）。\n\n## 契约怎么被拿到\n\n`src/` 与 `test/` 里的项目对 `Hosihikari.Abstractions` 有两种拿法，按兄弟目录在不在自动择一：\n\n- **两个仓并列摆放** → `ProjectReference`。改契约不用重新打包。\n- **只检出本仓**（CI、以及任何外部消费者）→ `PackageReference`，版本精确钉住。跟着契约的 API 面走。\n\n本机库的 RID 优先解析走 McMaster 的 fork；它也必须作为兄弟目录检出（CI 就是这么摆的）。\n\n## 作为 lip 包\n\n打 `v*` 标签会构建 `hosihikari-core-<版本>.zip`，发布为\n`github.com/HosihikariFramework/PluginManagement`。包把托管核心装进 `plugins/hosihikari/`；\n原生 Shim 包用 lip 依赖声明兼容的 Core 版本。原生侧与托管侧在启动时核对\n`HostingContractVersion`。\n\n源码部署时，`bash ./pack.sh <版本>` 可以在本地构建同一份归档。\n\n## 不在这里的\n\n- **Shim** —— 把 CLR 托管进 BDS 进程的那层原生代码，是独立的仓。\n- **进程外桥（例外一等 Provider）** —— RpcProvider 是官方 Provider，独立成仓，插件在子进程中运行；核心只认 Provider 契约，不认识子进程的内部。\n- **任何 BDS 专有能力** —— 世界、实体、命令、游戏事件都不在能力面内。\n\n## 许可\n\nLGPL-3.0-or-later，见 [LICENSE.md](LICENSE.md)。\n"}],"gallery":[],"versions":[{"version":"0.7.2","prerelease":false,"released":"2026-10-21T06:36:16Z","releaseUrl":"https://github.com/HosihikariFramework/PluginManager/releases/tag/v0.7.2","manifestUrl":"https://github.com/HosihikariFramework/PluginManager/blob/v0.7.2/tooth.json","info":{"name":"星光 · 核心","description":"星光框架的托管核心：插件发现、依赖排序、隔离装载、生命周期与打包器","tags":["platform:levilamina","platform:endstone","platform:linux","type:mod"]},"variants":{"":[{"side":"server","platform":"win-x64","deps":{}},{"side":"client","platform":"win-x64","deps":{}},{"side":"server","platform":"linux-x64","deps":{}},{"side":"client","platform":"linux-x64","deps":{}}]}},{"version":"0.7.1","prerelease":false,"released":"2026-10-21T04:13:59Z","releaseUrl":"https://github.com/HosihikariFramework/PluginManager/releases/tag/v0.7.1","manifestUrl":"https://github.com/HosihikariFramework/PluginManager/blob/v0.7.1/tooth.json","info":{"name":"星光 · 核心","description":"星光框架的托管核心：插件发现、依赖排序、隔离装载、生命周期与打包器","tags":["platform:levilamina","platform:endstone","platform:linux","type:mod"]},"variants":{"":[{"side":"server","platform":"win-x64","deps":{}},{"side":"client","platform":"win-x64","deps":{}},{"side":"server","platform":"linux-x64","deps":{}},{"side":"client","platform":"linux-x64","deps":{}}]}},{"version":"0.7.0","prerelease":false,"released":"2026-10-21T02:42:12Z","releaseUrl":"https://github.com/HosihikariFramework/PluginManager/releases/tag/v0.7.0","manifestUrl":"https://github.com/HosihikariFramework/PluginManager/blob/v0.7.0/tooth.json","info":{"name":"星光 · 核心","description":"星光框架的托管核心：插件发现、依赖排序、隔离装载、生命周期与打包器","tags":["platform:levilamina","platform:endstone","platform:linux","type:mod"]},"variants":{"":[{"side":"server","platform":"win-x64","deps":{}},{"side":"client","platform":"win-x64","deps":{}},{"side":"server","platform":"linux-x64","deps":{}},{"side":"client","platform":"linux-x64","deps":{}}]}},{"version":"0.6.0","prerelease":false,"released":"2026-10-21T01:35:53Z","releaseUrl":"https://github.com/HosihikariFramework/PluginManager/releases/tag/v0.6.0","manifestUrl":"https://github.com/HosihikariFramework/PluginManager/blob/v0.6.0/tooth.json","info":{"name":"星光 · 核心","description":"星光框架的托管核心：插件发现、依赖排序、隔离装载、生命周期与打包器","tags":["platform:levilamina","platform:endstone","platform:linux","type:mod"]},"variants":{"":[{"side":"server","platform":"win-x64","deps":{}},{"side":"client","platform":"win-x64","deps":{}},{"side":"server","platform":"linux-x64","deps":{}},{"side":"client","platform":"linux-x64","deps":{}}]}}],"dependencies":{},"requiredBy":[]}