factorly 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.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ ```
2
+ ░█▀▀░█▀█░█▀▀░▀█▀░█▀█░█▀▄░█░░█░█
3
+ ░█▀▀░█▀█░█░░░░█░░█░█░█▀▄░█░░░█░
4
+ ░▀░░░▀░▀░▀▀▀░░▀░░▀▀▀░▀░▀░▀▀▀░▀░
5
+ ```
6
+
7
+ <center>
8
+
9
+ # Factorly
10
+
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
12
+ [![Release](https://img.shields.io/badge/Release-v0.1.10-blue?logo=github)](https://github.com/factorly-dev/factorly-cli/releases)
13
+ [![MCP](https://img.shields.io/badge/MCP-compatible-8A2BE2)](https://modelcontextprotocol.io)
14
+
15
+ One command. All your tools. Credentials stay out of your agent's hands.
16
+
17
+ </center>
18
+
19
+ Factorly sits between your AI agent and the tools it uses. Secrets stay in an encrypted vault. Every call is logged. Governance rules control what the agent can do. REST APIs, CLI commands, and MCP servers — one config, one audit log, one set of rules.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npm install -g factorly
25
+ ```
26
+
27
+ ## Try It in 10 Seconds
28
+
29
+ ```bash
30
+ # Wrap any MCP server with zero config
31
+ factorly wrap -- npx @modelcontextprotocol/server-everything
32
+
33
+ # Or install a template for a service you use
34
+ factorly tools import templates github
35
+ factorly call github.list_repos --username octocat
36
+ ```
37
+
38
+ ## Quick Start
39
+
40
+ ```bash
41
+ factorly init # set up a project
42
+ factorly vault set GITHUB_TOKEN ghp_xxx # store a secret
43
+ factorly sync # connect to Claude Code / Cursor
44
+ ```
45
+
46
+ ## What You Get
47
+
48
+ - **Credential isolation** — secrets in encrypted vault, agent never sees them
49
+ - **Governance** — deny, confirm, rate limit, loop detection per tool
50
+ - **Audit log** — every call logged with params, response, and governance outcome
51
+ - **36 templates** — pre-built configs for GitHub, Slack, Stripe, Gmail, Linear, and more
52
+ - **Zero-config proxy** — `factorly wrap` adds safety to any MCP server instantly
53
+
54
+ ## Supported Platforms
55
+
56
+ | OS | Architecture |
57
+ |----|-------------|
58
+ | Linux | x64 |
59
+ | macOS | x64, arm64 |
60
+ | Windows | x64 |
61
+
62
+ The npm package downloads the pre-built Go binary for your platform during install.
63
+
64
+ ## Documentation
65
+
66
+ Full docs at [github.com/factorly-dev/factorly-cli](https://github.com/factorly-dev/factorly-cli)
67
+
68
+ ## License
69
+
70
+ MIT
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("child_process");
5
+ const path = require("path");
6
+
7
+ const IS_WIN = process.platform === "win32";
8
+ const BINARY = path.join(__dirname, IS_WIN ? "factorly.exe" : "factorly");
9
+
10
+ const result = spawnSync(BINARY, process.argv.slice(2), {
11
+ stdio: "inherit",
12
+ env: process.env,
13
+ });
14
+
15
+ if (result.error) {
16
+ if (result.error.code === "ENOENT") {
17
+ console.error("factorly binary not found. Run: npm rebuild factorly");
18
+ } else {
19
+ console.error(`factorly: ${result.error.message}`);
20
+ }
21
+ process.exit(127);
22
+ }
23
+
24
+ process.exit(result.status ?? 1);
package/install.js ADDED
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env node
2
+
3
+ const https = require("https");
4
+ const http = require("http");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const { execSync } = require("child_process");
8
+
9
+ const VERSION = require("./package.json").version;
10
+ const REPO = "factorly-dev/factorly-cli";
11
+ const BIN_DIR = path.join(__dirname, "bin");
12
+ const BIN_PATH = path.join(BIN_DIR, process.platform === "win32" ? "factorly.exe" : "factorly");
13
+
14
+ const PLATFORM_MAP = {
15
+ darwin: "darwin",
16
+ linux: "linux",
17
+ win32: "windows",
18
+ };
19
+
20
+ const ARCH_MAP = {
21
+ x64: "amd64",
22
+ arm64: "arm64",
23
+ };
24
+
25
+ function getBinaryName() {
26
+ const platform = PLATFORM_MAP[process.platform];
27
+ const arch = ARCH_MAP[process.arch];
28
+
29
+ if (!platform) {
30
+ throw new Error(`Unsupported platform: ${process.platform}`);
31
+ }
32
+ if (!arch) {
33
+ throw new Error(`Unsupported architecture: ${process.arch}`);
34
+ }
35
+
36
+ const ext = process.platform === "win32" ? ".exe" : "";
37
+ return `factorly-${platform}-${arch}${ext}`;
38
+ }
39
+
40
+ function download(url) {
41
+ return new Promise((resolve, reject) => {
42
+ const client = url.startsWith("https") ? https : http;
43
+ client
44
+ .get(url, { headers: { "User-Agent": "factorly-npm-installer" } }, (res) => {
45
+ // Follow redirects (GitHub releases redirect to S3)
46
+ if (res.statusCode === 301 || res.statusCode === 302) {
47
+ return download(res.headers.location).then(resolve).catch(reject);
48
+ }
49
+ if (res.statusCode !== 200) {
50
+ return reject(new Error(`Download failed: HTTP ${res.statusCode} from ${url}`));
51
+ }
52
+ const chunks = [];
53
+ res.on("data", (chunk) => chunks.push(chunk));
54
+ res.on("end", () => resolve(Buffer.concat(chunks)));
55
+ res.on("error", reject);
56
+ })
57
+ .on("error", reject);
58
+ });
59
+ }
60
+
61
+ async function install() {
62
+ // Skip if binary already exists (e.g., from a previous install)
63
+ if (fs.existsSync(BIN_PATH)) {
64
+ try {
65
+ const output = execSync(`"${BIN_PATH}" version`, { encoding: "utf8" }).trim();
66
+ if (output.includes(VERSION)) {
67
+ console.log(`factorly ${VERSION} already installed.`);
68
+ return;
69
+ }
70
+ } catch {
71
+ // Binary exists but doesn't work — re-download
72
+ }
73
+ }
74
+
75
+ const binaryName = getBinaryName();
76
+ const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
77
+
78
+ console.log(`Downloading factorly ${VERSION} for ${process.platform}/${process.arch}...`);
79
+ console.log(` ${url}`);
80
+
81
+ const data = await download(url);
82
+
83
+ // Ensure bin directory exists
84
+ fs.mkdirSync(BIN_DIR, { recursive: true });
85
+
86
+ // Write binary
87
+ fs.writeFileSync(BIN_PATH, data, { mode: 0o755 });
88
+
89
+ console.log(`Installed factorly to ${BIN_PATH}`);
90
+ }
91
+
92
+ install().catch((err) => {
93
+ console.error(`Failed to install factorly: ${err.message}`);
94
+ console.error("");
95
+ console.error("You can install manually from:");
96
+ console.error(` https://github.com/${REPO}/releases/tag/v${VERSION}`);
97
+ console.error("");
98
+ console.error("Or build from source:");
99
+ console.error(" git clone https://github.com/factorly-dev/factorly-cli.git");
100
+ console.error(" cd factorly-cli && make build");
101
+ process.exit(1);
102
+ });
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "factorly",
3
+ "version": "0.1.10",
4
+ "description": "Your agent calls tools. Factorly holds the keys.",
5
+ "homepage": "https://github.com/factorly-dev/factorly-cli",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/factorly-dev/factorly-cli.git"
9
+ },
10
+ "license": "MIT",
11
+ "bin": {
12
+ "factorly": "./bin/factorly.js"
13
+ },
14
+ "scripts": {
15
+ "postinstall": "node install.js"
16
+ },
17
+ "keywords": [
18
+ "mcp",
19
+ "agent",
20
+ "tools",
21
+ "cli",
22
+ "vault",
23
+ "oauth",
24
+ "openapi",
25
+ "factorly"
26
+ ],
27
+ "files": [
28
+ "install.js",
29
+ "bin/",
30
+ "README.md"
31
+ ]
32
+ }