mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
95eb07d04a
Move all credential handling out of commands into one place. authStage resolves the credential for the command's declared `auth` and bakes it into `ctx.client`, gating (throw) when missing; commands reach the network only through `ctx.client` and never touch tokens or baseUrl. - add Client (request/requestJson/uploadFile/mcp/console/url) wrapping the token + baseUrl; commands call it instead of self-resolving - run(config, flags) → run(ctx) + CommandContext; migrate all 45 commands - split domains: model = pure api-key (drop access-token fallback), console = config.json only (drop DASHSCOPE_ACCESS_TOKEN env) - consolidate env reads in loadConfig; CredentialSource = flag | env | config; priority flag > env > config - endpoints return paths (xxxPath) instead of full URLs; baseUrl owned by Client - auth status now uses describeAuth - video/download: auth "none" → "apiKey" (it needs the model API) - dedupe fetchModelList behind an injected console-call function - remove ensureApiKey/ensure-key.ts, prompt.ts + isInteractive, and the old resolveCredential/resolveConsoleGatewayCredential resolvers - tests: adapt auth.e2e to the new auth status shape; drop the DASHSCOPE_ACCESS_TOKEN branch from console-readiness gates
67 lines
1.6 KiB
JSON
67 lines
1.6 KiB
JSON
{
|
|
"name": "bailian-cli-runtime",
|
|
"version": "1.4.0",
|
|
"description": "Runtime framework for bailian-cli (createCli, registry, args, output, pipeline). See https://www.npmjs.com/package/bailian-cli for usage.",
|
|
"homepage": "https://bailian.console.aliyun.com/cli",
|
|
"bugs": {
|
|
"url": "https://github.com/modelstudioai/cli/issues"
|
|
},
|
|
"license": "Apache-2.0",
|
|
"author": "Aliyun Model Studio",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/modelstudioai/cli.git",
|
|
"directory": "packages/runtime"
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"type": "module",
|
|
"types": "./dist/index.d.mts",
|
|
"exports": {
|
|
".": {
|
|
"@bailian-cli/source": "./src/index.ts",
|
|
"default": "./dist/index.mjs"
|
|
},
|
|
"./package.json": "./package.json"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public",
|
|
"exports": {
|
|
".": "./dist/index.mjs",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"registry": "https://registry.npmjs.org/"
|
|
},
|
|
"scripts": {
|
|
"build": "vp pack",
|
|
"dev": "vp pack --watch",
|
|
"test": "vp test",
|
|
"check": "vp check"
|
|
},
|
|
"dependencies": {
|
|
"bailian-cli-core": "workspace:*",
|
|
"boxen": "catalog:",
|
|
"chalk": "catalog:",
|
|
"undici": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@clack/prompts": "^0.7.0",
|
|
"@types/node": "catalog:",
|
|
"@typescript/native-preview": "7.0.0-dev.20260328.1",
|
|
"ajv": "catalog:",
|
|
"typescript": "^6.0.2",
|
|
"vite-plus": "0.1.22",
|
|
"yaml": "catalog:"
|
|
},
|
|
"engines": {
|
|
"node": ">=22.12.0"
|
|
},
|
|
"inlinedDependencies": {
|
|
"ajv": "8.20.0",
|
|
"fast-deep-equal": "3.1.3",
|
|
"fast-uri": "3.1.2",
|
|
"json-schema-traverse": "1.0.0"
|
|
}
|
|
}
|