@roam-research/roam-tools-core 0.4.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/README.md +17 -0
- package/dist/client.d.ts +34 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +275 -0
- package/dist/connect.d.ts +10 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +477 -0
- package/dist/graph-resolver.d.ts +54 -0
- package/dist/graph-resolver.d.ts.map +1 -0
- package/dist/graph-resolver.js +338 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/operations/blocks.d.ts +120 -0
- package/dist/operations/blocks.d.ts.map +1 -0
- package/dist/operations/blocks.js +108 -0
- package/dist/operations/files.d.ts +43 -0
- package/dist/operations/files.d.ts.map +1 -0
- package/dist/operations/files.js +175 -0
- package/dist/operations/graphs.d.ts +26 -0
- package/dist/operations/graphs.d.ts.map +1 -0
- package/dist/operations/graphs.js +214 -0
- package/dist/operations/navigation.d.ts +32 -0
- package/dist/operations/navigation.d.ts.map +1 -0
- package/dist/operations/navigation.js +54 -0
- package/dist/operations/pages.d.ts +63 -0
- package/dist/operations/pages.d.ts.map +1 -0
- package/dist/operations/pages.js +59 -0
- package/dist/operations/query.d.ts +34 -0
- package/dist/operations/query.d.ts.map +1 -0
- package/dist/operations/query.js +46 -0
- package/dist/operations/search.d.ts +37 -0
- package/dist/operations/search.d.ts.map +1 -0
- package/dist/operations/search.js +33 -0
- package/dist/roam-api.d.ts +32 -0
- package/dist/roam-api.d.ts.map +1 -0
- package/dist/roam-api.js +50 -0
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +276 -0
- package/dist/types.d.ts +235 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +90 -0
- package/package.json +41 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
// src/core/graph-resolver.ts
|
|
2
|
+
// Stateless config-based graph resolution with token authentication
|
|
3
|
+
import { readFile, writeFile, chmod, stat } from "fs/promises";
|
|
4
|
+
import { homedir } from "os";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
import { RoamMcpConfigSchema, RoamError, ErrorCodes, CONFIG_VERSION, } from "./types.js";
|
|
7
|
+
// Warning suppression flags (prevent spamming on every tool call)
|
|
8
|
+
let permissionCheckDone = false;
|
|
9
|
+
let dedupWarningShown = false;
|
|
10
|
+
async function getLocalApiConfig() {
|
|
11
|
+
try {
|
|
12
|
+
const configFile = join(homedir(), ".roam-local-api.json");
|
|
13
|
+
const content = await readFile(configFile, "utf-8");
|
|
14
|
+
return JSON.parse(content);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return { port: 3333 }; // Default port
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export async function getPort() {
|
|
21
|
+
const config = await getLocalApiConfig();
|
|
22
|
+
return config.port;
|
|
23
|
+
}
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// MCP Config Loading (from ~/.roam-tools.json)
|
|
26
|
+
// ============================================================================
|
|
27
|
+
const CONFIG_PATH = join(homedir(), ".roam-tools.json");
|
|
28
|
+
/**
|
|
29
|
+
* Write config file with restricted permissions (owner read/write only).
|
|
30
|
+
*/
|
|
31
|
+
async function writeConfigFile(path, data) {
|
|
32
|
+
await writeFile(path, data, { mode: 0o600 });
|
|
33
|
+
// Also chmod in case the file already existed with wrong permissions
|
|
34
|
+
await chmod(path, 0o600);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check that the config file version is not newer than what this client supports.
|
|
38
|
+
* Must run on raw parsed JSON BEFORE Zod validation — a future version may change
|
|
39
|
+
* the schema structure, and Zod would reject it with a confusing error.
|
|
40
|
+
*/
|
|
41
|
+
function checkConfigVersion(parsed) {
|
|
42
|
+
const version = typeof parsed.version === "number" ? parsed.version : 1;
|
|
43
|
+
if (version > CONFIG_VERSION) {
|
|
44
|
+
throw new RoamError(`Your ~/.roam-tools.json (version ${version}) was written by a newer version of Roam tools. ` +
|
|
45
|
+
`This client only supports config version ${CONFIG_VERSION}. ` +
|
|
46
|
+
`Please update @roam-research/roam-mcp and @roam-research/roam-cli to the latest version.`, ErrorCodes.CONFIG_TOO_NEW, { configVersion: version, supportedVersion: CONFIG_VERSION });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export async function getMcpConfig() {
|
|
50
|
+
let content;
|
|
51
|
+
try {
|
|
52
|
+
content = await readFile(CONFIG_PATH, "utf-8");
|
|
53
|
+
// Check file permissions (Unix only — skip on Windows)
|
|
54
|
+
if (!permissionCheckDone) {
|
|
55
|
+
permissionCheckDone = true;
|
|
56
|
+
try {
|
|
57
|
+
const fileStat = await stat(CONFIG_PATH);
|
|
58
|
+
const mode = fileStat.mode & 0o777;
|
|
59
|
+
if (mode & 0o077) {
|
|
60
|
+
console.error(`[roam-mcp] WARNING: ${CONFIG_PATH} has overly permissive permissions (0${mode.toString(8)}). ` +
|
|
61
|
+
`This file contains API tokens and should not be accessible by others. ` +
|
|
62
|
+
`Run: chmod 600 ${CONFIG_PATH}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Ignore permission check errors (e.g., Windows)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (error.code === "ENOENT") {
|
|
72
|
+
throw new RoamError(`No graphs configured. Use the setup_new_graph tool to connect a Roam graph, ` +
|
|
73
|
+
`or run the CLI setup command:\n\n` +
|
|
74
|
+
` npx @roam-research/roam-cli connect\n\n` +
|
|
75
|
+
`After connecting, try your request again.`, ErrorCodes.CONFIG_NOT_FOUND);
|
|
76
|
+
}
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
let parsed;
|
|
80
|
+
try {
|
|
81
|
+
parsed = JSON.parse(content);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
throw new RoamError(`Invalid JSON in ${CONFIG_PATH}. Please check the file format.`, ErrorCodes.VALIDATION_ERROR);
|
|
85
|
+
}
|
|
86
|
+
checkConfigVersion(parsed);
|
|
87
|
+
const validated = RoamMcpConfigSchema.safeParse(parsed);
|
|
88
|
+
if (!validated.success) {
|
|
89
|
+
const issues = validated.error.issues
|
|
90
|
+
.map((i) => ` - ${i.path.join(".")}: ${i.message}`)
|
|
91
|
+
.join("\n");
|
|
92
|
+
throw new RoamError(`Invalid config in ${CONFIG_PATH}:\n${issues}`, ErrorCodes.VALIDATION_ERROR);
|
|
93
|
+
}
|
|
94
|
+
// Validate nickname uniqueness (case-insensitive)
|
|
95
|
+
const nicknames = new Set();
|
|
96
|
+
for (const graph of validated.data.graphs) {
|
|
97
|
+
const lowerNickname = graph.nickname.toLowerCase();
|
|
98
|
+
if (nicknames.has(lowerNickname)) {
|
|
99
|
+
throw new RoamError(`Duplicate nickname "${graph.nickname}" in config. Nicknames must be unique (case-insensitive).`, ErrorCodes.VALIDATION_ERROR);
|
|
100
|
+
}
|
|
101
|
+
nicknames.add(lowerNickname);
|
|
102
|
+
}
|
|
103
|
+
// Handle same-name collisions: if both hosted and offline exist with same name, keep hosted
|
|
104
|
+
const graphsByName = new Map();
|
|
105
|
+
for (const graph of validated.data.graphs) {
|
|
106
|
+
const existing = graphsByName.get(graph.name);
|
|
107
|
+
if (existing) {
|
|
108
|
+
if (!dedupWarningShown) {
|
|
109
|
+
dedupWarningShown = true;
|
|
110
|
+
// If existing is hosted, skip the new one (regardless of type)
|
|
111
|
+
// If existing is offline and new is hosted, replace with hosted
|
|
112
|
+
if (existing.type === "hosted") {
|
|
113
|
+
console.error(`[roam-mcp] Warning: Ignoring duplicate graph "${graph.name}" (${graph.type}), using hosted version`);
|
|
114
|
+
}
|
|
115
|
+
else if (graph.type === "hosted") {
|
|
116
|
+
console.error(`[roam-mcp] Warning: Replacing offline graph "${graph.name}" with hosted version`);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
console.error(`[roam-mcp] Warning: Ignoring duplicate offline graph "${graph.name}"`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Apply dedup logic regardless of whether warning was shown
|
|
123
|
+
if (existing.type === "hosted") {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
else if (graph.type === "hosted") {
|
|
127
|
+
graphsByName.set(graph.name, graph);
|
|
128
|
+
}
|
|
129
|
+
// else: both offline, skip the duplicate (continue already handled hosted case)
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
graphsByName.set(graph.name, graph);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Rebuild graphs array with deduplication applied
|
|
136
|
+
return { version: validated.data.version ?? 1, graphs: Array.from(graphsByName.values()) };
|
|
137
|
+
}
|
|
138
|
+
// ============================================================================
|
|
139
|
+
// Config Writing Functions
|
|
140
|
+
// ============================================================================
|
|
141
|
+
/**
|
|
142
|
+
* Read the raw config file for write operations (no dedup, but validates with Zod).
|
|
143
|
+
* Returns empty config if file doesn't exist (so saveGraphToConfig can create the initial file).
|
|
144
|
+
*/
|
|
145
|
+
async function readRawConfig() {
|
|
146
|
+
let content;
|
|
147
|
+
try {
|
|
148
|
+
content = await readFile(CONFIG_PATH, "utf-8");
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
if (error.code === "ENOENT") {
|
|
152
|
+
return { version: CONFIG_VERSION, graphs: [] };
|
|
153
|
+
}
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
let parsed;
|
|
157
|
+
try {
|
|
158
|
+
parsed = JSON.parse(content);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
throw new RoamError(`Invalid JSON in ${CONFIG_PATH}. Please check the file format.`, ErrorCodes.VALIDATION_ERROR);
|
|
162
|
+
}
|
|
163
|
+
checkConfigVersion(parsed);
|
|
164
|
+
const validated = RoamMcpConfigSchema.safeParse(parsed);
|
|
165
|
+
if (!validated.success) {
|
|
166
|
+
const issues = validated.error.issues
|
|
167
|
+
.map((i) => ` - ${i.path.join(".")}: ${i.message}`)
|
|
168
|
+
.join("\n");
|
|
169
|
+
throw new RoamError(`Invalid config in ${CONFIG_PATH}:\n${issues}`, ErrorCodes.VALIDATION_ERROR);
|
|
170
|
+
}
|
|
171
|
+
return validated.data;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Save a graph configuration to ~/.roam-tools.json
|
|
175
|
+
* If a graph with the same name+type exists, it will be updated.
|
|
176
|
+
* Otherwise, the graph will be added.
|
|
177
|
+
*/
|
|
178
|
+
export async function saveGraphToConfig(newGraph) {
|
|
179
|
+
const config = await readRawConfig();
|
|
180
|
+
// Check for nickname collision (case-insensitive)
|
|
181
|
+
const existingNickname = config.graphs.find((g) => g.nickname.toLowerCase() === newGraph.nickname.toLowerCase() &&
|
|
182
|
+
!(g.name === newGraph.name && g.type === newGraph.type));
|
|
183
|
+
if (existingNickname) {
|
|
184
|
+
throw new RoamError(`Nickname "${newGraph.nickname}" is already used by graph "${existingNickname.name}". Please choose a different nickname.`, ErrorCodes.VALIDATION_ERROR);
|
|
185
|
+
}
|
|
186
|
+
// Check for existing graph with same name+type
|
|
187
|
+
const existingIndex = config.graphs.findIndex((g) => g.name === newGraph.name && g.type === newGraph.type);
|
|
188
|
+
if (existingIndex >= 0) {
|
|
189
|
+
config.graphs[existingIndex] = newGraph; // Update existing
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
config.graphs.push(newGraph); // Add new
|
|
193
|
+
}
|
|
194
|
+
const output = { version: CONFIG_VERSION, graphs: config.graphs };
|
|
195
|
+
await writeConfigFile(CONFIG_PATH, JSON.stringify(output, null, 2));
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Remove a graph from ~/.roam-tools.json by nickname
|
|
199
|
+
*/
|
|
200
|
+
export async function removeGraphFromConfig(nickname) {
|
|
201
|
+
const config = await readRawConfig();
|
|
202
|
+
const lowerNickname = nickname.toLowerCase();
|
|
203
|
+
const initialLength = config.graphs.length;
|
|
204
|
+
config.graphs = config.graphs.filter((g) => g.nickname.toLowerCase() !== lowerNickname);
|
|
205
|
+
if (config.graphs.length === initialLength) {
|
|
206
|
+
return false; // Graph not found
|
|
207
|
+
}
|
|
208
|
+
const output = { version: CONFIG_VERSION, graphs: config.graphs };
|
|
209
|
+
await writeConfigFile(CONFIG_PATH, JSON.stringify(output, null, 2));
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Update a graph's access level and/or token status in config.
|
|
214
|
+
* No-ops if nothing changed (avoids unnecessary disk writes).
|
|
215
|
+
*/
|
|
216
|
+
export async function updateGraphTokenStatus(nickname, updates) {
|
|
217
|
+
const config = await readRawConfig();
|
|
218
|
+
const graph = config.graphs.find((g) => g.nickname.toLowerCase() === nickname.toLowerCase());
|
|
219
|
+
if (!graph)
|
|
220
|
+
return;
|
|
221
|
+
let changed = false;
|
|
222
|
+
if (updates.accessLevel !== undefined && graph.accessLevel !== updates.accessLevel) {
|
|
223
|
+
graph.accessLevel = updates.accessLevel;
|
|
224
|
+
changed = true;
|
|
225
|
+
}
|
|
226
|
+
if (updates.lastKnownTokenStatus !== undefined && graph.lastKnownTokenStatus !== updates.lastKnownTokenStatus) {
|
|
227
|
+
graph.lastKnownTokenStatus = updates.lastKnownTokenStatus;
|
|
228
|
+
changed = true;
|
|
229
|
+
}
|
|
230
|
+
if (!changed)
|
|
231
|
+
return;
|
|
232
|
+
const output = { version: CONFIG_VERSION, graphs: config.graphs };
|
|
233
|
+
await writeConfigFile(CONFIG_PATH, JSON.stringify(output, null, 2));
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get all configured graphs (returns empty array if config doesn't exist)
|
|
237
|
+
* Unlike getMcpConfig(), this doesn't throw if config is missing.
|
|
238
|
+
*/
|
|
239
|
+
export async function getConfiguredGraphsSafe() {
|
|
240
|
+
try {
|
|
241
|
+
const config = await readRawConfig();
|
|
242
|
+
return config.graphs;
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// ============================================================================
|
|
249
|
+
// Graph Lookup Functions
|
|
250
|
+
// ============================================================================
|
|
251
|
+
/**
|
|
252
|
+
* Find a graph config by nickname (case-insensitive) or name
|
|
253
|
+
*/
|
|
254
|
+
export async function findGraphConfig(nameOrNickname) {
|
|
255
|
+
const config = await getMcpConfig();
|
|
256
|
+
const lower = nameOrNickname.toLowerCase();
|
|
257
|
+
// First try nickname (case-insensitive)
|
|
258
|
+
const byNickname = config.graphs.find((g) => g.nickname.toLowerCase() === lower);
|
|
259
|
+
if (byNickname)
|
|
260
|
+
return byNickname;
|
|
261
|
+
// Fall back to exact name match
|
|
262
|
+
return config.graphs.find((g) => g.name === nameOrNickname);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Get list of all configured graphs (for list_graphs tool and error messages)
|
|
266
|
+
*/
|
|
267
|
+
export async function getConfiguredGraphs() {
|
|
268
|
+
const config = await getMcpConfig();
|
|
269
|
+
return config.graphs.map((g) => ({
|
|
270
|
+
nickname: g.nickname,
|
|
271
|
+
name: g.name,
|
|
272
|
+
accessLevel: g.accessLevel || "full",
|
|
273
|
+
...(g.lastKnownTokenStatus ? { lastKnownTokenStatus: g.lastKnownTokenStatus } : {}),
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
// ============================================================================
|
|
277
|
+
// Graph Resolution
|
|
278
|
+
// ============================================================================
|
|
279
|
+
/**
|
|
280
|
+
* Resolve which graph to use and return full config.
|
|
281
|
+
* Stateless: explicit param → single configured graph → error
|
|
282
|
+
*/
|
|
283
|
+
export async function resolveGraph(providedGraph) {
|
|
284
|
+
const config = await getMcpConfig();
|
|
285
|
+
// 1. Explicit graph parameter (by nickname or name)
|
|
286
|
+
if (providedGraph) {
|
|
287
|
+
const graphConfig = await findGraphConfig(providedGraph);
|
|
288
|
+
if (!graphConfig) {
|
|
289
|
+
throw new RoamError(`Graph "${providedGraph}" not found in config. Available graph nicknames are listed below.`, ErrorCodes.GRAPH_NOT_CONFIGURED, {
|
|
290
|
+
available_graphs: await getConfiguredGraphs(),
|
|
291
|
+
instruction: "Pass the 'nickname' value as the graph parameter. Before operating on a graph, call get_graph_guidelines to understand its conventions.",
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
name: graphConfig.name,
|
|
296
|
+
type: graphConfig.type,
|
|
297
|
+
token: graphConfig.token,
|
|
298
|
+
nickname: graphConfig.nickname,
|
|
299
|
+
accessLevel: graphConfig.accessLevel,
|
|
300
|
+
lastKnownTokenStatus: graphConfig.lastKnownTokenStatus,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
// 2. Auto-select if exactly one graph configured
|
|
304
|
+
if (config.graphs.length === 1) {
|
|
305
|
+
const graphConfig = config.graphs[0];
|
|
306
|
+
return {
|
|
307
|
+
name: graphConfig.name,
|
|
308
|
+
type: graphConfig.type,
|
|
309
|
+
token: graphConfig.token,
|
|
310
|
+
nickname: graphConfig.nickname,
|
|
311
|
+
accessLevel: graphConfig.accessLevel,
|
|
312
|
+
lastKnownTokenStatus: graphConfig.lastKnownTokenStatus,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
// 3. Multiple graphs - require explicit selection
|
|
316
|
+
throw new RoamError("Multiple graphs configured. Pass a graph nickname as the graph parameter to specify which graph to use.", ErrorCodes.GRAPH_NOT_SELECTED, {
|
|
317
|
+
available_graphs: await getConfiguredGraphs(),
|
|
318
|
+
instruction: "Pass the 'nickname' value as the graph parameter. Before operating on a graph, call get_graph_guidelines to understand its conventions.",
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Fetch list of open graphs from Roam's Local API.
|
|
323
|
+
* Note: This is NOT used for graph resolution in v2.0.0.
|
|
324
|
+
* It's kept for potential future use (e.g., showing which graphs are open).
|
|
325
|
+
*/
|
|
326
|
+
export async function getOpenGraphs() {
|
|
327
|
+
const port = await getPort();
|
|
328
|
+
const url = `http://127.0.0.1:${port}/api/graphs/open`;
|
|
329
|
+
const response = await fetch(url, {
|
|
330
|
+
method: "GET",
|
|
331
|
+
headers: { "Content-Type": "application/json" },
|
|
332
|
+
});
|
|
333
|
+
const data = (await response.json());
|
|
334
|
+
if (!data.success) {
|
|
335
|
+
throw new RoamError(data.error || "Failed to get open graphs", ErrorCodes.CONNECTION_FAILED);
|
|
336
|
+
}
|
|
337
|
+
return (data.result || []).map((g) => ({ name: g.name, type: g.type }));
|
|
338
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { CallToolResult, TextContent, ImageContent, GraphType, AccessLevel, GraphConfig, RoamMcpConfig, ResolvedGraph, ErrorCode, RoamApiError, RoamResponse, RoamClientConfig, Block, Page, BlockLocation, WindowType, SidebarWindow, SidebarWindowInfo, FocusedBlock, SelectedBlock, MainWindowViewType, MainWindowView, SearchResultPath, SearchResult, SearchResponse, Template, QueryResult, QueryResponse, TokenInfoResponse, TokenInfoResult, } from "./types.js";
|
|
2
|
+
export { GraphConfigSchema, RoamMcpConfigSchema, ErrorCodes, RoamError, CONFIG_VERSION, EXPECTED_API_VERSION, textResult, imageResult, errorResult, getErrorMessage, } from "./types.js";
|
|
3
|
+
export { RoamClient } from "./client.js";
|
|
4
|
+
export { getPort, resolveGraph, saveGraphToConfig, removeGraphFromConfig, updateGraphTokenStatus, getConfiguredGraphsSafe, getConfiguredGraphs, findGraphConfig, getMcpConfig, getOpenGraphs, } from "./graph-resolver.js";
|
|
5
|
+
export { fetchAvailableGraphs, requestToken, sleep, openRoamApp, slugify, } from "./roam-api.js";
|
|
6
|
+
export type { AvailableGraph, GraphsResponse, TokenExchangeResponse, } from "./roam-api.js";
|
|
7
|
+
export { tools, findTool, routeToolCall } from "./tools.js";
|
|
8
|
+
export type { ToolDefinition, ClientToolDefinition, StandaloneToolDefinition, } from "./tools.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EACV,cAAc,EAAE,WAAW,EAAE,YAAY,EACzC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EACjE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EACvD,KAAK,EAAE,IAAI,EAAE,aAAa,EAC1B,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAC5C,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,cAAc,EAClC,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAC9C,QAAQ,EAAE,WAAW,EAAE,aAAa,EACpC,iBAAiB,EAAE,eAAe,GACnC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EAAE,mBAAmB,EACtC,UAAU,EAAE,SAAS,EACrB,cAAc,EAAE,oBAAoB,EACpC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,GACtD,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EACL,OAAO,EAAE,YAAY,EACrB,iBAAiB,EAAE,qBAAqB,EAAE,sBAAsB,EAChE,uBAAuB,EAAE,mBAAmB,EAAE,eAAe,EAC7D,YAAY,EAAE,aAAa,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,oBAAoB,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,GAChE,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,cAAc,EAAE,cAAc,EAAE,qBAAqB,GACtD,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC5D,YAAY,EACV,cAAc,EAAE,oBAAoB,EAAE,wBAAwB,GAC/D,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Barrel export for @roam-research/roam-tools-core
|
|
2
|
+
export { GraphConfigSchema, RoamMcpConfigSchema, ErrorCodes, RoamError, CONFIG_VERSION, EXPECTED_API_VERSION, textResult, imageResult, errorResult, getErrorMessage, } from "./types.js";
|
|
3
|
+
// Client
|
|
4
|
+
export { RoamClient } from "./client.js";
|
|
5
|
+
// Graph resolution and config management
|
|
6
|
+
export { getPort, resolveGraph, saveGraphToConfig, removeGraphFromConfig, updateGraphTokenStatus, getConfiguredGraphsSafe, getConfiguredGraphs, findGraphConfig, getMcpConfig, getOpenGraphs, } from "./graph-resolver.js";
|
|
7
|
+
// Shared Roam API functions
|
|
8
|
+
export { fetchAvailableGraphs, requestToken, sleep, openRoamApp, slugify, } from "./roam-api.js";
|
|
9
|
+
// Tool definitions and routing
|
|
10
|
+
export { tools, findTool, routeToolCall } from "./tools.js";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { RoamClient } from "../client.js";
|
|
3
|
+
import type { CallToolResult } from "../types.js";
|
|
4
|
+
export declare const CreateBlockSchema: z.ZodObject<{
|
|
5
|
+
parentUid: z.ZodString;
|
|
6
|
+
markdown: z.ZodString;
|
|
7
|
+
order: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodEnum<["first", "last"]>]>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
markdown: string;
|
|
10
|
+
parentUid: string;
|
|
11
|
+
order?: number | "first" | "last" | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
markdown: string;
|
|
14
|
+
parentUid: string;
|
|
15
|
+
order?: number | "first" | "last" | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const GetBlockSchema: z.ZodObject<{
|
|
18
|
+
uid: z.ZodString;
|
|
19
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
uid: string;
|
|
22
|
+
maxDepth?: number | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
uid: string;
|
|
25
|
+
maxDepth?: number | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const UpdateBlockSchema: z.ZodObject<{
|
|
28
|
+
uid: z.ZodString;
|
|
29
|
+
string: z.ZodOptional<z.ZodString>;
|
|
30
|
+
open: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
heading: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
uid: string;
|
|
34
|
+
string?: string | undefined;
|
|
35
|
+
open?: boolean | undefined;
|
|
36
|
+
heading?: number | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
uid: string;
|
|
39
|
+
string?: string | undefined;
|
|
40
|
+
open?: boolean | undefined;
|
|
41
|
+
heading?: number | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const DeleteBlockSchema: z.ZodObject<{
|
|
44
|
+
uid: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
uid: string;
|
|
47
|
+
}, {
|
|
48
|
+
uid: string;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const MoveBlockSchema: z.ZodObject<{
|
|
51
|
+
uid: z.ZodString;
|
|
52
|
+
parentUid: z.ZodString;
|
|
53
|
+
order: z.ZodUnion<[z.ZodNumber, z.ZodEnum<["first", "last"]>]>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
uid: string;
|
|
56
|
+
parentUid: string;
|
|
57
|
+
order: number | "first" | "last";
|
|
58
|
+
}, {
|
|
59
|
+
uid: string;
|
|
60
|
+
parentUid: string;
|
|
61
|
+
order: number | "first" | "last";
|
|
62
|
+
}>;
|
|
63
|
+
export declare const GetBacklinksSchema: z.ZodObject<{
|
|
64
|
+
uid: z.ZodOptional<z.ZodString>;
|
|
65
|
+
title: z.ZodOptional<z.ZodString>;
|
|
66
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
sort: z.ZodOptional<z.ZodEnum<["created-date", "edited-date", "daily-note-date"]>>;
|
|
69
|
+
sortOrder: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
70
|
+
search: z.ZodOptional<z.ZodString>;
|
|
71
|
+
includePath: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
title?: string | undefined;
|
|
75
|
+
sort?: "created-date" | "edited-date" | "daily-note-date" | undefined;
|
|
76
|
+
search?: string | undefined;
|
|
77
|
+
uid?: string | undefined;
|
|
78
|
+
maxDepth?: number | undefined;
|
|
79
|
+
offset?: number | undefined;
|
|
80
|
+
limit?: number | undefined;
|
|
81
|
+
sortOrder?: "asc" | "desc" | undefined;
|
|
82
|
+
includePath?: boolean | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
title?: string | undefined;
|
|
85
|
+
sort?: "created-date" | "edited-date" | "daily-note-date" | undefined;
|
|
86
|
+
search?: string | undefined;
|
|
87
|
+
uid?: string | undefined;
|
|
88
|
+
maxDepth?: number | undefined;
|
|
89
|
+
offset?: number | undefined;
|
|
90
|
+
limit?: number | undefined;
|
|
91
|
+
sortOrder?: "asc" | "desc" | undefined;
|
|
92
|
+
includePath?: boolean | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
export type CreateBlockParams = z.infer<typeof CreateBlockSchema>;
|
|
95
|
+
export type GetBlockParams = z.infer<typeof GetBlockSchema>;
|
|
96
|
+
export type UpdateBlockParams = z.infer<typeof UpdateBlockSchema>;
|
|
97
|
+
export type DeleteBlockParams = z.infer<typeof DeleteBlockSchema>;
|
|
98
|
+
export type MoveBlockParams = z.infer<typeof MoveBlockSchema>;
|
|
99
|
+
export type GetBacklinksParams = z.infer<typeof GetBacklinksSchema>;
|
|
100
|
+
export interface BacklinkResult {
|
|
101
|
+
uid: string;
|
|
102
|
+
type?: "page";
|
|
103
|
+
markdown: string;
|
|
104
|
+
path?: Array<{
|
|
105
|
+
uid: string;
|
|
106
|
+
title?: string;
|
|
107
|
+
string?: string;
|
|
108
|
+
}>;
|
|
109
|
+
}
|
|
110
|
+
export interface GetBacklinksResponse {
|
|
111
|
+
total: number;
|
|
112
|
+
results: BacklinkResult[];
|
|
113
|
+
}
|
|
114
|
+
export declare function createBlock(client: RoamClient, params: CreateBlockParams): Promise<CallToolResult>;
|
|
115
|
+
export declare function getBlock(client: RoamClient, params: GetBlockParams): Promise<CallToolResult>;
|
|
116
|
+
export declare function updateBlock(client: RoamClient, params: UpdateBlockParams): Promise<CallToolResult>;
|
|
117
|
+
export declare function deleteBlock(client: RoamClient, params: DeleteBlockParams): Promise<CallToolResult>;
|
|
118
|
+
export declare function moveBlock(client: RoamClient, params: MoveBlockParams): Promise<CallToolResult>;
|
|
119
|
+
export declare function getBacklinks(client: RoamClient, params: GetBacklinksParams): Promise<CallToolResult>;
|
|
120
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/operations/blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;EAI1B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B,CAAC;AAGH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAGpE,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAWxG;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAMlG;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAQxG;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAGxG;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAapG;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,cAAc,CAAC,CAezB"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { textResult } from "../types.js";
|
|
3
|
+
// Schemas
|
|
4
|
+
export const CreateBlockSchema = z.object({
|
|
5
|
+
parentUid: z.string().describe("UID of parent block or page"),
|
|
6
|
+
markdown: z.string().describe("Markdown content for the block"),
|
|
7
|
+
order: z.union([z.coerce.number(), z.enum(["first", "last"])]).optional().describe("Position (number, 'first', or 'last'). Defaults to 'last'"),
|
|
8
|
+
});
|
|
9
|
+
export const GetBlockSchema = z.object({
|
|
10
|
+
uid: z.string().describe("Block UID"),
|
|
11
|
+
maxDepth: z.coerce.number().optional().describe("Max depth of children to include in markdown (omit for full tree)"),
|
|
12
|
+
});
|
|
13
|
+
export const UpdateBlockSchema = z.object({
|
|
14
|
+
uid: z.string().describe("Block UID"),
|
|
15
|
+
string: z.string().optional().describe("New text content"),
|
|
16
|
+
open: z.boolean().optional().describe("Collapse state"),
|
|
17
|
+
heading: z.coerce.number().optional().describe("Heading level (0-3)"),
|
|
18
|
+
});
|
|
19
|
+
export const DeleteBlockSchema = z.object({
|
|
20
|
+
uid: z.string().describe("Block UID to delete"),
|
|
21
|
+
});
|
|
22
|
+
export const MoveBlockSchema = z.object({
|
|
23
|
+
uid: z.string().describe("Block UID to move"),
|
|
24
|
+
parentUid: z.string().describe("UID of the new parent block or page"),
|
|
25
|
+
order: z.union([z.coerce.number(), z.enum(["first", "last"])]).describe("Position in the new parent (number, 'first', or 'last')"),
|
|
26
|
+
});
|
|
27
|
+
export const GetBacklinksSchema = z.object({
|
|
28
|
+
uid: z.string().optional().describe("UID of page or block (required if no title)"),
|
|
29
|
+
title: z.string().optional().describe("Page title (required if no uid)"),
|
|
30
|
+
offset: z.coerce.number().optional().describe("Skip first N results (default: 0)"),
|
|
31
|
+
limit: z.coerce.number().optional().describe("Max results to return (default: 20)"),
|
|
32
|
+
sort: z.enum(["created-date", "edited-date", "daily-note-date"]).optional().describe("Sort order (default: created-date)"),
|
|
33
|
+
sortOrder: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: desc)"),
|
|
34
|
+
search: z.string().optional().describe("Filter results by text match (searches block, parents, children, page title)"),
|
|
35
|
+
includePath: z.boolean().optional().describe("Include breadcrumb path to each result (default: true)"),
|
|
36
|
+
maxDepth: z.coerce.number().optional().describe("Max depth of children to include in markdown (default: 2)"),
|
|
37
|
+
});
|
|
38
|
+
export async function createBlock(client, params) {
|
|
39
|
+
const response = await client.call("data.block.fromMarkdown", [
|
|
40
|
+
{
|
|
41
|
+
location: {
|
|
42
|
+
"parent-uid": params.parentUid,
|
|
43
|
+
order: params.order ?? "last",
|
|
44
|
+
},
|
|
45
|
+
"markdown-string": params.markdown,
|
|
46
|
+
},
|
|
47
|
+
]);
|
|
48
|
+
return textResult(response.result ?? { uids: [] });
|
|
49
|
+
}
|
|
50
|
+
export async function getBlock(client, params) {
|
|
51
|
+
const apiParams = { uid: params.uid };
|
|
52
|
+
if (params.maxDepth !== undefined)
|
|
53
|
+
apiParams.maxDepth = params.maxDepth;
|
|
54
|
+
const response = await client.call("data.ai.getBlock", [apiParams]);
|
|
55
|
+
return textResult(response.result ?? null);
|
|
56
|
+
}
|
|
57
|
+
export async function updateBlock(client, params) {
|
|
58
|
+
const block = { uid: params.uid };
|
|
59
|
+
if (params.string !== undefined)
|
|
60
|
+
block.string = params.string;
|
|
61
|
+
if (params.open !== undefined)
|
|
62
|
+
block.open = params.open;
|
|
63
|
+
if (params.heading !== undefined)
|
|
64
|
+
block.heading = params.heading;
|
|
65
|
+
await client.call("data.block.update", [{ block }]);
|
|
66
|
+
return textResult({ success: true });
|
|
67
|
+
}
|
|
68
|
+
export async function deleteBlock(client, params) {
|
|
69
|
+
await client.call("data.block.delete", [{ block: { uid: params.uid } }]);
|
|
70
|
+
return textResult({ success: true });
|
|
71
|
+
}
|
|
72
|
+
export async function moveBlock(client, params) {
|
|
73
|
+
await client.call("data.block.move", [
|
|
74
|
+
{
|
|
75
|
+
location: {
|
|
76
|
+
"parent-uid": params.parentUid,
|
|
77
|
+
order: params.order,
|
|
78
|
+
},
|
|
79
|
+
block: {
|
|
80
|
+
uid: params.uid,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
]);
|
|
84
|
+
return textResult({ success: true });
|
|
85
|
+
}
|
|
86
|
+
export async function getBacklinks(client, params) {
|
|
87
|
+
const apiParams = {};
|
|
88
|
+
if (params.uid !== undefined)
|
|
89
|
+
apiParams.uid = params.uid;
|
|
90
|
+
if (params.title !== undefined)
|
|
91
|
+
apiParams.title = params.title;
|
|
92
|
+
if (params.offset !== undefined)
|
|
93
|
+
apiParams.offset = params.offset;
|
|
94
|
+
if (params.limit !== undefined)
|
|
95
|
+
apiParams.limit = params.limit;
|
|
96
|
+
if (params.sort !== undefined)
|
|
97
|
+
apiParams.sort = params.sort;
|
|
98
|
+
if (params.sortOrder !== undefined)
|
|
99
|
+
apiParams.sortOrder = params.sortOrder;
|
|
100
|
+
if (params.search !== undefined)
|
|
101
|
+
apiParams.search = params.search;
|
|
102
|
+
if (params.includePath !== undefined)
|
|
103
|
+
apiParams.includePath = params.includePath;
|
|
104
|
+
if (params.maxDepth !== undefined)
|
|
105
|
+
apiParams.maxDepth = params.maxDepth;
|
|
106
|
+
const response = await client.call("data.ai.getBacklinks", [apiParams]);
|
|
107
|
+
return textResult(response.result ?? { total: 0, results: [] });
|
|
108
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { RoamClient } from "../client.js";
|
|
3
|
+
import type { CallToolResult } from "../types.js";
|
|
4
|
+
export declare const FileGetSchema: z.ZodObject<{
|
|
5
|
+
url: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
url: string;
|
|
8
|
+
}, {
|
|
9
|
+
url: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const FileUploadSchema: z.ZodObject<{
|
|
12
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
13
|
+
url: z.ZodOptional<z.ZodString>;
|
|
14
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
15
|
+
mimetype: z.ZodOptional<z.ZodString>;
|
|
16
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
url?: string | undefined;
|
|
19
|
+
base64?: string | undefined;
|
|
20
|
+
filePath?: string | undefined;
|
|
21
|
+
mimetype?: string | undefined;
|
|
22
|
+
filename?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
url?: string | undefined;
|
|
25
|
+
base64?: string | undefined;
|
|
26
|
+
filePath?: string | undefined;
|
|
27
|
+
mimetype?: string | undefined;
|
|
28
|
+
filename?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const FileDeleteSchema: z.ZodObject<{
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
url: string;
|
|
34
|
+
}, {
|
|
35
|
+
url: string;
|
|
36
|
+
}>;
|
|
37
|
+
export type FileGetParams = z.infer<typeof FileGetSchema>;
|
|
38
|
+
export type FileUploadParams = z.infer<typeof FileUploadSchema>;
|
|
39
|
+
export type FileDeleteParams = z.infer<typeof FileDeleteSchema>;
|
|
40
|
+
export declare function getFile(client: RoamClient, params: FileGetParams): Promise<CallToolResult>;
|
|
41
|
+
export declare function uploadFile(client: RoamClient, params: FileUploadParams): Promise<CallToolResult>;
|
|
42
|
+
export declare function deleteFile(client: RoamClient, params: FileDeleteParams): Promise<CallToolResult>;
|
|
43
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/operations/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAM3B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAGH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AA0GhE,wBAAsB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAkBhG;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAiDtG;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAGtG"}
|