feat(plugin-protocol,server-shared): new package
This commit is contained in:
@@ -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)
|
||||
@@ -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:"
|
||||
}
|
||||
}
|
||||
@@ -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'
|
||||
@@ -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,
|
||||
})
|
||||
Reference in New Issue
Block a user