@tamfitronics/tamcoder 0.1.98 → 0.2.2
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 +6 -25
- package/bin/tamcoder.mjs +6 -3
- package/install.mjs +14 -52
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,30 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tamcoder
|
|
2
2
|
|
|
3
|
-
Tamcoder
|
|
3
|
+
Installs the official Tamcoder TypeScript runtime for Linux x86_64. Requires Node.js 22+ and tar. The installer downloads the release matching the package version from https://gpt.tamfitronics.com/tamcoder/ and verifies its SHA-256 checksum. It uses your user installation directory and does not change system artifact permissions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Run `tamcoder login`, then `tamcoder` in your project. Use `tamcoder --resume` to resume a session. Upgrade this package to receive a newer runtime.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm install -g @tamfitronics/tamcoder
|
|
9
|
-
```
|
|
7
|
+
`TAMCODER_INSTALL_PREFIX` changes the default `~/.local` installation prefix. `TAMCODER_RELEASE_BASE` selects an alternate release host for testing. No workspace, session or account data is sent during installation.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
Install with `npm install --global @tamfitronics/tamcoder`.
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
tamcoder --version
|
|
15
|
-
tamcoder --help
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## How it works
|
|
19
|
-
|
|
20
|
-
This npm package contains a small installer. On `npm install` it downloads the
|
|
21
|
-
official TypeScript release from `https://gpt.tamfitronics.com/tamcoder`,
|
|
22
|
-
verifies its SHA-256 checksum, and extracts it into
|
|
23
|
-
`~/.local/share/tamcoder/releases/<version>`. The `tamcoder` and `tamcoder-bin`
|
|
24
|
-
binaries are symlinked into `~/.local/bin`.
|
|
25
|
-
|
|
26
|
-
## Environment variables
|
|
27
|
-
|
|
28
|
-
- `TAMCODER_RELEASE_BASE` – override the download URL base
|
|
29
|
-
- `TAMCODER_INSTALL_PREFIX` – default `~/.local`
|
|
30
|
-
- `TAMCODER_LOCAL_RELEASE_ROOT` – install from a local directory instead of the network
|
|
11
|
+
Npm installer version 0.1.99 installs runtime 0.1.98. This corrects the old launcher accidentally included in npm 0.1.98.
|
package/bin/tamcoder.mjs
CHANGED
|
@@ -5,14 +5,17 @@ import { join } from 'path';
|
|
|
5
5
|
import { spawnSync } from 'child_process';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import { readFileSync } from 'fs';
|
|
9
|
+
import { install } from '../install.mjs';
|
|
10
|
+
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
11
|
+
const version = pkg.tamcoderRuntimeVersion ?? pkg.version;
|
|
9
12
|
const prefix = process.env.TAMCODER_INSTALL_PREFIX || join(homedir(), '.local');
|
|
10
13
|
const releaseDir = join(prefix, 'share', 'tamcoder', 'releases', version);
|
|
11
14
|
const binary = join(releaseDir, 'app', 'bin', 'tamcoder');
|
|
12
15
|
|
|
13
16
|
if (!existsSync(binary)) {
|
|
14
|
-
|
|
15
|
-
process.exit(1);
|
|
17
|
+
try { await install(); }
|
|
18
|
+
catch (error) { console.error(`tamcoder: ${error.message}`); process.exit(1); }
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
const result = spawnSync(binary, process.argv.slice(2), {
|
package/install.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createWriteStream, existsSync, mkdirSync, readFileSync
|
|
2
|
+
import { createWriteStream, existsSync, mkdirSync, readFileSync } from 'fs';
|
|
3
3
|
import { createHash } from 'crypto';
|
|
4
4
|
import { homedir } from 'os';
|
|
5
5
|
import { dirname, join, resolve } from 'path';
|
|
@@ -9,25 +9,15 @@ import { fileURLToPath } from 'url';
|
|
|
9
9
|
|
|
10
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
|
|
12
|
-
const version = pkg.
|
|
12
|
+
const version = pkg.tamcoderRuntimeVersion ?? pkg.version;
|
|
13
13
|
const platform = 'linux-x64';
|
|
14
|
-
let resolvedAsset = null;
|
|
15
14
|
const base = process.env.TAMCODER_RELEASE_BASE || 'https://gpt.tamfitronics.com/tamcoder';
|
|
16
15
|
const prefix = process.env.TAMCODER_INSTALL_PREFIX || join(homedir(), '.local');
|
|
17
16
|
const releaseDir = join(prefix, 'share', 'tamcoder', 'releases', version);
|
|
18
|
-
const binDir = join(prefix, 'bin');
|
|
19
17
|
const localReleaseRoot = process.env.TAMCODER_LOCAL_RELEASE_ROOT;
|
|
20
18
|
|
|
21
19
|
async function resolveAsset() {
|
|
22
|
-
|
|
23
|
-
if (localReleaseRoot) {
|
|
24
|
-
const latest = JSON.parse(await fetchText(`${base}/latest.json`));
|
|
25
|
-
resolvedAsset = latest.asset || `tamcoder-${latest.version}-${platform}.tar.gz`;
|
|
26
|
-
return resolvedAsset;
|
|
27
|
-
}
|
|
28
|
-
const latest = JSON.parse(await fetchText(`${base}/latest.json`));
|
|
29
|
-
resolvedAsset = latest.asset || `tamcoder-${latest.version}-${platform}.tar.gz`;
|
|
30
|
-
return resolvedAsset;
|
|
20
|
+
return `tamcoder-${version}-${platform}.tar.gz`;
|
|
31
21
|
}
|
|
32
22
|
|
|
33
23
|
function sha256(path) {
|
|
@@ -51,14 +41,6 @@ function ensureDir(dir) {
|
|
|
51
41
|
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
52
42
|
}
|
|
53
43
|
|
|
54
|
-
function linkBin(name) {
|
|
55
|
-
const src = join(releaseDir, 'app', 'bin', 'tamcoder');
|
|
56
|
-
const dst = join(binDir, name);
|
|
57
|
-
ensureDir(binDir);
|
|
58
|
-
if (existsSync(dst)) unlinkSync(dst);
|
|
59
|
-
symlinkSync(src, dst);
|
|
60
|
-
chmodSync(src, 0o755);
|
|
61
|
-
}
|
|
62
44
|
|
|
63
45
|
async function installFromLocal() {
|
|
64
46
|
const dir = localReleaseRoot;
|
|
@@ -67,6 +49,8 @@ async function installFromLocal() {
|
|
|
67
49
|
const tarball = join(dir, asset);
|
|
68
50
|
const checksum = join(dir, `${asset}.sha256`);
|
|
69
51
|
if (!existsSync(tarball)) throw new Error(`local asset missing: ${tarball}`);
|
|
52
|
+
const expected = readFileSync(checksum, 'utf8').trim().split(/\s+/)[0];
|
|
53
|
+
if (!/^[a-f0-9]{64}$/i.test(expected) || sha256(tarball) !== expected) throw new Error('local asset checksum mismatch');
|
|
70
54
|
ensureDir(releaseDir);
|
|
71
55
|
await import('child_process').then(({ execFileSync }) => {
|
|
72
56
|
execFileSync('tar', ['-xzf', tarball, '-C', releaseDir], { stdio: 'inherit' });
|
|
@@ -97,24 +81,10 @@ async function installFromNetwork() {
|
|
|
97
81
|
return true;
|
|
98
82
|
}
|
|
99
83
|
|
|
100
|
-
async function
|
|
101
|
-
|
|
102
|
-
const artifactRoot = '/mnt/tamcoder/users';
|
|
103
|
-
const artifactBase = dirname(artifactRoot);
|
|
104
|
-
const { execFileSync } = await import('child_process');
|
|
105
|
-
for (const [dir, mode] of [[artifactBase, '0755'], [artifactRoot, '1777']]) {
|
|
106
|
-
if (!existsSync(dir)) {
|
|
107
|
-
try { execFileSync('install', ['-d', '-m', mode, dir], { stdio: 'ignore' }); }
|
|
108
|
-
catch { /* user may manage this separately */ }
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
async function install() {
|
|
84
|
+
export async function install() {
|
|
85
|
+
if (process.platform !== 'linux' || process.arch !== 'x64') throw new Error('Tamcoder currently requires Linux x86_64.');
|
|
114
86
|
if (existsSync(join(releaseDir, 'app', 'bin', 'tamcoder'))) {
|
|
115
87
|
console.log(`Tamcoder ${version} already installed at ${releaseDir}`);
|
|
116
|
-
linkBin('tamcoder');
|
|
117
|
-
linkBin('tamcoder-bin');
|
|
118
88
|
return;
|
|
119
89
|
}
|
|
120
90
|
|
|
@@ -128,23 +98,15 @@ async function install() {
|
|
|
128
98
|
throw new Error('extracted asset is missing app/bin/tamcoder');
|
|
129
99
|
}
|
|
130
100
|
|
|
131
|
-
|
|
132
|
-
linkBin('tamcoder-bin');
|
|
133
|
-
await ensureArtifacts();
|
|
134
|
-
console.log(`Installed Tamcoder ${version} to ${binDir}/tamcoder`);
|
|
101
|
+
console.log(`Installed Tamcoder ${version} at ${releaseDir}`);
|
|
135
102
|
}
|
|
136
103
|
|
|
137
104
|
export async function verify() {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const remoteAsset = latest.asset || `tamcoder-${latest.version}-${platform}.tar.gz`;
|
|
142
|
-
const shaUrl = `${base}/releases/${remoteAsset}.sha256`;
|
|
143
|
-
// Verify checksum endpoint exists (404 will throw)
|
|
144
|
-
await fetchText(shaUrl);
|
|
105
|
+
const remoteAsset = await resolveAsset();
|
|
106
|
+
const checksum = (await fetchText(`${base}/releases/${remoteAsset}.sha256`)).trim().split(/\s+/)[0];
|
|
107
|
+
if (!/^[a-f0-9]{64}$/i.test(checksum)) throw new Error('invalid release checksum');
|
|
145
108
|
console.log(`Verified remote asset ${remoteAsset}`);
|
|
146
109
|
}
|
|
147
|
-
|
|
148
|
-
console.error(err.message);
|
|
149
|
-
|
|
150
|
-
});
|
|
110
|
+
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
111
|
+
install().catch(err => { console.error(err.message); process.exit(1); });
|
|
112
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamfitronics/tamcoder",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Tamcoder
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Tamcoder – TypeScript AI coding-agent runtime",
|
|
5
5
|
"license": "MIT OR MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/
|
|
32
|
+
"url": "git+https://github.com/tbtamfit/tamcoder.git"
|
|
33
33
|
},
|
|
34
|
-
"homepage": "https://tamfitronics.com/tamcoder",
|
|
34
|
+
"homepage": "https://gpt.tamfitronics.com/tamcoder/",
|
|
35
35
|
"author": "Tamfitronics <services@tamfitronics.com>",
|
|
36
36
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/
|
|
38
|
-
}
|
|
39
|
-
|
|
37
|
+
"url": "https://github.com/tbtamfit/tamcoder/issues"
|
|
38
|
+
},
|
|
39
|
+
"tamcoderRuntimeVersion": "0.2.2"
|
|
40
|
+
}
|