mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
e82898ad40
Address the two blockers the pre-publication OPSEC review raised against this subtree, and drop the in-repo demo provider that is not meant to ship. Remove the example provider: - delete agents/example (the offline demo backend and onboarding template) - migrate the cmd-layer tests onto a new catalog-type test fake (fakecat, registered beside the existing instance fakes), so the catalog-specific paths stay covered — unknown agent id, per-agent capability differences, declared send params, per-operation brand scoping - delete the example provider skill doc; retarget the remaining docs at base, using output captured from real `agents list` / `agents card` runs, and relabel the samples that can no longer be verified as structural examples Publication norms: - translate every user-facing string in the subtree to English (command help, flag usage, error messages, hints, meta.next labels), plus test messages and fixtures. Chinese now remains only in skills/**.md, the sanctioned convention, and in the test that asserts against those docs - drop the dangling internal design-doc section references that a public reader cannot resolve; public-standard RFC citations are kept - re-sync the quoted CLI output in the skill docs with the new messages Behavior changes carried in this commit: - run the capability gates before the --dry-run branch, so a preview is no longer a capability bypass: --answer / --file against an agent declaring input_required=false / file_input=false now report unsupported_capability under dry-run too, matching what a real send would answer. The --file confirmation gate stays after dry-run, which uploads nothing - raise the meta.next watch window from 30s to 90s. A typical backend task runs ~60s, so a 30s window made a caller re-issue --watch two or three times, and each new process restarted the poll backoff with no gap between calls — enough to self-hammer the backend into a rate limit Also trim the longest narrative comment blocks in the subtree.
24 lines
1.0 KiB
Go
24 lines
1.0 KiB
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package agents
|
|
|
|
// PageParams is the pagination request the framework hands every list hook. It
|
|
// is the Feishu-OpenAPI cursor model (page_token / page_size) reduced to the two
|
|
// fields a provider needs: an opaque cursor and a requested size. The framework
|
|
// fills it from the --page-token / --page-size flags before calling a list hook.
|
|
type PageParams struct {
|
|
Token string // opaque cursor from a prior response; "" = first page
|
|
Size int // requested page size; 0 = provider default
|
|
}
|
|
|
|
// PageInfo is what a list hook returns alongside the page's items. NextToken is
|
|
// the opaque cursor the caller echoes back (as PageParams.Token) to fetch the
|
|
// following page; an empty NextToken with HasMore=false marks the last page. The
|
|
// framework surfaces it as meta.has_more / meta.page_token and, when there is a
|
|
// next page, a ready-made "next page" next-action command.
|
|
type PageInfo struct {
|
|
NextToken string // opaque cursor for the next page; "" = last page
|
|
HasMore bool
|
|
}
|