@sleep2agi/tmcode 1.17.4
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/LICENSE +21 -0
- package/README.md +31 -0
- package/bin/tmcode.exe +0 -0
- package/package.json +21 -0
- package/postinstall.mjs +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 opencode
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @sleep2agi/tmcode (scoped alias)
|
|
2
|
+
|
|
3
|
+
> **`@sleep2agi/tmcode` is a scoped alias of [`tmcode-ai`](https://www.npmjs.com/package/tmcode-ai).**
|
|
4
|
+
>
|
|
5
|
+
> Same wrapper, same binary, same CLI command (`tmcode`). Published as a scoped
|
|
6
|
+
> name to give users another way to install while we wait for npm support to
|
|
7
|
+
> release the bare name `tmcode` (currently blocked by a similarity-gate
|
|
8
|
+
> false-positive — see [GitHub issue](https://github.com/sleep2agi/tmcode)).
|
|
9
|
+
|
|
10
|
+
## Three install paths (pick any)
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# 1) Default (recommended) — matches upstream opencode-ai naming
|
|
14
|
+
npm install -g tmcode-ai
|
|
15
|
+
|
|
16
|
+
# 2) Scoped alias — same wrapper, scoped npm name
|
|
17
|
+
npm install -g @sleep2agi/tmcode
|
|
18
|
+
|
|
19
|
+
# 3) Bare name (pending npm support review)
|
|
20
|
+
# npm install -g tmcode ← currently 403, in review
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
All three install the same `tmcode` CLI command. The binary is opencode 1.17.4
|
|
24
|
+
unmodified (v0 wrapper-only release). A v1 deep source rebuild is in progress.
|
|
25
|
+
|
|
26
|
+
See the [main repo](https://github.com/sleep2agi/tmcode) for full attribution
|
|
27
|
+
and v1 plan.
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT — same as upstream opencode.
|
package/bin/tmcode.exe
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sleep2agi/tmcode",
|
|
3
|
+
"bin": {
|
|
4
|
+
"tmcode": "./bin/tmcode.exe"
|
|
5
|
+
},
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node ./postinstall.mjs"
|
|
8
|
+
},
|
|
9
|
+
"version": "1.17.4",
|
|
10
|
+
"description": "tmcode v0 (scoped) = opencode 1.17.4 renamed distribution. Same wrapper as tmcode-ai, scoped alias.",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"homepage": "https://github.com/sleep2agi/tmcode",
|
|
13
|
+
"repository": { "type": "git", "url": "https://github.com/sleep2agi/tmcode.git" },
|
|
14
|
+
"os": ["darwin", "linux", "win32"],
|
|
15
|
+
"cpu": ["arm64", "x64"],
|
|
16
|
+
"optionalDependencies": {
|
|
17
|
+
"tmcode-darwin-arm64": "1.17.4",
|
|
18
|
+
"tmcode-linux-x64": "1.17.4",
|
|
19
|
+
"tmcode-windows-x64": "1.17.4"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/postinstall.mjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// tmcode v0 postinstall — copies the platform-specific binary
|
|
3
|
+
// (from `tmcode-<platform>-<arch>` optional dependency) into
|
|
4
|
+
// `bin/tmcode.exe`. Mirrors upstream opencode's pattern; the
|
|
5
|
+
// binary itself is opencode 1.17.4 unmodified pending v1 deep
|
|
6
|
+
// rebrand.
|
|
7
|
+
|
|
8
|
+
import fs from "fs"
|
|
9
|
+
import os from "os"
|
|
10
|
+
import path from "path"
|
|
11
|
+
import { createRequire } from "module"
|
|
12
|
+
import { fileURLToPath } from "url"
|
|
13
|
+
|
|
14
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
15
|
+
const require = createRequire(import.meta.url)
|
|
16
|
+
|
|
17
|
+
const platformMap = { darwin: "darwin", linux: "linux", win32: "windows" }
|
|
18
|
+
const archMap = { x64: "x64", arm64: "arm64", arm: "arm" }
|
|
19
|
+
|
|
20
|
+
const platform = platformMap[os.platform()] ?? os.platform()
|
|
21
|
+
const arch = archMap[os.arch()] ?? os.arch()
|
|
22
|
+
const base = `tmcode-${platform}-${arch}`
|
|
23
|
+
const sourceBinary = platform === "windows" ? "tmcode.exe" : "tmcode"
|
|
24
|
+
const targetBinary = path.join(__dirname, "bin", "tmcode.exe")
|
|
25
|
+
|
|
26
|
+
let resolved
|
|
27
|
+
try {
|
|
28
|
+
resolved = require.resolve(`${base}/package.json`)
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error(`tmcode: no prebuilt binary for ${platform}/${arch}.`)
|
|
31
|
+
console.error(` Tried to load: ${base}`)
|
|
32
|
+
console.error(` Supported platforms (v0): darwin-arm64, linux-x64, windows-x64`)
|
|
33
|
+
process.exit(0)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const sourcePath = path.join(path.dirname(resolved), "bin", sourceBinary)
|
|
37
|
+
if (!fs.existsSync(sourcePath)) {
|
|
38
|
+
console.error(`tmcode: binary missing in ${base}: ${sourcePath}`)
|
|
39
|
+
process.exit(0)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
fs.mkdirSync(path.dirname(targetBinary), { recursive: true })
|
|
43
|
+
fs.copyFileSync(sourcePath, targetBinary)
|
|
44
|
+
if (platform !== "windows") {
|
|
45
|
+
try { fs.chmodSync(targetBinary, 0o755) } catch {}
|
|
46
|
+
}
|