@candorsystems/candor-cli 0.3.140-win32-x64 → 0.3.140

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/bin/candor ADDED
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ const childProcess = require("node:child_process");
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+ const os = require("node:os");
6
+
7
+ const packageName = "@candorsystems/candor-cli";
8
+ const aliasPrefix = packageName;
9
+ const signalExitCodes = { SIGHUP: 129, SIGINT: 130, SIGTERM: 143 };
10
+
11
+ function spawnAndExit(target) {
12
+ const child = childProcess.spawn(target, process.argv.slice(2), {
13
+ stdio: "inherit",
14
+ });
15
+ child.on("error", (error) => {
16
+ console.error(error.message);
17
+ process.exit(1);
18
+ });
19
+ const forward = (signal) => {
20
+ if (!child.killed) {
21
+ try {
22
+ child.kill(signal);
23
+ } catch {}
24
+ }
25
+ };
26
+ ["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
27
+ process.on(signal, () => forward(signal));
28
+ });
29
+ child.on("exit", (code, signal) => {
30
+ if (signal) {
31
+ process.exit(signalExitCodes[signal] || 1);
32
+ return;
33
+ }
34
+ process.exit(typeof code === "number" ? code : 0);
35
+ });
36
+ }
37
+
38
+ if (process.env.CANDOR_BIN_PATH) {
39
+ spawnAndExit(process.env.CANDOR_BIN_PATH);
40
+ return;
41
+ }
42
+
43
+ const platformMap = { darwin: "darwin", linux: "linux", win32: "win32" };
44
+ const archMap = { arm64: "arm64", x64: "x64" };
45
+ const platform = platformMap[os.platform()];
46
+ const arch = archMap[os.arch()];
47
+ const target = platform && arch ? platform + "-" + arch : undefined;
48
+ const supportedTargets = new Set(["darwin-arm64","darwin-x64","linux-arm64","linux-x64","win32-x64"]);
49
+
50
+ if (!target || !supportedTargets.has(target)) {
51
+ console.error(
52
+ "candor: npm install supports macOS and Linux on arm64/x64, and Windows on x64."
53
+ );
54
+ process.exit(1);
55
+ }
56
+
57
+ const packageAlias = aliasPrefix + "-" + platform + "-" + arch;
58
+
59
+ try {
60
+ const packageJson = require.resolve(packageAlias + "/package.json");
61
+ const candidate = path.join(
62
+ path.dirname(packageJson),
63
+ "bin",
64
+ platform === "win32" ? "candor.exe" : "candor"
65
+ );
66
+ if (fs.existsSync(candidate)) {
67
+ spawnAndExit(candidate);
68
+ return;
69
+ }
70
+ } catch {
71
+ // Fall through to the actionable reinstall message below.
72
+ }
73
+
74
+ console.error(
75
+ "candor: could not locate the platform binary for " +
76
+ os.platform() +
77
+ "-" +
78
+ os.arch() +
79
+ ".\nTried optional dependency: " +
80
+ packageAlias +
81
+ "\nTo fix: npm install -g " +
82
+ packageName
83
+ );
84
+ process.exit(1);
package/package.json CHANGED
@@ -1,23 +1,39 @@
1
1
  {
2
2
  "name": "@candorsystems/candor-cli",
3
- "version": "0.3.140-win32-x64",
4
- "description": "Candor CLI binary for win32-x64.",
3
+ "version": "0.3.140",
4
+ "description": "Candor CLI launcher for the candor command.",
5
+ "keywords": [
6
+ "finance",
7
+ "personal-finance",
8
+ "budgeting",
9
+ "money-management",
10
+ "financial-planning",
11
+ "ai-agent",
12
+ "cli"
13
+ ],
5
14
  "license": "UNLICENSED",
6
15
  "homepage": "https://candor.money",
7
16
  "repository": {
8
17
  "type": "git",
9
18
  "url": "git+https://github.com/candorsystems/candor-finance.git"
10
19
  },
11
- "os": [
12
- "win32"
13
- ],
14
- "cpu": [
15
- "x64"
16
- ],
20
+ "bin": {
21
+ "candor": "bin/candor"
22
+ },
17
23
  "files": [
18
24
  "bin",
19
25
  "README.md"
20
26
  ],
27
+ "optionalDependencies": {
28
+ "@candorsystems/candor-cli-darwin-arm64": "npm:@candorsystems/candor-cli@0.3.140-darwin-arm64",
29
+ "@candorsystems/candor-cli-darwin-x64": "npm:@candorsystems/candor-cli@0.3.140-darwin-x64",
30
+ "@candorsystems/candor-cli-linux-arm64": "npm:@candorsystems/candor-cli@0.3.140-linux-arm64",
31
+ "@candorsystems/candor-cli-linux-x64": "npm:@candorsystems/candor-cli@0.3.140-linux-x64",
32
+ "@candorsystems/candor-cli-win32-x64": "npm:@candorsystems/candor-cli@0.3.140-win32-x64"
33
+ },
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
21
37
  "publishConfig": {
22
38
  "access": "public"
23
39
  }
package/bin/candor.exe DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/bin/candor.exe
3
- size: 122005504 bytes
4
- sha256: f6c87cc6bc50e8043a122869381c7533a5499947deb111222b3337b890f29d3b
package/bin/keyring.node DELETED
Binary file