@spanly/spanly 0.0.1

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 (2) hide show
  1. package/bin/spanly.js +28 -0
  2. package/package.json +18 -0
package/bin/spanly.js ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('node:child_process');
3
+
4
+ const BIN_NAME = 'spanly';
5
+ const os = process.platform;
6
+ const arch = process.arch;
7
+ const ext = os === 'win32' ? '.exe' : '';
8
+ const pkg = `@spanly/spanly-${os}-${arch}`;
9
+
10
+ let binaryPath;
11
+ try {
12
+ binaryPath = require.resolve(`${pkg}/bin/${BIN_NAME}${ext}`);
13
+ } catch (err) {
14
+ if (process.env.SPANLY_DEBUG) console.error('[spanly] resolve error:', err);
15
+ console.error(
16
+ `[spanly] no prebuilt binary for ${os}-${arch}.\n` +
17
+ `Supported: darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-x64.\n` +
18
+ `File an issue at https://github.com/spanly/monorepo/issues`,
19
+ );
20
+ process.exit(1);
21
+ }
22
+
23
+ const result = spawnSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
24
+ if (result.error) {
25
+ console.error(`[spanly] failed to spawn binary: ${result.error.message}`);
26
+ process.exit(1);
27
+ }
28
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@spanly/spanly",
3
+ "version": "0.0.1",
4
+ "description": "Spanly CLI — observability for MCP servers (run + proxy modes)",
5
+ "repository": "https://github.com/spanly/monorepo",
6
+ "homepage": "https://spanly.dev",
7
+ "license": "MIT",
8
+ "bin": {
9
+ "spanly": "bin/spanly.js"
10
+ },
11
+ "optionalDependencies": {
12
+ "@spanly/spanly-darwin-x64": "0.0.1",
13
+ "@spanly/spanly-linux-arm64": "0.0.1",
14
+ "@spanly/spanly-linux-x64": "0.0.1",
15
+ "@spanly/spanly-win32-x64": "0.0.1",
16
+ "@spanly/spanly-darwin-arm64": "0.0.1"
17
+ }
18
+ }