{"modulePath":"github.com/nsgo-dev/game","version":"v0.2.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package devtools\n\nPackage devtools installs development-time plugin contributions (MCP bridge prefabs and playtest bots) separately from [github.com/nsgo-dev/game/pkg/plugin](/github.com/nsgo-dev/game/pkg/plugin).\n\nSeparating MCP and playtest wiring into this subpackage keeps shipped game binaries that import pkg/plugin from linking pkg/mcp, pkg/playtest, pkg/replay, and their transitive dependencies.\n\n## Functions\n\n```go\nfunc Install(h *Host, ps ...Plugin) error\n```\nInstall validates every plugin in ps against h and the process-global playtest registry before registering anything, then installs their bots, prefabs, and Install hooks in deterministic order (plugins in argument order, Prefabs in slice order, Bots in sorted key order).\n\n## Types\n\n```go\ntype Host struct {\n\t// Bridge receives plugin Prefabs when non-nil.\n\tBridge *mcp.Bridge\n\t// contains filtered or unexported fields\n}\n```\nHost holds the development-time registries that [Install](#Install) wires plugins into. Nil fields skip that kind of contribution.\n\n```go\nfunc (h *Host) Has(name string) bool\n```\nHas reports whether a devtools plugin named name has been installed on h.\n\n```go\nfunc (h *Host) Plugins() []plugin.Installed\n```\nPlugins returns the devtools plugins installed on h in installation order.\n\n```go\ntype Plugin struct {\n\t// Name uniquely identifies the plugin using the same rule as plugin.yaml's name.\n\tName string\n\t// Module is the plugin's Go module path, matching go.mod and plugin.yaml when set.\n\tModule string\n\t// API must equal [plugin.APIVersion].\n\tAPI int\n\t// Prefabs lists prefabs registered on Host.Bridge in slice order.\n\tPrefabs []PrefabSpec\n\t// Bots maps playtest bot profile names to factories registered in the process-global playtest registry in sorted key order, once per process per owning plugin.\n\tBots map[string]playtest.BotFactory\n\t// Install is an optional escape hatch called last after all declarative contributions have been validated and registered.\n\tInstall func(*Host) error\n}\n```\nPlugin declares a plugin's development-time contributions: MCP bridge prefabs and playtest bot profiles.\n\n```go\ntype PrefabSpec struct {\n\t// Name is the prefab name registered on the Bridge. When Prefab is set and Name is empty, Prefab.Name() is used.\n\tName string\n\t// Prefab registers an *entities.Prefab via Bridge.RegisterEntityPrefab.\n\tPrefab *entities.Prefab\n\t// Scene registers a self-contained single-root *sceneformat.SceneDoc via Bridge.RegisterScenePrefab.\n\tScene *sceneformat.SceneDoc\n\t// Spawn registers a custom mcp.PrefabSpawner via Bridge.RegisterPrefab.\n\tSpawn mcp.PrefabSpawner\n}\n```\nPrefabSpec describes one prefab that a devtools [Plugin](#Plugin) registers on [Host.Bridge](#Host.Bridge). Exactly one of Prefab, Scene, or Spawn must be non-nil.\n\n","path":"github.com/nsgo-dev/game/pkg/plugin/devtools","name":"devtools","synopsis":"Package devtools installs development-time plugin contributions (MCP bridge prefabs and playtest bots) separately from github.com/nsgo-dev/game/pkg/plugin.","isRedistributable":true}
