@six5536/smllm 0.4.0 → 0.5.0
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/smllm.js +7 -0
- package/lib/binary.js +5 -0
- package/package.json +6 -6
package/bin/smllm.js
CHANGED
|
@@ -8,6 +8,9 @@ const { spawnSync } = require("node:child_process");
|
|
|
8
8
|
const { resolveBinary, exitCode } = require("../lib/binary");
|
|
9
9
|
|
|
10
10
|
let binary;
|
|
11
|
+
// sokf-implements: LNCH-1_AC-5
|
|
12
|
+
// sokf-implements: LNCH-1_AC-6
|
|
13
|
+
// sokf-implements: LNCH-1_AC-8
|
|
11
14
|
try {
|
|
12
15
|
binary = resolveBinary(process.platform, process.arch);
|
|
13
16
|
} catch (err) {
|
|
@@ -15,11 +18,15 @@ try {
|
|
|
15
18
|
process.exit(1);
|
|
16
19
|
}
|
|
17
20
|
|
|
21
|
+
// sokf-implements: LNCH-1_AC-1
|
|
18
22
|
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
19
23
|
|
|
24
|
+
// sokf-implements: LNCH-1_AC-7
|
|
25
|
+
// sokf-implements: LNCH-1_AC-8
|
|
20
26
|
if (result.error) {
|
|
21
27
|
process.stderr.write(`failed to run smllm: ${result.error.message}\n`);
|
|
22
28
|
process.exit(1);
|
|
23
29
|
}
|
|
24
30
|
|
|
31
|
+
// sokf-implements: LNCH-1_AC-2
|
|
25
32
|
process.exit(exitCode(result));
|
package/lib/binary.js
CHANGED
|
@@ -34,6 +34,7 @@ function binaryName(platform) {
|
|
|
34
34
|
*/
|
|
35
35
|
function resolveBinary(platform, arch, requireResolve = require.resolve) {
|
|
36
36
|
const pkg = selectPackage(platform, arch);
|
|
37
|
+
// sokf-implements: LNCH-1_AC-5
|
|
37
38
|
if (!pkg) {
|
|
38
39
|
throw new Error(
|
|
39
40
|
`No prebuilt smllm binary for ${platform}-${arch}.\n` +
|
|
@@ -41,6 +42,7 @@ function resolveBinary(platform, arch, requireResolve = require.resolve) {
|
|
|
41
42
|
`Install from source instead: cargo install smllm`,
|
|
42
43
|
);
|
|
43
44
|
}
|
|
45
|
+
// sokf-implements: LNCH-1_AC-6
|
|
44
46
|
try {
|
|
45
47
|
return requireResolve(`${pkg}/bin/${binaryName(platform)}`);
|
|
46
48
|
} catch {
|
|
@@ -60,6 +62,9 @@ function resolveBinary(platform, arch, requireResolve = require.resolve) {
|
|
|
60
62
|
* than a misleading 1. `signals` is injected for testability and defaults to
|
|
61
63
|
* Node's own table.
|
|
62
64
|
*/
|
|
65
|
+
// sokf-implements: LNCH-1_AC-2
|
|
66
|
+
// sokf-implements: LNCH-1_AC-3
|
|
67
|
+
// sokf-implements: LNCH-1_AC-4
|
|
63
68
|
function exitCode(result, signals = require("node:os").constants.signals) {
|
|
64
69
|
if (result.signal) {
|
|
65
70
|
const signum = signals[result.signal];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@six5536/smllm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "State machines for LLM agents: declarative workflows that drive a coding agent through its hooks and one MCP tool.",
|
|
5
5
|
"homepage": "https://github.com/six5536/smllm#readme",
|
|
6
6
|
"repository": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"node": ">=18"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@six5536/smllm-linux-x64": "0.
|
|
38
|
-
"@six5536/smllm-linux-arm64": "0.
|
|
39
|
-
"@six5536/smllm-darwin-x64": "0.
|
|
40
|
-
"@six5536/smllm-darwin-arm64": "0.
|
|
41
|
-
"@six5536/smllm-win32-x64": "0.
|
|
37
|
+
"@six5536/smllm-linux-x64": "0.5.0",
|
|
38
|
+
"@six5536/smllm-linux-arm64": "0.5.0",
|
|
39
|
+
"@six5536/smllm-darwin-x64": "0.5.0",
|
|
40
|
+
"@six5536/smllm-darwin-arm64": "0.5.0",
|
|
41
|
+
"@six5536/smllm-win32-x64": "0.5.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"test": "node --test test/*.test.js"
|