@charlie.act7/gemini-notebook-mcp 2.0.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/LICENSE +21 -0
- package/README.md +435 -0
- package/dist/auth/account-switcher.d.ts +21 -0
- package/dist/auth/account-switcher.d.ts.map +1 -0
- package/dist/auth/account-switcher.js +54 -0
- package/dist/auth/account-switcher.js.map +1 -0
- package/dist/auth/auth-manager.d.ts +139 -0
- package/dist/auth/auth-manager.d.ts.map +1 -0
- package/dist/auth/auth-manager.js +1006 -0
- package/dist/auth/auth-manager.js.map +1 -0
- package/dist/browser/chromium-fallback.d.ts +24 -0
- package/dist/browser/chromium-fallback.d.ts.map +1 -0
- package/dist/browser/chromium-fallback.js +53 -0
- package/dist/browser/chromium-fallback.js.map +1 -0
- package/dist/browser/watchdog.d.ts +35 -0
- package/dist/browser/watchdog.d.ts.map +1 -0
- package/dist/browser/watchdog.js +74 -0
- package/dist/browser/watchdog.js.map +1 -0
- package/dist/config.d.ts +99 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +255 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +26 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +41 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +558 -0
- package/dist/index.js.map +1 -0
- package/dist/library/metadata.d.ts +14 -0
- package/dist/library/metadata.d.ts.map +1 -0
- package/dist/library/metadata.js +33 -0
- package/dist/library/metadata.js.map +1 -0
- package/dist/library/notebook-library.d.ts +70 -0
- package/dist/library/notebook-library.d.ts.map +1 -0
- package/dist/library/notebook-library.js +311 -0
- package/dist/library/notebook-library.js.map +1 -0
- package/dist/library/types.d.ts +67 -0
- package/dist/library/types.d.ts.map +1 -0
- package/dist/library/types.js +8 -0
- package/dist/library/types.js.map +1 -0
- package/dist/notebooklm/audio.d.ts +67 -0
- package/dist/notebooklm/audio.d.ts.map +1 -0
- package/dist/notebooklm/audio.js +275 -0
- package/dist/notebooklm/audio.js.map +1 -0
- package/dist/notebooklm/chat.d.ts +79 -0
- package/dist/notebooklm/chat.d.ts.map +1 -0
- package/dist/notebooklm/chat.js +631 -0
- package/dist/notebooklm/chat.js.map +1 -0
- package/dist/notebooklm/citations.d.ts +35 -0
- package/dist/notebooklm/citations.d.ts.map +1 -0
- package/dist/notebooklm/citations.js +173 -0
- package/dist/notebooklm/citations.js.map +1 -0
- package/dist/notebooklm/selectors.d.ts +168 -0
- package/dist/notebooklm/selectors.d.ts.map +1 -0
- package/dist/notebooklm/selectors.js +435 -0
- package/dist/notebooklm/selectors.js.map +1 -0
- package/dist/notebooklm/sources.d.ts +61 -0
- package/dist/notebooklm/sources.d.ts.map +1 -0
- package/dist/notebooklm/sources.js +324 -0
- package/dist/notebooklm/sources.js.map +1 -0
- package/dist/notebooklm/url.d.ts +7 -0
- package/dist/notebooklm/url.d.ts.map +1 -0
- package/dist/notebooklm/url.js +36 -0
- package/dist/notebooklm/url.js.map +1 -0
- package/dist/resources/resource-handlers.d.ts +22 -0
- package/dist/resources/resource-handlers.d.ts.map +1 -0
- package/dist/resources/resource-handlers.js +220 -0
- package/dist/resources/resource-handlers.js.map +1 -0
- package/dist/session/browser-session.d.ts +147 -0
- package/dist/session/browser-session.d.ts.map +1 -0
- package/dist/session/browser-session.js +838 -0
- package/dist/session/browser-session.js.map +1 -0
- package/dist/session/session-manager.d.ts +80 -0
- package/dist/session/session-manager.d.ts.map +1 -0
- package/dist/session/session-manager.js +294 -0
- package/dist/session/session-manager.js.map +1 -0
- package/dist/session/shared-context-manager.d.ts +107 -0
- package/dist/session/shared-context-manager.d.ts.map +1 -0
- package/dist/session/shared-context-manager.js +465 -0
- package/dist/session/shared-context-manager.js.map +1 -0
- package/dist/tools/definitions/ask-question.d.ts +8 -0
- package/dist/tools/definitions/ask-question.d.ts.map +1 -0
- package/dist/tools/definitions/ask-question.js +244 -0
- package/dist/tools/definitions/ask-question.js.map +1 -0
- package/dist/tools/definitions/notebook-management.d.ts +9 -0
- package/dist/tools/definitions/notebook-management.d.ts.map +1 -0
- package/dist/tools/definitions/notebook-management.js +263 -0
- package/dist/tools/definitions/notebook-management.js.map +1 -0
- package/dist/tools/definitions/session-management.d.ts +12 -0
- package/dist/tools/definitions/session-management.d.ts.map +1 -0
- package/dist/tools/definitions/session-management.js +82 -0
- package/dist/tools/definitions/session-management.js.map +1 -0
- package/dist/tools/definitions/sources.d.ts +14 -0
- package/dist/tools/definitions/sources.d.ts.map +1 -0
- package/dist/tools/definitions/sources.js +200 -0
- package/dist/tools/definitions/sources.js.map +1 -0
- package/dist/tools/definitions/system.d.ts +9 -0
- package/dist/tools/definitions/system.d.ts.map +1 -0
- package/dist/tools/definitions/system.js +152 -0
- package/dist/tools/definitions/system.js.map +1 -0
- package/dist/tools/definitions.d.ts +12 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +28 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/handlers.d.ts +274 -0
- package/dist/tools/handlers.d.ts.map +1 -0
- package/dist/tools/handlers.js +840 -0
- package/dist/tools/handlers.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/transport/http.d.ts +38 -0
- package/dist/transport/http.d.ts.map +1 -0
- package/dist/transport/http.js +231 -0
- package/dist/transport/http.js.map +1 -0
- package/dist/types.d.ts +101 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/cleanup-manager.d.ts +133 -0
- package/dist/utils/cleanup-manager.d.ts.map +1 -0
- package/dist/utils/cleanup-manager.js +671 -0
- package/dist/utils/cleanup-manager.js.map +1 -0
- package/dist/utils/cli-handler.d.ts +16 -0
- package/dist/utils/cli-handler.d.ts.map +1 -0
- package/dist/utils/cli-handler.js +105 -0
- package/dist/utils/cli-handler.js.map +1 -0
- package/dist/utils/disclaimer.d.ts +31 -0
- package/dist/utils/disclaimer.d.ts.map +1 -0
- package/dist/utils/disclaimer.js +43 -0
- package/dist/utils/disclaimer.js.map +1 -0
- package/dist/utils/logger.d.ts +61 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +92 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/page-utils.d.ts +25 -0
- package/dist/utils/page-utils.d.ts.map +1 -0
- package/dist/utils/page-utils.js +51 -0
- package/dist/utils/page-utils.js.map +1 -0
- package/dist/utils/settings-manager.d.ts +37 -0
- package/dist/utils/settings-manager.d.ts.map +1 -0
- package/dist/utils/settings-manager.js +141 -0
- package/dist/utils/settings-manager.js.map +1 -0
- package/dist/utils/stealth-utils.d.ts +135 -0
- package/dist/utils/stealth-utils.d.ts.map +1 -0
- package/dist/utils/stealth-utils.js +399 -0
- package/dist/utils/stealth-utils.js.map +1 -0
- package/docs/configuration.md +181 -0
- package/docs/tools.md +417 -0
- package/docs/troubleshooting.md +171 -0
- package/docs/usage-guide.md +284 -0
- package/package.json +71 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { getTopicsLine, getUseCaseBullets } from "../../library/metadata.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build dynamic tool description for ask_question based on active notebook or library
|
|
4
|
+
*/
|
|
5
|
+
export function buildAskQuestionDescription(library) {
|
|
6
|
+
const active = library.getActiveNotebook();
|
|
7
|
+
const bt = "`"; // Backtick helper to avoid template literal issues
|
|
8
|
+
if (active) {
|
|
9
|
+
// Safe accessors — older library.json files may omit topics/use_cases (issue #33).
|
|
10
|
+
const topics = getTopicsLine(active);
|
|
11
|
+
const useCases = getUseCaseBullets(active);
|
|
12
|
+
return `# Conversational Research Partner (NotebookLM • Gemini 2.5 • Session RAG)
|
|
13
|
+
|
|
14
|
+
**Active Notebook:** ${active.name}
|
|
15
|
+
**Content:** ${active.description}
|
|
16
|
+
**Topics:** ${topics}
|
|
17
|
+
|
|
18
|
+
> Auth tip: If login is required, use the prompt 'notebooklm.auth-setup' and then verify with the 'get_health' tool. If authentication later fails (e.g., expired cookies), use the prompt 'notebooklm.auth-repair'.
|
|
19
|
+
|
|
20
|
+
## What This Tool Is
|
|
21
|
+
- Full conversational research with Gemini (LLM) grounded on your notebook sources
|
|
22
|
+
- Session-based: each follow-up uses prior context for deeper, more precise answers
|
|
23
|
+
- Source-cited responses designed to minimize hallucinations
|
|
24
|
+
|
|
25
|
+
## When To Use
|
|
26
|
+
${useCases}
|
|
27
|
+
|
|
28
|
+
## Rules (Important)
|
|
29
|
+
- Always prefer continuing an existing session for the same task
|
|
30
|
+
- If you start a new thread, create a new session and keep its session_id
|
|
31
|
+
- Ask clarifying questions before implementing; do not guess missing details
|
|
32
|
+
- If multiple notebooks could apply, propose the top 1–2 and ask which to use
|
|
33
|
+
- If task context changes, ask to reset the session or switch notebooks
|
|
34
|
+
- If authentication fails, use the prompts 'notebooklm.auth-repair' (or 'notebooklm.auth-setup') and verify with 'get_health'
|
|
35
|
+
- After every NotebookLM answer: pause, compare with the user's goal, and only respond if you are 100% sure the information is complete. Otherwise, plan the next NotebookLM question in the same session.
|
|
36
|
+
|
|
37
|
+
## Session Flow (Recommended)
|
|
38
|
+
${bt}${bt}${bt}javascript
|
|
39
|
+
// 1) Start broad (no session_id → creates one)
|
|
40
|
+
ask_question({ question: "Give me an overview of [topic]" })
|
|
41
|
+
// ← Save: result.session_id
|
|
42
|
+
|
|
43
|
+
// 2) Go specific (same session)
|
|
44
|
+
ask_question({ question: "Key APIs/methods?", session_id })
|
|
45
|
+
|
|
46
|
+
// 3) Cover pitfalls (same session)
|
|
47
|
+
ask_question({ question: "Common edge cases + gotchas?", session_id })
|
|
48
|
+
|
|
49
|
+
// 4) Ask for production example (same session)
|
|
50
|
+
ask_question({ question: "Show a production-ready example", session_id })
|
|
51
|
+
${bt}${bt}${bt}
|
|
52
|
+
|
|
53
|
+
## Automatic Multi-Pass Strategy (Host-driven)
|
|
54
|
+
- Simple prompts return once-and-done answers.
|
|
55
|
+
- For complex prompts, the host should issue follow-up calls:
|
|
56
|
+
1. Implementation plan (APIs, dependencies, configuration, authentication).
|
|
57
|
+
2. Pitfalls, gaps, validation steps, missing prerequisites.
|
|
58
|
+
- Keep the same session_id for all follow-ups, review NotebookLM's answer, and ask more questions until the problem is fully resolved.
|
|
59
|
+
- Before replying to the user, double-check: do you truly have everything? If not, queue another ask_question immediately.
|
|
60
|
+
|
|
61
|
+
## 🔥 REAL EXAMPLE
|
|
62
|
+
|
|
63
|
+
Task: "Implement error handling in n8n workflow"
|
|
64
|
+
|
|
65
|
+
Bad (shallow):
|
|
66
|
+
${bt}${bt}${bt}
|
|
67
|
+
Q: "How do I handle errors in n8n?"
|
|
68
|
+
A: [basic answer]
|
|
69
|
+
→ Implement → Probably missing edge cases!
|
|
70
|
+
${bt}${bt}${bt}
|
|
71
|
+
|
|
72
|
+
Good (deep):
|
|
73
|
+
${bt}${bt}${bt}
|
|
74
|
+
Q1: "What are n8n's error handling mechanisms?" (session created)
|
|
75
|
+
A1: [Overview of error handling]
|
|
76
|
+
|
|
77
|
+
Q2: "What's the recommended pattern for API errors?" (same session)
|
|
78
|
+
A2: [Specific patterns, uses context from Q1]
|
|
79
|
+
|
|
80
|
+
Q3: "How do I handle retry logic and timeouts?" (same session)
|
|
81
|
+
A3: [Detailed approach, builds on Q1+Q2]
|
|
82
|
+
|
|
83
|
+
Q4: "Show me a production example with all these patterns" (same session)
|
|
84
|
+
A4: [Complete example with full context]
|
|
85
|
+
|
|
86
|
+
→ NOW implement with confidence!
|
|
87
|
+
${bt}${bt}${bt}
|
|
88
|
+
|
|
89
|
+
## Notebook Selection
|
|
90
|
+
- Default: active notebook (${active.id})
|
|
91
|
+
- Or set notebook_id to use a library notebook
|
|
92
|
+
- Or set notebook_url for ad-hoc notebooks (not in library)
|
|
93
|
+
- If ambiguous which notebook fits, ASK the user which to use`;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return `# Conversational Research Partner (NotebookLM • Gemini 2.5 • Session RAG)
|
|
97
|
+
|
|
98
|
+
## No Active Notebook
|
|
99
|
+
- Visit https://notebooklm.google to create a notebook and get a share link
|
|
100
|
+
- Use **add_notebook** to add it to your library (explains how to get the link)
|
|
101
|
+
- Use **list_notebooks** to show available sources
|
|
102
|
+
- Use **select_notebook** to set one active
|
|
103
|
+
|
|
104
|
+
> Auth tip: If login is required, use the prompt 'notebooklm.auth-setup' and then verify with the 'get_health' tool. If authentication later fails (e.g., expired cookies), use the prompt 'notebooklm.auth-repair'.
|
|
105
|
+
|
|
106
|
+
Tip: Tell the user you can manage NotebookLM library and ask which notebook to use for the current task.`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export const askQuestionTool = {
|
|
110
|
+
name: "ask_question",
|
|
111
|
+
// Description will be set dynamically using buildAskQuestionDescription
|
|
112
|
+
description: "Dynamic description placeholder",
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: {
|
|
116
|
+
question: {
|
|
117
|
+
type: "string",
|
|
118
|
+
description: "The question to ask NotebookLM. Plain natural language; can be " +
|
|
119
|
+
"multi-line. Gemini responds grounded on the notebook's sources.",
|
|
120
|
+
},
|
|
121
|
+
session_id: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Reuse an existing browser session for follow-up questions. " +
|
|
124
|
+
"Pass back the `session_id` returned in a prior `ask_question` " +
|
|
125
|
+
"response — NotebookLM keeps the prior conversation in context, " +
|
|
126
|
+
"so follow-ups get sharper. Omit for a fresh session. " +
|
|
127
|
+
"`list_sessions` enumerates live sessions.",
|
|
128
|
+
},
|
|
129
|
+
notebook_id: {
|
|
130
|
+
type: "string",
|
|
131
|
+
description: "Library notebook id (from `list_notebooks` / `search_notebooks`). " +
|
|
132
|
+
"Defaults to the active notebook (see `select_notebook`) when omitted.",
|
|
133
|
+
},
|
|
134
|
+
notebook_url: {
|
|
135
|
+
type: "string",
|
|
136
|
+
description: "Direct NotebookLM URL — overrides `notebook_id`. Use for ad-hoc " +
|
|
137
|
+
"queries against notebooks not yet in your library. Format: " +
|
|
138
|
+
"`https://notebook.google.com/notebook/<uuid>` (the legacy " +
|
|
139
|
+
"`notebooklm.google.com` host is also accepted).",
|
|
140
|
+
},
|
|
141
|
+
source_format: {
|
|
142
|
+
type: "string",
|
|
143
|
+
enum: ["none", "inline", "footnotes", "json"],
|
|
144
|
+
description: "How citations are returned alongside the answer:\n" +
|
|
145
|
+
" • `none` (default) — raw answer, no citation extraction (fastest)\n" +
|
|
146
|
+
' • `footnotes` — answer plus a `Sources:` block, e.g. `[1] DocName — "excerpt…"`\n' +
|
|
147
|
+
' • `inline` — `[N]` markers in the answer are replaced with `[N] (DocName: "excerpt…")`\n' +
|
|
148
|
+
" • `json` — answer text untouched; structured `sources` array on the response\n\n" +
|
|
149
|
+
"Use `none` for snappy chat. Use `json` when downstream code needs to " +
|
|
150
|
+
"process citations programmatically. Use `footnotes`/`inline` when " +
|
|
151
|
+
"showing the answer to a human reader.",
|
|
152
|
+
},
|
|
153
|
+
show_browser: {
|
|
154
|
+
type: "boolean",
|
|
155
|
+
description: "Show browser window for debugging (simple version). " +
|
|
156
|
+
"For advanced control (typing speed, stealth, etc.), use browser_options instead.",
|
|
157
|
+
},
|
|
158
|
+
browser_options: {
|
|
159
|
+
type: "object",
|
|
160
|
+
description: "Optional browser behavior settings. Claude can control everything: " +
|
|
161
|
+
"visibility, typing speed, stealth mode, timeouts. Useful for debugging or fine-tuning.",
|
|
162
|
+
properties: {
|
|
163
|
+
show: {
|
|
164
|
+
type: "boolean",
|
|
165
|
+
description: "Show browser window (default: from ENV or false)",
|
|
166
|
+
},
|
|
167
|
+
headless: {
|
|
168
|
+
type: "boolean",
|
|
169
|
+
description: "Run browser in headless mode (default: true)",
|
|
170
|
+
},
|
|
171
|
+
timeout_ms: {
|
|
172
|
+
type: "number",
|
|
173
|
+
description: "Browser operation timeout in milliseconds (default: 30000)",
|
|
174
|
+
},
|
|
175
|
+
answer_timeout_ms: {
|
|
176
|
+
type: "number",
|
|
177
|
+
description: "Maximum wait for a NotebookLM answer in milliseconds (default: 600000)",
|
|
178
|
+
},
|
|
179
|
+
stealth: {
|
|
180
|
+
type: "object",
|
|
181
|
+
description: "Human-like behavior settings to avoid detection",
|
|
182
|
+
properties: {
|
|
183
|
+
enabled: {
|
|
184
|
+
type: "boolean",
|
|
185
|
+
description: "Master switch for all stealth features (default: true)",
|
|
186
|
+
},
|
|
187
|
+
random_delays: {
|
|
188
|
+
type: "boolean",
|
|
189
|
+
description: "Random delays between actions (default: true)",
|
|
190
|
+
},
|
|
191
|
+
human_typing: {
|
|
192
|
+
type: "boolean",
|
|
193
|
+
description: "Human-like typing patterns (default: true)",
|
|
194
|
+
},
|
|
195
|
+
mouse_movements: {
|
|
196
|
+
type: "boolean",
|
|
197
|
+
description: "Realistic mouse movements (default: true)",
|
|
198
|
+
},
|
|
199
|
+
typing_wpm_min: {
|
|
200
|
+
type: "number",
|
|
201
|
+
description: "Minimum typing speed in WPM (default: 160)",
|
|
202
|
+
},
|
|
203
|
+
typing_wpm_max: {
|
|
204
|
+
type: "number",
|
|
205
|
+
description: "Maximum typing speed in WPM (default: 240)",
|
|
206
|
+
},
|
|
207
|
+
delay_min_ms: {
|
|
208
|
+
type: "number",
|
|
209
|
+
description: "Minimum delay between actions in ms (default: 100)",
|
|
210
|
+
},
|
|
211
|
+
delay_max_ms: {
|
|
212
|
+
type: "number",
|
|
213
|
+
description: "Maximum delay between actions in ms (default: 400)",
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
viewport: {
|
|
218
|
+
type: "object",
|
|
219
|
+
description: "Browser viewport size",
|
|
220
|
+
properties: {
|
|
221
|
+
width: {
|
|
222
|
+
type: "number",
|
|
223
|
+
description: "Viewport width in pixels (default: 1920)",
|
|
224
|
+
},
|
|
225
|
+
height: {
|
|
226
|
+
type: "number",
|
|
227
|
+
description: "Viewport height in pixels (default: 1080)",
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
required: ["question"],
|
|
235
|
+
},
|
|
236
|
+
annotations: {
|
|
237
|
+
title: "Ask NotebookLM (Gemini 2.5)",
|
|
238
|
+
readOnlyHint: false,
|
|
239
|
+
destructiveHint: false,
|
|
240
|
+
idempotentHint: false,
|
|
241
|
+
openWorldHint: true,
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=ask-question.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-question.js","sourceRoot":"","sources":["../../../src/tools/definitions/ask-question.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE7E;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAAwB;IAClE,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC3C,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,mDAAmD;IAEnE,IAAI,MAAM,EAAE,CAAC;QACX,mFAAmF;QACnF,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAE3C,OAAO;;uBAEY,MAAM,CAAC,IAAI;eACnB,MAAM,CAAC,WAAW;cACnB,MAAM;;;;;;;;;;EAUlB,QAAQ;;;;;;;;;;;;EAYR,EAAE,GAAG,EAAE,GAAG,EAAE;;;;;;;;;;;;;EAaZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;;;;;;;;;;;;;EAeZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;;EAIZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;EAGZ,EAAE,GAAG,EAAE,GAAG,EAAE;;;;;;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I,EAAE,QAAQ;gCACd,WAAW,EAAE,2CAA2C;6BACzD;yBACF;qBACF;iBACF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,6BAA6B;QACpC,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;KACpB;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Library tools — manage the local catalogue of NotebookLM notebooks the
|
|
4
|
+
* user has registered with this server. The cross-tool ID flow (where
|
|
5
|
+
* `id` comes from, where it's used) lives in the server-level
|
|
6
|
+
* `instructions` string.
|
|
7
|
+
*/
|
|
8
|
+
export declare const notebookManagementTools: Tool[];
|
|
9
|
+
//# sourceMappingURL=notebook-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-management.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/notebook-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAAI,EA0QzC,CAAC"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library tools — manage the local catalogue of NotebookLM notebooks the
|
|
3
|
+
* user has registered with this server. The cross-tool ID flow (where
|
|
4
|
+
* `id` comes from, where it's used) lives in the server-level
|
|
5
|
+
* `instructions` string.
|
|
6
|
+
*/
|
|
7
|
+
export const notebookManagementTools = [
|
|
8
|
+
{
|
|
9
|
+
name: "add_notebook",
|
|
10
|
+
description: "Register a NotebookLM notebook in the local library so it can be " +
|
|
11
|
+
"queried with `ask_question`, ingested into with `add_source`, etc.\n\n" +
|
|
12
|
+
"## Required URL\n" +
|
|
13
|
+
"The user must supply a NotebookLM share-link. To produce one:\n" +
|
|
14
|
+
" 1. Open https://notebooklm.google\n" +
|
|
15
|
+
' 2. Open the notebook → click "Share" (top right)\n' +
|
|
16
|
+
' 3. Set "Anyone with the link" → "Copy link"\n\n' +
|
|
17
|
+
"## Permission workflow\n" +
|
|
18
|
+
"Do NOT call this tool unprompted. The expected dialogue is:\n" +
|
|
19
|
+
" 1. Ask for the URL\n" +
|
|
20
|
+
" 2. Ask what knowledge it contains (1–2 sentences) → `description`\n" +
|
|
21
|
+
" 3. Ask which topics it covers (3–5) → `topics`\n" +
|
|
22
|
+
" 4. Ask when it should be consulted → `use_cases`\n" +
|
|
23
|
+
" 5. Propose a `name` and the metadata back to the user\n" +
|
|
24
|
+
" 6. Only after explicit confirmation, call `add_notebook`.\n\n" +
|
|
25
|
+
"Free-tier limits: 100 notebooks · 50 sources each · 50 queries/day. " +
|
|
26
|
+
"Google AI Pro/Ultra raises these 5×.",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
url: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "NotebookLM share URL. Format: " +
|
|
33
|
+
"`https://notebook.google.com/notebook/<uuid>` (the legacy " +
|
|
34
|
+
"`notebooklm.google.com` host is also accepted; optional " +
|
|
35
|
+
"`?authuser=N` suffix).",
|
|
36
|
+
},
|
|
37
|
+
name: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Display name (e.g. 'n8n Documentation').",
|
|
40
|
+
},
|
|
41
|
+
description: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "1–2 sentence summary of what the notebook contains.",
|
|
44
|
+
},
|
|
45
|
+
topics: {
|
|
46
|
+
type: "array",
|
|
47
|
+
items: { type: "string" },
|
|
48
|
+
description: "3–5 topics covered. Used by `search_notebooks`.",
|
|
49
|
+
},
|
|
50
|
+
content_types: {
|
|
51
|
+
type: "array",
|
|
52
|
+
items: { type: "string" },
|
|
53
|
+
description: "Content classification, e.g. ['documentation', 'examples', 'best practices'].",
|
|
54
|
+
},
|
|
55
|
+
use_cases: {
|
|
56
|
+
type: "array",
|
|
57
|
+
items: { type: "string" },
|
|
58
|
+
description: "When the LLM should consult this notebook, e.g. ['Implementing n8n workflows'].",
|
|
59
|
+
},
|
|
60
|
+
tags: {
|
|
61
|
+
type: "array",
|
|
62
|
+
items: { type: "string" },
|
|
63
|
+
description: "Optional free-form tags for organisation.",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
required: ["url", "name", "description", "topics"],
|
|
67
|
+
},
|
|
68
|
+
annotations: {
|
|
69
|
+
title: "Add notebook to library",
|
|
70
|
+
readOnlyHint: false,
|
|
71
|
+
destructiveHint: false,
|
|
72
|
+
idempotentHint: false,
|
|
73
|
+
openWorldHint: false,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "list_notebooks",
|
|
78
|
+
description: "List every notebook in the local library with its metadata " +
|
|
79
|
+
"(`id`, `name`, `description`, `topics`, `tags`, `url`, `use_count`, " +
|
|
80
|
+
"etc.). Use the returned `id` for `select_notebook`, `update_notebook`, " +
|
|
81
|
+
"`get_notebook`, `remove_notebook`, or as `notebook_id` on " +
|
|
82
|
+
"`ask_question` / `add_source` / audio tools.",
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {},
|
|
86
|
+
},
|
|
87
|
+
annotations: {
|
|
88
|
+
title: "List notebooks",
|
|
89
|
+
readOnlyHint: true,
|
|
90
|
+
openWorldHint: false,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "get_notebook",
|
|
95
|
+
description: "Fetch full metadata for one notebook by id. Use to verify what's " +
|
|
96
|
+
"currently stored before calling `update_notebook`, or to show the " +
|
|
97
|
+
"user the exact `description`/`topics`/`use_cases` Claude has for it.",
|
|
98
|
+
inputSchema: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: {
|
|
101
|
+
id: {
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "Notebook id, as returned by `list_notebooks`/`search_notebooks`.",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
required: ["id"],
|
|
107
|
+
},
|
|
108
|
+
annotations: {
|
|
109
|
+
title: "Get notebook",
|
|
110
|
+
readOnlyHint: true,
|
|
111
|
+
openWorldHint: false,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "select_notebook",
|
|
116
|
+
description: "Mark a notebook as the active default. After this, `ask_question`, " +
|
|
117
|
+
"`add_source`, and the audio tools resolve to that notebook when the " +
|
|
118
|
+
"caller omits `notebook_id` / `notebook_url`.\n\n" +
|
|
119
|
+
"When to call:\n" +
|
|
120
|
+
" • The user explicitly switches context (e.g. \"Let's work on " +
|
|
121
|
+
'React now")\n' +
|
|
122
|
+
" • Task obviously needs a different notebook than the current one — " +
|
|
123
|
+
'announce the switch ("Switching to the React notebook…") before ' +
|
|
124
|
+
"calling.\n" +
|
|
125
|
+
" • If the right notebook is ambiguous, ask the user first instead " +
|
|
126
|
+
"of guessing.",
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: {
|
|
130
|
+
id: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "Notebook id to activate (from `list_notebooks`).",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ["id"],
|
|
136
|
+
},
|
|
137
|
+
annotations: {
|
|
138
|
+
title: "Select active notebook",
|
|
139
|
+
readOnlyHint: false,
|
|
140
|
+
destructiveHint: false,
|
|
141
|
+
idempotentHint: true,
|
|
142
|
+
openWorldHint: false,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "update_notebook",
|
|
147
|
+
description: "Patch metadata fields on an existing notebook. Pass `id` plus any " +
|
|
148
|
+
"subset of `name`, `description`, `topics`, `content_types`, " +
|
|
149
|
+
"`use_cases`, `tags`, `url` — only supplied fields change.\n\n" +
|
|
150
|
+
"Workflow: identify the target notebook → propose the exact change " +
|
|
151
|
+
"back to the user → call only after explicit confirmation. Multiple " +
|
|
152
|
+
"fields can be updated in one call.",
|
|
153
|
+
inputSchema: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {
|
|
156
|
+
id: {
|
|
157
|
+
type: "string",
|
|
158
|
+
description: "Notebook id to update (from `list_notebooks`).",
|
|
159
|
+
},
|
|
160
|
+
name: { type: "string", description: "New display name." },
|
|
161
|
+
description: { type: "string", description: "New 1–2 sentence summary." },
|
|
162
|
+
topics: {
|
|
163
|
+
type: "array",
|
|
164
|
+
items: { type: "string" },
|
|
165
|
+
description: "Replacement topics list (full replacement, not append).",
|
|
166
|
+
},
|
|
167
|
+
content_types: {
|
|
168
|
+
type: "array",
|
|
169
|
+
items: { type: "string" },
|
|
170
|
+
description: "Replacement content classification.",
|
|
171
|
+
},
|
|
172
|
+
use_cases: {
|
|
173
|
+
type: "array",
|
|
174
|
+
items: { type: "string" },
|
|
175
|
+
description: "Replacement use-cases.",
|
|
176
|
+
},
|
|
177
|
+
tags: {
|
|
178
|
+
type: "array",
|
|
179
|
+
items: { type: "string" },
|
|
180
|
+
description: "Replacement tags.",
|
|
181
|
+
},
|
|
182
|
+
url: {
|
|
183
|
+
type: "string",
|
|
184
|
+
description: "New NotebookLM share URL (rarely needed).",
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
required: ["id"],
|
|
188
|
+
},
|
|
189
|
+
annotations: {
|
|
190
|
+
title: "Update notebook metadata",
|
|
191
|
+
readOnlyHint: false,
|
|
192
|
+
destructiveHint: false,
|
|
193
|
+
idempotentHint: true,
|
|
194
|
+
openWorldHint: false,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "remove_notebook",
|
|
199
|
+
description: "Remove a notebook from the local library. **Does NOT delete the " +
|
|
200
|
+
"actual NotebookLM notebook on Google's side** — only the local " +
|
|
201
|
+
"metadata entry. Active sessions on this notebook are closed.\n\n" +
|
|
202
|
+
"Confirmation workflow: look up the notebook by id, ask the user " +
|
|
203
|
+
"\"Remove '[name]' from your library?\" — only call after a clear yes.",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {
|
|
207
|
+
id: {
|
|
208
|
+
type: "string",
|
|
209
|
+
description: "Notebook id to remove (from `list_notebooks`).",
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
required: ["id"],
|
|
213
|
+
},
|
|
214
|
+
annotations: {
|
|
215
|
+
title: "Remove notebook from library",
|
|
216
|
+
readOnlyHint: false,
|
|
217
|
+
destructiveHint: true,
|
|
218
|
+
idempotentHint: true,
|
|
219
|
+
openWorldHint: false,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "search_notebooks",
|
|
224
|
+
description: "Search the library by free-text query — matches against `name`, " +
|
|
225
|
+
"`description`, `topics`, and `tags`. Returns notebook objects with " +
|
|
226
|
+
"their `id` so you can chain into `select_notebook` etc.\n\n" +
|
|
227
|
+
'Use this when the user references a notebook by topic ("the React ' +
|
|
228
|
+
'one") instead of by exact name. If multiple notebooks match, ' +
|
|
229
|
+
"propose the top 1–2 and let the user choose.",
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: "object",
|
|
232
|
+
properties: {
|
|
233
|
+
query: {
|
|
234
|
+
type: "string",
|
|
235
|
+
description: "Search keywords (case-insensitive).",
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
required: ["query"],
|
|
239
|
+
},
|
|
240
|
+
annotations: {
|
|
241
|
+
title: "Search notebooks",
|
|
242
|
+
readOnlyHint: true,
|
|
243
|
+
openWorldHint: false,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "get_library_stats",
|
|
248
|
+
description: "Aggregate statistics about the local notebook library: " +
|
|
249
|
+
"`total_notebooks`, `active_notebook` (id), `most_used_notebook`, " +
|
|
250
|
+
"`total_queries`, `last_modified`. Useful as a quick health check or " +
|
|
251
|
+
'when the user asks "what notebooks do I have?".',
|
|
252
|
+
inputSchema: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {},
|
|
255
|
+
},
|
|
256
|
+
annotations: {
|
|
257
|
+
title: "Get library statistics",
|
|
258
|
+
readOnlyHint: true,
|
|
259
|
+
openWorldHint: false,
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
];
|
|
263
|
+
//# sourceMappingURL=notebook-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-management.js","sourceRoot":"","sources":["../../../src/tools/definitions/notebook-management.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAW;IAC7C;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,mEAAmE;YACnE,wEAAwE;YACxE,mBAAmB;YACnB,iEAAiE;YACjE,uCAAuC;YACvC,sDAAsD;YACtD,mDAAmD;YACnD,0BAA0B;YAC1B,+DAA+D;YAC/D,wBAAwB;YACxB,uEAAuE;YACvE,oDAAoD;YACpD,sDAAsD;YACtD,2DAA2D;YAC3D,iEAAiE;YACjE,sEAAsE;YACtE,sCAAsC;QACxC,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,gCAAgC;wBAChC,4DAA4D;wBAC5D,0DAA0D;wBAC1D,wBAAwB;iBAC3B;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,0CAA0C;iBACxD;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qDAAqD;iBACnE;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,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BACd,WAAW,EAAE,qCAAqC;iBACnD;aACF;YACD,QAAQ,EAAE,CAAC,OAAO,CAAC;SACpB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,yDAAyD;YACzD,mEAAmE;YACnE,sEAAsE;YACtE,iDAAiD;QACnD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,wBAAwB;YAC/B,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Session management tools. The MCP server uses session IDs to keep
|
|
4
|
+
* Gemini-side conversational context across follow-up `ask_question`
|
|
5
|
+
* calls. These tools surface, reset, and close those sessions.
|
|
6
|
+
*
|
|
7
|
+
* Where do session IDs come from? — Every successful `ask_question` call
|
|
8
|
+
* returns a `session_id` in its result. `list_sessions` enumerates the
|
|
9
|
+
* currently live ones.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sessionManagementTools: Tool[];
|
|
12
|
+
//# sourceMappingURL=session-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-management.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/session-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE/D;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,EAAE,IAAI,EA4ExC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session management tools. The MCP server uses session IDs to keep
|
|
3
|
+
* Gemini-side conversational context across follow-up `ask_question`
|
|
4
|
+
* calls. These tools surface, reset, and close those sessions.
|
|
5
|
+
*
|
|
6
|
+
* Where do session IDs come from? — Every successful `ask_question` call
|
|
7
|
+
* returns a `session_id` in its result. `list_sessions` enumerates the
|
|
8
|
+
* currently live ones.
|
|
9
|
+
*/
|
|
10
|
+
export const sessionManagementTools = [
|
|
11
|
+
{
|
|
12
|
+
name: "list_sessions",
|
|
13
|
+
description: "List all active browser sessions for this server. Each entry includes " +
|
|
14
|
+
"`id`, `created_at`, `last_activity`, `age_seconds`, `inactive_seconds`, " +
|
|
15
|
+
"`message_count`, and `notebook_url`. Useful before `reset_session` / " +
|
|
16
|
+
"`close_session` or to recover a `session_id` you can pass back into " +
|
|
17
|
+
"`ask_question` to continue an existing conversation. Sessions older " +
|
|
18
|
+
"than `session_timeout` (see `get_health`) are auto-closed.",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {},
|
|
22
|
+
},
|
|
23
|
+
annotations: {
|
|
24
|
+
title: "List sessions",
|
|
25
|
+
readOnlyHint: true,
|
|
26
|
+
openWorldHint: false,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "close_session",
|
|
31
|
+
description: "Permanently close a session and discard its browser tab. Use the " +
|
|
32
|
+
"`id` returned by `list_sessions` (or the `session_id` from a prior " +
|
|
33
|
+
"`ask_question` response). Closed sessions cannot be resumed — start " +
|
|
34
|
+
"a new one with `ask_question` (no `session_id`) or pick another " +
|
|
35
|
+
"from `list_sessions`. Ask the user before closing if the session " +
|
|
36
|
+
"might still be needed.",
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
session_id: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Session id to close. Obtain from `list_sessions` or from any " +
|
|
43
|
+
"prior `ask_question` response (`result.session_id`).",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
required: ["session_id"],
|
|
47
|
+
},
|
|
48
|
+
annotations: {
|
|
49
|
+
title: "Close session",
|
|
50
|
+
readOnlyHint: false,
|
|
51
|
+
destructiveHint: true,
|
|
52
|
+
idempotentHint: true,
|
|
53
|
+
openWorldHint: false,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "reset_session",
|
|
58
|
+
description: "Clear a session's chat history while keeping the same session id. " +
|
|
59
|
+
"Use this when the task changes mid-conversation and you want a " +
|
|
60
|
+
"fresh context without losing the underlying browser tab. Ask the " +
|
|
61
|
+
"user before resetting if they might still need the prior history.",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
session_id: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "Session id to reset. Obtain from `list_sessions` or from a " +
|
|
68
|
+
"prior `ask_question` response (`result.session_id`).",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
required: ["session_id"],
|
|
72
|
+
},
|
|
73
|
+
annotations: {
|
|
74
|
+
title: "Reset session",
|
|
75
|
+
readOnlyHint: false,
|
|
76
|
+
destructiveHint: true,
|
|
77
|
+
idempotentHint: true,
|
|
78
|
+
openWorldHint: false,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
//# sourceMappingURL=session-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-management.js","sourceRoot":"","sources":["../../../src/tools/definitions/session-management.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAW;IAC5C;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,wEAAwE;YACxE,0EAA0E;YAC1E,uEAAuE;YACvE,sEAAsE;YACtE,sEAAsE;YACtE,4DAA4D;QAC9D,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,mEAAmE;YACnE,qEAAqE;YACrE,sEAAsE;YACtE,kEAAkE;YAClE,mEAAmE;YACnE,wBAAwB;QAC1B,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,+DAA+D;wBAC/D,sDAAsD;iBACzD;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,oEAAoE;YACpE,iEAAiE;YACjE,mEAAmE;YACnE,mEAAmE;QACrE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,6DAA6D;wBAC7D,sDAAsD;iBACzD;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tool definitions for source ingestion + Audio Overview (issues #25, #11).
|
|
3
|
+
*
|
|
4
|
+
* The cross-tool async-audio chain (generate → poll → download) is documented
|
|
5
|
+
* in the server-level `instructions` string (see src/index.ts) so individual
|
|
6
|
+
* descriptions stay focused on one operation each.
|
|
7
|
+
*/
|
|
8
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
+
export declare const addSourceTool: Tool;
|
|
10
|
+
export declare const generateAudioTool: Tool;
|
|
11
|
+
export declare const getAudioStatusTool: Tool;
|
|
12
|
+
export declare const downloadAudioTool: Tool;
|
|
13
|
+
export declare const sourceTools: Tool[];
|
|
14
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/sources.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AA2B/D,eAAO,MAAM,aAAa,EAAE,IAuD3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAuD/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,IA0BhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,IAoC/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,IAAI,EAK7B,CAAC"}
|