feat(plugin-protocol,server-shared): new package

This commit is contained in:
Neko Ayaka
2026-02-08 03:44:04 +08:00
parent d98b3c6a2c
commit ca19529675
11 changed files with 1167 additions and 1008 deletions
+31
View File
@@ -0,0 +1,31 @@
# @proj-airi/plugin-protocol
Shared protocol contracts for plugin-module communication in Project AIRI.
## What it does
- Defines websocket event names and payload types for module/plugin orchestration.
- Exposes Eventa event definitions bound to protocol event names.
- Provides shared transport/event utility types used by server and plugin runtimes.
## How to use
```ts
import type { WebSocketEvent, WebSocketEventOf, WebSocketEvents } from '@proj-airi/plugin-protocol/types'
import { moduleAnnounce, moduleAuthenticate } from '@proj-airi/plugin-protocol/types'
```
## When to use
- You need canonical protocol contracts for plugin <-> host communication.
- You need event name stability and matching payload definitions across runtimes.
## When not to use
- You only need higher-level runtime client APIs from SDK packages.
- You are implementing app-only UI state that is not part of plugin/server transport contracts.
## License
[MIT](../../LICENSE)
+39
View File
@@ -0,0 +1,39 @@
{
"name": "@proj-airi/plugin-protocol",
"type": "module",
"version": "0.8.4",
"description": "Plugin protocol event definitions and shared websocket types for Project AIRI",
"author": {
"name": "Moeru AI Project AIRI Team",
"email": "airi@moeru.ai",
"url": "https://github.com/moeru-ai"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/moeru-ai/airi.git",
"directory": "packages/plugin-protocol"
},
"exports": {
"./types": {
"types": "./dist/types/index.d.mts",
"default": "./dist/types/index.mjs"
}
},
"main": "./dist/types/index.mjs",
"types": "./dist/types/index.d.mts",
"files": [
"README.md",
"dist",
"package.json"
],
"scripts": {
"dev": "pnpm run build",
"build": "tsdown",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@moeru/eventa": "catalog:",
"@xsai/shared-chat": "catalog:"
}
}
+1
View File
@@ -0,0 +1 @@
console.warn('import @proj-airi/plugin-protocol/types instead')
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
export * from './events'
+18
View File
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": [
"ESNext"
],
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"skipLibCheck": true
},
"include": [
"src/**/*.ts"
]
}
@@ -0,0 +1,9 @@
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: {
'types/index': 'src/types/index.ts',
},
sourcemap: true,
unused: true,
})
+1 -2
View File
@@ -33,7 +33,6 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@moeru/eventa": "catalog:",
"@xsai/shared-chat": "catalog:"
"@proj-airi/plugin-protocol": "workspace:*"
}
}
@@ -1 +1,2 @@
export * from './websocket'
export * from '@proj-airi/plugin-protocol/types'
File diff suppressed because it is too large Load Diff
+12 -6
View File
@@ -1970,6 +1970,15 @@ importers:
specifier: ^1.0.2
version: 1.0.2
packages/plugin-protocol:
dependencies:
'@moeru/eventa':
specifier: 'catalog:'
version: 1.0.0-alpha.14(electron@40.0.0)
'@xsai/shared-chat':
specifier: 'catalog:'
version: 0.4.0-beta.13
packages/plugin-sdk:
dependencies:
'@moeru/eventa':
@@ -2021,12 +2030,9 @@ importers:
packages/server-shared:
dependencies:
'@moeru/eventa':
specifier: 'catalog:'
version: 1.0.0-alpha.14(electron@40.0.0)
'@xsai/shared-chat':
specifier: 'catalog:'
version: 0.4.0-beta.13
'@proj-airi/plugin-protocol':
specifier: workspace:*
version: link:../plugin-protocol
packages/stage-layouts:
dependencies: