rote-toolkit 0.3.4 → 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 +9 -2
- package/README.zh-CN.md +9 -2
- package/dist/api.d.ts +2 -1
- package/dist/api.js +7 -0
- package/dist/cli.js +13 -0
- package/dist/mcp.js +29 -0
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Rote Toolkit
|
|
2
|
-
|
|
3
1
|
<p align="right">English | <a href="./README.zh-CN.md">中文</a></p>
|
|
4
2
|
|
|
3
|
+
# Rote Toolkit
|
|
4
|
+
|
|
5
5
|
Rote Toolkit is a TypeScript toolkit for connecting to and extending your [Rote](https://rote.ink) note system from terminal workflows and AI agents. It uses the Rote OpenKey API for simple, reusable authentication.
|
|
6
6
|
|
|
7
7
|
Main project repository: [`Rabithua/rote`](https://github.com/Rabithua/rote).
|
|
@@ -63,6 +63,12 @@ List recent notes (with archive/tag filters):
|
|
|
63
63
|
rote list --limit 5 --archived -t "knowledge"
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
List explore notes (no auth required):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
rote explore --limit 5
|
|
70
|
+
```
|
|
71
|
+
|
|
66
72
|
## MCP Usage
|
|
67
73
|
|
|
68
74
|
### Do I need pre-installation?
|
|
@@ -135,6 +141,7 @@ rote-mcp
|
|
|
135
141
|
- `rote_delete_note`
|
|
136
142
|
- `rote_search_notes`
|
|
137
143
|
- `rote_list_notes`
|
|
144
|
+
- `rote_explore_notes`
|
|
138
145
|
|
|
139
146
|
## Local Development
|
|
140
147
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Rote Toolkit
|
|
2
|
-
|
|
3
1
|
<p align="right"><a href="./README.md">English</a> | 中文</p>
|
|
4
2
|
|
|
3
|
+
# Rote Toolkit
|
|
4
|
+
|
|
5
5
|
Rote Toolkit 是一个基于 TypeScript 的增强工具包,主要用于在终端或 AI Agents 侧连接和增强你的 [Rote](https://rote.ink) 笔记系统。基于 Rote OpenKey API 授权,即插即用,无需繁复的登录流程。
|
|
6
6
|
|
|
7
7
|
主项目仓库:[`Rabithua/rote`](https://github.com/Rabithua/rote)。
|
|
@@ -63,6 +63,12 @@ rote search "MCP"
|
|
|
63
63
|
rote list --limit 5 --archived -t "知识管理"
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
获取探索页面的笔记(无需配置 OpenKey):
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
rote explore --limit 5
|
|
70
|
+
```
|
|
71
|
+
|
|
66
72
|
## MCP 模式使用指南
|
|
67
73
|
|
|
68
74
|
### 是否需要提前安装?
|
|
@@ -135,6 +141,7 @@ rote-mcp
|
|
|
135
141
|
- `rote_delete_note`
|
|
136
142
|
- `rote_search_notes`
|
|
137
143
|
- `rote_list_notes`
|
|
144
|
+
- `rote_explore_notes`
|
|
138
145
|
|
|
139
146
|
## 本地开发
|
|
140
147
|
|
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddReactionInput, CreateArticleInput, CreateNoteInput, ListNotesInput, RemoveReactionInput, RemoveReactionResponse, RoteArticle, RoteNote, RotePermissions, RoteProfile, RoteReaction, SearchNotesInput, ToolkitConfig, UpdateNoteInput, UpdateProfileInput } from "./types.js";
|
|
1
|
+
import type { AddReactionInput, CreateArticleInput, CreateNoteInput, ExploreNotesInput, ListNotesInput, RemoveReactionInput, RemoveReactionResponse, RoteArticle, RoteNote, RotePermissions, RoteProfile, RoteReaction, SearchNotesInput, ToolkitConfig, UpdateNoteInput, UpdateProfileInput } from "./types.js";
|
|
2
2
|
export declare class RoteClient {
|
|
3
3
|
private readonly apiUrl;
|
|
4
4
|
private readonly openKey;
|
|
@@ -8,6 +8,7 @@ export declare class RoteClient {
|
|
|
8
8
|
deleteNote(noteId: string): Promise<unknown>;
|
|
9
9
|
searchNotes(input: SearchNotesInput): Promise<RoteNote[]>;
|
|
10
10
|
listNotes(input?: ListNotesInput): Promise<RoteNote[]>;
|
|
11
|
+
exploreNotes(input?: ExploreNotesInput): Promise<RoteNote[]>;
|
|
11
12
|
createArticle(input: CreateArticleInput): Promise<RoteArticle>;
|
|
12
13
|
addReaction(input: AddReactionInput): Promise<RoteReaction>;
|
|
13
14
|
removeReaction(input: RemoveReactionInput): Promise<RemoveReactionResponse>;
|
package/dist/api.js
CHANGED
|
@@ -111,6 +111,13 @@ export class RoteClient {
|
|
|
111
111
|
}
|
|
112
112
|
return this.request(`/v2/api/openkey/notes?${params.toString()}`);
|
|
113
113
|
}
|
|
114
|
+
async exploreNotes(input = {}) {
|
|
115
|
+
const params = new URLSearchParams({
|
|
116
|
+
limit: String(input.limit ?? 20),
|
|
117
|
+
skip: String(input.skip ?? 0),
|
|
118
|
+
});
|
|
119
|
+
return this.request(`/v2/api/notes/public?${params.toString()}`);
|
|
120
|
+
}
|
|
114
121
|
async createArticle(input) {
|
|
115
122
|
if (!input.content?.trim()) {
|
|
116
123
|
throw new Error("content is required");
|
package/dist/cli.js
CHANGED
|
@@ -159,6 +159,19 @@ program
|
|
|
159
159
|
});
|
|
160
160
|
printNotes(notes);
|
|
161
161
|
});
|
|
162
|
+
program
|
|
163
|
+
.command("explore")
|
|
164
|
+
.description("List explore notes (no authentication required)")
|
|
165
|
+
.option("-l, --limit <limit>", "max results", parseInt, 20)
|
|
166
|
+
.option("-s, --skip <skip>", "offset", parseInt, 0)
|
|
167
|
+
.action(async (options) => {
|
|
168
|
+
const client = new RoteClient();
|
|
169
|
+
const notes = await client.exploreNotes({
|
|
170
|
+
limit: options.limit,
|
|
171
|
+
skip: options.skip,
|
|
172
|
+
});
|
|
173
|
+
printNotes(notes);
|
|
174
|
+
});
|
|
162
175
|
program
|
|
163
176
|
.command("mcp")
|
|
164
177
|
.description("Start MCP server over stdio")
|
package/dist/mcp.js
CHANGED
|
@@ -271,6 +271,35 @@ export async function startMcpServer() {
|
|
|
271
271
|
],
|
|
272
272
|
};
|
|
273
273
|
});
|
|
274
|
+
server.registerTool("rote_explore_notes", {
|
|
275
|
+
description: "Get explore notes in Rote (no authentication required).",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
limit: z
|
|
278
|
+
.number()
|
|
279
|
+
.int()
|
|
280
|
+
.min(1)
|
|
281
|
+
.max(50)
|
|
282
|
+
.optional()
|
|
283
|
+
.describe("Max results, default 20"),
|
|
284
|
+
skip: z
|
|
285
|
+
.number()
|
|
286
|
+
.int()
|
|
287
|
+
.min(0)
|
|
288
|
+
.optional()
|
|
289
|
+
.describe("Pagination offset, default 0"),
|
|
290
|
+
},
|
|
291
|
+
}, async ({ limit, skip }) => {
|
|
292
|
+
const notes = await client.exploreNotes({ limit, skip });
|
|
293
|
+
const lines = notes.map((note, i) => `${i + 1}. ${truncateSingleLine(note.content, 100)}`);
|
|
294
|
+
return {
|
|
295
|
+
content: [
|
|
296
|
+
{
|
|
297
|
+
type: "text",
|
|
298
|
+
text: lines.length > 0 ? lines.join("\n") : "No explore notes found.",
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
};
|
|
302
|
+
});
|
|
274
303
|
const transport = new StdioServerTransport();
|
|
275
304
|
await server.connect(transport);
|
|
276
305
|
}
|
package/dist/types.d.ts
CHANGED