@helpfeel/cosense-cli 1.14.2 → 1.15.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpfeel/cosense-cli",
3
- "version": "1.14.2",
3
+ "version": "1.15.0",
4
4
  "description": "Cosense (旧Scrapbox) のページを読み・調べ・編集するAgent Skillのハーネス",
5
5
  "homepage": "https://github.com/helpfeel/cosense-cli",
6
6
  "license": "MIT",
@@ -24,13 +24,13 @@
24
24
  "format": "oxfmt"
25
25
  },
26
26
  "dependencies": {
27
- "tsx": "4.23.12"
27
+ "tsx": "4.23.13"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "24.13.3",
31
31
  "npm-run-all": "4.1.5",
32
- "oxfmt": "0.64.0",
33
- "oxlint": "1.79.0",
32
+ "oxfmt": "0.65.0",
33
+ "oxlint": "1.80.0",
34
34
  "typescript": "7.0.2"
35
35
  },
36
36
  "engines": {
@@ -48,11 +48,14 @@ stdinから受け取る入力形式(既存ページ編集モード, JSON):
48
48
 
49
49
  戻り値(plain text):
50
50
  previewId / expireAt / status (create or update) / project / title / commitId のヘッダー +
51
- ops summary + 適用後 page 全体。
51
+ ops summary + 適用後 page 全体 + 変更行の内部リンク一覧。
52
52
  commitId は preview を作った時点の編集対象ページの最新コミット。 新規作成 (status: create)
53
53
  では出力されない。
54
54
  変更行の頭には > (新規) または * (更新) のマーカーと末尾 # <lineId> が付く。
55
55
  既存行(変更なし)はマーカーなし。
56
+ 末尾の internal links in changed lines: は、 この変更で書き換えた行と、 変更の影響でリンク記法
57
+ として解釈されるようになった既存行から張られる内部リンクの接続先を、 重複を除いて列挙する。
58
+ [title] と #tag は title、 [/project/title] は /project/title の形。 1件も無ければ (none)。
56
59
  preview は dry-run なのでこの段階ではpage URLは確定しない。 確定URLは submitEdit の出力で確認する。
57
60
  previewId は submitEdit に渡して commit を確定する。5分で expire する。
58
61
 
@@ -108,6 +111,7 @@ interface PreviewResponse {
108
111
  previewId: string;
109
112
  expireAt: string;
110
113
  pagePreview: PagePreview | null;
114
+ changedLinks?: string[];
111
115
  }
112
116
 
113
117
  const newLineId = (): string => randomBytes(12).toString('hex');
@@ -235,6 +239,17 @@ const formatPreview = (
235
239
  lines.push(` ${line.text}`);
236
240
  }
237
241
  }
242
+ // changedLinksはサーバーが対応している場合のみ返る
243
+ if (Array.isArray(response.changedLinks)) {
244
+ lines.push('');
245
+ lines.push('internal links in changed lines:');
246
+ if (response.changedLinks.length === 0) {
247
+ lines.push(' (none)');
248
+ }
249
+ for (const link of response.changedLinks) {
250
+ lines.push(` ${link}`);
251
+ }
252
+ }
238
253
  return lines.join('\n');
239
254
  };
240
255