@lark-project/meegle 1.0.4 → 1.0.6

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 CHANGED
@@ -8,6 +8,20 @@ versioned section on each npm release.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [v1.0.6] - 2026-05-28
12
+
13
+ ### Changed
14
+
15
+ - `auth status` now issues a lightweight `tools/list` call to validate the token against the server, instead of only checking whether a token string is present locally. Cron / CI preflights that previously saw `authenticated: true` followed by an immediate `401` on the next business call now get the correct verdict up front. JSON output gains a `reason` field on failure (`no local token` / `token rejected by server` / `server unreachable: <err>`). A new exit code `2` indicates the server was unreachable (network, timeout, 5xx) — distinct from exit `1` which still covers missing or rejected tokens. There is no opt-out flag: offline status inspection is intentionally no longer supported.
16
+
17
+ ## [v1.0.5] - 2026-05-20
18
+
19
+ ### Added
20
+
21
+ - New `deliverable` domain exposing the upstream `list_deliverables` MCP tool — `deliverable list` returns deliverables along with their root and source work items
22
+ - New `resource` domain for Meegle's resource-library feature — `resource create` creates a resource template (resource instance) under a resource-library-enabled work item type, `resource meta-fields` lists the resource library configuration (resource fields and roles)
23
+ - New `wbs` domain covering plan-table draft + instance workflows: `wbs list-draft-rows` / `wbs list-instance-rows` filter and project rows, `wbs create-draft` creates a new draft for a work item instance, `wbs edit-draft` applies one atomic operation to a single draft row (add / delete / restore / sort / rename / owner / schedule via `--params`), `wbs publish-draft` publishes a draft online, `wbs reset-draft` discards unpublished changes, `wbs get-draft-progress` polls async-operation progress, `wbs list-element-templates` lists element templates (resource nodes and tasks) from the flow resource library
24
+
11
25
  ## [v1.0.4] - 2026-05-19
12
26
 
13
27
  ### Fixed
package/README.md CHANGED
@@ -13,7 +13,7 @@ Command-line tool for [Meegle](https://meegle.com?utm_source=github&utm_medium=r
13
13
  ## Why Meegle CLI?
14
14
 
15
15
  - **Agent-Native** — Ships a bundled [AI Agent Skill](#ai-agent-skill) that teaches Trae, Claude Code, Cursor, Windsurf, Gemini CLI and other agents how to drive Meegle with one command. Every CLI command is designed for both humans and agents, with structured JSON output, `--dry-run` previews, and `--device-code` flows for non-TTY environments
16
- - **Broad Coverage** — 13 business domains (work items, workflow, subtasks, comments, work hours, relations, my-work, views, charts, team, user, project, attachments) and 40+ commands mapping to Meegle's core capabilities
16
+ - **Broad Coverage** — 16 business domains (work items, workflow, subtasks, comments, work hours, relations, my-work, views, charts, team, user, project, attachments, deliverables, resource library, WBS plan tables) and 50+ commands mapping to Meegle's core capabilities
17
17
  - **Two-Layer Parameters** — Ergonomic `--flag-name` for everyday use, fallback `--params <json>` for complex payloads like `fields[]` — pick the right granularity per call
18
18
  - **Flexible Output** — `json` / `table` / `ndjson` / `raw`, with `--select` dot-path projection for piping to other tools
19
19
  - **Secure by Default** — OS keychain credential storage, `${VAR}` env-var templating so secrets never land in config files, multi-profile switching for staging / prod
@@ -34,6 +34,9 @@ Command-line tool for [Meegle](https://meegle.com?utm_source=github&utm_medium=r
34
34
  | 👥 [Team & User](#team--user--people) | List teams, team members, search users, view current login |
35
35
  | 🗂️ [Projects](#project--projects) | Search projects by keyword |
36
36
  | 📎 [Attachments](#attachment--attachments) | Two-stage upload/download protocol — `prepare-*` basic commands plus `+upload` / `+download` end-to-end shortcuts |
37
+ | 📦 [Deliverables](#deliverable--deliverables) | List deliverables with their root and source work items |
38
+ | 🧩 [Resource Library](#resource--resource-library) | Create resource templates, inspect resource library configuration |
39
+ | 🗓️ [WBS Plan Tables](#wbs--wbs-plan-tables) | List draft / published plan rows, create / edit / publish / reset drafts, query draft progress, list element templates |
37
40
  | 🔐 [Auth & Config](#authentication) | OAuth login, device-code flow, multi-profile config, env-var injection |
38
41
  | 🔗 [URL Parsing](#url--url-parsing) | Offline decode of Meegle / Feishu Project URLs into `url_kind` + structured fields |
39
42
  | 🤖 [Agent Skill](#ai-agent-skill) | Pre-built skill for Trae / Claude Code / Cursor / Windsurf / Gemini CLI / Copilot |
@@ -254,13 +257,39 @@ The agent consults the skill, picks the right `meegle` commands, and runs them f
254
257
  | `attachment +upload` | End-to-end upload: preprocess + signed HTTP POST(s); returns the resulting `file_token` and file metadata |
255
258
  | `attachment +download` | End-to-end download: preprocess + signed HTTP GET(s) + atomic write — for `file_url`s embedded in `workitem get` / `comment list` responses |
256
259
 
260
+ ### deliverable — Deliverables
261
+
262
+ | Command | Description |
263
+ |---------|-------------|
264
+ | `deliverable list` | List deliverables with their root and source work items |
265
+
266
+ ### resource — Resource Library
267
+
268
+ | Command | Description |
269
+ |---------|-------------|
270
+ | `resource create` | Create a resource template (resource instance) under a resource-library-enabled work item type |
271
+ | `resource meta-fields` | List resource library configuration (resource fields and roles) |
272
+
273
+ ### wbs — WBS Plan Tables
274
+
275
+ | Command | Description |
276
+ |---------|-------------|
277
+ | `wbs list-draft-rows` | List rows in a WBS draft, filtered by query and projected to selected fields |
278
+ | `wbs list-instance-rows` | List rows in a published WBS instance, filtered by query and projected to selected fields |
279
+ | `wbs create-draft` | Create a new WBS draft for a work item instance |
280
+ | `wbs edit-draft` | Apply one atomic operation to a single draft row (add / delete / restore / sort / rename / owner / schedule); operation type via `--params` |
281
+ | `wbs publish-draft` | Publish a WBS draft online |
282
+ | `wbs reset-draft` | Reset a draft to match the published instance, discarding unpublished changes |
283
+ | `wbs get-draft-progress` | Get the execution progress of a WBS draft operation (create / edit / publish) |
284
+ | `wbs list-element-templates` | List element templates (resource nodes and tasks) from the flow resource library |
285
+
257
286
  ### auth — Authentication
258
287
 
259
288
  | Command | Description |
260
289
  |---------|-------------|
261
290
  | `auth login` | Log in (browser or `--device-code`) |
262
291
  | `auth logout` | Log out |
263
- | `auth status` | View login status |
292
+ | `auth status` | View login status (validates the token against the server) |
264
293
 
265
294
  ### config — Configuration
266
295
 
@@ -728,13 +757,30 @@ The terminal displays a QR code and authorization code. Scan with your phone to
728
757
  ### Other Auth Commands
729
758
 
730
759
  ```bash
731
- # Check login status
760
+ # Check login status (issues a lightweight tools/list call to validate the
761
+ # token against the server — safe to use as a cron preflight)
732
762
  meegle auth status
733
763
 
734
764
  # Log out
735
765
  meegle auth logout
736
766
  ```
737
767
 
768
+ `auth status` exit codes and `reason` field let scripts (cron jobs, CI
769
+ preflights) react correctly without having to parse human text:
770
+
771
+ | Exit | `reason` | Meaning | Recommended action |
772
+ |------|----------|---------|--------------------|
773
+ | 0 | — | Token is present locally and accepted by the server | Proceed |
774
+ | 1 | `no local token` | No token stored | Run `meegle auth login` |
775
+ | 1 | `token rejected by server` | Token expired or revoked; refresh exhausted | Run `meegle auth login` |
776
+ | 2 | `server unreachable: <err>` | Network, timeout, or 5xx — the call itself failed | Retry later; do not re-login |
777
+
778
+ JSON output example (`auth status --format json`) on a rejected token:
779
+
780
+ ```json
781
+ {"authenticated": false, "host": "meegle.com", "reason": "token rejected by server"}
782
+ ```
783
+
738
784
  ## Configuration
739
785
 
740
786
  ### Config File
package/README.zh-CN.md CHANGED
@@ -13,7 +13,7 @@
13
13
  ## 为什么选择 Meegle CLI?
14
14
 
15
15
  - **Agent 友好** — 附带一份 [AI Agent Skill](#ai-agent-skill),一条命令即可把 Meegle 操作手册喂给 Trae、Claude Code、Cursor、Windsurf、Gemini CLI 等主流 Agent。CLI 命令同时面向人类和 Agent 设计,结构化 JSON 输出、`--dry-run` 预览、`--device-code` 无 TTY 流程
16
- - **覆盖完整** — 13 个业务域(工作项、工作流、子任务、评论、工时、关联、我的工作、视图、图表、团队、用户、空间、附件),40+ 命令映射到 Meegle 核心能力
16
+ - **覆盖完整** — 16 个业务域(工作项、工作流、子任务、评论、工时、关联、我的工作、视图、图表、团队、用户、空间、附件、交付物、资源库、WBS 计划表),50+ 命令映射到 Meegle 核心能力
17
17
  - **两层参数模型** — 日常用 `--flag-name` 轻便直接,复杂载荷(如 `fields[]`)用 `--params <json>` 兜底 —— 按场景选择合适粒度
18
18
  - **输出格式灵活** — 支持 `json` / `table` / `ndjson` / `raw`,配合 `--select` 点路径投影可直接 pipe 给其他工具
19
19
  - **默认安全** — 凭证存进系统 keychain、`${VAR}` 环境变量模板让 secret 不落地到 config 文件、多 profile 分离 staging / prod
@@ -34,6 +34,9 @@
34
34
  | 👥 [团队与用户](#team--user--人员域) | 列出团队、团队成员、搜索用户、查看当前登录身份 |
35
35
  | 🗂️ [空间](#project--空间域) | 按关键词搜索空间 |
36
36
  | 📎 [附件](#attachment--附件域) | 两段式上传/下载协议 —— `prepare-*` 基础命令 + `+upload` / `+download` 端到端快捷命令 |
37
+ | 📦 [交付物](#deliverable--交付物域) | 列出交付物及所属根工作项、来源工作项 |
38
+ | 🧩 [资源库](#resource--资源库) | 创建资源模板、查看资源库配置 |
39
+ | 🗓️ [WBS 计划表](#wbs--wbs-计划表) | 查询草稿 / 已发布计划行、创建 / 编辑 / 发布 / 重置草稿、查询草稿进度、列流程资源库元素 |
37
40
  | 🔐 [认证与配置](#认证) | OAuth 登录、Device Code 流程、多 profile 配置、环境变量注入 |
38
41
  | 🔗 [URL 解析](#url--url-解析) | 离线解析飞书项目 / Meegle URL,输出 `url_kind` + 结构化字段 |
39
42
  | 🤖 [Agent Skill](#ai-agent-skill) | 内置 skill 供 Trae / Claude Code / Cursor / Windsurf / Gemini / Copilot 使用 |
@@ -254,13 +257,39 @@ Agent 会参考 skill,自动选择合适的 `meegle` 命令执行。配合 `--
254
257
  | `attachment +upload` | 端到端上传:预处理 + 签名 HTTP POST,返回 `file_token` 与文件元信息 |
255
258
  | `attachment +download` | 端到端下载:预处理 + 签名 HTTP GET + 原子写文件,用于消费 `workitem get` / `comment list` 返回的 `file_url` |
256
259
 
260
+ ### deliverable — 交付物域
261
+
262
+ | 命令 | 说明 |
263
+ |------|------|
264
+ | `deliverable list` | 列出交付物及其根工作项、来源工作项 |
265
+
266
+ ### resource — 资源库
267
+
268
+ | 命令 | 说明 |
269
+ |------|------|
270
+ | `resource create` | 在启用资源库的工作项类型下创建资源模板(资源实例) |
271
+ | `resource meta-fields` | 查看资源库配置(资源字段、资源角色) |
272
+
273
+ ### wbs — WBS 计划表
274
+
275
+ | 命令 | 说明 |
276
+ |------|------|
277
+ | `wbs list-draft-rows` | 在计划表草稿中按条件筛选行并返回指定字段 |
278
+ | `wbs list-instance-rows` | 在已发布的线上计划表实例中按条件筛选行并返回指定字段 |
279
+ | `wbs create-draft` | 为指定工作项实例创建新的计划表草稿 |
280
+ | `wbs edit-draft` | 对计划表草稿单行执行一次原子操作(新增 / 删除 / 恢复 / 排序 / 改名 / 改负责人 / 改排期),操作类型通过 `--params` 指定 |
281
+ | `wbs publish-draft` | 将编辑完成的草稿发布到线上 |
282
+ | `wbs reset-draft` | 将草稿重置为线上实例状态,放弃所有未发布的修改 |
283
+ | `wbs get-draft-progress` | 查询计划表草稿操作(创建 / 编辑 / 发布)的执行进度 |
284
+ | `wbs list-element-templates` | 列出流程资源库中的资源节点与资源任务模板 |
285
+
257
286
  ### auth — 认证域
258
287
 
259
288
  | 命令 | 说明 |
260
289
  |------|------|
261
290
  | `auth login` | 登录(浏览器或 `--device-code`) |
262
291
  | `auth logout` | 登出 |
263
- | `auth status` | 查看登录状态 |
292
+ | `auth status` | 查看登录状态(会向服务端发一次校验请求,确认 token 真实可用) |
264
293
 
265
294
  ### config — 配置域
266
295
 
@@ -705,13 +734,30 @@ meegle auth login --device-code
705
734
  ### 其他认证命令
706
735
 
707
736
  ```bash
708
- # 查看登录状态
737
+ # 查看登录状态(会向服务端发一次轻量 tools/list 调用校验 token,可作为
738
+ # cron 任务的 preflight)
709
739
  meegle auth status
710
740
 
711
741
  # 登出
712
742
  meegle auth logout
713
743
  ```
714
744
 
745
+ `auth status` 退出码与 `reason` 字段配合,让 cron / CI preflight 脚本
746
+ 不用解析人类可读文本即可分支处理:
747
+
748
+ | 退出码 | `reason` | 含义 | 建议动作 |
749
+ |--------|----------|------|----------|
750
+ | 0 | — | 本地有 token 且服务端校验通过 | 继续执行 |
751
+ | 1 | `no local token` | 本地无 token | 执行 `meegle auth login` |
752
+ | 1 | `token rejected by server` | token 已过期或被撤销(refresh 也救不回来) | 执行 `meegle auth login` |
753
+ | 2 | `server unreachable: <err>` | 网络、超时、5xx —— 调用本身失败 | 稍后重试,不要重新登录 |
754
+
755
+ JSON 输出示例(`auth status --format json`),token 被拒:
756
+
757
+ ```json
758
+ {"authenticated": false, "host": "meegle.com", "reason": "token rejected by server"}
759
+ ```
760
+
715
761
  ## 配置
716
762
 
717
763
  ### 配置文件
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-project/meegle",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Agent-First CLI for Meegle (Lark Project)",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/larksuite/meegle-cli#readme",