mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-22 01:48:11 +00:00
docs: mascot before each section heading in tutorial docs
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
**中文** | [English](../zh/PLUGIN_DEV.md)
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
# HomeAgent Plugin Development Guide
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## Overview
|
||||
|
||||
All external interaction capabilities of HomeAgent comes from plugins. Plugins interact with the kernel through `PluginSDK` (Go API).
|
||||
@ -35,6 +35,8 @@ type Plugin interface {
|
||||
|
||||
---
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## 1. Quick Start: Using the plugindev Toolchain
|
||||
|
||||
`plugindev` is the unified plugin development toolchain provided in the SDK repository, supporting both Go and Lua plugin types.
|
||||
@ -134,6 +136,8 @@ Or upload via WebUI plugin management page.
|
||||
|
||||
---
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## 2. Go Plugin Development in Detail
|
||||
|
||||
### Plugin Interface
|
||||
@ -346,6 +350,8 @@ channels := s.ListChannels()
|
||||
|
||||
---
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## 3. Lua Plugin Development in Detail
|
||||
|
||||
Lua plugins are suitable for lightweight rapid prototyping, requiring no Go compilation environment. Changes take effect after kernel restart.
|
||||
@ -416,6 +422,8 @@ When running inside the kernel, `sdk.*` global variables are injected by the Go
|
||||
|
||||
---
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## 4. Built-in Plugins
|
||||
|
||||
Built-in plugins use `init()` self-registration, compiled into the kernel, no separate deployment needed.
|
||||
@ -479,6 +487,8 @@ import (
|
||||
|
||||
---
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## 5. Best Practices
|
||||
|
||||
1. `Start()` is non-blocking — start long tasks in goroutines, don't block Start
|
||||
@ -491,6 +501,8 @@ import (
|
||||
|
||||
---
|
||||
|
||||
<img src="../../branding/mascot-xiaozhai.webp" width="20" style="border-radius:50%;vertical-align:middle"> :
|
||||
|
||||
## 6. Example Plugin Reference
|
||||
|
||||
### SDK Repository Examples (`homeagent-sdk/example/`)
|
||||
|
||||
Reference in New Issue
Block a user