xkat-cli 1.1.1 → 1.1.3

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 CHANGED
@@ -1,45 +1,56 @@
1
1
  # xKat (Local Terminal Bridge)
2
2
 
3
- xKat Agent 브라우저 기반의 코딩 학습 플랫폼과 사용자의 로컬 환경을 안전하게 연결해주는 브릿지 도구입니다.
3
+ xKat Agent is a bridge tool that securely connects a browser-based coding
4
+ learning platform to your local environment.
4
5
 
5
- ## 주요 기능
6
+ ## Features
6
7
 
7
- - **무설치 로컬 브릿지**: 브라우저의 IDE 터미널을 로컬 셸에 직접 연결합니다. 별도 설치/설정 없이 `npx xkat up` 한 번으로 현재 사용자 권한의 네이티브 셸(PTY)을 띄웁니다.
8
- - **실시간 파일 동기화**: 로컬 작업 디렉토리의 파일 변경(VFS)을 감지하여 대시보드와 즉시 동기화합니다.
9
- - **보안 중심 설계**: 127.0.0.1 루프백 바인딩과 Origin 검사를 통해 안전한 로컬 제어를 보장합니다.
10
- - **(선택) SSH 모드**: 자격 증명(사용자/비밀번호) 입력하면 로컬 SSH 서버로 연결할 수도 있습니다. 기본값은 무설치 직접 셸입니다.
8
+ - **Zero-install local shell bridge**: Connects the web IDE terminal in your
9
+ browser directly to your local shell. A single `npx xkat up` spawns a native
10
+ shell (PTY) with your current user permissions no extra install or setup.
11
+ - **Real-time file sync**: Watches file changes (VFS) in your local working
12
+ directory and syncs them with the web dashboard instantly.
13
+ - **Security-first design**: Binds to the 127.0.0.1 loopback and verifies the
14
+ request Origin to keep local control safe.
15
+ - **(Optional) SSH mode**: If you provide credentials (user/password), it can
16
+ connect to a local SSH server instead. The default is the zero-install
17
+ direct shell.
11
18
 
12
- ## 시작하기
19
+ ## Getting started
13
20
 
14
- NPM을 통해 별도의 설치 없이 즉시 실행할 수 있습니다.
21
+ Run instantly via npm without a separate install:
15
22
 
16
23
  ```bash
17
24
  npx xkat up
18
25
  ```
19
26
 
20
- 또는 전역 설치를 원할 경우:
27
+ Or install globally:
21
28
 
22
29
  ```bash
23
30
  npm install -g xkat-cli
24
31
  xkat up
25
32
  ```
26
33
 
27
- ## 시스템 요구 사항
34
+ ## System requirements
28
35
 
29
- - **Node.js**: 16.x 이상의 버전이 필요합니다.
30
- - **OpenSSH Server (선택)**: 기본 무설치 모드에서는 불필요합니다. SSH 자격 증명 모드를 사용할 때만 로컬 SSH 서버가 필요합니다.
36
+ - **Node.js**: 16.x or newer.
37
+ - **OpenSSH Server (optional)**: Not needed for the default zero-install shell
38
+ mode. Only required when using the SSH credentials mode.
31
39
 
32
- ## 보안 가이드라인
40
+ ## Security guidelines
33
41
 
34
- xKat Agent 보안을 위해 다음과 같은 장치를 마련하고 있습니다:
35
- 1. **Localhost Only**: 포트 10022는 오직 로컬호스트에서만 접근 가능합니다.
36
- 2. **Origin Verification**: 공식 서비스 도메인에서 온 연결요청만 수락합니다.
37
- 3. **Audit Log**: 모든 접속 시도와 파일 변경 이벤트는 타임스탬프와 함께 로컬로그에 기록됩니다.
42
+ xKat Agent includes the following safeguards:
38
43
 
39
- ## 배포 (Maintainers)
44
+ 1. **Localhost only**: Port 10022 is reachable only from localhost.
45
+ 2. **Origin verification**: Only connection requests from the official service
46
+ domains are accepted.
47
+ 3. **Audit log**: Every connection attempt and file-change event is recorded
48
+ locally with a timestamp.
40
49
 
41
- 릴리스 파이프라인은 `docs/xkat-agent/deployment-pipeline.md` 및
42
- `.github/workflows/release-agent.yml`를 참고하세요. 요약:
50
+ ## Releasing (maintainers)
51
+
52
+ See `docs/xkat-agent/deployment-pipeline.md` and
53
+ `.github/workflows/release-agent.yml` for the release pipeline. Summary:
43
54
 
44
55
  ```bash
45
56
  cd apps/xkat-agent
@@ -49,6 +60,6 @@ git tag agent-v$(node -p "require('./package.json').version")
49
60
  git push origin main --tags
50
61
  ```
51
62
 
52
- ## 라이선스
63
+ ## License
53
64
 
54
65
  MIT License
package/bin/xkat-cli.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  /**
4
4
  * xkat-cli.js
5
- * NPM에서 유저가 'xkat' 명령어를 입력하면 실행되는 경량 래퍼(Wrapper)입니다.
6
- * 유일한 역할: postinstall에서 다운받아둔 Rust 바이너리를 찾아서 실행권한을 넘기는 것.
5
+ * A lightweight wrapper invoked when the user runs the `xkat` command from npm.
6
+ * Its only job: locate the Rust binary downloaded during postinstall and hand
7
+ * over execution to it.
7
8
  */
8
9
  const { spawnSync } = require('child_process');
9
10
  const path = require('path');
@@ -38,11 +39,11 @@ const binaryPath = path.join(__dirname, '..', 'binaries', getBinaryName());
38
39
 
39
40
  if (!fs.existsSync(binaryPath)) {
40
41
  console.error('❌ xkat-agent binary not found.');
41
- console.error(' Try reinstalling: npm install -g xkat-agent');
42
+ console.error(' Try reinstalling: npm install -g xkat-cli');
42
43
  process.exit(1);
43
44
  }
44
45
 
45
- // Rust 바이너리에 모든 argv 그대로 토스
46
+ // Forward all argv straight to the Rust binary
46
47
  const result = spawnSync(binaryPath, process.argv.slice(2), {
47
48
  stdio: 'inherit',
48
49
  env: process.env,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xkat-cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "xKat Local Terminal Agent - Bridge between Web IDE and Local Shell",
5
5
  "main": "bin/xkat-cli.js",
6
6
  "bin": {
@@ -14,13 +14,8 @@
14
14
  "scripts": {
15
15
  "postinstall": "node ./scripts/install.js"
16
16
  },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/somilab/xkat-agent.git"
20
- },
21
17
  "keywords": [
22
18
  "xkat",
23
- "codingkat",
24
19
  "terminal",
25
20
  "ssh",
26
21
  "bridge",
@@ -28,8 +23,5 @@
28
23
  ],
29
24
  "author": "SomiLab <contact@somilab.com>",
30
25
  "license": "MIT",
31
- "bugs": {
32
- "url": "https://github.com/somilab/xkat-agent/issues"
33
- },
34
26
  "homepage": "https://xkat.space"
35
27
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
- * install.js — postinstall 스크립트
3
- * npm install 직후 자동 실행되며, 유저의 OS/아키텍처에 맞는
4
- * 미리 빌드된 Rust 바이너리를 GitHub Releases(또는 R2)에서 다운로드합니다.
2
+ * install.js — postinstall script
3
+ * Runs automatically right after `npm install`. Downloads the prebuilt Rust
4
+ * binary matching the user's OS/architecture from GitHub Releases (or R2).
5
5
  */
6
6
  const os = require('os');
7
7
  const fs = require('fs');
@@ -32,23 +32,23 @@ async function main() {
32
32
  const target = getPlatformTarget();
33
33
 
34
34
  if (!target) {
35
- console.log(`⚠️ xkat-agent: 지원하지 않는 플랫폼입니다 (${os.platform()}-${os.arch()})`);
36
- console.log(' 수동 빌드: cd apps/xkat-agent && cargo build --release');
35
+ console.log(`⚠️ xkat-agent: unsupported platform (${os.platform()}-${os.arch()})`);
36
+ console.log(' Build manually: cd apps/xkat-agent && cargo build --release');
37
37
  return;
38
38
  }
39
39
 
40
40
  const binDir = path.join(__dirname, '..', 'binaries');
41
41
  const destPath = path.join(binDir, target);
42
42
 
43
- // 이미 다운로드 되어 있으면 스킵
43
+ // Skip if already downloaded
44
44
  if (fs.existsSync(destPath)) {
45
- console.log(`✅ xkat-agent 바이너리가 이미 존재합니다: ${target}`);
45
+ console.log(`✅ xkat-agent binary already present: ${target}`);
46
46
  return;
47
47
  }
48
48
 
49
- console.log(`📥 xkat-agent 다운로드 중... (${target})`);
49
+ console.log(`📥 Downloading xkat-agent... (${target})`);
50
50
 
51
- // binaries 디렉토리 생성
51
+ // Create the binaries directory
52
52
  if (!fs.existsSync(binDir)) {
53
53
  fs.mkdirSync(binDir, { recursive: true });
54
54
  }
@@ -57,14 +57,14 @@ async function main() {
57
57
 
58
58
  try {
59
59
  await downloadFile(url, destPath);
60
- // 실행 권한 부여 (Unix 환경에서만)
60
+ // Grant execute permission (Unix only)
61
61
  if (os.platform() !== 'win32') {
62
62
  fs.chmodSync(destPath, 0o755);
63
63
  }
64
- console.log(`✅ 설치 완료! 실행: xkat up`);
64
+ console.log(`✅ Installed! Run: xkat up`);
65
65
  } catch (err) {
66
- console.log(`⚠️ 바이너리 다운로드 실패: ${err.message}`);
67
- console.log(' 로컬에서 직접 빌드하려면: cd apps/xkat-agent && cargo build --release');
66
+ console.log(`⚠️ Binary download failed: ${err.message}`);
67
+ console.log(' To build locally: cd apps/xkat-agent && cargo build --release');
68
68
  }
69
69
  }
70
70
 
@@ -72,7 +72,7 @@ function downloadFile(url, dest) {
72
72
  return new Promise((resolve, reject) => {
73
73
  const file = fs.createWriteStream(dest);
74
74
  https.get(url, (response) => {
75
- // GitHub Releases 302 리다이렉트를 씀
75
+ // GitHub Releases use 302 redirects
76
76
  if (response.statusCode === 302 || response.statusCode === 301) {
77
77
  https.get(response.headers.location, (redirected) => {
78
78
  redirected.pipe(file);