@dallay/agentsync 1.7.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/lib/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/lib/index.js ADDED
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const child_process_1 = require("child_process");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ /**
8
+ * Supported platforms and their npm package mappings
9
+ */
10
+ const PLATFORMS = {
11
+ "darwin-x64": "@dallay/agentsync-darwin-x64",
12
+ "darwin-arm64": "@dallay/agentsync-darwin-arm64",
13
+ "linux-x64": "@dallay/agentsync-linux-x64",
14
+ "linux-arm64": "@dallay/agentsync-linux-arm64",
15
+ "win32-x64": "@dallay/agentsync-windows-x64",
16
+ "win32-arm64": "@dallay/agentsync-windows-arm64",
17
+ "cygwin-x64": "@dallay/agentsync-windows-x64",
18
+ "cygwin-arm64": "@dallay/agentsync-windows-arm64",
19
+ };
20
+ /**
21
+ * Returns the executable path which is located inside `node_modules`
22
+ * The naming convention is agentsync-${os}-${arch}
23
+ * If the platform is `win32` or `cygwin`, executable will include a `.exe` extension.
24
+ *
25
+ * @see https://nodejs.org/api/os.html#osarch
26
+ * @see https://nodejs.org/api/os.html#osplatform
27
+ * @example "/path/to/node_modules/agentsync-darwin-arm64/bin/agentsync"
28
+ */
29
+ function getExePath() {
30
+ const platform = process.platform;
31
+ const arch = process.arch;
32
+ const platformKey = `${platform}-${arch}`;
33
+ const packageName = PLATFORMS[platformKey];
34
+ if (!packageName) {
35
+ const supportedPlatforms = Object.keys(PLATFORMS)
36
+ .map((p) => ` - ${p}`)
37
+ .join("\n");
38
+ throw new Error(`Unsupported platform: ${platformKey}\n\nSupported platforms:\n${supportedPlatforms}\n\nPlease open an issue at https://github.com/dallay/agentsync/issues`);
39
+ }
40
+ // Determine binary name (with .exe on Windows and Cygwin)
41
+ const binaryName = platform === "win32" || platform === "cygwin" ? "agentsync.exe" : "agentsync";
42
+ // Try to resolve the binary from the platform-specific package
43
+ let binaryPath;
44
+ try {
45
+ // This works when the package is installed in node_modules
46
+ const packagePath = require.resolve(`${packageName}/package.json`);
47
+ binaryPath = (0, path_1.join)(packagePath, "..", "bin", binaryName);
48
+ }
49
+ catch {
50
+ // Fallback: try to find it relative to this package
51
+ binaryPath = (0, path_1.join)(__dirname, "..", "node_modules", packageName, "bin", binaryName);
52
+ }
53
+ if (!(0, fs_1.existsSync)(binaryPath)) {
54
+ throw new Error(`Could not find agentsync binary at: ${binaryPath}\n\n` +
55
+ `This usually means the platform-specific package (${packageName}) was not installed.\n` +
56
+ `Try reinstalling with: npm install @dallay/agentsync\n\n` +
57
+ `If the problem persists, please open an issue at https://github.com/dallay/agentsync/issues`);
58
+ }
59
+ return binaryPath;
60
+ }
61
+ /**
62
+ * Runs the agentsync binary with the provided arguments
63
+ */
64
+ function run() {
65
+ let binaryPath;
66
+ try {
67
+ binaryPath = getExePath();
68
+ }
69
+ catch (error) {
70
+ console.error(`Error: ${error.message}`);
71
+ process.exit(1);
72
+ }
73
+ // Pass all arguments to the binary (skip node and script path)
74
+ const args = process.argv.slice(2);
75
+ const result = (0, child_process_1.spawnSync)(binaryPath, args, {
76
+ stdio: "inherit",
77
+ env: process.env,
78
+ });
79
+ // Handle spawn errors
80
+ if (result.error) {
81
+ console.error(`Failed to execute agentsync: ${result.error.message}`);
82
+ process.exit(1);
83
+ }
84
+ // Exit with the same code as the binary
85
+ process.exit(result.status ?? 1);
86
+ }
87
+ run();
88
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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AC;AACnC,CAAC;AAED,GAAG,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@dallay/agentsync",
3
+ "version": "1.7.0",
4
+ "description": "Sync AI agent configurations across multiple AI coding assistants using symbolic links",
5
+ "author": "Yuniel Acosta <yunielacosta738@gmail.com>",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/dallay/agentsync.git"
13
+ },
14
+ "homepage": "https://github.com/dallay/agentsync#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/dallay/agentsync/issues"
17
+ },
18
+ "keywords": [
19
+ "ai",
20
+ "agents",
21
+ "symlink",
22
+ "configuration",
23
+ "cli",
24
+ "claude",
25
+ "copilot",
26
+ "gemini",
27
+ "cursor",
28
+ "opencode"
29
+ ],
30
+ "bin": {
31
+ "agentsync": "lib/index.js"
32
+ },
33
+ "main": "lib/index.js",
34
+ "files": [
35
+ "lib"
36
+ ],
37
+ "scripts": {
38
+ "typecheck": "tsc --noEmit",
39
+ "build": "tsc",
40
+ "clean": "node -e \"require('fs').rmSync('lib', {recursive: true, force: true})\"",
41
+ "prepublishOnly": "npm run build"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^22.9.0",
45
+ "typescript": "^5.9.3"
46
+ },
47
+ "optionalDependencies": {
48
+ "@dallay/agentsync-linux-x64": "1.7.0",
49
+ "@dallay/agentsync-linux-arm64": "1.7.0",
50
+ "@dallay/agentsync-darwin-x64": "1.7.0",
51
+ "@dallay/agentsync-darwin-arm64": "1.7.0",
52
+ "@dallay/agentsync-windows-x64": "1.7.0",
53
+ "@dallay/agentsync-windows-arm64": "1.7.0"
54
+ },
55
+ "engines": {
56
+ "node": ">=18"
57
+ }
58
+ }