feat: enhance logging capabilities and update query options in sdk-typescript

- Introduced a new logging system with adjustable log levels (debug, info, warn, error).
- Updated query options to include a logLevel parameter for controlling verbosity.
- Refactored existing code to utilize the new logging system for better error handling and debugging.
- Cleaned up unused code and improved the structure of the SDK.
This commit is contained in:
mingholy.lmh
2025-11-26 21:37:40 +08:00
parent 49dc84ac0e
commit 769a438fa4
16 changed files with 552 additions and 143 deletions

View File

@@ -2,14 +2,15 @@
"name": "@qwen-code/sdk-typescript",
"version": "0.1.0",
"description": "TypeScript SDK for programmatic access to qwen-code CLI",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.js"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
@@ -19,14 +20,16 @@
"LICENSE"
],
"scripts": {
"build": "tsc",
"build": "node scripts/build.js",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"lint": "eslint src test",
"lint:fix": "eslint src test --fix",
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist",
"prepublishOnly": "npm run clean && npm run build"
"prepublishOnly": "npm run clean && npm run build",
"prepack": "npm run build"
},
"keywords": [
"qwen",
@@ -49,20 +52,23 @@
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@vitest/coverage-v8": "^1.6.0",
"dts-bundle-generator": "^9.5.1",
"esbuild": "^0.25.12",
"eslint": "^8.57.0",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"vitest": "^1.6.0",
"zod": "^3.23.8"
},
"peerDependencies": {
"typescript": ">=5.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/qwen-ai/qwen-code.git",
"directory": "packages/sdk/typescript"
"url": "https://github.com/QwenLM/qwen-code.git",
"directory": "packages/sdk-typescript"
},
"bugs": {
"url": "https://github.com/qwen-ai/qwen-code/issues"
"url": "https://github.com/QwenLM/qwen-code/issues"
},
"homepage": "https://github.com/qwen-ai/qwen-code#readme"
"homepage": "https://qwenlm.github.io/qwen-code-docs/"
}