feat(plugin-sdk): init
This commit is contained in:
+2
-2
@@ -78,8 +78,8 @@ components.d.ts
|
|||||||
**/public/assets/fonts/
|
**/public/assets/fonts/
|
||||||
|
|
||||||
# Code generation
|
# Code generation
|
||||||
vscode-airi/src/generated/
|
**/vscode-airi/src/generated/
|
||||||
vscode-airi/LICENSE
|
**/vscode-airi/LICENSE
|
||||||
|
|
||||||
# Make it easy for devenv users to override their local environment.
|
# Make it easy for devenv users to override their local environment.
|
||||||
# See: https://github.com/moeru-ai/airi/pull/110#discussion_r2024378953
|
# See: https://github.com/moeru-ai/airi/pull/110#discussion_r2024378953
|
||||||
|
|||||||
@@ -1,135 +0,0 @@
|
|||||||
// This file is generated by `vscode-ext-gen`. Do not modify manually.
|
|
||||||
// @see https://github.com/antfu/vscode-ext-gen
|
|
||||||
|
|
||||||
// Meta info
|
|
||||||
export const publisher = 'proj-airi'
|
|
||||||
export const name = 'airi-vscode'
|
|
||||||
export const version = '0.8.49000'
|
|
||||||
export const displayName = 'AIRI VS Code Bridge'
|
|
||||||
export const description = 'VS Code bridge that shares coding context with AIRI'
|
|
||||||
export const extensionId = `${publisher}.${name}`
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type union of all commands
|
|
||||||
*/
|
|
||||||
export type CommandKey
|
|
||||||
= | 'airi-vscode.enable'
|
|
||||||
| 'airi-vscode.disable'
|
|
||||||
| 'airi-vscode.status'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Commands map registered by `proj-airi.airi-vscode`
|
|
||||||
*/
|
|
||||||
export const commands = {
|
|
||||||
/**
|
|
||||||
* AIRI: Enable
|
|
||||||
* @value `airi-vscode.enable`
|
|
||||||
*/
|
|
||||||
enable: 'airi-vscode.enable',
|
|
||||||
/**
|
|
||||||
* AIRI: Disable
|
|
||||||
* @value `airi-vscode.disable`
|
|
||||||
*/
|
|
||||||
disable: 'airi-vscode.disable',
|
|
||||||
/**
|
|
||||||
* AIRI: Show Status
|
|
||||||
* @value `airi-vscode.status`
|
|
||||||
*/
|
|
||||||
status: 'airi-vscode.status',
|
|
||||||
} satisfies Record<string, CommandKey>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Type union of all configs
|
|
||||||
*/
|
|
||||||
export type ConfigKey
|
|
||||||
= | 'airi-vscode.enabled'
|
|
||||||
| 'airi-vscode.contextLines'
|
|
||||||
| 'airi-vscode.sendInterval'
|
|
||||||
|
|
||||||
export interface ConfigKeyTypeMap {
|
|
||||||
'airi-vscode.enabled': boolean
|
|
||||||
'airi-vscode.contextLines': number
|
|
||||||
'airi-vscode.sendInterval': number
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfigShorthandMap {
|
|
||||||
enabled: 'airi-vscode.enabled'
|
|
||||||
contextLines: 'airi-vscode.contextLines'
|
|
||||||
sendInterval: 'airi-vscode.sendInterval'
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfigShorthandTypeMap {
|
|
||||||
enabled: boolean
|
|
||||||
contextLines: number
|
|
||||||
sendInterval: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfigItem<T extends keyof ConfigKeyTypeMap> {
|
|
||||||
key: T
|
|
||||||
default: ConfigKeyTypeMap[T]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configs map registered by `proj-airi.airi-vscode`
|
|
||||||
*/
|
|
||||||
export const configs = {
|
|
||||||
/**
|
|
||||||
* Enable or disable the AIRI extension
|
|
||||||
* @key `airi-vscode.enabled`
|
|
||||||
* @default `true`
|
|
||||||
* @type `boolean`
|
|
||||||
*/
|
|
||||||
enabled: {
|
|
||||||
key: 'airi-vscode.enabled',
|
|
||||||
default: true,
|
|
||||||
} as ConfigItem<'airi-vscode.enabled'>,
|
|
||||||
/**
|
|
||||||
* Number of context lines to send (before and after current line)
|
|
||||||
* @key `airi-vscode.contextLines`
|
|
||||||
* @default `5`
|
|
||||||
* @type `number`
|
|
||||||
*/
|
|
||||||
contextLines: {
|
|
||||||
key: 'airi-vscode.contextLines',
|
|
||||||
default: 5,
|
|
||||||
} as ConfigItem<'airi-vscode.contextLines'>,
|
|
||||||
/**
|
|
||||||
* Interval in milliseconds to send updates (0 for real-time)
|
|
||||||
* @key `airi-vscode.sendInterval`
|
|
||||||
* @default `3000`
|
|
||||||
* @type `number`
|
|
||||||
*/
|
|
||||||
sendInterval: {
|
|
||||||
key: 'airi-vscode.sendInterval',
|
|
||||||
default: 3000,
|
|
||||||
} as ConfigItem<'airi-vscode.sendInterval'>,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ScopedConfigKeyTypeMap {
|
|
||||||
enabled: boolean
|
|
||||||
contextLines: number
|
|
||||||
sendInterval: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export const scopedConfigs = {
|
|
||||||
scope: 'airi-vscode',
|
|
||||||
defaults: {
|
|
||||||
enabled: true,
|
|
||||||
contextLines: 5,
|
|
||||||
sendInterval: 3000,
|
|
||||||
} satisfies ScopedConfigKeyTypeMap,
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NestedConfigs {
|
|
||||||
'airi-vscode': {
|
|
||||||
enabled: boolean
|
|
||||||
contextLines: number
|
|
||||||
sendInterval: number
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NestedScopedConfigs {
|
|
||||||
enabled: boolean
|
|
||||||
contextLines: number
|
|
||||||
sendInterval: number
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "@proj-airi/plugin-sdk",
|
||||||
|
"type": "module",
|
||||||
|
"version": "0.8.4",
|
||||||
|
"description": "Plugin SDK 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-sdk"
|
||||||
|
},
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./dist/index.d.mts",
|
||||||
|
"default": "./dist/index.mjs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"main": "./dist/index.mjs",
|
||||||
|
"types": "./dist/index.d.mts",
|
||||||
|
"files": [
|
||||||
|
"README.md",
|
||||||
|
"dist",
|
||||||
|
"package.json"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"dev": "pnpm run build",
|
||||||
|
"build": "tsdown",
|
||||||
|
"typecheck": "tsc --noEmit"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
console.warn('@proj-airi/plugin-sdk is currently working in progress. APIs may change without warning.')
|
||||||
@@ -383,9 +383,9 @@ export function setupApp(options?: {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
function closeAllPeers() {
|
function closeAllPeers() {
|
||||||
console.log('closing all peers', peers.size)
|
logger.withFields({ totalPeers: peers.size }).log('closing all peers')
|
||||||
for (const peer of peers.values()) {
|
for (const peer of peers.values()) {
|
||||||
console.log('closing peer', peer.peer.id)
|
logger.withFields({ peer: peer.peer.id, peerName: peer.name }).debug('closing peer')
|
||||||
peer.peer.close?.()
|
peer.peer.close?.()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+41
-33
@@ -1767,6 +1767,42 @@ importers:
|
|||||||
specifier: ^3.1.8
|
specifier: ^3.1.8
|
||||||
version: 3.2.1(typescript@5.9.3)
|
version: 3.2.1(typescript@5.9.3)
|
||||||
|
|
||||||
|
integrations/vscode/airi-plugin-vscode:
|
||||||
|
devDependencies:
|
||||||
|
'@proj-airi/plugin-sdk':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../../packages/plugin-sdk
|
||||||
|
|
||||||
|
integrations/vscode/vscode-airi:
|
||||||
|
devDependencies:
|
||||||
|
'@guiiai/logg':
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 1.2.11
|
||||||
|
'@moeru/std':
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 0.1.0-beta.14
|
||||||
|
'@proj-airi/server-sdk':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../../packages/server-sdk
|
||||||
|
'@types/vscode':
|
||||||
|
specifier: ^1.108.1
|
||||||
|
version: 1.108.1
|
||||||
|
es-toolkit:
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 1.43.0
|
||||||
|
injeca:
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 0.1.7(@guiiai/logg@1.2.11)(error-stack-parser@2.1.4)(nanoid@5.1.6)
|
||||||
|
nanoid:
|
||||||
|
specifier: 'catalog:'
|
||||||
|
version: 5.1.6
|
||||||
|
tinyexec:
|
||||||
|
specifier: ^1.0.2
|
||||||
|
version: 1.0.2
|
||||||
|
vscode-ext-gen:
|
||||||
|
specifier: ^1.5.1
|
||||||
|
version: 1.5.1
|
||||||
|
|
||||||
packages/audio:
|
packages/audio:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@alexanderolsen/libsamplerate-js':
|
'@alexanderolsen/libsamplerate-js':
|
||||||
@@ -1931,6 +1967,8 @@ importers:
|
|||||||
specifier: ^1.0.2
|
specifier: ^1.0.2
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
|
|
||||||
|
packages/plugin-sdk: {}
|
||||||
|
|
||||||
packages/server-runtime:
|
packages/server-runtime:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@guiiai/logg':
|
'@guiiai/logg':
|
||||||
@@ -2954,36 +2992,6 @@ importers:
|
|||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../packages/server-sdk
|
version: link:../../packages/server-sdk
|
||||||
|
|
||||||
plugins/airi-plugin-vscode:
|
|
||||||
devDependencies:
|
|
||||||
'@guiiai/logg':
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 1.2.11
|
|
||||||
'@moeru/std':
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 0.1.0-beta.14
|
|
||||||
'@proj-airi/server-sdk':
|
|
||||||
specifier: workspace:*
|
|
||||||
version: link:../../packages/server-sdk
|
|
||||||
'@types/vscode':
|
|
||||||
specifier: ^1.108.1
|
|
||||||
version: 1.108.1
|
|
||||||
es-toolkit:
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 1.43.0
|
|
||||||
injeca:
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 0.1.7(@guiiai/logg@1.2.11)(error-stack-parser@2.1.4)(nanoid@5.1.6)
|
|
||||||
nanoid:
|
|
||||||
specifier: 'catalog:'
|
|
||||||
version: 5.1.6
|
|
||||||
tinyexec:
|
|
||||||
specifier: ^1.0.2
|
|
||||||
version: 1.0.2
|
|
||||||
vscode-ext-gen:
|
|
||||||
specifier: ^1.5.1
|
|
||||||
version: 1.5.1
|
|
||||||
|
|
||||||
plugins/airi-plugin-web-extension:
|
plugins/airi-plugin-web-extension:
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@iconify-json/solar':
|
'@iconify-json/solar':
|
||||||
@@ -3009,7 +3017,7 @@ importers:
|
|||||||
version: 14.1.0(vue@3.5.26(typescript@5.9.3))
|
version: 14.1.0(vue@3.5.26(typescript@5.9.3))
|
||||||
'@wxt-dev/module-vue':
|
'@wxt-dev/module-vue':
|
||||||
specifier: ^1.0.3
|
specifier: ^1.0.3
|
||||||
version: 1.0.3(vite@7.3.1(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))(wxt@0.20.13(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(rollup@4.55.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))
|
version: 1.0.3(vite@8.0.0-beta.9(@types/node@24.10.9)(esbuild@0.27.2)(jiti@2.6.1)(less@4.5.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))(wxt@0.20.13(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(rollup@4.55.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))
|
||||||
nanoid:
|
nanoid:
|
||||||
specifier: ^5.1.6
|
specifier: ^5.1.6
|
||||||
version: 5.1.6
|
version: 5.1.6
|
||||||
@@ -23264,9 +23272,9 @@ snapshots:
|
|||||||
'@types/filesystem': 0.0.36
|
'@types/filesystem': 0.0.36
|
||||||
'@types/har-format': 1.2.16
|
'@types/har-format': 1.2.16
|
||||||
|
|
||||||
'@wxt-dev/module-vue@1.0.3(vite@7.3.1(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))(wxt@0.20.13(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(rollup@4.55.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))':
|
'@wxt-dev/module-vue@1.0.3(vite@8.0.0-beta.9(@types/node@24.10.9)(esbuild@0.27.2)(jiti@2.6.1)(less@4.5.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))(wxt@0.20.13(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(rollup@4.55.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vitejs/plugin-vue': 6.0.3(vite@7.3.1(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))
|
'@vitejs/plugin-vue': 6.0.3(vite@8.0.0-beta.9(@types/node@24.10.9)(esbuild@0.27.2)(jiti@2.6.1)(less@4.5.1)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2))(vue@3.5.26(typescript@5.9.3))
|
||||||
wxt: 0.20.13(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(rollup@4.55.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)
|
wxt: 0.20.13(@types/node@24.10.9)(jiti@2.6.1)(less@4.5.1)(lightningcss@1.30.2)(rollup@4.55.2)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- vite
|
- vite
|
||||||
|
|||||||
Reference in New Issue
Block a user