@roam-research/roam-tools-core 0.5.0 → 0.6.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 +23 -8
- package/dist/index.d.ts +3 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/operations/blocks.d.ts +25 -20
- package/dist/operations/blocks.d.ts.map +1 -1
- package/dist/operations/blocks.js +66 -15
- package/dist/operations/datalog.d.ts +15 -0
- package/dist/operations/datalog.d.ts.map +1 -0
- package/dist/operations/datalog.js +16 -0
- package/dist/operations/files.d.ts +6 -7
- package/dist/operations/files.d.ts.map +1 -1
- package/dist/operations/files.js +18 -5
- package/dist/operations/navigation.d.ts +9 -10
- package/dist/operations/navigation.d.ts.map +1 -1
- package/dist/operations/navigation.js +4 -1
- package/dist/operations/pages.d.ts +15 -13
- package/dist/operations/pages.d.ts.map +1 -1
- package/dist/operations/pages.js +34 -10
- package/dist/operations/query.d.ts +10 -11
- package/dist/operations/query.d.ts.map +1 -1
- package/dist/operations/query.js +24 -6
- package/dist/operations/search.d.ts +7 -8
- package/dist/operations/search.d.ts.map +1 -1
- package/dist/operations/search.js +22 -6
- package/dist/tools.d.ts +37 -4
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +91 -80
- package/dist/types.d.ts +11 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +14 -4
- package/package.json +7 -10
- package/dist/client.d.ts +0 -34
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -275
- package/dist/connect.d.ts +0 -10
- package/dist/connect.d.ts.map +0 -1
- package/dist/connect.js +0 -477
- package/dist/graph-resolver.d.ts +0 -54
- package/dist/graph-resolver.d.ts.map +0 -1
- package/dist/graph-resolver.js +0 -338
- package/dist/operations/graphs.d.ts +0 -26
- package/dist/operations/graphs.d.ts.map +0 -1
- package/dist/operations/graphs.js +0 -214
- package/dist/roam-api.d.ts +0 -32
- package/dist/roam-api.d.ts.map +0 -1
- package/dist/roam-api.js +0 -50
package/README.md
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
# @roam-research/roam-tools-core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Transport-agnostic core for Roam Research MCP and CLI tools. Provides the tool registry, schemas, operation functions, and dispatch — but no transport.
|
|
4
4
|
|
|
5
|
-
> **
|
|
5
|
+
> **Most users don't want this package directly.** If you want to connect an AI assistant to Roam, install [`@roam-research/roam-mcp`](https://www.npmjs.com/package/@roam-research/roam-mcp). For the command line, install [`@roam-research/roam-cli`](https://www.npmjs.com/package/@roam-research/roam-cli). Both wrap the local Roam Desktop transport ([`@roam-research/roam-tools-local`](https://www.npmjs.com/package/@roam-research/roam-tools-local)) which depends on this package.
|
|
6
|
+
|
|
7
|
+
## Who is this for?
|
|
8
|
+
|
|
9
|
+
This package is for **hosted MCP transports** that talk to Roam through a different backend (e.g., a WorkOS-authenticated proxy) and want to reuse the same tool registry, Zod schemas, and operation functions without dragging in the local Roam Desktop client or the `~/.roam-tools.json` config reader.
|
|
6
10
|
|
|
7
11
|
## What's in here
|
|
8
12
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
13
|
+
- `RoamActionClient` — structural client interface (`call()` + optional `getTokenInfo()`). Bring your own implementation.
|
|
14
|
+
- `routeToolCall(name, args, options)` — central dispatcher. **Requires** `options.resolveGraph` and `options.createClient`. Optional: `tokenInfoMode`, `onTokenStatusUpdate`.
|
|
15
|
+
- `ToolGraph` / `ResolvedGraph` — cross-transport graph identity types.
|
|
16
|
+
- Tool registry: `dataTools` (graph content, reusable across transports), `desktopUiTools` (file ops + window/selection — local-only), `contentTools` (the union), `tools` (alias of contentTools at this layer).
|
|
17
|
+
- Helpers: `defineTool`, `defineStandaloneTool`, `findTool`.
|
|
18
|
+
- Operations: page, block, search, query, datalog, navigation, files (all transport-agnostic — they only call `client.call(...)`).
|
|
19
|
+
- Types and schemas: `GraphConfigSchema`, `RoamMcpConfigSchema`, `RoamError`, `ErrorCodes`, `EXPECTED_API_VERSION`, etc.
|
|
20
|
+
|
|
21
|
+
## What's NOT in here
|
|
22
|
+
|
|
23
|
+
- `RoamClient` — the local Roam Desktop transport, in `@roam-research/roam-tools-local`.
|
|
24
|
+
- `~/.roam-tools.json` reader (`getPort`, `resolveGraph`, `getMcpConfig`, etc.) — also in `@roam-research/roam-tools-local`.
|
|
25
|
+
- `connect` interactive setup — also in `@roam-research/roam-tools-local`.
|
|
26
|
+
- The `list_graphs` and `setup_new_graph` standalone tools — also local.
|
|
27
|
+
|
|
28
|
+
Hosted consumers reimplement these (or substitute their own equivalents — e.g., reading picker grants from a remote store) and inject them via `routeToolCall`'s options.
|
|
14
29
|
|
|
15
30
|
## Documentation
|
|
16
31
|
|
|
17
|
-
See the [main repository](https://github.com/Roam-Research/roam-tools) for full documentation.
|
|
32
|
+
See the [main repository](https://github.com/Roam-Research/roam-tools) for full documentation, including the architecture rationale and the integration pattern.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export type { CallToolResult, TextContent, ImageContent, GraphType, AccessLevel, GraphConfig, RoamMcpConfig, ResolvedGraph, ErrorCode, RoamApiError, RoamResponse,
|
|
1
|
+
export type { CallToolResult, TextContent, ImageContent, GraphType, AccessLevel, GraphConfig, RoamMcpConfig, ToolGraph, ResolvedGraph, RoamActionClient, ErrorCode, RoamApiError, RoamResponse, Block, Page, BlockLocation, WindowType, SidebarWindow, SidebarWindowInfo, FocusedBlock, SelectedBlock, MainWindowViewType, MainWindowView, SearchResultPath, SearchResult, SearchResponse, RecentlyOpenedBlock, RecentlyOpenedItem, DailyNotePagesViewItem, RecentlyEditedPage, SearchSuggestionsResponse, SearchTemplatesResponse, GetPageResponse, GetBlockResponse, Template, QueryResult, QueryResponse, TokenInfoResponse, TokenInfoResult, } from "./types.js";
|
|
2
2
|
export { GraphConfigSchema, RoamMcpConfigSchema, ErrorCodes, RoamError, CONFIG_VERSION, EXPECTED_API_VERSION, textResult, imageResult, errorResult, getErrorMessage, } from "./types.js";
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
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";
|
|
3
|
+
export { tools, findTool, routeToolCall, contentTools, dataTools, desktopUiTools, defineTool, defineStandaloneTool, } from "./tools.js";
|
|
4
|
+
export type { ToolDefinition, ClientToolDefinition, StandaloneToolDefinition, RouteToolCallOptions, } from "./tools.js";
|
|
9
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,YAAY,EACV,cAAc,EACd,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,aAAa,EACb,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Barrel export for @roam-research/roam-tools-core
|
|
2
|
+
//
|
|
3
|
+
// Core is transport-agnostic — it does NOT export RoamClient, the
|
|
4
|
+
// ~/.roam-tools.json reader, or the connect command. Those live in
|
|
5
|
+
// @roam-research/roam-tools-local. Hosted MCP transports depend on this
|
|
6
|
+
// package directly and supply their own resolveGraph + createClient via
|
|
7
|
+
// routeToolCall's options.
|
|
2
8
|
export { GraphConfigSchema, RoamMcpConfigSchema, ErrorCodes, RoamError, CONFIG_VERSION, EXPECTED_API_VERSION, textResult, imageResult, errorResult, getErrorMessage, } from "./types.js";
|
|
3
|
-
//
|
|
4
|
-
export {
|
|
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";
|
|
9
|
+
// Tool definitions, helpers, and routing
|
|
10
|
+
export { tools, findTool, routeToolCall, contentTools, dataTools, desktopUiTools, defineTool, defineStandaloneTool, } from "./tools.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
-
import type { CallToolResult } from "../types.js";
|
|
2
|
+
import type { CallToolResult, RoamActionClient } from "../types.js";
|
|
4
3
|
export declare const CreateBlockSchema: z.ZodObject<{
|
|
5
4
|
parentUid: z.ZodOptional<z.ZodString>;
|
|
6
5
|
pageTitle: z.ZodOptional<z.ZodString>;
|
|
@@ -38,16 +37,22 @@ export declare const UpdateBlockSchema: z.ZodObject<{
|
|
|
38
37
|
string: z.ZodOptional<z.ZodString>;
|
|
39
38
|
open: z.ZodOptional<z.ZodBoolean>;
|
|
40
39
|
heading: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
childrenViewType: z.ZodOptional<z.ZodEnum<["bullet", "numbered", "document"]>>;
|
|
41
|
+
textAlign: z.ZodOptional<z.ZodEnum<["left", "center", "right", "justify"]>>;
|
|
41
42
|
}, "strip", z.ZodTypeAny, {
|
|
42
43
|
uid: string;
|
|
43
44
|
string?: string | undefined;
|
|
45
|
+
childrenViewType?: "bullet" | "numbered" | "document" | undefined;
|
|
44
46
|
open?: boolean | undefined;
|
|
45
47
|
heading?: number | undefined;
|
|
48
|
+
textAlign?: "left" | "center" | "right" | "justify" | undefined;
|
|
46
49
|
}, {
|
|
47
50
|
uid: string;
|
|
48
51
|
string?: string | undefined;
|
|
52
|
+
childrenViewType?: "bullet" | "numbered" | "document" | undefined;
|
|
49
53
|
open?: boolean | undefined;
|
|
50
54
|
heading?: number | undefined;
|
|
55
|
+
textAlign?: "left" | "center" | "right" | "justify" | undefined;
|
|
51
56
|
}>;
|
|
52
57
|
export declare const DeleteBlockSchema: z.ZodObject<{
|
|
53
58
|
uid: z.ZodString;
|
|
@@ -80,25 +85,25 @@ export declare const GetBacklinksSchema: z.ZodObject<{
|
|
|
80
85
|
includePath: z.ZodOptional<z.ZodBoolean>;
|
|
81
86
|
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
82
87
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
title?: string | undefined;
|
|
83
89
|
sort?: "created-date" | "edited-date" | "daily-note-date" | undefined;
|
|
90
|
+
search?: string | undefined;
|
|
84
91
|
uid?: string | undefined;
|
|
85
|
-
|
|
86
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
87
|
-
includePath?: boolean | undefined;
|
|
92
|
+
maxDepth?: number | undefined;
|
|
88
93
|
offset?: number | undefined;
|
|
89
94
|
limit?: number | undefined;
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
sortOrder?: "asc" | "desc" | undefined;
|
|
96
|
+
includePath?: boolean | undefined;
|
|
92
97
|
}, {
|
|
98
|
+
title?: string | undefined;
|
|
93
99
|
sort?: "created-date" | "edited-date" | "daily-note-date" | undefined;
|
|
100
|
+
search?: string | undefined;
|
|
94
101
|
uid?: string | undefined;
|
|
95
|
-
|
|
96
|
-
sortOrder?: "asc" | "desc" | undefined;
|
|
97
|
-
includePath?: boolean | undefined;
|
|
102
|
+
maxDepth?: number | undefined;
|
|
98
103
|
offset?: number | undefined;
|
|
99
104
|
limit?: number | undefined;
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
sortOrder?: "asc" | "desc" | undefined;
|
|
106
|
+
includePath?: boolean | undefined;
|
|
102
107
|
}>;
|
|
103
108
|
export type CreateBlockParams = z.infer<typeof CreateBlockSchema>;
|
|
104
109
|
export type GetBlockParams = z.infer<typeof GetBlockSchema>;
|
|
@@ -121,12 +126,12 @@ export interface GetBacklinksResponse {
|
|
|
121
126
|
total: number;
|
|
122
127
|
results: BacklinkResult[];
|
|
123
128
|
}
|
|
124
|
-
export declare function createBlock(client:
|
|
125
|
-
export declare function getBlock(client:
|
|
126
|
-
export declare function updateBlock(client:
|
|
127
|
-
export declare function deleteBlock(client:
|
|
128
|
-
export declare function moveBlock(client:
|
|
129
|
-
export declare function getBacklinks(client:
|
|
129
|
+
export declare function createBlock(client: RoamActionClient, params: CreateBlockParams): Promise<CallToolResult>;
|
|
130
|
+
export declare function getBlock(client: RoamActionClient, params: GetBlockParams): Promise<CallToolResult>;
|
|
131
|
+
export declare function updateBlock(client: RoamActionClient, params: UpdateBlockParams): Promise<CallToolResult>;
|
|
132
|
+
export declare function deleteBlock(client: RoamActionClient, params: DeleteBlockParams): Promise<CallToolResult>;
|
|
133
|
+
export declare function moveBlock(client: RoamActionClient, params: MoveBlockParams): Promise<CallToolResult>;
|
|
134
|
+
export declare function getBacklinks(client: RoamActionClient, params: GetBacklinksParams): Promise<CallToolResult>;
|
|
130
135
|
export declare const AddCommentSchema: z.ZodObject<{
|
|
131
136
|
blockUid: z.ZodString;
|
|
132
137
|
comment: z.ZodOptional<z.ZodString>;
|
|
@@ -165,6 +170,6 @@ export interface GetCommentsResponse {
|
|
|
165
170
|
total: number;
|
|
166
171
|
comments: CommentResult[];
|
|
167
172
|
}
|
|
168
|
-
export declare function addComment(client:
|
|
169
|
-
export declare function getComments(client:
|
|
173
|
+
export declare function addComment(client: RoamActionClient, params: AddCommentParams): Promise<CallToolResult>;
|
|
174
|
+
export declare function getComments(client: RoamActionClient, params: GetCommentsParams): Promise<CallToolResult>;
|
|
170
175
|
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -1 +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,
|
|
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,cAAc,EAAoB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAItF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EA+B5B,CAAC;AAEH,e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CAC3B;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,cAAc,CAAC,CA0BzB;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAMzB"}
|
|
@@ -2,22 +2,46 @@ import { z } from "zod";
|
|
|
2
2
|
import { textResult, RoamError, ErrorCodes } from "../types.js";
|
|
3
3
|
// Schemas
|
|
4
4
|
export const CreateBlockSchema = z.object({
|
|
5
|
-
parentUid: z
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
parentUid: z
|
|
6
|
+
.string()
|
|
7
|
+
.optional()
|
|
8
|
+
.describe("UID of parent block or page. Exactly one of parentUid, pageTitle, or dailyNotePage is required."),
|
|
9
|
+
pageTitle: z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Page title to create block under (creates the page if it doesn't exist). Exactly one of parentUid, pageTitle, or dailyNotePage is required."),
|
|
13
|
+
dailyNotePage: z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(/^\d{2}-\d{2}-\d{4}$/, "Must be MM-DD-YYYY format (e.g. '03-17-2026')")
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Daily note date in MM-DD-YYYY format (e.g. '03-17-2026'). Targets that day's daily note page, creating it if needed. Exactly one of parentUid, pageTitle, or dailyNotePage is required."),
|
|
18
|
+
nestUnder: z
|
|
19
|
+
.string()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Insert under a direct child block matching this string (matches on the block's string field, including markup like **bold** or [[links]]). If no match exists, creates a new child block with this text first, then inserts under it. Works with parentUid, pageTitle, or dailyNotePage."),
|
|
9
22
|
markdown: z.string().describe("Markdown content for the block"),
|
|
10
|
-
order: z
|
|
23
|
+
order: z
|
|
24
|
+
.union([z.coerce.number(), z.enum(["first", "last"])])
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Position (number, 'first', or 'last'). Defaults to 'last'"),
|
|
11
27
|
});
|
|
12
28
|
export const GetBlockSchema = z.object({
|
|
13
29
|
uid: z.string().describe("Block UID"),
|
|
14
|
-
maxDepth: z.coerce
|
|
30
|
+
maxDepth: z.coerce
|
|
31
|
+
.number()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Max depth of children to include in markdown (omit for full tree)"),
|
|
15
34
|
});
|
|
16
35
|
export const UpdateBlockSchema = z.object({
|
|
17
36
|
uid: z.string().describe("Block UID"),
|
|
18
37
|
string: z.string().optional().describe("New text content"),
|
|
19
38
|
open: z.boolean().optional().describe("Collapse state"),
|
|
20
39
|
heading: z.coerce.number().optional().describe("Heading level (0-3)"),
|
|
40
|
+
childrenViewType: z
|
|
41
|
+
.enum(["bullet", "numbered", "document"])
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("How children are displayed (bullet, numbered, or document)"),
|
|
44
|
+
textAlign: z.enum(["left", "center", "right", "justify"]).optional().describe("Text alignment"),
|
|
21
45
|
});
|
|
22
46
|
export const DeleteBlockSchema = z.object({
|
|
23
47
|
uid: z.string().describe("Block UID to delete"),
|
|
@@ -25,22 +49,36 @@ export const DeleteBlockSchema = z.object({
|
|
|
25
49
|
export const MoveBlockSchema = z.object({
|
|
26
50
|
uid: z.string().describe("Block UID to move"),
|
|
27
51
|
parentUid: z.string().describe("UID of the new parent block or page"),
|
|
28
|
-
order: z
|
|
52
|
+
order: z
|
|
53
|
+
.union([z.coerce.number(), z.enum(["first", "last"])])
|
|
54
|
+
.describe("Position in the new parent (number, 'first', or 'last')"),
|
|
29
55
|
});
|
|
30
56
|
export const GetBacklinksSchema = z.object({
|
|
31
57
|
uid: z.string().optional().describe("UID of page or block (required if no title)"),
|
|
32
58
|
title: z.string().optional().describe("Page title (required if no uid)"),
|
|
33
59
|
offset: z.coerce.number().optional().describe("Skip first N results (default: 0)"),
|
|
34
60
|
limit: z.coerce.number().optional().describe("Max results to return (default: 20)"),
|
|
35
|
-
sort: z
|
|
61
|
+
sort: z
|
|
62
|
+
.enum(["created-date", "edited-date", "daily-note-date"])
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Sort order (default: created-date)"),
|
|
36
65
|
sortOrder: z.enum(["asc", "desc"]).optional().describe("Sort direction (default: desc)"),
|
|
37
|
-
search: z
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
search: z
|
|
67
|
+
.string()
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Filter results by text match (searches block, parents, children, page title)"),
|
|
70
|
+
includePath: z
|
|
71
|
+
.boolean()
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Include breadcrumb path to each result (default: true)"),
|
|
74
|
+
maxDepth: z.coerce
|
|
75
|
+
.number()
|
|
76
|
+
.optional()
|
|
77
|
+
.describe("Max depth of children to include in markdown (default: 2)"),
|
|
40
78
|
});
|
|
41
79
|
export async function createBlock(client, params) {
|
|
42
80
|
// Validate: exactly one of parentUid, pageTitle, or dailyNotePage
|
|
43
|
-
const targets = [params.parentUid, params.pageTitle, params.dailyNotePage].filter(v => v !== undefined);
|
|
81
|
+
const targets = [params.parentUid, params.pageTitle, params.dailyNotePage].filter((v) => v !== undefined);
|
|
44
82
|
if (targets.length === 0) {
|
|
45
83
|
throw new RoamError("Either 'parentUid', 'pageTitle', or 'dailyNotePage' is required to specify where to create the block", ErrorCodes.VALIDATION_ERROR);
|
|
46
84
|
}
|
|
@@ -82,6 +120,10 @@ export async function updateBlock(client, params) {
|
|
|
82
120
|
block.open = params.open;
|
|
83
121
|
if (params.heading !== undefined)
|
|
84
122
|
block.heading = params.heading;
|
|
123
|
+
if (params.childrenViewType !== undefined)
|
|
124
|
+
block["children-view-type"] = params.childrenViewType;
|
|
125
|
+
if (params.textAlign !== undefined)
|
|
126
|
+
block["text-align"] = params.textAlign;
|
|
85
127
|
await client.call("data.block.update", [{ block }]);
|
|
86
128
|
return textResult({ success: true });
|
|
87
129
|
}
|
|
@@ -129,12 +171,21 @@ export async function getBacklinks(client, params) {
|
|
|
129
171
|
// --- Comments ---
|
|
130
172
|
export const AddCommentSchema = z.object({
|
|
131
173
|
blockUid: z.string().describe("UID of the block to comment on"),
|
|
132
|
-
comment: z
|
|
133
|
-
|
|
174
|
+
comment: z
|
|
175
|
+
.string()
|
|
176
|
+
.optional()
|
|
177
|
+
.describe("Plain text comment (single block, editable later via update_block). Required if commentMarkdown not provided. Preferred for simple comments."),
|
|
178
|
+
commentMarkdown: z
|
|
179
|
+
.string()
|
|
180
|
+
.optional()
|
|
181
|
+
.describe("Markdown comment parsed into multiple blocks. Required if comment not provided. Use only when you need structure (lists, headings). Harder to edit later."),
|
|
134
182
|
});
|
|
135
183
|
export const GetCommentsSchema = z.object({
|
|
136
184
|
blockUid: z.string().describe("UID of the block to get comments for"),
|
|
137
|
-
maxDepth: z.coerce
|
|
185
|
+
maxDepth: z.coerce
|
|
186
|
+
.number()
|
|
187
|
+
.optional()
|
|
188
|
+
.describe("Max depth of children to include in each comment's markdown (omit for full tree)"),
|
|
138
189
|
});
|
|
139
190
|
export async function addComment(client, params) {
|
|
140
191
|
// Validate: exactly one of comment or commentMarkdown must be provided
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { CallToolResult, RoamActionClient } from "../types.js";
|
|
3
|
+
export declare const DatalogQuerySchema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
inputs: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
query: string;
|
|
8
|
+
inputs?: unknown[] | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
query: string;
|
|
11
|
+
inputs?: unknown[] | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export type DatalogQueryParams = z.infer<typeof DatalogQuerySchema>;
|
|
14
|
+
export declare function datalogQuery(client: RoamActionClient, params: DatalogQueryParams): Promise<CallToolResult>;
|
|
15
|
+
//# sourceMappingURL=datalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datalog.d.ts","sourceRoot":"","sources":["../../src/operations/datalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpE,eAAO,MAAM,kBAAkB;;;;;;;;;EAQ7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,wBAAsB,YAAY,CAChC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,cAAc,CAAC,CAIzB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { textResult } from "../types.js";
|
|
3
|
+
export const DatalogQuerySchema = z.object({
|
|
4
|
+
query: z
|
|
5
|
+
.string()
|
|
6
|
+
.describe("Datalog query string (e.g., '[:find ?title :where [?e :node/title ?title]]')"),
|
|
7
|
+
inputs: z
|
|
8
|
+
.array(z.unknown())
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Input parameters for the query, corresponding to :in clause bindings after $"),
|
|
11
|
+
});
|
|
12
|
+
export async function datalogQuery(client, params) {
|
|
13
|
+
const args = params.inputs ? [params.query, ...params.inputs] : [params.query];
|
|
14
|
+
const response = await client.call("q", args);
|
|
15
|
+
return textResult(response.result ?? []);
|
|
16
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
-
import type { CallToolResult } from "../types.js";
|
|
2
|
+
import type { CallToolResult, RoamActionClient } from "../types.js";
|
|
4
3
|
export declare const FileGetSchema: z.ZodObject<{
|
|
5
4
|
url: z.ZodString;
|
|
6
5
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -16,14 +15,14 @@ export declare const FileUploadSchema: z.ZodObject<{
|
|
|
16
15
|
filename: z.ZodOptional<z.ZodString>;
|
|
17
16
|
}, "strip", z.ZodTypeAny, {
|
|
18
17
|
url?: string | undefined;
|
|
19
|
-
filePath?: string | undefined;
|
|
20
18
|
base64?: string | undefined;
|
|
19
|
+
filePath?: string | undefined;
|
|
21
20
|
mimetype?: string | undefined;
|
|
22
21
|
filename?: string | undefined;
|
|
23
22
|
}, {
|
|
24
23
|
url?: string | undefined;
|
|
25
|
-
filePath?: string | undefined;
|
|
26
24
|
base64?: string | undefined;
|
|
25
|
+
filePath?: string | undefined;
|
|
27
26
|
mimetype?: string | undefined;
|
|
28
27
|
filename?: string | undefined;
|
|
29
28
|
}>;
|
|
@@ -37,7 +36,7 @@ export declare const FileDeleteSchema: z.ZodObject<{
|
|
|
37
36
|
export type FileGetParams = z.infer<typeof FileGetSchema>;
|
|
38
37
|
export type FileUploadParams = z.infer<typeof FileUploadSchema>;
|
|
39
38
|
export type FileDeleteParams = z.infer<typeof FileDeleteSchema>;
|
|
40
|
-
export declare function getFile(client:
|
|
41
|
-
export declare function uploadFile(client:
|
|
42
|
-
export declare function deleteFile(client:
|
|
39
|
+
export declare function getFile(client: RoamActionClient, params: FileGetParams): Promise<CallToolResult>;
|
|
40
|
+
export declare function uploadFile(client: RoamActionClient, params: FileUploadParams): Promise<CallToolResult>;
|
|
41
|
+
export declare function deleteFile(client: RoamActionClient, params: FileDeleteParams): Promise<CallToolResult>;
|
|
43
42
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +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,
|
|
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,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpE,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAkB3B,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;AA+GhE,wBAAsB,OAAO,CAC3B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,cAAc,CAAC,CAkBzB;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,cAAc,CAAC,CAiDzB;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,cAAc,CAAC,CAGzB"}
|
package/dist/operations/files.js
CHANGED
|
@@ -7,11 +7,23 @@ export const FileGetSchema = z.object({
|
|
|
7
7
|
url: z.string().describe("Firebase storage URL of the file"),
|
|
8
8
|
});
|
|
9
9
|
export const FileUploadSchema = z.object({
|
|
10
|
-
filePath: z
|
|
10
|
+
filePath: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Local file path (preferred) - server reads the file directly"),
|
|
11
14
|
url: z.string().optional().describe("Remote URL to fetch the file from"),
|
|
12
|
-
base64: z
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
base64: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Base64-encoded file data (fallback for sandboxed clients)"),
|
|
19
|
+
mimetype: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("MIME type (e.g., image/png, image/jpeg) - auto-detected if not provided"),
|
|
23
|
+
filename: z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Original filename for reference - derived from path/url if not provided"),
|
|
15
27
|
});
|
|
16
28
|
export const FileDeleteSchema = z.object({
|
|
17
29
|
url: z.string().describe("Firebase storage URL of the file to delete"),
|
|
@@ -102,7 +114,8 @@ async function fetchRemoteFile(url) {
|
|
|
102
114
|
// Try Content-Type header first, then extension, then magic bytes
|
|
103
115
|
let mimetype = response.headers.get("content-type")?.split(";")[0];
|
|
104
116
|
if (!mimetype || mimetype === "application/octet-stream") {
|
|
105
|
-
mimetype =
|
|
117
|
+
mimetype =
|
|
118
|
+
detectMimeTypeFromExtension(urlPath) || detectMimeTypeFromBase64(base64) || undefined;
|
|
106
119
|
}
|
|
107
120
|
if (!mimetype) {
|
|
108
121
|
throw new Error(`Could not detect MIME type for URL: ${url}`);
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
-
import type { CallToolResult } from "../types.js";
|
|
2
|
+
import type { CallToolResult, RoamActionClient } from "../types.js";
|
|
4
3
|
export declare const GetOpenWindowsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
5
4
|
export declare const GetSelectionSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
6
5
|
export declare const OpenMainWindowSchema: z.ZodObject<{
|
|
7
6
|
uid: z.ZodOptional<z.ZodString>;
|
|
8
7
|
title: z.ZodOptional<z.ZodString>;
|
|
9
8
|
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
uid?: string | undefined;
|
|
11
9
|
title?: string | undefined;
|
|
12
|
-
}, {
|
|
13
10
|
uid?: string | undefined;
|
|
11
|
+
}, {
|
|
14
12
|
title?: string | undefined;
|
|
13
|
+
uid?: string | undefined;
|
|
15
14
|
}>;
|
|
16
15
|
export declare const OpenSidebarSchema: z.ZodObject<{
|
|
17
16
|
uid: z.ZodString;
|
|
18
17
|
type: z.ZodOptional<z.ZodEnum<["block", "outline", "mentions"]>>;
|
|
19
18
|
}, "strip", z.ZodTypeAny, {
|
|
20
19
|
uid: string;
|
|
21
|
-
type?: "
|
|
20
|
+
type?: "mentions" | "block" | "outline" | undefined;
|
|
22
21
|
}, {
|
|
23
22
|
uid: string;
|
|
24
|
-
type?: "
|
|
23
|
+
type?: "mentions" | "block" | "outline" | undefined;
|
|
25
24
|
}>;
|
|
26
25
|
export type OpenMainWindowParams = z.infer<typeof OpenMainWindowSchema>;
|
|
27
26
|
export type OpenSidebarParams = z.infer<typeof OpenSidebarSchema>;
|
|
28
|
-
export declare function getOpenWindows(client:
|
|
29
|
-
export declare function getSelection(client:
|
|
30
|
-
export declare function openMainWindow(client:
|
|
31
|
-
export declare function openSidebar(client:
|
|
27
|
+
export declare function getOpenWindows(client: RoamActionClient): Promise<CallToolResult>;
|
|
28
|
+
export declare function getSelection(client: RoamActionClient): Promise<CallToolResult>;
|
|
29
|
+
export declare function openMainWindow(client: RoamActionClient, params: OpenMainWindowParams): Promise<CallToolResult>;
|
|
30
|
+
export declare function openSidebar(client: RoamActionClient, params: OpenSidebarParams): Promise<CallToolResult>;
|
|
32
31
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/operations/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/operations/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAKV,cAAc,EACd,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAIrB,eAAO,MAAM,oBAAoB,gDAAe,CAAC;AAEjD,eAAO,MAAM,kBAAkB,gDAAe,CAAC;AAE/C,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;EAM5B,CAAC;AAGH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,wBAAsB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAStF;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CASpF;AAED,wBAAsB,cAAc,CAClC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,cAAc,CAAC,CAQzB;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAUzB"}
|
|
@@ -9,7 +9,10 @@ export const OpenMainWindowSchema = z.object({
|
|
|
9
9
|
});
|
|
10
10
|
export const OpenSidebarSchema = z.object({
|
|
11
11
|
uid: z.string().describe("UID of page or block"),
|
|
12
|
-
type: z
|
|
12
|
+
type: z
|
|
13
|
+
.enum(["block", "outline", "mentions"])
|
|
14
|
+
.optional()
|
|
15
|
+
.describe("View type (default: outline)"),
|
|
13
16
|
});
|
|
14
17
|
export async function getOpenWindows(client) {
|
|
15
18
|
const [mainResponse, sidebarResponse] = await Promise.all([
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type {
|
|
3
|
-
import type { CallToolResult } from "../types.js";
|
|
2
|
+
import type { CallToolResult, RoamActionClient } from "../types.js";
|
|
4
3
|
export declare const CreatePageSchema: z.ZodObject<{
|
|
5
4
|
title: z.ZodString;
|
|
6
5
|
markdown: z.ZodOptional<z.ZodString>;
|
|
7
6
|
uid: z.ZodOptional<z.ZodString>;
|
|
7
|
+
childrenViewType: z.ZodOptional<z.ZodEnum<["document", "bullet", "numbered"]>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
title: string;
|
|
10
|
-
uid?: string | undefined;
|
|
11
10
|
markdown?: string | undefined;
|
|
11
|
+
uid?: string | undefined;
|
|
12
|
+
childrenViewType?: "bullet" | "numbered" | "document" | undefined;
|
|
12
13
|
}, {
|
|
13
14
|
title: string;
|
|
14
|
-
uid?: string | undefined;
|
|
15
15
|
markdown?: string | undefined;
|
|
16
|
+
uid?: string | undefined;
|
|
17
|
+
childrenViewType?: "bullet" | "numbered" | "document" | undefined;
|
|
16
18
|
}>;
|
|
17
19
|
export declare const GetPageSchema: z.ZodObject<{
|
|
18
20
|
title: z.ZodOptional<z.ZodString>;
|
|
19
21
|
uid: z.ZodOptional<z.ZodString>;
|
|
20
22
|
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
21
23
|
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
uid?: string | undefined;
|
|
23
24
|
title?: string | undefined;
|
|
25
|
+
uid?: string | undefined;
|
|
24
26
|
maxDepth?: number | undefined;
|
|
25
27
|
}, {
|
|
26
|
-
uid?: string | undefined;
|
|
27
28
|
title?: string | undefined;
|
|
29
|
+
uid?: string | undefined;
|
|
28
30
|
maxDepth?: number | undefined;
|
|
29
31
|
}>;
|
|
30
32
|
export declare const DeletePageSchema: z.ZodObject<{
|
|
@@ -42,12 +44,12 @@ export declare const UpdatePageSchema: z.ZodObject<{
|
|
|
42
44
|
}, "strip", z.ZodTypeAny, {
|
|
43
45
|
uid: string;
|
|
44
46
|
title?: string | undefined;
|
|
45
|
-
childrenViewType?: "
|
|
47
|
+
childrenViewType?: "bullet" | "numbered" | "document" | undefined;
|
|
46
48
|
mergePages?: boolean | undefined;
|
|
47
49
|
}, {
|
|
48
50
|
uid: string;
|
|
49
51
|
title?: string | undefined;
|
|
50
|
-
childrenViewType?: "
|
|
52
|
+
childrenViewType?: "bullet" | "numbered" | "document" | undefined;
|
|
51
53
|
mergePages?: boolean | undefined;
|
|
52
54
|
}>;
|
|
53
55
|
export declare const GetGuidelinesSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
@@ -55,9 +57,9 @@ export type CreatePageParams = z.infer<typeof CreatePageSchema>;
|
|
|
55
57
|
export type GetPageParams = z.infer<typeof GetPageSchema>;
|
|
56
58
|
export type DeletePageParams = z.infer<typeof DeletePageSchema>;
|
|
57
59
|
export type UpdatePageParams = z.infer<typeof UpdatePageSchema>;
|
|
58
|
-
export declare function createPage(client:
|
|
59
|
-
export declare function getPage(client:
|
|
60
|
-
export declare function deletePage(client:
|
|
61
|
-
export declare function updatePage(client:
|
|
62
|
-
export declare function getGuidelines(client:
|
|
60
|
+
export declare function createPage(client: RoamActionClient, params: CreatePageParams): Promise<CallToolResult>;
|
|
61
|
+
export declare function getPage(client: RoamActionClient, params: GetPageParams): Promise<CallToolResult>;
|
|
62
|
+
export declare function deletePage(client: RoamActionClient, params: DeletePageParams): Promise<CallToolResult>;
|
|
63
|
+
export declare function updatePage(client: RoamActionClient, params: UpdatePageParams): Promise<CallToolResult>;
|
|
64
|
+
export declare function getGuidelines(client: RoamActionClient): Promise<CallToolResult>;
|
|
63
65
|
//# sourceMappingURL=pages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/operations/pages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources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