@particle-academy/agent-integrations 0.4.0 → 0.6.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.
Files changed (56) hide show
  1. package/README.md +45 -0
  2. package/dist/bridges-flow.js +340 -3
  3. package/dist/bridges-flow.js.map +1 -1
  4. package/dist/{chunk-E4AICMFZ.js → chunk-5XELJIJR.js} +3 -3
  5. package/dist/chunk-5XELJIJR.js.map +1 -0
  6. package/dist/{chunk-6LTKCNLF.js → chunk-AFUULW5E.js} +3 -34
  7. package/dist/chunk-AFUULW5E.js.map +1 -0
  8. package/dist/chunk-G6N2TQVO.js +34 -0
  9. package/dist/chunk-G6N2TQVO.js.map +1 -0
  10. package/dist/chunk-IJ6JX5VC.js +3 -0
  11. package/dist/chunk-IJ6JX5VC.js.map +1 -0
  12. package/dist/{chunk-JMYPUAFH.js → chunk-LVQXIUJH.js} +2 -2
  13. package/dist/{chunk-JMYPUAFH.js.map → chunk-LVQXIUJH.js.map} +1 -1
  14. package/dist/chunk-OIX2ANFS.js +386 -0
  15. package/dist/chunk-OIX2ANFS.js.map +1 -0
  16. package/dist/chunk-ZHAK2DQR.js +289 -0
  17. package/dist/chunk-ZHAK2DQR.js.map +1 -0
  18. package/dist/components/SharedWhiteboard/index.d.cts +55 -0
  19. package/dist/components/SharedWhiteboard/index.d.ts +55 -0
  20. package/dist/components-shared-whiteboard.cjs +1533 -0
  21. package/dist/components-shared-whiteboard.cjs.map +1 -0
  22. package/dist/components-shared-whiteboard.js +285 -0
  23. package/dist/components-shared-whiteboard.js.map +1 -0
  24. package/dist/index.cjs +249 -1287
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +4 -55
  27. package/dist/index.d.ts +4 -55
  28. package/dist/index.js +9 -563
  29. package/dist/index.js.map +1 -1
  30. package/dist/mcp.js +2 -1
  31. package/dist/relay-server/index.d.cts +134 -0
  32. package/dist/relay-server/index.d.ts +134 -0
  33. package/dist/relay-server-cli.cjs +483 -0
  34. package/dist/relay-server-cli.cjs.map +1 -0
  35. package/dist/relay-server-cli.js +98 -0
  36. package/dist/relay-server-cli.js.map +1 -0
  37. package/dist/relay-server.cjs +389 -0
  38. package/dist/relay-server.cjs.map +1 -0
  39. package/dist/relay-server.js +3 -0
  40. package/dist/relay-server.js.map +1 -0
  41. package/dist/sharing/index.d.cts +2 -34
  42. package/dist/sharing/index.d.ts +2 -34
  43. package/dist/sharing.js +2 -1
  44. package/dist/sheets-adapter.cjs +1 -1
  45. package/dist/sheets-adapter.cjs.map +1 -1
  46. package/dist/sheets-adapter.d.cts +11 -7
  47. package/dist/sheets-adapter.d.ts +11 -7
  48. package/dist/sheets-adapter.js +1 -1
  49. package/dist/token-CrJF76oH.d.cts +34 -0
  50. package/dist/token-CrJF76oH.d.ts +34 -0
  51. package/docs/relay-server.md +126 -0
  52. package/package.json +66 -7
  53. package/dist/chunk-6LTKCNLF.js.map +0 -1
  54. package/dist/chunk-E4AICMFZ.js.map +0 -1
  55. package/dist/chunk-N3H4DXY5.js +0 -342
  56. package/dist/chunk-N3H4DXY5.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -4,8 +4,6 @@ export { T as ToolHost, a as ToolRegistry } from './tool-host-BQuUygLF.cjs';
4
4
  export { InProcessTransport, RelayChannel, RelayTransport, attachInProcess, attachRelay } from './mcp/index.cjs';
5
5
  export { C as CallToolResult, d as ContentBlock, I as InitializeResult, c as JsonObject, J as JsonRpcMessage, e as JsonRpcNotification, f as JsonRpcRequest, g as JsonValue, M as MCP_PROTOCOL_VERSION, a as ServerCapabilities, S as ServerInfo, T as ToolDefinition, b as ToolHandler } from './types-aOQLTW0E.cjs';
6
6
  export { B as Bridge, a as BridgeFactory } from './types-CCSBGW9T.cjs';
7
- export { WhiteboardBridgeAdapter, WhiteboardBridgeOptions, registerWhiteboardBridge } from './bridges/whiteboard.cjs';
8
- export { FlowBridgeAdapter, FlowBridgeOptions, registerFlowBridge } from './bridges/flow.cjs';
9
7
  import { FormFieldDescriptor } from './bridges/forms.cjs';
10
8
  export { FormBridgeAdapter, FormBridgeOptions, registerFormBridge } from './bridges/forms.cjs';
11
9
  export { SheetsBridgeAdapter, SheetsBridgeOptions, registerSheetsBridge } from './bridges/sheets.cjs';
@@ -16,11 +14,11 @@ export { SceneBridgeAdapter, SceneBridgeOptions, SceneCamera, SceneObject, Scene
16
14
  export { ScreenSnapshot, ScreensBridgeAdapter, ScreensBridgeOptions, registerScreensBridge } from './bridges/screens.cjs';
17
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
18
16
  import { ReactNode, CSSProperties } from 'react';
19
- import { SessionDescriptor } from './sharing/index.cjs';
20
- export { RelayState, SseRelayOptions, SseRelayTransport, attachSseRelay, buildShareConfig, buildShareUrl, createSessionDescriptor, describeSession, readSessionFromUrl } from './sharing/index.cjs';
21
- import { StickyNoteItem, ShapeItem, ConnectorItem, Stroke, Viewport } from '@particle-academy/fancy-whiteboard';
17
+ import { S as SessionDescriptor } from './token-CrJF76oH.cjs';
18
+ export { b as buildShareConfig, a as buildShareUrl, c as createSessionDescriptor, d as describeSession, r as readSessionFromUrl } from './token-CrJF76oH.cjs';
22
19
  export { ActivityAgent, ActivityFilter, ActivityResolverContext, ActivityTargetResolver, ToolHandler as ActivityWrappedHandler, AgentActivityEvent, AgentActivityListener, AgentTarget, AgentTargetKind, emitActivity, onActivity, readActivityHistory, resetActivityRegistry, useAgentActivity, useAgentActivityForScreen, wrapToolWithActivity } from './presence/index.cjs';
23
20
  export { UndoEntry, UndoToolsOptions, clearStack as clearUndoStack, ensureUndoToolsRegistered, pushUndoEntry, readHistory as readUndoHistory, redoOne, registerUndoTools, resetAllUndoStacks, undoOne, useUndoStack } from './undo/index.cjs';
21
+ export { RelayState, SseRelayOptions, SseRelayTransport, attachSseRelay } from './sharing/index.cjs';
24
22
 
25
23
  type AgentActivity = {
26
24
  id: string;
@@ -199,53 +197,4 @@ type ShareControlsProps = {
199
197
  */
200
198
  declare function ShareControls({ session, onStart, onStop, status, shareBaseUrl, className, style, }: ShareControlsProps): react_jsx_runtime.JSX.Element;
201
199
 
202
- type SharedWhiteboardProps = {
203
- /** Initial board contents. */
204
- initialNotes?: StickyNoteItem[];
205
- initialShapes?: ShapeItem[];
206
- initialConnectors?: ConnectorItem[];
207
- initialStrokes?: Stroke[];
208
- initialViewport?: Viewport;
209
- /** Agent identity displayed in the panel + cursor. */
210
- agent?: {
211
- id: string;
212
- name?: string;
213
- color?: string;
214
- };
215
- /**
216
- * Where the relay HTTP endpoints live. The host app implements these (see
217
- * docs/relay-protocol.md). Pass `null` to disable sharing — the board
218
- * still works locally with the in-process MCP server.
219
- */
220
- shareBaseUrl?: string | null;
221
- /**
222
- * Optional callback to register a new session token with the host's
223
- * relay broker. Receives `{ session, token }` and should return after
224
- * registration. Defaults to POSTing JSON to `${shareBaseUrl}/register`.
225
- */
226
- onRegisterSession?: (descriptor: SessionDescriptor) => Promise<void>;
227
- /** Show the agent panel. Default true. */
228
- showAgentPanel?: boolean;
229
- /** Show share controls. Default true. */
230
- showShareControls?: boolean;
231
- /** Auto-broadcast local edits as `notifications/state_update`. Default true. */
232
- broadcastEdits?: boolean;
233
- /** Pixel height of the board area. Default 640. */
234
- height?: number;
235
- /** Header content rendered above the board. */
236
- header?: ReactNode;
237
- className?: string;
238
- style?: CSSProperties;
239
- };
240
- /**
241
- * SharedWhiteboard — drop-in component that bundles every piece of the
242
- * "agent-collaborative whiteboard" UX: board with all primitives, in-page
243
- * MCP server, share controls, agent panel, presence cursor, activity
244
- * highlight, and outbound state broadcast.
245
- *
246
- * Most apps only need this one component. For deeper customization, swap
247
- * it for the lower-level primitives (Board, MicroMcpServer, ShareControls).
248
- */
249
- declare function SharedWhiteboard({ initialNotes, initialShapes, initialConnectors, initialStrokes, initialViewport, agent, shareBaseUrl, onRegisterSession, showAgentPanel, showShareControls, broadcastEdits, height, header, className, style, }: SharedWhiteboardProps): react_jsx_runtime.JSX.Element;
250
-
251
- export { type AgentActivity, AgentActivityHighlight, type AgentActivityHighlightProps, AgentCursor, type AgentCursorProps, AgentPanel, type AgentPanelProps, BridgedForm, type BridgedFormProps, FormFieldDescriptor, MicroMcpServer, ScreensActivityBridge, type ScreensActivityBridgeProps, SessionDescriptor, ShareControls, type ShareControlsProps, SharedWhiteboard, type SharedWhiteboardProps };
200
+ export { type AgentActivity, AgentActivityHighlight, type AgentActivityHighlightProps, AgentCursor, type AgentCursorProps, AgentPanel, type AgentPanelProps, BridgedForm, type BridgedFormProps, FormFieldDescriptor, MicroMcpServer, ScreensActivityBridge, type ScreensActivityBridgeProps, SessionDescriptor, ShareControls, type ShareControlsProps };
package/dist/index.d.ts CHANGED
@@ -4,8 +4,6 @@ export { T as ToolHost, a as ToolRegistry } from './tool-host-C8JMMGYq.js';
4
4
  export { InProcessTransport, RelayChannel, RelayTransport, attachInProcess, attachRelay } from './mcp/index.js';
5
5
  export { C as CallToolResult, d as ContentBlock, I as InitializeResult, c as JsonObject, J as JsonRpcMessage, e as JsonRpcNotification, f as JsonRpcRequest, g as JsonValue, M as MCP_PROTOCOL_VERSION, a as ServerCapabilities, S as ServerInfo, T as ToolDefinition, b as ToolHandler } from './types-aOQLTW0E.js';
6
6
  export { B as Bridge, a as BridgeFactory } from './types-DIVNcIQO.js';
7
- export { WhiteboardBridgeAdapter, WhiteboardBridgeOptions, registerWhiteboardBridge } from './bridges/whiteboard.js';
8
- export { FlowBridgeAdapter, FlowBridgeOptions, registerFlowBridge } from './bridges/flow.js';
9
7
  import { FormFieldDescriptor } from './bridges/forms.js';
10
8
  export { FormBridgeAdapter, FormBridgeOptions, registerFormBridge } from './bridges/forms.js';
11
9
  export { SheetsBridgeAdapter, SheetsBridgeOptions, registerSheetsBridge } from './bridges/sheets.js';
@@ -16,11 +14,11 @@ export { SceneBridgeAdapter, SceneBridgeOptions, SceneCamera, SceneObject, Scene
16
14
  export { ScreenSnapshot, ScreensBridgeAdapter, ScreensBridgeOptions, registerScreensBridge } from './bridges/screens.js';
17
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
18
16
  import { ReactNode, CSSProperties } from 'react';
19
- import { SessionDescriptor } from './sharing/index.js';
20
- export { RelayState, SseRelayOptions, SseRelayTransport, attachSseRelay, buildShareConfig, buildShareUrl, createSessionDescriptor, describeSession, readSessionFromUrl } from './sharing/index.js';
21
- import { StickyNoteItem, ShapeItem, ConnectorItem, Stroke, Viewport } from '@particle-academy/fancy-whiteboard';
17
+ import { S as SessionDescriptor } from './token-CrJF76oH.js';
18
+ export { b as buildShareConfig, a as buildShareUrl, c as createSessionDescriptor, d as describeSession, r as readSessionFromUrl } from './token-CrJF76oH.js';
22
19
  export { ActivityAgent, ActivityFilter, ActivityResolverContext, ActivityTargetResolver, ToolHandler as ActivityWrappedHandler, AgentActivityEvent, AgentActivityListener, AgentTarget, AgentTargetKind, emitActivity, onActivity, readActivityHistory, resetActivityRegistry, useAgentActivity, useAgentActivityForScreen, wrapToolWithActivity } from './presence/index.js';
23
20
  export { UndoEntry, UndoToolsOptions, clearStack as clearUndoStack, ensureUndoToolsRegistered, pushUndoEntry, readHistory as readUndoHistory, redoOne, registerUndoTools, resetAllUndoStacks, undoOne, useUndoStack } from './undo/index.js';
21
+ export { RelayState, SseRelayOptions, SseRelayTransport, attachSseRelay } from './sharing/index.js';
24
22
 
25
23
  type AgentActivity = {
26
24
  id: string;
@@ -199,53 +197,4 @@ type ShareControlsProps = {
199
197
  */
200
198
  declare function ShareControls({ session, onStart, onStop, status, shareBaseUrl, className, style, }: ShareControlsProps): react_jsx_runtime.JSX.Element;
201
199
 
202
- type SharedWhiteboardProps = {
203
- /** Initial board contents. */
204
- initialNotes?: StickyNoteItem[];
205
- initialShapes?: ShapeItem[];
206
- initialConnectors?: ConnectorItem[];
207
- initialStrokes?: Stroke[];
208
- initialViewport?: Viewport;
209
- /** Agent identity displayed in the panel + cursor. */
210
- agent?: {
211
- id: string;
212
- name?: string;
213
- color?: string;
214
- };
215
- /**
216
- * Where the relay HTTP endpoints live. The host app implements these (see
217
- * docs/relay-protocol.md). Pass `null` to disable sharing — the board
218
- * still works locally with the in-process MCP server.
219
- */
220
- shareBaseUrl?: string | null;
221
- /**
222
- * Optional callback to register a new session token with the host's
223
- * relay broker. Receives `{ session, token }` and should return after
224
- * registration. Defaults to POSTing JSON to `${shareBaseUrl}/register`.
225
- */
226
- onRegisterSession?: (descriptor: SessionDescriptor) => Promise<void>;
227
- /** Show the agent panel. Default true. */
228
- showAgentPanel?: boolean;
229
- /** Show share controls. Default true. */
230
- showShareControls?: boolean;
231
- /** Auto-broadcast local edits as `notifications/state_update`. Default true. */
232
- broadcastEdits?: boolean;
233
- /** Pixel height of the board area. Default 640. */
234
- height?: number;
235
- /** Header content rendered above the board. */
236
- header?: ReactNode;
237
- className?: string;
238
- style?: CSSProperties;
239
- };
240
- /**
241
- * SharedWhiteboard — drop-in component that bundles every piece of the
242
- * "agent-collaborative whiteboard" UX: board with all primitives, in-page
243
- * MCP server, share controls, agent panel, presence cursor, activity
244
- * highlight, and outbound state broadcast.
245
- *
246
- * Most apps only need this one component. For deeper customization, swap
247
- * it for the lower-level primitives (Board, MicroMcpServer, ShareControls).
248
- */
249
- declare function SharedWhiteboard({ initialNotes, initialShapes, initialConnectors, initialStrokes, initialViewport, agent, shareBaseUrl, onRegisterSession, showAgentPanel, showShareControls, broadcastEdits, height, header, className, style, }: SharedWhiteboardProps): react_jsx_runtime.JSX.Element;
250
-
251
- export { type AgentActivity, AgentActivityHighlight, type AgentActivityHighlightProps, AgentCursor, type AgentCursorProps, AgentPanel, type AgentPanelProps, BridgedForm, type BridgedFormProps, FormFieldDescriptor, MicroMcpServer, ScreensActivityBridge, type ScreensActivityBridgeProps, SessionDescriptor, ShareControls, type ShareControlsProps, SharedWhiteboard, type SharedWhiteboardProps };
200
+ export { type AgentActivity, AgentActivityHighlight, type AgentActivityHighlightProps, AgentCursor, type AgentCursorProps, AgentPanel, type AgentPanelProps, BridgedForm, type BridgedFormProps, FormFieldDescriptor, MicroMcpServer, ScreensActivityBridge, type ScreensActivityBridgeProps, SessionDescriptor, ShareControls, type ShareControlsProps };