|
|
1 tuần trước cách đây | |
|---|---|---|
| .. | ||
| scripts | 1 tuần trước cách đây | |
| src | 1 tuần trước cách đây | |
| test | 1 tuần trước cách đây | |
| LICENSE | 1 tuần trước cách đây | |
| README.md | 1 tuần trước cách đây | |
| package.json | 1 tuần trước cách đây | |
| tsconfig.json | 1 tuần trước cách đây | |
| tsup.config.ts | 1 tuần trước cách đây | |
Type definitions for ZCode plugin extensions. The package has types only; it has no runtime code.
ZCode 插件扩展代码用的类型包。只有类型,没有运行时代码。
npm install --save-dev @zcode-dev/plugin-api
| Import | Types |
|---|---|
@zcode-dev/plugin-api |
ExtensionContext, Disposable, scopes, views, error codes |
@zcode-dev/plugin-api/manifest |
The manifest extension key, slots, grants |
@zcode-dev/plugin-api/sessions |
Session projection, session action inputs and results |
@zcode-dev/plugin-api/protocol-v4 |
Conversation rows, context composition, generation metrics |
import type { ExtensionContext } from "@zcode-dev/plugin-api";
export function activate(ctx: ExtensionContext): void {
ctx.commands.register("hello", () => ctx.log.info("hello"));
}
Use import type only. The package has no JavaScript.
The package version is the plugin API version of ZCode. Set extension.engines.zcode in the plugin manifest to the version you build against, for example "^1.4.0".
engines.zcode.插件清单的 extension.engines.zcode 写你构建时用的版本,例如 "^1.4.0"。ZCode 的插件 API 版本满足这个范围时才加载扩展。