@inf-monkeys-tech/monkeys-cli 0.10.0 → 0.10.2
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/README.md +184 -191
- package/README.zh.md +285 -0
- package/dist/config/store.js +1 -1
- package/dist/config/store.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,292 +1,285 @@
|
|
|
1
|
-
#
|
|
1
|
+
# monkeys-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[中文版](README.zh.md) | [English](README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The official Monkeys command-line tool for humans, automation, and AI Agents. It works with both cloud and self-hosted deployments and covers subscriptions and identity, Workflow, Execution, Agent Work, Ontology/Data, System Config, file transfer, and dynamic OpenAPI access.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The CLI is the only execution layer. The official Chinese-language `monkeys` Skill bundled in the npm package guides Agents in command selection, context resolution, and safe recovery. The CLI does not embed a model, planner, natural-language interpreter, or Agent Runtime.
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
- API Key 与账户 Session 认证,支持环境变量、stdin、系统 Keyring、受保护的 POSIX Session 文件、私有 CA 和代理
|
|
11
|
-
- OpenAPI 动态发现、缓存、精确 Operation 描述与原始 API 调用
|
|
12
|
-
- Workflow 完整 CRUD、严格单包导入与运行、Execution 查询/等待/状态流、文件流式上传下载
|
|
13
|
-
- Kernel Agent Work 查询、创建、编辑、分配、对话、Spec 审批、运行控制、验收与状态观察
|
|
14
|
-
- Data 的 Ontology、View、Asset、媒体、Field、Feature Value、Tag/Tag Group 查询与受控写入
|
|
15
|
-
- Kernel Bucket 初步治理,以及 Container Move/Copy/Remove/Trash Restore 可恢复生命周期
|
|
16
|
-
- Kernel System Config 总览、Key 发现/读取、当前配置校验、审计历史、脱敏导出与受控窄更新
|
|
17
|
-
- JSON/NDJSON 稳定输出、固定退出码、Secret 脱敏和语义到 API 的受控降级
|
|
9
|
+
[Install](#installation--quick-start) · [AI Agent Skill](#ai-agent-skill) · [Authentication](#authentication) · [Commands](#command-system) · [Advanced](#advanced-usage) · [Security](#security--risk-warning-read-before-use) · [Development](#development--release)
|
|
18
10
|
|
|
19
|
-
##
|
|
11
|
+
## Why monkeys-cli?
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
- **Agent-Native** — The CLI and official Skill ship in the same package and install with one command
|
|
14
|
+
- **Multi-Subscription** — Connect one local CLI to multiple cloud or self-hosted endpoints and switch Profiles quickly
|
|
15
|
+
- **Semantic First** — Workflow, Execution, Agent Work, Data, and Config have explicit domain commands
|
|
16
|
+
- **Open Coverage** — Discover the OpenAPI contract actually published by a deployment and make controlled raw API calls
|
|
17
|
+
- **Automation Friendly** — Stable JSON/NDJSON output, fixed exit codes, request IDs, and context summaries
|
|
18
|
+
- **Secure and Controllable** — Browser login never accepts account passwords, API Keys stay out of arguments, and high-risk writes require explicit confirmation
|
|
19
|
+
- **Recoverable** — Preflight checks, atomic configuration updates, local snapshots, and no-replay rules for unknown mutation outcomes
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
## Features
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
| Category | Capabilities |
|
|
24
|
+
| ----------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| 🔗 Deployment & Profile | Manage multiple endpoints, Tenants, Teams, and Profiles across cloud and self-hosted deployments |
|
|
26
|
+
| 🔐 Authentication | Browser Device Code login, API Key login, status checks, identity lookup, and secure-storage diagnostics |
|
|
27
|
+
| 🔁 Workflow & Execution | Workflow CRUD, import, run, and Execution query, wait, and status streaming |
|
|
28
|
+
| 🤖 Agent Work | Create, query, assign, converse, approve Specs, control runs, review, and watch state |
|
|
29
|
+
| 🧠 Ontology & Data | Ontology, View, Asset, Field, Feature Value, Tag, Container, and data migration operations |
|
|
30
|
+
| ⚙️ System Config | Overview, discovery, read, validation, history, redacted export, and controlled updates |
|
|
31
|
+
| 📁 Files & Media | Streaming transfer for files, Asset media, and View attachments |
|
|
32
|
+
| 🧩 OpenAPI | Dynamic discovery, caching, Operation descriptions, and evidence-constrained raw API calls |
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
`npm install --global @inf-monkeys-tech/monkeys-cli`。
|
|
34
|
+
## Installation & Quick Start
|
|
32
35
|
|
|
33
|
-
###
|
|
36
|
+
### Requirements
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
- Node.js 22 or later
|
|
39
|
+
- npm / npx
|
|
40
|
+
|
|
41
|
+
### Quick Start (Human Users)
|
|
42
|
+
|
|
43
|
+
#### Step 1 — Install the CLI and Skill
|
|
36
44
|
|
|
37
45
|
```bash
|
|
38
|
-
monkeys
|
|
46
|
+
npx @inf-monkeys-tech/monkeys-cli@latest install
|
|
39
47
|
```
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
The installer globally installs the `monkeys` CLI and installs the matching official `monkeys` Skill from the same npm artifact.
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
先查看真实参数,不要凭记忆构造命令:
|
|
51
|
+
To install only the CLI:
|
|
46
52
|
|
|
47
53
|
```bash
|
|
48
|
-
|
|
54
|
+
npm install --global @inf-monkeys-tech/monkeys-cli
|
|
49
55
|
```
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
#### Step 2 — Sign in to a subscription
|
|
58
|
+
|
|
59
|
+
The subscription URL is the endpoint associated with the Profile. After browser login, the CLI reads the authenticated Tenant's `tenantId`, uses it as the Profile name, and makes that Profile current.
|
|
52
60
|
|
|
53
61
|
```bash
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
monkeys auth login --url https://customer.example.com
|
|
63
|
+
```
|
|
56
64
|
|
|
57
|
-
|
|
58
|
-
monkeys auth login --url https://customer.example.com --api-key-stdin --output json
|
|
65
|
+
The CLI prints and opens the login URL for that endpoint. Account credentials are entered only in the browser and never pass through the CLI.
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
monkeys workflow run workflow-id \
|
|
62
|
-
--profile customer-a \
|
|
63
|
-
--team team-id \
|
|
64
|
-
--input-json '{"prompt":"hello"}' \
|
|
65
|
-
--output json
|
|
67
|
+
#### Step 3 — Verify and start using the CLI
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
--output json
|
|
69
|
+
```bash
|
|
70
|
+
monkeys auth status --output json
|
|
71
|
+
monkeys profile list --output json
|
|
72
|
+
monkeys workflow list --team <team-id> --output json
|
|
72
73
|
```
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
Run `monkeys <command> --help` for the authoritative parameters supported by the installed version.
|
|
75
76
|
|
|
76
|
-
###
|
|
77
|
+
### Quick Start (AI Agents)
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
> These steps are for an AI Agent helping a user install and authenticate the CLI. The user must complete browser authorization.
|
|
80
|
+
|
|
81
|
+
#### Step 1 — Install
|
|
79
82
|
|
|
80
83
|
```bash
|
|
81
|
-
|
|
82
|
-
monkeys
|
|
83
|
-
monkeys workflow update workflow-id --file workflow.json --profile customer-a --team team-id --dry-run --output json
|
|
84
|
-
monkeys workflow delete workflow-id --profile customer-a --team team-id --dry-run --output json
|
|
84
|
+
npx @inf-monkeys-tech/monkeys-cli@latest install
|
|
85
|
+
monkeys version check --output json
|
|
85
86
|
```
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
### Agent Work
|
|
90
|
-
|
|
91
|
-
Agent Work 对应 Kernel Agent Console。它只接受声明 Kernel Surface 的 Profile,固定为 Kernel 全局视角,不接受也不继承 Team。
|
|
88
|
+
#### Step 2 — Create a browser authorization request
|
|
92
89
|
|
|
93
90
|
```bash
|
|
94
|
-
monkeys
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
monkeys auth login \
|
|
92
|
+
--url https://customer.example.com \
|
|
93
|
+
--no-wait \
|
|
94
|
+
--output json
|
|
97
95
|
```
|
|
98
96
|
|
|
99
|
-
|
|
97
|
+
Send the returned authorization URL to the user. After the user finishes browser login, resume polling with the temporary Profile and Device Code returned by the same response:
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
```bash
|
|
100
|
+
monkeys auth login \
|
|
101
|
+
--profile <temporary-profile> \
|
|
102
|
+
--device-code <device-code> \
|
|
103
|
+
--output json
|
|
104
|
+
```
|
|
102
105
|
|
|
103
|
-
|
|
106
|
+
#### Step 3 — Verify the context
|
|
104
107
|
|
|
105
108
|
```bash
|
|
106
|
-
monkeys
|
|
107
|
-
monkeys
|
|
108
|
-
|
|
109
|
+
monkeys auth status --output json
|
|
110
|
+
monkeys profile list --output json
|
|
111
|
+
```
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
monkeys config set server.workflowPostReview.enabled=true \
|
|
112
|
-
--profile customer-kernel \
|
|
113
|
-
--dry-run \
|
|
114
|
-
--output json
|
|
113
|
+
For API Key authentication, never put the Key in command arguments or shell history:
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
--
|
|
115
|
+
```bash
|
|
116
|
+
monkeys auth login \
|
|
117
|
+
--url https://customer.example.com \
|
|
118
|
+
--api-key-stdin \
|
|
119
119
|
--output json
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### 浏览器登录
|
|
122
|
+
## AI Agent Skill
|
|
125
123
|
|
|
126
|
-
|
|
124
|
+
| Skill | Description |
|
|
125
|
+
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
126
|
+
| [`monkeys`](skills/monkeys/SKILL.md) | Multi-subscription context, authentication, Workflow, Execution, Agent Work, Data, System Config, OpenAPI, safety confirmation, and failure recovery |
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
The installer always installs the Skill from the current npm package to prevent CLI/Skill version drift. Check compatibility at any time:
|
|
129
129
|
|
|
130
130
|
```bash
|
|
131
|
-
monkeys
|
|
132
|
-
monkeys auth status --profile <tenantId> --output json
|
|
131
|
+
monkeys version check --output json
|
|
133
132
|
```
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
Agents should read the Skill before invoking the CLI. The source of truth for parameters is always `monkeys <command> --help`, never remembered syntax.
|
|
135
|
+
|
|
136
|
+
## Authentication
|
|
137
|
+
|
|
138
|
+
| Command | Description |
|
|
139
|
+
| --------------------- | ---------------------------------------------------------------------------------------------- |
|
|
140
|
+
| `auth login` | Start browser login for an endpoint URL or import an API Key from secure input |
|
|
141
|
+
| `auth status` | Validate the current Credential and return identity, Team, Surface, and permission information |
|
|
142
|
+
| `auth whoami` | Query the current server-side identity |
|
|
143
|
+
| `auth logout` | Remove the Credential stored for a Profile |
|
|
144
|
+
| `auth doctor` | Check secure read/write behavior for the current browser Session Store |
|
|
145
|
+
| `auth api-key import` | Import an API Key from stdin or a named environment variable |
|
|
146
|
+
|
|
147
|
+
### Browser Login
|
|
136
148
|
|
|
137
149
|
```bash
|
|
138
|
-
monkeys auth login --url https://customer.example.com --
|
|
139
|
-
monkeys auth login --profile <上一步返回的临时Profile> --device-code <device_code> --output json
|
|
150
|
+
monkeys auth login --url https://customer.example.com --output json
|
|
140
151
|
```
|
|
141
152
|
|
|
142
|
-
API Key
|
|
153
|
+
### API Key Login
|
|
143
154
|
|
|
144
155
|
```bash
|
|
145
156
|
monkeys auth login --url https://customer.example.com --api-key-stdin --output json
|
|
146
157
|
monkeys auth login --url https://customer.example.com --api-key-env MONKEYS_API_KEY --output json
|
|
147
158
|
```
|
|
148
159
|
|
|
149
|
-
|
|
160
|
+
### Switch Subscriptions
|
|
150
161
|
|
|
151
|
-
|
|
162
|
+
```bash
|
|
163
|
+
monkeys profile list --output json
|
|
164
|
+
monkeys profile use --name <profile-name> --output json
|
|
165
|
+
monkeys profile test --name <profile-name> --output json
|
|
166
|
+
```
|
|
152
167
|
|
|
153
|
-
|
|
168
|
+
## Command System
|
|
154
169
|
|
|
155
|
-
|
|
170
|
+
monkeys-cli provides three levels of access, from stable domain operations to the low-level API actually published by a deployment.
|
|
156
171
|
|
|
157
|
-
|
|
158
|
-
- `safeDetails.fallbackEvidence`
|
|
159
|
-
- `safeDetails.semanticAttemptId`
|
|
172
|
+
### 1. Semantic Commands
|
|
160
173
|
|
|
161
|
-
|
|
174
|
+
Use these first. They provide context validation, risk classification, and stable output for humans and Agents.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
monkeys workflow list --profile customer-a --team <team-id> --output json
|
|
178
|
+
monkeys workflow run <workflow-id> --profile customer-a --team <team-id> --input-json '{"prompt":"hello"}' --output json
|
|
179
|
+
monkeys execution wait <execution-id> --profile customer-a --team <team-id> --timeout-seconds 600 --output json
|
|
180
|
+
monkeys agent work list --profile customer-kernel --output json
|
|
181
|
+
monkeys data asset list --profile customer-kernel --perspective kernel --ontology <ontology-id> --output json
|
|
182
|
+
monkeys config overview --profile customer-kernel --output json
|
|
183
|
+
```
|
|
162
184
|
|
|
163
|
-
|
|
185
|
+
### 2. OpenAPI Discovery
|
|
164
186
|
|
|
165
|
-
|
|
166
|
-
- Kernel 全局读取默认不传 `--team`;只有明确筛选某 Team 时才传。Field、View、Feature Value、Advanced Asset Search 和 Asset Export 等需要下游数据资源 Team 的读取使用独立 `--resource-team`,仍保持 Kernel `teamMode=none`。CLI 不会用 Ontology owner Team 猜测资源 Team。Studio 使用明确的 Team 工作空间上下文。
|
|
167
|
-
- Ontology Create/Update 只接受 Kernel Profile 和显式目标/归属 Team;资源定位 Team 与用户 Team 筛选是不同合同,不得把 `resourceLocator.teamId` 描述成 Kernel 查询作用域。
|
|
168
|
-
- 服务端原生批量 JSONL 导入使用 `data asset import-jsonl --file <file> --ontology <id> --team <id> --perspective kernel --profile <profile> --yes`。命令返回持久 `logId`,后续通过 `data asset import-jsonl status <logId>` 查询进度;导入任务不可自动重放。可迁移数据包仍使用 `data asset import`,Ontology 结构迁移仍使用 `data ontology import`。
|
|
169
|
-
- 外部生成清单要补充已有 Asset Feature 时使用 `data asset feature-backfill`(资产特征回填):必须提供来源 ID 到目标 `assetId` 的映射文件,并先运行 `--dry-run`。该命令固定关闭 Asset/Tag 创建,只写指定图片列和文本列;`--priority-file` 会先通过同一映射解析最终目标 Asset,因此不同来源别名不能绕过高质量结果保护;未知优先来源、非法选中行或重复未保护目标都会在上传前失败。`--select-key/--select-value` 可做精确样本验收。`data asset enrich-jsonl` 仅作为已弃用兼容入口,JSON 结果会给出替代命令。
|
|
170
|
-
- Data JSON 输出通过 `teamMode=none|filter|context` 与可选的 `effectiveTeamId` 说明 CLI 实际施加的 Team 语义;可选 `resourceLocator` 只说明后端资源分区定位,不改变 Team 模式。
|
|
171
|
-
- `data container remove` 只移除 Membership 并进入 Trash,不删除 Asset。
|
|
172
|
-
- View 行数据使用 `data view rows --ontology <id> --view <id>` 批量读取。结果包含有序 `columns` 与 `rows`,按 View 配置补齐 Feature Value;现有 `data asset list` 继续保持紧凑投影。
|
|
173
|
-
- Ontology 全局标量 Feature 的临时结构化筛选使用 `data asset search --expression-json <JSON>` 或 `--expression-file <path>`。先通过 `data field list` 读取目标列的 `config.fieldKey` 和类型;表达式使用 `fieldKey`,不能使用展示名、Field ID 或 ES 路径。该能力是精确结构化过滤,不是语义、模糊或全文搜索。
|
|
174
|
-
- 普通 Filter View 保存筛选条件;`data view convert-to-container` 会按当前筛选快照生成 Container View。转换是高风险后台任务,需精确 View ID 与显式确认。
|
|
175
|
-
- Asset 媒体使用 `data asset media download <asset-id> --ontology <id> --out <path>` 下载。CLI 对公开 HTTPS 对象使用匿名安全下载;对象返回 401/403/404 时再向 Server 请求短期签名 URL。CLI 不自行签名、不输出对象 URL,也不会把 Monkeys 身份头发送给对象存储。
|
|
176
|
-
- View Feature 中的 PDF/文件使用 `data asset attachment download <asset-id> --ontology <id> --view <id> --field <id-or-exact-name> --out <path>` 下载。Field Value 读取携带 View Scope,签名仍由 Server 完成。
|
|
177
|
-
- V1 不提供 Bucket Delete、Container Purge、批量 Trash 或 Field Delete。
|
|
178
|
-
- Feature Value 批量写最多 100 项;部分成功返回退出码 9 和逐项结果。
|
|
187
|
+
List and describe real Operations from the fresh OpenAPI contract published by the current deployment.
|
|
179
188
|
|
|
180
189
|
```bash
|
|
181
|
-
|
|
182
|
-
monkeys
|
|
183
|
-
--file generated.jsonl \
|
|
184
|
-
--asset-map-file asset-map.jsonl \
|
|
185
|
-
--priority-file priority.jsonl \
|
|
186
|
-
--source-id-key file_token \
|
|
187
|
-
--priority-source-id-key file_token \
|
|
188
|
-
--image-key url \
|
|
189
|
-
--text-key source_name \
|
|
190
|
-
--image-field "AI 生成线稿图" \
|
|
191
|
-
--text-field "AI 线稿标签" \
|
|
192
|
-
--ontology <ontology-id> \
|
|
193
|
-
--team <team-id> \
|
|
194
|
-
--perspective kernel \
|
|
195
|
-
--profile <kernel-profile> \
|
|
196
|
-
--dry-run \
|
|
197
|
-
--output json
|
|
190
|
+
monkeys api list --profile customer-a --output json
|
|
191
|
+
monkeys api describe --operation-id <operation-id> --profile customer-a --output json
|
|
198
192
|
```
|
|
199
193
|
|
|
200
|
-
###
|
|
194
|
+
### 3. Controlled Raw API
|
|
201
195
|
|
|
202
|
-
|
|
196
|
+
Use raw API calls only when there is no suitable semantic command. Writes require explicit confirmation. When a semantic command returns controlled fallback evidence, consume it only in the same Profile, Tenant, Team, and Credential Context.
|
|
203
197
|
|
|
204
198
|
```bash
|
|
205
|
-
monkeys
|
|
206
|
-
--
|
|
207
|
-
--
|
|
208
|
-
--
|
|
209
|
-
--resource-team <data-team> \
|
|
210
|
-
--output json
|
|
211
|
-
|
|
212
|
-
monkeys data asset search \
|
|
213
|
-
--profile <profile> \
|
|
214
|
-
--perspective kernel \
|
|
215
|
-
--ontology <ontology-id> \
|
|
216
|
-
--resource-team <data-team> \
|
|
217
|
-
--expression-json '{"op":"and","filters":[{"op":"feature","fieldKey":"status","cmp":"eq","value":"ready"},{"op":"feature","fieldKey":"score","cmp":"gte","value":80}]}' \
|
|
218
|
-
--limit 20 \
|
|
199
|
+
monkeys api call \
|
|
200
|
+
--operation-id <operation-id> \
|
|
201
|
+
--profile customer-a \
|
|
202
|
+
--query-json '{}' \
|
|
219
203
|
--output json
|
|
220
204
|
```
|
|
221
205
|
|
|
222
|
-
|
|
206
|
+
## Advanced Usage
|
|
223
207
|
|
|
224
|
-
###
|
|
208
|
+
### Structured Output
|
|
225
209
|
|
|
226
|
-
-
|
|
227
|
-
- Ontology 的所有权/定位 Team 使用 `--team`;View、Field、Tag 等数据资源 Team 可通过 `--resource-team` 单独指定,未传时兼容回退为 `--team`。
|
|
228
|
-
- `data asset export/import` 交换业务数据。未传 `--format` 时固定使用 JSONL;CSV/XLSX 必须显式传 `--format csv|xlsx`,CLI 不根据扩展名静默切换。Ontology 全局导出默认保留完整 View Membership,并从各 View 合并可读的 Feature Value。
|
|
229
|
-
- 导出默认拒绝覆盖;覆盖已有文件必须同时传 `--overwrite --yes`。导入先对不可变输入快照做全量预检;真实写入必须传 `--yes`,建议先运行 `--dry-run`。
|
|
230
|
-
- 原生 CSV/XLSX 使用 `json:<JSON>` 类型化 Cell 保存字符串、数字、布尔值和复杂值,避免往返时改变类型;第三方表格通过 `--mapping-file` 显式把来源列映射到 `asset.<字段>`、`values.<Field ID>`、`sourceId`、`tagSourceIds` 或 `viewSourceIds`。
|
|
231
|
-
- CSV/XLSX 首版最多 50,000 行、500 列;XLSX 输入最大 100 MiB,解压后最大 128 MiB,Shared Strings 最大 64 MiB。更大数据集使用默认 JSONL。XLSX 流式读取 `data` 工作表且拒绝公式。
|
|
232
|
-
- Asset 导入首版是 append/create。来源 Asset ID 只进入映射报告,目标 ID 由 Server 生成;Field、Tag 或 View 来源引用必须通过同一 Context 的真实 Ontology 导入报告完成 `sourceId -> targetId` 映射,不能直接沿用来源 ID。映射报告最大 32 MiB。部分失败返回退出码 9,必须查看报告,禁止整文件自动重放。
|
|
210
|
+
Automation and Agents should use `--output json`; long-running status watches use NDJSON. Successful results go to stdout with exit code `0`. Errors go to stderr with a fixed non-zero exit code.
|
|
233
211
|
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"ok": true,
|
|
215
|
+
"data": {},
|
|
216
|
+
"meta": {
|
|
217
|
+
"command": "workflow list",
|
|
218
|
+
"schemaVersion": "1",
|
|
219
|
+
"timestamp": "..."
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Dry Run and Explicit Confirmation
|
|
237
225
|
|
|
238
|
-
|
|
239
|
-
monkeys data asset export --profile <profile> --perspective kernel --ontology <id> --resource-team <data-team> --format xlsx --out assets.xlsx --output json
|
|
226
|
+
For mutating commands that support `--dry-run`, run the preflight first. After it passes, real high-risk writes still require an explicit `--yes`.
|
|
240
227
|
|
|
241
|
-
|
|
242
|
-
monkeys
|
|
243
|
-
|
|
228
|
+
```bash
|
|
229
|
+
monkeys workflow delete <workflow-id> \
|
|
230
|
+
--profile customer-a \
|
|
231
|
+
--team <team-id> \
|
|
232
|
+
--dry-run \
|
|
233
|
+
--output json
|
|
244
234
|
```
|
|
245
235
|
|
|
246
|
-
|
|
236
|
+
### Explicit Context
|
|
237
|
+
|
|
238
|
+
- `--profile` selects the subscription and Credential
|
|
239
|
+
- `--team` selects a Team context or an explicit Team filter
|
|
240
|
+
- `--perspective kernel|studio` asserts the Data perspective without expanding permissions
|
|
241
|
+
- `--resource-team` identifies the downstream data-resource partition when required
|
|
247
242
|
|
|
248
|
-
|
|
243
|
+
Never infer Profile, Team, Ontology, or other IDs from resource names. Resolve the real context with read-only commands first.
|
|
249
244
|
|
|
250
|
-
|
|
251
|
-
| -----: | ------------------------ |
|
|
252
|
-
| 0 | 成功 |
|
|
253
|
-
| 1 | 输入校验失败 |
|
|
254
|
-
| 2 | 配置失败 |
|
|
255
|
-
| 3 | 认证失败 |
|
|
256
|
-
| 4 | 授权失败 |
|
|
257
|
-
| 5 | 网络失败 |
|
|
258
|
-
| 6 | API 失败 |
|
|
259
|
-
| 7 | 缺少高风险确认 |
|
|
260
|
-
| 8 | CLI/API/Skill 兼容性失败 |
|
|
261
|
-
| 9 | 部分成功 |
|
|
262
|
-
| 10 | 内部错误 |
|
|
245
|
+
### Detailed Documentation
|
|
263
246
|
|
|
264
|
-
|
|
247
|
+
| Topic | Documentation |
|
|
248
|
+
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
249
|
+
| Platform and context | [platform-overview.md](skills/monkeys/references/platform-overview.md) |
|
|
250
|
+
| Authentication and subscriptions | [authentication.md](skills/monkeys/references/authentication.md) |
|
|
251
|
+
| Workflow, Execution, and files | [workflow-execution-files.md](skills/monkeys/references/workflow-execution-files.md) |
|
|
252
|
+
| Agent Work | [agent-work.md](skills/monkeys/references/agent-work.md) |
|
|
253
|
+
| Data reads and perspectives | [data-read.md](skills/monkeys/references/data-read.md) · [data-perspective.md](skills/monkeys/references/data-perspective.md) |
|
|
254
|
+
| Data writes and transfer | [data-write.md](skills/monkeys/references/data-write.md) · [data-transfer.md](skills/monkeys/references/data-transfer.md) |
|
|
255
|
+
| System Config | [system-config.md](skills/monkeys/references/system-config.md) |
|
|
256
|
+
| OpenAPI fallback and error recovery | [fallback.md](skills/monkeys/references/fallback.md) · [safety-errors.md](skills/monkeys/references/safety-errors.md) |
|
|
265
257
|
|
|
266
|
-
|
|
267
|
-
- API Key 只通过 stdin 或环境变量导入;系统 Keyring 和 Session 文件只保存 API Key 或服务端签发的 Session Token。
|
|
268
|
-
- HTTPS 为默认要求;HTTP 只允许本机地址。私有 CA 用于验证客户内部 CA 签发的服务端证书,不会关闭 TLS 校验。
|
|
269
|
-
- 自定义 Header 不能覆盖 Authorization、Tenant、Team、Host、Cookie 或代理认证 Header。
|
|
270
|
-
- 输出统一递归脱敏;任何测试 Secret 都不应出现在 stdout、stderr、缓存或配置中。
|
|
271
|
-
- 删除与治理操作要求精确目标和显式确认;`--yes` 不扩大用户授权范围。
|
|
258
|
+
## Security & Risk Warning (Read Before Use)
|
|
272
259
|
|
|
273
|
-
|
|
260
|
+
AI Agents can invoke monkeys-cli to read or modify Monkeys data available to the user. Model hallucination, prompt injection, incorrect context, and permission misuse may still cause disclosure or unintended operations. Grant only the permissions required for the task and verify exact targets before writes.
|
|
274
261
|
|
|
275
|
-
|
|
262
|
+
- The CLI never accepts account passwords; account login happens only in the subscription endpoint's browser page
|
|
263
|
+
- API Keys are accepted only through stdin or environment variables and must not be placed in arguments, repositories, logs, or plain configuration files
|
|
264
|
+
- HTTPS is required by default; HTTP is allowed only for local addresses, and private CA support never disables TLS verification
|
|
265
|
+
- Custom headers cannot override authentication, Tenant, Team, Host, Cookie, or proxy-authentication headers
|
|
266
|
+
- Deletes, governance operations, and other high-risk actions require exact targets and explicit confirmation; `--yes` never expands permissions
|
|
267
|
+
- Never automatically retry an unknown mutation outcome; inspect it first with the corresponding read-only `list`, `get`, `status`, or `history` command
|
|
268
|
+
- Output is recursively redacted, but callers must still avoid sharing business data and debug logs with unrelated third parties
|
|
269
|
+
|
|
270
|
+
## Development & Release
|
|
271
|
+
|
|
272
|
+
The repository uses Bun for dependency management and development scripts. Users continue to install the released CLI with npm or npx.
|
|
276
273
|
|
|
277
274
|
```bash
|
|
278
275
|
bun install --frozen-lockfile
|
|
279
276
|
bun run verify
|
|
280
|
-
|
|
281
|
-
# 为三个桌面平台生成携带 Node.js 的独立包
|
|
282
|
-
bun run pack:standalone
|
|
283
|
-
bun run checksums
|
|
284
277
|
```
|
|
285
278
|
|
|
286
|
-
`bun run verify`
|
|
279
|
+
`bun run verify` covers formatting, types, unit and contract tests, build, CLI/Skill compatibility, npm installation smoke tests, and performance gates.
|
|
287
280
|
|
|
288
|
-
|
|
281
|
+
Every default-branch push uses GitLab CI to calculate the smallest patch version and publish it to npm `latest`, then creates the matching `vX.Y.Z` Git tag and GitLab Release. Do not run `npm publish` locally.
|
|
289
282
|
|
|
290
|
-
|
|
283
|
+
## License
|
|
291
284
|
|
|
292
|
-
|
|
285
|
+
The package is currently marked `UNLICENSED`. Use, copying, and distribution require authorization from INFMONKEYS.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# monkeys-cli
|
|
2
|
+
|
|
3
|
+
[中文版](README.zh.md) | [English](README.md)
|
|
4
|
+
|
|
5
|
+
Monkeys 官方命令行工具,让人类、自动化脚本和 AI Agent 都能在终端中安全操作 Monkeys。它支持云端与私有化部署,覆盖订阅与身份、Workflow、Execution、Agent Work、Ontology/Data、System Config、文件传输和动态 OpenAPI。
|
|
6
|
+
|
|
7
|
+
CLI 是唯一执行层;随 npm 包分发的官方中文 `monkeys` Skill 负责指导 Agent 选择命令、补齐上下文并处理安全恢复,不内置模型、规划器或 Agent Runtime。
|
|
8
|
+
|
|
9
|
+
[安装](#安装与快速开始) · [AI Agent Skill](#ai-agent-skill) · [认证](#认证) · [命令体系](#命令体系) · [进阶用法](#进阶用法) · [安全](#安全与风险提示使用前必读) · [开发](#开发与发布)
|
|
10
|
+
|
|
11
|
+
## 为什么选择 monkeys-cli?
|
|
12
|
+
|
|
13
|
+
- **Agent 原生** — CLI 与官方 Skill 同包、同版本发布,一条命令完成安装
|
|
14
|
+
- **多订阅设计** — 一个本地 CLI 可连接多个云端或私有化 Endpoint,并快速切换 Profile
|
|
15
|
+
- **语义优先** — Workflow、Execution、Agent Work、Data 和 Config 都有明确的领域命令
|
|
16
|
+
- **开放覆盖** — 动态发现部署实际发布的 OpenAPI,并提供受控的原始 API 调用
|
|
17
|
+
- **自动化友好** — 稳定 JSON/NDJSON 输出、固定退出码、Request ID 和上下文摘要
|
|
18
|
+
- **安全可控** — 浏览器登录不接收账户密码,API Key 不进入命令参数,高风险写入要求显式确认
|
|
19
|
+
- **可恢复** — 写入前预检、配置原子更新、本地快照以及结果未知时的禁止重放策略
|
|
20
|
+
|
|
21
|
+
## 功能
|
|
22
|
+
|
|
23
|
+
| 类别 | 能力 |
|
|
24
|
+
| ------------------------ | ----------------------------------------------------------------------- |
|
|
25
|
+
| 🔗 Deployment 与 Profile | 管理多个 Endpoint、Tenant、Team 和 Profile,支持云端及私有化部署 |
|
|
26
|
+
| 🔐 认证 | 浏览器 Device Code 登录、API Key 登录、状态验证、身份查询和安全存储诊断 |
|
|
27
|
+
| 🔁 Workflow 与 Execution | Workflow CRUD、导入、运行,以及 Execution 查询、等待和状态流 |
|
|
28
|
+
| 🤖 Agent Work | 创建、查询、分配、对话、Spec 审批、运行控制、Review 与状态观察 |
|
|
29
|
+
| 🧠 Ontology 与 Data | Ontology、View、Asset、Field、Feature Value、Tag、Container 和数据迁移 |
|
|
30
|
+
| ⚙️ System Config | 配置总览、发现、读取、校验、历史、脱敏导出与受控更新 |
|
|
31
|
+
| 📁 文件与媒体 | 文件、Asset 媒体和 View Attachment 的流式上传下载 |
|
|
32
|
+
| 🧩 OpenAPI | 动态发现、缓存、Operation 描述与带证据约束的原始 API 调用 |
|
|
33
|
+
|
|
34
|
+
## 安装与快速开始
|
|
35
|
+
|
|
36
|
+
### 环境要求
|
|
37
|
+
|
|
38
|
+
- Node.js 22 或更高版本
|
|
39
|
+
- npm / npx
|
|
40
|
+
|
|
41
|
+
### 快速开始(人类用户)
|
|
42
|
+
|
|
43
|
+
#### 第 1 步 — 安装 CLI 与 Skill
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx @inf-monkeys-tech/monkeys-cli@latest install
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
安装向导会全局安装 `monkeys` CLI,并从同一个 npm 制品安装匹配版本的官方 `monkeys` Skill。
|
|
50
|
+
|
|
51
|
+
如果只需要 CLI:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install --global @inf-monkeys-tech/monkeys-cli
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### 第 2 步 — 登录订阅
|
|
58
|
+
|
|
59
|
+
订阅 URL 就是该 Profile 对应的 Endpoint。浏览器登录成功后,CLI 会读取当前租户的 `tenantId`,用它命名 Profile,并设为当前订阅。
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
monkeys auth login --url https://customer.example.com
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
CLI 会输出并打开该 Endpoint 的登录 URL。账户密码只在浏览器页面输入,不会经过 CLI。
|
|
66
|
+
|
|
67
|
+
#### 第 3 步 — 验证并开始使用
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
monkeys auth status --output json
|
|
71
|
+
monkeys profile list --output json
|
|
72
|
+
monkeys workflow list --team <team-id> --output json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
运行 `monkeys <命令> --help` 查看当前版本的真实参数。
|
|
76
|
+
|
|
77
|
+
### 快速开始(AI Agent)
|
|
78
|
+
|
|
79
|
+
> 以下步骤面向正在协助用户安装和登录的 AI Agent。浏览器授权必须由用户完成。
|
|
80
|
+
|
|
81
|
+
#### 第 1 步 — 安装
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx @inf-monkeys-tech/monkeys-cli@latest install
|
|
85
|
+
monkeys version check --output json
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### 第 2 步 — 创建浏览器授权
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
monkeys auth login \
|
|
92
|
+
--url https://customer.example.com \
|
|
93
|
+
--no-wait \
|
|
94
|
+
--output json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
把返回的授权 URL 交给用户。用户完成浏览器登录后,使用同一响应中的临时 Profile 和 Device Code 继续轮询:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
monkeys auth login \
|
|
101
|
+
--profile <temporary-profile> \
|
|
102
|
+
--device-code <device-code> \
|
|
103
|
+
--output json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### 第 3 步 — 验证上下文
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
monkeys auth status --output json
|
|
110
|
+
monkeys profile list --output json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
如果使用 API Key,不要把 Key 放进参数或 shell history:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
monkeys auth login \
|
|
117
|
+
--url https://customer.example.com \
|
|
118
|
+
--api-key-stdin \
|
|
119
|
+
--output json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## AI Agent Skill
|
|
123
|
+
|
|
124
|
+
| Skill | 说明 |
|
|
125
|
+
| ------------------------------------ | ----------------------------------------------------------------------------------------------------- |
|
|
126
|
+
| [`monkeys`](skills/monkeys/SKILL.md) | 多订阅上下文、认证、Workflow、Execution、Agent Work、Data、System Config、OpenAPI、安全确认与失败恢复 |
|
|
127
|
+
|
|
128
|
+
安装向导始终从当前 npm 包安装 Skill,避免 CLI 与 Skill 版本漂移。可随时验证兼容性:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
monkeys version check --output json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Agent 应优先读取 Skill,再执行 CLI;参数真相始终来自 `monkeys <命令> --help`,不能凭记忆构造。
|
|
135
|
+
|
|
136
|
+
## 认证
|
|
137
|
+
|
|
138
|
+
| 命令 | 说明 |
|
|
139
|
+
| --------------------- | ---------------------------------------------------------- |
|
|
140
|
+
| `auth login` | 使用 Endpoint URL 发起浏览器登录,或从安全输入导入 API Key |
|
|
141
|
+
| `auth status` | 验证当前 Credential,并返回身份、Team、Surface 和权限 |
|
|
142
|
+
| `auth whoami` | 查询当前服务端身份 |
|
|
143
|
+
| `auth logout` | 移除指定 Profile 保存的 Credential |
|
|
144
|
+
| `auth doctor` | 检查当前浏览器 Session Store 的安全读写能力 |
|
|
145
|
+
| `auth api-key import` | 从 stdin 或指定环境变量导入 API Key |
|
|
146
|
+
|
|
147
|
+
### 浏览器登录
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
monkeys auth login --url https://customer.example.com --output json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### API Key 登录
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
monkeys auth login --url https://customer.example.com --api-key-stdin --output json
|
|
157
|
+
monkeys auth login --url https://customer.example.com --api-key-env MONKEYS_API_KEY --output json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 多订阅切换
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
monkeys profile list --output json
|
|
164
|
+
monkeys profile use --name <profile-name> --output json
|
|
165
|
+
monkeys profile test --name <profile-name> --output json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## 命令体系
|
|
169
|
+
|
|
170
|
+
monkeys-cli 提供三种调用粒度,从稳定领域操作到部署实际发布的底层 API。
|
|
171
|
+
|
|
172
|
+
### 1. 语义命令
|
|
173
|
+
|
|
174
|
+
优先供人类和 Agent 使用,内置上下文校验、风险分类和稳定输出。
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
monkeys workflow list --profile customer-a --team <team-id> --output json
|
|
178
|
+
monkeys workflow run <workflow-id> --profile customer-a --team <team-id> --input-json '{"prompt":"hello"}' --output json
|
|
179
|
+
monkeys execution wait <execution-id> --profile customer-a --team <team-id> --timeout-seconds 600 --output json
|
|
180
|
+
monkeys agent work list --profile customer-kernel --output json
|
|
181
|
+
monkeys data asset list --profile customer-kernel --perspective kernel --ontology <ontology-id> --output json
|
|
182
|
+
monkeys config overview --profile customer-kernel --output json
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 2. OpenAPI 发现
|
|
186
|
+
|
|
187
|
+
从当前部署发布的新鲜 OpenAPI 合同中列出并描述真实 Operation。
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
monkeys api list --profile customer-a --output json
|
|
191
|
+
monkeys api describe --operation-id <operation-id> --profile customer-a --output json
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 3. 受控原始 API
|
|
195
|
+
|
|
196
|
+
只在没有合适语义命令时使用。写操作要求显式确认;语义命令返回受控降级证据时,必须在相同 Profile、Tenant、Team 和 Credential Context 中消费。
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
monkeys api call \
|
|
200
|
+
--operation-id <operation-id> \
|
|
201
|
+
--profile customer-a \
|
|
202
|
+
--query-json '{}' \
|
|
203
|
+
--output json
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## 进阶用法
|
|
207
|
+
|
|
208
|
+
### 结构化输出
|
|
209
|
+
|
|
210
|
+
自动化和 Agent 使用 `--output json`;长时间状态观察使用 NDJSON。成功结果写入 stdout 且退出码为 `0`,错误写入 stderr 并返回固定非零退出码。
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"ok": true,
|
|
215
|
+
"data": {},
|
|
216
|
+
"meta": {
|
|
217
|
+
"command": "workflow list",
|
|
218
|
+
"schemaVersion": "1",
|
|
219
|
+
"timestamp": "..."
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Dry Run 与显式确认
|
|
225
|
+
|
|
226
|
+
支持 `--dry-run` 的副作用命令应先执行预检;通过预检后,真实高风险写入必须显式添加 `--yes`。
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
monkeys workflow delete <workflow-id> \
|
|
230
|
+
--profile customer-a \
|
|
231
|
+
--team <team-id> \
|
|
232
|
+
--dry-run \
|
|
233
|
+
--output json
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### 明确上下文
|
|
237
|
+
|
|
238
|
+
- `--profile` 选择订阅和 Credential
|
|
239
|
+
- `--team` 选择 Team 上下文或显式筛选
|
|
240
|
+
- `--perspective kernel|studio` 断言 Data 视角,不扩大权限
|
|
241
|
+
- `--resource-team` 在需要时明确下游数据资源分区
|
|
242
|
+
|
|
243
|
+
不要根据资源名称猜测 Profile、Team、Ontology 或其他 ID;先用只读命令解析真实上下文。
|
|
244
|
+
|
|
245
|
+
### 深入文档
|
|
246
|
+
|
|
247
|
+
| 主题 | 文档 |
|
|
248
|
+
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
249
|
+
| 平台与上下文 | [platform-overview.md](skills/monkeys/references/platform-overview.md) |
|
|
250
|
+
| 认证与多订阅 | [authentication.md](skills/monkeys/references/authentication.md) |
|
|
251
|
+
| Workflow、Execution 与文件 | [workflow-execution-files.md](skills/monkeys/references/workflow-execution-files.md) |
|
|
252
|
+
| Agent Work | [agent-work.md](skills/monkeys/references/agent-work.md) |
|
|
253
|
+
| Data 读取与视角 | [data-read.md](skills/monkeys/references/data-read.md) · [data-perspective.md](skills/monkeys/references/data-perspective.md) |
|
|
254
|
+
| Data 写入与迁移 | [data-write.md](skills/monkeys/references/data-write.md) · [data-transfer.md](skills/monkeys/references/data-transfer.md) |
|
|
255
|
+
| System Config | [system-config.md](skills/monkeys/references/system-config.md) |
|
|
256
|
+
| OpenAPI 降级与错误恢复 | [fallback.md](skills/monkeys/references/fallback.md) · [safety-errors.md](skills/monkeys/references/safety-errors.md) |
|
|
257
|
+
|
|
258
|
+
## 安全与风险提示(使用前必读)
|
|
259
|
+
|
|
260
|
+
monkeys-cli 可以被 AI Agent 调用来读取或修改用户有权访问的 Monkeys 数据。模型幻觉、提示词注入、错误上下文和权限误用仍可能造成数据泄露或非预期操作;请只授予任务所需的最小权限,并在写入前核对精确目标。
|
|
261
|
+
|
|
262
|
+
- CLI 不接收账户密码;账户登录只在订阅 Endpoint 的浏览器页面完成
|
|
263
|
+
- API Key 只允许从 stdin 或环境变量读取,不得写入参数、仓库、日志或普通配置文件
|
|
264
|
+
- HTTPS 是默认要求;HTTP 只允许本机地址,私有 CA 不会关闭 TLS 校验
|
|
265
|
+
- 自定义 Header 不能覆盖认证、Tenant、Team、Host、Cookie 或代理认证 Header
|
|
266
|
+
- 删除、治理和其他高风险操作要求精确目标与显式确认,`--yes` 不扩大权限
|
|
267
|
+
- 写请求结果未知时禁止自动重试,先用对应的只读 `list/get/status/history` 命令核查
|
|
268
|
+
- 输出统一递归脱敏,但调用者仍应避免把业务数据和调试日志发送给无关第三方
|
|
269
|
+
|
|
270
|
+
## 开发与发布
|
|
271
|
+
|
|
272
|
+
仓库使用 Bun 管理依赖和执行脚本;用户安装仍使用 npm / npx。
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
bun install --frozen-lockfile
|
|
276
|
+
bun run verify
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`bun run verify` 包含格式、类型、单元与合同测试、构建、CLI/Skill 兼容检查、npm 安装冒烟和性能门禁。
|
|
280
|
+
|
|
281
|
+
默认分支 push 会通过 GitLab CI 自动计算最小 patch 版本并发布到 npm `latest`,随后创建同版本的 `vX.Y.Z` Git tag 和 GitLab Release。本地不得直接执行 `npm publish`。
|
|
282
|
+
|
|
283
|
+
## License
|
|
284
|
+
|
|
285
|
+
当前包标记为 `UNLICENSED`。使用、复制和分发须获得 INFMONKEYS 授权。
|
package/dist/config/store.js
CHANGED
|
@@ -8,7 +8,7 @@ import { configSchema, emptyConfig } from './schema.js';
|
|
|
8
8
|
import { resolveConfigPath } from './paths.js';
|
|
9
9
|
const DEFAULT_LOCK_RETRY_MS = 25;
|
|
10
10
|
const DEFAULT_LOCK_STALE_MS = 30_000;
|
|
11
|
-
const DEFAULT_LOCK_TIMEOUT_MS =
|
|
11
|
+
const DEFAULT_LOCK_TIMEOUT_MS = 10_000;
|
|
12
12
|
function isNodeError(error, code) {
|
|
13
13
|
return error instanceof Error && 'code' in error && error.code === code;
|
|
14
14
|
}
|
package/dist/config/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/config/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAY,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAA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": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "面向 AI Agent、自动化和人工操作的 Monkeys 命令行客户端",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"monkeys": "
|
|
8
|
+
"monkeys": "bin/run.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"monkeysReleaseCommit": "
|
|
89
|
+
"monkeysReleaseCommit": "f9e1db581e85e68b7d1ec0b7c78b9f0057279e5a"
|
|
90
90
|
}
|