@musashishao/agent-kit 1.11.1 → 1.11.3

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.
@@ -43,7 +43,7 @@ def get_platform_info() -> Dict[str, Path]:
43
43
  "vscode_config": home / ".vscode/mcp.json",
44
44
  "agent_kit_config": cwd / ".agent/mcp/config/mcp-config.json",
45
45
  "antigravity_config": home / ".gemini/antigravity/mcp_config.json",
46
- "codex_config": home / ".codex/mcp_config.json",
46
+ "codex_config": home / ".codex/config.toml", # Codex uses TOML format
47
47
  "python_exe": "python",
48
48
  "pip_exe": "pip",
49
49
  }
@@ -56,7 +56,7 @@ def get_platform_info() -> Dict[str, Path]:
56
56
  "vscode_config": home / ".vscode/mcp.json",
57
57
  "agent_kit_config": cwd / ".agent/mcp/config/mcp-config.json",
58
58
  "antigravity_config": Path(os.environ.get("LOCALAPPDATA", home)) / "Google/Antigravity/mcp_config.json",
59
- "codex_config": Path(os.environ.get("LOCALAPPDATA", home)) / "Codex/mcp_config.json",
59
+ "codex_config": Path(os.environ.get("LOCALAPPDATA", home)) / "Codex/config.toml", # Codex uses TOML
60
60
  "python_exe": "python.exe",
61
61
  "pip_exe": "pip.exe",
62
62
  }
@@ -159,10 +159,28 @@ def install_package(python_path: str) -> bool:
159
159
 
160
160
  def get_wrapper_path() -> Optional[str]:
161
161
  """Get absolute path to wrapper script."""
162
- wrapper_path = Path.cwd() / WRAPPER_SCRIPT_REL
162
+ # Search in multiple locations
163
+ search_paths = [
164
+ # 1. Project's installed .agent folder
165
+ Path.cwd() / WRAPPER_SCRIPT_REL,
166
+ # 2. Package source (when running from node_modules or repo)
167
+ Path(__file__).parent.parent / "mcp" / "servers" / "notebooklm" / "run_notebooklm_mcp.py",
168
+ # 3. Alongside this script's .agent folder
169
+ Path(__file__).parent.parent.parent / WRAPPER_SCRIPT_REL,
170
+ ]
171
+
172
+ wrapper_path = None
173
+ for path in search_paths:
174
+ if path.exists():
175
+ wrapper_path = path
176
+ break
163
177
 
164
- if not wrapper_path.exists():
165
- print(f"❌ Không tìm thấy wrapper script tại: {wrapper_path}")
178
+ if not wrapper_path:
179
+ print(f"❌ Không tìm thấy wrapper script.")
180
+ print(f" Đã tìm tại:")
181
+ for p in search_paths:
182
+ print(f" - {p}")
183
+ print(f"\n Hãy chạy 'npx @musashishao/agent-kit init' trước.")
166
184
  return None
167
185
 
168
186
  # Make executable on Unix
@@ -172,7 +190,7 @@ def get_wrapper_path() -> Optional[str]:
172
190
  except Exception:
173
191
  pass
174
192
 
175
- return str(wrapper_path)
193
+ return str(wrapper_path.resolve())
176
194
 
177
195
 
178
196
  def select_profile() -> str:
@@ -231,6 +249,65 @@ def update_json_config(file_path: Path, server_name: str, config_data: Dict) ->
231
249
  return False
232
250
 
233
251
 
252
+ def update_toml_config(file_path: Path, server_name: str, python_path: str, wrapper_path: str, profile: str) -> bool:
253
+ """Update a TOML config file with server config (for Codex CLI)."""
254
+ try:
255
+ file_path.parent.mkdir(parents=True, exist_ok=True)
256
+
257
+ # Read existing content
258
+ lines = []
259
+ if file_path.exists():
260
+ with open(file_path, 'r', encoding='utf-8') as f:
261
+ lines = f.readlines()
262
+
263
+ # Check if server already exists
264
+ server_header = f'[mcp_servers.{server_name}]'
265
+ server_exists = any(server_header in line for line in lines)
266
+
267
+ if server_exists:
268
+ # Remove existing server config
269
+ new_lines = []
270
+ skip_section = False
271
+ for line in lines:
272
+ if server_header in line:
273
+ skip_section = True
274
+ continue
275
+ elif skip_section and line.strip().startswith('['):
276
+ skip_section = False
277
+
278
+ if not skip_section:
279
+ new_lines.append(line)
280
+ lines = new_lines
281
+
282
+ # Build TOML config for server
283
+ # Escape backslashes for Windows paths
284
+ py_path_escaped = python_path.replace('\\', '\\\\')
285
+ wrapper_escaped = wrapper_path.replace('\\', '\\\\')
286
+
287
+ toml_config = f'''
288
+ [mcp_servers.{server_name}]
289
+ command = "{py_path_escaped}"
290
+ args = ["-u", "-W", "ignore", "{wrapper_escaped}"]
291
+ env = {{ "PYTHONUNBUFFERED" = "1", "PYTHONWARNINGS" = "ignore", "NOTEBOOKLM_PROFILE" = "{profile}" }}
292
+ startup_timeout_sec = 60
293
+ '''
294
+
295
+ # Append new config
296
+ content = ''.join(lines)
297
+ if not content.endswith('\n'):
298
+ content += '\n'
299
+ content += toml_config
300
+
301
+ with open(file_path, 'w', encoding='utf-8') as f:
302
+ f.write(content)
303
+
304
+ return True
305
+
306
+ except Exception as e:
307
+ print(f" ⚠️ Không thể cập nhật {file_path.name}: {e}")
308
+ return False
309
+
310
+
234
311
  def run_auth_check(python_path: str) -> bool:
235
312
  """Check if NotebookLM auth is configured."""
236
313
  try:
@@ -310,15 +387,15 @@ def main():
310
387
  # 8. Update client configs
311
388
  print("\n🔗 Đang cấu hình các app AI...")
312
389
 
313
- configs_to_update = [
390
+ # JSON-based configs
391
+ json_configs = [
314
392
  (platform_info["claude_config"], "notebooklm-mcp", "Claude"),
315
393
  (platform_info["cursor_config"], "notebooklm-mcp", "Cursor"),
316
394
  (platform_info["vscode_config"], "notebooklm-mcp", "VS Code"),
317
395
  (platform_info.get("antigravity_config"), "notebooklm", "Antigravity"),
318
- (platform_info.get("codex_config"), "notebooklm", "Codex"),
319
396
  ]
320
397
 
321
- for config_path, server_name, app_name in configs_to_update:
398
+ for config_path, server_name, app_name in json_configs:
322
399
  if not config_path:
323
400
  continue
324
401
  if update_json_config(config_path, server_name, server_config):
@@ -326,6 +403,14 @@ def main():
326
403
  else:
327
404
  print(f" ⚠️ {app_name} (bỏ qua)")
328
405
 
406
+ # TOML-based configs (Codex CLI)
407
+ codex_config = platform_info.get("codex_config")
408
+ if codex_config:
409
+ if update_toml_config(codex_config, "notebooklm", python_path, wrapper_path, profile):
410
+ print(f" ✅ Codex CLI")
411
+ else:
412
+ print(f" ⚠️ Codex CLI (bỏ qua)")
413
+
329
414
  # 9. Update Agent Kit config
330
415
  ak_config = platform_info["agent_kit_config"]
331
416
  if ak_config.exists():
@@ -6,6 +6,8 @@ description_vi: Xây dựng workflow cho AI Agent. Từ thiết kế hệ thốn
6
6
 
7
7
  # 🤖 /ai-agent - AI Agent Builder Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  This workflow guides you through designing and implementing sophisticated AI agents and multi-agent systems.
10
12
 
11
13
  ## 📋 Steps
@@ -6,6 +6,8 @@ description_vi: "Tạo Engineering Brief từ tài liệu thô qua NotebookLM. C
6
6
 
7
7
  # Engineering Brief Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Distill PRD documents, specs, and meeting notes into a concise Engineering Brief to inject into the Agent context.
10
12
 
11
13
  ---
@@ -6,6 +6,8 @@ description_en: "Initialize a new game project with Spec Ecosystem structure."
6
6
 
7
7
  # /gamekit.init - Game Project Initialization
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Initialize a new game project with the complete Spec Ecosystem documentation structure.
10
12
 
11
13
  ---
@@ -6,6 +6,8 @@ description_en: "Mobile game launch workflow. From pre-launch to App Store submi
6
6
 
7
7
  # /gamekit-launch - Mobile Game Launch Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Complete workflow to launch your mobile game to iOS App Store and Google Play.
10
12
 
11
13
  ---
@@ -6,6 +6,8 @@ description_en: "Generate implementation plan from approved game specification."
6
6
 
7
7
  # /gamekit.plan - Game Implementation Plan
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Generate a detailed implementation plan from an approved specification. Includes task breakdown, agent assignments, and file structure.
10
12
 
11
13
  ---
@@ -6,6 +6,8 @@ description_en: "Playtest and QA loop for iterative game refinement."
6
6
 
7
7
  # /gamekit-qa - Evaluative Loop (QA & Refinement)
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Playtest, collect feedback, and iteratively refine game feel and balance.
10
12
 
11
13
  > 💡 **Migrated from:** `/game-hybrid` Tier 3
@@ -6,6 +6,8 @@ description_en: "Create game specification with Explained Q&A for all stakeholde
6
6
 
7
7
  # /gamekit.spec - Game Specification Creation
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Create a comprehensive game specification using the Explained Q&A system. Designed for ALL stakeholders (Developer, PM, Designer).
10
12
 
11
13
  ---
@@ -6,6 +6,8 @@ description_en: "Generate executable task list from approved game plan."
6
6
 
7
7
  # /gamekit.tasks - Game Task List Generation
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Generate an executable task list with checkboxes, session tracking, and progress overview from an approved implementation plan.
10
12
 
11
13
  ---
@@ -5,6 +5,8 @@ description_vi: "Khởi tạo dự án mới với kiến trúc Generative UI. C
5
5
 
6
6
  # /generative-ui-init Workflow
7
7
 
8
+ $ARGUMENTS
9
+
8
10
  > **Purpose:** Scaffold a project optimized for Generative UI patterns (agent-driven, A2UI-ready).
9
11
 
10
12
  ---
@@ -6,6 +6,8 @@ description_vi: Workflow lập kế hoạch marketing tăng trưởng và chiế
6
6
 
7
7
  # 🚀 /marketing - Campaign Planning Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  This workflow guides you through the process of planning and executing a high-impact marketing campaign for your product.
10
12
 
11
13
  ## 📋 Steps
@@ -6,6 +6,8 @@ description_vi: Workflow kiểm thử xâm nhập và đánh giá bảo mật. P
6
6
 
7
7
  # 🕵️ /pentest - Security Audit Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  This workflow executes a systematic security assessment of your application or infrastructure.
10
12
 
11
13
  ## 📋 Steps
@@ -6,6 +6,8 @@ description_vi: "Workflow nghiên cứu sâu với NotebookLM. Quét web, phân
6
6
 
7
7
  # Deep Research Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  Use NotebookLM MCP to deeply research a topic, import sources, and synthesize insights.
10
12
 
11
13
  ---
@@ -6,6 +6,8 @@ description_vi: Workflow ra mắt sản phẩm SaaS. Từ trang landing page đ
6
6
 
7
7
  # 🚀 /saas - SaaS Launch Workflow
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  This workflow helps you turn a project into a recurring revenue business by integrating essential SaaS components.
10
12
 
11
13
  ## 📋 Steps
@@ -4,6 +4,8 @@ description: "Run Vibe Alignment Audit on a URL or local file. Uses Playwright t
4
4
 
5
5
  # /ui-verify - UI/UX Quality Verification
6
6
 
7
+ $ARGUMENTS
8
+
7
9
  Use this workflow to verify the visual quality of a UI before shipping.
8
10
 
9
11
  ---
@@ -5,6 +5,8 @@ description_vi: "Đánh giá thẩm mỹ và cảm xúc của một trang hoặc
5
5
 
6
6
  # /vibe-audit Workflow
7
7
 
8
+ $ARGUMENTS
9
+
8
10
  > **Purpose:** Audit any UI for "vibe" alignment and generate a quality report.
9
11
 
10
12
  ---
@@ -4,6 +4,8 @@ description: "Unified entry point for AI VibeCoding Game Ecosystem. Concept -> S
4
4
 
5
5
  # 🎸 /vibe-game Workflow
6
6
 
7
+ $ARGUMENTS
8
+
7
9
  This workflow activates the **Sage AI Game Conductor** to transform a creative idea into a professional game architecture.
8
10
 
9
11
  ## 🌊 Steps
package/bin/agent-kit CHANGED
@@ -18,6 +18,7 @@ const VERSION = packageJson.version;
18
18
 
19
19
  // Commands handled by cli.js (Node.js)
20
20
  const CLI_JS_COMMANDS = [
21
+ 'setup', // Full setup: init + NotebookLM + Codex sync
21
22
  'init',
22
23
  'update',
23
24
  'status',
@@ -46,7 +47,6 @@ const PYTHON_CLI_COMMANDS = [
46
47
  'setup-notion-mcp',
47
48
  'memory-sync',
48
49
  'notebooklm-status',
49
- 'setup',
50
50
  'install'
51
51
  ];
52
52
 
package/bin/cli.js CHANGED
@@ -35,6 +35,7 @@ const translations = {
35
35
  usage: 'Usage:',
36
36
  usageText: ` npx ${PACKAGE_NAME} <command> [options]`,
37
37
  commands: 'Commands:',
38
+ setup: '⭐ FULL SETUP: Install everything in one command',
38
39
  init: 'Install .agent folder into current project',
39
40
  ai: 'AI Infrastructure management (init, sync, status)',
40
41
  setupCodex: 'Sync workflows with Codex CLI slash commands',
@@ -164,6 +165,7 @@ ${colors.bright}${t.usage}${colors.reset}
164
165
  ${t.usageText}
165
166
 
166
167
  ${colors.bright}${t.commands}${colors.reset}
168
+ ${colors.bright}${colors.yellow}setup${colors.reset} ${t.setup || '⭐ Full setup: init + NotebookLM + Codex'}
167
169
  ${colors.cyan}init${colors.reset} ${t.init}
168
170
  ${colors.cyan}ai${colors.reset} ${t.ai}
169
171
  ${colors.cyan}setup-codex${colors.reset} ${t.setupCodex}
@@ -314,6 +316,92 @@ ${colors.bright}📚 Documentation:${colors.reset}
314
316
  }
315
317
  }
316
318
 
319
+ /**
320
+ * Setup command - Install everything in one go
321
+ * Runs: init + setup-notebooklm + setup-codex
322
+ */
323
+ function setupCommand(options) {
324
+ log.title('🚀 Agent Kit Full Setup');
325
+ console.log(`
326
+ ╔══════════════════════════════════════════════════════════════╗
327
+ ║ AGENT KIT - FULL INSTALLATION ║
328
+ ║ Cài đặt hoàn chỉnh chỉ với 1 lệnh duy nhất ║
329
+ ╚══════════════════════════════════════════════════════════════╝
330
+ `);
331
+
332
+ const steps = [
333
+ { name: 'Agent Kit Core', desc: 'Cài đặt .agent folder' },
334
+ { name: 'NotebookLM MCP', desc: 'Cài MCP server cho research' },
335
+ { name: 'Codex CLI', desc: 'Sync slash commands' }
336
+ ];
337
+
338
+ console.log(`${colors.bright}📋 Các bước sẽ thực hiện:${colors.reset}`);
339
+ steps.forEach((s, i) => {
340
+ console.log(` ${i + 1}. ${s.name} - ${s.desc}`);
341
+ });
342
+ console.log('');
343
+
344
+ // Step 1: Init (install .agent folder)
345
+ console.log(`\n${colors.bright}[1/3] Installing Agent Kit Core...${colors.reset}`);
346
+ try {
347
+ // Check if already exists
348
+ const agentDir = path.join(process.cwd(), '.agent');
349
+ if (fs.existsSync(agentDir) && !options.force) {
350
+ log.info('.agent folder already exists, skipping...');
351
+ } else {
352
+ initCommand({ ...options, quiet: true, force: options.force });
353
+ log.success('Agent Kit Core installed!');
354
+ }
355
+ } catch (e) {
356
+ log.error(`Init failed: ${e.message}`);
357
+ return;
358
+ }
359
+
360
+ // Step 2: Setup NotebookLM MCP
361
+ console.log(`\n${colors.bright}[2/3] Setting up NotebookLM MCP...${colors.reset}`);
362
+ try {
363
+ const scriptPath = path.join(process.cwd(), '.agent/scripts/setup_notebooklm_mcp.py');
364
+ if (fs.existsSync(scriptPath)) {
365
+ execSync(`python3 "${scriptPath}"`, { stdio: 'inherit' });
366
+ log.success('NotebookLM MCP configured!');
367
+ } else {
368
+ log.warn('NotebookLM setup script not found, skipping...');
369
+ }
370
+ } catch (e) {
371
+ log.warn(`NotebookLM setup skipped: ${e.message}`);
372
+ }
373
+
374
+ // Step 3: Setup Codex CLI
375
+ console.log(`\n${colors.bright}[3/3] Syncing with Codex CLI...${colors.reset}`);
376
+ try {
377
+ setupCodexCommand({ ...options, quiet: true });
378
+ log.success('Codex CLI synced!');
379
+ } catch (e) {
380
+ log.warn(`Codex sync skipped: ${e.message}`);
381
+ }
382
+
383
+ // Final summary
384
+ console.log(`
385
+ ╔══════════════════════════════════════════════════════════════╗
386
+ ║ 🎉 SETUP HOÀN TẤT! ║
387
+ ╚══════════════════════════════════════════════════════════════╝
388
+
389
+ ${colors.bright}📌 Bước tiếp theo:${colors.reset}
390
+ 1. Xác thực NotebookLM (nếu muốn dùng):
391
+ ${colors.cyan}notebooklm-mcp-auth${colors.reset}
392
+
393
+ 2. Restart AI tools của bạn (Codex, Cursor, Claude...)
394
+
395
+ 3. Bắt đầu sử dụng:
396
+ ${colors.cyan}/brainstorm${colors.reset} - Lên ý tưởng
397
+ ${colors.cyan}/create${colors.reset} - Tạo app mới
398
+ ${colors.cyan}/debug${colors.reset} - Fix lỗi
399
+
400
+ ${colors.bright}📚 Docs:${colors.reset} .agent/ARCHITECTURE.md
401
+ ${colors.bright}🆘 Help:${colors.reset} npx @musashishao/agent-kit doctor
402
+ `);
403
+ }
404
+
317
405
  function setupCodexCommand(options) {
318
406
  const lang = getSystemLanguage();
319
407
  const t = translations[lang] || translations.en;
@@ -1581,6 +1669,9 @@ if (templateIndex !== -1 && args[templateIndex + 1]) {
1581
1669
 
1582
1670
  // Execute command
1583
1671
  switch (command) {
1672
+ case 'setup':
1673
+ setupCommand(options);
1674
+ break;
1584
1675
  case 'init':
1585
1676
  initCommand(options);
1586
1677
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@musashishao/agent-kit",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "AI Agent templates - Skills, Agents, Workflows, and AI-Ready Data Infrastructure Gateway",
5
5
  "main": "index.js",
6
6
  "bin": {