@lsddream/platform-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +19 -0
- package/README.md +103 -0
- package/dist/chunk-2RAWITF3.js +134 -0
- package/dist/chunk-2RAWITF3.js.map +1 -0
- package/dist/chunk-3SORXO53.js +90 -0
- package/dist/chunk-3SORXO53.js.map +1 -0
- package/dist/cli.js +1255 -0
- package/dist/cli.js.map +1 -0
- package/dist/credentials-2BZZNZFE.js +16 -0
- package/dist/credentials-2BZZNZFE.js.map +1 -0
- package/dist/credentials-H3QSX2O6.js +15 -0
- package/dist/credentials-H3QSX2O6.js.map +1 -0
- package/dist/index.d.ts +133 -0
- package/dist/index.js +253 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/utils/errors.ts","../src/auth/session.ts","../src/api/client.ts","../src/api/cli-api.ts","../src/auth/browser-login.ts","../src/auth/pkce.ts","../src/utils/output.ts","../src/auth/device.ts","../src/utils/prompt.ts","../src/utils/platform.ts","../src/commands/auth.ts","../src/qwenpaw/workspace.ts","../src/utils/hash.ts","../src/commands/qwenpaw/agents.ts","../src/api/qwenpaw-api.ts","../src/commands/qwenpaw/remote.ts","../src/qwenpaw/sync.ts","../src/commands/qwenpaw/sync.ts","../src/commands/qwenpaw/index.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { CLI_VERSION } from \"./constants.js\";\nimport { resolveConfig, type GlobalOptions } from \"./config.js\";\nimport { registerAuthCommands } from \"./commands/auth.js\";\nimport { registerQwenpawCommands } from \"./commands/qwenpaw/index.js\";\nimport { AspError } from \"./utils/errors.js\";\nimport { printError } from \"./utils/output.js\";\n\nconst globalOpts: GlobalOptions = {};\n\nconst program = new Command()\n .name(\"asp\")\n .description(\"AgentScope Platform CLI\")\n .version(CLI_VERSION)\n .option(\"--platform-url <url>\", \"Custom Platform base URL (advanced)\")\n .option(\"--token <token>\", \"Access token (overrides stored credentials)\")\n .option(\"-v, --verbose\", \"Verbose logging\")\n .option(\"--json\", \"Output JSON\")\n .hook(\"preAction\", (thisCommand) => {\n const opts = thisCommand.opts();\n globalOpts.platformUrl = opts.platformUrl;\n globalOpts.token = opts.token;\n globalOpts.verbose = opts.verbose;\n globalOpts.json = opts.json;\n });\n\nconst getConfig = () => resolveConfig(globalOpts);\n\nregisterAuthCommands(program, getConfig);\nregisterQwenpawCommands(program, getConfig);\n\nasync function main(): Promise<void> {\n try {\n await program.parseAsync(process.argv);\n } catch (err) {\n if (err instanceof AspError) {\n printError(`${err.message} [${err.code}]`);\n if (err.hint) printError(`Hint: ${err.hint}`);\n if (err.requestId) printError(`Request ID: ${err.requestId}`);\n process.exit(err.exitCode);\n }\n if (err instanceof Error) {\n printError(err.message);\n if (globalOpts.verbose && err.stack) console.error(err.stack);\n process.exit(1);\n }\n throw err;\n }\n}\n\nmain();\n","export interface ApiErrorBody {\n request_id?: string;\n error: {\n code: string;\n message: string;\n hint?: string;\n };\n}\n\nexport class AspError extends Error {\n readonly code: string;\n readonly hint?: string;\n readonly requestId?: string;\n readonly statusCode?: number;\n readonly exitCode: number;\n\n constructor(\n message: string,\n options: {\n code?: string;\n hint?: string;\n requestId?: string;\n statusCode?: number;\n exitCode?: number;\n cause?: unknown;\n } = {},\n ) {\n super(message, { cause: options.cause });\n this.name = \"AspError\";\n this.code = options.code ?? \"UNKNOWN\";\n this.hint = options.hint;\n this.requestId = options.requestId;\n this.statusCode = options.statusCode;\n this.exitCode = options.exitCode ?? 1;\n }\n\n static fromResponse(status: number, body: unknown): AspError {\n const parsed = body as Partial<ApiErrorBody> & {\n error?: ApiErrorBody[\"error\"] & { detail?: string };\n };\n if (parsed?.error) {\n const exitCode = mapErrorCodeToExit(parsed.error.code, status);\n let hint = parsed.error.hint ?? parsed.error.detail;\n if (parsed.error.code === \"ASP.COMM.NOT_FOUND\") {\n hint =\n hint ??\n \"The API endpoint is not available on this Platform environment. Pre-release may not have /api/qwenpaw/v1 yet; try production `asp qwenpaw remote list` after `asp auth login`.\";\n }\n return new AspError(parsed.error.message, {\n code: parsed.error.code,\n hint,\n requestId: parsed.request_id,\n statusCode: status,\n exitCode,\n });\n }\n return new AspError(`HTTP ${status}`, {\n code: \"HTTP_ERROR\",\n statusCode: status,\n exitCode: status >= 500 ? 2 : 1,\n });\n }\n}\n\nfunction mapErrorCodeToExit(code: string, status: number): number {\n if (\n code === \"UNAUTHORIZED\" ||\n code === \"UNAUTHENTICATED\" ||\n code === \"ASP.AUTH.UNAUTHORIZED\" ||\n code === \"ASP.AUTH.SESSION_INVALID\" ||\n code === \"SESSION_INVALID\"\n ) {\n return 3;\n }\n if (code === \"FORBIDDEN\") return 4;\n if (status >= 500) return 2;\n return 1;\n}\n\nexport function maskSecrets(text: string): string {\n return text\n .replace(/Bearer\\s+[A-Za-z0-9._-]+/gi, \"Bearer [REDACTED]\")\n .replace(/\"access_token\"\\s*:\\s*\"[^\"]+\"/gi, '\"access_token\":\"[REDACTED]\"')\n .replace(/\"refresh_token\"\\s*:\\s*\"[^\"]+\"/gi, '\"refresh_token\":\"[REDACTED]\"')\n .replace(/\"token\"\\s*:\\s*\"[^\"]+\"/gi, '\"token\":\"[REDACTED]\"');\n}\n","import type { ResolvedConfig } from \"../config.js\";\nimport { CliApiClient, type TokenResponse } from \"../api/cli-api.js\";\nimport {\n credentialsFromTokenResponse,\n saveCredentials,\n type StoredCredentials,\n} from \"./credentials.js\";\nimport { AspError } from \"../utils/errors.js\";\n\nexport function isSessionInvalidError(err: unknown): boolean {\n if (!(err instanceof AspError)) return false;\n return err.code === \"ASP.AUTH.SESSION_INVALID\" || err.code === \"SESSION_INVALID\";\n}\n\nexport async function refreshStoredSession(\n config: ResolvedConfig,\n refreshToken: string,\n platformUrl: string,\n): Promise<StoredCredentials> {\n const client = new CliApiClient({\n ...config,\n token: undefined,\n platformUrl: platformUrl.replace(/\\/$/, \"\"),\n });\n const refreshed = await client.refresh(refreshToken);\n const creds = credentialsFromTokenResponse(platformUrl, refreshed);\n await saveCredentials(creds);\n return creds;\n}\n\n/** Login 返回的 access_token 在 pre 环境需先 refresh 才能访问 /me */\nexport async function finalizeLogin(\n config: ResolvedConfig,\n loginResponse: TokenResponse,\n): Promise<StoredCredentials> {\n if (!loginResponse.refresh_token) {\n const creds = credentialsFromTokenResponse(config.platformUrl, loginResponse);\n await saveCredentials(creds);\n return creds;\n }\n\n try {\n return await refreshStoredSession(\n config,\n loginResponse.refresh_token,\n config.platformUrl,\n );\n } catch {\n const creds = credentialsFromTokenResponse(config.platformUrl, loginResponse);\n await saveCredentials(creds);\n return creds;\n }\n}\n\nexport async function ensureValidSession(config: ResolvedConfig): Promise<StoredCredentials> {\n const { loadCredentials, isTokenExpired } = await import(\"./credentials.js\");\n const creds = await loadCredentials();\n if (!creds) {\n throw new AspError(\"Not logged in.\", {\n code: \"UNAUTHORIZED\",\n hint: \"Run `asp auth login`.\",\n exitCode: 3,\n });\n }\n\n if (!isTokenExpired(creds) && creds.access_token) {\n return creds;\n }\n\n if (!creds.refresh_token) {\n throw new AspError(\"Session expired.\", {\n code: \"ASP.AUTH.SESSION_INVALID\",\n hint: \"Run `asp auth login`.\",\n exitCode: 3,\n });\n }\n\n return refreshStoredSession(config, creds.refresh_token, creds.platform_url);\n}\n","import { AspError, maskSecrets } from \"../utils/errors.js\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport {\n loadCredentials,\n isTokenExpired,\n type StoredCredentials,\n} from \"../auth/credentials.js\";\nimport { refreshStoredSession, isSessionInvalidError } from \"../auth/session.js\";\n\nexport interface RequestOptions {\n method?: string;\n path: string;\n body?: unknown;\n headers?: Record<string, string>;\n auth?: boolean;\n prefix?: string;\n _retried?: boolean;\n}\n\nexport class HttpClient {\n constructor(private readonly config: ResolvedConfig) {}\n\n async request<T>(opts: RequestOptions): Promise<T> {\n try {\n return await this.doRequest<T>(opts);\n } catch (err) {\n if (\n opts.auth !== false &&\n !opts._retried &&\n isSessionInvalidError(err) &&\n !this.config.token\n ) {\n const creds = await loadCredentials();\n if (creds?.refresh_token) {\n await refreshStoredSession(configWithPlatform(this.config, creds), creds.refresh_token, creds.platform_url);\n return this.doRequest<T>({ ...opts, _retried: true });\n }\n }\n throw err;\n }\n }\n\n private async doRequest<T>(opts: RequestOptions): Promise<T> {\n const creds = opts.auth !== false && !this.config.token ? await loadCredentials() : null;\n const platformUrl = creds?.platform_url ?? this.config.platformUrl;\n const prefix = opts.prefix ?? \"\";\n const url = `${platformUrl}${prefix}${opts.path}`;\n const headers: Record<string, string> = {\n Accept: \"application/json\",\n ...opts.headers,\n };\n\n if (opts.body !== undefined) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n\n if (opts.auth !== false) {\n const token = await this.resolveAccessToken(creds);\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n }\n }\n\n if (this.config.verbose) {\n console.error(`[verbose] ${opts.method ?? \"GET\"} ${url}`);\n if (opts.body) console.error(maskSecrets(JSON.stringify(opts.body)));\n }\n\n const res = await fetch(url, {\n method: opts.method ?? \"GET\",\n headers,\n body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,\n });\n\n const text = await res.text();\n let data: unknown = {};\n if (text) {\n try {\n data = JSON.parse(text);\n } catch {\n data = { raw: text };\n }\n }\n\n if (this.config.verbose) {\n console.error(`[verbose] ${res.status}`, maskSecrets(text.slice(0, 2000)));\n }\n\n if (!res.ok) {\n throw AspError.fromResponse(res.status, data);\n }\n\n return data as T;\n }\n\n async resolveAccessToken(existing?: StoredCredentials | null): Promise<string | undefined> {\n if (this.config.token) return this.config.token;\n\n const creds = existing ?? (await loadCredentials());\n if (!creds) return undefined;\n\n if (isTokenExpired(creds) && creds.refresh_token) {\n const refreshed = await refreshStoredSession(\n configWithPlatform(this.config, creds),\n creds.refresh_token,\n creds.platform_url,\n );\n return refreshed.access_token;\n }\n\n return creds.access_token;\n }\n}\n\nfunction configWithPlatform(config: ResolvedConfig, creds: StoredCredentials): ResolvedConfig {\n return { ...config, platformUrl: creds.platform_url || config.platformUrl };\n}\n","import { CLI_API_PREFIX } from \"../constants.js\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport { HttpClient } from \"./client.js\";\n\nexport interface MetaResponse {\n request_id: string;\n service: string;\n api_version: string;\n platform_url: string;\n environment: string;\n min_cli_version: string;\n recommended_cli_version: string;\n features: Record<string, boolean>;\n}\n\nexport interface MeResponse {\n request_id: string;\n user_id?: string;\n account?: string;\n email?: string;\n username?: string;\n is_admin?: boolean;\n user?: {\n id: string;\n display_name?: string;\n email?: string;\n };\n qwenpaw_instance?: {\n id: string;\n status: string;\n cloud_url: string;\n };\n scopes?: string[];\n}\n\nexport interface TokenResponse {\n request_id: string;\n access_token: string;\n refresh_token?: string;\n token_type: string;\n expires_in?: number;\n scope?: string;\n user?: {\n id: string;\n display_name?: string;\n email?: string;\n };\n}\n\nexport interface DeviceCodeResponse {\n request_id: string;\n device_code: string;\n user_code: string;\n verification_uri: string;\n verification_uri_complete?: string;\n expires_in: number;\n interval?: number;\n}\n\nexport class CliApiClient {\n private readonly http: HttpClient;\n\n constructor(config: ResolvedConfig) {\n this.http = new HttpClient(config);\n }\n\n private req<T>(opts: Parameters<HttpClient[\"request\"]>[0]): Promise<T> {\n return this.http.request<T>({ ...opts, prefix: CLI_API_PREFIX });\n }\n\n getMeta(): Promise<MetaResponse> {\n return this.req({ path: \"/meta\", auth: false });\n }\n\n getMe(): Promise<MeResponse> {\n return this.req({ path: \"/me\" });\n }\n\n login(account: string, password: string): Promise<TokenResponse> {\n return this.req({\n method: \"POST\",\n path: \"/auth/login\",\n auth: false,\n body: { account, password },\n });\n }\n\n refresh(refreshToken: string): Promise<TokenResponse> {\n return this.req({\n method: \"POST\",\n path: \"/auth/refresh\",\n auth: false,\n body: { refresh_token: refreshToken },\n });\n }\n\n oauthToken(body: Record<string, string>): Promise<TokenResponse> {\n return this.req({ method: \"POST\", path: \"/oauth/token\", auth: false, body });\n }\n\n oauthDeviceCode(body: Record<string, string>): Promise<DeviceCodeResponse> {\n return this.req({ method: \"POST\", path: \"/oauth/device/code\", auth: false, body });\n }\n\n oauthDeviceToken(body: Record<string, string>): Promise<TokenResponse> {\n return this.req({ method: \"POST\", path: \"/oauth/device/token\", auth: false, body });\n }\n\n oauthRevoke(token: string, tokenTypeHint = \"refresh_token\"): Promise<{ ok: boolean }> {\n return this.req<{ ok: boolean }>({\n method: \"POST\",\n path: \"/oauth/revoke\",\n body: { token, token_type_hint: tokenTypeHint },\n });\n }\n\n async logout(): Promise<{ ok: boolean }> {\n try {\n return await this.req<{ ok: boolean }>({ method: \"POST\", path: \"/auth/logout\" });\n } catch {\n return this.oauthRevoke(\"\", \"access_token\");\n }\n }\n}\n","import { createServer, type IncomingMessage, type ServerResponse } from \"node:http\";\nimport open from \"open\";\nimport { CLIENT_ID, DEFAULT_SCOPE } from \"../constants.js\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport { generatePkce } from \"./pkce.js\";\nimport { finalizeLogin } from \"./session.js\";\nimport { CliApiClient } from \"../api/cli-api.js\";\nimport { printInfo, printSuccess } from \"../utils/output.js\";\n\nconst LOGIN_TIMEOUT_MS = 300_000;\n\nexport async function browserPkceLogin(config: ResolvedConfig): Promise<void> {\n const pkce = generatePkce();\n const port = await pickPort();\n const redirectUri = `http://127.0.0.1:${port}/callback/${pkce.nonce}`;\n const loginUrl = new URL(`${config.platformUrl}/cli/login`);\n loginUrl.searchParams.set(\"client_id\", CLIENT_ID);\n loginUrl.searchParams.set(\"redirect_uri\", redirectUri);\n loginUrl.searchParams.set(\"response_type\", \"code\");\n loginUrl.searchParams.set(\"code_challenge\", pkce.codeChallenge);\n loginUrl.searchParams.set(\"code_challenge_method\", \"S256\");\n loginUrl.searchParams.set(\"state\", pkce.state);\n loginUrl.searchParams.set(\"scope\", DEFAULT_SCOPE);\n\n const code = await waitForCallback(port, pkce.nonce, pkce.state, loginUrl.toString());\n const client = new CliApiClient(config);\n const token = await client.oauthToken({\n grant_type: \"authorization_code\",\n client_id: CLIENT_ID,\n code,\n code_verifier: pkce.codeVerifier,\n redirect_uri: redirectUri,\n });\n\n await finalizeLogin(config, token);\n printSuccess(`Logged in as ${token.user?.email ?? token.user?.display_name ?? \"user\"}`);\n}\n\nasync function pickPort(): Promise<number> {\n return new Promise((resolve, reject) => {\n const server = createServer();\n server.listen(0, \"127.0.0.1\", () => {\n const addr = server.address();\n if (!addr || typeof addr === \"string\") {\n server.close();\n reject(new Error(\"Failed to bind callback port\"));\n return;\n }\n const port = addr.port;\n server.close(() => resolve(port));\n });\n server.on(\"error\", reject);\n });\n}\n\nfunction waitForCallback(\n port: number,\n nonce: string,\n expectedState: string,\n loginUrl: string,\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const server = createServer(async (req: IncomingMessage, res: ServerResponse) => {\n try {\n const url = new URL(req.url ?? \"/\", `http://127.0.0.1:${port}`);\n if (url.pathname !== `/callback/${nonce}`) {\n res.writeHead(404);\n res.end(\"Not found\");\n return;\n }\n const code = url.searchParams.get(\"code\");\n const state = url.searchParams.get(\"state\");\n if (!code || state !== expectedState) {\n res.writeHead(400);\n res.end(\"Invalid callback\");\n reject(new Error(\"Invalid OAuth callback: state mismatch or missing code\"));\n server.close();\n return;\n }\n res.writeHead(200, { \"Content-Type\": \"text/html; charset=utf-8\" });\n res.end(\"<html><body><h2>Login successful. You can close this window.</h2></body></html>\");\n server.close();\n resolve(code);\n } catch (err) {\n server.close();\n reject(err);\n }\n });\n\n server.listen(port, \"127.0.0.1\", () => {\n printInfo(`Opening browser for login...`);\n void open(loginUrl).catch(() => {\n printInfo(`Open this URL manually: ${loginUrl}`);\n });\n });\n\n setTimeout(() => {\n server.close();\n reject(new Error(\"Login timed out\"));\n }, LOGIN_TIMEOUT_MS);\n });\n}\n","import { randomBytes, createHash } from \"node:crypto\";\n\nexport interface PkcePair {\n codeVerifier: string;\n codeChallenge: string;\n state: string;\n nonce: string;\n}\n\nfunction base64Url(buf: Buffer): string {\n return buf.toString(\"base64url\");\n}\n\nexport function generatePkce(): PkcePair {\n const codeVerifier = base64Url(randomBytes(32));\n const codeChallenge = base64Url(createHash(\"sha256\").update(codeVerifier).digest());\n const state = `state_${base64Url(randomBytes(16))}`;\n const nonce = `nonce_${base64Url(randomBytes(16))}`;\n return { codeVerifier, codeChallenge, state, nonce };\n}\n","import chalk from \"chalk\";\n\nexport function printJson(data: unknown): void {\n console.log(JSON.stringify(data, null, 2));\n}\n\nexport function printSuccess(message: string): void {\n console.log(chalk.green(\"✓\"), message);\n}\n\nexport function printInfo(message: string): void {\n console.log(chalk.blue(\"ℹ\"), message);\n}\n\nexport function printWarn(message: string): void {\n console.log(chalk.yellow(\"⚠\"), message);\n}\n\nexport function printError(message: string): void {\n console.error(chalk.red(\"✗\"), message);\n}\n\nexport function printTable(headers: string[], rows: string[][]): void {\n const widths = headers.map((h, i) =>\n Math.max(h.length, ...rows.map((r) => (r[i] ?? \"\").length)),\n );\n const headerLine = headers.map((h, i) => h.padEnd(widths[i])).join(\" \");\n console.log(chalk.bold(headerLine));\n for (const row of rows) {\n console.log(row.map((c, i) => (c ?? \"\").padEnd(widths[i])).join(\" \"));\n }\n}\n\nexport function formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n","import open from \"open\";\nimport { CLIENT_ID, DEFAULT_SCOPE } from \"../constants.js\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport { CliApiClient } from \"../api/cli-api.js\";\nimport { finalizeLogin } from \"./session.js\";\nimport { printInfo, printSuccess } from \"../utils/output.js\";\n\nexport async function deviceCodeLogin(config: ResolvedConfig): Promise<void> {\n const client = new CliApiClient(config);\n const device = await client.oauthDeviceCode({\n client_id: CLIENT_ID,\n scope: DEFAULT_SCOPE,\n });\n\n printInfo(`Visit: ${device.verification_uri_complete ?? device.verification_uri}`);\n printInfo(`Enter code: ${device.user_code}`);\n await open(device.verification_uri_complete ?? device.verification_uri).catch(() => {});\n\n const interval = (device.interval ?? 5) * 1000;\n const deadline = Date.now() + device.expires_in * 1000;\n\n while (Date.now() < deadline) {\n await sleep(interval);\n try {\n const token = await client.oauthDeviceToken({\n grant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n client_id: CLIENT_ID,\n device_code: device.device_code,\n });\n await finalizeLogin(config, token);\n printSuccess(`Logged in as ${token.user?.email ?? token.user?.display_name ?? \"user\"}`);\n return;\n } catch (err) {\n const code = (err as { code?: string }).code;\n if (code === \"AUTHORIZATION_PENDING\" || code === \"SLOW_DOWN\") continue;\n throw err;\n }\n }\n throw new Error(\"Device code login timed out\");\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((r) => setTimeout(r, ms));\n}\n","import { createInterface } from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\n\nexport async function promptLine(message: string): Promise<string> {\n const rl = createInterface({ input, output });\n try {\n const value = (await rl.question(message)).trim();\n if (!value) {\n throw new Error(\"Input is required.\");\n }\n return value;\n } finally {\n rl.close();\n }\n}\n\nexport async function promptPassword(message = \"Password: \"): Promise<string> {\n return new Promise((resolve, reject) => {\n const stdin = process.stdin;\n const wasRaw = stdin.isRaw;\n const wasPaused = stdin.isPaused();\n\n if (!stdin.isTTY) {\n reject(new Error(\"Password prompt requires an interactive terminal.\"));\n return;\n }\n\n output.write(message);\n\n stdin.setRawMode(true);\n stdin.resume();\n stdin.setEncoding(\"utf8\");\n\n let password = \"\";\n\n const cleanup = (): void => {\n stdin.removeListener(\"data\", onData);\n stdin.setRawMode(wasRaw ?? false);\n if (wasPaused) stdin.pause();\n else stdin.resume();\n };\n\n const onData = (char: string): void => {\n switch (char) {\n case \"\\n\":\n case \"\\r\":\n case \"\\u0004\":\n cleanup();\n output.write(\"\\n\");\n if (!password) {\n reject(new Error(\"Password is required.\"));\n return;\n }\n resolve(password);\n break;\n case \"\\u0003\":\n cleanup();\n output.write(\"\\n\");\n reject(new Error(\"Login cancelled.\"));\n break;\n case \"\\u007f\":\n case \"\\b\":\n if (password.length > 0) {\n password = password.slice(0, -1);\n output.write(\"\\b \\b\");\n }\n break;\n default:\n if (char < \" \" && char !== \"\\t\") return;\n password += char;\n output.write(\"*\");\n break;\n }\n };\n\n stdin.on(\"data\", onData);\n });\n}\n\nexport async function promptCredentials(options: {\n account?: string;\n password?: string;\n}): Promise<{ account: string; password: string }> {\n const account = options.account ?? (await promptLine(\"Email: \"));\n const password = options.password ?? (await promptPassword());\n return { account, password };\n}\n","import { PROD_PLATFORM_URL, PRE_PLATFORM_URL } from \"../constants.js\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport { loadCredentials, type StoredCredentials } from \"../auth/credentials.js\";\nimport { AspError } from \"./errors.js\";\n\nexport type PlatformEnv = \"prod\" | \"pre\" | \"custom\";\n\nexport type EnvTarget = { pre?: boolean; prod?: boolean };\n\nexport function detectPlatformEnv(url: string): PlatformEnv {\n const normalized = url.replace(/\\/$/, \"\");\n if (normalized === PROD_PLATFORM_URL) return \"prod\";\n if (normalized === PRE_PLATFORM_URL) return \"pre\";\n return \"custom\";\n}\n\nexport function formatPlatformLabel(url: string): string {\n const env = detectPlatformEnv(url);\n if (env === \"prod\") return `prod (${PROD_PLATFORM_URL})`;\n if (env === \"pre\") return `pre (${PRE_PLATFORM_URL})`;\n return url;\n}\n\nexport function withPlatformUrl(config: ResolvedConfig, platformUrl: string): ResolvedConfig {\n return { ...config, platformUrl: platformUrl.replace(/\\/$/, \"\") };\n}\n\n/** 无 -pre 后缀 → 生产;带 -pre 后缀 → 预发 */\nexport function resolveCommandPlatformUrl(\n config: ResolvedConfig,\n options: EnvTarget = {},\n): string {\n if (options.pre) return PRE_PLATFORM_URL;\n if (options.prod) return PROD_PLATFORM_URL;\n return config.platformUrl;\n}\n\nexport async function requireCredentials(\n config: ResolvedConfig,\n targetPlatformUrl: string,\n): Promise<{ config: ResolvedConfig; creds: StoredCredentials }> {\n if (config.token) {\n return {\n config: withPlatformUrl(config, targetPlatformUrl),\n creds: {\n access_token: config.token,\n token_type: \"Bearer\",\n platform_url: targetPlatformUrl,\n },\n };\n }\n\n const creds = await loadCredentials();\n if (!creds?.access_token) {\n const hint =\n detectPlatformEnv(targetPlatformUrl) === \"pre\"\n ? \"Run `asp auth login-pre`.\"\n : \"Run `asp auth login`.\";\n throw new AspError(\"Not logged in.\", {\n code: \"UNAUTHORIZED\",\n hint,\n exitCode: 3,\n });\n }\n\n const credsUrl = creds.platform_url.replace(/\\/$/, \"\");\n const targetUrl = targetPlatformUrl.replace(/\\/$/, \"\");\n if (credsUrl !== targetUrl) {\n const loggedIn = formatPlatformLabel(credsUrl);\n const target = formatPlatformLabel(targetUrl);\n const hint =\n detectPlatformEnv(targetUrl) === \"pre\"\n ? `You are logged in to ${loggedIn}. Run \\`asp auth login-pre\\` or use the matching -pre command.`\n : `You are logged in to ${loggedIn}. Run \\`asp auth login\\` or use production commands without -pre.`;\n throw new AspError(`Credential environment mismatch: logged in to ${loggedIn}, command targets ${target}.`, {\n code: \"ENV_MISMATCH\",\n hint,\n exitCode: 1,\n });\n }\n\n return {\n config: withPlatformUrl(config, targetUrl),\n creds,\n };\n}\n\nexport async function resolveAuthContext(\n getConfig: () => ResolvedConfig,\n options: EnvTarget = {},\n): Promise<{ config: ResolvedConfig; creds: StoredCredentials }> {\n const base = getConfig();\n const platformUrl = resolveCommandPlatformUrl(base, options);\n return requireCredentials(base, platformUrl);\n}\n","import type { Command } from \"commander\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport { PROD_PLATFORM_URL, PRE_PLATFORM_URL } from \"../constants.js\";\nimport { CliApiClient } from \"../api/cli-api.js\";\nimport { browserPkceLogin } from \"../auth/browser-login.js\";\nimport { deviceCodeLogin } from \"../auth/device.js\";\nimport {\n credentialsFromTokenResponse,\n loadCredentials,\n saveCredentials,\n clearCredentials,\n} from \"../auth/credentials.js\";\nimport { finalizeLogin, refreshStoredSession } from \"../auth/session.js\";\nimport { AspError } from \"../utils/errors.js\";\nimport { printJson, printSuccess, printInfo } from \"../utils/output.js\";\nimport { promptCredentials } from \"../utils/prompt.js\";\nimport {\n formatPlatformLabel,\n requireCredentials,\n resolveCommandPlatformUrl,\n type EnvTarget,\n withPlatformUrl,\n} from \"../utils/platform.js\";\n\ninterface LoginOptions {\n device?: boolean;\n browser?: boolean;\n token?: string;\n account?: string;\n password?: string;\n}\n\nconst LOGIN_OPTIONS: Array<[string, string]> = [\n [\"--device\", \"Use device code flow (headless)\"],\n [\"--browser\", \"Use browser PKCE login\"],\n [\"--token <token>\", \"Save and validate an existing access token\"],\n [\"--account <email>\", \"Account email (non-interactive)\"],\n [\"--password <password>\", \"Account password (non-interactive)\"],\n];\n\nasync function runLogin(config: ResolvedConfig, opts: LoginOptions): Promise<void> {\n const client = new CliApiClient(config);\n\n if (opts.token) {\n await saveTokenLogin(config, opts.token);\n return;\n }\n\n const meta = await client.getMeta().catch(() => null);\n\n if (opts.device) {\n if (meta?.features?.device_login === false) {\n throw new AspError(\"Device login is not enabled on this platform.\", {\n code: \"FEATURE_DISABLED\",\n hint: \"Use email/password login instead.\",\n });\n }\n await deviceCodeLogin(config);\n return;\n }\n\n if (opts.browser) {\n if (meta?.features?.browser_pkce_login === false) {\n throw new AspError(\"Browser PKCE login is not enabled on this platform.\", {\n code: \"FEATURE_DISABLED\",\n hint: \"Use email/password login instead.\",\n });\n }\n await browserPkceLogin(config);\n return;\n }\n\n const { account, password } = await promptCredentials({\n account: opts.account,\n password: opts.password,\n });\n\n const loginResponse = await client.login(account, password);\n await finalizeLogin(config, loginResponse);\n\n const me = await new CliApiClient(config).getMe();\n const display = me.user?.email ?? me.email ?? me.user?.display_name ?? me.account ?? account;\n printSuccess(`Logged in as ${display} (${formatPlatformLabel(config.platformUrl)})`);\n}\n\nasync function saveTokenLogin(config: ResolvedConfig, token: string): Promise<void> {\n const creds = credentialsFromTokenResponse(config.platformUrl, {\n access_token: token,\n token_type: \"Bearer\",\n });\n await saveCredentials(creds);\n const me = await new CliApiClient({ ...config, token }).getMe();\n const display =\n me.user?.email ?? me.email ?? me.user?.display_name ?? me.account ?? me.user_id;\n printSuccess(`Token saved. Logged in as ${display} (${formatPlatformLabel(config.platformUrl)})`);\n}\n\nfunction registerLoginCommand(\n auth: Command,\n getConfig: () => ResolvedConfig,\n name: string,\n description: string,\n platformUrl: string,\n): void {\n let cmd = auth.command(name).description(description);\n for (const [flags, desc] of LOGIN_OPTIONS) {\n cmd = cmd.option(flags, desc);\n }\n cmd.action(async (opts: LoginOptions) => {\n const config = withPlatformUrl(getConfig(), platformUrl);\n await runLogin(config, opts);\n });\n}\n\nasync function runStatus(getConfig: () => ResolvedConfig, env: EnvTarget): Promise<void> {\n const base = getConfig();\n const platformUrl = resolveCommandPlatformUrl(base, env);\n const creds = await loadCredentials();\n\n if (!base.token && !creds) {\n printInfo(\"Not logged in.\");\n printInfo(\" prod: `asp auth login`\");\n printInfo(\" pre: `asp auth login-pre`\");\n return;\n }\n\n const { config: apiConfig } = await requireCredentials(base, platformUrl);\n const client = new CliApiClient(apiConfig);\n const me = await client.getMe();\n const latestCreds = (await loadCredentials()) ?? creds;\n\n if (base.json) {\n printJson({\n logged_in: true,\n environment: formatPlatformLabel(platformUrl),\n user: me.user ?? {\n id: me.user_id,\n email: me.email,\n display_name: me.username ?? me.account,\n },\n qwenpaw_instance: me.qwenpaw_instance,\n scopes: me.scopes,\n expires_at: latestCreds?.expires_at,\n platform_url: platformUrl,\n });\n return;\n }\n\n const user = me.user ?? {\n id: me.user_id ?? \"\",\n email: me.email,\n display_name: me.username ?? me.account,\n };\n printInfo(`Environment: ${formatPlatformLabel(platformUrl)}`);\n printInfo(`User: ${user.display_name ?? user.email ?? user.id}`);\n if (user.email) printInfo(`Email: ${user.email}`);\n if (me.qwenpaw_instance) {\n printInfo(`QwenPaw instance: ${me.qwenpaw_instance.status} (${me.qwenpaw_instance.id})`);\n printInfo(`Cloud URL: ${me.qwenpaw_instance.cloud_url}`);\n }\n if (me.scopes?.length) printInfo(`Scopes: ${me.scopes.join(\", \")}`);\n if (latestCreds?.expires_at) printInfo(`Token expires: ${latestCreds.expires_at}`);\n}\n\nasync function runRefresh(getConfig: () => ResolvedConfig, env: EnvTarget): Promise<void> {\n const base = getConfig();\n const platformUrl = resolveCommandPlatformUrl(base, env);\n const { config, creds } = await requireCredentials(base, platformUrl);\n\n if (!creds.refresh_token) {\n throw new AspError(\"No refresh token available.\", {\n code: \"UNAUTHORIZED\",\n hint: env.pre ? \"Run `asp auth login-pre`.\" : \"Run `asp auth login`.\",\n exitCode: 3,\n });\n }\n\n await refreshStoredSession(config, creds.refresh_token, platformUrl);\n printSuccess(`Token refreshed (${formatPlatformLabel(platformUrl)}).`);\n}\n\nasync function runLogout(getConfig: () => ResolvedConfig, env: EnvTarget): Promise<void> {\n const base = getConfig();\n const platformUrl = resolveCommandPlatformUrl(base, env);\n const creds = await loadCredentials();\n\n if (!creds) {\n printInfo(`Not logged in to ${formatPlatformLabel(platformUrl)}.`);\n return;\n }\n\n const credsUrl = creds.platform_url.replace(/\\/$/, \"\");\n const targetUrl = platformUrl.replace(/\\/$/, \"\");\n\n if (credsUrl !== targetUrl) {\n throw new AspError(\n `Not logged in to ${formatPlatformLabel(targetUrl)}.`,\n {\n code: \"ENV_MISMATCH\",\n hint: env.pre\n ? `Current session is ${formatPlatformLabel(credsUrl)}. Use \\`asp auth logout-pre\\` after \\`asp auth login-pre\\`.`\n : `Current session is ${formatPlatformLabel(credsUrl)}. Use \\`asp auth logout-pre\\` for pre, or re-login with \\`asp auth login\\`.`,\n exitCode: 1,\n },\n );\n }\n\n if (creds.refresh_token) {\n const client = new CliApiClient({ ...base, platformUrl: targetUrl });\n await client.logout().catch(() => {});\n }\n await clearCredentials();\n printSuccess(`Logged out from ${formatPlatformLabel(platformUrl)}.`);\n}\n\nfunction registerEnvAuthCommand(\n auth: Command,\n getConfig: () => ResolvedConfig,\n baseName: string,\n description: string,\n env: EnvTarget,\n handler: (getConfig: () => ResolvedConfig, env: EnvTarget) => Promise<void>,\n): void {\n auth.command(baseName).description(description).action(async () => {\n await handler(getConfig, env);\n });\n}\n\nexport function registerAuthCommands(program: Command, getConfig: () => ResolvedConfig): void {\n const auth = program.command(\"auth\").description(\"Authentication commands\");\n\n registerLoginCommand(\n auth,\n getConfig,\n \"login\",\n `Log in to production (${PROD_PLATFORM_URL})`,\n PROD_PLATFORM_URL,\n );\n\n registerLoginCommand(\n auth,\n getConfig,\n \"login-pre\",\n `Log in to pre-release (${PRE_PLATFORM_URL})`,\n PRE_PLATFORM_URL,\n );\n\n registerEnvAuthCommand(\n auth,\n getConfig,\n \"status\",\n `Show login status (production, ${PROD_PLATFORM_URL})`,\n { prod: true },\n runStatus,\n );\n\n registerEnvAuthCommand(\n auth,\n getConfig,\n \"status-pre\",\n `Show login status (pre-release, ${PRE_PLATFORM_URL})`,\n { pre: true },\n runStatus,\n );\n\n registerEnvAuthCommand(\n auth,\n getConfig,\n \"refresh\",\n `Refresh access token (production, ${PROD_PLATFORM_URL})`,\n { prod: true },\n runRefresh,\n );\n\n registerEnvAuthCommand(\n auth,\n getConfig,\n \"refresh-pre\",\n `Refresh access token (pre-release, ${PRE_PLATFORM_URL})`,\n { pre: true },\n runRefresh,\n );\n\n registerEnvAuthCommand(\n auth,\n getConfig,\n \"logout\",\n `Log out from production (${PROD_PLATFORM_URL})`,\n { prod: true },\n runLogout,\n );\n\n registerEnvAuthCommand(\n auth,\n getConfig,\n \"logout-pre\",\n `Log out from pre-release (${PRE_PLATFORM_URL})`,\n { pre: true },\n runLogout,\n );\n}\n","import { readFile, access, readdir, stat } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { getQwenpawWorkspacesRoot } from \"../config.js\";\nimport { EXCLUDED_PATTERNS, SENSITIVE_REASONS, SYNC_DEFAULT_FILES } from \"../constants.js\";\nimport { fileStat, guessContentType, sha256File, toPosixPath } from \"../utils/hash.js\";\nimport type { FileDescriptor } from \"../api/qwenpaw-api.js\";\nimport { AspError } from \"../utils/errors.js\";\n\nexport function getAgentWorkspace(agentId: string): string {\n return join(getQwenpawWorkspacesRoot(), agentId);\n}\n\nexport async function listLocalAgentIds(): Promise<string[]> {\n const root = getQwenpawWorkspacesRoot();\n try {\n const entries = await readdir(root, { withFileTypes: true });\n return entries.filter((e) => e.isDirectory()).map((e) => e.name).sort();\n } catch {\n return [];\n }\n}\n\nexport async function ensureAgentWorkspace(agentId: string): Promise<string> {\n const ws = getAgentWorkspace(agentId);\n const root = getQwenpawWorkspacesRoot();\n\n try {\n await access(ws);\n return ws;\n } catch {\n const agents = await listLocalAgentIds();\n if (agents.length === 0) {\n throw new AspError(`Local QwenPaw workspace directory not found: ${root}`, {\n code: \"WORKSPACE_NOT_FOUND\",\n hint:\n \"Install and create a local QwenPaw agent first, or set QWENPAW_WORKSPACES_DIR to your workspaces path.\",\n });\n }\n throw new AspError(`Local agent '${agentId}' not found under ${root}`, {\n code: \"AGENT_NOT_FOUND\",\n hint: `Available agents: ${agents.join(\", \")}. Run \\`asp qwenpaw agents list\\`.`,\n });\n }\n}\n\nexport async function readAgentJson(agentId: string): Promise<{ id?: string; name?: string }> {\n const ws = await ensureAgentWorkspace(agentId);\n const raw = await readFile(join(ws, \"agent.json\"), \"utf8\");\n return JSON.parse(raw);\n}\n\nfunction isExcluded(relPath: string): string | null {\n const posix = toPosixPath(relPath);\n for (const pattern of EXCLUDED_PATTERNS) {\n if (posix === pattern.replace(/\\/$/, \"\") || posix.startsWith(pattern)) {\n return SENSITIVE_REASONS[pattern] ?? \"excluded\";\n }\n }\n return null;\n}\n\nasync function collectFilesRecursive(\n workspaceRoot: string,\n relDir: string,\n files: FileDescriptor[],\n excluded: Array<{ path: string; reason: string }>,\n): Promise<void> {\n const absDir = join(workspaceRoot, relDir);\n let entries;\n try {\n entries = await readdir(absDir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const rel = relDir ? `${relDir}/${entry.name}` : entry.name;\n const posix = toPosixPath(rel);\n const reason = isExcluded(posix);\n if (reason) {\n if (!excluded.some((e) => e.path === posix || posix.startsWith(`${e.path}/`))) {\n excluded.push({ path: posix.endsWith(\"/\") ? posix : `${posix}/`, reason });\n }\n continue;\n }\n if (entry.isDirectory()) {\n await collectFilesRecursive(workspaceRoot, rel, files, excluded);\n } else if (entry.isFile()) {\n const abs = join(workspaceRoot, rel);\n const sha256 = await sha256File(abs);\n const st = await fileStat(abs);\n files.push({\n path: posix,\n sha256,\n bytes: st.bytes,\n role: inferRole(posix),\n content_type: guessContentType(posix),\n mtime: st.mtime,\n });\n }\n }\n}\n\nfunction inferRole(path: string): string {\n if (path === \"agent.json\") return \"agent_config\";\n if (path.endsWith(\".md\") && [\"AGENTS.md\", \"SOUL.md\", \"PROFILE.md\", \"MEMORY.md\"].includes(path))\n return \"persona\";\n if (path === \"skill.json\" || path.startsWith(\"skills/\")) return \"skill\";\n if (path.startsWith(\"memory/\")) return \"memory\";\n if (path === \"jobs.json\") return \"jobs\";\n return \"user_file\";\n}\n\nexport interface SyncManifestOptions {\n includeJobs?: boolean;\n includeMemoryDir?: boolean;\n}\n\nexport interface SyncManifest {\n files: FileDescriptor[];\n excluded: Array<{ path: string; reason: string }>;\n}\n\nexport async function buildSyncManifest(\n agentId: string,\n options: SyncManifestOptions = {},\n): Promise<SyncManifest> {\n const ws = await ensureAgentWorkspace(agentId);\n const files: FileDescriptor[] = [];\n const excluded: Array<{ path: string; reason: string }> = [];\n\n for (const f of SYNC_DEFAULT_FILES) {\n const abs = join(ws, f);\n try {\n await stat(abs);\n const reason = isExcluded(f);\n if (reason) {\n excluded.push({ path: f, reason });\n continue;\n }\n const sha256 = await sha256File(abs);\n const st = await fileStat(abs);\n files.push({\n path: f,\n sha256,\n bytes: st.bytes,\n role: inferRole(f),\n content_type: guessContentType(f),\n mtime: st.mtime,\n });\n } catch {\n // optional file missing\n }\n }\n\n if (options.includeMemoryDir !== false) {\n await collectFilesRecursive(ws, \"skills\", files, excluded);\n await collectFilesRecursive(ws, \"memory\", files, excluded);\n }\n\n if (options.includeJobs) {\n const jobs = \"jobs.json\";\n try {\n await stat(join(ws, jobs));\n const sha256 = await sha256File(join(ws, jobs));\n const st = await fileStat(join(ws, jobs));\n files.push({\n path: jobs,\n sha256,\n bytes: st.bytes,\n role: \"jobs\",\n content_type: \"application/json\",\n mtime: st.mtime,\n });\n } catch {\n // optional\n }\n }\n\n const seen = new Set<string>();\n const deduped = files.filter((f) => {\n if (seen.has(f.path)) return false;\n seen.add(f.path);\n return true;\n });\n\n return { files: deduped, excluded };\n}\n","import { createHash } from \"node:crypto\";\nimport { createReadStream } from \"node:fs\";\nimport { stat } from \"node:fs/promises\";\nimport { hostname, userInfo } from \"node:os\";\nimport { basename, join, posix, relative, resolve } from \"node:path\";\n\nexport async function sha256File(filePath: string): Promise<string> {\n return new Promise((resolvePromise, reject) => {\n const hash = createHash(\"sha256\");\n const stream = createReadStream(filePath);\n stream.on(\"data\", (chunk) => hash.update(chunk));\n stream.on(\"end\", () => resolvePromise(hash.digest(\"hex\")));\n stream.on(\"error\", reject);\n });\n}\n\nexport function toPosixPath(p: string): string {\n return p.split(\"\\\\\").join(\"/\");\n}\n\nexport function guessContentType(filePath: string): string {\n const ext = basename(filePath).split(\".\").pop()?.toLowerCase();\n const map: Record<string, string> = {\n json: \"application/json\",\n md: \"text/markdown\",\n txt: \"text/plain\",\n csv: \"text/csv\",\n pdf: \"application/pdf\",\n zip: \"application/zip\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n };\n return map[ext ?? \"\"] ?? \"application/octet-stream\";\n}\n\nexport async function fileStat(filePath: string): Promise<{ bytes: number; mtime: string }> {\n const s = await stat(filePath);\n return {\n bytes: s.size,\n mtime: s.mtime.toISOString(),\n };\n}\n\nexport function remoteAgentId(localAgentId: string, custom?: string): string {\n if (custom) return custom;\n return `${localAgentId}_remote`;\n}\n\nexport function validateAgentId(agentId: string, allowRemoteSource = false): void {\n if (!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(agentId)) {\n throw new Error(`Invalid agent id: ${agentId}`);\n }\n if (!allowRemoteSource && agentId.endsWith(\"_remote\")) {\n throw new Error(\n `Agent id '${agentId}' ends with '_remote'. Use --allow-remote-source to override.`,\n );\n }\n}\n\nexport function getMachineLabel(): string {\n try {\n const user = userInfo().username;\n return `${user} ${hostname()}`;\n } catch {\n return \"unknown\";\n }\n}\n\nexport function normalizeWorkspacePath(workspaceRoot: string, inputPath: string): string {\n const abs = resolve(workspaceRoot, inputPath);\n const rel = relative(workspaceRoot, abs);\n if (rel.startsWith(\"..\") || rel === \"..\") {\n throw new Error(`Path is outside workspace: ${inputPath}`);\n }\n return toPosixPath(rel);\n}\n\nexport function joinPosix(...parts: string[]): string {\n return posix.join(...parts);\n}\n\nexport function joinPath(root: string, ...parts: string[]): string {\n return join(root, ...parts);\n}\n","import type { Command } from \"commander\";\nimport { getQwenpawWorkspacesRoot, type ResolvedConfig } from \"../../config.js\";\nimport { listLocalAgentIds } from \"../../qwenpaw/workspace.js\";\nimport { printInfo, printJson, printTable } from \"../../utils/output.js\";\n\nexport function registerAgentsCommands(\n qwenpaw: Command,\n getConfig: () => ResolvedConfig,\n): void {\n const agents = qwenpaw.command(\"agents\").description(\"Local QwenPaw agents\");\n\n agents\n .command(\"list\")\n .description(\"List local QwenPaw agent workspaces\")\n .action(async () => {\n const config = getConfig();\n const root = getQwenpawWorkspacesRoot();\n const ids = await listLocalAgentIds();\n\n if (config.json) {\n printJson({ workspaces_root: root, agents: ids });\n return;\n }\n\n printInfo(`Workspaces root: ${root}`);\n if (ids.length === 0) {\n printInfo(\"No local agents found.\");\n printInfo(\"Create an agent in QwenPaw first, or set QWENPAW_WORKSPACES_DIR.\");\n return;\n }\n\n printTable([\"AGENT ID\"], ids.map((id) => [id]));\n });\n}\n","import { QWENPAW_API_PREFIX } from \"../constants.js\";\nimport type { ResolvedConfig } from \"../config.js\";\nimport { HttpClient } from \"./client.js\";\n\nexport interface FileDescriptor {\n path: string;\n sha256: string;\n bytes: number;\n role: string;\n content_type?: string;\n mtime?: string;\n}\n\nexport interface RemoteAgent {\n remote_agent_id: string;\n remote_agent_name: string;\n local_agent_id?: string;\n status: string;\n cloud_url?: string;\n created_at?: string;\n latest_sync?: {\n sync_plan_id: string;\n status?: string;\n completed_at?: string;\n };\n}\n\nexport class QwenpawApiClient {\n private readonly http: HttpClient;\n\n constructor(config: ResolvedConfig) {\n this.http = new HttpClient(config);\n }\n\n private req<T>(opts: Parameters<HttpClient[\"request\"]>[0]): Promise<T> {\n return this.http.request<T>({ ...opts, prefix: QWENPAW_API_PREFIX });\n }\n\n listRemoteAgents(params: Record<string, string> = {}): Promise<{\n items: RemoteAgent[];\n next_cursor?: string | null;\n }> {\n const qs = new URLSearchParams(params).toString();\n return this.req({ path: `/remote-agents${qs ? `?${qs}` : \"\"}` });\n }\n\n createRemoteAgent(body: Record<string, unknown>): Promise<{ remote_agent: RemoteAgent }> {\n return this.req({\n method: \"POST\",\n path: \"/remote-agents\",\n body,\n });\n }\n}\n","import type { Command } from \"commander\";\nimport type { ResolvedConfig } from \"../../config.js\";\nimport { PROD_PLATFORM_URL, PRE_PLATFORM_URL } from \"../../constants.js\";\nimport { QwenpawApiClient } from \"../../api/qwenpaw-api.js\";\nimport { printJson, printInfo, printTable } from \"../../utils/output.js\";\nimport { formatPlatformLabel, resolveAuthContext } from \"../../utils/platform.js\";\n\ninterface ListOptions {\n query?: string;\n status?: string;\n pageSize: string;\n cursor?: string;\n}\n\nasync function runRemoteList(\n getConfig: () => ResolvedConfig,\n options: { pre?: boolean; prod?: boolean },\n opts: ListOptions,\n): Promise<void> {\n const { config } = await resolveAuthContext(getConfig, options);\n const api = new QwenpawApiClient(config);\n\n const params: Record<string, string> = { page_size: opts.pageSize };\n if (opts.query) params.q = opts.query;\n if (opts.status) params.status = opts.status;\n if (opts.cursor) params.cursor = opts.cursor;\n\n const res = await api.listRemoteAgents(params);\n\n if (config.json) {\n printJson({\n platform_url: config.platformUrl,\n environment: formatPlatformLabel(config.platformUrl),\n ...res,\n });\n return;\n }\n\n printInfo(`Environment: ${formatPlatformLabel(config.platformUrl)}`);\n\n if (res.items.length === 0) {\n printInfo(\"No remote agents found.\");\n return;\n }\n\n printTable(\n [\"REMOTE ID\", \"LOCAL ID\", \"STATUS\", \"UPDATED\"],\n res.items.map((a) => [\n a.remote_agent_id,\n a.local_agent_id ?? \"-\",\n a.status,\n a.latest_sync?.completed_at ?? a.created_at ?? \"-\",\n ]),\n );\n\n if (res.next_cursor) {\n const cmd = options.pre ? \"asp qwenpaw remote list-pre\" : \"asp qwenpaw remote list\";\n printInfo(`More results available. Use: ${cmd} --cursor ${res.next_cursor}`);\n }\n}\n\nfunction registerListCommand(\n remote: Command,\n getConfig: () => ResolvedConfig,\n name: string,\n description: string,\n env: { pre?: boolean; prod?: boolean },\n): void {\n remote\n .command(name)\n .description(description)\n .option(\"-q, --query <q>\", \"Search query\")\n .option(\"--status <status>\", \"Filter by status: creating|ready|syncing|error|archived\")\n .option(\"--page-size <n>\", \"Page size\", \"50\")\n .option(\"--cursor <cursor>\", \"Pagination cursor from previous response\")\n .action(async (opts: ListOptions) => {\n await runRemoteList(getConfig, env, opts);\n });\n}\n\nexport function registerRemoteCommands(\n qwenpaw: Command,\n getConfig: () => ResolvedConfig,\n): void {\n const remote = qwenpaw.command(\"remote\").description(\"Remote agent registry\");\n\n registerListCommand(\n remote,\n getConfig,\n \"list\",\n `List remote agents on production (${PROD_PLATFORM_URL})`,\n { prod: true },\n );\n\n registerListCommand(\n remote,\n getConfig,\n \"list-pre\",\n `List remote agents on pre-release (${PRE_PLATFORM_URL})`,\n { pre: true },\n );\n}\n","import type { ResolvedConfig } from \"../config.js\";\nimport { QwenpawApiClient } from \"../api/qwenpaw-api.js\";\nimport { getMachineLabel, remoteAgentId } from \"../utils/hash.js\";\nimport {\n buildSyncManifest,\n readAgentJson,\n type SyncManifest,\n} from \"./workspace.js\";\n\nexport async function ensureRemoteAgent(\n config: ResolvedConfig,\n localAgentId: string,\n customRemoteId?: string,\n): Promise<{ remoteAgentId: string; created: boolean }> {\n const api = new QwenpawApiClient(config);\n const rid = remoteAgentId(localAgentId, customRemoteId);\n const existing = await api.listRemoteAgents({ q: rid });\n const found = existing.items.find((a) => a.remote_agent_id === rid);\n if (found) {\n return { remoteAgentId: rid, created: false };\n }\n\n const agent = await readAgentJson(localAgentId).catch(() => ({ name: undefined as string | undefined }));\n const agentName = agent.name ?? localAgentId;\n await api.createRemoteAgent({\n local_agent_id: localAgentId,\n local_agent_name: agentName,\n remote_agent_id: rid,\n remote_agent_name: `${agentName}_remote`,\n source: {\n kind: \"local_qwenpaw\",\n qwenpaw_version: process.env.QWENPAW_VERSION ?? \"unknown\",\n machine_label: getMachineLabel(),\n },\n create_if_missing: true,\n update_if_exists: false,\n });\n return { remoteAgentId: rid, created: true };\n}\n\nexport async function runSyncAgent(\n config: ResolvedConfig,\n localAgentId: string,\n options: {\n dryRun?: boolean;\n includeJobs?: boolean;\n includeMemoryDir?: boolean;\n remoteId?: string;\n } = {},\n): Promise<{ manifest: SyncManifest; remoteAgentId?: string; created?: boolean }> {\n const manifest = await buildSyncManifest(localAgentId, {\n includeJobs: options.includeJobs,\n includeMemoryDir: options.includeMemoryDir,\n });\n\n if (options.dryRun) {\n return { manifest };\n }\n\n const { remoteAgentId: rid, created } = await ensureRemoteAgent(\n config,\n localAgentId,\n options.remoteId,\n );\n return { manifest, remoteAgentId: rid, created };\n}\n","import type { Command } from \"commander\";\nimport type { ResolvedConfig } from \"../../config.js\";\nimport { PROD_PLATFORM_URL, PRE_PLATFORM_URL } from \"../../constants.js\";\nimport { runSyncAgent } from \"../../qwenpaw/sync.js\";\nimport { validateAgentId } from \"../../utils/hash.js\";\nimport { printJson, printInfo, printSuccess, formatBytes } from \"../../utils/output.js\";\nimport { formatPlatformLabel, resolveAuthContext } from \"../../utils/platform.js\";\n\ninterface SyncAgentOptions {\n dryRun?: boolean;\n remoteId?: string;\n includeJobs?: boolean;\n memoryDir?: boolean;\n allowRemoteSource?: boolean;\n}\n\nasync function runSyncAgentCommand(\n getConfig: () => ResolvedConfig,\n agentId: string,\n env: { pre?: boolean; prod?: boolean },\n opts: SyncAgentOptions,\n): Promise<void> {\n validateAgentId(agentId, opts.allowRemoteSource);\n\n const syncOptions = {\n dryRun: opts.dryRun,\n includeJobs: opts.includeJobs,\n includeMemoryDir: opts.memoryDir !== false,\n remoteId: opts.remoteId,\n };\n\n if (opts.dryRun) {\n const result = await runSyncAgent(getConfig(), agentId, syncOptions);\n printSyncResult(getConfig(), agentId, opts, result, null);\n return;\n }\n\n const { config } = await resolveAuthContext(getConfig, env);\n const result = await runSyncAgent(config, agentId, syncOptions);\n printSyncResult(config, agentId, opts, result, config.platformUrl);\n}\n\nfunction printSyncResult(\n config: ResolvedConfig,\n agentId: string,\n opts: SyncAgentOptions,\n result: Awaited<ReturnType<typeof runSyncAgent>>,\n platformUrl: string | null,\n): void {\n\n if (config.json) {\n printJson({\n agent_id: agentId,\n platform_url: platformUrl,\n environment: platformUrl ? formatPlatformLabel(platformUrl) : \"local\",\n dry_run: !!opts.dryRun,\n ...result,\n });\n return;\n }\n\n if (opts.dryRun) {\n printInfo(`Sync preview for agent: ${agentId} (local only, no upload)`);\n if (result.manifest.files.length > 0) {\n printInfo(\"\\nWill upload:\");\n for (const f of result.manifest.files) {\n console.log(` ${f.path} (${formatBytes(f.bytes)})`);\n }\n } else {\n printInfo(\"\\nNo files to upload.\");\n }\n if (result.manifest.excluded.length > 0) {\n printInfo(\"\\nExcluded:\");\n for (const e of result.manifest.excluded) {\n console.log(` ${e.path.padEnd(20)} ${e.reason}`);\n }\n }\n return;\n }\n\n printInfo(`Environment: ${formatPlatformLabel(platformUrl!)}`);\n const rid = result.remoteAgentId!;\n if (result.created) {\n printSuccess(`Created remote agent: ${rid}`);\n } else {\n printSuccess(`Remote agent already exists: ${rid}`);\n }\n}\n\nfunction registerSyncAgentCommand(\n sync: Command,\n getConfig: () => ResolvedConfig,\n name: string,\n description: string,\n env: { pre?: boolean; prod?: boolean },\n): void {\n sync\n .command(name)\n .description(description)\n .argument(\"<agent_id>\", \"Local QwenPaw agent id\")\n .option(\"--dry-run\", \"Preview files to sync without uploading\")\n .option(\"--remote-id <id>\", \"Custom remote agent id\")\n .option(\"--include-jobs\", \"Include jobs.json in sync manifest\")\n .option(\"--no-memory-dir\", \"Exclude memory/ directory from manifest\")\n .option(\"--allow-remote-source\", \"Allow agent ids ending with _remote\")\n .action(async (agentId: string, opts: SyncAgentOptions) => {\n await runSyncAgentCommand(getConfig, agentId, env, opts);\n });\n}\n\nexport function registerSyncCommands(\n qwenpaw: Command,\n getConfig: () => ResolvedConfig,\n): void {\n const sync = qwenpaw.command(\"sync\").description(\"Sync local agent to cloud\");\n\n registerSyncAgentCommand(\n sync,\n getConfig,\n \"agent\",\n `Sync agent to production remote (${PROD_PLATFORM_URL})`,\n { prod: true },\n );\n\n registerSyncAgentCommand(\n sync,\n getConfig,\n \"agent-pre\",\n `Sync agent to pre-release remote (${PRE_PLATFORM_URL})`,\n { pre: true },\n );\n}\n","import type { Command } from \"commander\";\nimport type { ResolvedConfig } from \"../../config.js\";\nimport { registerAgentsCommands } from \"./agents.js\";\nimport { registerRemoteCommands } from \"./remote.js\";\nimport { registerSyncCommands } from \"./sync.js\";\n\nexport function registerQwenpawCommands(\n program: Command,\n getConfig: () => ResolvedConfig,\n): void {\n const qwenpaw = program.command(\"qwenpaw\").description(\"QwenPaw cloud sync commands\");\n registerAgentsCommands(qwenpaw, getConfig);\n registerRemoteCommands(qwenpaw, getConfig);\n registerSyncCommands(qwenpaw, getConfig);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;;;ACSjB,IAAM,WAAN,MAAM,kBAAiB,MAAM;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EA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eAAe,IAAI,SAAS,EAAE;AAC5D,cAAQ,KAAK,IAAI,QAAQ;AAAA,IAC3B;AACA,QAAI,eAAe,OAAO;AACxB,iBAAW,IAAI,OAAO;AACtB,UAAI,WAAW,WAAW,IAAI,MAAO,SAAQ,MAAM,IAAI,KAAK;AAC5D,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,UAAM;AAAA,EACR;AACF;AAEA,KAAK;","names":["resolve","open","open","resolve","getConfig","getConfig","program","stat","join","createHash","join","posix","stat","getConfig","getConfig","getConfig","result","program","getConfig"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
clearCredentials,
|
|
4
|
+
credentialsFromTokenResponse,
|
|
5
|
+
isTokenExpired,
|
|
6
|
+
loadCredentials,
|
|
7
|
+
saveCredentials
|
|
8
|
+
} from "./chunk-2RAWITF3.js";
|
|
9
|
+
export {
|
|
10
|
+
clearCredentials,
|
|
11
|
+
credentialsFromTokenResponse,
|
|
12
|
+
isTokenExpired,
|
|
13
|
+
loadCredentials,
|
|
14
|
+
saveCredentials
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=credentials-2BZZNZFE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearCredentials,
|
|
3
|
+
credentialsFromTokenResponse,
|
|
4
|
+
isTokenExpired,
|
|
5
|
+
loadCredentials,
|
|
6
|
+
saveCredentials
|
|
7
|
+
} from "./chunk-3SORXO53.js";
|
|
8
|
+
export {
|
|
9
|
+
clearCredentials,
|
|
10
|
+
credentialsFromTokenResponse,
|
|
11
|
+
isTokenExpired,
|
|
12
|
+
loadCredentials,
|
|
13
|
+
saveCredentials
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=credentials-H3QSX2O6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
declare const CLI_VERSION = "0.1.0";
|
|
2
|
+
declare const PROD_PLATFORM_URL = "https://platform.agentscope.io";
|
|
3
|
+
declare const PRE_PLATFORM_URL = "https://platform-pre.agentscope.io";
|
|
4
|
+
declare const DEFAULT_PLATFORM_URL = "https://platform.agentscope.io";
|
|
5
|
+
|
|
6
|
+
interface GlobalOptions {
|
|
7
|
+
platformUrl?: string;
|
|
8
|
+
token?: string;
|
|
9
|
+
verbose?: boolean;
|
|
10
|
+
json?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ResolvedConfig {
|
|
13
|
+
platformUrl: string;
|
|
14
|
+
token?: string;
|
|
15
|
+
verbose: boolean;
|
|
16
|
+
json: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare function resolveConfig(opts?: GlobalOptions): ResolvedConfig;
|
|
19
|
+
|
|
20
|
+
interface MetaResponse {
|
|
21
|
+
request_id: string;
|
|
22
|
+
service: string;
|
|
23
|
+
api_version: string;
|
|
24
|
+
platform_url: string;
|
|
25
|
+
environment: string;
|
|
26
|
+
min_cli_version: string;
|
|
27
|
+
recommended_cli_version: string;
|
|
28
|
+
features: Record<string, boolean>;
|
|
29
|
+
}
|
|
30
|
+
interface MeResponse {
|
|
31
|
+
request_id: string;
|
|
32
|
+
user_id?: string;
|
|
33
|
+
account?: string;
|
|
34
|
+
email?: string;
|
|
35
|
+
username?: string;
|
|
36
|
+
is_admin?: boolean;
|
|
37
|
+
user?: {
|
|
38
|
+
id: string;
|
|
39
|
+
display_name?: string;
|
|
40
|
+
email?: string;
|
|
41
|
+
};
|
|
42
|
+
qwenpaw_instance?: {
|
|
43
|
+
id: string;
|
|
44
|
+
status: string;
|
|
45
|
+
cloud_url: string;
|
|
46
|
+
};
|
|
47
|
+
scopes?: string[];
|
|
48
|
+
}
|
|
49
|
+
interface TokenResponse {
|
|
50
|
+
request_id: string;
|
|
51
|
+
access_token: string;
|
|
52
|
+
refresh_token?: string;
|
|
53
|
+
token_type: string;
|
|
54
|
+
expires_in?: number;
|
|
55
|
+
scope?: string;
|
|
56
|
+
user?: {
|
|
57
|
+
id: string;
|
|
58
|
+
display_name?: string;
|
|
59
|
+
email?: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
interface DeviceCodeResponse {
|
|
63
|
+
request_id: string;
|
|
64
|
+
device_code: string;
|
|
65
|
+
user_code: string;
|
|
66
|
+
verification_uri: string;
|
|
67
|
+
verification_uri_complete?: string;
|
|
68
|
+
expires_in: number;
|
|
69
|
+
interval?: number;
|
|
70
|
+
}
|
|
71
|
+
declare class CliApiClient {
|
|
72
|
+
private readonly http;
|
|
73
|
+
constructor(config: ResolvedConfig);
|
|
74
|
+
private req;
|
|
75
|
+
getMeta(): Promise<MetaResponse>;
|
|
76
|
+
getMe(): Promise<MeResponse>;
|
|
77
|
+
login(account: string, password: string): Promise<TokenResponse>;
|
|
78
|
+
refresh(refreshToken: string): Promise<TokenResponse>;
|
|
79
|
+
oauthToken(body: Record<string, string>): Promise<TokenResponse>;
|
|
80
|
+
oauthDeviceCode(body: Record<string, string>): Promise<DeviceCodeResponse>;
|
|
81
|
+
oauthDeviceToken(body: Record<string, string>): Promise<TokenResponse>;
|
|
82
|
+
oauthRevoke(token: string, tokenTypeHint?: string): Promise<{
|
|
83
|
+
ok: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
logout(): Promise<{
|
|
86
|
+
ok: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface RemoteAgent {
|
|
91
|
+
remote_agent_id: string;
|
|
92
|
+
remote_agent_name: string;
|
|
93
|
+
local_agent_id?: string;
|
|
94
|
+
status: string;
|
|
95
|
+
cloud_url?: string;
|
|
96
|
+
created_at?: string;
|
|
97
|
+
latest_sync?: {
|
|
98
|
+
sync_plan_id: string;
|
|
99
|
+
status?: string;
|
|
100
|
+
completed_at?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
declare class QwenpawApiClient {
|
|
104
|
+
private readonly http;
|
|
105
|
+
constructor(config: ResolvedConfig);
|
|
106
|
+
private req;
|
|
107
|
+
listRemoteAgents(params?: Record<string, string>): Promise<{
|
|
108
|
+
items: RemoteAgent[];
|
|
109
|
+
next_cursor?: string | null;
|
|
110
|
+
}>;
|
|
111
|
+
createRemoteAgent(body: Record<string, unknown>): Promise<{
|
|
112
|
+
remote_agent: RemoteAgent;
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
declare class AspError extends Error {
|
|
117
|
+
readonly code: string;
|
|
118
|
+
readonly hint?: string;
|
|
119
|
+
readonly requestId?: string;
|
|
120
|
+
readonly statusCode?: number;
|
|
121
|
+
readonly exitCode: number;
|
|
122
|
+
constructor(message: string, options?: {
|
|
123
|
+
code?: string;
|
|
124
|
+
hint?: string;
|
|
125
|
+
requestId?: string;
|
|
126
|
+
statusCode?: number;
|
|
127
|
+
exitCode?: number;
|
|
128
|
+
cause?: unknown;
|
|
129
|
+
});
|
|
130
|
+
static fromResponse(status: number, body: unknown): AspError;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { AspError, CLI_VERSION, CliApiClient, DEFAULT_PLATFORM_URL, PRE_PLATFORM_URL, PROD_PLATFORM_URL, QwenpawApiClient, type ResolvedConfig, resolveConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLI_API_PREFIX,
|
|
3
|
+
CLI_VERSION,
|
|
4
|
+
DEFAULT_PLATFORM_URL,
|
|
5
|
+
PRE_PLATFORM_URL,
|
|
6
|
+
PROD_PLATFORM_URL,
|
|
7
|
+
QWENPAW_API_PREFIX,
|
|
8
|
+
credentialsFromTokenResponse,
|
|
9
|
+
isTokenExpired,
|
|
10
|
+
loadCredentials,
|
|
11
|
+
resolveConfig,
|
|
12
|
+
saveCredentials
|
|
13
|
+
} from "./chunk-3SORXO53.js";
|
|
14
|
+
|
|
15
|
+
// src/utils/errors.ts
|
|
16
|
+
var AspError = class _AspError extends Error {
|
|
17
|
+
code;
|
|
18
|
+
hint;
|
|
19
|
+
requestId;
|
|
20
|
+
statusCode;
|
|
21
|
+
exitCode;
|
|
22
|
+
constructor(message, options = {}) {
|
|
23
|
+
super(message, { cause: options.cause });
|
|
24
|
+
this.name = "AspError";
|
|
25
|
+
this.code = options.code ?? "UNKNOWN";
|
|
26
|
+
this.hint = options.hint;
|
|
27
|
+
this.requestId = options.requestId;
|
|
28
|
+
this.statusCode = options.statusCode;
|
|
29
|
+
this.exitCode = options.exitCode ?? 1;
|
|
30
|
+
}
|
|
31
|
+
static fromResponse(status, body) {
|
|
32
|
+
const parsed = body;
|
|
33
|
+
if (parsed?.error) {
|
|
34
|
+
const exitCode = mapErrorCodeToExit(parsed.error.code, status);
|
|
35
|
+
let hint = parsed.error.hint ?? parsed.error.detail;
|
|
36
|
+
if (parsed.error.code === "ASP.COMM.NOT_FOUND") {
|
|
37
|
+
hint = hint ?? "The API endpoint is not available on this Platform environment. Pre-release may not have /api/qwenpaw/v1 yet; try production `asp qwenpaw remote list` after `asp auth login`.";
|
|
38
|
+
}
|
|
39
|
+
return new _AspError(parsed.error.message, {
|
|
40
|
+
code: parsed.error.code,
|
|
41
|
+
hint,
|
|
42
|
+
requestId: parsed.request_id,
|
|
43
|
+
statusCode: status,
|
|
44
|
+
exitCode
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return new _AspError(`HTTP ${status}`, {
|
|
48
|
+
code: "HTTP_ERROR",
|
|
49
|
+
statusCode: status,
|
|
50
|
+
exitCode: status >= 500 ? 2 : 1
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
function mapErrorCodeToExit(code, status) {
|
|
55
|
+
if (code === "UNAUTHORIZED" || code === "UNAUTHENTICATED" || code === "ASP.AUTH.UNAUTHORIZED" || code === "ASP.AUTH.SESSION_INVALID" || code === "SESSION_INVALID") {
|
|
56
|
+
return 3;
|
|
57
|
+
}
|
|
58
|
+
if (code === "FORBIDDEN") return 4;
|
|
59
|
+
if (status >= 500) return 2;
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
function maskSecrets(text) {
|
|
63
|
+
return text.replace(/Bearer\s+[A-Za-z0-9._-]+/gi, "Bearer [REDACTED]").replace(/"access_token"\s*:\s*"[^"]+"/gi, '"access_token":"[REDACTED]"').replace(/"refresh_token"\s*:\s*"[^"]+"/gi, '"refresh_token":"[REDACTED]"').replace(/"token"\s*:\s*"[^"]+"/gi, '"token":"[REDACTED]"');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/auth/session.ts
|
|
67
|
+
function isSessionInvalidError(err) {
|
|
68
|
+
if (!(err instanceof AspError)) return false;
|
|
69
|
+
return err.code === "ASP.AUTH.SESSION_INVALID" || err.code === "SESSION_INVALID";
|
|
70
|
+
}
|
|
71
|
+
async function refreshStoredSession(config, refreshToken, platformUrl) {
|
|
72
|
+
const client = new CliApiClient({
|
|
73
|
+
...config,
|
|
74
|
+
token: void 0,
|
|
75
|
+
platformUrl: platformUrl.replace(/\/$/, "")
|
|
76
|
+
});
|
|
77
|
+
const refreshed = await client.refresh(refreshToken);
|
|
78
|
+
const creds = credentialsFromTokenResponse(platformUrl, refreshed);
|
|
79
|
+
await saveCredentials(creds);
|
|
80
|
+
return creds;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// src/api/client.ts
|
|
84
|
+
var HttpClient = class {
|
|
85
|
+
constructor(config) {
|
|
86
|
+
this.config = config;
|
|
87
|
+
}
|
|
88
|
+
config;
|
|
89
|
+
async request(opts) {
|
|
90
|
+
try {
|
|
91
|
+
return await this.doRequest(opts);
|
|
92
|
+
} catch (err) {
|
|
93
|
+
if (opts.auth !== false && !opts._retried && isSessionInvalidError(err) && !this.config.token) {
|
|
94
|
+
const creds = await loadCredentials();
|
|
95
|
+
if (creds?.refresh_token) {
|
|
96
|
+
await refreshStoredSession(configWithPlatform(this.config, creds), creds.refresh_token, creds.platform_url);
|
|
97
|
+
return this.doRequest({ ...opts, _retried: true });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async doRequest(opts) {
|
|
104
|
+
const creds = opts.auth !== false && !this.config.token ? await loadCredentials() : null;
|
|
105
|
+
const platformUrl = creds?.platform_url ?? this.config.platformUrl;
|
|
106
|
+
const prefix = opts.prefix ?? "";
|
|
107
|
+
const url = `${platformUrl}${prefix}${opts.path}`;
|
|
108
|
+
const headers = {
|
|
109
|
+
Accept: "application/json",
|
|
110
|
+
...opts.headers
|
|
111
|
+
};
|
|
112
|
+
if (opts.body !== void 0) {
|
|
113
|
+
headers["Content-Type"] = "application/json";
|
|
114
|
+
}
|
|
115
|
+
if (opts.auth !== false) {
|
|
116
|
+
const token = await this.resolveAccessToken(creds);
|
|
117
|
+
if (token) {
|
|
118
|
+
headers.Authorization = `Bearer ${token}`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (this.config.verbose) {
|
|
122
|
+
console.error(`[verbose] ${opts.method ?? "GET"} ${url}`);
|
|
123
|
+
if (opts.body) console.error(maskSecrets(JSON.stringify(opts.body)));
|
|
124
|
+
}
|
|
125
|
+
const res = await fetch(url, {
|
|
126
|
+
method: opts.method ?? "GET",
|
|
127
|
+
headers,
|
|
128
|
+
body: opts.body !== void 0 ? JSON.stringify(opts.body) : void 0
|
|
129
|
+
});
|
|
130
|
+
const text = await res.text();
|
|
131
|
+
let data = {};
|
|
132
|
+
if (text) {
|
|
133
|
+
try {
|
|
134
|
+
data = JSON.parse(text);
|
|
135
|
+
} catch {
|
|
136
|
+
data = { raw: text };
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (this.config.verbose) {
|
|
140
|
+
console.error(`[verbose] ${res.status}`, maskSecrets(text.slice(0, 2e3)));
|
|
141
|
+
}
|
|
142
|
+
if (!res.ok) {
|
|
143
|
+
throw AspError.fromResponse(res.status, data);
|
|
144
|
+
}
|
|
145
|
+
return data;
|
|
146
|
+
}
|
|
147
|
+
async resolveAccessToken(existing) {
|
|
148
|
+
if (this.config.token) return this.config.token;
|
|
149
|
+
const creds = existing ?? await loadCredentials();
|
|
150
|
+
if (!creds) return void 0;
|
|
151
|
+
if (isTokenExpired(creds) && creds.refresh_token) {
|
|
152
|
+
const refreshed = await refreshStoredSession(
|
|
153
|
+
configWithPlatform(this.config, creds),
|
|
154
|
+
creds.refresh_token,
|
|
155
|
+
creds.platform_url
|
|
156
|
+
);
|
|
157
|
+
return refreshed.access_token;
|
|
158
|
+
}
|
|
159
|
+
return creds.access_token;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
function configWithPlatform(config, creds) {
|
|
163
|
+
return { ...config, platformUrl: creds.platform_url || config.platformUrl };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/api/cli-api.ts
|
|
167
|
+
var CliApiClient = class {
|
|
168
|
+
http;
|
|
169
|
+
constructor(config) {
|
|
170
|
+
this.http = new HttpClient(config);
|
|
171
|
+
}
|
|
172
|
+
req(opts) {
|
|
173
|
+
return this.http.request({ ...opts, prefix: CLI_API_PREFIX });
|
|
174
|
+
}
|
|
175
|
+
getMeta() {
|
|
176
|
+
return this.req({ path: "/meta", auth: false });
|
|
177
|
+
}
|
|
178
|
+
getMe() {
|
|
179
|
+
return this.req({ path: "/me" });
|
|
180
|
+
}
|
|
181
|
+
login(account, password) {
|
|
182
|
+
return this.req({
|
|
183
|
+
method: "POST",
|
|
184
|
+
path: "/auth/login",
|
|
185
|
+
auth: false,
|
|
186
|
+
body: { account, password }
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
refresh(refreshToken) {
|
|
190
|
+
return this.req({
|
|
191
|
+
method: "POST",
|
|
192
|
+
path: "/auth/refresh",
|
|
193
|
+
auth: false,
|
|
194
|
+
body: { refresh_token: refreshToken }
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
oauthToken(body) {
|
|
198
|
+
return this.req({ method: "POST", path: "/oauth/token", auth: false, body });
|
|
199
|
+
}
|
|
200
|
+
oauthDeviceCode(body) {
|
|
201
|
+
return this.req({ method: "POST", path: "/oauth/device/code", auth: false, body });
|
|
202
|
+
}
|
|
203
|
+
oauthDeviceToken(body) {
|
|
204
|
+
return this.req({ method: "POST", path: "/oauth/device/token", auth: false, body });
|
|
205
|
+
}
|
|
206
|
+
oauthRevoke(token, tokenTypeHint = "refresh_token") {
|
|
207
|
+
return this.req({
|
|
208
|
+
method: "POST",
|
|
209
|
+
path: "/oauth/revoke",
|
|
210
|
+
body: { token, token_type_hint: tokenTypeHint }
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async logout() {
|
|
214
|
+
try {
|
|
215
|
+
return await this.req({ method: "POST", path: "/auth/logout" });
|
|
216
|
+
} catch {
|
|
217
|
+
return this.oauthRevoke("", "access_token");
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// src/api/qwenpaw-api.ts
|
|
223
|
+
var QwenpawApiClient = class {
|
|
224
|
+
http;
|
|
225
|
+
constructor(config) {
|
|
226
|
+
this.http = new HttpClient(config);
|
|
227
|
+
}
|
|
228
|
+
req(opts) {
|
|
229
|
+
return this.http.request({ ...opts, prefix: QWENPAW_API_PREFIX });
|
|
230
|
+
}
|
|
231
|
+
listRemoteAgents(params = {}) {
|
|
232
|
+
const qs = new URLSearchParams(params).toString();
|
|
233
|
+
return this.req({ path: `/remote-agents${qs ? `?${qs}` : ""}` });
|
|
234
|
+
}
|
|
235
|
+
createRemoteAgent(body) {
|
|
236
|
+
return this.req({
|
|
237
|
+
method: "POST",
|
|
238
|
+
path: "/remote-agents",
|
|
239
|
+
body
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
export {
|
|
244
|
+
AspError,
|
|
245
|
+
CLI_VERSION,
|
|
246
|
+
CliApiClient,
|
|
247
|
+
DEFAULT_PLATFORM_URL,
|
|
248
|
+
PRE_PLATFORM_URL,
|
|
249
|
+
PROD_PLATFORM_URL,
|
|
250
|
+
QwenpawApiClient,
|
|
251
|
+
resolveConfig
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=index.js.map
|