From c2bdb2efb67c1060262117a07c6fca799200485b Mon Sep 17 00:00:00 2001 From: nav Date: Wed, 8 Apr 2026 19:33:32 +0000 Subject: [PATCH] feat: scaffold yonexus client plugin --- package.json | 27 +++++++++++++++++++++++++++ plugin/commands/.gitkeep | 0 plugin/core/.gitkeep | 0 plugin/hooks/.gitkeep | 0 plugin/index.ts | 28 ++++++++++++++++++++++++++++ plugin/openclaw.plugin.json | 13 +++++++++++++ plugin/tools/.gitkeep | 0 scripts/install.mjs | 37 +++++++++++++++++++++++++++++++++++++ servers/.gitkeep | 0 skills/.gitkeep | 0 tsconfig.json | 24 ++++++++++++++++++++++++ 11 files changed, 129 insertions(+) create mode 100644 package.json create mode 100644 plugin/commands/.gitkeep create mode 100644 plugin/core/.gitkeep create mode 100644 plugin/hooks/.gitkeep create mode 100644 plugin/tools/.gitkeep create mode 100644 servers/.gitkeep create mode 100644 skills/.gitkeep create mode 100644 tsconfig.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..1a0dd5a --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "yonexus-client", + "version": "0.1.0", + "private": true, + "description": "Yonexus.Client OpenClaw plugin scaffold", + "type": "module", + "main": "dist/plugin/index.js", + "files": [ + "dist", + "plugin", + "scripts", + "protocol", + "README.md", + "PLAN.md", + "SCAFFOLD.md", + "STRUCTURE.md", + "TASKS.md" + ], + "scripts": { + "build": "tsc -p tsconfig.json", + "clean": "rm -rf dist", + "check": "tsc -p tsconfig.json --noEmit" + }, + "devDependencies": { + "typescript": "^5.6.3" + } +} diff --git a/plugin/commands/.gitkeep b/plugin/commands/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugin/core/.gitkeep b/plugin/core/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugin/hooks/.gitkeep b/plugin/hooks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugin/index.ts b/plugin/index.ts index e69de29..8a095cd 100644 --- a/plugin/index.ts +++ b/plugin/index.ts @@ -0,0 +1,28 @@ +export interface YonexusClientPluginManifest { + readonly name: "Yonexus.Client"; + readonly version: string; + readonly description: string; +} + +export interface YonexusClientPluginRuntime { + readonly hooks: readonly []; + readonly commands: readonly []; + readonly tools: readonly []; +} + +const manifest: YonexusClientPluginManifest = { + name: "Yonexus.Client", + version: "0.1.0", + description: "Yonexus client plugin for cross-instance OpenClaw communication" +}; + +export function createYonexusClientPlugin(): YonexusClientPluginRuntime { + return { + hooks: [], + commands: [], + tools: [] + }; +} + +export default createYonexusClientPlugin; +export { manifest }; diff --git a/plugin/openclaw.plugin.json b/plugin/openclaw.plugin.json index e69de29..ada1f87 100644 --- a/plugin/openclaw.plugin.json +++ b/plugin/openclaw.plugin.json @@ -0,0 +1,13 @@ +{ + "name": "Yonexus.Client", + "version": "0.1.0", + "description": "Yonexus client plugin for cross-instance OpenClaw communication", + "entry": "dist/plugin/index.js", + "permissions": [], + "config": { + "mainHost": "", + "identifier": "", + "notifyBotToken": "", + "adminUserId": "" + } +} diff --git a/plugin/tools/.gitkeep b/plugin/tools/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/scripts/install.mjs b/scripts/install.mjs index e69de29..7fa47a5 100644 --- a/scripts/install.mjs +++ b/scripts/install.mjs @@ -0,0 +1,37 @@ +#!/usr/bin/env node + +import fs from "node:fs"; +import path from "node:path"; +import os from "node:os"; + +const args = process.argv.slice(2); +const mode = args.includes("--install") ? "install" : args.includes("--uninstall") ? "uninstall" : null; +const profileIndex = args.indexOf("--openclaw-profile-path"); +const profilePath = profileIndex >= 0 ? args[profileIndex + 1] : path.join(os.homedir(), ".openclaw"); + +if (!mode) { + console.error("Usage: node scripts/install.mjs --install|--uninstall [--openclaw-profile-path ]"); + process.exit(1); +} + +const repoRoot = path.resolve(import.meta.dirname, ".."); +const pluginName = "Yonexus.Client"; +const sourceDist = path.join(repoRoot, "dist"); +const targetDir = path.join(profilePath, "plugins", pluginName); + +if (mode === "install") { + if (!fs.existsSync(sourceDist)) { + console.error(`Build output not found: ${sourceDist}`); + process.exit(1); + } + + fs.mkdirSync(path.dirname(targetDir), { recursive: true }); + fs.rmSync(targetDir, { recursive: true, force: true }); + fs.cpSync(sourceDist, path.join(targetDir, "dist"), { recursive: true }); + fs.copyFileSync(path.join(repoRoot, "plugin", "openclaw.plugin.json"), path.join(targetDir, "openclaw.plugin.json")); + console.log(`Installed ${pluginName} to ${targetDir}`); + process.exit(0); +} + +fs.rmSync(targetDir, { recursive: true, force: true }); +console.log(`Removed ${pluginName} from ${targetDir}`); diff --git a/servers/.gitkeep b/servers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/skills/.gitkeep b/skills/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..cf17390 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "outDir": "dist", + "rootDir": ".", + "strict": true, + "skipLibCheck": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "declaration": true, + "sourceMap": true + }, + "include": [ + "plugin/**/*.ts", + "servers/**/*.ts" + ], + "exclude": [ + "dist", + "node_modules" + ] +}