@tangle-network/agent-app 0.45.1 → 0.45.2

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.
@@ -1,95 +0,0 @@
1
- import { A as AppToolContext, a as AppToolName, b as AppToolDefinition } from './types-DbU-oO5h.js';
2
- import { T as ToolHeaderNames } from './auth-DJs6lfAs.js';
3
-
4
- /** Default route path each app tool is served at. A product mounts its routes
5
- * at these paths (or supplies its own via {@link BuildMcpServerOptions.paths}). */
6
- declare const DEFAULT_APP_TOOL_PATHS: Record<AppToolName, string>;
7
- /** The portable MCP server entry the sandbox SDK accepts (transport + url +
8
- * headers). Matches `AgentProfileMcpServer` structurally without importing the
9
- * sandbox SDK — products spread it into their profile's `mcp` map. */
10
- interface AppToolMcpServer {
11
- transport: 'http';
12
- url: string;
13
- headers: Record<string, string>;
14
- enabled: true;
15
- metadata: {
16
- description: string;
17
- };
18
- }
19
- /** Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description */
20
- interface BuildHttpMcpServerOptions {
21
- /** Route path on the app the sandbox POSTs to (e.g. `/api/tools/propose`). */
22
- path: string;
23
- /** App base URL the sandbox reaches back to (no trailing slash required). */
24
- baseUrl: string;
25
- /** Per-user capability token, baked into the Authorization header. */
26
- token: string;
27
- ctx: AppToolContext;
28
- /** Tool description the model sees. */
29
- description: string;
30
- headerNames?: ToolHeaderNames;
31
- }
32
- /**
33
- * Build ONE HTTP MCP server entry — the generic agent→app bridge. The
34
- * capability token + the user/workspace/thread ids ride in server-set headers
35
- * (never tool args), so the model can't forge identity or target another
36
- * workspace. Workspace/thread headers are omitted when their `ctx` value is
37
- * empty/null (e.g. an integration-invoke bridge that's user-scoped only). Used
38
- * directly for non-app-tool bridges (integration_invoke) and via
39
- * {@link buildAppToolMcpServer} for the four app tools.
40
- */
41
- declare function buildHttpMcpServer(opts: BuildHttpMcpServerOptions): AppToolMcpServer;
42
- /** Options for a per-document/scoped MCP channel entry (design-canvas,
43
- * sequences, …). The capability token + path scope ONE resource; the document
44
- * id lives in the path, never a tool argument. */
45
- interface ScopedMcpServerEntryOptions {
46
- /** App base URL the sandbox reaches back to (trailing slash tolerated). */
47
- baseUrl: string;
48
- /** Product route serving the resource's MCP handler — id is part of the path. */
49
- path: string;
50
- /** Capability token the product minted for this (user, resource) scope. With
51
- * no token there is no entry to build — omit the server instead. */
52
- token: string;
53
- /** Override the channel's default tool-server description. */
54
- description?: string;
55
- /** Identity headers for products whose route recovers the user via
56
- * `authenticateToolRequest`. Omit when the bearer token is self-contained. */
57
- ctx?: AppToolContext;
58
- headerNames?: ToolHeaderNames;
59
- }
60
- /**
61
- * Build the `AgentProfileMcpServer`-shaped entry for a scoped, per-resource MCP
62
- * channel. The shared mechanism behind the per-domain entry builders
63
- * (`buildDesignCanvasMcpServerEntry`, `buildSequencesMcpServerEntry`): same
64
- * token/path guards, same description default, same ctx-vs-self-contained-token
65
- * branching. The domain is two parameters — `label` (for guard messages) and
66
- * `defaultDescription` — never baked.
67
- *
68
- * The no-`ctx` branch is a GENUINE behavioral path, not a shortcut: it emits a
69
- * self-contained-token entry with ONLY `Authorization` + `Content-Type`.
70
- * Routing it through {@link buildHttpMcpServer} would unconditionally write a
71
- * `userId` identity header (here `undefined`), so it stays a distinct branch.
72
- */
73
- declare function buildScopedMcpServerEntry(opts: ScopedMcpServerEntryOptions & {
74
- label: string;
75
- defaultDescription: string;
76
- }): AppToolMcpServer;
77
- /** Define configuration options required to build an MCP server including tool, baseUrl, token, and context */
78
- interface BuildMcpServerOptions {
79
- /** A built-in app tool name, or a product-registered {@link AppToolDefinition}.
80
- * A custom tool supplies its route via `AppToolDefinition.path` (or `paths`). */
81
- tool: AppToolName | AppToolDefinition;
82
- baseUrl: string;
83
- token: string;
84
- ctx: AppToolContext;
85
- description: string;
86
- headerNames?: ToolHeaderNames;
87
- paths?: Partial<Record<string, string>>;
88
- }
89
- /** Build one app-tool MCP server entry — a thin wrapper over
90
- * {@link buildHttpMcpServer} that resolves the tool's route path. Built-ins map
91
- * through {@link DEFAULT_APP_TOOL_PATHS}; a custom tool uses its own `path`
92
- * (or a `paths` override). */
93
- declare function buildAppToolMcpServer(opts: BuildMcpServerOptions): AppToolMcpServer;
94
-
95
- export { type AppToolMcpServer as A, type BuildHttpMcpServerOptions as B, DEFAULT_APP_TOOL_PATHS as D, type ScopedMcpServerEntryOptions as S, type BuildMcpServerOptions as a, buildAppToolMcpServer as b, buildHttpMcpServer as c, buildScopedMcpServerEntry as d };