@tangle-network/agent-app 0.12.0 → 0.14.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.
- package/dist/DesignCanvas-3JEEIT6Y.js +10 -0
- package/dist/DesignCanvas-3JEEIT6Y.js.map +1 -0
- package/dist/DesignCanvasEditor-37LPJIIR.js +9 -0
- package/dist/DesignCanvasEditor-37LPJIIR.js.map +1 -0
- package/dist/chunk-2Q73HGDI.js +1743 -0
- package/dist/chunk-2Q73HGDI.js.map +1 -0
- package/dist/{chunk-3WAJWYKD.js → chunk-6UOE5CTA.js} +9 -92
- package/dist/{chunk-3WAJWYKD.js.map → chunk-6UOE5CTA.js.map} +1 -1
- package/dist/chunk-7QCIYDGC.js +1119 -0
- package/dist/chunk-7QCIYDGC.js.map +1 -0
- package/dist/chunk-A76ZHWNF.js +194 -0
- package/dist/chunk-A76ZHWNF.js.map +1 -0
- package/dist/chunk-F5KTWRO7.js +2276 -0
- package/dist/chunk-F5KTWRO7.js.map +1 -0
- package/dist/chunk-JZAJE3JL.js +990 -0
- package/dist/chunk-JZAJE3JL.js.map +1 -0
- package/dist/{chunk-CF5DZELC.js → chunk-SSX2A6XX.js} +39 -2
- package/dist/chunk-SSX2A6XX.js.map +1 -0
- package/dist/design-canvas/drizzle.d.ts +569 -0
- package/dist/design-canvas/drizzle.js +183 -0
- package/dist/design-canvas/drizzle.js.map +1 -0
- package/dist/design-canvas/index.d.ts +261 -0
- package/dist/design-canvas/index.js +96 -0
- package/dist/design-canvas/index.js.map +1 -0
- package/dist/design-canvas-react/index.d.ts +916 -0
- package/dist/design-canvas-react/index.js +423 -0
- package/dist/design-canvas-react/index.js.map +1 -0
- package/dist/export-presets-Dl5Aa5xj.d.ts +284 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +103 -3
- package/dist/mcp-rpc-DLw_r9PQ.d.ts +55 -0
- package/dist/model-BHLN208Z.d.ts +183 -0
- package/dist/sequences/index.d.ts +4 -0
- package/dist/sequences/index.js +2 -2
- package/dist/store-CUStmtdH.d.ts +64 -0
- package/dist/tools/index.d.ts +64 -2
- package/dist/tools/index.js +10 -2
- package/package.json +28 -3
- package/dist/chunk-CF5DZELC.js.map +0 -1
- package/dist/chunk-IJZJWKUK.js +0 -77
- package/dist/chunk-IJZJWKUK.js.map +0 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { d as SceneElement, N as NewPageOptions, P as PageBleed, a as PageGuides, g as ScenePage, B as Bounds } from './model-BHLN208Z.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The design-canvas operation union — the ONE mutation vocabulary shared by
|
|
5
|
+
* the editor's command stack (human edits, undo/redo), the MCP tool
|
|
6
|
+
* dispatcher (agent edits), and programmatic automation (template
|
|
7
|
+
* instantiation, data sync). Every state change the editor can express is an
|
|
8
|
+
* operation here; anything not expressible here does not happen to a
|
|
9
|
+
* document. That closure is the automation contract: replaying a decision
|
|
10
|
+
* log reproduces the document.
|
|
11
|
+
*
|
|
12
|
+
* Attribute patches are validated per element kind in ./validate before
|
|
13
|
+
* ./apply mutates the document; both run server-side on every path.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Per-kind attribute patch. `kind` is immutable after creation; ids are
|
|
17
|
+
* immutable always. Validation rejects attrs foreign to the target's kind. */
|
|
18
|
+
type SceneAttrsPatch = Partial<Omit<SceneElement, 'id' | 'kind' | 'children'>> & {
|
|
19
|
+
text?: string;
|
|
20
|
+
width?: number;
|
|
21
|
+
height?: number;
|
|
22
|
+
points?: number[];
|
|
23
|
+
fill?: string;
|
|
24
|
+
stroke?: string;
|
|
25
|
+
strokeWidth?: number;
|
|
26
|
+
cornerRadius?: number;
|
|
27
|
+
dash?: number[];
|
|
28
|
+
fontFamily?: string;
|
|
29
|
+
fontSize?: number;
|
|
30
|
+
fontStyle?: 'normal' | 'bold' | 'italic' | 'bold italic';
|
|
31
|
+
align?: 'left' | 'center' | 'right';
|
|
32
|
+
lineHeight?: number;
|
|
33
|
+
letterSpacing?: number;
|
|
34
|
+
src?: string;
|
|
35
|
+
posterSrc?: string;
|
|
36
|
+
fit?: 'fill' | 'cover' | 'contain';
|
|
37
|
+
};
|
|
38
|
+
interface AddElementOperation {
|
|
39
|
+
type: 'add_element';
|
|
40
|
+
pageId: string;
|
|
41
|
+
/** Complete element including caller-minted id (reconciled like sequences
|
|
42
|
+
* clips when the server re-mints). */
|
|
43
|
+
element: SceneElement;
|
|
44
|
+
/** Insertion z-index; omitted → top. */
|
|
45
|
+
index?: number;
|
|
46
|
+
/** Parent group; omitted → page root. */
|
|
47
|
+
parentGroupId?: string;
|
|
48
|
+
}
|
|
49
|
+
interface SetAttrsOperation {
|
|
50
|
+
type: 'set_attrs';
|
|
51
|
+
pageId: string;
|
|
52
|
+
elementId: string;
|
|
53
|
+
attrs: SceneAttrsPatch;
|
|
54
|
+
}
|
|
55
|
+
interface ReorderElementOperation {
|
|
56
|
+
type: 'reorder_element';
|
|
57
|
+
pageId: string;
|
|
58
|
+
elementId: string;
|
|
59
|
+
/** Target index within the element's CURRENT owner (page root or group). */
|
|
60
|
+
toIndex: number;
|
|
61
|
+
}
|
|
62
|
+
interface DeleteElementOperation {
|
|
63
|
+
type: 'delete_element';
|
|
64
|
+
pageId: string;
|
|
65
|
+
elementId: string;
|
|
66
|
+
}
|
|
67
|
+
interface GroupElementsOperation {
|
|
68
|
+
type: 'group_elements';
|
|
69
|
+
pageId: string;
|
|
70
|
+
/** ≥ 2 sibling elements (same owner); grouped in their current z-order. */
|
|
71
|
+
elementIds: string[];
|
|
72
|
+
/** Caller-minted id for the new group. */
|
|
73
|
+
groupId: string;
|
|
74
|
+
name?: string;
|
|
75
|
+
}
|
|
76
|
+
interface UngroupElementOperation {
|
|
77
|
+
type: 'ungroup_element';
|
|
78
|
+
pageId: string;
|
|
79
|
+
groupId: string;
|
|
80
|
+
}
|
|
81
|
+
interface AddPageOperation {
|
|
82
|
+
type: 'add_page';
|
|
83
|
+
/** Caller-minted page id. */
|
|
84
|
+
pageId: string;
|
|
85
|
+
options?: NewPageOptions;
|
|
86
|
+
/** Position in the page list; omitted → end. */
|
|
87
|
+
index?: number;
|
|
88
|
+
}
|
|
89
|
+
interface DuplicatePageOperation {
|
|
90
|
+
type: 'duplicate_page';
|
|
91
|
+
sourcePageId: string;
|
|
92
|
+
/** Caller-minted id for the copy; element ids are re-minted server-side. */
|
|
93
|
+
pageId: string;
|
|
94
|
+
}
|
|
95
|
+
interface DeletePageOperation {
|
|
96
|
+
type: 'delete_page';
|
|
97
|
+
pageId: string;
|
|
98
|
+
}
|
|
99
|
+
interface ReorderPageOperation {
|
|
100
|
+
type: 'reorder_page';
|
|
101
|
+
pageId: string;
|
|
102
|
+
toIndex: number;
|
|
103
|
+
}
|
|
104
|
+
interface SetPagePropsOperation {
|
|
105
|
+
type: 'set_page_props';
|
|
106
|
+
pageId: string;
|
|
107
|
+
name?: string;
|
|
108
|
+
width?: number;
|
|
109
|
+
height?: number;
|
|
110
|
+
background?: string;
|
|
111
|
+
/** null clears bleed; omitted leaves unchanged. */
|
|
112
|
+
bleed?: PageBleed | null;
|
|
113
|
+
}
|
|
114
|
+
interface SetPageGuidesOperation {
|
|
115
|
+
type: 'set_page_guides';
|
|
116
|
+
pageId: string;
|
|
117
|
+
guides: PageGuides;
|
|
118
|
+
}
|
|
119
|
+
interface BindSlotOperation {
|
|
120
|
+
type: 'bind_slot';
|
|
121
|
+
pageId: string;
|
|
122
|
+
elementId: string;
|
|
123
|
+
/** null unbinds. Slot names are unique document-wide. */
|
|
124
|
+
slot: string | null;
|
|
125
|
+
}
|
|
126
|
+
/** Fill slots with data — text slots take strings, image/video slots take
|
|
127
|
+
* src URLs. Unknown slot names throw; partial application is allowed. */
|
|
128
|
+
interface ApplyDataOperation {
|
|
129
|
+
type: 'apply_data';
|
|
130
|
+
bindings: Record<string, string>;
|
|
131
|
+
}
|
|
132
|
+
interface SetDocumentTitleOperation {
|
|
133
|
+
type: 'set_document_title';
|
|
134
|
+
title: string;
|
|
135
|
+
}
|
|
136
|
+
type SceneOperation = AddElementOperation | SetAttrsOperation | ReorderElementOperation | DeleteElementOperation | GroupElementsOperation | UngroupElementOperation | AddPageOperation | DuplicatePageOperation | DeletePageOperation | ReorderPageOperation | SetPagePropsOperation | SetPageGuidesOperation | BindSlotOperation | ApplyDataOperation | SetDocumentTitleOperation;
|
|
137
|
+
interface ScenePlan {
|
|
138
|
+
summary: string;
|
|
139
|
+
operations: SceneOperation[];
|
|
140
|
+
}
|
|
141
|
+
type SceneOperationType = SceneOperation['type'];
|
|
142
|
+
declare const SCENE_OPERATION_TYPES: readonly SceneOperationType[];
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Page size presets, channel-size output presets, and export math for the
|
|
146
|
+
* design canvas.
|
|
147
|
+
*
|
|
148
|
+
* Size presets (SizePreset / SIZE_PRESETS) describe page dimensions for the
|
|
149
|
+
* new-page dialog. Export presets (ExportPreset / EXPORT_PRESETS) pin pixel
|
|
150
|
+
* ratio, output dimensions, bleed, and format for the export dialog and the
|
|
151
|
+
* MCP export tool. Channel presets (ChannelPreset / CHANNEL_PRESETS) are the
|
|
152
|
+
* fixed output resolutions the export UI offers; `scaleForPreset` + the
|
|
153
|
+
* letterbox helper derive Konva stage parameters from them.
|
|
154
|
+
*
|
|
155
|
+
* All dimensions are CSS pixels at 96 DPI unless noted otherwise.
|
|
156
|
+
*/
|
|
157
|
+
|
|
158
|
+
interface SizePreset {
|
|
159
|
+
id: string;
|
|
160
|
+
label: string;
|
|
161
|
+
category: 'social' | 'print' | 'presentation' | 'custom';
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
164
|
+
}
|
|
165
|
+
declare const SIZE_PRESETS: readonly SizePreset[];
|
|
166
|
+
declare function findPreset(id: string): SizePreset | null;
|
|
167
|
+
/** Match a (width, height) pair against the preset table. Returns the first
|
|
168
|
+
* exact match or null — used to drive the dropdown selection indicator. */
|
|
169
|
+
declare function matchPreset(width: number, height: number): SizePreset | null;
|
|
170
|
+
type ExportFormat = 'png' | 'jpeg';
|
|
171
|
+
/**
|
|
172
|
+
* Export quality preset — pins pixel density, optional output dimensions,
|
|
173
|
+
* bleed inclusion, and raster format so callers pass a preset id rather than
|
|
174
|
+
* a full parameter bag.
|
|
175
|
+
*
|
|
176
|
+
* `outputWidth` / `outputHeight`: when non-null, the pixel ratio is derived
|
|
177
|
+
* from the crop rect width (see `scaleForPreset`) so the output is exactly
|
|
178
|
+
* this many pixels wide. When null, `pixelRatio` applies directly.
|
|
179
|
+
*/
|
|
180
|
+
interface ExportPreset {
|
|
181
|
+
name: string;
|
|
182
|
+
/** Target pixels-per-document-px for stage.toDataURL. */
|
|
183
|
+
pixelRatio: number;
|
|
184
|
+
outputWidth: number | null;
|
|
185
|
+
outputHeight: number | null;
|
|
186
|
+
/** Whether bleed margins are included in the crop rect. */
|
|
187
|
+
includeBleed: boolean;
|
|
188
|
+
format: ExportFormat;
|
|
189
|
+
}
|
|
190
|
+
declare const EXPORT_PRESETS: Record<string, ExportPreset>;
|
|
191
|
+
interface ExportCropRect {
|
|
192
|
+
/** Page-coordinate origin. Negative when bleed extends outside page bounds. */
|
|
193
|
+
x: number;
|
|
194
|
+
y: number;
|
|
195
|
+
width: number;
|
|
196
|
+
height: number;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Crop rectangle in page coordinates for a given page, optionally expanded to
|
|
200
|
+
* include bleed margins. Bleed extends OUTSIDE the page bounds, so the origin
|
|
201
|
+
* goes negative when bleed is included.
|
|
202
|
+
*
|
|
203
|
+
* When `includeBleed` is true but `page.bleed` is null, the page rect is
|
|
204
|
+
* returned unchanged — the caller must not assume symmetric expansion.
|
|
205
|
+
*/
|
|
206
|
+
declare function bleedAwareExportBounds(page: ScenePage, includeBleed: boolean): ExportCropRect;
|
|
207
|
+
/**
|
|
208
|
+
* Pixel ratio for stage.toDataURL given a crop rect and an export preset.
|
|
209
|
+
*
|
|
210
|
+
* When the preset pins `outputWidth`, the ratio is derived from the crop rect
|
|
211
|
+
* width so the final raster is exactly that many pixels wide. When there is no
|
|
212
|
+
* output pin, the preset's declared `pixelRatio` is returned directly.
|
|
213
|
+
*
|
|
214
|
+
* The crop rect must already account for bleed inclusion before this call.
|
|
215
|
+
*/
|
|
216
|
+
declare function scaleForPreset(preset: ExportPreset, cropRect: ExportCropRect): number;
|
|
217
|
+
interface ChannelPreset {
|
|
218
|
+
id: string;
|
|
219
|
+
label: string;
|
|
220
|
+
width: number;
|
|
221
|
+
height: number;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Fixed output resolution presets for the channel/platform export dialog.
|
|
225
|
+
* Width × height are OUTPUT pixels (the raster the export produces), not page
|
|
226
|
+
* CSS px — they describe the target delivery format, not the canvas layout.
|
|
227
|
+
* The a4_print_2480x3508 preset corresponds to A4 at 300 dpi.
|
|
228
|
+
*/
|
|
229
|
+
declare const CHANNEL_PRESETS: readonly ChannelPreset[];
|
|
230
|
+
type ChannelPresetId = (typeof CHANNEL_PRESETS)[number]['id'];
|
|
231
|
+
/** Throws when the id is unknown — callers should only pass ids sourced from
|
|
232
|
+
* `CHANNEL_PRESETS`. */
|
|
233
|
+
declare function requireChannelPreset(id: string): ChannelPreset;
|
|
234
|
+
interface ChannelScaleResult {
|
|
235
|
+
/**
|
|
236
|
+
* Konva stage pixelRatio: the stage logical size stays at page dimensions;
|
|
237
|
+
* the backing canvas renders at `pixelRatio × page` px. Setting Konva's
|
|
238
|
+
* pixelRatio to this value yields an output canvas exactly
|
|
239
|
+
* `channelPreset.width × channelPreset.height` pixels.
|
|
240
|
+
*/
|
|
241
|
+
pixelRatio: number;
|
|
242
|
+
/**
|
|
243
|
+
* Horizontal letterbox offset in PAGE-coordinate px. Add to the stage x
|
|
244
|
+
* translation so the page is centered horizontally in the output frame.
|
|
245
|
+
* Zero when the page fills the full width after scaling.
|
|
246
|
+
*/
|
|
247
|
+
offsetX: number;
|
|
248
|
+
/**
|
|
249
|
+
* Vertical letterbox offset in PAGE-coordinate px. Add to the stage y
|
|
250
|
+
* translation. Zero when the page fills the full height.
|
|
251
|
+
*/
|
|
252
|
+
offsetY: number;
|
|
253
|
+
fit: 'contain';
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Computes the Konva stage parameters to render `page` centered inside
|
|
257
|
+
* `channelPreset` without cropping (contain / letterbox).
|
|
258
|
+
*
|
|
259
|
+
* Exact-ratio fast path: when page and preset share the same aspect ratio
|
|
260
|
+
* (within 1e-9 floating-point tolerance) both offsets are 0 and pixelRatio
|
|
261
|
+
* is exact.
|
|
262
|
+
*
|
|
263
|
+
* Example — 1080×1080 page into 1920×1080 preset:
|
|
264
|
+
* scaleX = 1920/1080 ≈ 1.7778, scaleY = 1080/1080 = 1.0
|
|
265
|
+
* pixelRatio = 1.0, rendered page = 1080×1080 px
|
|
266
|
+
* offsetX = (1920 − 1080) / 2 / 1.0 = 420 page-px, offsetY = 0
|
|
267
|
+
*/
|
|
268
|
+
declare function scalePageForChannelPreset(page: Pick<ScenePage, 'width' | 'height'>, channelPreset: ChannelPreset): ChannelScaleResult;
|
|
269
|
+
/**
|
|
270
|
+
* Export rectangle in page coordinates that includes bleed margins when
|
|
271
|
+
* present. When `page.bleed` is null, returns the trim rectangle (origin 0,0;
|
|
272
|
+
* size = page dimensions).
|
|
273
|
+
*
|
|
274
|
+
* The bleed rectangle extends OUTSIDE the page: x and y are negative (bleed
|
|
275
|
+
* bleeds off the left/top edge), width and height exceed the page by the
|
|
276
|
+
* combined bleed on each axis. Pass into Konva's clip/export bounds to
|
|
277
|
+
* include the bleed zone in the render.
|
|
278
|
+
*
|
|
279
|
+
* Named `bleedAwareExportRect` to avoid collision with the two-arg
|
|
280
|
+
* `bleedAwareExportBounds(page, includeBleed)` above.
|
|
281
|
+
*/
|
|
282
|
+
declare function bleedAwareExportRect(page: Pick<ScenePage, 'width' | 'height' | 'bleed'>): Bounds;
|
|
283
|
+
|
|
284
|
+
export { type AddElementOperation as A, type BindSlotOperation as B, CHANNEL_PRESETS as C, type DeleteElementOperation as D, EXPORT_PRESETS as E, scaleForPreset as F, type GroupElementsOperation as G, scalePageForChannelPreset as H, type ReorderElementOperation as R, SCENE_OPERATION_TYPES as S, type UngroupElementOperation as U, type AddPageOperation as a, type ApplyDataOperation as b, type ChannelPreset as c, type ChannelPresetId as d, type ChannelScaleResult as e, type DeletePageOperation as f, type DuplicatePageOperation as g, type ExportCropRect as h, type ExportFormat as i, type ExportPreset as j, type ReorderPageOperation as k, SIZE_PRESETS as l, type SceneAttrsPatch as m, type SceneOperation as n, type SceneOperationType as o, type ScenePlan as p, type SetAttrsOperation as q, type SetDocumentTitleOperation as r, type SetPageGuidesOperation as s, type SetPagePropsOperation as t, type SizePreset as u, bleedAwareExportBounds as v, bleedAwareExportRect as w, findPreset as x, matchPreset as y, requireChannelPreset as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { AppToolRuntimeExecutor, CapabilityTokenOptions, DispatchOptions, ExpiringCapabilityTokenOptions, HandleToolRequestOptions, RuntimeExecutorOptions, ToolInputError, createAppToolRuntimeExecutor, createCapabilityToken, createExpiringCapabilityToken, dispatchAppTool, handleAppToolRequest, outcomeStatus, verifyCapabilityToken, verifyExpiringCapabilityToken } from './tools/index.js';
|
|
1
|
+
export { AppToolRuntimeExecutor, CapabilityTokenOptions, DispatchOptions, ExpiringCapabilityTokenOptions, HandleToolRequestOptions, ResolveToolCapabilitiesOptions, ResolvedToolCapabilities, RuntimeExecutorOptions, ToolCapability, ToolInputError, createAppToolRuntimeExecutor, createCapabilityToken, createExpiringCapabilityToken, dispatchAppTool, handleAppToolRequest, outcomeStatus, resolveToolCapabilities, restrictTaxonomy, verifyCapabilityToken, verifyExpiringCapabilityToken } from './tools/index.js';
|
|
2
2
|
export { A as APP_TOOL_NAMES, a as AppToolMcpServer, b as AppToolName, c as AuthenticateOptions, B as BuildHttpMcpServerOptions, d as BuildMcpServerOptions, D as DEFAULT_APP_TOOL_PATHS, e as DEFAULT_HEADER_NAMES, O as OpenAIFunctionTool, T as ToolAuthResult, f as ToolHeaderNames, g as authenticateToolRequest, h as buildAppToolMcpServer, i as buildAppToolOpenAITools, j as buildHttpMcpServer, k as isAppToolName, r as readToolArgs } from './mcp-CIupfjxV.js';
|
|
3
|
+
export { C as CreateMcpToolHandlerOptions, M as MCP_PROTOCOL_VERSIONS, a as McpProtocolVersion, b as McpServerInfo, c as McpToolDefinition, d as createMcpToolHandler } from './mcp-rpc-DLw_r9PQ.js';
|
|
3
4
|
export { A as AddCitationArgs, a as AddCitationResult, b as AppToolContext, c as AppToolHandlers, d as AppToolOutcome, e as AppToolProducedEvent, f as AppToolTaxonomy, R as RenderUiArgs, g as RenderUiResult, S as ScheduleFollowupArgs, h as ScheduleFollowupResult, i as SubmitProposalArgs, j as SubmitProposalResult } from './types-By4B3K37.js';
|
|
4
5
|
export { BuildDelegationOptions, DELEGATION_MCP_SERVER_KEY, DELEGATION_TOOLS, DelegationMcpServer, buildDelegationMcpServer, delegationMcpForConfig } from './delegation/index.js';
|
|
5
6
|
export { BrokerToken, BrokerTokenMinter, BrokerTokenProvider, BrokerTokenProviderOptions, ConsentUrlInput, buildConsentUrl, createBrokerTokenProvider } from './tangle/index.js';
|
|
@@ -23,6 +24,10 @@ export { DistributionSummary, FlowSpan, FlowTrace, LoopTraceEventLike, MissionFl
|
|
|
23
24
|
export { M as MIN_SEQUENCE_CLIP_FRAMES, N as NewSequenceClip, a as NewSequenceDecision, b as NewSequenceTrack, S as SequenceClip, c as SequenceClipMedia, d as SequenceClipPatch, e as SequenceDecision, f as SequenceExportFormat, g as SequenceExportRecord, h as SequenceExportStatus, i as SequenceFrameSnapshot, j as SequenceMediaKind, k as SequenceMeta, l as SequenceStatus, m as SequenceStore, n as SequenceStoreScope, o as SequenceTimeline, p as SequenceTrack, q as SequenceTrackKind, T as TimelineClipBounds, r as TimelineInterval, s as assertClipFitsSequence, t as chooseCaptionPlacement, u as clampClipDuration, v as clampClipStart, w as formatSeconds, x as formatTimecode, y as framesToSeconds, z as secondsToFrames, A as snapshotFrame, B as trackIntervals } from './store-gckrNq-g.js';
|
|
24
25
|
export { A as AddCaptionOperation, C as CaptionTargetResolution, a as CreateTrackOperation, D as DeleteClipOperation, E as ExtendSequenceOperation, M as MoveClipOperation, P as PlaceClipOperation, Q as QueueExportOperation, S as SEQUENCE_OPERATION_TYPES, b as SequenceApplyResult, c as SequenceOperation, d as SequenceOperationContext, e as SequenceOperationType, f as SequencePlan, g as SetClipDisabledOperation, h as SetClipTextOperation, i as SplitClipOperation, T as TrimClipOperation, j as applySequenceOperation, k as applySequenceOperations, l as assertSequenceMediaUrl, m as captionTrackNameForLanguage, n as lastClipEndFrame, p as parseSequenceOperations, r as resolveCaptionPlacement, o as resolveCaptionTarget, q as resolvePlaceClipTrack, v as validateAddCaption, s as validateCreateTrack, t as validateDeleteClip, u as validateExtendSequence, w as validateMoveClip, x as validatePlaceClip, y as validateQueueExport, z as validateSequenceOperation, B as validateSequenceOperations, F as validateSetClipDisabled, G as validateSetClipText, H as validateSplitClip, I as validateTrimClip } from './apply-Cp8c3K9D.js';
|
|
25
26
|
export { BuildCaptionChunksOptions, BuildSequencesMcpServerEntryOptions, CaptionChunk, CaptionCoverageEntry, CaptionExportOptions, ContactSheetEntry, ContactSheetManifest, CreateSequencesMcpHandlerOptions, DEFAULT_SEQUENCES_MCP_DESCRIPTION, LanguageFanoutOptions, MAX_CAPTION_BATCH, OtioClip, OtioExternalReference, OtioGap, OtioMissingReference, OtioRationalTime, OtioStack, OtioTimeRange, OtioTimeline, OtioTrack, SEQUENCES_MCP_PROTOCOL_VERSIONS, SEQUENCE_EXPORT_FORMATS, SEQUENCE_MCP_TOOLS, SEQUENCE_MEDIA_KINDS, SEQUENCE_TRACK_KINDS, SequenceMcpToolDefinition, SequenceMcpToolEnv, SequencesMcpServerInfo, TranscriptSegment, buildCaptionChunks, buildContactSheetManifest, buildEdl, buildOtio, buildSequencesMcpServerEntry, buildSrt, buildVtt, captionCoverage, createSequencesMcpHandler, findSequenceMcpTool, normalizeLanguageTag, planLanguageFanout } from './sequences/index.js';
|
|
27
|
+
export { B as Bounds, E as EllipseElement, G as GroupElement, I as ImageElement, L as LineElement, N as NewPageOptions, P as PageBleed, a as PageGuides, R as RectElement, S as SCENE_ELEMENT_KINDS, b as SCENE_SCHEMA_VERSION, c as SceneDocument, d as SceneElement, e as SceneElementBase, f as SceneElementKind, g as ScenePage, h as SceneSettings, T as TextElement, V as VideoElement, i as assertColor, j as assertFinite, k as assertPositiveFinite, l as assertSceneMediaSrc, m as boundsIntersect, n as collectSlots, o as createEmptyDocument, p as createPage, q as elementAabb, r as elementExtent, s as estimateTextHeight, t as findElement, u as requireElement, v as requirePage } from './model-BHLN208Z.js';
|
|
28
|
+
export { A as AddElementOperation, a as AddPageOperation, b as ApplyDataOperation, B as BindSlotOperation, C as CHANNEL_PRESETS, c as ChannelPreset, d as ChannelPresetId, e as ChannelScaleResult, D as DeleteElementOperation, f as DeletePageOperation, g as DuplicatePageOperation, E as EXPORT_PRESETS, h as ExportCropRect, i as ExportFormat, j as ExportPreset, G as GroupElementsOperation, R as ReorderElementOperation, k as ReorderPageOperation, S as SCENE_OPERATION_TYPES, l as SIZE_PRESETS, m as SceneAttrsPatch, n as SceneOperation, o as SceneOperationType, p as ScenePlan, q as SetAttrsOperation, r as SetDocumentTitleOperation, s as SetPageGuidesOperation, t as SetPagePropsOperation, u as SizePreset, U as UngroupElementOperation, v as bleedAwareExportBounds, w as bleedAwareExportRect, x as findPreset, y as matchPreset, z as requireChannelPreset, F as scaleForPreset, H as scalePageForChannelPreset } from './export-presets-Dl5Aa5xj.js';
|
|
29
|
+
export { N as NewSceneDecision, S as SceneDecision, a as SceneDocumentRecord, b as SceneExportFormat, c as SceneExportRecord, d as SceneStore, e as SceneStoreScope } from './store-CUStmtdH.js';
|
|
30
|
+
export { ApplySceneOptions, BuildDesignCanvasMcpServerEntryOptions, CANVAS_ELEMENT_KINDS, CANVAS_MCP_TOOLS, CANVAS_MCP_TOOL_NAMES, CreateDesignCanvasMcpHandlerOptions, DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION, DesignCanvasMcpServerInfo, DesignCanvasMcpToolEnv, InstantiateOptions, SceneApplyResult, SlotFillKind, TemplateSlot, applyBindingsToDocument, applySceneOperation, applySceneOperations, buildDesignCanvasMcpServerEntry, createDesignCanvasMcpHandler, findCanvasMcpTool, instantiateTemplate, listTemplateSlots, storeApplyScenePlan, validateBindings, validateSceneOperation, validateSceneOperations, validateSlotValue } from './design-canvas/index.js';
|
|
26
31
|
export { C as CatalogModel, M as ModelCatalog, R as RouterModel, _ as __resetCatalogCache, b as buildCatalog, f as fetchModelCatalog, n as normalizeModelId } from './model-catalog-BEAEVDaa.js';
|
|
27
32
|
export { CompletionRequirement, CompletionVerdict, CorrectnessChecker, ProducedState, RuntimeEventLike, SatisfiedBy, TaskGold, createLlmCorrectnessChecker, extractProducedState, verifyCompletion, weightedComposite } from '@tangle-network/agent-eval';
|
|
28
33
|
export { C as CreateTangleRouterModelConfigOptions, D as DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR, a as DEFAULT_TANGLE_ROUTER_BASE_URL, R as ResolveModelOptions, b as ResolveUserTangleExecutionKeyForUserOptions, c as ResolveUserTangleExecutionKeyOptions, d as ResolvedTangleExecutionKey, T as TangleBillingEnforcementOptions, e as TangleExecutionEnvironment, f as TangleExecutionKeyError, g as TangleExecutionKeyErrorCode, h as TangleExecutionKeyHttpError, i as TangleExecutionKeySource, j as TangleModelConfig, k as createTangleRouterModelConfig, l as isTangleBillingEnforcementDisabled, m as isTangleExecutionKeyError, r as resolveTangleExecutionEnvironment, n as resolveTangleModelConfig, o as resolveUserTangleExecutionKey, p as resolveUserTangleExecutionKeyForUser, t as tangleExecutionKeyHttpError } from './model-CKzniMMr.js';
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,21 @@ import {
|
|
|
41
41
|
validateSetClipText,
|
|
42
42
|
validateSplitClip,
|
|
43
43
|
validateTrimClip
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-6UOE5CTA.js";
|
|
45
|
+
import {
|
|
46
|
+
CANVAS_ELEMENT_KINDS,
|
|
47
|
+
CANVAS_MCP_TOOLS,
|
|
48
|
+
CANVAS_MCP_TOOL_NAMES,
|
|
49
|
+
DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION,
|
|
50
|
+
SCENE_OPERATION_TYPES,
|
|
51
|
+
applyBindingsToDocument,
|
|
52
|
+
buildDesignCanvasMcpServerEntry,
|
|
53
|
+
createDesignCanvasMcpHandler,
|
|
54
|
+
findCanvasMcpTool,
|
|
55
|
+
instantiateTemplate,
|
|
56
|
+
listTemplateSlots,
|
|
57
|
+
validateBindings
|
|
58
|
+
} from "./chunk-7QCIYDGC.js";
|
|
45
59
|
import {
|
|
46
60
|
MIN_SEQUENCE_CLIP_FRAMES,
|
|
47
61
|
assertClipFitsSequence,
|
|
@@ -55,6 +69,40 @@ import {
|
|
|
55
69
|
snapshotFrame,
|
|
56
70
|
trackIntervals
|
|
57
71
|
} from "./chunk-ZYBWGSAZ.js";
|
|
72
|
+
import {
|
|
73
|
+
CHANNEL_PRESETS,
|
|
74
|
+
EXPORT_PRESETS,
|
|
75
|
+
SCENE_ELEMENT_KINDS,
|
|
76
|
+
SCENE_SCHEMA_VERSION,
|
|
77
|
+
SIZE_PRESETS,
|
|
78
|
+
applySceneOperation,
|
|
79
|
+
applySceneOperations,
|
|
80
|
+
assertColor,
|
|
81
|
+
assertFinite,
|
|
82
|
+
assertPositiveFinite,
|
|
83
|
+
assertSceneMediaSrc,
|
|
84
|
+
bleedAwareExportBounds,
|
|
85
|
+
bleedAwareExportRect,
|
|
86
|
+
boundsIntersect,
|
|
87
|
+
collectSlots,
|
|
88
|
+
createEmptyDocument,
|
|
89
|
+
createPage,
|
|
90
|
+
elementAabb,
|
|
91
|
+
elementExtent,
|
|
92
|
+
estimateTextHeight,
|
|
93
|
+
findElement,
|
|
94
|
+
findPreset,
|
|
95
|
+
matchPreset,
|
|
96
|
+
requireChannelPreset,
|
|
97
|
+
requireElement,
|
|
98
|
+
requirePage,
|
|
99
|
+
scaleForPreset,
|
|
100
|
+
scalePageForChannelPreset,
|
|
101
|
+
storeApplyScenePlan,
|
|
102
|
+
validateSceneOperation,
|
|
103
|
+
validateSceneOperations,
|
|
104
|
+
validateSlotValue
|
|
105
|
+
} from "./chunk-JZAJE3JL.js";
|
|
58
106
|
import {
|
|
59
107
|
DEFAULT_MISSION_STEP_KINDS,
|
|
60
108
|
MISSION_CONTROL_CHANNEL_ID,
|
|
@@ -197,17 +245,21 @@ import {
|
|
|
197
245
|
createCapabilityToken,
|
|
198
246
|
createExpiringCapabilityToken,
|
|
199
247
|
handleAppToolRequest,
|
|
248
|
+
resolveToolCapabilities,
|
|
249
|
+
restrictTaxonomy,
|
|
200
250
|
verifyCapabilityToken,
|
|
201
251
|
verifyExpiringCapabilityToken
|
|
202
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-SSX2A6XX.js";
|
|
203
253
|
import {
|
|
204
254
|
DEFAULT_APP_TOOL_PATHS,
|
|
205
255
|
DEFAULT_HEADER_NAMES,
|
|
256
|
+
MCP_PROTOCOL_VERSIONS,
|
|
206
257
|
authenticateToolRequest,
|
|
207
258
|
buildAppToolMcpServer,
|
|
208
259
|
buildHttpMcpServer,
|
|
260
|
+
createMcpToolHandler,
|
|
209
261
|
readToolArgs
|
|
210
|
-
} from "./chunk-
|
|
262
|
+
} from "./chunk-A76ZHWNF.js";
|
|
211
263
|
import {
|
|
212
264
|
DELEGATION_MCP_SERVER_KEY,
|
|
213
265
|
DELEGATION_TOOLS,
|
|
@@ -270,9 +322,14 @@ export {
|
|
|
270
322
|
APP_TOOL_NAMES,
|
|
271
323
|
ApprovalEventSchema,
|
|
272
324
|
BrandTokensSchema,
|
|
325
|
+
CANVAS_ELEMENT_KINDS,
|
|
326
|
+
CANVAS_MCP_TOOLS,
|
|
327
|
+
CANVAS_MCP_TOOL_NAMES,
|
|
328
|
+
CHANNEL_PRESETS,
|
|
273
329
|
ConversionMetricsSchema,
|
|
274
330
|
CopyContentSchema,
|
|
275
331
|
DEFAULT_APP_TOOL_PATHS,
|
|
332
|
+
DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION,
|
|
276
333
|
DEFAULT_HARNESS,
|
|
277
334
|
DEFAULT_HEADER_NAMES,
|
|
278
335
|
DEFAULT_MISSION_STEP_KINDS,
|
|
@@ -282,23 +339,29 @@ export {
|
|
|
282
339
|
DEFAULT_TANGLE_ROUTER_BASE_URL,
|
|
283
340
|
DELEGATION_MCP_SERVER_KEY,
|
|
284
341
|
DELEGATION_TOOLS,
|
|
342
|
+
EXPORT_PRESETS,
|
|
285
343
|
EmailContentSchema,
|
|
286
344
|
HubExecClient,
|
|
287
345
|
ImageContentSchema,
|
|
288
346
|
KNOWN_HARNESSES,
|
|
289
347
|
MAX_CAPTION_BATCH,
|
|
348
|
+
MCP_PROTOCOL_VERSIONS,
|
|
290
349
|
MIN_SEQUENCE_CLIP_FRAMES,
|
|
291
350
|
MISSION_CONTROL_CHANNEL_ID,
|
|
292
351
|
MissionConcurrencyError,
|
|
293
352
|
PRESET_MIGRATION_SQL,
|
|
294
353
|
PRESET_TABLES,
|
|
295
354
|
RetryableStepError,
|
|
355
|
+
SCENE_ELEMENT_KINDS,
|
|
356
|
+
SCENE_OPERATION_TYPES,
|
|
357
|
+
SCENE_SCHEMA_VERSION,
|
|
296
358
|
SEQUENCES_MCP_PROTOCOL_VERSIONS,
|
|
297
359
|
SEQUENCE_EXPORT_FORMATS,
|
|
298
360
|
SEQUENCE_MCP_TOOLS,
|
|
299
361
|
SEQUENCE_MEDIA_KINDS,
|
|
300
362
|
SEQUENCE_OPERATION_TYPES,
|
|
301
363
|
SEQUENCE_TRACK_KINDS,
|
|
364
|
+
SIZE_PRESETS,
|
|
302
365
|
TURN_EVENTS_MIGRATION_SQL,
|
|
303
366
|
TangleExecutionKeyError,
|
|
304
367
|
ToolInputError,
|
|
@@ -306,15 +369,25 @@ export {
|
|
|
306
369
|
__resetCatalogCache,
|
|
307
370
|
addSecurityHeaders,
|
|
308
371
|
agentAppConfigJsonSchema,
|
|
372
|
+
applyBindingsToDocument,
|
|
309
373
|
applyMissionEvent,
|
|
374
|
+
applySceneOperation,
|
|
375
|
+
applySceneOperations,
|
|
310
376
|
applySequenceOperation,
|
|
311
377
|
applySequenceOperations,
|
|
312
378
|
asMissionStreamEvent,
|
|
313
379
|
asRecord,
|
|
314
380
|
asString,
|
|
315
381
|
assertClipFitsSequence,
|
|
382
|
+
assertColor,
|
|
383
|
+
assertFinite,
|
|
384
|
+
assertPositiveFinite,
|
|
385
|
+
assertSceneMediaSrc,
|
|
316
386
|
assertSequenceMediaUrl,
|
|
317
387
|
authenticateToolRequest,
|
|
388
|
+
bleedAwareExportBounds,
|
|
389
|
+
bleedAwareExportRect,
|
|
390
|
+
boundsIntersect,
|
|
318
391
|
budgetGateProposalId,
|
|
319
392
|
buildAgentMissionPlan,
|
|
320
393
|
buildAppToolMcpServer,
|
|
@@ -324,6 +397,7 @@ export {
|
|
|
324
397
|
buildConsentUrl,
|
|
325
398
|
buildContactSheetManifest,
|
|
326
399
|
buildDelegationMcpServer,
|
|
400
|
+
buildDesignCanvasMcpServerEntry,
|
|
327
401
|
buildEdl,
|
|
328
402
|
buildFlowTrace,
|
|
329
403
|
buildHttpMcpServer,
|
|
@@ -344,6 +418,7 @@ export {
|
|
|
344
418
|
clearCookieHeader,
|
|
345
419
|
coalesceDeltas,
|
|
346
420
|
coerceHarness,
|
|
421
|
+
collectSlots,
|
|
347
422
|
composeMissionFlowTrace,
|
|
348
423
|
createAgentRuntime,
|
|
349
424
|
createAppToolRuntimeExecutor,
|
|
@@ -351,16 +426,20 @@ export {
|
|
|
351
426
|
createCapabilityToken,
|
|
352
427
|
createD1KnowledgeStateAccessor,
|
|
353
428
|
createD1TurnEventStore,
|
|
429
|
+
createDesignCanvasMcpHandler,
|
|
430
|
+
createEmptyDocument,
|
|
354
431
|
createExpiringCapabilityToken,
|
|
355
432
|
createFieldCrypto,
|
|
356
433
|
createInMemoryMissionStore,
|
|
357
434
|
createKnowledgeLoop,
|
|
358
435
|
createLlmCorrectnessChecker,
|
|
436
|
+
createMcpToolHandler,
|
|
359
437
|
createMemoryTurnEventStore,
|
|
360
438
|
createMissionEngine,
|
|
361
439
|
createMissionService,
|
|
362
440
|
createMissionTraceContext,
|
|
363
441
|
createOpenAICompatStreamTurn,
|
|
442
|
+
createPage,
|
|
364
443
|
createPlatformBalanceManager,
|
|
365
444
|
createPresetDrizzleSchema,
|
|
366
445
|
createPresetFieldCrypto,
|
|
@@ -386,20 +465,27 @@ export {
|
|
|
386
465
|
deriveSignals,
|
|
387
466
|
detectSpans,
|
|
388
467
|
dispatchAppTool,
|
|
468
|
+
elementAabb,
|
|
469
|
+
elementExtent,
|
|
389
470
|
encodeEvent,
|
|
390
471
|
encryptAesGcm,
|
|
391
472
|
encryptBytes,
|
|
392
473
|
encryptWithKey,
|
|
474
|
+
estimateTextHeight,
|
|
393
475
|
extractProducedState,
|
|
394
476
|
extractRequestContext,
|
|
395
477
|
fetchModelCatalog,
|
|
396
478
|
finalizeAssistantParts,
|
|
479
|
+
findCanvasMcpTool,
|
|
480
|
+
findElement,
|
|
481
|
+
findPreset,
|
|
397
482
|
findSequenceMcpTool,
|
|
398
483
|
formatSeconds,
|
|
399
484
|
formatTimecode,
|
|
400
485
|
framesToSeconds,
|
|
401
486
|
getPartKey,
|
|
402
487
|
handleAppToolRequest,
|
|
488
|
+
instantiateTemplate,
|
|
403
489
|
invokeIntegrationHub,
|
|
404
490
|
isAppToolName,
|
|
405
491
|
isHarness,
|
|
@@ -408,8 +494,10 @@ export {
|
|
|
408
494
|
isTangleBillingEnforcementDisabled,
|
|
409
495
|
isTangleExecutionKeyError,
|
|
410
496
|
lastClipEndFrame,
|
|
497
|
+
listTemplateSlots,
|
|
411
498
|
loopTraceEventsToFlowSpans,
|
|
412
499
|
maskSpans,
|
|
500
|
+
matchPreset,
|
|
413
501
|
mergeMissionState,
|
|
414
502
|
mergePersistedPart,
|
|
415
503
|
mergeSurfaceOverlay,
|
|
@@ -437,6 +525,9 @@ export {
|
|
|
437
525
|
renderHistogram,
|
|
438
526
|
renderWaterfall,
|
|
439
527
|
replayTurnEvents,
|
|
528
|
+
requireChannelPreset,
|
|
529
|
+
requireElement,
|
|
530
|
+
requirePage,
|
|
440
531
|
requireString,
|
|
441
532
|
resolveCaptionPlacement,
|
|
442
533
|
resolveCaptionTarget,
|
|
@@ -446,20 +537,25 @@ export {
|
|
|
446
537
|
resolveSessionHarness,
|
|
447
538
|
resolveTangleExecutionEnvironment,
|
|
448
539
|
resolveTangleModelConfig,
|
|
540
|
+
resolveToolCapabilities,
|
|
449
541
|
resolveToolId,
|
|
450
542
|
resolveToolName,
|
|
451
543
|
resolveUserTangleExecutionKey,
|
|
452
544
|
resolveUserTangleExecutionKeyForUser,
|
|
545
|
+
restrictTaxonomy,
|
|
453
546
|
revealSpan,
|
|
454
547
|
reviewCandidate,
|
|
455
548
|
runAppToolLoop,
|
|
456
549
|
safeParseAssetSpec,
|
|
550
|
+
scaleForPreset,
|
|
551
|
+
scalePageForChannelPreset,
|
|
457
552
|
secondsToFrames,
|
|
458
553
|
serializeCookie,
|
|
459
554
|
snapshotFrame,
|
|
460
555
|
stepActivityFlowTrace,
|
|
461
556
|
stepAgentActivity,
|
|
462
557
|
stepGateProposalId,
|
|
558
|
+
storeApplyScenePlan,
|
|
463
559
|
streamAppToolLoop,
|
|
464
560
|
summarize,
|
|
465
561
|
tangleExecutionKeyHttpError,
|
|
@@ -468,16 +564,20 @@ export {
|
|
|
468
564
|
traceEnv,
|
|
469
565
|
trackIntervals,
|
|
470
566
|
validateAddCaption,
|
|
567
|
+
validateBindings,
|
|
471
568
|
validateCreateTrack,
|
|
472
569
|
validateDeleteClip,
|
|
473
570
|
validateExtendSequence,
|
|
474
571
|
validateMoveClip,
|
|
475
572
|
validatePlaceClip,
|
|
476
573
|
validateQueueExport,
|
|
574
|
+
validateSceneOperation,
|
|
575
|
+
validateSceneOperations,
|
|
477
576
|
validateSequenceOperation,
|
|
478
577
|
validateSequenceOperations,
|
|
479
578
|
validateSetClipDisabled,
|
|
480
579
|
validateSetClipText,
|
|
580
|
+
validateSlotValue,
|
|
481
581
|
validateSplitClip,
|
|
482
582
|
validateTrimClip,
|
|
483
583
|
verifyCapabilityToken,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server.
|
|
3
|
+
* Stateless, Workers-compatible: no session table, no SSE — every request gets
|
|
4
|
+
* a single `application/json` response, which the streamable-HTTP transport
|
|
5
|
+
* explicitly permits for tools-only servers.
|
|
6
|
+
*
|
|
7
|
+
* Protocol surface:
|
|
8
|
+
* initialize → echo client's protocolVersion if supported, else latest
|
|
9
|
+
* ping → empty result {}
|
|
10
|
+
* notifications/* (no `id`) → 202 with no body
|
|
11
|
+
* tools/list → tool manifest
|
|
12
|
+
* tools/call → run + surface execution failures as isError text results
|
|
13
|
+
* anything else → -32601
|
|
14
|
+
*
|
|
15
|
+
* Execution failures (argument shape, validation, store throws) become `isError`
|
|
16
|
+
* tool results carrying the thrown message verbatim — the model reads WHY and
|
|
17
|
+
* retries. Protocol misuse becomes a JSON-RPC error object.
|
|
18
|
+
*/
|
|
19
|
+
declare const MCP_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
20
|
+
type McpProtocolVersion = (typeof MCP_PROTOCOL_VERSIONS)[number];
|
|
21
|
+
interface McpServerInfo {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
}
|
|
25
|
+
/** One tool entry in the registry the handler owns. */
|
|
26
|
+
interface McpToolDefinition<TEnv = Record<string, never>> {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
/** JSON Schema for the `params.arguments` object. */
|
|
30
|
+
inputSchema: Record<string, unknown>;
|
|
31
|
+
/** Receive validated (Record) args + the env the handler threaded; throw to
|
|
32
|
+
* surface an isError result — never throw for protocol/framing issues. */
|
|
33
|
+
run(args: Record<string, unknown>, env: TEnv): Promise<unknown>;
|
|
34
|
+
}
|
|
35
|
+
interface CreateMcpToolHandlerOptions<TEnv = Record<string, never>> {
|
|
36
|
+
serverInfo: McpServerInfo;
|
|
37
|
+
/** Full tool list; order IS the tools/list order. */
|
|
38
|
+
tools: McpToolDefinition<TEnv>[];
|
|
39
|
+
/** Per-request environment threaded into every `run` call. If your tools are
|
|
40
|
+
* stateless (or carry state through closure) pass an empty builder:
|
|
41
|
+
* `() => ({} as TEnv)`. */
|
|
42
|
+
buildEnv(request: Request): TEnv | Promise<TEnv>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build a request handler for a tools-only MCP server. The returned function
|
|
46
|
+
* accepts a standard `Request` and resolves to a `Response` — mount it on any
|
|
47
|
+
* Cloudflare Worker route or Remix `loader`.
|
|
48
|
+
*
|
|
49
|
+
* The handler calls `buildEnv` exactly ONCE per `tools/call` request (after
|
|
50
|
+
* the tool is found, before `run`) — non-`tools/call` paths skip it entirely
|
|
51
|
+
* so metadata requests do not pay env-build cost.
|
|
52
|
+
*/
|
|
53
|
+
declare function createMcpToolHandler<TEnv = Record<string, never>>(opts: CreateMcpToolHandlerOptions<TEnv>): (request: Request) => Promise<Response>;
|
|
54
|
+
|
|
55
|
+
export { type CreateMcpToolHandlerOptions as C, MCP_PROTOCOL_VERSIONS as M, type McpProtocolVersion as a, type McpServerInfo as b, type McpToolDefinition as c, createMcpToolHandler as d };
|