@zerozhang-giza/kdl-agent 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # 更新记录
2
+
3
+ ## 未发布
4
+
5
+ - npm 按平台下载安装器、SHA256 与版本校验、同版本 Skill 安装向导;首个候选版本 `0.1.0-beta.1`。
6
+ - 个人 npm 包 `@zerozhang-giza/kdl-agent`,终端命令保持 `kdl-agent`;升级、回退及卸载保留 `.kdl`。
7
+ - GoReleaser 候选、来源绑定检查、公开安装/API/Skill 文档与安装器回归。
8
+ - npm 打包允许清单同时验证文件缺失和意外夹带,包含同版本更新记录。
9
+ - 向导回归覆盖下载预检、固定版本、Skill 部分失败、升级失败恢复和登录/查询输出隔离。
10
+ - 查询与授权命令、家目录凭证、隐藏输入验证登录、网关隔离、状态检查和退出。
11
+ - 独立源码构建、五平台候选归档及 Go 测试。
12
+
13
+ 公开源码与候选构建不代表正式业务上线或目标平台最低版本已验收。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kuaidaili
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # 快代理 CLI
2
+
3
+ 通过快代理 Agent Gateway 查询账户、订单、产品、消息与工单,并执行已授权的购买、工单创建、订单密钥读取及代理便利操作。
4
+
5
+ 源码与问题反馈:https://github.com/gizaZerozhang/kdl-agent-cli
6
+
7
+ 源码许可证见 [LICENSE](./LICENSE)。
8
+
9
+ ## npm 安装
10
+
11
+ 需要 Node.js 22.14+ 和用户可写的 npm 全局目录。首个预发行目标为 `0.1.0-beta.1`,仅在同版本 GitHub Release 与 npm 发布完成后可安装:
12
+
13
+ ```bash
14
+ npx @zerozhang-giza/kdl-agent@0.1.0-beta.1 install
15
+ ```
16
+
17
+ 向导安装 CLI 与同版本 Skill,然后引导本机隐藏输入凭证并验证首次只读查询。Agent 自动安装使用 `install --yes --agent codex --no-login`,由用户在本地终端完成登录。仅安装 CLI 可执行 `npm install -g @zerozhang-giza/kdl-agent@0.1.0-beta.1`。
18
+
19
+ npm 包按平台下载 GitHub Release 原生二进制并验证内置 SHA256。beta 的 macOS 程序未签名/公证;最低系统和真实业务仍待专项验收。安装、升级、回退与卸载见[安装指南](./docs/install.md),维护者见[发行操作](./docs/releasing.md)。
20
+
21
+ ## 从源码构建
22
+
23
+ 维护者需要 Go 1.23.6+、Git。构建原生二进制后,使用者无需安装 Go、Python 或 Node.js。
24
+
25
+ ```bash
26
+ go test ./...
27
+ go build -trimpath -o bin/kdl-agent .
28
+ ./bin/kdl-agent --help
29
+ ```
30
+
31
+ Windows 构建输出使用 `bin/kdl-agent.exe`。默认版本为开发版;带版本及来源信息的构建见下文。
32
+
33
+ ## 登录与首次查询
34
+
35
+ ```bash
36
+ kdl-agent auth login
37
+ kdl-agent auth status
38
+ kdl-agent account summary
39
+ kdl-agent order list --format json
40
+ ```
41
+
42
+ 登录在本地终端隐藏输入 Agent 凭证,向 `https://agent-gateway.kdlapi.com` 验证成功后保存;需要先在[快代理会员中心](https://www.kuaidaili.com/uc/agent/settings/)创建并授权凭证。服务可用性和账户权限以实际环境为准。
43
+
44
+ 普通配置位于用户家目录 `.kdl/config.toml`,明文凭证位于 `.kdl/credentials.toml`,按规范化网关地址关联。macOS/Linux 目录 `0700`、凭证文件 `0600`;Windows 设置当前用户访问权限。同用户运行的程序仍可读取文件,不提供磁盘加密或同用户隔离。订单 Secret 不持久化。
45
+
46
+ `auth status --format json` 的状态为 `unconfigured`、`valid`、`invalid`、`unreachable` 或 `error`;只有 `valid` 代表远端验证有效。`auth logout` 只清除当前网关的本地凭证,服务端撤销仍在会员中心执行。
47
+
48
+ ## 配置与自动化
49
+
50
+ | 配置 | 语义 |
51
+ | --- | --- |
52
+ | `--config`、`KDL_AGENT_CONFIG` | 普通配置路径,优先级为参数 > 环境变量 > 家目录默认;显式相对路径相对 CWD,不改变凭证文件位置 |
53
+ | `KDL_AGENT_GATEWAY_URL` | 当前运行的网关基址,覆盖文件;使用 HTTPS,仅本机回环测试允许 HTTP |
54
+ | `KDL_AGENT_TOKEN` | 当前运行的 Agent 凭证,覆盖本地对应网关的凭证,不自动保存 |
55
+ | `--print-paths` | 显示配置与凭证位置、来源后退出,不发送业务请求 |
56
+ | `--format json` | 供自动化处理的结果;错误和诊断输出到 stderr |
57
+ | `--color auto\|always\|never` | 终端颜色,`NO_COLOR` 优先 |
58
+
59
+ 自动化应通过受控运行环境注入凭证,并核对目标地址;需要明确保存时可通过 `auth login --token-stdin` 从受控标准输入读入。不把凭证放在命令参数、日志、工单或模型对话中。切换网关不会自动发送其他网关的本地凭证。
60
+
61
+ 旧版本的 CWD `kdl-agent.toml` 不自动发现;显式读取含 `token` 或 `[device]` 的旧格式会拒绝加载。移除旧 `--config`/`KDL_AGENT_CONFIG` 后重新登录并验证,再由用户清理旧文件和撤销旧凭证。
62
+
63
+ ## 命令
64
+
65
+ | 命令 | 用途 |
66
+ | --- | --- |
67
+ | `account funds/summary` | 账户查询 |
68
+ | `order list/show/stats/guide` | 订单、使用量及接入指南 |
69
+ | `product list/spec/quote/trial-eligibility` | 产品、规格、报价及试用资格 |
70
+ | `msg list/show` | 站内信 |
71
+ | `ticket preview/create` | 工单预览与创建 |
72
+ | `product buy` | 创建待付款订单,不自动付款 |
73
+ | `order secret get` | 显式读取并输出已授权订单密钥 |
74
+ | `proxy fetch`、`order whitelist` | 代理提取和白名单便利命令 |
75
+
76
+ 参数以各子命令 `--help` 为准。敏感授权仅 `product.purchase.create`、`support.ticket.create`、`order.secret.read` 三项,默认关闭。购买与工单的同一操作重试必须复用幂等键。撤销授权仅阻止后续读取,已获取的订单密钥须由用户在订单设置中主动轮换。
77
+
78
+ ## 构建发行包
79
+
80
+ 维护者安装 Python 3.10+ 后执行:
81
+
82
+ ```bash
83
+ python3 scripts/build.py --version 0.1.0-rc.1 --output dist/candidate
84
+ ```
85
+
86
+ 输出 macOS arm64/amd64、Linux arm64/amd64、Windows amd64 的归档包及 `SHA256SUMS`,包含 `BUILD.json` 与第三方许可。输出目录必须不存在;版本与 commit 注入可执行文件。可用 `--local` 只构建当前目标进行开发验证。
87
+
88
+ 编译目标不等于已支持的最低系统版本。最低系统目标为 macOS 12、Ubuntu 22.04、Windows 11,逐个平台实测后才能发布支持声明。当前公开源码及候选构建不表示生产业务或正式二进制发行已验收。
89
+
90
+ ## 维护与反馈
91
+
92
+ 提交前运行 `go test ./...` 和 `go vet ./...`。问题报告包含版本、系统、脱敏错误码与复现步骤;请勿包含 Agent 凭证、订单 Secret、客户数据或完整配置文件。第三方许可见 `THIRD_PARTY_NOTICES.txt`。
package/SHA256SUMS ADDED
@@ -0,0 +1,12 @@
1
+ bf6110f2fa1ac45f66c3d07833408114a7b464564c7ee7dde88f421bddee0054 BUILD.json
2
+ 25762eecaae5a0b7a316faf8c9ace8ee7b7a841916ae874683152a620dc21264 api-guide.md
3
+ 8b8529f293422dde91ac23cf388c171f557eb1ab806596cece6e97fe75ce1487 cli-guide.md
4
+ 9ce97e29116c224343a32b5402a588ed74e306d6b66fd525a3b6fa82c373724e install.md
5
+ 2245321a97bf8e504499bc97efc62cc9d55084cdbade0e3299a8e4224921be4a kdl-agent-skill.zip
6
+ 6134119e18c2150c37a5f67e38b30eadc41d700c07bb1cc531c320650dd7bdbd kdl-agent_0.1.0-beta.1_darwin_amd64.tar.gz
7
+ 444baaaebf7a4ef2a7d478603086ca35bd4a4d2e5029ef1d8254585eb7be95fd kdl-agent_0.1.0-beta.1_darwin_arm64.tar.gz
8
+ fcdffeaf5d9db4bdb16f4eb5bbdb457f3db851b2816d0d127276f5c0c650cbcc kdl-agent_0.1.0-beta.1_linux_amd64.tar.gz
9
+ 9456ade4ddad1c8e7af7c6d018541165b3a68682c1290619c4b6c33c72aefe8c kdl-agent_0.1.0-beta.1_linux_arm64.tar.gz
10
+ 561f597fe475891ede81b337a243345749d5465d2b32e7f737df7d575111d619 kdl-agent_0.1.0-beta.1_windows_amd64.zip
11
+ 95a9aae626b807cd97b95fb73ff0207c72a88c10c936fc73da5a25fa4af14d10 openapi.yaml
12
+ 6773ea828c0e4d021b6aaaf903a72e763fc4c034f68f35fcdd0cc3cf6ea1b035 release-notes.md