//#region types/deepseek-ai.d.ts /** * @deepseek-ai mock type declarations * * For local development and testing. * At runtime these are provided by the DSH host framework. */ declare module '@deepseek-ai/cordis' { export interface Context { webServer: { register(route: { kind: 'exact' | 'prefix'; path: string; handler: (req: any, res: any) => void; }): void; }; logger: { info(...args: any[]): void; warn(...args: any[]): void; error(...args: any[]): void; }; inject(names: string[], callback: (scope: any) => void): void; get(name: string, strict?: boolean): any; effect(callback: () => (() => void) | void, label?: string): () => void; connection: { fetch: { register(route: { path: string; methods: string[]; requestBody: 'buffered' | 'streaming'; fetch: (request: any) => Promise; }): () => void; }; rpc: { call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise; }; }; systemPrompt?: { context(contribution: { name: string; order: number; text: (context: any) => string; }): () => void; section(contribution: any): () => void; }; sessionController?: { prompt(request: any, signal?: AbortSignal): Promise; }; } } declare module '@deepseek-ai/dsh-host-webserver' { // empty } declare module '@deepseek-ai/dsh-client-runtime/client' { export interface ClientContext { slots: any; get(name: string, strict?: boolean): any; /** Cordis 生命周期:回调返回 disposer,插件卸载时调用。 */ effect(callback: () => (() => void) | void, label?: string): () => void; connection?: { rpc: { call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise; }; }; } } //#endregion //#region src/index.d.ts /** * 单包入口(Host 侧)。 * * 发布形态是**一个 npm 包同时提供两端**: * - `main` / `exports["."]` → 本文件(ESM,Host 插件) * - `exports["./client"]` → 客户端 bundle(CJS,自注册到 __ModuleLoader__) * - `dsh.bundle.patch` → cordis.patch.yml 里同时插入 host + client 两条 loader * - `dsh.client` → 声明浏览器半区(platform: web) * * 这样 `dsh plugin add dsh-webds-bridge` 一条命令即可同时激活两端,用户无需手改 patch。 * * 本文件在结构上**就是**原来 packages/dsh-host/src/index.ts 的移植, * 逻辑逐行保持不变,只是把路径型 import 改到 ./host/*。 */ /** Plugin name, follows Cordis plugin convention */ declare const name = "dsh-webds-bridge"; /** Injected dependencies */ declare const inject: readonly []; /** * Plugin apply function * @param ctx - Cordis context */ declare function apply(ctx: void 0): void; //# sourceMappingURL=index.d.ts.map //#endregion export { apply, inject, name }; //# sourceMappingURL=index.d.ts.map