chat-relink 0.1.3 → 0.1.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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project are documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.4] - 2026-12-06
10
+
11
+ ### Fixed
12
+ - Option errors (missing value, unknown option, value given to a flag) are now translated; `--lang ko` no longer shows Node's English text after "사용법 오류:".
13
+
7
14
  ## [0.1.3] - 2026-11-23
8
15
 
9
16
  ### Changed
package/README.ko.md CHANGED
@@ -7,7 +7,7 @@ Chat Relink 는 프로젝트 폴더 이름을 바꾸거나 옮기거나 다시
7
7
  ![연습 데모: 스캔, 미리보기, dry-run, VS Code 실행 중 보호, 재연결, 검증, 되돌리기](docs/images/01-demo.ko.png)
8
8
  *`npm start` 는 합성 연습용 데이터로 전체 흐름을 실행합니다. 내 VS Code 데이터는 읽지 않습니다.*
9
9
 
10
- > **솔직한 현재 상태 (v0.1.3).** 테스트는 모두 합성 데이터와 `vscode` API 목(mock)으로 돌렸습니다. 확장은 **실제 VS Code 안에서 실행해 보지 못했고**, CLI 도 macOS 에서만 실행했습니다. 소중한 데이터에 쓰기 전에 [지원 레이아웃과 한계](#지원-레이아웃과-한계)를 읽어 주세요. CLI 는 `--apply` 없이는 아무것도 바꾸지 않고, 바꾸기 전에 항상 백업합니다.
10
+ > **솔직한 현재 상태 (v0.1.4).** 테스트는 모두 합성 데이터와 `vscode` API 목(mock)으로 돌렸습니다. 확장은 **실제 VS Code 안에서 실행해 보지 못했고**, CLI 도 macOS 에서만 실행했습니다. 소중한 데이터에 쓰기 전에 [지원 레이아웃과 한계](#지원-레이아웃과-한계)를 읽어 주세요. CLI 는 `--apply` 없이는 아무것도 바꾸지 않고, 바꾸기 전에 항상 백업합니다.
11
11
 
12
12
  ## 무엇을 해 주나요
13
13
 
@@ -44,7 +44,7 @@ npm run build
44
44
 
45
45
  ```bash
46
46
  npm run package # 릴리스 단계: npx 로 @vscode/vsce@4.1.1 을 받으므로 네트워크 필요
47
- code --install-extension chat-relink-0.1.3.vsix
47
+ code --install-extension chat-relink-0.1.4.vsix
48
48
  ```
49
49
 
50
50
  ## 빠르게 시작하기
@@ -129,7 +129,7 @@ chat-relink relink --from shop-api --to ~/code/shop-api-v2 --apply # 실제로
129
129
  |---|---|
130
130
  | `chat-relink export --from <칸\|경로> --out <폴더>` | 공식 `Chat: Import Chat...` 용으로 세션마다 JSON 하나를 씁니다. 채팅에 붙여 넣은 비밀 값이 들어 있을 수 있으니 채팅 자체처럼 다루세요. |
131
131
  | `chat-relink demo [--keep]` | 연습 데모. `--keep` 은 합성 폴더를 남겨 다른 명령을 시험해 볼 수 있게 합니다. |
132
- | `chat-relink --version` / `--help` | `0.1.3` / 사용법을 출력합니다. |
132
+ | `chat-relink --version` / `--help` | `0.1.4` / 사용법을 출력합니다. |
133
133
 
134
134
  종료 코드: 0 성공, 1 실패, 2 사용법 오류, 3 VS Code 실행 중, 4 검증 실패(되돌림), 5 대상 칸 없음.
135
135
 
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Chat Relink
2
2
 
3
- **English** | [한국어](https://github.com/LeeGyeongPil/chat-relink/blob/v0.1.3/README.ko.md)
3
+ **English** | [한국어](https://github.com/LeeGyeongPil/chat-relink/blob/v0.1.4/README.ko.md)
4
4
 
5
5
  Chat Relink finds the VS Code chat sessions that vanished after you renamed, moved or re-cloned a project folder, lets you preview them, and relinks them to the new folder with a backup, a verification step and an undo. It ships as a small read-only VS Code extension plus a Node CLI that share one TypeScript core with zero runtime dependencies.
6
6
 
7
- ![Practice demo: scan, preview, dry run, running-VS-Code guard, relink, verify, undo](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/01-demo.png)
7
+ ![Practice demo: scan, preview, dry run, running-VS-Code guard, relink, verify, undo](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/01-demo.png)
8
8
  *`npm start` runs the whole flow on a synthetic practice fixture. Your own VS Code data is not read.*
9
9
 
10
- > **Honest status (v0.1.3).** All tests run against synthetic data and a mocked `vscode` API. The extension has **not** been run inside a real VS Code, and the CLI has only been run on macOS. See [Supported layouts & limits](#supported-layouts--limits) before pointing it at data you care about. The CLI never changes anything without `--apply`, and it backs up first.
10
+ > **Honest status (v0.1.4).** All tests run against synthetic data and a mocked `vscode` API. The extension has **not** been run inside a real VS Code, and the CLI has only been run on macOS. See [Supported layouts & limits](#supported-layouts--limits) before pointing it at data you care about. The CLI never changes anything without `--apply`, and it backs up first.
11
11
 
12
12
  ## What it does
13
13
 
@@ -44,7 +44,7 @@ To try the extension, build a VSIX and install it (this step was packaged but **
44
44
 
45
45
  ```bash
46
46
  npm run package # release step: downloads @vscode/vsce@4.1.1 with npx, needs network
47
- code --install-extension chat-relink-0.1.3.vsix
47
+ code --install-extension chat-relink-0.1.4.vsix
48
48
  ```
49
49
 
50
50
  ## Quick start
@@ -83,34 +83,34 @@ The screenshots use the synthetic fixture from the demo: the folder `shop-api` w
83
83
 
84
84
  ### 1. Find orphans: `scan`
85
85
 
86
- ![scan output: one orphaned slot with 2 sessions, two skipped slots, one ok slot](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/02-scan.png)
86
+ ![scan output: one orphaned slot with 2 sessions, two skipped slots, one ok slot](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/02-scan.png)
87
87
  *Each row is one `workspaceStorage` slot. `orphan` means its folder is gone and it still holds chats. Remote and multi-root workspaces are skipped with a reason.*
88
88
 
89
89
  `--current <folder>` ranks the orphans by how well they match that folder (name match, plus files that exist in both folders).
90
90
 
91
91
  ### 2. Preview: `show`
92
92
 
93
- ![show output: two sessions with title, turns and date](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/03-show.png)
93
+ ![show output: two sessions with title, turns and date](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/03-show.png)
94
94
  *Check titles, turns and dates before copying. A legacy `.json` file with the same id as a `.jsonl` is noted, and the `.jsonl` is used.*
95
95
 
96
96
  ### 3. Plan: `relink` without `--apply`
97
97
 
98
- ![dry run: plan of 2 copies, nothing written](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/04-dry-run.png)
98
+ ![dry run: plan of 2 copies, nothing written](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/04-dry-run.png)
99
99
  *The dry run lists what would be copied and how many index entries the target would have. Nothing is written.*
100
100
 
101
101
  ### 4. Apply: `relink --apply`
102
102
 
103
- ![apply: relinked 2 sessions, backup path, integrity ok, journal path](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/05-apply.png)
103
+ ![apply: relinked 2 sessions, backup path, integrity ok, journal path](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/05-apply.png)
104
104
  *A backup (`VACUUM INTO`) and a journal are written first. After the copy and the index update, the tool checks `PRAGMA integrity_check`, re-parses the index and confirms the files exist. A failed check rolls everything back (exit code 4).*
105
105
 
106
106
  ### 5. Refusing to write while VS Code runs
107
107
 
108
- ![guard: relink refuses with exit code 3 because code.lock holds a live PID](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/06-guard.png)
108
+ ![guard: relink refuses with exit code 3 because code.lock holds a live PID](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/06-guard.png)
109
109
  *If `code.lock` holds a live process id, the CLI stops with exit code 3 and writes nothing.*
110
110
 
111
111
  ### 6. Undo: `undo <journal>`
112
112
 
113
- ![undo: database restored, files and index entries removed](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.3/docs/images/07-undo.png)
113
+ ![undo: database restored, files and index entries removed](https://raw.githubusercontent.com/LeeGyeongPil/chat-relink/v0.1.4/docs/images/07-undo.png)
114
114
  *The journal path was printed by `--apply`. Undo restores the database, or, if VS Code saved new chats in between, removes only the entries it added.*
115
115
 
116
116
  ### In VS Code
@@ -129,7 +129,7 @@ I could not capture screenshots of the extension because no real VS Code was ava
129
129
  |---|---|
130
130
  | `chat-relink export --from <slot\|path> --out <dir>` | Writes one JSON per session for the official `Chat: Import Chat...`. Exported files can contain secrets that were pasted into chats, so treat them like the chats themselves. |
131
131
  | `chat-relink demo [--keep]` | The practice demo. `--keep` leaves the synthetic folder so you can try the other commands on it. |
132
- | `chat-relink --version` / `--help` | Prints `0.1.3` / the usage. |
132
+ | `chat-relink --version` / `--help` | Prints `0.1.4` / the usage. |
133
133
 
134
134
  Exit codes: 0 ok, 1 failure, 2 usage, 3 VS Code is running, 4 verification failed (rolled back), 5 target slot not found.
135
135
 
@@ -214,7 +214,7 @@ npm run build
214
214
  npm start # build, then the practice demo
215
215
  ```
216
216
 
217
- CI is one Ubuntu 24.04 job on Node 24: `npm ci`, `npm run typecheck`, `npm test` (all offline). Node 22.13, the engines floor, was checked locally only. Changes are listed in [CHANGELOG.md](https://github.com/LeeGyeongPil/chat-relink/blob/v0.1.3/CHANGELOG.md).
217
+ CI is one Ubuntu 24.04 job on Node 24: `npm ci`, `npm run typecheck`, `npm test` (all offline). Node 22.13, the engines floor, was checked locally only. Changes are listed in [CHANGELOG.md](https://github.com/LeeGyeongPil/chat-relink/blob/v0.1.4/CHANGELOG.md).
218
218
 
219
219
  ## License
220
220
 
package/dist/cli/index.js CHANGED
@@ -18,7 +18,7 @@ const workspaceId_1 = require("../core/workspaceId");
18
18
  const messages_1 = require("../i18n/messages");
19
19
  const msg_1 = require("../core/msg");
20
20
  const demo_1 = require("./demo");
21
- const VERSION = '0.1.3';
21
+ const VERSION = '0.1.4';
22
22
  /** Absolute path with symlinks resolved (macOS /tmp is /private/tmp); plain resolve when it does not exist. */
23
23
  function realPath(p) {
24
24
  const abs = node_path_1.default.resolve(p);
@@ -83,6 +83,22 @@ async function run(argv, io, env = process.env, deps = {}) {
83
83
  },
84
84
  });
85
85
  }
86
+ /** Turn a parseArgs error into a translated sentence; unknown codes or unparsable messages fall back to the raw text. */
87
+ const parseErrorDetail = (e) => {
88
+ const message = e instanceof Error ? e.message : String(e);
89
+ const code = e?.code;
90
+ const name = /'(-{1,2}[^\s'=]+)/.exec(message)?.[1];
91
+ if (name === undefined)
92
+ return message;
93
+ if (code === 'ERR_PARSE_ARGS_UNKNOWN_OPTION')
94
+ return m('error.unknownOption', { name });
95
+ if (code === 'ERR_PARSE_ARGS_INVALID_OPTION_VALUE') {
96
+ return /does not take an argument/.test(message)
97
+ ? m('error.optionTakesNoValue', { name })
98
+ : m('error.optionNeedsValue', { name });
99
+ }
100
+ return message;
101
+ };
86
102
  const usage = (detail) => {
87
103
  io.err(m('error.usage', { detail }));
88
104
  return relink_1.EXIT.usage;
@@ -91,7 +107,7 @@ async function run(argv, io, env = process.env, deps = {}) {
91
107
  parsed = parse();
92
108
  }
93
109
  catch (e) {
94
- return usage(e.message);
110
+ return usage(parseErrorDetail(e));
95
111
  }
96
112
  const { values, positionals } = parsed;
97
113
  if (values.lang !== undefined && !(0, messages_1.isLang)(values.lang))
package/dist/i18n/en.js CHANGED
@@ -34,6 +34,9 @@ Exit codes: 0 ok, 1 failure, 2 usage, 3 VS Code is running, 4 verification faile
34
34
  'error.missingCommand': 'no command given',
35
35
  'error.missingOption': 'missing option --{name}',
36
36
  'error.missingArgument': '"{command}" needs an argument: {what}',
37
+ 'error.unknownOption': "unknown option '{name}'",
38
+ 'error.optionNeedsValue': "option '{name}' needs a value",
39
+ 'error.optionTakesNoValue': "option '{name}' does not take a value",
37
40
  'error.badOption': '{detail}',
38
41
  'error.badProduct': 'unknown product "{product}" (use code, insiders, vscodium or cursor)',
39
42
  'error.badLang': 'unknown language "{lang}" (use en or ko)',
package/dist/i18n/ko.js CHANGED
@@ -34,6 +34,9 @@ exports.ko = {
34
34
  'error.missingCommand': '명령이 없습니다',
35
35
  'error.missingOption': '--{name} 옵션이 없습니다',
36
36
  'error.missingArgument': '"{command}" 에는 인자가 필요합니다: {what}',
37
+ 'error.unknownOption': "알 수 없는 옵션 '{name}'",
38
+ 'error.optionNeedsValue': "'{name}' 옵션에 값이 없습니다",
39
+ 'error.optionTakesNoValue': "'{name}' 옵션은 값을 받지 않습니다",
37
40
  'error.badOption': '{detail}',
38
41
  'error.badProduct': '알 수 없는 제품 "{product}" (code, insiders, vscodium, cursor 중 하나)',
39
42
  'error.badLang': '알 수 없는 언어 "{lang}" (en 또는 ko)',
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "chat-relink",
3
3
  "displayName": "Chat Relink",
4
4
  "description": "Find VS Code chat sessions orphaned by a renamed, moved or re-cloned folder, preview them, and relink them safely.",
5
- "version": "0.1.3",
5
+ "version": "0.1.4",
6
6
  "license": "MIT",
7
7
  "publisher": "leegyeongpil",
8
8
  "type": "commonjs",