@particle-academy/agent-integrations 0.6.1 → 0.6.3
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/dist/bridges/charts.d.cts +3 -3
- package/dist/bridges/charts.d.ts +3 -3
- package/dist/bridges/code.d.cts +3 -3
- package/dist/bridges/code.d.ts +3 -3
- package/dist/bridges/flow.d.cts +3 -3
- package/dist/bridges/flow.d.ts +3 -3
- package/dist/bridges/forms.d.cts +3 -3
- package/dist/bridges/forms.d.ts +3 -3
- package/dist/bridges/scene.d.cts +3 -3
- package/dist/bridges/scene.d.ts +3 -3
- package/dist/bridges/screens.d.cts +3 -3
- package/dist/bridges/screens.d.ts +3 -3
- package/dist/bridges/sheets.d.cts +3 -3
- package/dist/bridges/sheets.d.ts +3 -3
- package/dist/bridges/slides.d.cts +58 -0
- package/dist/bridges/slides.d.ts +58 -0
- package/dist/bridges/whiteboard.d.cts +3 -3
- package/dist/bridges/whiteboard.d.ts +3 -3
- package/dist/bridges-slides.cjs +438 -0
- package/dist/bridges-slides.cjs.map +1 -0
- package/dist/bridges-slides.js +6 -0
- package/dist/bridges-slides.js.map +1 -0
- package/dist/chunk-NE3GIGQD.js +384 -0
- package/dist/chunk-NE3GIGQD.js.map +1 -0
- package/dist/components/SharedWhiteboard/index.d.cts +1 -1
- package/dist/components/SharedWhiteboard/index.d.ts +1 -1
- package/dist/index.cjs +377 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.cts +5 -5
- package/dist/mcp/index.d.ts +5 -5
- package/dist/presence/index.d.cts +1 -1
- package/dist/presence/index.d.ts +1 -1
- package/dist/{server-BsSwfemr.d.cts → server-C2OpfPEo.d.cts} +3 -3
- package/dist/{server-Du3-IGqM.d.ts → server-CKAqFTyc.d.ts} +3 -3
- package/dist/sharing/index.d.cts +4 -4
- package/dist/sharing/index.d.ts +4 -4
- package/dist/sheets-adapter.d.cts +3 -3
- package/dist/sheets-adapter.d.ts +3 -3
- package/dist/{token-CrJF76oH.d.cts → token-C1O22GxJ.d.cts} +1 -1
- package/dist/{token-CrJF76oH.d.ts → token-C1O22GxJ.d.ts} +1 -1
- package/dist/{tool-host-BQuUygLF.d.cts → tool-host-CX3WFXgh.d.cts} +1 -1
- package/dist/{tool-host-C8JMMGYq.d.ts → tool-host-DldwGNqR.d.ts} +1 -1
- package/dist/{types-aOQLTW0E.d.cts → types-C2zdUpzn.d.cts} +1 -1
- package/dist/{types-aOQLTW0E.d.ts → types-C2zdUpzn.d.ts} +1 -1
- package/dist/{types-CCSBGW9T.d.cts → types-Cq5u8MJ8.d.cts} +1 -1
- package/dist/{types-DIVNcIQO.d.ts → types-DyaHnqNC.d.ts} +1 -1
- package/dist/undo/index.d.cts +2 -2
- package/dist/undo/index.d.ts +2 -2
- package/docs/relay-server.md +225 -5
- package/package.json +11 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { T as ToolHost, a as ToolRegistry } from './tool-host-
|
|
1
|
+
import { a as MicroMcpServer } from './server-C2OpfPEo.cjs';
|
|
2
|
+
export { M as McpServerOptions, T as Transport, e as errorResult, r as rpcError, t as textResult } from './server-C2OpfPEo.cjs';
|
|
3
|
+
export { T as ToolHost, a as ToolRegistry } from './tool-host-CX3WFXgh.cjs';
|
|
4
4
|
export { InProcessTransport, RelayChannel, RelayTransport, attachInProcess, attachRelay } from './mcp/index.cjs';
|
|
5
|
-
export { C as CallToolResult,
|
|
6
|
-
export { B as Bridge, a as BridgeFactory } from './types-
|
|
5
|
+
export { C as CallToolResult, a as ContentBlock, I as InitializeResult, f as JsonObject, i as JsonRpcMessage, j as JsonRpcNotification, k as JsonRpcRequest, m as JsonValue, M as MCP_PROTOCOL_VERSION, S as ServerCapabilities, n as ServerInfo, T as ToolDefinition, o as ToolHandler } from './types-C2zdUpzn.cjs';
|
|
6
|
+
export { B as Bridge, a as BridgeFactory } from './types-Cq5u8MJ8.cjs';
|
|
7
7
|
import { FormFieldDescriptor } from './bridges/forms.cjs';
|
|
8
8
|
export { FormBridgeAdapter, FormBridgeOptions, registerFormBridge } from './bridges/forms.cjs';
|
|
9
9
|
export { SheetsBridgeAdapter, SheetsBridgeOptions, registerSheetsBridge } from './bridges/sheets.cjs';
|
|
@@ -12,13 +12,15 @@ export { CodeBridgeAdapter, CodeBridgeOptions, registerCodeBridge } from './brid
|
|
|
12
12
|
export { ChartsBridgeAdapter, ChartsBridgeOptions, registerChartsBridge } from './bridges/charts.cjs';
|
|
13
13
|
export { SceneBridgeAdapter, SceneBridgeOptions, SceneCamera, SceneObject, SceneObjectKind, SceneState, registerSceneBridge } from './bridges/scene.cjs';
|
|
14
14
|
export { ScreenSnapshot, ScreensBridgeAdapter, ScreensBridgeOptions, registerScreensBridge } from './bridges/screens.cjs';
|
|
15
|
+
export { SlidesBridgeAdapter, SlidesBridgeOptions, registerSlidesBridge } from './bridges/slides.cjs';
|
|
15
16
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
16
17
|
import { ReactNode, CSSProperties } from 'react';
|
|
17
|
-
import { S as SessionDescriptor } from './token-
|
|
18
|
-
export { b as buildShareConfig, a as buildShareUrl,
|
|
18
|
+
import { S as SessionDescriptor } from './token-C1O22GxJ.cjs';
|
|
19
|
+
export { b as buildShareConfig, a as buildShareUrl, d as createSessionDescriptor, e as describeSession, r as readSessionFromUrl } from './token-C1O22GxJ.cjs';
|
|
19
20
|
export { ActivityAgent, ActivityFilter, ActivityResolverContext, ActivityTargetResolver, ToolHandler as ActivityWrappedHandler, AgentActivityEvent, AgentActivityListener, AgentTarget, AgentTargetKind, emitActivity, onActivity, readActivityHistory, resetActivityRegistry, useAgentActivity, useAgentActivityForScreen, wrapToolWithActivity } from './presence/index.cjs';
|
|
20
21
|
export { UndoEntry, UndoToolsOptions, clearStack as clearUndoStack, ensureUndoToolsRegistered, pushUndoEntry, readHistory as readUndoHistory, redoOne, registerUndoTools, resetAllUndoStacks, undoOne, useUndoStack } from './undo/index.cjs';
|
|
21
22
|
export { RelayState, SseRelayOptions, SseRelayTransport, attachSseRelay } from './sharing/index.cjs';
|
|
23
|
+
import '@particle-academy/fancy-slides';
|
|
22
24
|
|
|
23
25
|
type AgentActivity = {
|
|
24
26
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { T as ToolHost, a as ToolRegistry } from './tool-host-
|
|
1
|
+
import { a as MicroMcpServer } from './server-CKAqFTyc.js';
|
|
2
|
+
export { M as McpServerOptions, T as Transport, e as errorResult, r as rpcError, t as textResult } from './server-CKAqFTyc.js';
|
|
3
|
+
export { T as ToolHost, a as ToolRegistry } from './tool-host-DldwGNqR.js';
|
|
4
4
|
export { InProcessTransport, RelayChannel, RelayTransport, attachInProcess, attachRelay } from './mcp/index.js';
|
|
5
|
-
export { C as CallToolResult,
|
|
6
|
-
export { B as Bridge, a as BridgeFactory } from './types-
|
|
5
|
+
export { C as CallToolResult, a as ContentBlock, I as InitializeResult, f as JsonObject, i as JsonRpcMessage, j as JsonRpcNotification, k as JsonRpcRequest, m as JsonValue, M as MCP_PROTOCOL_VERSION, S as ServerCapabilities, n as ServerInfo, T as ToolDefinition, o as ToolHandler } from './types-C2zdUpzn.js';
|
|
6
|
+
export { B as Bridge, a as BridgeFactory } from './types-DyaHnqNC.js';
|
|
7
7
|
import { FormFieldDescriptor } from './bridges/forms.js';
|
|
8
8
|
export { FormBridgeAdapter, FormBridgeOptions, registerFormBridge } from './bridges/forms.js';
|
|
9
9
|
export { SheetsBridgeAdapter, SheetsBridgeOptions, registerSheetsBridge } from './bridges/sheets.js';
|
|
@@ -12,13 +12,15 @@ export { CodeBridgeAdapter, CodeBridgeOptions, registerCodeBridge } from './brid
|
|
|
12
12
|
export { ChartsBridgeAdapter, ChartsBridgeOptions, registerChartsBridge } from './bridges/charts.js';
|
|
13
13
|
export { SceneBridgeAdapter, SceneBridgeOptions, SceneCamera, SceneObject, SceneObjectKind, SceneState, registerSceneBridge } from './bridges/scene.js';
|
|
14
14
|
export { ScreenSnapshot, ScreensBridgeAdapter, ScreensBridgeOptions, registerScreensBridge } from './bridges/screens.js';
|
|
15
|
+
export { SlidesBridgeAdapter, SlidesBridgeOptions, registerSlidesBridge } from './bridges/slides.js';
|
|
15
16
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
16
17
|
import { ReactNode, CSSProperties } from 'react';
|
|
17
|
-
import { S as SessionDescriptor } from './token-
|
|
18
|
-
export { b as buildShareConfig, a as buildShareUrl,
|
|
18
|
+
import { S as SessionDescriptor } from './token-C1O22GxJ.js';
|
|
19
|
+
export { b as buildShareConfig, a as buildShareUrl, d as createSessionDescriptor, e as describeSession, r as readSessionFromUrl } from './token-C1O22GxJ.js';
|
|
19
20
|
export { ActivityAgent, ActivityFilter, ActivityResolverContext, ActivityTargetResolver, ToolHandler as ActivityWrappedHandler, AgentActivityEvent, AgentActivityListener, AgentTarget, AgentTargetKind, emitActivity, onActivity, readActivityHistory, resetActivityRegistry, useAgentActivity, useAgentActivityForScreen, wrapToolWithActivity } from './presence/index.js';
|
|
20
21
|
export { UndoEntry, UndoToolsOptions, clearStack as clearUndoStack, ensureUndoToolsRegistered, pushUndoEntry, readHistory as readUndoHistory, redoOne, registerUndoTools, resetAllUndoStacks, undoOne, useUndoStack } from './undo/index.js';
|
|
21
22
|
export { RelayState, SseRelayOptions, SseRelayTransport, attachSseRelay } from './sharing/index.js';
|
|
23
|
+
import '@particle-academy/fancy-slides';
|
|
22
24
|
|
|
23
25
|
type AgentActivity = {
|
|
24
26
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { registerSceneBridge } from './chunk-XRAJSOPS.js';
|
|
2
2
|
export { registerScreensBridge } from './chunk-57ZDHD53.js';
|
|
3
|
+
export { registerSlidesBridge } from './chunk-NE3GIGQD.js';
|
|
3
4
|
export { useSheetsActivityHighlights, useSheetsAdapter } from './chunk-5XELJIJR.js';
|
|
4
5
|
export { AgentActivityHighlight, AgentCursor, AgentPanel, ShareControls } from './chunk-ZHAK2DQR.js';
|
|
5
6
|
import './chunk-IJ6JX5VC.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/BridgedForm/BridgedForm.tsx","../src/components/ScreensActivityBridge/ScreensActivityBridge.tsx"],"names":["useEffect"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/BridgedForm/BridgedForm.tsx","../src/components/ScreensActivityBridge/ScreensActivityBridge.tsx"],"names":["useEffect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyCO,SAAS,WAAA,CAAY;AAAA,EAC1B,EAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAAqB;AAEnB,EAAA,MAAM,SAAA,GAAY,OAAO,MAAM,CAAA;AAC/B,EAAA,MAAM,WAAA,GAAc,OAAO,QAAQ,CAAA;AACnC,EAAA,MAAM,SAAA,GAAY,OAAO,MAAM,CAAA;AAC/B,EAAA,MAAM,SAAA,GAAY,OAAO,QAAQ,CAAA;AACjC,EAAA,SAAA,CAAU,MAAM;AAAE,IAAA,SAAA,CAAU,OAAA,GAAU,MAAA;AAAA,EAAQ,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AAAE,IAAA,WAAA,CAAY,OAAA,GAAU,QAAA;AAAA,EAAU,CAAA,EAAG,CAAC,QAAQ,CAAC,CAAA;AAC/D,EAAA,SAAA,CAAU,MAAM;AAAE,IAAA,SAAA,CAAU,OAAA,GAAU,MAAA;AAAA,EAAQ,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AACzD,EAAA,SAAA,CAAU,MAAM;AAAE,IAAA,SAAA,CAAU,OAAA,GAAU,QAAA;AAAA,EAAU,CAAA,EAAG,CAAC,QAAQ,CAAC,CAAA;AAE7D,EAAA,MAAM,YAAA,GAAe,CAAC,IAAA,KAAiB;AACrC,IAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,IAAA,MAAM,KAAK,QAAA,CAAS,aAAA,CAAc,kBAAkB,EAAE,CAAA,UAAA,EAAa,IAAI,CAAA,EAAA,CAAI,CAAA;AAC3E,IAAA,EAAA,EAAI,KAAA,EAAM;AAAA,EACZ,CAAA;AAEA,EAAA,MAAM,OAAA,GAAU,QAA2B,OAAO;AAAA,IAChD,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA,EAAW,MAAM,SAAA,CAAU,OAAA;AAAA,IAC3B,QAAA,EAAU,CAAC,IAAA,KAAS,SAAA,CAAU,QAAQ,IAAI,CAAA;AAAA,IAC1C,SAAA,EAAW,OAAO,EAAE,GAAG,UAAU,OAAA,EAAQ,CAAA;AAAA,IACzC,QAAA,EAAU,CAAC,IAAA,EAAM,CAAA,KAAM,YAAY,OAAA,CAAQ,EAAE,GAAG,SAAA,CAAU,OAAA,EAAS,CAAC,IAAI,GAAG,GAAG,CAAA;AAAA,IAC9E,SAAA,EAAW,CAAC,IAAA,KAAS,WAAA,CAAY,OAAA,CAAQ,EAAE,GAAG,SAAA,CAAU,OAAA,EAAS,GAAG,IAAA,EAAM,CAAA;AAAA,IAC1E,KAAA,EAAO,YAAA;AAAA,IACP,QAAQ,YAAY;AAClB,MAAA,IAAI,CAAC,UAAU,OAAA,EAAS;AACtB,QAAA,OAAO,EAAE,IAAI,IAAA,EAAM,MAAA,EAAQ,EAAE,GAAG,SAAA,CAAU,SAAQ,EAAE;AAAA,MACtD;AACA,MAAA,OAAO,UAAU,OAAA,EAAQ;AAAA,IAC3B;AAAA;AAAA,GAEF,CAAA,EAAI,CAAC,EAAA,EAAI,KAAA,EAAO,QAAQ,CAAC,CAAA;AAEzB,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,MAAA,EAAQ;AACb,IAAA,MAAM,SAAS,kBAAA,CAAmB,MAAA,EAAQ,EAAE,OAAA,EAAS,OAAO,CAAA;AAC5D,IAAA,OAAO,MAAM,OAAO,OAAA,EAAQ;AAAA,EAC9B,CAAA,EAAG,CAAC,MAAA,EAAQ,OAAA,EAAS,KAAK,CAAC,CAAA;AAE3B,EAAA,uBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,cAAA,EAAc,EAAA,EAAK,QAAA,EAAS,CAAA;AAC1C;AC5DO,SAAS,qBAAA,CAAsB,EAAE,MAAA,EAAQ,MAAA,GAAS,MAAK,EAA+B;AAC3F,EAAAA,UAAU,MAAM;AACd,IAAA,MAAM,UAAA,uBAAiB,GAAA,EAA2C;AAClE,IAAA,MAAM,GAAA,GAAM,UAAA,CAAW,CAAC,KAAA,KAAU;AAChC,MAAA,MAAM,QAAA,GAAW,MAAM,MAAA,CAAO,QAAA;AAC9B,MAAA,IAAI,CAAC,QAAA,EAAU;AAEf,MAAA,IAAI,CAAC,MAAA,CAAO,QAAA,CAAS,GAAA,CAAI,QAAQ,CAAA,EAAG;AACpC,MAAA,MAAM,QAAA,GAAW;AAAA,QACf,SAAS,KAAA,CAAM,OAAA;AAAA,QACf,WAAW,KAAA,CAAM,SAAA;AAAA,QACjB,YAAY,KAAA,CAAM,UAAA;AAAA,QAClB,QAAQ,KAAA,CAAM,MAAA;AAAA,QACd,WAAW,KAAA,CAAM,SAAA;AAAA,QACjB,SAAA,EAAW,MAAM,MAAA,CAAO,SAAA;AAAA,QACxB,KAAA,EAAO,MAAM,MAAA,CAAO;AAAA,OACtB;AACA,MAAA,MAAA,CAAO,YAAA,CAAa,QAAA,EAAU,EAAE,aAAA,EAAe,UAAU,CAAA;AACzD,MAAA,MAAM,IAAA,GAAO,UAAA,CAAW,GAAA,CAAI,QAAQ,CAAA;AACpC,MAAA,IAAI,IAAA,eAAmB,IAAI,CAAA;AAC3B,MAAA,UAAA,CAAW,GAAA;AAAA,QACT,QAAA;AAAA,QACA,WAAW,MAAM;AACf,UAAA,MAAA,CAAO,YAAA,CAAa,QAAA,EAAU,EAAE,aAAA,EAAe,MAAM,CAAA;AACrD,UAAA,UAAA,CAAW,OAAO,QAAQ,CAAA;AAAA,QAC5B,CAAA,EAAG,KAAA,CAAM,KAAA,IAAS,MAAM;AAAA,OAC1B;AAAA,IACF,CAAC,CAAA;AACD,IAAA,OAAO,MAAM;AACX,MAAA,GAAA,EAAI;AACJ,MAAA,KAAA,MAAW,CAAA,IAAK,UAAA,CAAW,MAAA,EAAO,eAAgB,CAAC,CAAA;AAAA,IACrD,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AACnB,EAAA,OAAO,IAAA;AACT","file":"index.js","sourcesContent":["import { type ReactNode, useEffect, useMemo, useRef } from \"react\";\nimport type { MicroMcpServer } from \"../../mcp/server\";\nimport { registerFormBridge, type FormBridgeAdapter, type FormFieldDescriptor } from \"../../bridges/forms\";\n\nexport type BridgedFormProps = {\n /** Stable id for this form. Used by agents in `form_*` tool calls. */\n id: string;\n /** Human title (also surfaced as the bridge title). */\n title?: string;\n /** Optional fancy-screens screen id this form lives in. */\n screenId?: string;\n /** Field descriptors — drives the agent-facing schema. */\n fields: FormFieldDescriptor[];\n /** Controlled values. */\n values: Record<string, unknown>;\n /** Setter — hosts pass their setState. */\n onChange: (next: Record<string, unknown>) => void;\n /** Optional submit handler. */\n onSubmit?: () => Promise<{ ok: boolean; values?: Record<string, unknown>; error?: string }>;\n /** The MicroMcpServer the bridge registers against. Pass null/undefined\n * to render without a bridge (useful for stories / non-shared use). */\n server?: MicroMcpServer | null;\n /** Identity used in activity events. */\n agent?: { id: string; name?: string; color?: string };\n children: ReactNode;\n};\n\n/**\n * BridgedForm — wraps a react-fancy form (or any controlled inputs)\n * with a `registerFormBridge` lifecycle. Children render the actual form\n * using `values` + `onChange`; this component only manages the bridge.\n *\n * Hosts use it like:\n *\n * <BridgedForm id=\"signup\" fields={...} values={values} onChange={setValues} server={server}>\n * <Field><Input value={values.email} onValueChange={(v) => onChange({ ...values, email: v })} /></Field>\n * ...\n * </BridgedForm>\n *\n * Agents can then call form_describe, form_set_value, form_submit, etc.\n */\nexport function BridgedForm({\n id,\n title,\n screenId,\n fields,\n values,\n onChange,\n onSubmit,\n server,\n agent,\n children,\n}: BridgedFormProps) {\n // Refs so the adapter sees fresh values without re-installing the bridge.\n const valuesRef = useRef(values);\n const onChangeRef = useRef(onChange);\n const fieldsRef = useRef(fields);\n const submitRef = useRef(onSubmit);\n useEffect(() => { valuesRef.current = values; }, [values]);\n useEffect(() => { onChangeRef.current = onChange; }, [onChange]);\n useEffect(() => { fieldsRef.current = fields; }, [fields]);\n useEffect(() => { submitRef.current = onSubmit; }, [onSubmit]);\n\n const focusElement = (name: string) => {\n if (typeof document === \"undefined\") return;\n const el = document.querySelector(`[data-form-id=\"${id}\"] [name=\"${name}\"]`) as HTMLElement | null;\n el?.focus();\n };\n\n const adapter = useMemo<FormBridgeAdapter>(() => ({\n id,\n title,\n screenId,\n getFields: () => fieldsRef.current,\n getValue: (name) => valuesRef.current[name],\n getValues: () => ({ ...valuesRef.current }),\n setValue: (name, v) => onChangeRef.current({ ...valuesRef.current, [name]: v }),\n setValues: (next) => onChangeRef.current({ ...valuesRef.current, ...next }),\n focus: focusElement,\n submit: async () => {\n if (!submitRef.current) {\n return { ok: true, values: { ...valuesRef.current } };\n }\n return submitRef.current();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [id, title, screenId]);\n\n useEffect(() => {\n if (!server) return;\n const bridge = registerFormBridge(server, { adapter, agent });\n return () => bridge.dispose();\n }, [server, adapter, agent]);\n\n return <div data-form-id={id}>{children}</div>;\n}\n","import { useEffect } from \"react\";\nimport { onActivity } from \"../../presence/registry\";\n\n/**\n * Loose shape of the fancy-screens system context — kept here so this\n * component doesn't hard-import `@particle-academy/fancy-screens`.\n */\ntype ScreenSystemLike = {\n registry: Map<string, { id: string; agentActivity?: unknown }>;\n updateScreen: (id: string, patch: { agentActivity?: unknown }) => void;\n};\n\nexport type ScreensActivityBridgeProps = {\n /** The value returned by `useScreenSystem()` from fancy-screens. */\n system: ScreenSystemLike;\n /** ms to wait after the last activity before clearing the screen's badge. Default 1500. */\n fadeMs?: number;\n};\n\n/**\n * ScreensActivityBridge — subscribe to the in-process activity registry\n * and patch each event into the matching screen's `agentActivity` field.\n * Fade-out clears the badge after `fadeMs`.\n *\n * Use it once near the root of your app, ABOVE every <Screen>:\n *\n * const system = useScreenSystem();\n * <>\n * <ScreensActivityBridge system={system} />\n * <Screen id=\"dashboard\">…</Screen>\n * <Screen id=\"form\">…</Screen>\n * </>\n *\n * Renders nothing; pure side-effect component.\n */\nexport function ScreensActivityBridge({ system, fadeMs = 1500 }: ScreensActivityBridgeProps) {\n useEffect(() => {\n const fadeTimers = new Map<string, ReturnType<typeof setTimeout>>();\n const off = onActivity((event) => {\n const screenId = event.target.screenId;\n if (!screenId) return;\n // Only patch screens that are currently registered.\n if (!system.registry.has(screenId)) return;\n const activity = {\n agentId: event.agentId,\n agentName: event.agentName,\n agentColor: event.agentColor,\n action: event.action,\n timestamp: event.timestamp,\n elementId: event.target.elementId,\n label: event.target.label,\n };\n system.updateScreen(screenId, { agentActivity: activity });\n const prev = fadeTimers.get(screenId);\n if (prev) clearTimeout(prev);\n fadeTimers.set(\n screenId,\n setTimeout(() => {\n system.updateScreen(screenId, { agentActivity: null });\n fadeTimers.delete(screenId);\n }, event.ttlMs ?? fadeMs),\n );\n });\n return () => {\n off();\n for (const t of fadeTimers.values()) clearTimeout(t);\n };\n }, [system, fadeMs]);\n return null;\n}\n"]}
|
package/dist/mcp/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Transport,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { C as CallToolResult,
|
|
5
|
-
import '../tool-host-
|
|
1
|
+
import { T as Transport, a as MicroMcpServer } from '../server-C2OpfPEo.cjs';
|
|
2
|
+
export { M as McpServerOptions, e as errorResult, r as rpcError, t as textResult } from '../server-C2OpfPEo.cjs';
|
|
3
|
+
import { i as JsonRpcMessage } from '../types-C2zdUpzn.cjs';
|
|
4
|
+
export { C as CallToolResult, a as ContentBlock, I as InitializeResult, J as JSONRPC_INTERNAL_ERROR, b as JSONRPC_INVALID_PARAMS, c as JSONRPC_INVALID_REQUEST, d as JSONRPC_METHOD_NOT_FOUND, e as JSONRPC_PARSE_ERROR, f as JsonObject, g as JsonRpcError, h as JsonRpcId, j as JsonRpcNotification, k as JsonRpcRequest, l as JsonRpcSuccess, m as JsonValue, M as MCP_PROTOCOL_VERSION, R as RegisteredTool, S as ServerCapabilities, n as ServerInfo, T as ToolDefinition, o as ToolHandler, p as ToolInputSchema } from '../types-C2zdUpzn.cjs';
|
|
5
|
+
import '../tool-host-CX3WFXgh.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* InProcessTransport — direct function-call wiring between an in-page MCP
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Transport,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { C as CallToolResult,
|
|
5
|
-
import '../tool-host-
|
|
1
|
+
import { T as Transport, a as MicroMcpServer } from '../server-CKAqFTyc.js';
|
|
2
|
+
export { M as McpServerOptions, e as errorResult, r as rpcError, t as textResult } from '../server-CKAqFTyc.js';
|
|
3
|
+
import { i as JsonRpcMessage } from '../types-C2zdUpzn.js';
|
|
4
|
+
export { C as CallToolResult, a as ContentBlock, I as InitializeResult, J as JSONRPC_INTERNAL_ERROR, b as JSONRPC_INVALID_PARAMS, c as JSONRPC_INVALID_REQUEST, d as JSONRPC_METHOD_NOT_FOUND, e as JSONRPC_PARSE_ERROR, f as JsonObject, g as JsonRpcError, h as JsonRpcId, j as JsonRpcNotification, k as JsonRpcRequest, l as JsonRpcSuccess, m as JsonValue, M as MCP_PROTOCOL_VERSION, R as RegisteredTool, S as ServerCapabilities, n as ServerInfo, T as ToolDefinition, o as ToolHandler, p as ToolInputSchema } from '../types-C2zdUpzn.js';
|
|
5
|
+
import '../tool-host-DldwGNqR.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* InProcessTransport — direct function-call wiring between an in-page MCP
|
package/dist/presence/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as ToolRegistry } from './tool-host-
|
|
1
|
+
import { n as ServerInfo, S as ServerCapabilities, i as JsonRpcMessage, C as CallToolResult } from './types-C2zdUpzn.cjs';
|
|
2
|
+
import { a as ToolRegistry } from './tool-host-CX3WFXgh.cjs';
|
|
3
3
|
|
|
4
4
|
type McpServerOptions = {
|
|
5
5
|
info: ServerInfo;
|
|
@@ -60,4 +60,4 @@ declare function rpcError(code: number, message: string, data?: any): {
|
|
|
60
60
|
declare function textResult(text: string, structured?: any): CallToolResult;
|
|
61
61
|
declare function errorResult(text: string): CallToolResult;
|
|
62
62
|
|
|
63
|
-
export {
|
|
63
|
+
export { type McpServerOptions as M, type Transport as T, MicroMcpServer as a, errorResult as e, rpcError as r, textResult as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as ToolRegistry } from './tool-host-
|
|
1
|
+
import { n as ServerInfo, S as ServerCapabilities, i as JsonRpcMessage, C as CallToolResult } from './types-C2zdUpzn.js';
|
|
2
|
+
import { a as ToolRegistry } from './tool-host-DldwGNqR.js';
|
|
3
3
|
|
|
4
4
|
type McpServerOptions = {
|
|
5
5
|
info: ServerInfo;
|
|
@@ -60,4 +60,4 @@ declare function rpcError(code: number, message: string, data?: any): {
|
|
|
60
60
|
declare function textResult(text: string, structured?: any): CallToolResult;
|
|
61
61
|
declare function errorResult(text: string): CallToolResult;
|
|
62
62
|
|
|
63
|
-
export {
|
|
63
|
+
export { type McpServerOptions as M, type Transport as T, MicroMcpServer as a, errorResult as e, rpcError as r, textResult as t };
|
package/dist/sharing/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as SessionDescriptor, b as buildShareConfig, a as buildShareUrl,
|
|
2
|
-
import {
|
|
3
|
-
import { T as Transport,
|
|
4
|
-
import '../tool-host-
|
|
1
|
+
export { S as SessionDescriptor, b as buildShareConfig, a as buildShareUrl, c as constantTimeEqual, d as createSessionDescriptor, e as describeSession, r as readSessionFromUrl } from '../token-C1O22GxJ.cjs';
|
|
2
|
+
import { i as JsonRpcMessage } from '../types-C2zdUpzn.cjs';
|
|
3
|
+
import { T as Transport, a as MicroMcpServer } from '../server-C2OpfPEo.cjs';
|
|
4
|
+
import '../tool-host-CX3WFXgh.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* SseRelayTransport — bridges the in-page MicroMcpServer to a host-app
|
package/dist/sharing/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as SessionDescriptor, b as buildShareConfig, a as buildShareUrl,
|
|
2
|
-
import {
|
|
3
|
-
import { T as Transport,
|
|
4
|
-
import '../tool-host-
|
|
1
|
+
export { S as SessionDescriptor, b as buildShareConfig, a as buildShareUrl, c as constantTimeEqual, d as createSessionDescriptor, e as describeSession, r as readSessionFromUrl } from '../token-C1O22GxJ.js';
|
|
2
|
+
import { i as JsonRpcMessage } from '../types-C2zdUpzn.js';
|
|
3
|
+
import { T as Transport, a as MicroMcpServer } from '../server-CKAqFTyc.js';
|
|
4
|
+
import '../tool-host-DldwGNqR.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* SseRelayTransport — bridges the in-page MicroMcpServer to a host-app
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SheetsBridgeAdapter } from './bridges/sheets.cjs';
|
|
2
|
-
import './tool-host-
|
|
3
|
-
import './types-
|
|
4
|
-
import './types-
|
|
2
|
+
import './tool-host-CX3WFXgh.cjs';
|
|
3
|
+
import './types-C2zdUpzn.cjs';
|
|
4
|
+
import './types-Cq5u8MJ8.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Shared-session helpers for `@particle-academy/fancy-sheets`.
|
package/dist/sheets-adapter.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SheetsBridgeAdapter } from './bridges/sheets.js';
|
|
2
|
-
import './tool-host-
|
|
3
|
-
import './types-
|
|
4
|
-
import './types-
|
|
2
|
+
import './tool-host-DldwGNqR.js';
|
|
3
|
+
import './types-C2zdUpzn.js';
|
|
4
|
+
import './types-DyaHnqNC.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Shared-session helpers for `@particle-academy/fancy-sheets`.
|
|
@@ -31,4 +31,4 @@ declare function readSessionFromUrl(): SessionDescriptor | null;
|
|
|
31
31
|
/** Constant-time string compare so a mismatched token leaks no timing info. */
|
|
32
32
|
declare function constantTimeEqual(a: string, b: string): boolean;
|
|
33
33
|
|
|
34
|
-
export { type SessionDescriptor as S, buildShareUrl as a, buildShareConfig as b,
|
|
34
|
+
export { type SessionDescriptor as S, buildShareUrl as a, buildShareConfig as b, constantTimeEqual as c, createSessionDescriptor as d, describeSession as e, readSessionFromUrl as r };
|
|
@@ -31,4 +31,4 @@ declare function readSessionFromUrl(): SessionDescriptor | null;
|
|
|
31
31
|
/** Constant-time string compare so a mismatched token leaks no timing info. */
|
|
32
32
|
declare function constantTimeEqual(a: string, b: string): boolean;
|
|
33
33
|
|
|
34
|
-
export { type SessionDescriptor as S, buildShareUrl as a, buildShareConfig as b,
|
|
34
|
+
export { type SessionDescriptor as S, buildShareUrl as a, buildShareConfig as b, constantTimeEqual as c, createSessionDescriptor as d, describeSession as e, readSessionFromUrl as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ToolDefinition,
|
|
1
|
+
import { T as ToolDefinition, o as ToolHandler, R as RegisteredTool, f as JsonObject, C as CallToolResult } from './types-C2zdUpzn.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ToolHost — the minimal surface a bridge needs to register its tools.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as ToolDefinition,
|
|
1
|
+
import { T as ToolDefinition, o as ToolHandler, R as RegisteredTool, f as JsonObject, C as CallToolResult } from './types-C2zdUpzn.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ToolHost — the minimal surface a bridge needs to register its tools.
|
|
@@ -109,4 +109,4 @@ type RegisteredTool = {
|
|
|
109
109
|
};
|
|
110
110
|
declare const MCP_PROTOCOL_VERSION = "2025-06-18";
|
|
111
111
|
|
|
112
|
-
export { type CallToolResult as C, type InitializeResult as I,
|
|
112
|
+
export { type CallToolResult as C, type InitializeResult as I, JSONRPC_INTERNAL_ERROR as J, MCP_PROTOCOL_VERSION as M, type RegisteredTool as R, type ServerCapabilities as S, type ToolDefinition as T, type ContentBlock as a, JSONRPC_INVALID_PARAMS as b, JSONRPC_INVALID_REQUEST as c, JSONRPC_METHOD_NOT_FOUND as d, JSONRPC_PARSE_ERROR as e, type JsonObject as f, type JsonRpcError as g, type JsonRpcId as h, type JsonRpcMessage as i, type JsonRpcNotification as j, type JsonRpcRequest as k, type JsonRpcSuccess as l, type JsonValue as m, type ServerInfo as n, type ToolHandler as o, type ToolInputSchema as p };
|
|
@@ -109,4 +109,4 @@ type RegisteredTool = {
|
|
|
109
109
|
};
|
|
110
110
|
declare const MCP_PROTOCOL_VERSION = "2025-06-18";
|
|
111
111
|
|
|
112
|
-
export { type CallToolResult as C, type InitializeResult as I,
|
|
112
|
+
export { type CallToolResult as C, type InitializeResult as I, JSONRPC_INTERNAL_ERROR as J, MCP_PROTOCOL_VERSION as M, type RegisteredTool as R, type ServerCapabilities as S, type ToolDefinition as T, type ContentBlock as a, JSONRPC_INVALID_PARAMS as b, JSONRPC_INVALID_REQUEST as c, JSONRPC_METHOD_NOT_FOUND as d, JSONRPC_PARSE_ERROR as e, type JsonObject as f, type JsonRpcError as g, type JsonRpcId as h, type JsonRpcMessage as i, type JsonRpcNotification as j, type JsonRpcRequest as k, type JsonRpcSuccess as l, type JsonValue as m, type ServerInfo as n, type ToolHandler as o, type ToolInputSchema as p };
|
package/dist/undo/index.d.cts
CHANGED
package/dist/undo/index.d.ts
CHANGED
package/docs/relay-server.md
CHANGED
|
@@ -75,12 +75,232 @@ docker build -t agent-integrations-relay .
|
|
|
75
75
|
docker run -p 8787:8787 agent-integrations-relay
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
## Deployment recipes
|
|
79
|
+
|
|
80
|
+
The relay is a tiny stateless Node HTTP server. Any platform that can host a
|
|
81
|
+
long-running Node process works. Pick whichever matches the rest of your
|
|
82
|
+
infrastructure — verification steps are at the bottom of each recipe.
|
|
83
|
+
|
|
84
|
+
### Laravel Forge (Node site or daemon)
|
|
85
|
+
|
|
86
|
+
Forge supports both Node sites and standalone daemons, either fits.
|
|
87
|
+
|
|
88
|
+
**Option A — Forge "Static" site running Node:**
|
|
89
|
+
|
|
90
|
+
1. In Forge, create a new site on your server. Set **Project Type** to
|
|
91
|
+
*Static / Node*. Web directory: `/public` (unused — we'll serve from the
|
|
92
|
+
relay port).
|
|
93
|
+
2. Add a domain (e.g. `relay.particle.academy`) and an LE SSL cert.
|
|
94
|
+
3. Connect the site to a deploy repo — point it at this package's git URL or
|
|
95
|
+
a thin wrapper repo containing just:
|
|
96
|
+
```
|
|
97
|
+
.
|
|
98
|
+
├── package.json (just "scripts": { "start": "agent-integrations-relay --port 8787" }
|
|
99
|
+
│ and "dependencies": { "@particle-academy/agent-integrations": "^0.6.1" })
|
|
100
|
+
└── README.md
|
|
101
|
+
```
|
|
102
|
+
4. Deploy script:
|
|
103
|
+
```bash
|
|
104
|
+
cd $FORGE_SITE_PATH
|
|
105
|
+
npm install --omit=dev
|
|
106
|
+
```
|
|
107
|
+
5. In **Daemons** (sidebar), add:
|
|
108
|
+
- **Command:** `npx agent-integrations-relay --port 8787 --cors https://your-site.example`
|
|
109
|
+
- **Directory:** `$FORGE_SITE_PATH`
|
|
110
|
+
- **User:** `forge`
|
|
111
|
+
Daemon auto-restarts on crash.
|
|
112
|
+
6. In the site's **Nginx config**, replace the upstream block with:
|
|
113
|
+
```nginx
|
|
114
|
+
location / {
|
|
115
|
+
proxy_pass http://127.0.0.1:8787;
|
|
116
|
+
proxy_http_version 1.1;
|
|
117
|
+
proxy_set_header Host $host;
|
|
118
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
119
|
+
|
|
120
|
+
# SSE needs these — otherwise the stream is buffered and never reaches the agent.
|
|
121
|
+
proxy_buffering off;
|
|
122
|
+
proxy_cache off;
|
|
123
|
+
proxy_read_timeout 6h;
|
|
124
|
+
proxy_send_timeout 6h;
|
|
125
|
+
chunked_transfer_encoding on;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
7. Restart Nginx via the Forge UI button or `sudo nginx -s reload`.
|
|
129
|
+
|
|
130
|
+
**Option B — daemon alongside an existing Laravel app on the same server:**
|
|
131
|
+
|
|
132
|
+
If you'd rather not give it its own subdomain, run it as a Forge daemon on
|
|
133
|
+
an internal port and proxy from an existing site's Nginx config:
|
|
134
|
+
|
|
135
|
+
```nginx
|
|
136
|
+
# Inside an existing Forge Laravel site
|
|
137
|
+
location /mcp-relay/ {
|
|
138
|
+
proxy_pass http://127.0.0.1:8787/;
|
|
139
|
+
proxy_http_version 1.1;
|
|
140
|
+
proxy_buffering off;
|
|
141
|
+
proxy_read_timeout 6h;
|
|
142
|
+
chunked_transfer_encoding on;
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Verify:**
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
curl https://relay.particle.academy/ # → {"ok":true,"service":"…"}
|
|
150
|
+
curl -X POST -H 'content-type: application/json' \
|
|
151
|
+
-d '{"session":"smoke-001","token":"abcdef0123456789abcdef0123456789"}' \
|
|
152
|
+
https://relay.particle.academy/register # → {"ok":true}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Fly.io
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
git clone https://github.com/Particle-Academy/agent-integrations
|
|
159
|
+
cd agent-integrations
|
|
160
|
+
npm install && npm run build
|
|
161
|
+
docker build -t agent-integrations-relay .
|
|
162
|
+
|
|
163
|
+
# Init + deploy (first time only):
|
|
164
|
+
fly launch \
|
|
165
|
+
--name relay-particle-academy \
|
|
166
|
+
--no-deploy \
|
|
167
|
+
--copy-config \
|
|
168
|
+
--image agent-integrations-relay \
|
|
169
|
+
--internal-port 8787 \
|
|
170
|
+
--region iad
|
|
171
|
+
fly deploy
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Public URL prints at the end, e.g. `https://relay-particle-academy.fly.dev`.
|
|
175
|
+
|
|
176
|
+
### Railway
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Commit the Dockerfile to your relay repo, then:
|
|
180
|
+
railway login
|
|
181
|
+
railway init
|
|
182
|
+
railway up
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
In the Railway dashboard, enable a public domain on the service; copy the
|
|
186
|
+
generated `*.up.railway.app` URL.
|
|
187
|
+
|
|
188
|
+
### Render
|
|
189
|
+
|
|
190
|
+
1. New → **Web Service**
|
|
191
|
+
2. Connect a git repo containing the Dockerfile
|
|
192
|
+
3. Runtime: **Docker**
|
|
193
|
+
4. Port: `8787`
|
|
194
|
+
5. Add `Header: Cache-Control: no-cache` on the service so Render's CDN
|
|
195
|
+
doesn't buffer SSE
|
|
196
|
+
|
|
197
|
+
### Google Cloud Run
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
gcloud builds submit --tag gcr.io/$PROJECT/agent-integrations-relay
|
|
201
|
+
gcloud run deploy agent-integrations-relay \
|
|
202
|
+
--image gcr.io/$PROJECT/agent-integrations-relay \
|
|
203
|
+
--port 8787 \
|
|
204
|
+
--allow-unauthenticated \
|
|
205
|
+
--min-instances 1 \
|
|
206
|
+
--timeout 3600
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Cloud Run's default request timeout is 60s — bump it via `--timeout 3600`
|
|
210
|
+
(max 3600s on managed Cloud Run) so SSE streams aren't cut off. For longer
|
|
211
|
+
sessions, use **Cloud Run for Anthos / GKE** or a Compute Engine VM.
|
|
212
|
+
|
|
213
|
+
### Bare server (systemd)
|
|
214
|
+
|
|
215
|
+
If the relay is going on a VM you already own, `systemd`:
|
|
216
|
+
|
|
217
|
+
```ini
|
|
218
|
+
# /etc/systemd/system/mcp-relay.service
|
|
219
|
+
[Unit]
|
|
220
|
+
Description=MCP relay broker
|
|
221
|
+
After=network.target
|
|
222
|
+
|
|
223
|
+
[Service]
|
|
224
|
+
Type=simple
|
|
225
|
+
User=relay
|
|
226
|
+
WorkingDirectory=/opt/relay
|
|
227
|
+
ExecStart=/usr/bin/npx agent-integrations-relay --port 8787 --cors https://your-site.example
|
|
228
|
+
Restart=on-failure
|
|
229
|
+
RestartSec=5
|
|
230
|
+
Environment=NODE_ENV=production
|
|
231
|
+
|
|
232
|
+
[Install]
|
|
233
|
+
WantedBy=multi-user.target
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
sudo systemctl daemon-reload
|
|
238
|
+
sudo systemctl enable --now mcp-relay
|
|
239
|
+
sudo systemctl status mcp-relay
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Front with Nginx using the same SSE-friendly proxy block as the Forge
|
|
243
|
+
recipe.
|
|
244
|
+
|
|
245
|
+
## Smoke testing any deploy
|
|
246
|
+
|
|
247
|
+
After you have a public URL, regardless of host:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
RELAY=https://relay.example.com
|
|
251
|
+
|
|
252
|
+
# 1. Health
|
|
253
|
+
curl $RELAY/
|
|
254
|
+
|
|
255
|
+
# 2. Register a session
|
|
256
|
+
curl -X POST -H 'content-type: application/json' \
|
|
257
|
+
-d '{"session":"smoke-001","token":"abcdef0123456789abcdef0123456789"}' \
|
|
258
|
+
$RELAY/register
|
|
259
|
+
|
|
260
|
+
# 3. POST a frame
|
|
261
|
+
curl -X POST -H 'content-type: application/json' \
|
|
262
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
|
|
263
|
+
"$RELAY/smoke-001/inbox?token=abcdef0123456789abcdef0123456789"
|
|
264
|
+
|
|
265
|
+
# 4. SSE stream — should hang open + emit keepalive comments every 15s
|
|
266
|
+
curl -N "$RELAY/smoke-001/events?token=abcdef0123456789abcdef0123456789&direction=inbound"
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
If `curl -N` returns immediately, your proxy is buffering. Re-check
|
|
270
|
+
`proxy_buffering off` (Nginx) or the equivalent on your edge.
|
|
271
|
+
|
|
272
|
+
## Hooking into your demo site
|
|
273
|
+
|
|
274
|
+
Set the relay base URL in your demo's environment. For a Laravel host (like
|
|
275
|
+
particle.academy):
|
|
276
|
+
|
|
277
|
+
```env
|
|
278
|
+
# .env on the demo site
|
|
279
|
+
MCP_RELAY_BASE_URL=https://relay.particle.academy
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Bind it to a config and read it from your Livewire/Blade layer:
|
|
283
|
+
|
|
284
|
+
```php
|
|
285
|
+
// config/mcp.php
|
|
286
|
+
return [
|
|
287
|
+
'relay_base_url' => env('MCP_RELAY_BASE_URL', ''),
|
|
288
|
+
];
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Then pass it to the React mount placeholder:
|
|
292
|
+
|
|
293
|
+
```blade
|
|
294
|
+
<div
|
|
295
|
+
data-fancy-demo="composer"
|
|
296
|
+
data-relay-base="{{ config('mcp.relay_base_url') }}"
|
|
297
|
+
></div>
|
|
298
|
+
```
|
|
79
299
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
300
|
+
The React side reads `node.dataset.relayBase`, passes it to the demo
|
|
301
|
+
component, and the component uses it for `attachSseRelay({ baseUrl: ... })`.
|
|
302
|
+
See [agent-hookable-demos.md](./agent-hookable-demos.md) for the
|
|
303
|
+
end-to-end pattern.
|
|
84
304
|
|
|
85
305
|
## Wire protocol
|
|
86
306
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-academy/agent-integrations",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "MCP-driven agent presence in collab sessions: per-session micro-MCP server, pluggable bridges to fancy-* packages, and agent UX components (panel + on-canvas cursor).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
"import": { "types": "./dist/bridges/screens.d.ts", "default": "./dist/bridges-screens.js" },
|
|
58
58
|
"require": { "types": "./dist/bridges/screens.d.cts", "default": "./dist/bridges-screens.cjs" }
|
|
59
59
|
},
|
|
60
|
+
"./bridges/slides": {
|
|
61
|
+
"import": { "types": "./dist/bridges/slides.d.ts", "default": "./dist/bridges-slides.js" },
|
|
62
|
+
"require": { "types": "./dist/bridges/slides.d.cts", "default": "./dist/bridges-slides.cjs" }
|
|
63
|
+
},
|
|
60
64
|
"./sheets-adapter": {
|
|
61
65
|
"import": { "types": "./dist/sheets-adapter.d.ts", "default": "./dist/sheets-adapter.js" },
|
|
62
66
|
"require": { "types": "./dist/sheets-adapter.d.cts", "default": "./dist/sheets-adapter.cjs" }
|
|
@@ -96,15 +100,18 @@
|
|
|
96
100
|
"react": "^18.0.0 || ^19.0.0",
|
|
97
101
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
98
102
|
"@particle-academy/fancy-whiteboard": "^0.1.0",
|
|
99
|
-
"@particle-academy/fancy-flow": "^0.2.0",
|
|
100
|
-
"@particle-academy/fancy-sheets": "^0.1.0"
|
|
103
|
+
"@particle-academy/fancy-flow": "^0.2.0 || ^0.3.0",
|
|
104
|
+
"@particle-academy/fancy-sheets": "^0.1.0",
|
|
105
|
+
"@particle-academy/fancy-slides": "^0.1.4"
|
|
101
106
|
},
|
|
102
107
|
"peerDependenciesMeta": {
|
|
103
108
|
"@particle-academy/fancy-whiteboard": { "optional": true },
|
|
104
109
|
"@particle-academy/fancy-flow": { "optional": true },
|
|
105
|
-
"@particle-academy/fancy-sheets": { "optional": true }
|
|
110
|
+
"@particle-academy/fancy-sheets": { "optional": true },
|
|
111
|
+
"@particle-academy/fancy-slides": { "optional": true }
|
|
106
112
|
},
|
|
107
113
|
"devDependencies": {
|
|
114
|
+
"@particle-academy/fancy-slides": "^0.1.6",
|
|
108
115
|
"@particle-academy/fancy-whiteboard": "^0.1.5",
|
|
109
116
|
"@types/node": "^22.0.0",
|
|
110
117
|
"@types/react": "^19.0.0",
|