@huanlin/dsh-plugin-aigc-canvas 0.1.3 → 0.1.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.
@@ -4,10 +4,10 @@
4
4
  * outside the DSH monorepo's single cordis instance, so the upstream
5
5
  * `declare module 'cordis'` augmentations do not reach this Context — and
6
6
  * the npm cordis package does not declare the DSH-vendored runtime members
7
- * (`ctx.effect`, the httpServer/sessions/loader faces). The members below
7
+ * (`ctx.effect`, the webServer/sessions/loader faces). The members below
8
8
  * mirror the actual runtime shapes this plugin touches:
9
9
  *
10
- * - httpServer: @deepseek-ai/dsh-host-webserver
10
+ * - webServer: @deepseek-ai/dsh-host-webserver
11
11
  * - sessions: @deepseek-ai/dsh-session (host side)
12
12
  * - loader: @cordisjs/plugin-loader (entry options)
13
13
  * - invariants: @deepseek-ai/dsh-invariants
@@ -30,8 +30,8 @@ export interface AigcWebUpgradeRoute {
30
30
  path: string;
31
31
  handler: (req: IncomingMessage, socket: Duplex, head: Buffer) => void | Promise<void>;
32
32
  }
33
- /** The httpServer service face this plugin uses. */
34
- export interface AigcHttpServer {
33
+ /** The webServer service face this plugin uses. */
34
+ export interface AigcWebServer {
35
35
  register(route: AigcWebRoute): () => void;
36
36
  registerUpgrade(route: AigcWebUpgradeRoute): () => void;
37
37
  }
@@ -102,7 +102,7 @@ export interface AigcToolsService {
102
102
  }
103
103
  declare module 'cordis' {
104
104
  interface Context {
105
- httpServer: AigcHttpServer;
105
+ webServer: AigcWebServer;
106
106
  sessions: AigcSessionStore;
107
107
  agents: AigcAgentRegistry;
108
108
  loader: AigcLoader;
package/lib/index.js CHANGED
@@ -2741,7 +2741,7 @@ async function saveResponseToSession(content, ext, sessionId, cwd) {
2741
2741
  const name = "dsh-aigc-canvas";
2742
2742
  /** Services required before mounting. */
2743
2743
  const inject = [
2744
- "httpServer",
2744
+ "webServer",
2745
2745
  "sessions",
2746
2746
  "agents",
2747
2747
  "loader",
@@ -2957,7 +2957,7 @@ function apply(ctx, config) {
2957
2957
  }));
2958
2958
  };
2959
2959
  const api = buildApi(ctx, canvas, store, getResolved);
2960
- ctx.effect(() => ctx.httpServer.register({
2960
+ ctx.effect(() => ctx.webServer.register({
2961
2961
  kind: "prefix",
2962
2962
  path: "/aigc-canvas/api",
2963
2963
  handler: async (req, res) => {
@@ -2997,7 +2997,7 @@ function apply(ctx, config) {
2997
2997
  }
2998
2998
  }
2999
2999
  }), "dsh-aigc-canvas: /aigc-canvas/api routes");
3000
- ctx.effect(() => ctx.httpServer.register({
3000
+ ctx.effect(() => ctx.webServer.register({
3001
3001
  kind: "prefix",
3002
3002
  path: "/aigc-canvas/file",
3003
3003
  handler: async (req, res) => {
@@ -3038,7 +3038,7 @@ function apply(ctx, config) {
3038
3038
  }
3039
3039
  }), "dsh-aigc-canvas: /aigc-canvas/file media route");
3040
3040
  const wss = new WebSocketServer({ noServer: true });
3041
- ctx.effect(() => ctx.httpServer.registerUpgrade({
3041
+ ctx.effect(() => ctx.webServer.registerUpgrade({
3042
3042
  path: "/aigc-canvas/ws/canvas",
3043
3043
  handler: (req, socket, head) => {
3044
3044
  if (!fence(req)) {
package/lib/invariant.js CHANGED
@@ -7,7 +7,7 @@ const inject = ["invariants"];
7
7
  /**
8
8
  * No runtime invariant: the canvas owns no service state or event protocol
9
9
  * of its own beyond the registry's own assertions (uuid existence, kind
10
- * checks) — every route is mounted under the host's httpServer fence, the
10
+ * checks) — every route is mounted under the host's webServer fence, the
11
11
  * element table is exercised by the smoke spec, and the client view is a
12
12
  * pure projection of the host state.
13
13
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huanlin/dsh-plugin-aigc-canvas",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "DSH plugin: an infinite free canvas for the better-sidebar plus provider-agnostic generation. Exposes aigc_get_provider_info / aigc_http_request (endpoint + apiKey auto-attached) / aigc_provider_set_instructions / aigc_canvas_place / aigc_canvas_link / aigc_canvas_unlink / aigc_canvas_list_elements tools; generated files are placed at arbitrary canvas positions and can be double-clicked for prompt + params.",
5
5
  "type": "module",
6
6
  "license": "MIT",