refactor: restructure project layout and add install.mjs

- Move src/ → plugin/ with subdirectories:
  - plugin/core/ (business logic, models, store, permissions, utils, memory)
  - plugin/tools/ (query, resources)
  - plugin/commands/ (placeholder for slash commands)
  - plugin/hooks/ (placeholder for lifecycle hooks)
  - plugin/index.ts (wiring layer only, no business logic)
- Add install.mjs with --install, --uninstall, --openclaw-profile-path
- Add skills/ and docs/ root directories
- Move planning docs (PLAN.md, FEAT.md, AGENT_TASKS.md) to docs/
- Remove old scripts/install.sh
- Update tsconfig rootDir: src → plugin
- Update README.md and README.zh.md with new layout
- Bump version to 0.2.0
- All tests pass
This commit is contained in:
zhi
2026-03-10 14:44:40 +00:00
parent 00ffef0d8e
commit a0e926594f
30 changed files with 260 additions and 81 deletions

View File

@@ -24,24 +24,20 @@ Yonexus is an OpenClaw plugin for organization hierarchy and agent identity mana
```text
.
├─ plugin.json
├─ src/
│ ├─ index.ts
│ ├─ models/
│ ├─ permissions/
store/
│ ├─ tools/
│ ├─ memory/
│ └─ utils/
├─ scripts/
├─ install.sh
│ └─ demo.ts
├─ tests/
│ └─ smoke.ts
├─ examples/
│ └─ sample-data.json
└─ dist/
└─ yonexus/
├─ plugin/
│ ├─ index.ts # wiring: init, register commands/hooks/tools
│ ├─ commands/ # slash commands
│ ├─ tools/ # query & resource tools
│ ├─ hooks/ # lifecycle hooks
core/ # business logic, models, store, permissions
├─ skills/ # skill definitions
├─ docs/ # project documentation
├─ scripts/ # demo & utility scripts
├─ tests/ # tests
├─ install.mjs # install/uninstall script
├─ plugin.json # plugin manifest
├─ README.md
└─ README.zh.md
```
## Requirements
@@ -54,11 +50,23 @@ Yonexus is an OpenClaw plugin for organization hierarchy and agent identity mana
```bash
npm install
npm run build
bash scripts/install.sh
npm run test:smoke
npm run demo
```
## Install / Uninstall
```bash
# Install (builds and copies to ~/.openclaw/plugins/yonexus)
node install.mjs --install
# Install to custom openclaw profile path
node install.mjs --install --openclaw-profile-path /path/to/.openclaw
# Uninstall
node install.mjs --uninstall
```
## Configuration
`plugin.json` includes default config:
@@ -98,8 +106,6 @@ Data & audit:
## Testing
Smoke test:
```bash
npm run test:smoke
```