orangeslice 1.1.0 ā 1.2.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/dist/cli.js +28 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -36,26 +36,45 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
+
const child_process_1 = require("child_process");
|
|
39
40
|
const DOCS_DIR = path.join(__dirname, "..", "docs");
|
|
40
41
|
const TARGET_DIR = path.join(process.cwd(), "orangeslice-docs");
|
|
41
42
|
async function main() {
|
|
42
|
-
console.log("
|
|
43
|
-
//
|
|
43
|
+
console.log("\n orangeslice - setting up B2B client for AI agents...\n");
|
|
44
|
+
// 1. Copy docs
|
|
45
|
+
console.log("1. Copying B2B documentation...");
|
|
44
46
|
if (!fs.existsSync(TARGET_DIR)) {
|
|
45
47
|
fs.mkdirSync(TARGET_DIR, { recursive: true });
|
|
46
48
|
}
|
|
47
|
-
// Copy all docs
|
|
48
49
|
const files = fs.readdirSync(DOCS_DIR);
|
|
49
|
-
let copied = 0;
|
|
50
50
|
for (const file of files) {
|
|
51
51
|
const src = path.join(DOCS_DIR, file);
|
|
52
52
|
const dest = path.join(TARGET_DIR, file);
|
|
53
53
|
fs.copyFileSync(src, dest);
|
|
54
|
-
console.log(`
|
|
55
|
-
copied++;
|
|
54
|
+
console.log(` ${file}`);
|
|
56
55
|
}
|
|
57
|
-
console.log(
|
|
58
|
-
|
|
59
|
-
console.log("
|
|
56
|
+
console.log(` Copied ${files.length} docs to ./orangeslice-docs/\n`);
|
|
57
|
+
// 2. Install package
|
|
58
|
+
console.log("2. Installing orangeslice package...");
|
|
59
|
+
try {
|
|
60
|
+
(0, child_process_1.execSync)("npm install orangeslice", { stdio: "inherit", cwd: process.cwd() });
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
console.log(" (skipped - no package.json or npm not available)\n");
|
|
64
|
+
}
|
|
65
|
+
// 3. Show usage
|
|
66
|
+
console.log("\n Done! Your AI agent can now:\n");
|
|
67
|
+
console.log(" // Read docs in ./orangeslice-docs/ to understand the B2B schema");
|
|
68
|
+
console.log(" // Then query with automatic rate limiting:");
|
|
69
|
+
console.log("");
|
|
70
|
+
console.log(' import { orangeslice } from "orangeslice";');
|
|
71
|
+
console.log("");
|
|
72
|
+
console.log(" const companies = await orangeslice.b2b.sql(`");
|
|
73
|
+
console.log(" SELECT company_name, employee_count");
|
|
74
|
+
console.log(" FROM linkedin_company");
|
|
75
|
+
console.log(" WHERE domain = 'stripe.com'");
|
|
76
|
+
console.log(" `);");
|
|
77
|
+
console.log("");
|
|
78
|
+
console.log(" Start by reading: ./orangeslice-docs/B2B_DATABASE.md\n");
|
|
60
79
|
}
|
|
61
80
|
main().catch(console.error);
|