dsh-image-gen 0.6.10 → 0.7.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/lib/client.js +351 -43
- package/lib/client.js.map +1 -1
- package/lib/index.js +761 -1076
- package/lib/types/client/browser-image-utils.d.ts +9 -0
- package/lib/types/client/gallery-store.d.ts +4 -0
- package/lib/types/client/gallery-view.d.ts +32 -2
- package/lib/types/client/index.d.ts +9 -2
- package/lib/types/client/settings-write.d.ts +4 -0
- package/lib/types/client/tl/studio-tl-canvas.d.ts +7 -0
- package/lib/types/config.d.ts +7 -1
- package/lib/types/shared.d.ts +6 -0
- package/package.json +20 -20
- package/lib/types/client/canvas/canvas-bridge.d.ts +0 -10
- package/lib/types/client/canvas/canvas-model.d.ts +0 -129
- package/lib/types/client/canvas/canvas-nodes.d.ts +0 -23
- package/lib/types/client/canvas/canvas-store.d.ts +0 -29
- package/lib/types/client/canvas/canvas-style.d.ts +0 -1
- package/lib/types/client/canvas/canvas-view.d.ts +0 -8
- package/lib/types/client/canvas/rf-base-css.d.ts +0 -2
- package/lib/types/client/studio-chat-panel.d.ts +0 -23
- package/lib/types/client/tl/diagram-landing.d.ts +0 -75
- package/lib/types/client/tl/diagram-layout.d.ts +0 -76
- package/lib/types/client/tl/diagram-measure.d.ts +0 -40
- package/lib/types/diagram.d.ts +0 -42
- package/lib/types/studio-chat.d.ts +0 -48
package/lib/types/diagram.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* create_diagram: a structure-only tool whose results land on the workbench
|
|
3
|
-
* infinite canvas.
|
|
4
|
-
*
|
|
5
|
-
* The model outputs a declarative DSL (nodes + edges with local ids, never
|
|
6
|
-
* coordinates). The tool call succeeds immediately — exactly like image
|
|
7
|
-
* generation — and the diagram rides the same landing bus: an open canvas
|
|
8
|
-
* renders it at once, a closed one renders it the moment it opens. The canvas
|
|
9
|
-
* computes the layered layout, creates geo shapes, and binds every arrow to
|
|
10
|
-
* its endpoints so the user can drag nodes around with arrows following.
|
|
11
|
-
*/
|
|
12
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
13
|
-
import { type DiagramDirection, type DiagramEdgeSpec, type DiagramNodeSpec } from './shared.js';
|
|
14
|
-
/** Value returned by create_diagram and echoed into the tool-result schema. */
|
|
15
|
-
export interface CreateDiagramValue {
|
|
16
|
-
diagramId: string;
|
|
17
|
-
title: string;
|
|
18
|
-
direction: DiagramDirection;
|
|
19
|
-
nodeCount: number;
|
|
20
|
-
edgeCount: number;
|
|
21
|
-
}
|
|
22
|
-
/** Untrusted create_diagram arguments as they arrive from the model. */
|
|
23
|
-
export interface CreateDiagramArgs {
|
|
24
|
-
title?: unknown;
|
|
25
|
-
direction?: unknown;
|
|
26
|
-
nodes?: unknown;
|
|
27
|
-
edges?: unknown;
|
|
28
|
-
}
|
|
29
|
-
/** Register the create_diagram tool on a host context. */
|
|
30
|
-
export declare function registerDiagramTool(ctx: Context): void;
|
|
31
|
-
/**
|
|
32
|
-
* Validate untrusted create_diagram arguments into a DiagramSpec. Returns
|
|
33
|
-
* undefined for anything structurally unusable (no nodes, duplicate ids,
|
|
34
|
-
* edges pointing at unknown nodes, over the caps) — the tool then fails with
|
|
35
|
-
* an actionable message and the model can retry with a corrected diagram.
|
|
36
|
-
*/
|
|
37
|
-
export declare function diagramSpecFromArgs(args: CreateDiagramArgs): {
|
|
38
|
-
title?: string;
|
|
39
|
-
direction?: DiagramDirection;
|
|
40
|
-
nodes: DiagramNodeSpec[];
|
|
41
|
-
edges: DiagramEdgeSpec[];
|
|
42
|
-
} | undefined;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dedicated DSH agent session backing the workbench chat panel.
|
|
3
|
-
*
|
|
4
|
-
* The panel is a real DSH conversation driven from the plugin, not a parallel
|
|
5
|
-
* chat implementation: on first use the host creates an agent through
|
|
6
|
-
* ctx.agents.create (the same factory the sidebar uses), then archives the
|
|
7
|
-
* session through ctx.workspaceRegistry so it never appears in the sidebar
|
|
8
|
-
* history list while remaining fully usable. The plugin never calls
|
|
9
|
-
* sessions.open - archiving the selected session would clear the user's
|
|
10
|
-
* current selection - and drives turns purely through agent.followup().
|
|
11
|
-
*
|
|
12
|
-
* Session events are projected into a small lossless-enough StudioChatEvent
|
|
13
|
-
* feed (text turns, tool summaries, generated-image references) and served to
|
|
14
|
-
* the browser through CHAT_ROUTE. The browser pulls increments with
|
|
15
|
-
* ?since=<seq>; images land on the tldraw canvas from the browser side via
|
|
16
|
-
* the existing IMAGE_ROUTE + landing-queue path.
|
|
17
|
-
*/
|
|
18
|
-
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
19
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
20
|
-
import { type StudioChatEvent } from './shared.js';
|
|
21
|
-
/** Wire responses for CHAT_ROUTE. */
|
|
22
|
-
export interface StudioChatStateResponse {
|
|
23
|
-
ok: true;
|
|
24
|
-
latestSeq: number;
|
|
25
|
-
events: StudioChatEvent[];
|
|
26
|
-
/** Why the backing agent is missing, when creation failed; absent otherwise. */
|
|
27
|
-
unavailable?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface StudioChatSendResponse {
|
|
30
|
-
ok: true;
|
|
31
|
-
}
|
|
32
|
-
export interface StudioChatErrorResponse {
|
|
33
|
-
error: string;
|
|
34
|
-
}
|
|
35
|
-
export interface StudioChatDeps {
|
|
36
|
-
maxBodyBytes: number;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Install the studio chat: ensure the dedicated agent session, subscribe to
|
|
40
|
-
* its events, and return the CHAT_ROUTE handler plus a disposer. Creation
|
|
41
|
-
* failures never break the plugin load - the route reports the error and the
|
|
42
|
-
* panel shows it, so a host without agent services degrades visibly instead
|
|
43
|
-
* of fatally.
|
|
44
|
-
*/
|
|
45
|
-
export declare function createStudioChat(ctx: Context, deps: StudioChatDeps): {
|
|
46
|
-
serve: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
47
|
-
dispose(): void;
|
|
48
|
-
};
|