feat(lark-cli): Feishu approval submission via official lark-cli - #249
Open
an7tang wants to merge 1 commit into
Open
feat(lark-cli): Feishu approval submission via official lark-cli#249an7tang wants to merge 1 commit into
an7tang wants to merge 1 commit into
Conversation
Integrate larksuite/cli as a built-in harness capability (lark_cli) with a layered command policy (relaxed read / strict write whitelist / dynamic Risk-probe), device-code user login, in-conversation app provisioning, dry-run preview with confirmation gate and idempotent replay, plus the lark_approval_submit SOP card. Trusted-layer error messages redirect the model to the correct next action (auth scopes / auth qrcode cases).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds a built-in
lark_clicapability that submits Feishu (Lark) approval requests on behalf of the user through the official larksuite/cli, together with alark_approval_submitSOP card (search definition → assemble form → dry-run preview → user confirmation → real submission).Key design
app/lark_cli/policy.py): permissive reads, strict writes — registered read-only commands accept the CLI's native flags as-is; unregistered commands are adjudicated dynamically via the CLI's ownRisk:classification; write commands are limited to a strict whitelist; the rawapiescape hatch,--yes, and caller-supplieduuidare permanently blocked.config init, or--newto create an app on the spot); user login uses the multi-turn device-code flow.submission_digest); the trusted layer replays the confirmed content and injects--yesplus an idempotentuuid. Form structure is validated against the approval definition before preview.auth scopeslacking admin permissions,auth qrcodeunavailable, server-side form rejections, etc.) get deterministic corrective guidance appended by the trusted layer, preventing the model from misreading them as task failure.Testing
backend/tests/test_lark_cli.py(policy + end-to-end service tests against a fake CLI binary).