mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
98acbd7341
Add a feature catalog (`packages/dsh/src/features.ts`) that drives two entry
points from one declaration: a model tool per feature (natural-language
entry) and a card-click webServer route (UI entry). Each feature declares
its `bl` argv, optional parameter flags, and a `summarize` projection, so
adding a capability means adding one catalog entry rather than wiring a
tool and a route separately.
New CLI commands backing the TokenPlan usage panel:
- `bl token-plan personal-usage` — 5h/1w usage percentage, subscription
state, and addon credits, unwrapping the console gateway's nested
`data.DataV2.data.data` envelope.
- `bl token-plan personal-key` — the masked personal-edition API key.
Both are `auth: "console"` and registered per the command checklist
(library export, `bl` product map, e2e topic routes, generated reference).
Two type fixes in the tool registration path:
- The parameter map was typed `Record<string, { type: string; ... }>`,
which widens `FeatureParam["type"]` to `string` and is then unassignable
to `ParameterSchemaSpec` (it needs the literal union). Keep the literal.
- `invokeFeature` returned `Promise<unknown>`, so the tool's `{ summary,
data }` value failed `Record<string, JsonValue>`. It parses
`bl --output json` output, so its return type is `JsonValue` — narrowing
the signature is more honest than casting at the call site.
Co-Authored-By: Claude <noreply@anthropic.com>
bailian-cli-core
Internal SDK for bailian-cli.
Not intended for direct use. For installation, usage, and documentation, see the CLI package:
- npm: https://www.npmjs.com/package/bailian-cli
- Homepage: https://bailian.console.aliyun.com/cli?source_channel=cli_github&
License
Apache-2.0