@musashishao/agent-kit 1.4.0 → 1.4.1

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.
@@ -179,17 +179,25 @@ def cmd_init(args: argparse.Namespace) -> int:
179
179
  print(f"\n[{steps_completed + 1}/{total_steps}] Generating dependency graph...")
180
180
  graph_script = kit_path / "skills" / "graph-mapper" / "scripts" / "generate_graph.py"
181
181
 
182
- src_dir = project_root / "src"
183
- if not src_dir.exists():
184
- src_dir = project_root / "app"
182
+ # Smart source detection
183
+ src_dir = None
184
+ for folder in ["src", "app", "lib", "scripts", "components", "docs"]:
185
+ if (project_root / folder).exists():
186
+ src_dir = project_root / folder
187
+ break
185
188
 
186
- if src_dir.exists() and graph_script.exists():
189
+ if src_dir is None:
190
+ # Fallback to project root
191
+ src_dir = project_root
192
+
193
+ if graph_script.exists():
187
194
  result = subprocess.run(
188
195
  [
189
196
  "python3", str(graph_script),
190
197
  "--src", str(src_dir),
191
198
  "--output", str(agent_dir / "graph.json"),
192
199
  "--format", "both",
200
+ "--lang", "universal",
193
201
  ],
194
202
  capture_output=True,
195
203
  text=True,
@@ -199,7 +207,7 @@ def cmd_init(args: argparse.Namespace) -> int:
199
207
  else:
200
208
  print(" ⚠️ No source code found or script failed")
201
209
  else:
202
- print(" ⚠️ No src/ or app/ directory found, skipping")
210
+ print(" ⚠️ Graph script not found, skipping")
203
211
  steps_completed += 1
204
212
 
205
213
  # Step 5: Configure AI hosts
@@ -260,18 +268,25 @@ def cmd_init(args: argparse.Namespace) -> int:
260
268
 
261
269
  def find_source_dir(project_root: Path) -> Path:
262
270
  """Intelligently find the source directory."""
263
- # Priority defaults
271
+ # Priority folders
264
272
  for folder in ["src", "app", "lib", "scripts", "components"]:
265
273
  if (project_root / folder).exists():
266
274
  return project_root / folder
267
275
 
268
- # Fallback to root if there are source files in root
269
- source_extensions = {".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".c", ".cpp", ".cs"}
276
+ # Check if there are source files in root
277
+ source_extensions = {".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".c", ".cpp", ".cs", ".md"}
278
+ has_source_files = False
270
279
  for item in project_root.iterdir():
271
280
  if item.is_file() and item.suffix in source_extensions:
272
- return project_root
273
-
274
- return project_root / "src" # Ultimate fallback
281
+ has_source_files = True
282
+ break
283
+
284
+ # Check for docs folder
285
+ if (project_root / "docs").exists():
286
+ return project_root / "docs"
287
+
288
+ # Fallback: use project root if it has any content, otherwise return root anyway
289
+ return project_root
275
290
 
276
291
 
277
292
  def cmd_sync(args: argparse.Namespace) -> int:
@@ -308,7 +323,7 @@ def cmd_sync(args: argparse.Namespace) -> int:
308
323
  if not graph_script.exists():
309
324
  print(f" ❌ Graph script not found at: {graph_script}")
310
325
  success = False
311
- elif not src_dir.exists() and src_dir != project_root:
326
+ elif not src_dir.exists():
312
327
  print(f" ⚠️ Source directory {src_dir} not found")
313
328
  else:
314
329
  result = subprocess.run(
@@ -317,6 +332,7 @@ def cmd_sync(args: argparse.Namespace) -> int:
317
332
  "--src", str(src_dir),
318
333
  "--output", str(agent_dir / "graph.json"),
319
334
  "--format", "both",
335
+ "--lang", "universal",
320
336
  ],
321
337
  capture_output=True,
322
338
  text=True,
@@ -335,12 +351,15 @@ def cmd_sync(args: argparse.Namespace) -> int:
335
351
  if not rag_script.exists():
336
352
  print(f" ❌ RAG script not found at: {rag_script}")
337
353
  success = False
354
+ elif not src_dir.exists():
355
+ print(f" ⚠️ Source directory {src_dir} not found")
338
356
  else:
339
357
  result = subprocess.run(
340
358
  [
341
359
  "python3", str(rag_script),
342
360
  "--src", str(src_dir),
343
361
  "--output", str(agent_dir / "rag" / "chunks.json"),
362
+ "--lang", "universal",
344
363
  ],
345
364
  capture_output=True,
346
365
  text=True,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@musashishao/agent-kit",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "AI Agent templates - Skills, Agents, Workflows, and AI-Ready Data Infrastructure Gateway",
5
5
  "main": "index.js",
6
6
  "bin": {