惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
MyScale Blog
MyScale Blog
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
Recent Announcements
Recent Announcements
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat: scaffold provider plugins from init (#94352) · open...
plugins-authoring-command.test.ts · 2026-06-27 · via Recent Commits to openclaw:main

@@ -5,6 +5,7 @@ import path from "node:path";

55

import { Type } from "typebox";

66

import { beforeAll, describe, expect, it } from "vitest";

77

import { defineToolPlugin, getToolPluginMetadata } from "../plugin-sdk/tool-plugin.js";

8+

import { VERSION } from "../version.js";

89

import {

910

buildToolPluginManifest,

1011

buildToolPluginPackageManifest,

@@ -342,6 +343,7 @@ describe("plugin authoring commands", () => {

342343

scripts: {

343344

"plugin:build": "npm run build && openclaw plugins build --entry ./dist/index.js",

344345

"plugin:validate": "npm run build && openclaw plugins validate --entry ./dist/index.js",

346+

test: "vitest run --config ./vitest.config.ts",

345347

},

346348

openclaw: {

347349

extensions: ["./dist/index.js"],

@@ -362,5 +364,110 @@ describe("plugin authoring commands", () => {

362364

expect(fs.readFileSync(path.join(projectDir, "src/index.test.ts"), "utf8")).toContain(

363365

"getToolPluginMetadata",

364366

);

367+

expect(fs.readFileSync(path.join(projectDir, "vitest.config.ts"), "utf8")).toContain(

368+

'include: ["src/**/*.test.ts"]',

369+

);

370+

});

371+372+

it("scaffolds a provider plugin project with ClawHub validation and release metadata", async () => {

373+

const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-provider-init-"));

374+

const projectDir = path.join(tmpDir, "plugin-init-test");

375+376+

await runPluginsInitCommand("plugin-init-test", {

377+

directory: projectDir,

378+

name: "Plugin Init Test",

379+

type: "provider",

380+

});

381+382+

const packageManifest = JSON.parse(

383+

fs.readFileSync(path.join(projectDir, "package.json"), "utf8"),

384+

);

385+

expect(packageManifest).toMatchObject({

386+

name: "openclaw-plugin-plugin-init-test",

387+

scripts: {

388+

build: "tsc -p tsconfig.json",

389+

test: "vitest run --config ./vitest.config.ts",

390+

validate: "npm run build && clawhub package validate . --out .clawhub-validation",

391+

},

392+

peerDependencies: {

393+

openclaw: `>=${VERSION}`,

394+

},

395+

devDependencies: {

396+

clawhub: "latest",

397+

openclaw: "latest",

398+

typescript: "^5.9.0",

399+

vitest: "^3.2.0",

400+

},

401+

openclaw: {

402+

extensions: ["./dist/index.js"],

403+

install: {

404+

clawhubSpec: "clawhub:openclaw-plugin-plugin-init-test",

405+

defaultChoice: "clawhub",

406+

minHostVersion: `>=${VERSION}`,

407+

},

408+

compat: {

409+

pluginApi: `>=${VERSION}`,

410+

},

411+

build: {

412+

openclawVersion: VERSION,

413+

},

414+

release: {

415+

publishToClawHub: true,

416+

},

417+

},

418+

});

419+

expect(packageManifest.scripts).not.toHaveProperty("plugin:build");

420+

expect(packageManifest.scripts).not.toHaveProperty("plugin:validate");

421+422+

const manifest = JSON.parse(

423+

fs.readFileSync(path.join(projectDir, "openclaw.plugin.json"), "utf8"),

424+

);

425+

expect(manifest).toMatchObject({

426+

id: "plugin-init-test",

427+

name: "Plugin Init Test",

428+

version: "0.1.0",

429+

providers: ["plugin-init-test"],

430+

setup: {

431+

providers: [

432+

{

433+

id: "plugin-init-test",

434+

envVars: ["PLUGIN_INIT_TEST_API_KEY"],

435+

},

436+

],

437+

},

438+

configSchema: {

439+

type: "object",

440+

additionalProperties: false,

441+

properties: {},

442+

},

443+

});

444+445+

const indexSource = fs.readFileSync(path.join(projectDir, "src/index.ts"), "utf8");

446+

expect(indexSource).toContain("definePluginEntry");

447+

expect(indexSource).toContain("api.registerProvider");

448+

expect(indexSource).toContain("buildSingleProviderApiKeyCatalog");

449+450+

expect(fs.readFileSync(path.join(projectDir, "src/index.test.ts"), "utf8")).toContain(

451+

"OpenClawPluginApi",

452+

);

453+

expect(fs.readFileSync(path.join(projectDir, "vitest.config.ts"), "utf8")).toContain(

454+

'include: ["src/**/*.test.ts"]',

455+

);

456+

const readme = fs.readFileSync(path.join(projectDir, "README.md"), "utf8");

457+

expect(readme).toContain("npm run validate");

458+

expect(readme).toContain("npm exec clawhub -- login");

459+

expect(readme).toContain("npm exec clawhub -- package publish .");

460+

expect(readme).toContain("npm exec clawhub -- package trusted-publisher set");

461+462+

const workflow = fs.readFileSync(

463+

path.join(projectDir, ".github/workflows/clawhub-publish.yml"),

464+

"utf8",

465+

);

466+

expect(workflow).not.toContain("release:");

467+

expect(workflow).not.toContain("secrets: inherit");

468+

expect(workflow).toContain("workflow_dispatch:");

469+

expect(workflow).toContain(

470+

"openclaw/clawhub/.github/workflows/package-publish.yml@9d49df109d4ad3dc8a6ecf05d26b39f46d294721",

471+

);

365472

});

366473

});