mthds-pkg
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseManage MTHDS packages
管理MTHDS包
Initialize, configure exports, list, and validate MTHDS packages using the CLI.
mthds-agent使用 CLI初始化、配置导出、列出和校验MTHDS包。
mthds-agentProcess
流程
Step 0 — CLI Check (mandatory, do this FIRST)
步骤0 — CLI检查(必做,请最先执行)
Run . The minimum required version is 0.1.0 (declared in this skill's front matter as ).
mthds-agent --versionmin_mthds_version- If the command is not found: STOP. Do not proceed. Tell the user:
TheCLI is required but not installed. Install it with:mthds-agentnpm install -g mthdsThen re-run this skill.
- If the version is below 0.1.0: STOP. Do not proceed. Tell the user:
This skill requiresversion 0.1.0 or higher (found X.Y.Z). Upgrade with:mthds-agentnpm install -g mthds@latestThen re-run this skill.
- If the version is 0.1.0 or higher: proceed to the next step.
Do not write files manually, do not scan for existing methods, do not do any other work. The CLI is required for validation, formatting, and execution — without it the output will be broken.
.mthdsNo backend setup needed: This skill works without configuring inference backends or API keys. You can start building/validating methods right away. Backend configuration is only needed to run methods with live inference — usewhen you're ready./pipelex-setup
运行。最低要求版本为0.1.0(在本技能的前置元数据中声明为)。
mthds-agent --versionmin_mthds_version- 如果未找到该命令:停止操作,不要继续。告知用户:
需要使用CLI但尚未安装。请通过以下命令安装:mthds-agentnpm install -g mthds之后重新运行本技能。
- 如果版本低于0.1.0:停止操作,不要继续。告知用户:
本技能要求版本为0.1.0或更高(当前版本为X.Y.Z)。请通过以下命令升级:mthds-agentnpm install -g mthds@latest之后重新运行本技能。
- 如果版本为0.1.0或更高:继续下一步。
请勿手动编写文件,请勿扫描现有方法,请勿执行任何其他操作。校验、格式化和执行都需要用到该CLI,没有它输出内容将会出错。
.mthds无需后端配置:本技能无需配置推理后端或API密钥即可使用。你可以立即开始构建/校验方法。仅当你需要通过实时推理运行方法时才需要配置后端,准备就绪后使用即可。/pipelex-setup
1. Initialize a package
1. 初始化包
Create a manifest:
METHODS.tomlbash
mthds-agent package init --address <address> --version <version> --description <description> -C <pkg-dir>Required flags:
| Flag | Purpose | Example |
|---|---|---|
| Package address (hostname/path format) | |
| Package version (semver) | |
| Package description | |
Optional flags:
| Flag | Purpose | Example |
|---|---|---|
| Comma-separated list of authors | |
| License identifier | |
| Method name (2-25 lowercase chars) | |
| Human-readable display name (max 128 chars) | |
| Main pipe code (snake_case) | |
| Overwrite existing METHODS.toml | — |
创建清单:
METHODS.tomlbash
mthds-agent package init --address <address> --version <version> --description <description> -C <pkg-dir>必填参数:
| 标志 | 用途 | 示例 |
|---|---|---|
| 包地址(主机名/路径格式) | |
| 包版本(semver格式) | |
| 包描述 | |
可选参数:
| 标志 | 用途 | 示例 |
|---|---|---|
| 逗号分隔的作者列表 | |
| 许可证标识符 | |
| 方法名称(2-25个小写字符) | |
| 人类可读的展示名称(最长128字符) | |
| 主管道代码(snake_case格式) | |
| 覆盖已有的METHODS.toml | — |
2. Configure exports
2. 配置导出
Exports declare which pipes the package makes available to consumers. They are organized by domain in :
METHODS.tomltoml
[exports.restaurant_analysis]
pipes = ["present_restaurant", "extract_menu", "analyze_menu"]To configure exports:
- Read the bundle(s) in the package to find the domain codes and pipe codes defined inside them
.mthds - Edit to add an
METHODS.tomlsection for each domain, listing the pipe codes to export[exports.<domain>]
Rules:
- The of each bundle is auto-exported — you do not need to list it unless you want to be explicit
main_pipe - Concepts are always public and do not need to be listed in exports
- Each section requires a
[exports.<domain>]key with a list of pipe code stringspipes
导出声明了包可以向使用者提供哪些管道。它们在中按领域组织:
METHODS.tomltoml
[exports.restaurant_analysis]
pipes = ["present_restaurant", "extract_menu", "analyze_menu"]配置导出的步骤:
- 读取包内的包文件,找到其中定义的领域代码和管道代码
.mthds - 编辑,为每个领域添加
METHODS.toml分区,列出要导出的管道代码[exports.<domain>]
规则:
- 每个包的会自动导出——除非你想要显式声明,否则无需列出它
main_pipe - 概念始终是公开的,不需要在导出中列出
- 每个分区都需要有一个
[exports.<domain>]键,对应管道代码字符串列表pipes
3. List package manifest
3. 列出包清单
Display the current package manifest:
bash
mthds-agent package list -C <pkg-dir>展示当前的包清单:
bash
mthds-agent package list -C <pkg-dir>4. Validate package manifest
4. 校验包清单
Validate the package manifest:
METHODS.tomlbash
mthds-agent package validate -C <pkg-dir>Note:validates themthds-agent package validatepackage manifest. To validateMETHODS.tomlbundle semantics, use.mthds(see /mthds-check skill).mthds-agent pipelex validate pipe
校验包清单:
METHODS.tomlbash
mthds-agent package validate -C <pkg-dir>注意:仅校验mthds-agent package validate包清单。如果要校验METHODS.toml包的语义,请使用.mthds(参考/mthds-check技能)。mthds-agent pipelex validate pipe
The -C
option
-C-C
选项
-CAll commands accept (long: ) to target a package directory other than the shell's current working directory. This is essential when the agent's CWD differs from the package location.
mthds-agent package-C <path>--package-dirbash
undefined所有命令都支持(全写:)来指定 shell 当前工作目录之外的包目录。当Agent的当前工作目录和包位置不一致时这个选项非常重要。
mthds-agent package-C <path>--package-dirbash
undefinedFrom any directory, target a specific package
可以在任意目录下指定目标包
mthds-agent package init --address github.com/org/repo --version 1.0.0 --description "My package" -C mthds-wip/restaurant_presenter/
mthds-agent package validate -C mthds-wip/restaurant_presenter/
If `-C` is omitted, commands default to the current working directory.mthds-agent package init --address github.com/org/repo --version 1.0.0 --description "My package" -C mthds-wip/restaurant_presenter/
mthds-agent package validate -C mthds-wip/restaurant_presenter/
如果省略`-C`,命令默认使用当前工作目录。Common Workflows
常用工作流
Starting a new package:
- — create the manifest
mthds-agent package init --address <address> --version <version> --description <desc> -C <pkg-dir> - Read bundles in the package to extract domain codes and pipe codes
.mthds - Edit to set the correct
METHODS.tomlsections[exports.<domain>] - — validate the manifest
mthds-agent package validate -C <pkg-dir>
新建一个包:
- — 创建清单
mthds-agent package init --address <address> --version <version> --description <desc> -C <pkg-dir> - 读取包内的包文件,提取领域代码和管道代码
.mthds - 编辑,设置正确的
METHODS.toml分区[exports.<domain>] - — 校验清单
mthds-agent package validate -C <pkg-dir>
Reference
参考
- Error Handling — read when CLI returns an error to determine recovery
- MTHDS Agent Guide — read for CLI command syntax or output format details
- 错误处理 — CLI返回错误时阅读本文确定恢复方案
- MTHDS Agent指南 — 阅读本文了解CLI命令语法或输出格式详情