Skip to content

feat(drive): add +inspect shortcut for document URL inspection with wiki unwrapping#947

Merged
fangshuyu-768 merged 3 commits into
mainfrom
feat/drive-resolve-url
May 19, 2026
Merged

feat(drive): add +inspect shortcut for document URL inspection with wiki unwrapping#947
fangshuyu-768 merged 3 commits into
mainfrom
feat/drive-resolve-url

Conversation

@fangshuyu-768
Copy link
Copy Markdown
Collaborator

@fangshuyu-768 fangshuyu-768 commented May 18, 2026

Summary

Implements #662: lark-cli drive +inspect --url <url> inspects any Lark/Feishu document URL to get its type, title, and canonical token with wiki unwrapping support.

Algorithm

  1. Parse URL path → {type, token} via new ParseResourceURL (inverse of existing BuildResourceURL)
  2. If type is wiki: call GET /open-apis/wiki/v2/spaces/get_node to unwrap to underlying document
  3. Call POST /open-apis/drive/v1/metas/batch_query to verify and get title
  4. Output JSON: {input_url, type, title, token, url, wiki_node?}

Usage

# Inspect a docx URL
lark-cli drive +inspect --url 'https://xxx.feishu.cn/docx/doxcnXXX'

# Inspect a wiki URL (auto-unwraps to underlying doc)
lark-cli drive +inspect --url 'https://xxx.feishu.cn/wiki/wikcnXXX'

# Bare token with explicit type
lark-cli drive +inspect --url doxcnXXX --type docx

# Pretty output
lark-cli drive +inspect --url 'https://xxx.feishu.cn/base/bascnXXX' --format pretty

Why drive +inspect?

  • drive not docs: URL inspection is a cross-document capability (docx, sheet, bitable, wiki, file, folder, mindnote, slides) backed by drive.metas.batch_query, not specific to document content operations.
  • +inspect not +search: +inspect examines a specific URL, while +search does full-text search — no ambiguity.

Test Plan

  • go build ./... — clean
  • go test -race ./shortcuts/... — all pass
  • go vet ./... — clean
  • gofmt -l . — clean
  • go mod tidy — no changes
  • Dry-run E2E tests (docx URL, wiki URL, bare token) — all pass

Summary by CodeRabbit

  • New Features

    • Added a Drive "inspect" command to validate/inspect Drive links or tokens, resolving resource type, real token, title, and canonical URL; markdown export now uses resolved titles when available.
    • Added URL parsing for Drive resource links and a helper to fetch document titles.
  • Tests

    • Added unit tests for URL parsing and end-to-end dry-run tests for the inspect command.
  • Documentation

    • Updated drive docs and skill guides with recommended inspect workflow and a new reference for the inspect command.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds shared resource parsing and metadata helpers, consolidates export title lookup, implements a new Drive "+inspect" shortcut (dry-run and execute), registers the command, adds E2E dry-run tests, and updates docs and skill references.

Changes

Drive +inspect resource inspection feature

Layer / File(s) Summary
Shared resource URL and metadata utilities
shortcuts/common/resource_url.go, shortcuts/common/drive_meta.go, shortcuts/common/resource_url_test.go
Adds ResourceRef and ParseResourceURL to parse resource URLs into type/token pairs, adds FetchDriveMetaTitle to call drive/v1/metas/batch_query and return the first meta title, and adds unit tests including a round-trip test.
Drive export title lookup consolidation
shortcuts/drive/drive_export_common.go, shortcuts/drive/drive_export.go
Removes local fetchDriveMetaTitle and updates markdown export to call common.FetchDriveMetaTitle for filename/title resolution with the existing fallback behavior.
Drive +inspect command implementation
shortcuts/drive/drive_inspect.go
Implements DriveInspect with validation for URLs or bare tokens (requires --type), DryRun that emits planned API steps (wiki -> get_node + batch_query, others -> batch_query), and Execute that unwraps wiki nodes, fetches titles, builds canonical URLs, and formats output.
Drive +inspect registration and E2E test coverage
shortcuts/drive/shortcuts.go, shortcuts/drive/shortcuts_test.go, tests/cli_e2e/drive/drive_inspect_dryrun_test.go
Registers DriveInspect in the shortcut registry, updates tests to expect +inspect, and adds three E2E dry-run tests covering docx URL, wiki URL, and bare-token-with-type scenarios.
Docs and skill references
skill-template/domains/drive.md, skills/lark-drive/SKILL.md, skills/lark-drive/references/lark-drive-inspect.md
Adds recommended workflow using lark-cli drive +inspect for wiki links, updates SKILL.md to document +inspect, and creates a reference guide describing command purpose, examples, and JSON output schema.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • larksuite/cli#470: Also modifies the drive shortcuts registry to add a drive command; overlaps at the same registry area.
  • larksuite/cli#588: Adds a drive command and updates tests/registry similarly to this PR.

Suggested reviewers

  • wittam-01
  • liujinkun2025

Poem

🐰 I nibble tokens and chase URLs bright,
Parsing tokens by moonlit byte,
+inspect reveals titles the users seek,
Wiki nodes unwrapped in just one peek.
Hooray — shared helpers make the work light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a new +inspect shortcut for document URL inspection with wiki unwrapping support, which matches the primary objective of the PR.
Description check ✅ Passed The PR description is comprehensive and well-structured, covering summary, algorithm, usage examples, rationale, and a complete test plan with all checkboxes marked. It exceeds the template requirements by providing substantial context.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/drive-resolve-url

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels May 18, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
shortcuts/common/resource_url_test.go (1)

15-52: ⚡ Quick win

Add two negative cases to cover untested parser branches.

Please add table cases for an invalid URL parse failure (e.g., https://%zz) and a recognized prefix without token (e.g., https://xxx.feishu.cn/docx/). This closes the currently untested url.Parse error and empty-token return paths in ParseResourceURL.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shortcuts/common/resource_url_test.go` around lines 15 - 52, Add two negative
test entries to the existing tests slice in resource_url_test.go to exercise the
url.Parse error and empty-token branches of ParseResourceURL: add one named like
"invalid url parse" with rawURL "https://%zz" expecting wantType="" wantToken=""
wantOK=false, and one named like "recognized prefix no token" with rawURL
"https://xxx.feishu.cn/docx/" expecting wantType="" wantToken="" wantOK=false;
this ensures ParseResourceURL's URL parse failure and the branch that returns
empty token for known prefixes are covered.
tests/cli_e2e/drive/drive_info_dryrun_test.go (1)

35-40: ⚡ Quick win

Strengthen dry-run E2E assertions to validate params/body shape.

These tests only check API count and URL. Please also assert request structure (e.g., wiki api.0.params.token, batch query api.*.body.request_docs.0.doc_token/doc_type) so the tests enforce dry-run contract fidelity.

As per coding guidelines: “Dry-run E2E tests required for every shortcut change must validate request structure without calling real APIs...”.

Also applies to: 63-70, 93-97

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/cli_e2e/drive/drive_info_dryrun_test.go` around lines 35 - 40, The test
currently only asserts API count and URL; update drive_info_dryrun_test.go to
also validate the dry-run request shapes: add gjson assertions that
api.0.params.token exists and is non-empty (for the wiki step), and for the
batch_query step assert api.*.body.request_docs.0.doc_token and
api.*.body.request_docs.0.doc_type exist and match expected values or are
non-empty; reference the existing assertions around gjson.Get(result.Stdout,
"api.#"), gjson.Get(result.Stdout, "api.0.url") and extend them similarly (e.g.,
gjson.Get(result.Stdout, "api.0.params.token"), gjson.Get(result.Stdout,
"api.0.body.request_docs.0.doc_token") and gjson.Get(result.Stdout,
"api.0.body.request_docs.0.doc_type")); apply equivalent additional assertions
to the other two test blocks noted (the sections around lines 63-70 and 93-97)
so all dry-run E2E checks validate request param/body shape without calling real
APIs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shortcuts/drive/drive_info.go`:
- Around line 68-75: The dry-run for wiki handling uses the wrong query key and
omits the POST payload shape: in the ref.Type == "wiki" branch update the
dry.GET("/open-apis/wiki/v2/spaces/get_node") call to set the real query key
"token" (not "wiki_token") and mirror the exact query param(s) used by the real
API; also expand dry.POST("/open-apis/drive/v1/metas/batch_query") to include
the expected request body shape used in production (for example the list of
node/file IDs and requested fields or whatever keys metas/batch_query actually
expects) so --dry-run validates request structure; apply the same fixes to the
other similar block around the 78-80 region.

---

Nitpick comments:
In `@shortcuts/common/resource_url_test.go`:
- Around line 15-52: Add two negative test entries to the existing tests slice
in resource_url_test.go to exercise the url.Parse error and empty-token branches
of ParseResourceURL: add one named like "invalid url parse" with rawURL
"https://%zz" expecting wantType="" wantToken="" wantOK=false, and one named
like "recognized prefix no token" with rawURL "https://xxx.feishu.cn/docx/"
expecting wantType="" wantToken="" wantOK=false; this ensures ParseResourceURL's
URL parse failure and the branch that returns empty token for known prefixes are
covered.

In `@tests/cli_e2e/drive/drive_info_dryrun_test.go`:
- Around line 35-40: The test currently only asserts API count and URL; update
drive_info_dryrun_test.go to also validate the dry-run request shapes: add gjson
assertions that api.0.params.token exists and is non-empty (for the wiki step),
and for the batch_query step assert api.*.body.request_docs.0.doc_token and
api.*.body.request_docs.0.doc_type exist and match expected values or are
non-empty; reference the existing assertions around gjson.Get(result.Stdout,
"api.#"), gjson.Get(result.Stdout, "api.0.url") and extend them similarly (e.g.,
gjson.Get(result.Stdout, "api.0.params.token"), gjson.Get(result.Stdout,
"api.0.body.request_docs.0.doc_token") and gjson.Get(result.Stdout,
"api.0.body.request_docs.0.doc_type")); apply equivalent additional assertions
to the other two test blocks noted (the sections around lines 63-70 and 93-97)
so all dry-run E2E checks validate request param/body shape without calling real
APIs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 77babcd3-d967-4794-8cae-1cacfb419da6

📥 Commits

Reviewing files that changed from the base of the PR and between 7af616b and a965b8d.

📒 Files selected for processing (10)
  • shortcuts/common/drive_meta.go
  • shortcuts/common/resource_url.go
  • shortcuts/common/resource_url_test.go
  • shortcuts/drive/drive_export.go
  • shortcuts/drive/drive_export_common.go
  • shortcuts/drive/drive_info.go
  • shortcuts/drive/shortcuts.go
  • shortcuts/drive/shortcuts_test.go
  • shortcuts/sheets/lark_sheets_cell_style_and_merge.go
  • tests/cli_e2e/drive/drive_info_dryrun_test.go
💤 Files with no reviewable changes (1)
  • shortcuts/drive/drive_export_common.go

Comment thread shortcuts/drive/drive_inspect.go
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@67e322c71a159867f7203d5a808b3334d027ceec

🧩 Skill update

npx skills add larksuite/cli#feat/drive-resolve-url -y -g

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 97.14286% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.01%. Comparing base (7af616b) to head (67e322c).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/drive/drive_inspect.go 95.91% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #947      +/-   ##
==========================================
+ Coverage   66.71%   67.01%   +0.30%     
==========================================
  Files         563      570       +7     
  Lines       52287    53089     +802     
==========================================
+ Hits        34884    35580     +696     
- Misses      14509    14578      +69     
- Partials     2894     2931      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
tests/cli_e2e/drive/drive_resolve_dryrun_test.go (1)

35-40: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Dry-run E2E assertions are incomplete for request-structure validation.

These tests only assert API count and URL. Please also assert planned query/body fields (e.g., wiki token query key and metas/batch_query request_docs payload shape) so dry-run truly validates request structure.

As per coding guidelines: “Dry-run E2E tests required for every shortcut change must validate request structure without calling real APIs.”

Also applies to: 63-70, 93-97

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/cli_e2e/drive/drive_resolve_dryrun_test.go` around lines 35 - 40, The
current dry-run assertions only check API count and URL; extend them to validate
the planned request structure by asserting the query token and the batch_query
payload shape: use gjson on result.Stdout to assert that "api.0.query.token"
exists and equals the expected wiki token key, and that
"api.0.body.request_docs" is the expected array/object shape (e.g., contains
required fields like url/filetype/doc_id), and add equivalent assertions for the
other ranges (use "api.1..." or appropriate indices referenced at lines 63-70
and 93-97) so the test validates both query keys and the request_docs payload
structure rather than only count and URL.
shortcuts/drive/drive_resolve.go (1)

68-80: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Dry-run request shape does not mirror real API calls.

The dry-run plan uses wiki_token instead of the real query key (token) and omits metas/batch_query request body shape in both branches, so --dry-run cannot validate request structure reliably.

Suggested patch
 		if ref.Type == "wiki" {
 			dry.Desc("2-step: resolve wiki node, then batch query metadata")
 			dry.GET("/open-apis/wiki/v2/spaces/get_node").
 				Desc("[1] Resolve wiki node to underlying document").
-				Set("wiki_token", ref.Token)
+				Set("token", ref.Token)
 			dry.POST("/open-apis/drive/v1/metas/batch_query").
-				Desc("[2] Batch query document metadata (title)")
+				Desc("[2] Batch query document metadata (title)").
+				Body(map[string]interface{}{
+					"request_docs": []map[string]interface{}{
+						{"doc_token": "<resolved_obj_token>", "doc_type": "<resolved_obj_type>"},
+					},
+				})
 			return dry
 		}
 
 		dry.Desc("1-step: batch query document metadata")
-		dry.POST("/open-apis/drive/v1/metas/batch_query")
+		dry.POST("/open-apis/drive/v1/metas/batch_query").
+			Body(map[string]interface{}{
+				"request_docs": []map[string]interface{}{
+					{"doc_token": ref.Token, "doc_type": ref.Type},
+				},
+			})
 		return dry

As per coding guidelines: “Dry-run E2E tests required for every shortcut change must validate request structure without calling real APIs.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shortcuts/drive/drive_resolve.go` around lines 68 - 80, The dry-run uses the
wrong query key and omits the POST body shape; update drive_resolve.go so the
wiki branch sets the real query key (replace Set("wiki_token", ref.Token) with
Set("token", ref.Token)) and add the expected request body shape for POST
"/open-apis/drive/v1/metas/batch_query" in both branches (use the same body
structure used by the real API call in the codebase—e.g., the JSON payload
passed to the actual metas batch_query call) so the dry-run accurately mirrors
the real requests and can validate request structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@shortcuts/drive/drive_resolve.go`:
- Around line 68-80: The dry-run uses the wrong query key and omits the POST
body shape; update drive_resolve.go so the wiki branch sets the real query key
(replace Set("wiki_token", ref.Token) with Set("token", ref.Token)) and add the
expected request body shape for POST "/open-apis/drive/v1/metas/batch_query" in
both branches (use the same body structure used by the real API call in the
codebase—e.g., the JSON payload passed to the actual metas batch_query call) so
the dry-run accurately mirrors the real requests and can validate request
structure.

In `@tests/cli_e2e/drive/drive_resolve_dryrun_test.go`:
- Around line 35-40: The current dry-run assertions only check API count and
URL; extend them to validate the planned request structure by asserting the
query token and the batch_query payload shape: use gjson on result.Stdout to
assert that "api.0.query.token" exists and equals the expected wiki token key,
and that "api.0.body.request_docs" is the expected array/object shape (e.g.,
contains required fields like url/filetype/doc_id), and add equivalent
assertions for the other ranges (use "api.1..." or appropriate indices
referenced at lines 63-70 and 93-97) so the test validates both query keys and
the request_docs payload structure rather than only count and URL.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a443a73e-a4aa-4eb9-af18-0efe3563d9ce

📥 Commits

Reviewing files that changed from the base of the PR and between 4169528 and 8ddaf80.

📒 Files selected for processing (3)
  • shortcuts/drive/drive_resolve.go
  • shortcuts/drive/shortcuts.go
  • tests/cli_e2e/drive/drive_resolve_dryrun_test.go

@fangshuyu-768 fangshuyu-768 changed the title feat(drive): add +resolve shortcut for document URL resolution with wiki unwrapping feat(drive): add +inspect shortcut for document URL inspection with wiki unwrapping May 18, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/cli_e2e/drive/drive_inspect_dryrun_test.go`:
- Around line 35-40: The test currently only asserts step count and URL via
gjson.Get(result.Stdout, "api.#") and gjson.Get(result.Stdout, "api.0.url");
extend the assertions to validate the dry-run request payloads: use gjson.Get on
result.Stdout to check api.0.params (or api.0.query) contains the wiki get_node
query key/name (e.g., "get_node") and expected query fields, and assert
api.0.body (or api.0.payload) for the /metas/batch_query step contains the
required keys/shape (e.g., expected "queries"/"targets"/"metas" array and
required subfields). Apply the same additional assertions pattern to the other
similar checks at the ranges noted (the blocks around lines 63-70 and 93-97) so
each dry-run step validates both URL and request structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: de211b96-923e-4d1c-ae5b-01e9d4bdb111

📥 Commits

Reviewing files that changed from the base of the PR and between 8ddaf80 and f44cfb5.

📒 Files selected for processing (4)
  • shortcuts/drive/drive_inspect.go
  • shortcuts/drive/shortcuts.go
  • shortcuts/drive/shortcuts_test.go
  • tests/cli_e2e/drive/drive_inspect_dryrun_test.go

Comment thread tests/cli_e2e/drive/drive_inspect_dryrun_test.go Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
skills/lark-drive/references/lark-drive-inspect.md (1)

20-21: ⚡ Quick win

Document the --format parameter in the notes section.

The example shows --format pretty but this parameter is not mentioned in the "注意事项" (notes) section. If --format is specific to this command rather than a global CLI parameter, consider adding documentation about available format options and the default format.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-drive/references/lark-drive-inspect.md` around lines 20 - 21, Add
documentation for the --format option used by the lark-cli drive +inspect
command: in the "注意事项" (notes) section of lark-drive-inspect.md, describe that
--format controls output formatting, list the supported values (e.g., pretty,
json, yaml or whatever options the command supports), and state the default
format when the flag is omitted; reference the example command "lark-cli drive
+inspect --url ... --format pretty" so readers know this flag is command-scoped
rather than global.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@skills/lark-drive/references/lark-drive-inspect.md`:
- Around line 20-21: Add documentation for the --format option used by the
lark-cli drive +inspect command: in the "注意事项" (notes) section of
lark-drive-inspect.md, describe that --format controls output formatting, list
the supported values (e.g., pretty, json, yaml or whatever options the command
supports), and state the default format when the flag is omitted; reference the
example command "lark-cli drive +inspect --url ... --format pretty" so readers
know this flag is command-scoped rather than global.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 561dc100-24af-4ef3-bfcb-159274b43e22

📥 Commits

Reviewing files that changed from the base of the PR and between f44cfb5 and 45193b9.

📒 Files selected for processing (3)
  • skill-template/domains/drive.md
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-inspect.md
✅ Files skipped from review due to trivial changes (2)
  • skills/lark-drive/SKILL.md
  • skill-template/domains/drive.md

@fangshuyu-768 fangshuyu-768 force-pushed the feat/drive-resolve-url branch 3 times, most recently from 4ba0de1 to f8a8949 Compare May 18, 2026 13:02
@github-actions github-actions Bot added size/XL Architecture-level or global-impact change and removed size/L Large or sensitive change across domains or core paths labels May 18, 2026
@fangshuyu-768 fangshuyu-768 force-pushed the feat/drive-resolve-url branch from f8a8949 to e8073af Compare May 18, 2026 13:03
@github-actions github-actions Bot added size/L Large or sensitive change across domains or core paths and removed size/XL Architecture-level or global-impact change labels May 18, 2026
@fangshuyu-768 fangshuyu-768 force-pushed the feat/drive-resolve-url branch 3 times, most recently from eae8768 to 79de33a Compare May 19, 2026 02:10
…iki unwrapping

Implements #662: `lark-cli drive +inspect --url <url>` inspects any
Lark/Feishu document URL to get its type, title, and canonical token,
with automatic wiki URL unwrapping via get_node API.

- Add ParseResourceURL (inverse of BuildResourceURL) in common
- Extract FetchDriveMetaTitle as public shared helper
- Add drive +inspect shortcut with wiki unwrapping support
- Add skill reference docs and update SKILL.md
- Dry-run E2E tests for docx URL, wiki URL, and bare token
@fangshuyu-768 fangshuyu-768 force-pushed the feat/drive-resolve-url branch from 79de33a to 201e805 Compare May 19, 2026 03:01
ParseResourceURL is a general-purpose URL parser that should not
hardcode domain lists — future Lark domains would silently break.
Move isLarkHost/larkHostSuffixes to drive_inspect.go where host
validation is a business decision of the +inspect command.
Add E2E test for non-Lark host with Lark-like path.
Lark supports custom enterprise domains, so a hardcoded suffix list
can never be exhaustive and would falsely reject valid URLs.
Path-based matching in ParseResourceURL is sufficient; invalid URLs
will fail naturally at the API call stage.
@wittam-01 wittam-01 self-requested a review May 19, 2026 07:18
@fangshuyu-768 fangshuyu-768 merged commit 4aa61db into main May 19, 2026
21 checks passed
@fangshuyu-768 fangshuyu-768 deleted the feat/drive-resolve-url branch May 19, 2026 07:19
@liangshuo-1 liangshuo-1 mentioned this pull request May 19, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants