@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.
- package/dist/cli/check.js +6 -2
- package/dist/cli/index.js +14 -1
- package/dist/cli/installSkills.js +21 -12
- package/dist/cli/serve.js +7 -3
- package/dist/cli/setup.js +50 -32
- package/dist/cli/setupCookies.d.ts +1 -4
- package/dist/cli/setupCookies.js +15 -2
- package/dist/cli/uninstall.js +21 -18
- package/dist/contracts/youtubeToolContracts.d.ts +17 -0
- package/dist/contracts/youtubeToolContracts.js +189 -0
- package/dist/server.d.ts +1 -1
- package/dist/tools/downloads.d.ts +1 -1
- package/dist/tools/remote.d.ts +1 -1
- package/dist/tools/remote.js +32 -51
- package/dist/tools/subtitles/cookieSession.d.ts +22 -0
- package/dist/tools/subtitles/cookieSession.js +66 -0
- package/dist/tools/subtitles/download.d.ts +24 -0
- package/dist/tools/subtitles/download.js +169 -0
- package/dist/tools/subtitles/parse.d.ts +1 -0
- package/dist/tools/subtitles/parse.js +106 -0
- package/dist/tools/subtitles.d.ts +5 -26
- package/dist/tools/subtitles.js +7 -389
- package/dist/utils/codeBuddy.d.ts +8 -0
- package/dist/utils/codeBuddy.js +62 -0
- package/dist/utils/cookieRefresh.js +7 -0
- package/dist/utils/launcher.d.ts +6 -11
- package/dist/utils/launcher.js +11 -82
- package/dist/utils/workBuddy.d.ts +8 -0
- package/dist/utils/workBuddy.js +62 -0
- package/package.json +6 -1
- package/dist/auth/oauthFlow.d.ts +0 -9
- package/dist/auth/oauthFlow.js +0 -151
- package/dist/auth/sharedAuth.d.ts +0 -10
- package/dist/auth/sharedAuth.js +0 -31
- package/dist/auth/tokenManager.d.ts +0 -18
- package/dist/auth/tokenManager.js +0 -92
- package/dist/utils/codexInternal.d.ts +0 -9
- package/dist/utils/codexInternal.js +0 -60
- package/dist/utils/mcpRegistration.d.ts +0 -7
- package/dist/utils/mcpRegistration.js +0 -23
- package/dist/utils/openClaw.d.ts +0 -18
- package/dist/utils/openClaw.js +0 -82
- package/dist/utils/skills.d.ts +0 -16
- package/dist/utils/skills.js +0 -56
package/dist/utils/openClaw.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
|
-
export function getOpenClawConfigPath(homeDir = homedir()) {
|
|
5
|
-
return join(homeDir, ".openclaw", "workspace", "config", "mcporter.json");
|
|
6
|
-
}
|
|
7
|
-
export function getOpenClawSkillsDir(homeDir = homedir()) {
|
|
8
|
-
return join(homeDir, ".openclaw", "skills");
|
|
9
|
-
}
|
|
10
|
-
export function buildOpenClawServerConfig(launcherCommand) {
|
|
11
|
-
return {
|
|
12
|
-
transport: "stdio",
|
|
13
|
-
command: launcherCommand.command,
|
|
14
|
-
args: [...launcherCommand.args],
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function parseOpenClawConfig(raw) {
|
|
18
|
-
const parsed = JSON.parse(raw);
|
|
19
|
-
if (parsed && typeof parsed === "object") {
|
|
20
|
-
return parsed;
|
|
21
|
-
}
|
|
22
|
-
throw new Error("OpenClaw config must be a JSON object");
|
|
23
|
-
}
|
|
24
|
-
export function upsertOpenClawConfigText(currentText, serverName, launcherCommand) {
|
|
25
|
-
const config = currentText ? parseOpenClawConfig(currentText) : {};
|
|
26
|
-
const servers = config.servers && typeof config.servers === "object" ? { ...config.servers } : {};
|
|
27
|
-
servers[serverName] = buildOpenClawServerConfig(launcherCommand);
|
|
28
|
-
const nextConfig = {
|
|
29
|
-
...config,
|
|
30
|
-
servers,
|
|
31
|
-
};
|
|
32
|
-
return JSON.stringify(nextConfig, null, 2);
|
|
33
|
-
}
|
|
34
|
-
export function removeOpenClawConfigEntryText(currentText, serverName) {
|
|
35
|
-
if (!currentText) {
|
|
36
|
-
return { changed: false, nextText: null };
|
|
37
|
-
}
|
|
38
|
-
const config = parseOpenClawConfig(currentText);
|
|
39
|
-
if (!config.servers || typeof config.servers !== "object" || !(serverName in config.servers)) {
|
|
40
|
-
return { changed: false, nextText: currentText };
|
|
41
|
-
}
|
|
42
|
-
const servers = { ...config.servers };
|
|
43
|
-
delete servers[serverName];
|
|
44
|
-
const nextConfig = { ...config };
|
|
45
|
-
if (Object.keys(servers).length === 0) {
|
|
46
|
-
delete nextConfig.servers;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
nextConfig.servers = servers;
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
changed: true,
|
|
53
|
-
nextText: JSON.stringify(nextConfig, null, 2),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export function isOpenClawInstallLikelyInstalled(detectBinary, configPath = getOpenClawConfigPath()) {
|
|
57
|
-
if (detectBinary("mcporter") || detectBinary("openclaw")) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
return existsSync(configPath) || existsSync(dirname(configPath));
|
|
61
|
-
}
|
|
62
|
-
export function writeOpenClawConfig(serverName, launcherCommand, configPath = getOpenClawConfigPath()) {
|
|
63
|
-
const existingText = existsSync(configPath) ? readFileSync(configPath, "utf8") : null;
|
|
64
|
-
const created = existingText === null;
|
|
65
|
-
const nextText = upsertOpenClawConfigText(existingText, serverName, launcherCommand);
|
|
66
|
-
mkdirSync(dirname(configPath), { recursive: true });
|
|
67
|
-
writeFileSync(configPath, `${nextText}\n`, "utf8");
|
|
68
|
-
return created ? "created" : "updated";
|
|
69
|
-
}
|
|
70
|
-
export function removeOpenClawConfig(serverName, configPath = getOpenClawConfigPath()) {
|
|
71
|
-
const existingText = existsSync(configPath) ? readFileSync(configPath, "utf8") : null;
|
|
72
|
-
const result = removeOpenClawConfigEntryText(existingText, serverName);
|
|
73
|
-
if (!result.changed) {
|
|
74
|
-
return "missing";
|
|
75
|
-
}
|
|
76
|
-
if (!result.nextText) {
|
|
77
|
-
rmSync(configPath, { force: true });
|
|
78
|
-
return "removed";
|
|
79
|
-
}
|
|
80
|
-
writeFileSync(configPath, `${result.nextText}\n`, "utf8");
|
|
81
|
-
return "removed";
|
|
82
|
-
}
|
package/dist/utils/skills.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { LauncherCommand } from "./launcher.js";
|
|
2
|
-
export interface SkillInstallTarget {
|
|
3
|
-
client: string;
|
|
4
|
-
label: string;
|
|
5
|
-
sourceDir: string;
|
|
6
|
-
targetDir: string;
|
|
7
|
-
}
|
|
8
|
-
export interface SkillInstallPlanOptions {
|
|
9
|
-
homeDir?: string;
|
|
10
|
-
availableCliNames?: string[];
|
|
11
|
-
includeOpenClaw?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function getSkillPackageSourcePath(packageRoot: string): string;
|
|
14
|
-
export declare function buildSkillLauncherCommand(launcherPath: string): LauncherCommand;
|
|
15
|
-
export declare function buildSkillInstallPlan(packageRoot: string, options?: SkillInstallPlanOptions): SkillInstallTarget[];
|
|
16
|
-
export declare function installSkillTarget(target: SkillInstallTarget): void;
|
package/dist/utils/skills.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
|
-
import { getOpenClawSkillsDir } from "./openClaw.js";
|
|
5
|
-
const SKILL_NAME = "use-yt-mcp";
|
|
6
|
-
export function getSkillPackageSourcePath(packageRoot) {
|
|
7
|
-
return join(packageRoot, "skills", SKILL_NAME);
|
|
8
|
-
}
|
|
9
|
-
export function buildSkillLauncherCommand(launcherPath) {
|
|
10
|
-
return {
|
|
11
|
-
command: "node",
|
|
12
|
-
args: [launcherPath, "install-skills"],
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export function buildSkillInstallPlan(packageRoot, options = {}) {
|
|
16
|
-
const homeDir = options.homeDir ?? homedir();
|
|
17
|
-
const availableCliNames = new Set(options.availableCliNames ?? []);
|
|
18
|
-
const sourceDir = getSkillPackageSourcePath(packageRoot);
|
|
19
|
-
const plan = [];
|
|
20
|
-
const cliTargets = [
|
|
21
|
-
{ client: "claude-internal", label: "Claude Code (internal)", dir: join(homeDir, ".claude-internal", "skills") },
|
|
22
|
-
{ client: "claude", label: "Claude Code", dir: join(homeDir, ".claude", "skills") },
|
|
23
|
-
{ client: "codex-internal", label: "Codex CLI (internal)", dir: join(homeDir, ".codex-internal", "skills") },
|
|
24
|
-
{ client: "codex", label: "Codex CLI / Codex App", dir: join(homeDir, ".codex", "skills") },
|
|
25
|
-
{ client: "gemini-internal", label: "Gemini CLI (internal)", dir: join(homeDir, ".gemini-internal", "skills") },
|
|
26
|
-
{ client: "gemini", label: "Gemini CLI", dir: join(homeDir, ".gemini", "skills") },
|
|
27
|
-
];
|
|
28
|
-
for (const target of cliTargets) {
|
|
29
|
-
if (!availableCliNames.has(target.client)) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
plan.push({
|
|
33
|
-
client: target.client,
|
|
34
|
-
label: target.label,
|
|
35
|
-
sourceDir,
|
|
36
|
-
targetDir: join(target.dir, SKILL_NAME),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (options.includeOpenClaw) {
|
|
40
|
-
plan.push({
|
|
41
|
-
client: "openclaw",
|
|
42
|
-
label: "OpenClaw",
|
|
43
|
-
sourceDir,
|
|
44
|
-
targetDir: join(getOpenClawSkillsDir(homeDir), SKILL_NAME),
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return plan;
|
|
48
|
-
}
|
|
49
|
-
export function installSkillTarget(target) {
|
|
50
|
-
if (!existsSync(target.sourceDir)) {
|
|
51
|
-
throw new Error(`Bundled skill not found: ${target.sourceDir}`);
|
|
52
|
-
}
|
|
53
|
-
mkdirSync(dirname(target.targetDir), { recursive: true });
|
|
54
|
-
rmSync(target.targetDir, { recursive: true, force: true });
|
|
55
|
-
cpSync(target.sourceDir, target.targetDir, { recursive: true });
|
|
56
|
-
}
|