driggsby 0.1.19 → 0.1.21

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 CHANGED
@@ -16,6 +16,9 @@ For non-interactive MCP launcher flows, use:
16
16
  npx -y driggsby@latest mcp-server
17
17
  ```
18
18
 
19
+ Supported native artifacts currently cover macOS arm64, macOS x64, Linux arm64
20
+ glibc, and Linux x64 glibc.
21
+
19
22
  ## License
20
23
 
21
24
  Apache-2.0
package/install.js CHANGED
@@ -1,16 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createHash } from "node:crypto";
3
- import { chmodSync, createWriteStream, existsSync, lstatSync, mkdtempSync, mkdirSync, readFileSync, rmSync, } from "node:fs";
3
+ import { chmodSync, createWriteStream, existsSync, lstatSync, mkdtempSync, mkdirSync, rmSync, } from "node:fs";
4
4
  import { tmpdir } from "node:os";
5
- import { basename, dirname, join } from "node:path";
5
+ import { basename, join } from "node:path";
6
6
  import { Transform } from "node:stream";
7
7
  import { pipeline } from "node:stream/promises";
8
- import { fileURLToPath } from "node:url";
8
+ import { installDirectory, installedBinaryPath, readPackageJson, resolvePlatform, unsupportedPlatformMessage, } from "./lib/artifacts.js";
9
9
  import { readCommandOutput, writeCommandOutputToFile } from "./lib/process.js";
10
- const packageDirectory = dirname(fileURLToPath(import.meta.url));
11
- const installDirectory = join(packageDirectory, "node_modules", ".bin_real");
12
10
  const maxArtifactBytes = 64 * 1024 * 1024;
13
- const packageJson = JSON.parse(readFileSync(join(packageDirectory, "package.json"), "utf8"));
11
+ const packageJson = readPackageJson();
14
12
  try {
15
13
  await install();
16
14
  }
@@ -24,8 +22,13 @@ catch (error) {
24
22
  process.exit(1);
25
23
  }
26
24
  async function install() {
27
- const platform = resolvePlatform();
28
- const binaryPath = join(installDirectory, platform.binaryPath);
25
+ const resolution = resolvePlatform(packageJson);
26
+ const platform = resolution.platform;
27
+ if (!platform) {
28
+ console.warn(unsupportedPlatformMessage(resolution));
29
+ return;
30
+ }
31
+ const binaryPath = installedBinaryPath(platform.binaryPath);
29
32
  if (existsSync(binaryPath)) {
30
33
  return;
31
34
  }
@@ -52,43 +55,6 @@ async function install() {
52
55
  rmSync(tempDirectory, { force: true, recursive: true });
53
56
  }
54
57
  }
55
- function resolvePlatform() {
56
- const triple = targetTriple();
57
- const platform = packageJson.driggsbyArtifacts.supportedPlatforms[triple];
58
- if (!platform) {
59
- const supported = Object.keys(packageJson.driggsbyArtifacts.supportedPlatforms)
60
- .sort()
61
- .join(", ");
62
- throw new Error(`Driggsby does not currently publish a native binary for ${process.platform}/${process.arch}. Supported targets: ${supported}.`);
63
- }
64
- return platform;
65
- }
66
- function targetTriple() {
67
- const architecture = mapArchitecture(process.arch);
68
- const operatingSystem = mapOperatingSystem(process.platform);
69
- return `${architecture}-${operatingSystem}`;
70
- }
71
- function mapArchitecture(architecture) {
72
- if (architecture === "arm64") {
73
- return "aarch64";
74
- }
75
- if (architecture === "x64") {
76
- return "x86_64";
77
- }
78
- return architecture;
79
- }
80
- function mapOperatingSystem(platform) {
81
- if (platform === "darwin") {
82
- return "apple-darwin";
83
- }
84
- if (platform === "linux") {
85
- return "unknown-linux-gnu";
86
- }
87
- if (platform === "win32") {
88
- return "pc-windows-msvc";
89
- }
90
- return platform;
91
- }
92
58
  async function downloadAndVerifyFile(url, destination, expectedChecksum) {
93
59
  const response = await fetch(url);
94
60
  if (!response.ok || response.body === null) {
@@ -0,0 +1,51 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ export const packageDirectory = dirname(dirname(fileURLToPath(import.meta.url)));
5
+ export const installDirectory = join(packageDirectory, "node_modules", ".bin_real");
6
+ export function readPackageJson() {
7
+ return JSON.parse(readFileSync(join(packageDirectory, "package.json"), "utf8"));
8
+ }
9
+ export function installedBinaryPath(binaryPath) {
10
+ return join(installDirectory, binaryPath);
11
+ }
12
+ export function resolvePlatform(packageJson) {
13
+ const triple = targetTriple();
14
+ return {
15
+ platform: packageJson.driggsbyArtifacts.supportedPlatforms[triple],
16
+ supportedTargets: Object.keys(packageJson.driggsbyArtifacts.supportedPlatforms).sort(),
17
+ triple,
18
+ };
19
+ }
20
+ export function unsupportedPlatformMessage(resolution) {
21
+ const supported = resolution.supportedTargets.length > 0
22
+ ? resolution.supportedTargets.join(", ")
23
+ : "none";
24
+ return `Driggsby does not currently publish a native binary for ${process.platform}/${process.arch} (${resolution.triple}). Supported targets: ${supported}.`;
25
+ }
26
+ function targetTriple() {
27
+ const architecture = mapArchitecture(process.arch);
28
+ const operatingSystem = mapOperatingSystem(process.platform);
29
+ return `${architecture}-${operatingSystem}`;
30
+ }
31
+ function mapArchitecture(architecture) {
32
+ if (architecture === "arm64") {
33
+ return "aarch64";
34
+ }
35
+ if (architecture === "x64") {
36
+ return "x86_64";
37
+ }
38
+ return architecture;
39
+ }
40
+ function mapOperatingSystem(platform) {
41
+ if (platform === "darwin") {
42
+ return "apple-darwin";
43
+ }
44
+ if (platform === "linux") {
45
+ return "unknown-linux-gnu";
46
+ }
47
+ if (platform === "win32") {
48
+ return "pc-windows-msvc";
49
+ }
50
+ return platform;
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "driggsby",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Local MCP broker and CLI for connecting AI clients to Driggsby",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/thegoodsoftwareco/driggsby-cli",
@@ -24,11 +24,12 @@
24
24
  "run-driggsby.js"
25
25
  ],
26
26
  "driggsbyArtifacts": {
27
- "baseUrl": "https://github.com/thegoodsoftwareco/driggsby-cli/releases/download/driggsby-v0.1.19",
27
+ "baseUrl": "https://github.com/thegoodsoftwareco/driggsby-cli/releases/download/driggsby-v0.1.21",
28
28
  "checksums": {
29
- "driggsby-aarch64-apple-darwin.tar.xz": "7a924b9f775a0fb10de12da6d471080f464769adeacbcb581dc1da58eeb3123c",
30
- "driggsby-x86_64-apple-darwin.tar.xz": "2b91b590424f074e3a4b08b2b5581ec97c07dbdc28f82cd42cc84cb87a3b98ab",
31
- "driggsby-x86_64-unknown-linux-gnu.tar.xz": "96ae120d4ba0b8d4720daa9151e7069f01792c0066054002fdef3a3bb8efc459"
29
+ "driggsby-aarch64-apple-darwin.tar.xz": "1bdd63ea017a771ed5ed6e7fa1ab8fe8469949509b6763d8a71b989251611e11",
30
+ "driggsby-x86_64-apple-darwin.tar.xz": "cef45b06f66cd68aeb82ca288a4a52e79e1abd4d105acebb05d62ed7f04cf3a1",
31
+ "driggsby-aarch64-unknown-linux-gnu.tar.xz": "93b2433dede66d40c2320a7fda9eb46f31406842b63c3d436ea11f2c78fab5eb",
32
+ "driggsby-x86_64-unknown-linux-gnu.tar.xz": "9f41aac3cb140f59fe0cb62882f5571916b5f6fda873e30529f3732f48d80f70"
32
33
  },
33
34
  "supportedPlatforms": {
34
35
  "aarch64-apple-darwin": {
@@ -39,6 +40,10 @@
39
40
  "artifactName": "driggsby-x86_64-apple-darwin.tar.xz",
40
41
  "binaryPath": "driggsby"
41
42
  },
43
+ "aarch64-unknown-linux-gnu": {
44
+ "artifactName": "driggsby-aarch64-unknown-linux-gnu.tar.xz",
45
+ "binaryPath": "driggsby"
46
+ },
42
47
  "x86_64-unknown-linux-gnu": {
43
48
  "artifactName": "driggsby-x86_64-unknown-linux-gnu.tar.xz",
44
49
  "binaryPath": "driggsby"
package/run-driggsby.js CHANGED
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync } from "node:fs";
3
- import { dirname, join } from "node:path";
4
- import { fileURLToPath } from "node:url";
3
+ import { installedBinaryPath, readPackageJson, resolvePlatform, unsupportedPlatformMessage, } from "./lib/artifacts.js";
5
4
  import { spawnFileAndExit } from "./lib/process.js";
6
- const packageDirectory = dirname(fileURLToPath(import.meta.url));
7
- const binaryPath = join(packageDirectory, "node_modules", ".bin_real", "driggsby");
5
+ const packageJson = readPackageJson();
6
+ const resolution = resolvePlatform(packageJson);
7
+ if (!resolution.platform) {
8
+ console.error(unsupportedPlatformMessage(resolution));
9
+ process.exit(1);
10
+ }
11
+ const binaryPath = installedBinaryPath(resolution.platform.binaryPath);
8
12
  if (!existsSync(binaryPath)) {
9
- console.error("Driggsby is not installed. Reinstall the npm package and try again.");
13
+ console.error("Driggsby native binary is not installed. Reinstall with npm scripts enabled, or rerun with npm_config_foreground_scripts=true to see installer output.");
10
14
  process.exit(1);
11
15
  }
12
16
  spawnFileAndExit(binaryPath, process.argv.slice(2));