dsh-wtq-pool 1.0.2 → 1.0.4

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/lib/index.d.ts CHANGED
@@ -1,27 +1,23 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
+ import { IncomingMessage, ServerResponse } from "node:http";
2
3
  import { SettingsPathOp } from "@deepseek-ai/dsh-settings";
3
- //#region src/host.d.ts
4
+ //#region src/web-panel.d.ts
4
5
  /**
5
- * dsh-wtq-pool - the plugin's engine.
6
- *
7
- * Merges every WorkBuddy, Trae and Qoder desktop sign-in on this machine into
8
- * one model pool that fails over on its own:
9
- *
10
- * 1. discover every sign-in on this machine (read-only),
11
- * 2. serve each vendor edition from its own loopback OpenAI-compatible
12
- * endpoint,
13
- * 3. publish those endpoints as six providers,
14
- * 4. rotate to the next account whenever the upstream answers 429.
15
- *
16
- * This file is the engine, not the entry: `index.ts` owns the Cordis
17
- * activation and the provider registrations, and `pi-compat.ts` is the bridge
18
- * between the two. Everything below is written against that bridge.
6
+ * The slice of the host's web server this plugin mounts into.
19
7
  *
20
- * Upstream traffic uses the platform `fetch` rather than a host network bridge:
21
- * a bridged response is buffered into text, and a provider contract needs the
22
- * upstream SSE body relayed as it arrives. Nothing leaves this machine except
23
- * to the three vendors' own endpoints.
8
+ * Hand-written rather than imported from the host package for the same reason
9
+ * the entry's other seams are: the plugin compiles against the capability it
10
+ * uses, and a host that grows a field does not become a compile error here.
24
11
  */
12
+ interface WebServerSeam {
13
+ register(route: {
14
+ kind: 'exact' | 'prefix';
15
+ path: string;
16
+ handler: (req: IncomingMessage, res: ServerResponse) => unknown;
17
+ }): () => void;
18
+ }
19
+ //#endregion
20
+ //#region src/host.d.ts
25
21
  declare function onPanelInvoke(channel: any, payload: any): Promise<any>;
26
22
  declare function onLoad(): Promise<void>;
27
23
  declare function onUnload(): Promise<void>;
@@ -138,8 +134,7 @@ interface ClientContext {
138
134
  };
139
135
  effect(callback: () => unknown, label?: string): unknown;
140
136
  inject(names: string[], callback: (scoped: ClientContext) => unknown): unknown;
141
- on(name: string, listener: (...args: unknown[]) => void): (() => void) | undefined;
142
- off?(name: string, listener: (...args: unknown[]) => void): void;
137
+ on(name: string, listener: (...args: unknown[]) => void): () => void;
143
138
  get(name: string): unknown;
144
139
  emit(name: string, ...args: unknown[]): void;
145
140
  fiber?: {
@@ -150,6 +145,8 @@ interface ClientContext {
150
145
  };
151
146
  };
152
147
  };
148
+ /** Present once `webServer` is injected; the panel routes mount into it. */
149
+ webServer?: WebServerSeam;
153
150
  }
154
151
  /**
155
152
  * Activate the plugin.