resource

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const WorkspaceForgeRendererPath = "/mcp-ui/forge-window"

WorkspaceForgeRendererPath is the canonical same-origin SPA route the MCP UI host loads inside the bubble iframe when a workspace view resource opts in to richer Forge-backed rendering. The page receives the workspace window key via the `windowKey` query parameter and bootstraps the canonical Forge `WindowContent` renderer through normal authenticated workspace fetches.

View Source
const WorkspaceForgeSandbox = "allow-scripts allow-same-origin"

WorkspaceForgeSandbox is the per-resource sandbox opt-in published with workspace view resources. It narrowly adds `allow-same-origin` to the host default so the renderer page can perform authenticated same-origin workspace metadata and datasource fetches; no other relaxations are granted.

View Source
const WorkspaceServerScope = "agently.wk_default"

WorkspaceServerScope is the canonical server-scope used to publish workspace-backed forge windows as MCP UI resources. It identifies the default Agently workspace, follows the reserved `agently.*` module prefix, and uses a deterministic suffix so identical effective workspace inputs always yield the same URI across process restarts.

Variables

This section is empty.

Functions

func ListWorkspaceResources

func ListWorkspaceResources(ctx context.Context) ([]mcpschema.Resource, error)

ListWorkspaceResources enumerates workspace-backed Forge windows with view content and exposes them as generic MCP UI resources keyed by windowKey. This stays generic: it publishes what the active workspace declares and does not hardcode any business-specific window identities.

func LoadWorkspaceForgeWindow

func LoadWorkspaceForgeWindow(ctx context.Context, windowKey string) (*forgeTypes.Window, error)

LoadWorkspaceForgeWindow loads the workspace-owned forge window for the supplied key by reusing the same canonical workspace fallback the HTTP /window handler uses. It returns (nil, nil) when no window with view content exists under the workspace.

func ReadWorkspaceResource

func ReadWorkspaceResource(ctx context.Context, uri string) (*mcpschema.ReadResourceResult, error)

ReadWorkspaceResource resolves `ui://agently.wk_default/view/<windowKey>` URIs against the canonical workspace forge window loader. The HTML payload is server-assembled from the loaded forge window so the surface flows through MCP UI without inventing a parallel app-specific tool or rendering path.

func ReadWorkspaceViewResource

func ReadWorkspaceViewResource(ctx context.Context, uri, windowKey string) (*mcpschema.ReadResourceResult, error)

ReadWorkspaceViewResource loads the workspace-owned forge window identified by windowKey and assembles a workspace-backed MCP UI HTML resource for the exact uri supplied by the caller.

This helper is intentionally additive: it does not mutate ui/view behavior or rely on hosted-region open semantics. Callers provide the exact `ui://...` identity they want to publish, while the backing window truth still comes from the canonical workspace forge window loader.

func WorkspaceForgeRendererURL

func WorkspaceForgeRendererURL(windowKey, resourceURI, contentHash string) string

WorkspaceForgeRendererURL returns the canonical same-origin renderer URL for the workspace forge window identified by windowKey and resource URI. The URL includes the exact `resourceUri` plus a deterministic content-hash query argument so embedded bubbles do not reuse a stale renderer page after the published workspace UI resource changes.

func WorkspaceViewURI

func WorkspaceViewURI(windowKey string) string

WorkspaceViewURI returns the canonical `ui://...` resource URI for the workspace-owned forge window identified by windowKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL