first commit

This commit is contained in:
npc0-hue
2026-07-11 14:56:10 +08:00
commit 7e05d0a4e7
660 changed files with 78119 additions and 0 deletions
@@ -0,0 +1,38 @@
## 1. Plugin SDK and Manifest Contract
- [x] 1.1 Extend plugin manifest schema, SDK types, and the development example with bridge action/page declarations.
- [x] 1.2 Add SDK bridge action, request envelope, response, safe error, and permission helper types.
- [x] 1.3 Add plugin SDK tests for request builders, local permission checks, and forbidden transport assumptions.
## 2. Platform Bridge Authorization
- [x] 2.1 Add platform domain and DTO types for plugin bridge sessions, actions, requests, and authorization decisions.
- [x] 2.2 Add platform validators that map bridge actions to required permissions and AI purposes.
- [x] 2.3 Add platform service logic and API route for bridge action authorization.
- [x] 2.4 Add Go tests for allowed actions, missing permissions, unsupported actions, and undeclared AI purposes.
## 3. Frontend Host Bridge Utilities
- [x] 3.1 Add frontend bridge host contract/types for safe plugin page context.
- [x] 3.2 Add frontend utilities that filter page permissions against manifest permissions and exclude secret-bearing fields.
- [x] 3.3 Add frontend tests for safe context creation and page permission filtering.
## 4. Verification
- [x] 4.1 Run plugin SDK/schema tests.
- [x] 4.2 Run platform bridge authorization tests.
- [x] 4.3 Run platform_web bridge utility tests.
- [x] 4.4 Run `scripts/check-structure.sh`.
- [x] 4.5 Run `openspec validate implement-plugin-bridge-and-sdk --strict`.
- [x] 4.6 Record verification evidence in this task file and only then mark verification tasks complete.
## Evidence
- `cd platform && go test ./...`: passed.
- `cd plugins && npm test`: passed, 1 file / 7 tests.
- `cd plugins && npm run typecheck`: passed.
- `cd plugins && npm run validate:manifest`: passed for `examples/dev-game-plugin/manifest.json`.
- `cd platform_web && npm test`: passed, 4 files / 7 tests.
- `cd platform_web && npm run typecheck`: passed.
- `scripts/check-structure.sh`: passed.
- `openspec validate implement-plugin-bridge-and-sdk --strict`: passed.