Skip to content

Commit 8ec3f8a

Browse files
committed
Merge branch 'main' into feat-cli-docx-folder-manager
Change-Id: I6a19d223a45b3d01f22ed194b98a4a18efa55424
2 parents 42cb51e + a2cc5e1 commit 8ec3f8a

349 files changed

Lines changed: 29124 additions & 2531 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Test Plan
1010
<!-- Describe how this change was verified. -->
1111
- [ ] Unit tests pass
12-
- [ ] Manual local verification confirms the `lark xxx` command works as expected
12+
- [ ] Manual local verification confirms the `lark-cli <domain> <command>` flow works as expected
1313

1414
## Related Issues
1515
<!-- Link related issues. Use Closes/Fixes to close them automatically. -->

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build output
2-
/lark-cli
2+
/lark-cli*
33
.cache/
44
dist/
55
bin/

CHANGELOG.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,116 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [v1.0.43] - 2026-05-28
6+
7+
### Features
8+
9+
- **event**: Support `note` generated event (#1159)
10+
- **config**: Decouple `--lang` preference from TUI display language (#1132)
11+
- **mail**: Add HTML lint library with Larksuite-native autofix for `lark-mail` (#1019)
12+
13+
### Bug Fixes
14+
15+
- **config**: Propagate `Lang` across credential boundary; respect `CurrentApp` in priorLang (#1157)
16+
- **config**: Allow lark-channel bind source override (#1154)
17+
- **im**: Clarify `messages-send` dry-run chat membership (#1150)
18+
- **base**: Include `log_id` in attachment media errors (#1133)
19+
20+
### Performance
21+
22+
- **im**: Parallelize reactions, thread_replies, and merge_forward fetches (#1146)
23+
24+
### Documentation
25+
26+
- **im**: Update IM skill urgent APIs (#1153)
27+
28+
## [v1.0.42] - 2026-05-27
29+
30+
### Features
31+
32+
- **mail**: Add `+draft-send` shortcut for batch draft sending (#1017)
33+
- **im**: Enrich messages with reactions and output `update_time` (#1095)
34+
- **schema**: Output JSON spec envelope for all API commands (#1048)
35+
- **event**: Support `vc` / `note` / `minute` events (#1113)
36+
- **drive**: Add secure label shortcuts (#985)
37+
- **affordance**: Use description and command in affordance example schema (#1126)
38+
39+
### Bug Fixes
40+
41+
- **docs**: Remove unsupported `fetch` text format (#1109)
42+
43+
### Refactor
44+
45+
- **auth**: Drop duplicate top-level user fields in `status` (#1128)
46+
47+
### Documentation
48+
49+
- **doc**: Document block anchor URLs in `lark-doc` skill (#1120)
50+
- **whiteboard**: Improve SVG/Mermaid instructions (#1097)
51+
52+
## [v1.0.41] - 2026-05-26
53+
54+
### Features
55+
56+
- **minutes**: Add minutes edit shortcuts (#1036)
57+
- **minutes**: Get minutes keywords (#1079)
58+
- **slides**: Support importing pptx as slides (#1068)
59+
- **config**: Add `keychain-downgrade` subcommand (macOS) (#1085)
60+
- **errors**: Add structured CLI error contract (#984)
61+
- **apps**: Replace `+html-publish` cwd hard-reject with credential-file scan (#1072)
62+
63+
### Bug Fixes
64+
65+
- **drive**: Support doubao drive inspect URL variants (#1106)
66+
- **skills**: Sync skills incrementally during update (#1042)
67+
- **apps**: Read app object from `data.app` for `+create` and `+update` (#1087)
68+
- **common**: Escape special chars in multipart form filenames (#1037)
69+
- **auth**: Remove fenced code block guidance from auth URL output hints (#1088)
70+
71+
### Documentation
72+
73+
- **skills**: Fix agent routing for doubao.com URLs (#1082)
74+
- **task**: Require `--complete=false` for pending standup summaries (#1101)
75+
- **base**: Document UI-only field settings (#1078)
76+
- **contributing**: Clarify contributor guidance (#1096)
77+
78+
## [v1.0.40] - 2026-05-25
79+
80+
### Features
81+
82+
- **wiki**: Add exponential backoff retry for `+node-create` lock contention (#1012)
83+
- **auth**: Add `auth qrcode` subcommand and update auth docs/hints (#968)
84+
85+
### Bug Fixes
86+
87+
- **wiki**: Rename `+node-get --token` to `--node-token`, keep alias (#1074)
88+
- **output**: Classify wiki lock-contention error (131009) with retry hint (#1014)
89+
- **contact**: Add actionable hint when fanout search all-fail with no API code (#1054)
90+
- **permission**: Annotate auto-grant permission failures with `required_scope` and `console_url` (#1045)
91+
- **validation**: Use `ErrValidation` instead of `fmt.Errorf` in `Validate` paths (#1001)
92+
93+
### Documentation
94+
95+
- **skills**: Add 云盘/云存储 alias alongside 云空间 for agent clarity (#1073)
96+
- **task**: Refresh `lark-task` shortcut docs (#1057)
97+
98+
## [v1.0.39] - 2026-05-22
99+
100+
### Features
101+
102+
- **slides**: Add `+export` shortcut to export slides (#988)
103+
- **sidecar**: Support multi-client identity isolation in `server-demo` via per-client HMAC keys, preventing UAT cross-contamination when multiple CLI sandboxes share one sidecar (#934)
104+
- **im**: Support Markdown image rendering in post content (#893)
105+
106+
### Bug Fixes
107+
108+
- **scope**: Add 22 new scope entries to scope priorities (#1050)
109+
110+
### Documentation
111+
112+
- **base**: Update location `full_address` guidance (#754)
113+
- **apps**: Refine `lark-apps` skill description and surface, document `index.html` / `--path` hard constraints (#1040)
114+
5115
## [v1.0.38] - 2026-05-22
6116

7117
### Features
@@ -823,6 +933,11 @@ Bundled AI agent skills for intelligent assistance:
823933
- Bilingual documentation (English & Chinese).
824934
- CI/CD pipelines: linting, testing, coverage reporting, and automated releases.
825935

936+
[v1.0.43]: https://github.com/larksuite/cli/releases/tag/v1.0.43
937+
[v1.0.42]: https://github.com/larksuite/cli/releases/tag/v1.0.42
938+
[v1.0.41]: https://github.com/larksuite/cli/releases/tag/v1.0.41
939+
[v1.0.40]: https://github.com/larksuite/cli/releases/tag/v1.0.40
940+
[v1.0.39]: https://github.com/larksuite/cli/releases/tag/v1.0.39
826941
[v1.0.38]: https://github.com/larksuite/cli/releases/tag/v1.0.38
827942
[v1.0.37]: https://github.com/larksuite/cli/releases/tag/v1.0.37
828943
[v1.0.36]: https://github.com/larksuite/cli/releases/tag/v1.0.36

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ Community contributions are welcome! If you find a bug or have feature suggestio
279279

280280
For major changes, we recommend discussing with us first via an Issue.
281281

282+
Before opening a PR, see [AGENTS.md](./AGENTS.md) for the local build, test, and PR checklist used by contributors and AI agents.
283+
282284
## License
283285

284286
This project is licensed under the **MIT License**.

README.zh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ lark-cli schema im.messages.delete
280280

281281
对于较大的改动,建议先通过 Issue 与我们讨论。
282282

283+
提交 PR 前,请先阅读 [AGENTS.md](./AGENTS.md),其中列出了贡献者和 AI Agent 使用的本地构建、测试和 PR 检查清单。
284+
283285
## 许可证
284286

285287
本项目基于 **MIT 许可证** 开源。

cmd/api/api.go

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ func apiRun(opts *APIOptions) error {
238238

239239
resp, err := ac.DoAPI(opts.Ctx, request)
240240
if err != nil {
241-
return output.MarkRaw(client.WrapDoAPIError(err))
241+
// MarkRaw tells the dispatcher to skip enrichPermissionError so the
242+
// raw API error detail (log_id, troubleshooter, permission_violations)
243+
// stays on the wire — `lark-cli api` callers explicitly want the raw
244+
// envelope.
245+
return output.MarkRaw(err)
242246
}
243247
err = client.HandleResponse(resp, client.ResponseOptions{
244248
OutputPath: opts.Output,
@@ -248,9 +252,15 @@ func apiRun(opts *APIOptions) error {
248252
ErrOut: f.IOStreams.ErrOut,
249253
FileIO: f.ResolveFileIO(opts.Ctx),
250254
CommandPath: opts.Cmd.CommandPath(),
255+
Identity: opts.As,
256+
// Stage 1: CheckResponse emits the legacy *output.ExitError envelope.
257+
// Per-domain migration in stage 2+ will route through
258+
// errclass.BuildAPIError to populate identity-aware fields
259+
// (PermissionError.ConsoleURL needs Brand+AppID from the client).
260+
CheckError: ac.CheckResponse,
251261
})
252-
// MarkRaw tells root error handler to skip enrichPermissionError,
253-
// preserving the original API error detail (log_id, troubleshooter, etc.).
262+
// MarkRaw: see comment above on the DoAPI path. Applies equally to
263+
// HandleResponse failures so the raw API error survives to the wire.
254264
if err != nil {
255265
return output.MarkRaw(err)
256266
}
@@ -262,9 +272,12 @@ func apiDryRun(f *cmdutil.Factory, request client.RawApiRequest, config *core.Cl
262272
}
263273

264274
func apiPaginate(ctx context.Context, ac *client.APIClient, request client.RawApiRequest, format output.Format, jqExpr string, out, errOut io.Writer, pagOpts client.PaginationOptions) error {
275+
if pagOpts.Identity == "" {
276+
pagOpts.Identity = request.As
277+
}
265278
// When jq is set, always aggregate all pages then filter.
266279
if jqExpr != "" {
267-
if err := client.PaginateWithJq(ctx, ac, request, jqExpr, out, pagOpts, client.CheckLarkResponse); err != nil {
280+
if err := client.PaginateWithJq(ctx, ac, request, jqExpr, out, pagOpts, ac.CheckResponse); err != nil {
268281
return output.MarkRaw(err)
269282
}
270283
return nil
@@ -277,9 +290,9 @@ func apiPaginate(ctx context.Context, ac *client.APIClient, request client.RawAp
277290
pf.FormatPage(items)
278291
}, pagOpts)
279292
if err != nil {
280-
return output.MarkRaw(output.ErrNetwork("API call failed: %v", err))
293+
return output.MarkRaw(err)
281294
}
282-
if apiErr := client.CheckLarkResponse(result); apiErr != nil {
295+
if apiErr := ac.CheckResponse(result, pagOpts.Identity); apiErr != nil {
283296
output.FormatValue(out, result, output.FormatJSON)
284297
return output.MarkRaw(apiErr)
285298
}
@@ -291,9 +304,9 @@ func apiPaginate(ctx context.Context, ac *client.APIClient, request client.RawAp
291304
default:
292305
result, err := ac.PaginateAll(ctx, request, pagOpts)
293306
if err != nil {
294-
return output.MarkRaw(output.ErrNetwork("API call failed: %v", err))
307+
return output.MarkRaw(err)
295308
}
296-
if apiErr := client.CheckLarkResponse(result); apiErr != nil {
309+
if apiErr := ac.CheckResponse(result, pagOpts.Identity); apiErr != nil {
297310
output.FormatValue(out, result, output.FormatJSON)
298311
return output.MarkRaw(apiErr)
299312
}

0 commit comments

Comments
 (0)