@sellable/mcp 0.1.1 → 0.1.3
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/index-dev.js +0 -0
- package/dist/index.js +0 -0
- package/dist/skills.d.ts +1 -0
- package/dist/skills.js +13 -1
- package/dist/tools/framework.js +11 -5
- package/dist/tools/leads.js +4 -2
- package/dist/tools/navigation.js +9 -3
- package/package.json +1 -1
package/dist/index-dev.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/skills.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface SkillDefinition {
|
|
|
5
5
|
content: string;
|
|
6
6
|
visibility: SkillVisibility;
|
|
7
7
|
}
|
|
8
|
+
export declare function resolveSkillsDir(): string;
|
|
8
9
|
export declare function loadSkills(force?: boolean): SkillDefinition[];
|
|
9
10
|
export declare function listSkills(visibility?: SkillVisibility): SkillDefinition[];
|
|
10
11
|
export declare function getSkillByName(name: string): SkillDefinition | undefined;
|
package/dist/skills.js
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
2
|
import * as path from "path";
|
|
3
|
-
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
export function resolveSkillsDir() {
|
|
4
5
|
const candidates = [];
|
|
5
6
|
if (process.env.SELLABLE_SKILLS_DIR) {
|
|
6
7
|
candidates.push(path.resolve(process.env.SELLABLE_SKILLS_DIR));
|
|
7
8
|
}
|
|
9
|
+
// Works for both source execution (src/../skills) and npm package execution
|
|
10
|
+
// (dist/../skills), including npx bin shims.
|
|
11
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
candidates.push(path.resolve(moduleDir, "../skills"));
|
|
8
13
|
if (process.argv[1]) {
|
|
9
14
|
// When running as CLI, argv[1] is typically ".../dist/index.js".
|
|
10
15
|
candidates.push(path.resolve(path.dirname(process.argv[1]), "../skills"));
|
|
16
|
+
try {
|
|
17
|
+
const realEntryPath = fs.realpathSync(process.argv[1]);
|
|
18
|
+
candidates.push(path.resolve(path.dirname(realEntryPath), "../skills"));
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
// Ignore unreadable argv paths; module-relative and cwd fallbacks remain.
|
|
22
|
+
}
|
|
11
23
|
}
|
|
12
24
|
// Local repo execution and test contexts.
|
|
13
25
|
candidates.push(path.resolve(process.cwd(), "mcp/sellable/skills"));
|
package/dist/tools/framework.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
2
|
import { dirname, isAbsolute, join, resolve } from "path";
|
|
3
|
+
import { resolveSkillsDir } from "../skills.js";
|
|
3
4
|
import { resolveWorkspaceRoot } from "../utils/workspace-root.js";
|
|
4
5
|
const entryPath = process.argv[1] ? resolve(process.argv[1]) : process.cwd();
|
|
5
6
|
const entryDir = dirname(entryPath);
|
|
6
7
|
const workspaceRoot = resolveWorkspaceRoot(entryDir);
|
|
7
|
-
const
|
|
8
|
-
const
|
|
8
|
+
const skillsRoot = resolveSkillsDir();
|
|
9
|
+
const frameworkRoot = join(skillsRoot, "create-campaign");
|
|
10
|
+
const frameworkV2Root = join(skillsRoot, "create-campaign-v2");
|
|
9
11
|
function getFrameworkRoot(flowVersion) {
|
|
10
12
|
return flowVersion === "v2" ? frameworkV2Root : frameworkRoot;
|
|
11
13
|
}
|
|
12
|
-
function
|
|
14
|
+
function resolveSkillAwarePath(filePath) {
|
|
13
15
|
if (isAbsolute(filePath))
|
|
14
16
|
return filePath;
|
|
17
|
+
const skillPathPrefix = "mcp/sellable/skills/";
|
|
18
|
+
if (filePath.startsWith(skillPathPrefix)) {
|
|
19
|
+
return resolve(skillsRoot, filePath.slice(skillPathPrefix.length));
|
|
20
|
+
}
|
|
15
21
|
return resolve(workspaceRoot, filePath);
|
|
16
22
|
}
|
|
17
23
|
function readJson(filePath) {
|
|
@@ -30,7 +36,7 @@ function loadProviders(registry) {
|
|
|
30
36
|
const warnings = [];
|
|
31
37
|
for (const entry of registry.providers) {
|
|
32
38
|
try {
|
|
33
|
-
const configPath =
|
|
39
|
+
const configPath = resolveSkillAwarePath(entry.configPath);
|
|
34
40
|
providers[entry.id] = readJson(configPath);
|
|
35
41
|
}
|
|
36
42
|
catch (error) {
|
|
@@ -65,7 +71,7 @@ function loadPlugins(registry) {
|
|
|
65
71
|
const enabledEntries = registry.plugins.filter((p) => p.enabled !== false);
|
|
66
72
|
const warnings = [];
|
|
67
73
|
const plugins = enabledEntries.map((entry) => {
|
|
68
|
-
const fullPath =
|
|
74
|
+
const fullPath = resolveSkillAwarePath(entry.path);
|
|
69
75
|
if (!existsSync(fullPath)) {
|
|
70
76
|
warnings.push(`Plugin file missing for ${entry.id}: ${fullPath}`);
|
|
71
77
|
return {
|
package/dist/tools/leads.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
2
|
import { dirname, join, resolve } from "path";
|
|
3
3
|
import { getApi, SellableApiError } from "../api.js";
|
|
4
|
+
import { resolveSkillsDir } from "../skills.js";
|
|
4
5
|
import { resolveWorkspaceRoot } from "../utils/workspace-root.js";
|
|
5
6
|
import { buildCsvDomainPreview, matchesConfirmationToken, parseConfirmationToken, projectCsvCarryRows, } from "./csv-domains.js";
|
|
6
7
|
import { buildCsvLinkedinPreview, matchesLinkedinConfirmationToken, parseLinkedinConfirmationToken, uploadCsvLinkedinFile, } from "./csv-linkedin.js";
|
|
@@ -10,7 +11,8 @@ import { waitForLeadListReady } from "./readiness.js";
|
|
|
10
11
|
const entryPath = process.argv[1] ? resolve(process.argv[1]) : process.cwd();
|
|
11
12
|
const entryDir = dirname(entryPath);
|
|
12
13
|
const workspaceRoot = resolveWorkspaceRoot(entryDir);
|
|
13
|
-
const
|
|
14
|
+
const skillsRoot = resolveSkillsDir();
|
|
15
|
+
const signalProviderConfigPath = join(skillsRoot, "create-campaign/core/providers/signal-discovery.json");
|
|
14
16
|
const leadImportLimitsPath = join(workspaceRoot, "lead-import-limits.json");
|
|
15
17
|
const defaultLeadImportLimits = {
|
|
16
18
|
apollo: { maxImportCount: 2500 },
|
|
@@ -2235,7 +2237,7 @@ export function getProviderPrompt(input) {
|
|
|
2235
2237
|
if (!filename) {
|
|
2236
2238
|
throw new Error(`Unknown provider: ${provider}. Valid options: apollo, sales-nav, prospeo, signal-discovery`);
|
|
2237
2239
|
}
|
|
2238
|
-
const promptPath = join(
|
|
2240
|
+
const promptPath = join(skillsRoot, "providers", filename);
|
|
2239
2241
|
try {
|
|
2240
2242
|
const prompt = readFileSync(promptPath, "utf-8");
|
|
2241
2243
|
markProviderPromptLoaded({
|
package/dist/tools/navigation.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
2
|
import { dirname, isAbsolute, join, resolve } from "path";
|
|
3
3
|
import { getApi } from "../api.js";
|
|
4
|
+
import { resolveSkillsDir } from "../skills.js";
|
|
4
5
|
import { resolveWorkspaceRoot } from "../utils/workspace-root.js";
|
|
5
6
|
import { getTableRowsMinimal } from "./rows.js";
|
|
6
7
|
const entryPath = process.argv[1] ? resolve(process.argv[1]) : process.cwd();
|
|
7
8
|
const entryDir = dirname(entryPath);
|
|
8
9
|
const workspaceRoot = resolveWorkspaceRoot(entryDir);
|
|
9
|
-
const
|
|
10
|
+
const skillsRoot = resolveSkillsDir();
|
|
11
|
+
const frameworkRoot = join(skillsRoot, "create-campaign");
|
|
10
12
|
function isTruthyFlag(value) {
|
|
11
13
|
if (!value)
|
|
12
14
|
return false;
|
|
@@ -77,9 +79,13 @@ export function logNavigationDebug(event, payload = {}, campaignId) {
|
|
|
77
79
|
...payload,
|
|
78
80
|
})}`);
|
|
79
81
|
}
|
|
80
|
-
function
|
|
82
|
+
function resolveSkillAwarePath(filePath) {
|
|
81
83
|
if (isAbsolute(filePath))
|
|
82
84
|
return filePath;
|
|
85
|
+
const skillPathPrefix = "mcp/sellable/skills/";
|
|
86
|
+
if (filePath.startsWith(skillPathPrefix)) {
|
|
87
|
+
return resolve(skillsRoot, filePath.slice(skillPathPrefix.length));
|
|
88
|
+
}
|
|
83
89
|
return resolve(workspaceRoot, filePath);
|
|
84
90
|
}
|
|
85
91
|
function readJson(filePath) {
|
|
@@ -100,7 +106,7 @@ function loadProviderConfigs() {
|
|
|
100
106
|
const failures = [];
|
|
101
107
|
for (const entry of registry.providers) {
|
|
102
108
|
try {
|
|
103
|
-
const configPath =
|
|
109
|
+
const configPath = resolveSkillAwarePath(entry.configPath);
|
|
104
110
|
const cfg = readJson(configPath);
|
|
105
111
|
configs[entry.id] = cfg;
|
|
106
112
|
}
|