shinsa 0.0.1 → 1.0.0-canary.52
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 +11 -0
- package/bin/shinsa.js +63 -0
- package/package.json +22 -3
- package/index.js +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Shinsa
|
|
2
|
+
|
|
3
|
+
The Shinsa engine and the `shinsa` command, for Linux (x64 and arm64, glibc) and Apple Silicon Macs.
|
|
4
|
+
It includes the web app, served on the engine’s port.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm i -g shinsa
|
|
8
|
+
shinsa start
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
On a Mac you can install the Shinsa app instead, which carries the same engine: https://shinsa.dev
|
package/bin/shinsa.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawnSync } = require('node:child_process');
|
|
3
|
+
const { dirname, join } = require('node:path');
|
|
4
|
+
|
|
5
|
+
const ENGINE_PACKAGES = {
|
|
6
|
+
'darwin-arm64': '@shinsa/darwin-arm64',
|
|
7
|
+
'linux-x64': '@shinsa/linux-x64',
|
|
8
|
+
'linux-arm64': '@shinsa/linux-arm64',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const SUPPORTED = 'Shinsa’s engine runs on Apple Silicon Macs and on Linux x64 and arm64 with glibc.';
|
|
12
|
+
|
|
13
|
+
function resolveEnginePackage(platform, arch) {
|
|
14
|
+
const name = ENGINE_PACKAGES[`${platform}-${arch}`];
|
|
15
|
+
if (name) return name;
|
|
16
|
+
if (platform === 'darwin') {
|
|
17
|
+
throw new Error(`${SUPPORTED} This Mac has an Intel processor, so there is no engine for it.`);
|
|
18
|
+
}
|
|
19
|
+
throw new Error(`${SUPPORTED} There is no engine for ${platform} ${arch}.`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function resolveEngineBinary(platform, arch, resolve) {
|
|
23
|
+
const name = resolveEnginePackage(platform, arch);
|
|
24
|
+
let manifest;
|
|
25
|
+
try {
|
|
26
|
+
manifest = resolve(`${name}/package.json`);
|
|
27
|
+
} catch {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`${name} is not installed. Install shinsa again without --omit=optional or --no-optional. ${SUPPORTED}`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return join(dirname(manifest), 'bin', 'shinsa');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function runLauncher({ platform, arch, argv, resolve, spawn, writeError }) {
|
|
36
|
+
let binary;
|
|
37
|
+
try {
|
|
38
|
+
binary = resolveEngineBinary(platform, arch, resolve);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
writeError(`${error.message}\n`);
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
const result = spawn(binary, argv, { stdio: 'inherit' });
|
|
44
|
+
if (result.error) {
|
|
45
|
+
writeError(`Could not run ${binary}: ${result.error.message}\n`);
|
|
46
|
+
return 1;
|
|
47
|
+
}
|
|
48
|
+
if (result.signal) return 128 + (require('node:os').constants.signals[result.signal] ?? 0);
|
|
49
|
+
return result.status ?? 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (require.main === module) {
|
|
53
|
+
process.exitCode = runLauncher({
|
|
54
|
+
platform: process.platform,
|
|
55
|
+
arch: process.arch,
|
|
56
|
+
argv: process.argv.slice(2),
|
|
57
|
+
resolve: require.resolve,
|
|
58
|
+
spawn: spawnSync,
|
|
59
|
+
writeError: (text) => process.stderr.write(text),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
module.exports = { ENGINE_PACKAGES, resolveEnginePackage, resolveEngineBinary, runLauncher };
|
package/package.json
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinsa",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0-canary.52",
|
|
4
|
+
"description": "Shinsa’s engine and the `shinsa` command: hand coding work to agents and keep the decisions.",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"homepage": "https://shinsa.dev",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/shinsa-dev/shinsa.git"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"shinsa": "bin/shinsa.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"optionalDependencies": {
|
|
21
|
+
"@shinsa/darwin-arm64": "1.0.0-canary.52",
|
|
22
|
+
"@shinsa/linux-x64": "1.0.0-canary.52",
|
|
23
|
+
"@shinsa/linux-arm64": "1.0.0-canary.52"
|
|
24
|
+
}
|
|
6
25
|
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// hansei
|