@mkterswingman/5mghost-yonder 0.0.37 → 0.0.39

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.
Files changed (44) hide show
  1. package/dist/cli/check.js +6 -2
  2. package/dist/cli/index.js +14 -1
  3. package/dist/cli/installSkills.js +21 -12
  4. package/dist/cli/serve.js +7 -3
  5. package/dist/cli/setup.js +50 -32
  6. package/dist/cli/setupCookies.d.ts +1 -4
  7. package/dist/cli/setupCookies.js +15 -2
  8. package/dist/cli/uninstall.js +21 -18
  9. package/dist/contracts/youtubeToolContracts.d.ts +17 -0
  10. package/dist/contracts/youtubeToolContracts.js +189 -0
  11. package/dist/server.d.ts +1 -1
  12. package/dist/tools/downloads.d.ts +1 -1
  13. package/dist/tools/remote.d.ts +1 -1
  14. package/dist/tools/remote.js +32 -51
  15. package/dist/tools/subtitles/cookieSession.d.ts +22 -0
  16. package/dist/tools/subtitles/cookieSession.js +66 -0
  17. package/dist/tools/subtitles/download.d.ts +24 -0
  18. package/dist/tools/subtitles/download.js +169 -0
  19. package/dist/tools/subtitles/parse.d.ts +1 -0
  20. package/dist/tools/subtitles/parse.js +106 -0
  21. package/dist/tools/subtitles.d.ts +5 -26
  22. package/dist/tools/subtitles.js +7 -389
  23. package/dist/utils/codeBuddy.d.ts +8 -0
  24. package/dist/utils/codeBuddy.js +62 -0
  25. package/dist/utils/cookieRefresh.js +7 -0
  26. package/dist/utils/launcher.d.ts +6 -11
  27. package/dist/utils/launcher.js +11 -82
  28. package/dist/utils/workBuddy.d.ts +8 -0
  29. package/dist/utils/workBuddy.js +62 -0
  30. package/package.json +6 -1
  31. package/dist/auth/oauthFlow.d.ts +0 -9
  32. package/dist/auth/oauthFlow.js +0 -151
  33. package/dist/auth/sharedAuth.d.ts +0 -10
  34. package/dist/auth/sharedAuth.js +0 -31
  35. package/dist/auth/tokenManager.d.ts +0 -18
  36. package/dist/auth/tokenManager.js +0 -92
  37. package/dist/utils/codexInternal.d.ts +0 -9
  38. package/dist/utils/codexInternal.js +0 -60
  39. package/dist/utils/mcpRegistration.d.ts +0 -7
  40. package/dist/utils/mcpRegistration.js +0 -23
  41. package/dist/utils/openClaw.d.ts +0 -18
  42. package/dist/utils/openClaw.js +0 -82
  43. package/dist/utils/skills.d.ts +0 -16
  44. package/dist/utils/skills.js +0 -56
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { PATHS, loadConfig } from "../utils/config.js";
3
- import { TokenManager } from "../auth/tokenManager.js";
3
+ import { TokenManager } from "@mkterswingman/5mghost-shared-client/auth";
4
4
  import { hasSIDCookies, areCookiesExpired } from "../utils/cookies.js";
5
5
  import { getYtDlpVersion } from "../utils/ytdlpPath.js";
6
6
  import { runRuntimeCommand } from "./runtime.js";
@@ -9,7 +9,11 @@ import { runRuntimeCommand } from "./runtime.js";
9
9
  */
10
10
  export async function runCheck() {
11
11
  const config = loadConfig();
12
- const tm = new TokenManager(config.auth_url);
12
+ const tm = new TokenManager({
13
+ authUrl: config.auth_url,
14
+ authJsonPath: PATHS.sharedAuthJson,
15
+ envTokenName: "YT_MCP_TOKEN",
16
+ });
13
17
  console.log("yt-mcp check\n");
14
18
  // 1. Token
15
19
  const token = await tm.getValidToken();
package/dist/cli/index.js CHANGED
@@ -28,6 +28,7 @@ Commands:
28
28
  setup-cookies Refresh YouTube cookies using browser login
29
29
  runtime Manage required runtimes
30
30
  check Check auth, runtime, cookies, and connectivity
31
+ doctor Alias for check; diagnose local install and runtime health
31
32
  uninstall Remove MCP registrations and local yt-mcp config
32
33
  update Update the main package and required runtimes
33
34
  version Show current version
@@ -70,6 +71,13 @@ export async function runUnifiedUpdate(deps) {
70
71
  const command = process.argv[2];
71
72
  async function main() {
72
73
  switch (command) {
74
+ case undefined:
75
+ case "help":
76
+ case "--help":
77
+ case "-h": {
78
+ console.log(buildHelpText(getVersion()));
79
+ break;
80
+ }
73
81
  case "setup": {
74
82
  const { runSetup } = await import("./setup.js");
75
83
  await runSetup();
@@ -118,6 +126,11 @@ async function main() {
118
126
  await runCheck();
119
127
  break;
120
128
  }
129
+ case "doctor": {
130
+ const { runCheck } = await import("./check.js");
131
+ await runCheck();
132
+ break;
133
+ }
121
134
  case "update": {
122
135
  const current = getVersion();
123
136
  console.log(`Current version: ${current}`);
@@ -165,7 +178,7 @@ async function main() {
165
178
  }
166
179
  default:
167
180
  console.log(buildHelpText(getVersion()));
168
- process.exit(command ? 1 : 0);
181
+ process.exit(1);
169
182
  }
170
183
  }
171
184
  main().catch((err) => {
@@ -1,16 +1,9 @@
1
1
  import { fileURLToPath } from "node:url";
2
2
  import { dirname, join } from "node:path";
3
- import { execFileSync } from "node:child_process";
4
- import { buildSkillInstallPlan, installSkillTarget, } from "../utils/skills.js";
5
- function detectCli(name) {
6
- try {
7
- execFileSync(name, ["--version"], { stdio: "pipe" });
8
- return true;
9
- }
10
- catch {
11
- return false;
12
- }
13
- }
3
+ import { buildSkillInstallPlan, installSkillTarget, } from "@mkterswingman/5mghost-shared-client/registration";
4
+ import { detectCli } from "@mkterswingman/5mghost-shared-client";
5
+ import { getWorkBuddySkillsDir, isWorkBuddyInstallLikelyInstalled } from "../utils/workBuddy.js";
6
+ import { getCodeBuddySkillsDir, isCodeBuddyInstallLikelyInstalled } from "../utils/codeBuddy.js";
14
7
  function resolvePackageRoot() {
15
8
  return join(dirname(fileURLToPath(import.meta.url)), "..", "..");
16
9
  }
@@ -24,10 +17,26 @@ export async function runInstallSkills() {
24
17
  "gemini-internal",
25
18
  "gemini",
26
19
  ].filter(detectCli);
27
- const plan = buildSkillInstallPlan(packageRoot, {
20
+ const plan = buildSkillInstallPlan(packageRoot, "use-yt-mcp", {
28
21
  availableCliNames,
29
22
  includeOpenClaw: process.env.YT_MCP_INSTALL_OPENCLAW_SKILL === "1",
30
23
  });
24
+ if (isWorkBuddyInstallLikelyInstalled() && !plan.some((target) => target.client === "workbuddy")) {
25
+ plan.push({
26
+ client: "workbuddy",
27
+ label: "WorkBuddy",
28
+ sourceDir: join(packageRoot, "skills", "use-yt-mcp"),
29
+ targetDir: join(getWorkBuddySkillsDir(), "use-yt-mcp"),
30
+ });
31
+ }
32
+ if (isCodeBuddyInstallLikelyInstalled() && !plan.some((target) => target.client === "codebuddy")) {
33
+ plan.push({
34
+ client: "codebuddy",
35
+ label: "CodeBuddy",
36
+ sourceDir: join(packageRoot, "skills", "use-yt-mcp"),
37
+ targetDir: join(getCodeBuddySkillsDir(), "use-yt-mcp"),
38
+ });
39
+ }
31
40
  if (plan.length === 0) {
32
41
  console.log("[yt-mcp] No supported AI client detected for bundled skill install.");
33
42
  return;
package/dist/cli/serve.js CHANGED
@@ -1,11 +1,15 @@
1
1
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
- import { loadConfig } from "../utils/config.js";
3
- import { TokenManager } from "../auth/tokenManager.js";
2
+ import { loadConfig, PATHS } from "../utils/config.js";
3
+ import { TokenManager } from "@mkterswingman/5mghost-shared-client/auth";
4
4
  import { DownloadJobManager } from "../download/jobManager.js";
5
5
  import { createServer } from "../server.js";
6
6
  export async function runServe() {
7
7
  const config = loadConfig();
8
- const tokenManager = new TokenManager(config.auth_url);
8
+ const tokenManager = new TokenManager({
9
+ authUrl: config.auth_url,
10
+ authJsonPath: PATHS.sharedAuthJson,
11
+ envTokenName: "YT_MCP_TOKEN",
12
+ });
9
13
  const downloadJobManager = new DownloadJobManager();
10
14
  // PAT mode via env var (don't persist — just keep in memory for this session)
11
15
  const pat = process.env.YT_MCP_TOKEN;
package/dist/cli/setup.js CHANGED
@@ -2,25 +2,17 @@ import { execFileSync } from "node:child_process";
2
2
  import { existsSync } from "node:fs";
3
3
  import { createInterface } from "node:readline/promises";
4
4
  import { loadConfig, saveConfig, PATHS, ensureConfigDir } from "../utils/config.js";
5
- import { TokenManager } from "../auth/tokenManager.js";
6
- import { runOAuthFlow } from "../auth/oauthFlow.js";
5
+ import { TokenManager } from "@mkterswingman/5mghost-shared-client/auth";
6
+ import { runOAuthFlow } from "@mkterswingman/5mghost-shared-client/auth";
7
7
  import { hasSIDCookies } from "../utils/cookies.js";
8
8
  import { buildLauncherCommand, writeLauncherFile } from "../utils/launcher.js";
9
9
  import { buildBrowserOpenCommand } from "../utils/browserLaunch.js";
10
+ import { getWorkBuddyConfigPath, isWorkBuddyInstallLikelyInstalled, writeWorkBuddyConfig, } from "../utils/workBuddy.js";
11
+ import { getCodeBuddyConfigPath, isCodeBuddyInstallLikelyInstalled, writeCodeBuddyConfig, } from "../utils/codeBuddy.js";
10
12
  import { checkAll } from "../runtime/installers.js";
11
13
  import { runInstallSkills } from "./installSkills.js";
12
- import { getOpenClawConfigPath, isOpenClawInstallLikelyInstalled, writeOpenClawConfig, } from "../utils/openClaw.js";
13
- import { getCodexInternalConfigPath, writeCodexInternalConfig, } from "../utils/codexInternal.js";
14
- import { MCP_REGISTER_TIMEOUT_MS, classifyRegistrationFailure, } from "../utils/mcpRegistration.js";
15
- function detectCli(name) {
16
- try {
17
- execFileSync(name, ["--version"], { stdio: "pipe" });
18
- return true;
19
- }
20
- catch {
21
- return false;
22
- }
23
- }
14
+ import { registerCliCandidates, registerOpenClaw, } from "@mkterswingman/5mghost-shared-client/registration";
15
+ import { getOpenClawConfigPath, getCodexInternalConfigPath, writeCodexInternalConfig, detectCli, isOpenClawInstallLikelyInstalled, MCP_REGISTER_TIMEOUT_MS, classifyRegistrationFailure, } from "@mkterswingman/5mghost-shared-client";
24
16
  function tryRegisterMcp(cmd, label) {
25
17
  try {
26
18
  execFileSync(cmd.file, cmd.args, { stdio: "pipe", timeout: MCP_REGISTER_TIMEOUT_MS });
@@ -215,7 +207,11 @@ export async function runSetup() {
215
207
  console.log(` ✅ Shared auth: ${PATHS.sharedAuthJson}`);
216
208
  // ── Step 3: Authentication ──
217
209
  console.log("Step 3/5: Authentication...");
218
- const tokenManager = new TokenManager(config.auth_url);
210
+ const tokenManager = new TokenManager({
211
+ authUrl: config.auth_url,
212
+ authJsonPath: PATHS.sharedAuthJson,
213
+ envTokenName: "YT_MCP_TOKEN",
214
+ });
219
215
  const pat = process.env.YT_MCP_TOKEN;
220
216
  if (pat) {
221
217
  // Explicit PAT provided via env var
@@ -270,7 +266,11 @@ export async function runSetup() {
270
266
  }
271
267
  console.log(` OAuth 等待上限:${Math.round(oauthTimeoutMs / 1000)}s`);
272
268
  try {
273
- const tokens = await runOAuthFlow(config.auth_url, { timeoutMs: oauthTimeoutMs });
269
+ const tokens = await runOAuthFlow({
270
+ clientName: "yt-mcp-cli",
271
+ authUrl: config.auth_url,
272
+ timeoutMs: oauthTimeoutMs,
273
+ });
274
274
  await tokenManager.saveTokens(tokens.accessToken, tokens.refreshToken, tokens.expiresIn, tokens.clientId);
275
275
  console.log(" ✅ OAuth login successful");
276
276
  console.log(" ℹ️ Other first-party local MCPs on this machine can reuse this login.");
@@ -363,18 +363,10 @@ export async function runSetup() {
363
363
  // ── Step 5: MCP Registration ──
364
364
  console.log("Step 5/5: Registering MCP in AI clients...");
365
365
  const launcherCommand = buildLauncherCommand();
366
- let registered = false;
367
- let skillsInstalled = false;
368
- for (const { bin, label, command } of buildSetupCliCandidates({
369
- file: launcherCommand.command,
370
- args: launcherCommand.args,
371
- })) {
372
- if (!detectCli(bin))
373
- continue;
374
- if (tryRegisterMcp(command, label)) {
375
- registered = true;
376
- }
377
- }
366
+ let registered = registerCliCandidates({
367
+ serverName: "yt-mcp",
368
+ launcherCommand,
369
+ });
378
370
  if (isOpenClawInstallLikelyInstalled(detectCli)) {
379
371
  try {
380
372
  let openClawRegistered = false;
@@ -385,10 +377,11 @@ export async function runSetup() {
385
377
  }), "OpenClaw (mcporter config)");
386
378
  }
387
379
  if (!openClawRegistered) {
388
- const status = writeOpenClawConfig("yt-mcp", launcherCommand);
389
- const suffix = status === "created" ? "created" : "updated";
390
- console.log(` ✅ MCP registered in OpenClaw (${suffix} ${getOpenClawConfigPath()})`);
391
- openClawRegistered = true;
380
+ const result = registerOpenClaw("yt-mcp", launcherCommand);
381
+ if (result) {
382
+ console.log(` ✅ MCP registered in OpenClaw (${result.method === "cli" ? "mcporter config" : result.status} ${getOpenClawConfigPath()})`);
383
+ openClawRegistered = true;
384
+ }
392
385
  }
393
386
  if (openClawRegistered) {
394
387
  registered = true;
@@ -409,6 +402,29 @@ export async function runSetup() {
409
402
  console.log(` ⚠️ Codex CLI (internal) auto-register failed: ${err instanceof Error ? err.message : String(err)}`);
410
403
  }
411
404
  }
405
+ if (isWorkBuddyInstallLikelyInstalled(getWorkBuddyConfigPath())) {
406
+ try {
407
+ const status = writeWorkBuddyConfig("yt-mcp", launcherCommand);
408
+ const suffix = status === "created" ? "created" : "updated";
409
+ console.log(` ✅ MCP registered in WorkBuddy (${suffix} ${getWorkBuddyConfigPath()})`);
410
+ registered = true;
411
+ }
412
+ catch (err) {
413
+ console.log(` ⚠️ WorkBuddy auto-register failed: ${err instanceof Error ? err.message : String(err)}`);
414
+ }
415
+ }
416
+ if (isCodeBuddyInstallLikelyInstalled(getCodeBuddyConfigPath())) {
417
+ try {
418
+ const status = writeCodeBuddyConfig("yt-mcp", launcherCommand);
419
+ const suffix = status === "created" ? "created" : "updated";
420
+ console.log(` ✅ MCP registered in CodeBuddy (${suffix} ${getCodeBuddyConfigPath()})`);
421
+ registered = true;
422
+ }
423
+ catch (err) {
424
+ console.log(` ⚠️ CodeBuddy auto-register failed: ${err instanceof Error ? err.message : String(err)}`);
425
+ }
426
+ }
427
+ let skillsInstalled = false;
412
428
  try {
413
429
  process.env.YT_MCP_INSTALL_OPENCLAW_SKILL = isOpenClawInstallLikelyInstalled(detectCli) ? "1" : "0";
414
430
  await runInstallSkills();
@@ -449,6 +465,8 @@ export async function runSetup() {
449
465
  console.log(" OpenClaw stdio CLI (recommended):");
450
466
  console.log(` mcporter config add yt-mcp --command node --arg ${JSON.stringify(PATHS.launcherJs)} --arg serve`);
451
467
  console.log(` OpenClaw uses ${PATHS.sharedAuthJson} for PAT/JWT, so env.YT_MCP_TOKEN is optional after setup.`);
468
+ console.log(` WorkBuddy MCP config: ${getWorkBuddyConfigPath()}`);
469
+ console.log(` CodeBuddy MCP config: ${getCodeBuddyConfigPath()}`);
452
470
  if (skillsInstalled) {
453
471
  console.log(" ✅ Installed bundled yt-mcp analysis skill for detected AI clients");
454
472
  }
@@ -76,9 +76,6 @@ export declare function readCdpCookiesUntilSession(client: CdpCookieClient, deps
76
76
  export declare function tryImportBrowserCookies(chromium: SetupCookiesChromium, deps: SetupCookiesDeps): Promise<boolean>;
77
77
  export declare function readImportedBrowserCookies(candidate: BrowserProfileCandidate, chromium: SetupCookiesChromium, deps: SetupCookiesDeps): Promise<PlaywrightCookie[] | null>;
78
78
  export declare function runManualCookieSetup(chromium: SetupCookiesChromium, deps: SetupCookiesDeps): Promise<void>;
79
- /**
80
- * Interactive cookie setup — opens a visible browser for user to log in.
81
- */
82
- export declare function parseSetupCookiesArgs(argv: string[]): void;
79
+ export declare function parseSetupCookiesArgs(argv: string[], warn?: (message: string) => void): void;
83
80
  export declare function runSetupCookies(overrides?: Partial<SetupCookiesDeps>): Promise<void>;
84
81
  export {};
@@ -412,9 +412,22 @@ export async function runManualCookieSetup(chromium, deps) {
412
412
  /**
413
413
  * Interactive cookie setup — opens a visible browser for user to log in.
414
414
  */
415
- export function parseSetupCookiesArgs(argv) {
415
+ const LEGACY_SETUP_COOKIES_FLAGS = new Set(["--import-only", "--headed"]);
416
+ export function parseSetupCookiesArgs(argv, warn = console.warn) {
417
+ const legacyFlags = [];
416
418
  for (const arg of argv) {
417
- throw new Error(`Unknown option for setup-cookies: ${arg}. setup-cookies accepts no options.`);
419
+ if (LEGACY_SETUP_COOKIES_FLAGS.has(arg)) {
420
+ if (!legacyFlags.includes(arg)) {
421
+ legacyFlags.push(arg);
422
+ }
423
+ continue;
424
+ }
425
+ throw new Error(`Unknown option for setup-cookies: ${arg}. Supported legacy flags: --import-only, --headed.`);
426
+ }
427
+ if (legacyFlags.length > 0) {
428
+ warn(`[DEPRECATED] setup-cookies now runs a single guided flow. ` +
429
+ `Ignoring legacy flags: ${legacyFlags.join(", ")}. ` +
430
+ `Please run: yt-mcp setup-cookies`);
418
431
  }
419
432
  }
420
433
  export async function runSetupCookies(overrides = {}) {
@@ -1,17 +1,10 @@
1
1
  import { execFileSync, spawn } from "node:child_process";
2
2
  import { existsSync, rmSync } from "node:fs";
3
3
  import { PATHS } from "../utils/config.js";
4
- import { getOpenClawConfigPath, removeOpenClawConfig } from "../utils/openClaw.js";
5
- import { getCodexInternalConfigPath, removeCodexInternalConfig, } from "../utils/codexInternal.js";
6
- function detectCli(name) {
7
- try {
8
- execFileSync(name, ["--version"], { stdio: "pipe" });
9
- return true;
10
- }
11
- catch {
12
- return false;
13
- }
14
- }
4
+ import { getWorkBuddyConfigPath, removeWorkBuddyConfig } from "../utils/workBuddy.js";
5
+ import { getCodeBuddyConfigPath, removeCodeBuddyConfig } from "../utils/codeBuddy.js";
6
+ import { getOpenClawConfigPath, getCodexInternalConfigPath, removeCodexInternalConfig, unregisterOpenClaw, detectCli, } from "@mkterswingman/5mghost-shared-client";
7
+ import { unregisterCliCandidates } from "@mkterswingman/5mghost-shared-client/registration";
15
8
  function tryRemoveMcp(command, label) {
16
9
  try {
17
10
  execFileSync(command.file, command.args, { stdio: "pipe" });
@@ -64,13 +57,9 @@ function scheduleSelfUninstall() {
64
57
  export async function runUninstall() {
65
58
  console.log("\n🧹 yt-mcp uninstall\n");
66
59
  console.log("Removing MCP client registrations...");
67
- for (const candidate of buildUninstallCliCandidates()) {
68
- if (!detectCli(candidate.bin))
69
- continue;
70
- tryRemoveMcp(candidate.command, candidate.label);
71
- }
72
- const openClawStatus = removeOpenClawConfig("yt-mcp");
73
- if (openClawStatus === "removed") {
60
+ unregisterCliCandidates({ serverName: "yt-mcp" });
61
+ const openClawResult = unregisterOpenClaw("yt-mcp");
62
+ if (openClawResult === "removed") {
74
63
  console.log(` ✅ Removed MCP registration from OpenClaw (${getOpenClawConfigPath()})`);
75
64
  }
76
65
  else {
@@ -85,6 +74,20 @@ export async function runUninstall() {
85
74
  console.log(" ℹ️ Codex CLI (internal) did not have yt-mcp registered");
86
75
  }
87
76
  }
77
+ const workBuddyStatus = removeWorkBuddyConfig("yt-mcp");
78
+ if (workBuddyStatus === "removed") {
79
+ console.log(` ✅ Removed MCP registration from WorkBuddy (${getWorkBuddyConfigPath()})`);
80
+ }
81
+ else {
82
+ console.log(" ℹ️ WorkBuddy did not have yt-mcp registered");
83
+ }
84
+ const codeBuddyStatus = removeCodeBuddyConfig("yt-mcp");
85
+ if (codeBuddyStatus === "removed") {
86
+ console.log(` ✅ Removed MCP registration from CodeBuddy (${getCodeBuddyConfigPath()})`);
87
+ }
88
+ else {
89
+ console.log(" ℹ️ CodeBuddy did not have yt-mcp registered");
90
+ }
88
91
  if (existsSync(PATHS.configDir)) {
89
92
  // Why: ~/.yt-mcp contains launcher, token cache, cookies, and npm cache owned by this package.
90
93
  rmSync(PATHS.configDir, { recursive: true, force: true });
@@ -0,0 +1,17 @@
1
+ export type YouTubeToolHttpMethod = "GET" | "POST";
2
+ export interface YouTubeToolAliasContract {
3
+ name: string;
4
+ remove_after_version: string;
5
+ remove_after_date: string;
6
+ note: string;
7
+ }
8
+ export interface YouTubeToolContract {
9
+ id: string;
10
+ remote_tool_name: string;
11
+ mcp_primary_name: string;
12
+ mcp_aliases: YouTubeToolAliasContract[];
13
+ http_path: string;
14
+ http_method: YouTubeToolHttpMethod;
15
+ }
16
+ export declare const YOUTUBE_TOOL_CONTRACTS: YouTubeToolContract[];
17
+ export declare function getYouTubeToolContractById(id: string): YouTubeToolContract;
@@ -0,0 +1,189 @@
1
+ // AUTO-GENERATED by scripts/sync-youtube-tool-contracts.mjs
2
+ // Source of truth: contracts/youtube-tool-contracts.json
3
+ // Do not edit manually.
4
+ export const YOUTUBE_TOOL_CONTRACTS = [
5
+ {
6
+ "id": "search_videos",
7
+ "remote_tool_name": "search_videos",
8
+ "mcp_primary_name": "search_videos",
9
+ "mcp_aliases": [],
10
+ "http_path": "/api/search",
11
+ "http_method": "POST"
12
+ },
13
+ {
14
+ "id": "get_video_stats",
15
+ "remote_tool_name": "get_video_stats",
16
+ "mcp_primary_name": "get_video_stats",
17
+ "mcp_aliases": [
18
+ {
19
+ "name": "get_video_stats_bulk_sync",
20
+ "remove_after_version": "0.2.0",
21
+ "remove_after_date": "2026-12-31",
22
+ "note": "Legacy name kept for backward compatibility."
23
+ }
24
+ ],
25
+ "http_path": "/api/video-stats/bulk",
26
+ "http_method": "POST"
27
+ },
28
+ {
29
+ "id": "start_video_stats_job",
30
+ "remote_tool_name": "start_video_stats_job",
31
+ "mcp_primary_name": "start_video_stats_job",
32
+ "mcp_aliases": [],
33
+ "http_path": "/api/video-stats/job/start",
34
+ "http_method": "POST"
35
+ },
36
+ {
37
+ "id": "poll_video_stats_job",
38
+ "remote_tool_name": "poll_video_stats_job",
39
+ "mcp_primary_name": "poll_video_stats_job",
40
+ "mcp_aliases": [],
41
+ "http_path": "/api/video-stats/job/poll",
42
+ "http_method": "POST"
43
+ },
44
+ {
45
+ "id": "resume_video_stats_job",
46
+ "remote_tool_name": "resume_video_stats_job",
47
+ "mcp_primary_name": "resume_video_stats_job",
48
+ "mcp_aliases": [],
49
+ "http_path": "/api/video-stats/job/resume",
50
+ "http_method": "POST"
51
+ },
52
+ {
53
+ "id": "get_trending",
54
+ "remote_tool_name": "get_trending",
55
+ "mcp_primary_name": "get_trending",
56
+ "mcp_aliases": [
57
+ {
58
+ "name": "get_trending_videos",
59
+ "remove_after_version": "0.2.0",
60
+ "remove_after_date": "2026-12-31",
61
+ "note": "Legacy name kept for backward compatibility."
62
+ }
63
+ ],
64
+ "http_path": "/api/trending",
65
+ "http_method": "POST"
66
+ },
67
+ {
68
+ "id": "search_channels",
69
+ "remote_tool_name": "search_channels",
70
+ "mcp_primary_name": "search_channels",
71
+ "mcp_aliases": [],
72
+ "http_path": "/api/channel/search",
73
+ "http_method": "POST"
74
+ },
75
+ {
76
+ "id": "get_channel_stats",
77
+ "remote_tool_name": "get_channel_stats",
78
+ "mcp_primary_name": "get_channel_stats",
79
+ "mcp_aliases": [],
80
+ "http_path": "/api/channel/stats",
81
+ "http_method": "POST"
82
+ },
83
+ {
84
+ "id": "list_channel_uploads",
85
+ "remote_tool_name": "list_channel_uploads",
86
+ "mcp_primary_name": "list_channel_uploads",
87
+ "mcp_aliases": [],
88
+ "http_path": "/api/channel/uploads",
89
+ "http_method": "POST"
90
+ },
91
+ {
92
+ "id": "get_comments",
93
+ "remote_tool_name": "get_comments",
94
+ "mcp_primary_name": "get_comments",
95
+ "mcp_aliases": [
96
+ {
97
+ "name": "get_video_comments_sync",
98
+ "remove_after_version": "0.2.0",
99
+ "remove_after_date": "2026-12-31",
100
+ "note": "Legacy name kept for backward compatibility."
101
+ }
102
+ ],
103
+ "http_path": "/api/comments/sync",
104
+ "http_method": "POST"
105
+ },
106
+ {
107
+ "id": "start_comments_job",
108
+ "remote_tool_name": "start_comments_job",
109
+ "mcp_primary_name": "start_comments_job",
110
+ "mcp_aliases": [
111
+ {
112
+ "name": "start_comments_export_job",
113
+ "remove_after_version": "0.2.0",
114
+ "remove_after_date": "2026-12-31",
115
+ "note": "Legacy name kept for backward compatibility."
116
+ }
117
+ ],
118
+ "http_path": "/api/comments/start",
119
+ "http_method": "POST"
120
+ },
121
+ {
122
+ "id": "poll_comments_job",
123
+ "remote_tool_name": "poll_comments_job",
124
+ "mcp_primary_name": "poll_comments_job",
125
+ "mcp_aliases": [
126
+ {
127
+ "name": "poll_comments_export_job",
128
+ "remove_after_version": "0.2.0",
129
+ "remove_after_date": "2026-12-31",
130
+ "note": "Legacy name kept for backward compatibility."
131
+ }
132
+ ],
133
+ "http_path": "/api/comments/poll",
134
+ "http_method": "POST"
135
+ },
136
+ {
137
+ "id": "resume_comments_job",
138
+ "remote_tool_name": "resume_comments_job",
139
+ "mcp_primary_name": "resume_comments_job",
140
+ "mcp_aliases": [
141
+ {
142
+ "name": "resume_comments_export_job",
143
+ "remove_after_version": "0.2.0",
144
+ "remove_after_date": "2026-12-31",
145
+ "note": "Legacy name kept for backward compatibility."
146
+ }
147
+ ],
148
+ "http_path": "/api/comments/resume",
149
+ "http_method": "POST"
150
+ },
151
+ {
152
+ "id": "get_comment_replies",
153
+ "remote_tool_name": "get_comment_replies",
154
+ "mcp_primary_name": "get_comment_replies",
155
+ "mcp_aliases": [
156
+ {
157
+ "name": "get_comment_replies_sync",
158
+ "remove_after_version": "0.2.0",
159
+ "remove_after_date": "2026-12-31",
160
+ "note": "Legacy name kept for backward compatibility."
161
+ }
162
+ ],
163
+ "http_path": "/api/comments/replies",
164
+ "http_method": "POST"
165
+ },
166
+ {
167
+ "id": "get_quota_usage",
168
+ "remote_tool_name": "get_quota_usage",
169
+ "mcp_primary_name": "get_quota_usage",
170
+ "mcp_aliases": [],
171
+ "http_path": "/api/quota",
172
+ "http_method": "POST"
173
+ },
174
+ {
175
+ "id": "get_patch_notes",
176
+ "remote_tool_name": "get_patch_notes",
177
+ "mcp_primary_name": "get_patch_notes",
178
+ "mcp_aliases": [],
179
+ "http_path": "/api/patch-notes",
180
+ "http_method": "GET"
181
+ }
182
+ ];
183
+ export function getYouTubeToolContractById(id) {
184
+ const match = YOUTUBE_TOOL_CONTRACTS.find((tool) => tool.id === id);
185
+ if (!match) {
186
+ throw new Error(`Unknown YouTube tool contract id: ${id}`);
187
+ }
188
+ return match;
189
+ }
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import type { YtMcpConfig } from "./utils/config.js";
3
- import type { TokenManager } from "./auth/tokenManager.js";
3
+ import type { TokenManager } from "@mkterswingman/5mghost-shared-client/auth";
4
4
  import { DownloadJobManager } from "./download/jobManager.js";
5
5
  import type { DownloadToolDeps } from "./tools/downloads.js";
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import type { YtMcpConfig } from "../utils/config.js";
3
- import type { TokenManager } from "../auth/tokenManager.js";
3
+ import type { TokenManager } from "@mkterswingman/5mghost-shared-client/auth";
4
4
  import { downloadOneItem } from "../download/downloader.js";
5
5
  import type { DownloadJobManager } from "../download/jobManager.js";
6
6
  export interface DownloadToolDeps {
@@ -1,4 +1,4 @@
1
1
  import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import type { YtMcpConfig } from "../utils/config.js";
3
- import type { TokenManager } from "../auth/tokenManager.js";
3
+ import type { TokenManager } from "@mkterswingman/5mghost-shared-client/auth";
4
4
  export declare function registerRemoteTools(server: McpServer, config: YtMcpConfig, tokenManager: TokenManager): void;