@dubusoft/toodo 1.10.3-dev.137 → 1.10.3-dev.139
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 +1 -1
- package/bin/toodo.js +6 -53
- package/install.js +14 -0
- package/lib/platform.js +71 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ It installs the newest version of the channel with npm (`latest` for releases, `
|
|
|
45
45
|
|
|
46
46
|
## Requirements
|
|
47
47
|
|
|
48
|
-
- Linux x64 or arm64 (glibc or musl) or macOS x64 or arm64, with Node.js 18 or later. Install with optional dependencies enabled (the default), because the binaries ship in the platform packages `@dubusoft/toodo-linux-<arch>`, `@dubusoft/toodo-linux-<arch>-musl`, and `@dubusoft/toodo-darwin-<arch>`.
|
|
48
|
+
- Linux x64 or arm64 (glibc or musl) or macOS x64 or arm64, with Node.js 18 or later. Install with optional dependencies enabled (the default), because the binaries ship in the platform packages `@dubusoft/toodo-linux-<arch>`, `@dubusoft/toodo-linux-<arch>-musl`, and `@dubusoft/toodo-darwin-<arch>`. When npm cannot install the platform package (optional dependencies disabled, or the registry not serving it yet), the install fails with the reason instead of leaving a `toodo` without binaries, and an existing install stays as it was.
|
|
49
49
|
- Optional: Claude Code (`claude`) or Codex (`codex`) on `PATH`, to register the MCP endpoint with them.
|
|
50
50
|
|
|
51
51
|
See https://github.com/Dubusoft/toodo for documentation.
|
package/bin/toodo.js
CHANGED
|
@@ -2,67 +2,20 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const { spawnSync } = require('child_process');
|
|
5
|
-
const fs = require('fs');
|
|
6
5
|
const path = require('path');
|
|
6
|
+
const { findPlatformPackage, REINSTALL } = require('../lib/platform');
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function isMusl() {
|
|
12
|
-
try {
|
|
13
|
-
if (process.report) {
|
|
14
|
-
process.report.excludeNetwork = true;
|
|
15
|
-
const header = process.report.getReport().header;
|
|
16
|
-
if (header) return !header.glibcVersionRuntime;
|
|
17
|
-
}
|
|
18
|
-
} catch {
|
|
19
|
-
// Fall through to the next check.
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
return fs.readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
|
|
23
|
-
} catch {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function platformSuffix() {
|
|
29
|
-
if (process.arch !== 'x64' && process.arch !== 'arm64') return null;
|
|
30
|
-
if (process.platform === 'darwin') return `darwin-${process.arch}`;
|
|
31
|
-
if (process.platform === 'linux') return `linux-${process.arch}${isMusl() ? '-musl' : ''}`;
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const suffix = platformSuffix();
|
|
36
|
-
if (!suffix) {
|
|
37
|
-
console.error(
|
|
38
|
-
`toodo: ${process.platform}/${process.arch} is not supported; only ${SUPPORTED} are. ` +
|
|
39
|
-
'Build toodo-server from source instead, following docs/server.md in https://github.com/Dubusoft/toodo.'
|
|
40
|
-
);
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const pkg = `@dubusoft/toodo-${suffix}`;
|
|
45
|
-
let pkgDir;
|
|
46
|
-
try {
|
|
47
|
-
pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
48
|
-
} catch {
|
|
49
|
-
console.error(
|
|
50
|
-
`toodo: the platform package ${pkg} is not installed. ` +
|
|
51
|
-
'Reinstall with optional dependencies enabled: npm install -g @dubusoft/toodo --include=optional ' +
|
|
52
|
-
'(--no-optional or --omit=optional skips it). If it is still missing, this version was published ' +
|
|
53
|
-
`without ${pkg}; install the newest one with: npm install -g @dubusoft/toodo@latest --include=optional`
|
|
54
|
-
);
|
|
8
|
+
const found = findPlatformPackage();
|
|
9
|
+
if (found.error) {
|
|
10
|
+
console.error(`toodo: ${found.error}`);
|
|
55
11
|
process.exit(1);
|
|
56
12
|
}
|
|
57
13
|
|
|
58
|
-
const bin = path.join(
|
|
14
|
+
const bin = path.join(found.dir, 'bin', 'toodo');
|
|
59
15
|
const result = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
60
16
|
|
|
61
17
|
if (result.error) {
|
|
62
|
-
console.error(
|
|
63
|
-
`toodo: could not run ${bin}: ${result.error.message}. ` +
|
|
64
|
-
'Reinstall with: npm install -g @dubusoft/toodo --include=optional'
|
|
65
|
-
);
|
|
18
|
+
console.error(`toodo: could not run ${bin}: ${result.error.message}. Reinstall with: ${REINSTALL}`);
|
|
66
19
|
process.exit(1);
|
|
67
20
|
}
|
|
68
21
|
if (result.signal) {
|
package/install.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// postinstall: fails the install when npm left out the platform package. npm skips an
|
|
4
|
+
// optional dependency it cannot download (for example while the registry does not serve its
|
|
5
|
+
// tarball yet) with only a warning, which would leave a toodo with no binary to run; failing
|
|
6
|
+
// here makes npm report the error and keep the previous install.
|
|
7
|
+
|
|
8
|
+
const { findPlatformPackage } = require('./lib/platform');
|
|
9
|
+
|
|
10
|
+
const found = findPlatformPackage();
|
|
11
|
+
if (found.error) {
|
|
12
|
+
console.error(`@dubusoft/toodo: ${found.error}`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
package/lib/platform.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Finds the platform package @dubusoft/toodo-<target> that holds the toodo and
|
|
4
|
+
// toodo-server binaries for this machine. Shared by the launcher (bin/toodo.js) and the
|
|
5
|
+
// install check (install.js).
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
const SUPPORTED = 'macOS x64 and arm64, and Linux x64 and arm64 (glibc or musl)';
|
|
11
|
+
const REINSTALL = 'npm install -g @dubusoft/toodo --include=optional';
|
|
12
|
+
|
|
13
|
+
// Whether this Linux runs on musl (Alpine and others) rather than glibc.
|
|
14
|
+
function isMusl() {
|
|
15
|
+
try {
|
|
16
|
+
if (process.report) {
|
|
17
|
+
process.report.excludeNetwork = true;
|
|
18
|
+
const header = process.report.getReport().header;
|
|
19
|
+
if (header) return !header.glibcVersionRuntime;
|
|
20
|
+
}
|
|
21
|
+
} catch {
|
|
22
|
+
// Fall through to the next check.
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
return fs.readFileSync('/usr/bin/ldd', 'utf8').includes('musl');
|
|
26
|
+
} catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function platformSuffix() {
|
|
32
|
+
if (process.arch !== 'x64' && process.arch !== 'arm64') return null;
|
|
33
|
+
if (process.platform === 'darwin') return `darwin-${process.arch}`;
|
|
34
|
+
if (process.platform === 'linux') return `linux-${process.arch}${isMusl() ? '-musl' : ''}`;
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// The platform package directory as { dir }, or { error } with the message to print.
|
|
39
|
+
function findPlatformPackage() {
|
|
40
|
+
const suffix = platformSuffix();
|
|
41
|
+
if (!suffix) {
|
|
42
|
+
return {
|
|
43
|
+
error:
|
|
44
|
+
`${process.platform}/${process.arch} is not supported; only ${SUPPORTED} are. ` +
|
|
45
|
+
'Build toodo-server from source instead, following docs/server.md in https://github.com/Dubusoft/toodo.',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const pkg = `@dubusoft/toodo-${suffix}`;
|
|
49
|
+
let dir;
|
|
50
|
+
try {
|
|
51
|
+
dir = path.dirname(require.resolve(`${pkg}/package.json`));
|
|
52
|
+
} catch {
|
|
53
|
+
return {
|
|
54
|
+
error:
|
|
55
|
+
`the platform package ${pkg} is not installed. ` +
|
|
56
|
+
`Reinstall with optional dependencies enabled: ${REINSTALL} ` +
|
|
57
|
+
'(--no-optional or --omit=optional skips it). If it is still missing, npm could not download ' +
|
|
58
|
+
`${pkg} for this version (it may not be on the registry yet); retry in a few minutes, or install ` +
|
|
59
|
+
'the newest release with: npm install -g @dubusoft/toodo@latest --include=optional',
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
for (const name of ['toodo', 'toodo-server']) {
|
|
63
|
+
const file = path.join(dir, 'bin', name);
|
|
64
|
+
if (!fs.existsSync(file)) {
|
|
65
|
+
return { error: `${file} is missing from ${pkg}. Reinstall with: ${REINSTALL}` };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return { dir };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = { findPlatformPackage, REINSTALL };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dubusoft/toodo",
|
|
3
|
-
"version": "1.10.3-dev.
|
|
3
|
+
"version": "1.10.3-dev.139",
|
|
4
4
|
"description": "Toodo command line: task planning that turns a plan into reviewed code",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"homepage": "https://github.com/Dubusoft/toodo",
|
|
@@ -11,14 +11,19 @@
|
|
|
11
11
|
"bin": {
|
|
12
12
|
"toodo": "bin/toodo.js"
|
|
13
13
|
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"postinstall": "node install.js"
|
|
16
|
+
},
|
|
14
17
|
"files": [
|
|
15
|
-
"bin"
|
|
18
|
+
"bin",
|
|
19
|
+
"lib",
|
|
20
|
+
"install.js"
|
|
16
21
|
],
|
|
17
22
|
"engines": {
|
|
18
23
|
"node": ">=18"
|
|
19
24
|
},
|
|
20
25
|
"optionalDependencies": {
|
|
21
|
-
"@dubusoft/toodo-linux-x64": "1.10.3-dev.
|
|
22
|
-
"@dubusoft/toodo-linux-arm64": "1.10.3-dev.
|
|
26
|
+
"@dubusoft/toodo-linux-x64": "1.10.3-dev.139",
|
|
27
|
+
"@dubusoft/toodo-linux-arm64": "1.10.3-dev.139"
|
|
23
28
|
}
|
|
24
29
|
}
|