docs: rescan rebased documentation hierarchy

This commit is contained in:
Turtle
2026-08-05 16:16:57 +08:00
parent 012bb0a549
commit 8af3babaea
304 changed files with 1091 additions and 1983 deletions
+21 -6
View File
@@ -2,7 +2,15 @@
English | [中文](index.zh.md)
This guide creates a minimal Harness plugin and loads it into an agent.
This tutorial creates a minimal Harness plugin and loads it into the Web UI. Start from a repository checkout that has completed the [quick start](../../guide/quickstart.md).
## Create a local project
From the repository root, create a scratch project for the tutorial:
```sh
mkdir -p scratch-plugin/src
```
## What is a plugin?
@@ -22,7 +30,7 @@ That is the complete shape.
## Create the plugin file
Create `src/my-plugin.ts` in your project:
Create `scratch-plugin/src/my-plugin.ts`:
```ts
import type { Context } from 'cordis'
@@ -37,14 +45,21 @@ export function apply(ctx: Context) {
## Register it in cordis.yml
Add an entry to `cordis.yml`:
Create `scratch-plugin/cordis.yml` as a Web overlay that inserts the local plugin:
```yaml
- id: hello
name: './src/my-plugin.ts'
- insert:
- id: hello
name: './src/my-plugin.ts'
```
After startup, the console prints `[hello-plugin] plugin loaded!`.
Start the Web UI with that overlay:
```sh
pnpm run dsh web --config ./scratch-plugin/cordis.yml
```
Open `http://127.0.0.1:3080`. The terminal prints `[hello-plugin] plugin loaded!` during startup.
## Automatic cleanup