@nahisaho/katashiro 2.1.2 → 2.2.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.
Files changed (3) hide show
  1. package/AGENTS.md +69 -0
  2. package/package.json +7 -7
  3. package/LICENSE +0 -21
package/AGENTS.md CHANGED
@@ -26,6 +26,75 @@
26
26
 
27
27
  ---
28
28
 
29
+ ## ⚠️ 重要: TypeScriptコード生成・実行ワークフロー
30
+
31
+ DeepResearchやその他の機能でTypeScriptコードを生成・実行する際は、**必ず以下のワークフローに従ってください**。
32
+
33
+ ### 必須ワークフロー
34
+
35
+ ```
36
+ 1. コード生成
37
+
38
+ 2. TypeScript型チェック(tsc --noEmit)
39
+
40
+ 3. エラーがあれば修正
41
+
42
+ 4. 実行
43
+ ```
44
+
45
+ ### 実行前チェックリスト
46
+
47
+ 生成したTypeScriptコードを実行する前に、以下を確認してください:
48
+
49
+ #### 1. Result型APIのチェック
50
+ ```typescript
51
+ // ❌ 間違い - WebScraper.scrape()はResult型を返す
52
+ const page = await scraper.scrape(url);
53
+ console.log(page.content); // エラー!
54
+
55
+ // ✅ 正しい
56
+ const page = await scraper.scrape(url);
57
+ if (isOk(page)) {
58
+ console.log(page.value.content);
59
+ }
60
+ ```
61
+
62
+ #### 2. 直接値APIのチェック
63
+ ```typescript
64
+ // ❌ 間違い - TextAnalyzer.analyze()は直接オブジェクトを返す
65
+ const analysis = await analyzer.analyze(text);
66
+ if (isOk(analysis)) { // エラー!isOk()は不要
67
+ console.log(analysis.value.keywords);
68
+ }
69
+
70
+ // ✅ 正しい
71
+ const analysis = await analyzer.analyze(text);
72
+ console.log(analysis.keywords);
73
+ ```
74
+
75
+ #### 3. 型チェックコマンド
76
+ ```bash
77
+ # 生成したファイルの型チェック
78
+ npx tsc --noEmit your-script.ts
79
+
80
+ # エラーがあれば修正してから実行
81
+ npx tsx your-script.ts
82
+ ```
83
+
84
+ ### AIエージェントへの指示
85
+
86
+ **DeepResearch実行時のワークフロー**:
87
+
88
+ 1. **コード生成**: KATASHIROのAPIを使用してTypeScriptコードを生成
89
+ 2. **型チェック**: `npx tsc --noEmit` でコンパイルエラーをチェック
90
+ 3. **エラー修正**: 型エラーがあれば、このドキュメントの「戻り値の型について」セクションを参照して修正
91
+ 4. **実行**: エラーがなくなってから `npx tsx` で実行
92
+ 5. **結果確認**: 実行結果を確認し、必要に応じて修正
93
+
94
+ **重要**: 型チェックをスキップしてはいけません。Result型と直接値の混同は最も一般的なエラーです。
95
+
96
+ ---
97
+
29
98
  ## 🔄 課題解決ワークフロー
30
99
 
31
100
  ### ステップ1: 課題の分析
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/katashiro",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "KATASHIRO - VS Code Agent Mode向け情報収集・分析・生成システム(オールインワンパッケージ)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -114,6 +114,11 @@
114
114
  "default": "./dist/workspace.js"
115
115
  }
116
116
  },
117
+ "scripts": {
118
+ "build": "tsc",
119
+ "test": "echo \"No tests for meta package\"",
120
+ "postinstall": "node scripts/postinstall.js"
121
+ },
117
122
  "keywords": [
118
123
  "katashiro",
119
124
  "vscode",
@@ -157,10 +162,5 @@
157
162
  },
158
163
  "engines": {
159
164
  "node": ">=20.0.0"
160
- },
161
- "scripts": {
162
- "build": "tsc",
163
- "test": "echo \"No tests for meta package\"",
164
- "postinstall": "node scripts/postinstall.js"
165
165
  }
166
- }
166
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 nahisaho
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.