@nahisaho/katashiro 2.0.4 → 2.0.6

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 (2) hide show
  1. package/package.json +15 -15
  2. package/scripts/postinstall.js +22 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nahisaho/katashiro",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "KATASHIRO - VS Code Agent Mode向け情報収集・分析・生成システム(オールインワンパッケージ)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -108,20 +108,20 @@
108
108
  "url": "https://github.com/nahisaho/katashiro/issues"
109
109
  },
110
110
  "dependencies": {
111
- "@nahisaho/katashiro-analyzer": "^2.0.3",
112
- "@nahisaho/katashiro-collector": "^2.0.3",
113
- "@nahisaho/katashiro-core": "^2.0.3",
114
- "@nahisaho/katashiro-evaluation": "^2.0.3",
115
- "@nahisaho/katashiro-feedback": "^2.0.3",
116
- "@nahisaho/katashiro-generator": "^2.0.3",
117
- "@nahisaho/katashiro-knowledge": "^2.0.3",
118
- "@nahisaho/katashiro-llm": "^2.0.3",
119
- "@nahisaho/katashiro-observability": "^2.0.3",
120
- "@nahisaho/katashiro-orchestrator": "^2.0.3",
121
- "@nahisaho/katashiro-rag": "^2.0.3",
122
- "@nahisaho/katashiro-sandbox": "^2.0.3",
123
- "@nahisaho/katashiro-security": "^2.0.3",
124
- "@nahisaho/katashiro-workspace": "^2.0.3",
111
+ "@nahisaho/katashiro-analyzer": "^2.0.5",
112
+ "@nahisaho/katashiro-collector": "^2.0.5",
113
+ "@nahisaho/katashiro-core": "^2.0.5",
114
+ "@nahisaho/katashiro-evaluation": "^2.0.5",
115
+ "@nahisaho/katashiro-feedback": "^2.0.5",
116
+ "@nahisaho/katashiro-generator": "^2.0.5",
117
+ "@nahisaho/katashiro-knowledge": "^2.0.5",
118
+ "@nahisaho/katashiro-llm": "^2.0.5",
119
+ "@nahisaho/katashiro-observability": "^2.0.5",
120
+ "@nahisaho/katashiro-orchestrator": "^2.0.5",
121
+ "@nahisaho/katashiro-rag": "^2.0.5",
122
+ "@nahisaho/katashiro-sandbox": "^2.0.5",
123
+ "@nahisaho/katashiro-security": "^2.0.5",
124
+ "@nahisaho/katashiro-workspace": "^2.0.5",
125
125
  "commander": "^12.1.0"
126
126
  },
127
127
  "engines": {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * postinstall script - AGENTS.md, CLAUDE.md, .github をプロジェクトルートにコピー
4
+ * postinstall script - AGENTS.md, CLAUDE.md, .github をカレントディレクトリにコピー
5
5
  */
6
6
 
7
7
  import { promises as fs } from 'fs';
@@ -14,8 +14,8 @@ const __dirname = dirname(__filename);
14
14
  // パッケージのルートディレクトリ
15
15
  const packageRoot = resolve(__dirname, '..');
16
16
 
17
- // インストール先のプロジェクトルート(node_modulesの2つ上)
18
- const projectRoot = resolve(packageRoot, '..', '..', '..');
17
+ // npm install を実行したカレントディレクトリ
18
+ const projectRoot = process.cwd();
19
19
 
20
20
  // コピーするファイル/ディレクトリ
21
21
  const filesToCopy = [
@@ -26,6 +26,14 @@ const filesToCopy = [
26
26
 
27
27
  async function copyFile(src, dest) {
28
28
  try {
29
+ // ソースファイルが存在するか確認
30
+ try {
31
+ await fs.access(src);
32
+ } catch {
33
+ console.error(` [error] Source not found: ${src}`);
34
+ return;
35
+ }
36
+
29
37
  // ディレクトリが存在しない場合は作成
30
38
  const destDir = dirname(dest);
31
39
  await fs.mkdir(destDir, { recursive: true });
@@ -44,18 +52,20 @@ async function copyFile(src, dest) {
44
52
  }
45
53
 
46
54
  async function main() {
47
- // npm install が実行されているか確認(CI環境やパッケージ開発時はスキップ)
48
- const isNpmInstall = process.env.npm_lifecycle_event === 'postinstall';
55
+ // CI環境ではスキップ
49
56
  const isCi = process.env.CI === 'true';
57
+ if (isCi) {
58
+ return;
59
+ }
50
60
 
51
- // パッケージ自体の開発時はスキップ
52
- const isPackageDev = projectRoot.includes('packages/katashiro');
53
-
54
- if (!isNpmInstall || isCi || isPackageDev) {
61
+ // 自分自身のパッケージ開発中はスキップ(カレントディレクトリがpackageRoot内)
62
+ if (projectRoot.startsWith(packageRoot) || packageRoot.startsWith(projectRoot + '/packages')) {
63
+ console.log('📦 KATASHIRO: Skipping postinstall (development mode)');
55
64
  return;
56
65
  }
57
66
 
58
- console.log('\n📦 KATASHIRO: Setting up agent configuration files...\n');
67
+ console.log('📦 KATASHIRO: Setting up agent configuration files...');
68
+ console.log(` Target: ${projectRoot}`);
59
69
 
60
70
  for (const file of filesToCopy) {
61
71
  const src = join(packageRoot, file);
@@ -63,10 +73,10 @@ async function main() {
63
73
  await copyFile(src, dest);
64
74
  }
65
75
 
66
- console.log('\n✅ KATASHIRO setup complete!\n');
76
+ console.log('✅ KATASHIRO setup complete!');
67
77
  console.log(' - AGENTS.md: AI agent instructions');
68
78
  console.log(' - CLAUDE.md: Claude-specific guide');
69
- console.log(' - .github/copilot-skills.json: VS Code Copilot skills\n');
79
+ console.log(' - .github/copilot-skills.json: VS Code Copilot skills');
70
80
  }
71
81
 
72
82
  main().catch(console.error);