@kitlangton/tailcode 0.2.3 → 0.2.5
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 +28 -7
- package/dist/tailcode.js +662 -0
- package/package.json +12 -21
- package/bin/tailcode.ts +0 -75
- package/bunfig.toml +0 -1
- package/src/app.tsx +0 -567
- package/src/flow.ts +0 -115
- package/src/main.tsx +0 -23
- package/src/qr.ts +0 -118
- package/src/runtime.ts +0 -6
- package/src/services/config.ts +0 -28
- package/src/services/errors.ts +0 -14
- package/src/services/opencode.ts +0 -108
- package/src/services/process.ts +0 -52
- package/src/services/tailscale.ts +0 -308
- package/src/state.ts +0 -15
- package/tsconfig.json +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitlangton/tailcode",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Terminal wizard for publishing OpenCode to your Tailscale tailnet",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,20 +23,11 @@
|
|
|
23
23
|
"bun": ">=1.3.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
|
-
"
|
|
27
|
-
"src/main.tsx",
|
|
28
|
-
"src/app.tsx",
|
|
29
|
-
"src/flow.ts",
|
|
30
|
-
"src/runtime.ts",
|
|
31
|
-
"src/qr.ts",
|
|
32
|
-
"src/state.ts",
|
|
33
|
-
"src/services/*.ts",
|
|
34
|
-
"tsconfig.json",
|
|
35
|
-
"bunfig.toml",
|
|
26
|
+
"dist/tailcode.js",
|
|
36
27
|
"README.md"
|
|
37
28
|
],
|
|
38
29
|
"bin": {
|
|
39
|
-
"tailcode": "./
|
|
30
|
+
"tailcode": "./dist/tailcode.js"
|
|
40
31
|
},
|
|
41
32
|
"publishConfig": {
|
|
42
33
|
"access": "public"
|
|
@@ -60,24 +51,24 @@
|
|
|
60
51
|
"publish:npm": "bun run check && bun run build && bun publish"
|
|
61
52
|
},
|
|
62
53
|
"dependencies": {
|
|
63
|
-
"@effect/atom-solid": "4.0.0-beta.
|
|
64
|
-
"@effect/platform-bun": "4.0.0-beta.
|
|
54
|
+
"@effect/atom-solid": "4.0.0-beta.12",
|
|
55
|
+
"@effect/platform-bun": "4.0.0-beta.12",
|
|
65
56
|
"@opentui/core": "0.1.81",
|
|
66
57
|
"@opentui/solid": "0.1.81",
|
|
67
|
-
"effect": "4.0.0-beta.
|
|
58
|
+
"effect": "4.0.0-beta.12",
|
|
68
59
|
"qrcode": "1.5.4",
|
|
69
60
|
"solid-js": "1.9.11"
|
|
70
61
|
},
|
|
71
62
|
"devDependencies": {
|
|
72
|
-
"@effect/language-service": "0.
|
|
73
|
-
"@effect/vitest": "4.0.0-beta.
|
|
74
|
-
"@tsconfig/bun": "^1.0.
|
|
63
|
+
"@effect/language-service": "0.76.0",
|
|
64
|
+
"@effect/vitest": "4.0.0-beta.12",
|
|
65
|
+
"@tsconfig/bun": "^1.0.10",
|
|
75
66
|
"@types/bun": "^1.3.9",
|
|
76
|
-
"@types/qrcode": "^1.5.
|
|
67
|
+
"@types/qrcode": "^1.5.6",
|
|
77
68
|
"oxfmt": "^0.35.0",
|
|
78
69
|
"oxlint": "^1.50.0",
|
|
79
|
-
"tuistory": "^0.0.
|
|
70
|
+
"tuistory": "^0.0.16",
|
|
80
71
|
"typescript": "^5.8.2",
|
|
81
|
-
"vitest": "
|
|
72
|
+
"vitest": "4.0.18"
|
|
82
73
|
}
|
|
83
74
|
}
|
package/bin/tailcode.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
export {}
|
|
4
|
-
|
|
5
|
-
const DEFAULT_PORT = 4096
|
|
6
|
-
|
|
7
|
-
function printHelp() {
|
|
8
|
-
process.stdout.write(
|
|
9
|
-
`tailcode\n\nUsage:\n tailcode [--attach] [--help]\n\nOptions:\n --attach Attach to an already-running local OpenCode server\n --help Show this help\n`,
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function resolvePort() {
|
|
14
|
-
const raw = process.env.TAILCODE_PORT
|
|
15
|
-
if (!raw) return DEFAULT_PORT
|
|
16
|
-
const parsed = Number.parseInt(raw, 10)
|
|
17
|
-
return Number.isInteger(parsed) && parsed > 0 && parsed <= 65535 ? parsed : DEFAULT_PORT
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function isHealthy(port: number) {
|
|
21
|
-
const controller = new AbortController()
|
|
22
|
-
const timer = setTimeout(() => controller.abort(), 600)
|
|
23
|
-
try {
|
|
24
|
-
const response = await fetch(`http://127.0.0.1:${port}/global/health`, {
|
|
25
|
-
signal: controller.signal,
|
|
26
|
-
})
|
|
27
|
-
return response.ok
|
|
28
|
-
} catch {
|
|
29
|
-
return false
|
|
30
|
-
} finally {
|
|
31
|
-
clearTimeout(timer)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function runAttach(port: number) {
|
|
36
|
-
const bin = Bun.which("opencode")
|
|
37
|
-
if (!bin) {
|
|
38
|
-
process.stderr.write("tailcode: 'opencode' is not installed\n")
|
|
39
|
-
process.exit(1)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const target = `http://127.0.0.1:${port}`
|
|
43
|
-
process.stdout.write(`tailcode: attaching to ${target}\n`)
|
|
44
|
-
|
|
45
|
-
const child = Bun.spawn([bin, "attach", target], {
|
|
46
|
-
stdin: "inherit",
|
|
47
|
-
stdout: "inherit",
|
|
48
|
-
stderr: "inherit",
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
process.exit(await child.exited)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const args = process.argv.slice(2)
|
|
55
|
-
const forceAttach = args.includes("--attach")
|
|
56
|
-
|
|
57
|
-
if (args.includes("--help") || args.includes("-h")) {
|
|
58
|
-
printHelp()
|
|
59
|
-
process.exit(0)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const port = resolvePort()
|
|
63
|
-
|
|
64
|
-
if (forceAttach) {
|
|
65
|
-
const healthy = await isHealthy(port)
|
|
66
|
-
if (healthy) {
|
|
67
|
-
await runAttach(port)
|
|
68
|
-
} else {
|
|
69
|
-
process.stderr.write(`tailcode: OpenCode is not running on http://127.0.0.1:${port}\n`)
|
|
70
|
-
process.exit(1)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Default: always launch the wizard
|
|
75
|
-
await import("../src/main.tsx")
|
package/bunfig.toml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
preload = ["@opentui/solid/preload"]
|