feat: use description and command in affordance example schema#1126
Conversation
Affordance examples previously carried a title plus a structured input object mirroring the inputSchema. Replace that with a description plus a command string holding a ready-to-run lark-cli invocation, which is what an AI agent driving the CLI actually consumes. No affordance data exists in the registry yet, so this only reshapes the consuming AffordanceCase type and its tests; the data pipeline (registry-config.yaml -> gen-registry.py -> meta_data.json) forwards the new keys verbatim.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR refactors the ChangesAffordance Example Type Redesign
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@4727fe025ed59eec22f5b0077f9389ae0764c063🧩 Skill updatenpx skills add larksuite/cli#feat/affordance-example-command -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1126 +/- ##
=======================================
Coverage 68.22% 68.22%
=======================================
Files 617 617
Lines 57192 57192
=======================================
Hits 39017 39017
Misses 14945 14945
Partials 3230 3230 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…uite#1126) Affordance examples previously carried a title plus a structured input object mirroring the inputSchema. Replace that with a description plus a command string holding a ready-to-run lark-cli invocation, which is what an AI agent driving the CLI actually consumes. No affordance data exists in the registry yet, so this only reshapes the consuming AffordanceCase type and its tests; the data pipeline (registry-config.yaml -> gen-registry.py -> meta_data.json) forwards the new keys verbatim.
Summary
Affordance examples are the AI-facing usage snippets in an envelope's
_meta. They previously usedtitleplus a structuredinputobject mirroring the inputSchema. This reshapes each example todescriptionplus acommandstring holding a ready-to-run lark-cli invocation — what an agent driving the CLI actually consumes. The affordance type was only just introduced and has no data authored in the registry yet, so this is a pre-population contract change with no migration. (The internal authoring guide was updated in lockstep.)Changes
AffordanceCase.TitletoDescription(json:"title"->json:"description") and changeAffordanceCase.Input map[string]interface{}(json:"input") toCommand string(json:"command") ininternal/schema/types.gointernal/schema/assembler_test.goto the new keys, and add an assertion on theCommandvalueTest Plan
go test -race ./internal/schema/...passed (affected package)go build ./...passed;gofmt -landgo vet ./internal/schema/...cleanmake unit-test(full suite): hit an unrelated flaky crash inextension/transportunder parallel-race; that package has zero dependency oninternal/schema(go list -deps) and passes in isolation across repeated runscalendar.calendars.primaryin registry-config.yaml, rangen-registry.py calendar, copied the generatedmeta_data.json, and confirmedlark-cli schema calendar calendars primaryrenders_meta.affordance.examples[0] = {description, command};lark-cli calendar calendars primary --dry-runconfirmed the example command resolves toPOST /open-apis/calendar/v4/calendars/primaryRelated Issues
N/A
Summary by CodeRabbit