@vibeprospecting/vpai 0.1.8 → 0.1.10

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 (3) hide show
  1. package/README.md +19 -6
  2. package/dist/vpai.cjs +33 -11
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -42,14 +42,14 @@ npm run build
42
42
 
43
43
  Produces:
44
44
 
45
- - `dist/vpai.js` – Node-compatible bundle (runs with Node.js)
45
+ - `dist/vpai.cjs` – Node-compatible bundle (runs with Node.js)
46
46
 
47
47
  ### Run without installing
48
48
 
49
49
  ```bash
50
50
  npm run call -- <command> [options]
51
51
  # or
52
- node dist/vpai.js <command> [options]
52
+ node dist/vpai.cjs <command> [options]
53
53
  ```
54
54
 
55
55
  ---
@@ -122,16 +122,28 @@ Install via npm for production use. Node.js is required on the target system.
122
122
 
123
123
  ```bash
124
124
  npm install -g @vibeprospecting/vpai
125
- # or copy dist/vpai.js and add to PATH (Node.js required)
125
+ # or copy dist/vpai.cjs and add to PATH (Node.js required)
126
126
  ```
127
127
 
128
128
  ### Auth
129
129
 
130
- OAuth runs automatically on first use (browser opens). Tokens are cached by mcporter. For CI or headless use, pre-authenticate with `npx mcporter auth vpai`.
130
+ **MCP auth flow (recommended for agents/plugins):** Same pattern as [vibeprospecting-plugin](https://github.com/explorium-ai/vibeprospecting-plugin). The agent calls `get-auth-token` on the Explorium MCP server, extracts `api_key`, and exports it before running vpai:
131
+
132
+ ```bash
133
+ # 1. Agent calls get-auth-token (no args)
134
+ # 2. Agent extracts api_key from response
135
+ # 3. Agent exports for CLI session
136
+ export VP_API_KEY="<api_key from get-auth-token>"
137
+ vpai match-business --args '{"businesses_to_match":[{"name":"Google"}]}'
138
+ ```
139
+
140
+ **Auth precedence when MCP is unavailable:** `VP_API_KEY` environment variable.
141
+
142
+ **OAuth (interactive):** When `VP_API_KEY` is not set, OAuth runs automatically on first use (browser opens). Tokens are cached by mcporter. For CI or headless use, pre-authenticate with `npx mcporter auth vpai`.
131
143
 
132
144
  ### Config
133
145
 
134
- MCP server URL, OAuth settings, and timeout are embedded in the build (`src/embedded-config.ts`). No external config files.
146
+ MCP server URL, OAuth settings, and timeout are embedded in the build (`src/embedded-config.ts`). API key via `VP_API_KEY` env (see Auth above).
135
147
 
136
148
  ### Error handling
137
149
 
@@ -156,9 +168,10 @@ Errors are logged as JSON to stderr. No unhandled promise rejections or silent f
156
168
  vpai-cli/
157
169
  ├── src/
158
170
  │ ├── cli.ts # Entry point
171
+ │ ├── api-key.ts # API key resolution (VP_API_KEY env)
159
172
  │ ├── proxy.ts # Tool registration
160
173
  │ ├── config.ts # Config loader
161
- │ ├── embedded-config.ts # MCP URL, OAuth, timeout
174
+ │ ├── embedded-config.ts # MCP URL, OAuth, API key headers
162
175
  │ ├── runtime.ts # mcporter runtime
163
176
  │ ├── executors/ # Tool execution
164
177
  │ ├── output/ # Result and schema printing
package/dist/vpai.cjs CHANGED
@@ -44262,23 +44262,42 @@ var CLI_DESCRIPTION = "Find company & contact data. Build lead lists, research p
44262
44262
  var DEFAULT_SERVER_NAME = "vpai";
44263
44263
 
44264
44264
  // src/embedded-config.ts
44265
- var EMBEDDED_SERVER = {
44266
- name: DEFAULT_SERVER_NAME,
44267
- description: "Explorium research MCP (production)",
44268
- command: {
44269
- kind: "http",
44270
- url: new URL("https://mcp.explorium.ai/mcp")
44271
- },
44272
- auth: "oauth"
44273
- };
44265
+ var MCP_URL = new URL("https://mcp.explorium.ai/mcp");
44266
+ function buildServerDefinition(apiKey) {
44267
+ if (apiKey) {
44268
+ return {
44269
+ name: DEFAULT_SERVER_NAME,
44270
+ description: "Explorium research MCP (production)",
44271
+ command: {
44272
+ kind: "http",
44273
+ url: MCP_URL,
44274
+ headers: { api_key: apiKey }
44275
+ }
44276
+ };
44277
+ }
44278
+ return {
44279
+ name: DEFAULT_SERVER_NAME,
44280
+ description: "Explorium research MCP (production)",
44281
+ command: { kind: "http", url: MCP_URL },
44282
+ auth: "oauth"
44283
+ };
44284
+ }
44274
44285
  var EMBEDDED_CLI_CONFIG = {
44275
44286
  timeout: 12e4
44276
44287
  };
44277
44288
 
44289
+ // src/api-key.ts
44290
+ var VP_API_KEY_ENV = "VP_API_KEY";
44291
+ function resolveApiKey() {
44292
+ const key = process.env[VP_API_KEY_ENV]?.trim();
44293
+ return key || null;
44294
+ }
44295
+
44278
44296
  // src/runtime.ts
44279
44297
  async function ensureRuntime() {
44298
+ const server = buildServerDefinition(resolveApiKey());
44280
44299
  return createRuntime({
44281
- servers: [EMBEDDED_SERVER]
44300
+ servers: [server]
44282
44301
  });
44283
44302
  }
44284
44303
 
@@ -44417,7 +44436,7 @@ function loadConfig() {
44417
44436
  // package.json
44418
44437
  var package_default = {
44419
44438
  name: "@vibeprospecting/vpai",
44420
- version: "0.1.8",
44439
+ version: "0.1.10",
44421
44440
  description: "Power your chat with B2B data to create lead lists, research companies, personalize your outreach, and more. Search any company or professional to access emails, phone numbers, roles, growth signals, tech stack details, business events, website changes, and more.",
44422
44441
  type: "module",
44423
44442
  license: "MIT",
@@ -44437,6 +44456,7 @@ var package_default = {
44437
44456
  scripts: {
44438
44457
  bump: "node scripts/bump.cjs",
44439
44458
  build: "rm -rf dist && mkdir -p dist && node esbuild.config.cjs && chmod +x dist/vpai.cjs",
44459
+ "type-check": "tsc --noEmit",
44440
44460
  prepublishOnly: "npm run build",
44441
44461
  call: "node dist/vpai.cjs",
44442
44462
  test: "jest --config jest.config.cjs",
@@ -44483,6 +44503,8 @@ program2.description(CLI_DESCRIPTION);
44483
44503
  program2.addHelpText(
44484
44504
  "before",
44485
44505
  `
44506
+ ${CLI_NAME} v${package_default.version}
44507
+
44486
44508
  Workflow (run in order):
44487
44509
  1. ${CLI_NAME} --help Discover available tools and descriptions
44488
44510
  2. ${CLI_NAME} <tool> --all-parameters Inspect input/output JSON schema before executing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeprospecting/vpai",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Power your chat with B2B data to create lead lists, research companies, personalize your outreach, and more. Search any company or professional to access emails, phone numbers, roles, growth signals, tech stack details, business events, website changes, and more.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -20,6 +20,7 @@
20
20
  "scripts": {
21
21
  "bump": "node scripts/bump.cjs",
22
22
  "build": "rm -rf dist && mkdir -p dist && node esbuild.config.cjs && chmod +x dist/vpai.cjs",
23
+ "type-check": "tsc --noEmit",
23
24
  "prepublishOnly": "npm run build",
24
25
  "call": "node dist/vpai.cjs",
25
26
  "test": "jest --config jest.config.cjs",