From ab3088de8261a6d540f095f3761874a0b15ee343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=87=A1?= Date: Mon, 2 Feb 2026 16:02:08 +0800 Subject: [PATCH 1/3] refactor: update demoTool invoke method to use structured ToolArgs interface for better type safety --- src/templates/typescript/src/tools/demo.ts.eta | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/templates/typescript/src/tools/demo.ts.eta b/src/templates/typescript/src/tools/demo.ts.eta index 08dc8aa..6751ace 100644 --- a/src/templates/typescript/src/tools/demo.ts.eta +++ b/src/templates/typescript/src/tools/demo.ts.eta @@ -1,6 +1,11 @@ import type { ToolDefinition } from "@choiceopen/atomemo-plugin-sdk-js/types" import { t } from "../i18n/i18n-node" +interface ToolArgs { + parameters: { location: string } + credentials: Record +} + export const demoTool = { name: "demo-tool", display_name: t("DEMO_TOOL_DISPLAY_NAME"), @@ -21,9 +26,9 @@ export const demoTool = { }, }, ], - async invoke({ args }: { args: { location: string } }) { + async invoke({ args }: { args: ToolArgs }) { return { - message: `Testing the plugin with location: ${args.location}`, + message: `Testing the plugin with location: ${args.parameters.location}`, } }, } satisfies ToolDefinition From c0148eac299780a46d8e006a14bfa98fbdceaaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=87=A1?= Date: Mon, 2 Feb 2026 16:02:35 +0800 Subject: [PATCH 2/3] chore(release): v0.5.9 :tada: --- README.md | 16 ++++++++-------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0d314fc..e836f9c 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ EXAMPLES $ atomemo auth login ``` -_See code: [src/commands/auth/login.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/auth/login.ts)_ +_See code: [src/commands/auth/login.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/auth/login.ts)_ ## `atomemo auth status` @@ -120,7 +120,7 @@ EXAMPLES $ atomemo auth status ``` -_See code: [src/commands/auth/status.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/auth/status.ts)_ +_See code: [src/commands/auth/status.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/auth/status.ts)_ ## `atomemo autocomplete [SHELL]` @@ -195,7 +195,7 @@ EXAMPLES $ atomemo plugin checksum ``` -_See code: [src/commands/plugin/checksum.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/plugin/checksum.ts)_ +_See code: [src/commands/plugin/checksum.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/plugin/checksum.ts)_ ## `atomemo plugin init` @@ -225,7 +225,7 @@ EXAMPLES $ atomemo plugin init ``` -_See code: [src/commands/plugin/init.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/plugin/init.ts)_ +_See code: [src/commands/plugin/init.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/plugin/init.ts)_ ## `atomemo plugin pack [FILE]` @@ -249,7 +249,7 @@ EXAMPLES $ atomemo plugin pack ``` -_See code: [src/commands/plugin/pack.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/plugin/pack.ts)_ +_See code: [src/commands/plugin/pack.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/plugin/pack.ts)_ ## `atomemo plugin permission [FILE]` @@ -273,7 +273,7 @@ EXAMPLES $ atomemo plugin permission ``` -_See code: [src/commands/plugin/permission.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/plugin/permission.ts)_ +_See code: [src/commands/plugin/permission.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/plugin/permission.ts)_ ## `atomemo plugin refresh-key` @@ -290,7 +290,7 @@ EXAMPLES $ atomemo plugin refresh-key ``` -_See code: [src/commands/plugin/refresh-key.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/plugin/refresh-key.ts)_ +_See code: [src/commands/plugin/refresh-key.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/plugin/refresh-key.ts)_ ## `atomemo plugin run [FILE]` @@ -314,7 +314,7 @@ EXAMPLES $ atomemo plugin run ``` -_See code: [src/commands/plugin/run.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.8/src/commands/plugin/run.ts)_ +_See code: [src/commands/plugin/run.ts](https://github.com/choice-open/atomemo-plugin-cli/blob/v0.5.9/src/commands/plugin/run.ts)_ ## `atomemo version` diff --git a/package-lock.json b/package-lock.json index 3cfde74..4221b51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@choiceopen/atomemo-plugin-cli", - "version": "0.5.8", + "version": "0.5.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@choiceopen/atomemo-plugin-cli", - "version": "0.5.8", + "version": "0.5.9", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 71c0db7..436abef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@choiceopen/atomemo-plugin-cli", - "version": "0.5.8", + "version": "0.5.9", "description": "A command-line utility for building and publishing Choiceform Atomemo Plugin.", "keywords": [ "oclif" From ea70a6651155b1cd058383bac55c2ee6f2478356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E5=87=A1?= Date: Mon, 2 Feb 2026 16:03:34 +0800 Subject: [PATCH 3/3] docs: update CHANGELOG.md for v0.5.9 release, adding entry for demoTool invoke method refactor --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b97b30e..180e652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +## [0.5.9] - 2026-02-02 + +### Changed + +- 模板重构:`demoTool` 的 `invoke` 方法改为使用结构化的 `ToolArgs` 接口,提升类型安全性 + ## [0.5.8] - 2026-02-02 ### Added @@ -211,7 +217,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). - Code quality checks with Biome. - Automated release workflow via GitHub Actions. -[Unreleased]: https://github.com/choice-open/atomemo-plugin-cli/compare/v0.5.8...HEAD +[Unreleased]: https://github.com/choice-open/atomemo-plugin-cli/compare/v0.5.9...HEAD +[0.5.9]: https://github.com/choice-open/atomemo-plugin-cli/compare/v0.5.8...v0.5.9 [0.5.8]: https://github.com/choice-open/atomemo-plugin-cli/compare/v0.5.7...v0.5.8 [0.5.7]: https://github.com/choice-open/atomemo-plugin-cli/compare/v0.5.6...v0.5.7 [0.5.6]: https://github.com/choice-open/atomemo-plugin-cli/compare/v0.5.5...v0.5.6