@particle-academy/agent-integrations 0.6.3 → 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.
@@ -0,0 +1,78 @@
1
+ import { T as ToolHost } from '../tool-host-CX3WFXgh.cjs';
2
+ import { B as Bridge } from '../types-Cq5u8MJ8.cjs';
3
+ import '../types-C2zdUpzn.cjs';
4
+
5
+ /**
6
+ * Transport-level JSON shapes. These intentionally mirror fancy-artboard's
7
+ * public `ArtBoardValue` but are defined LOCALLY so this bridge builds
8
+ * independently of the sibling package — they are plain JSON crossing the
9
+ * MCP wire, not the live component types. Keep them in sync with
10
+ * @particle-academy/fancy-artboard's public surface.
11
+ */
12
+ type Viewport = {
13
+ x: number;
14
+ y: number;
15
+ zoom: number;
16
+ };
17
+ type ArtPieceContent = {
18
+ kind: "image";
19
+ src: string;
20
+ alt?: string;
21
+ } | {
22
+ kind: "html";
23
+ html: string;
24
+ } | {
25
+ kind: "node";
26
+ };
27
+ type ArtPieceData = {
28
+ id: string;
29
+ label?: string;
30
+ width?: number;
31
+ height?: number;
32
+ content: ArtPieceContent;
33
+ pending?: boolean;
34
+ };
35
+ type ArtSectionData = {
36
+ id: string;
37
+ title: string;
38
+ subtitle?: string;
39
+ pieces: ArtPieceData[];
40
+ };
41
+ type ArtBoardValue = {
42
+ sections: ArtSectionData[];
43
+ };
44
+ /**
45
+ * State accessors / mutators the bridge needs from the host. The host owns
46
+ * artboard state (controlled props on fancy-artboard components); the bridge
47
+ * calls into these to read or change it.
48
+ */
49
+ type ArtboardBridgeAdapter = {
50
+ getValue: () => ArtBoardValue;
51
+ setValue: (next: ArtBoardValue | ((prev: ArtBoardValue) => ArtBoardValue)) => void;
52
+ getViewport: () => Viewport;
53
+ setViewport: (next: Viewport) => void;
54
+ getFocus: () => string | null;
55
+ setFocus: (id: string | null) => void;
56
+ /** Optional: agent presence cursor (for the visualizer). */
57
+ setAgentCursor?: (cursor: {
58
+ x: number;
59
+ y: number;
60
+ } | null) => void;
61
+ };
62
+ type ArtboardBridgeOptions = {
63
+ adapter: ArtboardBridgeAdapter;
64
+ /** Identity used when the agent stamps authorship / cursor. */
65
+ agent?: {
66
+ id: string;
67
+ name?: string;
68
+ color?: string;
69
+ };
70
+ };
71
+ /**
72
+ * registerArtboardBridge — wires a full MCP tool set against a fancy-artboard
73
+ * session controlled by the host. Returns a Bridge handle the host can dispose
74
+ * to tear everything down.
75
+ */
76
+ declare function registerArtboardBridge(host: ToolHost, options: ArtboardBridgeOptions): Bridge;
77
+
78
+ export { type ArtboardBridgeAdapter, type ArtboardBridgeOptions, registerArtboardBridge };
@@ -0,0 +1,78 @@
1
+ import { T as ToolHost } from '../tool-host-DldwGNqR.js';
2
+ import { B as Bridge } from '../types-DyaHnqNC.js';
3
+ import '../types-C2zdUpzn.js';
4
+
5
+ /**
6
+ * Transport-level JSON shapes. These intentionally mirror fancy-artboard's
7
+ * public `ArtBoardValue` but are defined LOCALLY so this bridge builds
8
+ * independently of the sibling package — they are plain JSON crossing the
9
+ * MCP wire, not the live component types. Keep them in sync with
10
+ * @particle-academy/fancy-artboard's public surface.
11
+ */
12
+ type Viewport = {
13
+ x: number;
14
+ y: number;
15
+ zoom: number;
16
+ };
17
+ type ArtPieceContent = {
18
+ kind: "image";
19
+ src: string;
20
+ alt?: string;
21
+ } | {
22
+ kind: "html";
23
+ html: string;
24
+ } | {
25
+ kind: "node";
26
+ };
27
+ type ArtPieceData = {
28
+ id: string;
29
+ label?: string;
30
+ width?: number;
31
+ height?: number;
32
+ content: ArtPieceContent;
33
+ pending?: boolean;
34
+ };
35
+ type ArtSectionData = {
36
+ id: string;
37
+ title: string;
38
+ subtitle?: string;
39
+ pieces: ArtPieceData[];
40
+ };
41
+ type ArtBoardValue = {
42
+ sections: ArtSectionData[];
43
+ };
44
+ /**
45
+ * State accessors / mutators the bridge needs from the host. The host owns
46
+ * artboard state (controlled props on fancy-artboard components); the bridge
47
+ * calls into these to read or change it.
48
+ */
49
+ type ArtboardBridgeAdapter = {
50
+ getValue: () => ArtBoardValue;
51
+ setValue: (next: ArtBoardValue | ((prev: ArtBoardValue) => ArtBoardValue)) => void;
52
+ getViewport: () => Viewport;
53
+ setViewport: (next: Viewport) => void;
54
+ getFocus: () => string | null;
55
+ setFocus: (id: string | null) => void;
56
+ /** Optional: agent presence cursor (for the visualizer). */
57
+ setAgentCursor?: (cursor: {
58
+ x: number;
59
+ y: number;
60
+ } | null) => void;
61
+ };
62
+ type ArtboardBridgeOptions = {
63
+ adapter: ArtboardBridgeAdapter;
64
+ /** Identity used when the agent stamps authorship / cursor. */
65
+ agent?: {
66
+ id: string;
67
+ name?: string;
68
+ color?: string;
69
+ };
70
+ };
71
+ /**
72
+ * registerArtboardBridge — wires a full MCP tool set against a fancy-artboard
73
+ * session controlled by the host. Returns a Bridge handle the host can dispose
74
+ * to tear everything down.
75
+ */
76
+ declare function registerArtboardBridge(host: ToolHost, options: ArtboardBridgeOptions): Bridge;
77
+
78
+ export { type ArtboardBridgeAdapter, type ArtboardBridgeOptions, registerArtboardBridge };