/** * Copyright (c) 2018-2099, Chill Zhuang 庄骞 (bladejava@qq.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * @author Chill */ import { AxiosInstance } from "axios"; import type { TdcResponse } from "./types.js"; /** * 创建带嵌入式 API Key 的 axios 实例。 * 从 process.env.TQ_API_KEY 读 Key;无 Key 直接 throw(MCP 启动失败,Agent 用户能看到)。 * 从 process.env.TQ_API_BASE 读 gateway 地址(默认 http://localhost:9001)。 */ export declare function createTransport(): AxiosInstance; /** * 调用 /v1/** 数据面端点,自动解 TdcResponse 信封 + 错误翻译。 */ export declare function callDataPlane(client: AxiosInstance, path: string, params?: Record): Promise<{ data?: T; meta?: TdcResponse["meta"]; error?: { code: string; message: string; }; }>; /** * 调用 /portal/**, /admin/** 等走 R 信封的端点(本期不用,留接口给 P5-Agent-4)。 */ export declare function callBladeR(client: AxiosInstance, path: string, params?: Record): Promise<{ data?: T; error?: { code: string; message: string; }; }>;