cassady 0.3.5

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,11 @@
1
+ # Cassady / Cass
2
+
3
+ Cassady (`cass`) is a terminal coding agent written in Rust. This npm package is a tiny launcher that installs the matching platform-specific binary package and exposes both commands:
4
+
5
+ ```sh
6
+ npm install -g cassady
7
+ cass --version
8
+ cassady --version
9
+ ```
10
+
11
+ The platform-specific packages contain the Rust-built executables. Supported npm platforms are macOS Apple Silicon, Linux x86_64, Linux ARM64, and Windows x86_64.
package/bin/cass.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../lib/run').run('cass');
package/bin/cassady.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../lib/run').run('cassady');
package/lib/run.js ADDED
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const { spawnSync } = require('node:child_process');
6
+
7
+ const packagesByPlatform = {
8
+ 'darwin-arm64': '@cassady/cli-darwin-arm64',
9
+ 'linux-x64': '@cassady/cli-linux-x64',
10
+ 'linux-arm64': '@cassady/cli-linux-arm64',
11
+ 'win32-x64': '@cassady/cli-win32-x64',
12
+ };
13
+
14
+ function packageNameForCurrentPlatform() {
15
+ const key = process.platform + '-' + process.arch;
16
+ const packageName = packagesByPlatform[key];
17
+ if (!packageName) {
18
+ throw new Error(
19
+ 'Unsupported platform for Cassady: ' + process.platform + ' ' + process.arch +
20
+ '. Supported platforms: ' + Object.keys(packagesByPlatform).join(', ')
21
+ );
22
+ }
23
+ return packageName;
24
+ }
25
+
26
+ function binaryPath(command) {
27
+ const packageName = packageNameForCurrentPlatform();
28
+ let packageJsonPath;
29
+ try {
30
+ packageJsonPath = require.resolve(packageName + '/package.json');
31
+ } catch (error) {
32
+ throw new Error(
33
+ 'Cassady binary package was not installed: ' + packageName + '.\n' +
34
+ 'Try reinstalling with npm install -g cassady and make sure optional dependencies are enabled.\n' +
35
+ 'Original error: ' + error.message
36
+ );
37
+ }
38
+
39
+ const executable = process.platform === 'win32' ? command + '.exe' : command;
40
+ const resolved = path.join(path.dirname(packageJsonPath), 'bin', executable);
41
+ if (!fs.existsSync(resolved)) {
42
+ throw new Error('Cassady executable is missing from ' + packageName + ': ' + resolved);
43
+ }
44
+ return resolved;
45
+ }
46
+
47
+ function run(command) {
48
+ let executable;
49
+ try {
50
+ executable = binaryPath(command);
51
+ } catch (error) {
52
+ console.error(error.message);
53
+ process.exit(1);
54
+ }
55
+
56
+ const result = spawnSync(executable, process.argv.slice(2), { stdio: 'inherit' });
57
+ if (result.error) {
58
+ console.error(result.error.message);
59
+ process.exit(1);
60
+ }
61
+ if (result.signal) {
62
+ process.kill(process.pid, result.signal);
63
+ return;
64
+ }
65
+ process.exit(result.status == null ? 1 : result.status);
66
+ }
67
+
68
+ module.exports = { run };
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "cassady",
3
+ "version": "0.3.5",
4
+ "description": "Cassady/Cass minimal terminal coding agent",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/owenqwenstarsky/cassady#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/owenqwenstarsky/cassady.git"
10
+ },
11
+ "bin": {
12
+ "cass": "bin/cass.js",
13
+ "cassady": "bin/cassady.js"
14
+ },
15
+ "optionalDependencies": {
16
+ "@cassady/cli-darwin-arm64": "0.3.5",
17
+ "@cassady/cli-linux-x64": "0.3.5",
18
+ "@cassady/cli-linux-arm64": "0.3.5",
19
+ "@cassady/cli-win32-x64": "0.3.5"
20
+ },
21
+ "engines": {
22
+ "node": ">=16"
23
+ },
24
+ "files": [
25
+ "bin",
26
+ "lib"
27
+ ]
28
+ }