@linhnguyen96114/agentkit-engineer 1.4.3 → 1.5.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/CHANGELOG.md CHANGED
@@ -1,3 +1,43 @@
1
+ ## [7.10.0](https://github.com/linhnguyen-gt/agentkit-engineer/compare/v7.9.0...v7.10.0) (2026-10-23)
2
+
3
+ ### 🚀 Features
4
+
5
+ * **ak-orchestrate:** distill v2.2.0 routing, graph optimizer, 3-layer arbiter, and pi runtime ([003a1eb](https://github.com/linhnguyen-gt/agentkit-engineer/commit/003a1ebba960331bd3b1f5806d041a834df64484))
6
+ * **bootstrap:** add Nuxt 4 frontend adapter, CLI target, and .vue token check ([4e0ca01](https://github.com/linhnguyen-gt/agentkit-engineer/commit/4e0ca01905a76b901775bcb7217512001a003ce8))
7
+ * **claude:** use native autoCompactWindow and 1h subagentPromptCacheTtl in settings.json ([61d4fc6](https://github.com/linhnguyen-gt/agentkit-engineer/commit/61d4fc6f90e9a272ee1673f803671ae6997da0f3))
8
+ * **gamedev:** add gamedev profile with studio skills, specialist agents, and rules ([5c526c3](https://github.com/linhnguyen-gt/agentkit-engineer/commit/5c526c366501593523c70e90396af68860e7fb27))
9
+ * **gamedev:** bundle CoplayDev unityMCP server with gamedev profile and skill ([6433e94](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6433e94c908f106303253c869330dfe76cb971a0))
10
+ * **scout:** modularize scanner and refine compound token ranking ([5bc235c](https://github.com/linhnguyen-gt/agentkit-engineer/commit/5bc235cfe11a2447a186103d76996a8f9c9dabcb))
11
+ * **skills:** add --project, --global, and --kit flags to agentkit skills CLI ([ac7befd](https://github.com/linhnguyen-gt/agentkit-engineer/commit/ac7befd6bcbfeec8e6a920505fabf0b07707a862))
12
+ * **skills:** add create, audit, and blast-radius optimize modes to test skill ([0633f1c](https://github.com/linhnguyen-gt/agentkit-engineer/commit/0633f1c92017d338f0816c810e9448957b735a6f))
13
+ * **skills:** install companion agents and rules for seo and gamedev skills ([1390557](https://github.com/linhnguyen-gt/agentkit-engineer/commit/13905576ad3ede92f888777afd341e2a2e04877f))
14
+ * **skills:** integrate agentkit CLI discovery and install flow into automation-recommender ([b3cf500](https://github.com/linhnguyen-gt/agentkit-engineer/commit/b3cf500239c6d1542b5eb5afacc91666aa60d10a))
15
+ * **skills:** ship typesafe-ai in core and wire ak-orchestrate into semantic decisions ([dce8438](https://github.com/linhnguyen-gt/agentkit-engineer/commit/dce8438d90e0580c2c9aaa567212c9c8bee4e4e7))
16
+ * **skills:** vendor multi-kit automation-recommender skill across all 12 kits ([22a8121](https://github.com/linhnguyen-gt/agentkit-engineer/commit/22a8121eb0c2c72b3f41e550357e5bfa6a7bc3e8))
17
+ * **sync:** expand upstream sync workflow to all vendor skill sources ([7173e9e](https://github.com/linhnguyen-gt/agentkit-engineer/commit/7173e9ea9f0a6a59e02b51e81964d589f7598ab4))
18
+
19
+ ### 🐞 Bug Fixes
20
+
21
+ * **gamedev:** omit seo specialist agents when installing gamedev profile ([e35d6a4](https://github.com/linhnguyen-gt/agentkit-engineer/commit/e35d6a4dd4b9d669fe4ddf0a06b548a8ce2141cd))
22
+ * **installer:** preserve .agentkit.json user state across kit re-install ([6a3e1b8](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6a3e1b8b7dc84bcbeeb4a64866f7641b0834ea8f))
23
+ * **installer:** preserve user MCP servers across init updates ([5d2b79f](https://github.com/linhnguyen-gt/agentkit-engineer/commit/5d2b79f4e5a6c80757a271635ed0fad6d9ad8ed7))
24
+ * **skills:** restrict seo companion agents to marketing and full profiles ([125564d](https://github.com/linhnguyen-gt/agentkit-engineer/commit/125564dba9a8c6679ef64a848f599598d9e14247))
25
+
26
+ ### 📚 Documentation
27
+
28
+ * **guide:** update SETUP-ANTIGRAVITY.md for Antigravity 2.0 ([6aff249](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6aff24962ad51d9b17b7a9ee27daf76ff62f1af6))
29
+ * update project docs to 7.9.0 ([6832f77](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6832f7722a2caa0883fe70086a172eec3485f6cc))
30
+
31
+ ### ♻️ Code Refactoring
32
+
33
+ * **cli:** drop the literal payload path from logout copy and docs ([713ef88](https://github.com/linhnguyen-gt/agentkit-engineer/commit/713ef88dcb5517c8366021c8cfa819f1608f7165))
34
+ * **cli:** replace the dispatch ladders in bin/agentkit.js with a route table ([9f45305](https://github.com/linhnguyen-gt/agentkit-engineer/commit/9f453057cfa25fd8b7c03b491cb05d88a54d549b))
35
+ * **rules:** tighten chat reply casing and ban dash connectors in prose ([cf27d29](https://github.com/linhnguyen-gt/agentkit-engineer/commit/cf27d29d2e0ece7d3259623350c2f99ead925875))
36
+
37
+ ### ✅ Tests
38
+
39
+ * **skills:** isolate global kit-root env overrides in kit context and skills tests ([4da6fa0](https://github.com/linhnguyen-gt/agentkit-engineer/commit/4da6fa0721dcc2affd2a28848e35f317fdb9998f))
40
+
1
41
  ## [7.9.0](https://github.com/linhnguyen-gt/agentkit-engineer/compare/v7.8.2...v7.9.0) (2026-10-12)
2
42
 
3
43
  ### 🚀 Features
package/README.md CHANGED
@@ -11,8 +11,8 @@ agentkit init # pick a kit, install it globally
11
11
  ```
12
12
 
13
13
  Access is gated: `agentkit login` authorizes a GitHub App through the device
14
- flow, and the first gated command downloads the kit payload into
15
- `~/.agentkit/payload/`. Without an authorized login, every gated command
14
+ flow, and the first gated command downloads the kit payload into the local
15
+ payload cache. Without an authorized login, every gated command
16
16
  answers `no access` and writes nothing.
17
17
 
18
18
  ## Commands
package/bin/agentkit.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const path=require("path"),fs=require("fs"),{spawnSync}=require("child_process"),args=process.argv.slice(2),command=args[0],packageRoot=path.join(__dirname,".."),PAYLOAD_ROOTS=["skills","rules","agents","agent-kit"],clientHasPayload=PAYLOAD_ROOTS.every(n=>{try{return fs.statSync(path.join(packageRoot,n)).isDirectory()}catch{return!1}});async function runInPayload(n){const{resolveInstallSource:a,NoAccessError:l}=require("../scripts-dist/lib/payload/source.js"),{execPayload:e}=require("../scripts-dist/lib/payload/exec.js"),s=n.indexOf("--ref"),o=s!==-1?n[s+1]:void 0;s!==-1&&(!o||o.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit <command> --ref <tag|branch|sha>"),process.exit(1));const{getPayloadVersion:t}=require("../scripts-dist/lib/version-check.js");try{const i=await a({version:t(packageRoot)??"0.0.0",ref:o,interactive:!0,cliRoot:packageRoot}),r=path.join(packageRoot,"node_modules"),g=e(process.execPath,[path.join(i.root,"bin","agentkit.js"),...n],{env:{...process.env,NODE_PATH:r,AGENTKIT_NODE_MODULES:r}});process.exit(g.status==null?1:g.status)}catch(i){i instanceof l?console.error(`\u2717 ${i.message}`):console.error(`\u2717 Could not resolve the kit payload: ${i.message}`),process.exit(1)}}function scheduleUpdateNotice(){try{const{maybeNotifyUpdate:n}=require("../scripts-dist/lib/update-notifier"),{getPayloadVersion:a}=require("../scripts-dist/lib/version-check.js");let l=a(packageRoot);try{const{newestTagInstalledTree:e}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:s}=require("../scripts-dist/lib/agentkit-home.js");l=e(s())?.version??l}catch{}n({currentVersion:l??"0.0.0"})}catch{}}function printProfilesGuide(){console.log("Profiles:"),console.log(" Every install takes a slice of the skill catalog. Leave --profile out and you get the"),console.log(" default for your kit; name one to take a different slice."),console.log(""),console.log(" core Workflow + tooling, minus vendor suites and niche extras (default)"),console.log(" full Every skill the kit ships"),console.log(" frontend core + frontend, design, frameworks"),console.log(" backend core + backend, database, infrastructure, security"),console.log(" mobile core + frontend, frameworks, design"),console.log(" fullstack core + frontend, backend, database, infrastructure, frameworks, design"),console.log(" marketing core + marketing, design, seo, documents, multimedia, ai-ml"),console.log(" also names: copywriting, show-off, project-management, frontend-design, agent-browser,"),console.log(" project-organization, ak-sowat, enhance-ux-ax"),console.log(" dependency: enhance-ux-ax installs with seo (its AX engine)"),console.log(" assistant The personal agents' set \u2014 hermes and openclaw default here"),console.log(""),console.log(" The choice is recorded per kit (.agentkit.json) and reapplied on update, so a later"),console.log(" agentkit init keeps it without the flag; --profile overrides it."),console.log(""),console.log(" Missing a skill a wider profile would have installed?"),console.log(" agentkit skills list Browse the whole catalog (\u2713 = installed here)"),console.log(" agentkit skills add <name> Install one; later updates keep it"),console.log("")}function printGeneralHelp(){console.log("Agentkit CLI"),console.log(""),console.log("Usage:"),console.log(" agentkit <command> [options]"),console.log(" agentkit help [command]"),console.log(""),console.log("Commands:"),console.log(" agentkit init [kit] Initialize AI development kit (project or global)"),console.log(" agentkit login Authorize this machine to reach the kit repository"),console.log(" agentkit logout Remove the stored login and entitlement cache"),console.log(" agentkit whoami Show the logged-in account and its entitlement"),console.log(" agentkit profile Manage install profiles (remove)"),console.log(" agentkit update Upgrade the Agentkit CLI itself to the latest release"),console.log(" agentkit clear Remove Agentkit installations (project or global)"),console.log(" agentkit uninstall Remove Agentkit CLI from your system (global uninstall)"),console.log(" agentkit config Manage auto-update settings"),console.log(" agentkit skills Discover and install skills (list / pick / add / remove)"),console.log(" agentkit doctor Report the health of the installed kit"),console.log(" agentkit status List every kit install on this machine"),console.log(" agentkit dashboard Open the local dashboard in your browser"),console.log(" agentkit hooks See and set hook toggles (list / enable / disable)"),console.log(" agentkit db-first Scaffold a database-first backend project"),console.log(" agentkit mobile Scaffold a mobile project (Expo or Flutter)"),console.log(" agentkit frontend Scaffold a web frontend (agent workflow handoff)"),console.log(" agentkit stack Full-stack workflow tools (typed API client generator)"),console.log(""),console.log("Options:"),console.log(" --help, -h Show this help message"),console.log(" --version, -v Show CLI version"),console.log(""),printProfilesGuide(),console.log("Examples:"),console.log(" agentkit init # Run interactive installer"),console.log(" agentkit init claude # Initialize Claude Code directly (no kit menu)"),console.log(" agentkit init omp # Target a global-only kit (hermes, openclaw, omp)"),console.log(" agentkit init --profile frontend # Install only frontend-relevant skills"),console.log(" agentkit profile remove claude # Reinstall Claude with the core profile"),console.log(" agentkit profile remove --global # Remove profiles from global installs"),console.log(" # Switching an existing profile with init asks for confirmation"),console.log(" agentkit skills # Browse and pick skills to install"),console.log(" agentkit skills add databases # Add one or more skills by name"),console.log(" agentkit skills remove databases # Undo an add: delete it and forget it"),console.log(" agentkit doctor # Check the installed kit's health"),console.log(" agentkit doctor --json # Same, machine-readable"),console.log(" agentkit status # Every kit install and version"),console.log(" agentkit status --scan # Choose the directories to search"),console.log(" agentkit hooks list # Show every hook toggle"),console.log(" agentkit hooks disable scout-block # Turn one hook off"),console.log(" agentkit update # Upgrade the Agentkit CLI itself"),console.log(" agentkit clear # Remove Agentkit files from project/global"),console.log(" agentkit uninstall # Remove Agentkit CLI from system"),console.log(" agentkit config autoupdate # Show auto-update status"),console.log(" agentkit config autoupdate on # Enable auto-update"),console.log(" agentkit config semantic # Semantic decisions: status (off by default)"),console.log(" agentkit config semantic enable # Enable the semantic-decision layer"),console.log(" agentkit decide < payload.json # Ask a decision model one typed question set"),console.log(" agentkit db-first init myapp postgresql # Scaffold a backend project"),console.log(" agentkit mobile init myapp # Scaffold a mobile project"),console.log(" agentkit frontend init myapp --framework nextjs # Frontend Mode handoff"),console.log(" agentkit stack client ./api ./web/src # Typed client from the API's schema"),console.log(" agentkit help <command> # Show detailed help for a command"),console.log(" agentkit help profile # What each install profile includes"),console.log(" agentkit -v # Check version"),console.log("")}async function main(){scheduleUpdateNotice();const n=new Set(["login","logout","whoami","uninstall","config","help","--help","-h","--version","-v"]),a=args[1]==="--help"||args[1]==="-h"||args[1]==="help",l=command!==void 0&&!n.has(command);if(l&&!a){const{checkEntitlement:e}=require("../scripts-dist/lib/entitlement/check.js");(await e({interactive:!0}).catch(()=>null))?.status!=="active"&&(console.error("\u2717 no access \u2014 this command needs an authorized login. Run `agentkit login`."),process.exit(1))}if(l&&!clientHasPayload&&await runInPayload(args),command==="db-first"){const e=path.join(__dirname,"db-first.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="mobile"){const e=path.join(__dirname,"mobile.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="frontend"){const e=path.join(__dirname,"frontend.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="stack"){const e=path.join(__dirname,"stack.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="login")require("../scripts-dist/cli/agentkit-login.js");else if(command==="logout")require("../scripts-dist/cli/agentkit-logout.js");else if(command==="whoami")require("../scripts-dist/cli/agentkit-whoami.js");else if(command==="init"){const{resolveInstallSource:e,NoAccessError:s}=require("../scripts-dist/lib/payload/source.js"),{getPayloadVersion:o}=require("../scripts-dist/lib/version-check.js"),t=path.join(__dirname,".."),i=args.indexOf("--ref"),r=i!==-1?args[i+1]:void 0;i!==-1&&(!r||r.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit init --ref <tag|branch|sha>"),process.exit(1));const g=i!==-1?r:void 0;i!==-1&&process.argv.splice(2+i,2);try{const c=await e({version:o(t)??"0.0.0",ref:g,interactive:!0,cliRoot:t});process.env.AGENTKIT_SOURCE_ROOT=c.root,require("../scripts-dist/cli/agentkit-init.js")}catch(c){c instanceof s?console.error(`\u2717 ${c.message}`):console.error(`\u2717 Could not resolve the kit payload: ${c.message}`),process.exit(1)}}else if(command==="profile")require("../scripts-dist/cli/agentkit-profile.js");else if(command==="update")require("../scripts-dist/cli/agentkit-update.js");else if(command==="clear")require("../scripts-dist/cli/agentkit-clear.js");else if(command==="uninstall")require("../scripts-dist/cli/agentkit-uninstall.js");else if(command==="config")require("../scripts-dist/cli/agentkit-config.js");else if(command==="decide")require("../scripts-dist/cli/agentkit-decide.js");else if(command==="skills")require("../scripts-dist/cli/agentkit-skills.js");else if(command==="doctor")require("../scripts-dist/cli/agentkit-doctor.js");else if(command==="status")require("../scripts-dist/cli/agentkit-status.js");else if(command==="dashboard")require("../scripts-dist/cli/agentkit-dashboard.js");else if(command==="hooks")require("../scripts-dist/cli/agentkit-hooks.js");else if(command==="help"&&args[1]){const e=args[1];if(!clientHasPayload&&!new Set(["profile","profiles","login","logout","whoami","uninstall"]).has(e)&&await runInPayload(["help",e]),e==="profile"||e==="profiles")printProfilesGuide();else if(e==="db-first"){const o=path.join(__dirname,"db-first.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else if(e==="mobile"){const o=path.join(__dirname,"mobile.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else if(e==="frontend"){const o=path.join(__dirname,"frontend.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else if(e==="stack"){const o=path.join(__dirname,"stack.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else e==="login"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-login.js"),"--help"],require("../scripts-dist/cli/agentkit-login.js")):e==="logout"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-logout.js"),"--help"],require("../scripts-dist/cli/agentkit-logout.js")):e==="whoami"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-whoami.js"),"--help"],require("../scripts-dist/cli/agentkit-whoami.js")):e==="init"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-init.js"),"--help"],require("../scripts-dist/cli/agentkit-init.js")):e==="update"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-update.js"),"--help"],require("../scripts-dist/cli/agentkit-update.js")):e==="clear"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-clear.js"),"--help"],require("../scripts-dist/cli/agentkit-clear.js")):e==="uninstall"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-uninstall.js"),"--help"],require("../scripts-dist/cli/agentkit-uninstall.js")):e==="config"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-config.js"),"--help"],require("../scripts-dist/cli/agentkit-config.js")):e==="decide"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-decide.js"),"--help"],require("../scripts-dist/cli/agentkit-decide.js")):e==="skills"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-skills.js"),"help"],require("../scripts-dist/cli/agentkit-skills.js")):e==="doctor"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-doctor.js"),"--help"],require("../scripts-dist/cli/agentkit-doctor.js")):e==="status"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-status.js"),"--help"],require("../scripts-dist/cli/agentkit-status.js")):e==="dashboard"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-dashboard.js"),"--help"],require("../scripts-dist/cli/agentkit-dashboard.js")):e==="hooks"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-hooks.js"),"help"],require("../scripts-dist/cli/agentkit-hooks.js")):(console.log(`Unknown command: ${e}`),console.log(""),printGeneralHelp(),process.exit(1))}else if(command==="--version"||command==="-v"){const e=require("../package.json");let s=typeof e.payloadVersion=="string"?e.payloadVersion:null;try{const{newestTagInstalledTree:t}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:i}=require("../scripts-dist/lib/agentkit-home.js");s=t(i())?.version??s}catch{}const o=s&&s!==e.version?` (payload v${s})`:"";console.log(`v${e.version}${o}`)}else printGeneralHelp()}main();
2
+ const path=require("path"),fs=require("fs"),{spawnSync}=require("child_process"),args=process.argv.slice(2),command=args[0],packageRoot=path.join(__dirname,".."),PAYLOAD_ROOTS=["skills","rules","agents","agent-kit"],clientHasPayload=PAYLOAD_ROOTS.every(e=>{try{return fs.statSync(path.join(packageRoot,e)).isDirectory()}catch{return!1}});async function runInPayload(e){const{resolveInstallSource:t,NoAccessError:o}=require("../scripts-dist/lib/payload/source.js"),{execPayload:n}=require("../scripts-dist/lib/payload/exec.js"),s=e.indexOf("--ref"),l=s!==-1?e[s+1]:void 0;s!==-1&&(!l||l.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit <command> --ref <tag|branch|sha>"),process.exit(1));const{getPayloadVersion:i}=require("../scripts-dist/lib/version-check.js");try{const a=await t({version:i(packageRoot)??"0.0.0",ref:l,interactive:!0,cliRoot:packageRoot}),r=path.join(packageRoot,"node_modules"),c=n(process.execPath,[path.join(a.root,"bin","agentkit.js"),...e],{env:{...process.env,NODE_PATH:r,AGENTKIT_NODE_MODULES:r}});process.exit(c.status==null?1:c.status)}catch(a){a instanceof o?console.error(`\u2717 ${a.message}`):console.error(`\u2717 Could not resolve the kit payload: ${a.message}`),process.exit(1)}}function scheduleUpdateNotice(){try{const{maybeNotifyUpdate:e}=require("../scripts-dist/lib/update-notifier"),{getPayloadVersion:t}=require("../scripts-dist/lib/version-check.js");let o=t(packageRoot);try{const{newestTagInstalledTree:n}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:s}=require("../scripts-dist/lib/agentkit-home.js");o=n(s())?.version??o}catch{}e({currentVersion:o??"0.0.0"})}catch{}}function printProfilesGuide(){console.log("Profiles:"),console.log(" Every install takes a slice of the skill catalog. Leave --profile out and you get the"),console.log(" default for your kit; name one to take a different slice."),console.log(""),console.log(" core Workflow + tooling, minus vendor suites and niche extras (default)"),console.log(" full Every skill the kit ships"),console.log(" frontend core + frontend, design, frameworks"),console.log(" backend core + backend, database, infrastructure, security"),console.log(" mobile core + frontend, frameworks, design"),console.log(" fullstack core + frontend, backend, database, infrastructure, frameworks, design"),console.log(" gamedev core + gamedev, multimedia"),console.log(" also names: threejs, shader, ai-artist, ai-multimodal, ui-ux-pro-max, ak-scenario, ak-optimize"),console.log(" marketing core + marketing, design, seo, documents, multimedia, ai-ml"),console.log(" also names: copywriting, show-off, project-management, frontend-design, agent-browser,"),console.log(" project-organization, ak-sowat, enhance-ux-ax"),console.log(" dependency: enhance-ux-ax installs with seo (its AX engine)"),console.log(" assistant The personal agents' set \u2014 hermes and openclaw default here"),console.log(""),console.log(" The choice is recorded per kit (.agentkit.json) and reapplied on update, so a later"),console.log(" agentkit init keeps it without the flag; --profile overrides it."),console.log(""),console.log(" Missing a skill a wider profile would have installed?"),console.log(" agentkit skills list Browse the whole catalog (\u2713 = installed here)"),console.log(" agentkit skills add <name> Install one; later updates keep it"),console.log(" agentkit skills add <name> --project Install into the current project (--kit <kit>)"),console.log("")}function printGeneralHelp(){console.log("Agentkit CLI"),console.log(""),console.log("Usage:"),console.log(" agentkit <command> [options]"),console.log(" agentkit help [command]"),console.log(""),console.log("Commands:"),console.log(" agentkit init [kit] Initialize AI development kit (project or global)"),console.log(" agentkit login Authorize this machine to reach the kit repository"),console.log(" agentkit logout Remove the stored login and entitlement cache"),console.log(" agentkit whoami Show the logged-in account and its entitlement"),console.log(" agentkit profile Manage install profiles (remove)"),console.log(" agentkit update Upgrade the Agentkit CLI itself to the latest release"),console.log(" agentkit clear Remove Agentkit installations (project or global)"),console.log(" agentkit uninstall Remove Agentkit CLI from your system (global uninstall)"),console.log(" agentkit config Manage auto-update settings"),console.log(" agentkit skills Discover and install skills (list / pick / add / remove)"),console.log(" agentkit doctor Report the health of the installed kit"),console.log(" agentkit status List every kit install on this machine"),console.log(" agentkit dashboard Open the local dashboard in your browser"),console.log(" agentkit hooks See and set hook toggles (list / enable / disable)"),console.log(" agentkit db-first Scaffold a database-first backend project"),console.log(" agentkit mobile Scaffold a mobile project (Expo or Flutter)"),console.log(" agentkit frontend Scaffold a web frontend (agent workflow handoff)"),console.log(" agentkit stack Full-stack workflow tools (typed API client generator)"),console.log(""),console.log("Options:"),console.log(" --help, -h Show this help message"),console.log(" --version, -v Show CLI version"),console.log(""),printProfilesGuide(),console.log("Examples:"),console.log(" agentkit init # Run interactive installer"),console.log(" agentkit init claude # Initialize Claude Code directly (no kit menu)"),console.log(" agentkit init omp # Target a global-only kit (hermes, openclaw, omp)"),console.log(" agentkit init --profile frontend # Install only frontend-relevant skills"),console.log(" agentkit profile remove claude # Reinstall Claude with the core profile"),console.log(" agentkit profile remove --global # Remove profiles from global installs"),console.log(" # Switching an existing profile with init asks for confirmation"),console.log(" agentkit skills # Browse and pick skills to install"),console.log(" agentkit skills add databases # Add one or more skills by name"),console.log(" agentkit skills add expo --project # Add a skill into the current project"),console.log(" agentkit skills remove databases # Undo an add: delete it and forget it"),console.log(" agentkit doctor # Check the installed kit's health"),console.log(" agentkit doctor --json # Same, machine-readable"),console.log(" agentkit status # Every kit install and version"),console.log(" agentkit status --scan # Choose the directories to search"),console.log(" agentkit hooks list # Show every hook toggle"),console.log(" agentkit hooks disable scout-block # Turn one hook off"),console.log(" agentkit update # Upgrade the Agentkit CLI itself"),console.log(" agentkit clear # Remove Agentkit files from project/global"),console.log(" agentkit uninstall # Remove Agentkit CLI from system"),console.log(" agentkit config autoupdate # Show auto-update status"),console.log(" agentkit config autoupdate on # Enable auto-update"),console.log(" agentkit config semantic # Semantic decisions: status (off by default)"),console.log(" agentkit config semantic enable # Enable the semantic-decision layer"),console.log(" agentkit decide < payload.json # Ask a decision model one typed question set"),console.log(" agentkit db-first init myapp postgresql # Scaffold a backend project"),console.log(" agentkit mobile init myapp # Scaffold a mobile project"),console.log(" agentkit frontend init myapp --framework nextjs # Frontend Mode handoff"),console.log(" agentkit stack client ./api ./web/src # Typed client from the API's schema"),console.log(" agentkit help <command> # Show detailed help for a command"),console.log(" agentkit help profile # What each install profile includes"),console.log(" agentkit -v # Check version"),console.log("")}function runSiblingBin(e,t){const o=spawnSync(process.execPath,[path.join(__dirname,e),...t],{stdio:"inherit"});process.exit(o.status==null?1:o.status)}function cliEntryPath(e){return path.join(packageRoot,"scripts-dist","cli",`agentkit-${e}.js`)}function requireCliEntry(e){require(cliEntryPath(e))}async function runInit(){const{resolveInstallSource:e,NoAccessError:t}=require("../scripts-dist/lib/payload/source.js"),{getPayloadVersion:o}=require("../scripts-dist/lib/version-check.js"),n=args.indexOf("--ref"),s=n!==-1?args[n+1]:void 0;n!==-1&&(!s||s.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit init --ref <tag|branch|sha>"),process.exit(1));const l=n!==-1?s:void 0;n!==-1&&process.argv.splice(2+n,2);try{const i=await e({version:o(packageRoot)??"0.0.0",ref:l,interactive:!0,cliRoot:packageRoot});process.env.AGENTKIT_SOURCE_ROOT=i.root,requireCliEntry("init")}catch(i){i instanceof t?console.error(`\u2717 ${i.message}`):console.error(`\u2717 Could not resolve the kit payload: ${i.message}`),process.exit(1)}}async function runHelpTopic(e){!clientHasPayload&&!new Set(["profile","profiles","login","logout","whoami","uninstall"]).has(e)&&await runInPayload(["help",e]);const o=new Set(["db-first","mobile","frontend","stack"]),n=new Map([["login","--help"],["logout","--help"],["whoami","--help"],["init","--help"],["update","--help"],["clear","--help"],["uninstall","--help"],["config","--help"],["decide","--help"],["doctor","--help"],["status","--help"],["dashboard","--help"],["skills","help"],["hooks","help"]]);e==="profile"||e==="profiles"?printProfilesGuide():o.has(e)?runSiblingBin(`${e}.js`,["--help"]):n.has(e)?(process.argv=[process.argv[0],cliEntryPath(e),n.get(e)],requireCliEntry(e)):(console.log(`Unknown command: ${e}`),console.log(""),printGeneralHelp(),process.exit(1))}function printVersion(){const e=require("../package.json");let t=typeof e.payloadVersion=="string"?e.payloadVersion:null;try{const{newestTagInstalledTree:n}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:s}=require("../scripts-dist/lib/agentkit-home.js");t=n(s())?.version??t}catch{}const o=t&&t!==e.version?` (payload v${t})`:"";console.log(`v${e.version}${o}`)}async function main(){scheduleUpdateNotice();const e=new Set(["login","logout","whoami","uninstall","config","help","--help","-h","--version","-v"]),t=args[1]==="--help"||args[1]==="-h"||args[1]==="help",o=command!==void 0&&!e.has(command);if(o&&!t){const{checkEntitlement:l}=require("../scripts-dist/lib/entitlement/check.js");(await l({interactive:!0}).catch(()=>null))?.status!=="active"&&(console.error("\u2717 no access \u2014 this command needs an authorized login. Run `agentkit login`."),process.exit(1))}o&&!clientHasPayload&&await runInPayload(args);const s=[{when:command==="db-first",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="mobile",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="frontend",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="stack",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="login",run:()=>requireCliEntry(command)},{when:command==="logout",run:()=>requireCliEntry(command)},{when:command==="whoami",run:()=>requireCliEntry(command)},{when:command==="init",run:runInit},{when:command==="profile",run:()=>requireCliEntry(command)},{when:command==="update",run:()=>requireCliEntry(command)},{when:command==="clear",run:()=>requireCliEntry(command)},{when:command==="uninstall",run:()=>requireCliEntry(command)},{when:command==="config",run:()=>requireCliEntry(command)},{when:command==="decide",run:()=>requireCliEntry(command)},{when:command==="skills",run:()=>requireCliEntry(command)},{when:command==="doctor",run:()=>requireCliEntry(command)},{when:command==="status",run:()=>requireCliEntry(command)},{when:command==="dashboard",run:()=>requireCliEntry(command)},{when:command==="hooks",run:()=>requireCliEntry(command)},{when:command==="help"&&args[1],run:()=>runHelpTopic(args[1])},{when:command==="--version"||command==="-v",run:printVersion}].find(l=>l.when);s?await s.run():printGeneralHelp()}main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linhnguyen96114/agentkit-engineer",
3
- "version": "1.4.3",
3
+ "version": "1.5.0",
4
4
  "description": "Agentkit thin client — downloads and installs the Agentkit payload after `agentkit login` entitlement.",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -20,7 +20,7 @@
20
20
  "type": "git",
21
21
  "url": "https://github.com/linhnguyen-gt/agentkit-engineer.git"
22
22
  },
23
- "payloadVersion": "7.9.0",
23
+ "payloadVersion": "7.10.0",
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  }
@@ -7,6 +7,6 @@ Usage:
7
7
  agentkit logout
8
8
 
9
9
  Clears the credential-store entry, ~/.agentkit/auth.json and
10
- ~/.agentkit/entitlement.json. Fetched payload versions under
11
- ~/.agentkit/payload/ are kept; 'agentkit uninstall' removes them.
10
+ ~/.agentkit/entitlement.json. Fetched payload versions are kept;
11
+ 'agentkit uninstall' removes them.
12
12
  `)}(0,cli_2.runCli)({command:"logout",printHelp,helpArgs:cli_2.helpFlagsOnly,handler:()=>(0,cli_1.runLogout)()});
@@ -14,12 +14,17 @@ Commands:
14
14
  help Show this help message
15
15
 
16
16
  Options:
17
+ --project, -p Target the current project directory
18
+ --global, -g Target a global kit install
19
+ --kit, -k <name> Target a specific kit by name (e.g. claude, cursor, codex)
17
20
  --help, -h Show this help message
18
21
 
19
22
  Examples:
20
- agentkit skills # Interactive skill picker
21
- agentkit skills list # Print all available skills
22
- agentkit skills add databases # Add databases skill to active kit
23
- agentkit skills add gsap expo # Add multiple skills
24
- agentkit skills remove databases # Remove a previously added skill
23
+ agentkit skills # Interactive skill picker
24
+ agentkit skills list # Print all available skills
25
+ agentkit skills add databases # Add skill to active kit (project or global)
26
+ agentkit skills add databases --project # Add skill to current project
27
+ agentkit skills add expo -p -k claude # Add skill to project for a specific kit
28
+ agentkit skills add gsap --global # Add skill to global install
29
+ agentkit skills remove databases --project # Remove a previously added project skill
25
30
  `)}(0,cli_1.runCli)({command:"skills",printHelp,helpArgs:l=>l.includes("--help")||l.includes("-h")||l[0]==="help"||l[1]==="help",handler:cli_2.runSkills});
@@ -1,6 +1,6 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,a,r){r===void 0&&(r=a);var o=Object.getOwnPropertyDescriptor(e,a);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,o)}):(function(t,e,a,r){r===void 0&&(r=a),t[r]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(a){var r=[];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[r.length]=o);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var r=t(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(a,e,r[o]);return __setModuleDefault(a,e),a}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseOwnerRepo=parseOwnerRepo,exports.normalizeVersion=normalizeVersion,exports.interpretTagOutput=interpretTagOutput,exports.fetchLatestTag=fetchLatestTag,exports.fetchCommitsBehind=fetchCommitsBehind,exports.buildDriftRow=buildDriftRow;const child_process_1=require("child_process"),generate_catalogs_1=require("./generate-catalogs"),path=__importStar(require("path")),REPO_ROOT=path.resolve(__dirname,"..","..");function parseOwnerRepo(t){const e=t.match(/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return e?`${e[1]}/${e[2]}`:null}function normalizeVersion(t){return t.replace(/^v/,"").trim()}function interpretTagOutput(t){return{reachable:!0,tag:t.trim()||null}}function fetchLatestTag(t){try{return interpretTagOutput((0,child_process_1.execFileSync)("gh",["api",`repos/${t}/tags`,"--jq",".[0].name"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}))}catch{return{reachable:!1}}}function fetchCommitsBehind(t,e){try{const a=(0,child_process_1.execFileSync)("gh",["api",`repos/${t}/compare/${e}...HEAD`,"--jq",".ahead_by"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim(),r=Number.parseInt(a,10);return Number.isNaN(r)?null:r}catch{return null}}function buildDriftRow(t,e,a=null){const r=parseOwnerRepo(t.upstream??"")??t.upstream??"?",o=t.upstream_version?normalizeVersion(t.upstream_version):null,u=e.reachable?e.tag:null,l=!!(t.upstream_commit&&e.reachable&&(!t.upstream_version||e.tag===null));let i;if(!e.reachable)i="unreachable";else if(l){if(a!==null)return{skill:t.name,ownerRepo:r,local:t.upstream_commit.slice(0,12),latest:`HEAD~${a}`,state:a===0?"current":"behind"};i="untagged"}else e.tag===null?i="untagged":o===null?i="unpinned":i=normalizeVersion(e.tag)===o?"current":"behind";return{skill:t.name,ownerRepo:r,local:o,latest:u,state:i}}function main(){const t=(0,generate_catalogs_1.collectSkills)(REPO_ROOT).filter(n=>n.upstream);if(t.length===0){console.log("No vendored skills declare an `upstream` \u2014 nothing to check.");return}console.log(`Checking ${t.length} vendored skill(s) against upstream tags...
2
- `);const e=[];for(const n of t){const s=parseOwnerRepo(n.upstream??""),c=s?fetchLatestTag(s):{reachable:!1},f=s&&n.upstream_commit&&c.reachable&&(!n.upstream_version||c.tag===null)?fetchCommitsBehind(s,n.upstream_commit):null;e.push(buildDriftRow(n,c,f))}const a=(n,s)=>Math.max(n.length,...s.map(c=>(c??"\u2014").length))+2,r=a("LOCAL",e.map(n=>n.local)),o=a("LATEST",e.map(n=>n.latest)),u=a("SKILL",e.map(n=>n.skill)),l=(n,s)=>n.padEnd(s);console.log(l("SKILL",u)+l("LOCAL",r)+l("LATEST",o)+"STATE");for(const n of e)console.log(l(n.skill,u)+l(n.local??"\u2014",r)+l(n.latest??"\u2014",o)+n.state);const i=e.filter(n=>n.state==="behind"),p=e.filter(n=>n.state==="untagged"),h=e.filter(n=>n.state==="unreachable");if(i.length>0&&console.warn(`
3
- \u26A0 ${i.length} skill(s) behind upstream \u2014 consider a re-sync.`),p.length>0){const n=[...new Set(p.map(s=>s.ownerRepo))].join(", ");console.warn(`
4
- \u2139 ${p.length} skill(s) track an upstream that publishes no tags (${n}).
5
- Version comparison is impossible by design there \u2014 compare by commit, or re-sync on a date.`)}h.length>0&&console.warn(`
6
- \u26A0 ${h.length} upstream(s) unreachable (no network / no gh auth / repo gone) \u2014 skipped.`)}require.main===module&&main();
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,a,r){r===void 0&&(r=a);var o=Object.getOwnPropertyDescriptor(e,a);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,o)}):(function(t,e,a,r){r===void 0&&(r=a),t[r]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(a){var r=[];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[r.length]=o);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var r=t(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(a,e,r[o]);return __setModuleDefault(a,e),a}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseOwnerRepo=parseOwnerRepo,exports.normalizeVersion=normalizeVersion,exports.interpretTagOutput=interpretTagOutput,exports.fetchLatestTag=fetchLatestTag,exports.fetchCommitsBehind=fetchCommitsBehind,exports.buildDriftRow=buildDriftRow;const child_process_1=require("child_process"),generate_catalogs_1=require("./generate-catalogs"),path=__importStar(require("path")),REPO_ROOT=path.resolve(__dirname,"..","..");function parseOwnerRepo(t){const e=t.match(/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return e?`${e[1]}/${e[2]}`:null}function normalizeVersion(t){return t.replace(/^v/,"").trim()}function interpretTagOutput(t){return{reachable:!0,tag:t.trim()||null}}function fetchLatestTag(t){try{return interpretTagOutput((0,child_process_1.execFileSync)("gh",["api",`repos/${t}/tags`,"--jq",".[0].name"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}))}catch{return{reachable:!1}}}function fetchCommitsBehind(t,e){try{const a=(0,child_process_1.execFileSync)("gh",["api",`repos/${t}/compare/${e}...HEAD`,"--jq",".ahead_by"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim(),r=Number.parseInt(a,10);return Number.isNaN(r)?null:r}catch{return null}}function buildDriftRow(t,e,a=null){const r=parseOwnerRepo(t.upstream??"")??t.upstream??"?",o=t.upstream_version?normalizeVersion(t.upstream_version):null,u=e.reachable?e.tag:null,p=!!(t.upstream_commit&&e.reachable&&(!t.upstream_version||e.tag===null));let i;if(!e.reachable)i="unreachable";else if(p){if(a!==null)return{skill:t.name,ownerRepo:r,local:t.upstream_commit.slice(0,12),latest:`HEAD~${a}`,state:a===0?"current":"behind"};i="untagged"}else e.tag===null?i="untagged":o===null?i="unpinned":i=normalizeVersion(e.tag)===o?"current":"behind";return{skill:t.name,ownerRepo:r,local:o,latest:u,state:i}}function main(){const t=(0,generate_catalogs_1.collectSkills)(REPO_ROOT).filter(n=>n.upstream);if(t.length===0){console.log("No vendored skills declare an `upstream` \u2014 nothing to check.");return}console.log(`Checking ${t.length} vendored skill(s) against upstream tags...
2
+ `);const e=[],a=new Map,r=new Map;for(const n of t){const s=parseOwnerRepo(n.upstream??"");let l={reachable:!1};s&&(a.has(s)||a.set(s,fetchLatestTag(s)),l=a.get(s));let d=null;if(s&&n.upstream_commit&&l.reachable&&(!n.upstream_version||l.tag===null)){const f=`${s}@${n.upstream_commit}`;r.has(f)||r.set(f,fetchCommitsBehind(s,n.upstream_commit)),d=r.get(f)}e.push(buildDriftRow(n,l,d))}const o=(n,s)=>Math.max(n.length,...s.map(l=>(l??"\u2014").length))+2,u=o("LOCAL",e.map(n=>n.local)),p=o("LATEST",e.map(n=>n.latest)),i=o("SKILL",e.map(n=>n.skill)),c=(n,s)=>n.padEnd(s);console.log(c("SKILL",i)+c("LOCAL",u)+c("LATEST",p)+"STATE");for(const n of e)console.log(c(n.skill,i)+c(n.local??"\u2014",u)+c(n.latest??"\u2014",p)+n.state);const g=e.filter(n=>n.state==="behind"),h=e.filter(n=>n.state==="untagged"),m=e.filter(n=>n.state==="unreachable");if(g.length>0&&console.warn(`
3
+ \u26A0 ${g.length} skill(s) behind upstream \u2014 consider a re-sync.`),h.length>0){const n=[...new Set(h.map(s=>s.ownerRepo))].join(", ");console.warn(`
4
+ \u2139 ${h.length} skill(s) track an upstream that publishes no tags (${n}).
5
+ Version comparison is impossible by design there \u2014 compare by commit, or re-sync on a date.`)}m.length>0&&console.warn(`
6
+ \u26A0 ${m.length} upstream(s) unreachable (no network / no gh auth / repo gone) \u2014 skipped.`)}require.main===module&&main();
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var v=Object.create,m=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,A=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,E=(e,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of $(n))!j.call(e,r)&&r!==o&&m(e,r,{get:()=>n[r],enumerable:!(a=x(n,r))||a.enumerable});return e},u=(e,n,o)=>(o=e!=null?v(A(e)):{},E(n||!e||!e.__esModule?m(o,"default",{value:e,enumerable:!0}):o,e)),t=u(require("fs")),s=u(require("path")),i=["nextjs","react","vue","angular"],f=["landing","crud-list","dashboard"],d=["npm","yarn","pnpm"];function F(e){return i.includes(e)}function S(e){return f.includes(e)}function M(e){return d.includes(e)}function p(e,n){let o=e.indexOf(n);return o>=0&&o+1<e.length?e[o+1]:void 0}function w(e){return e.find(n=>!n.startsWith("-"))}function R(){let e=process.argv.slice(2),n=e[0];(!n||n==="help"||n==="--help"||n==="-h")&&(k(),process.exit(0));try{switch(n){case"init":C(e.slice(1));break;case"run":P(e.slice(1));break;default:console.error(`Unknown command: ${n}
3
- `),k(),process.exit(1)}}catch(o){console.error("Error:",o instanceof Error?o.message:o),process.exit(1)}}function C(e){let n=w(e);n||(console.error("Usage: agentkit frontend init <app> --framework <nextjs|react|vue|angular> [--archetype <landing|crud-list|dashboard>] [--package-manager <npm|yarn|pnpm>]"),process.exit(1));let o=p(e,"--framework");o||(console.log(b(n)),process.exit(0)),F(o)||(console.error(`Unknown framework "${o}". Expected one of: ${i.join(", ")}`),process.exit(1));let a=null,r=p(e,"--archetype");r&&(S(r)||(console.error(`Unknown archetype "${r}". Expected one of: ${f.join(", ")}`),process.exit(1)),a=r);let c=p(e,"--package-manager")??"npm";M(c)||(console.error(`Unknown package manager "${c}". Expected one of: ${d.join(", ")}`),process.exit(1));let l={framework:o,archetype:a,packageManager:c},g=s.join(process.cwd(),"plans",n);t.mkdirSync(g,{recursive:!0});let h=s.join(g,"frontend.config.json");t.writeFileSync(h,`${JSON.stringify(l,null,2)}
2
+ "use strict";var x=Object.create,u=Object.defineProperty,v=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,A=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,S=(e,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of $(n))!j.call(e,r)&&r!==o&&u(e,r,{get:()=>n[r],enumerable:!(a=v(n,r))||a.enumerable});return e},m=(e,n,o)=>(o=e!=null?x(A(e)):{},S(n||!e||!e.__esModule?u(o,"default",{value:e,enumerable:!0}):o,e)),t=m(require("fs")),s=m(require("path")),i=["nextjs","react","vue","angular","nuxt"],f=["landing","crud-list","dashboard"],d=["npm","yarn","pnpm"];function E(e){return i.includes(e)}function F(e){return f.includes(e)}function M(e){return d.includes(e)}function p(e,n){let o=e.indexOf(n);return o>=0&&o+1<e.length?e[o+1]:void 0}function w(e){return e.find(n=>!n.startsWith("-"))}function R(){let e=process.argv.slice(2),n=e[0];(!n||n==="help"||n==="--help"||n==="-h")&&(k(),process.exit(0));try{switch(n){case"init":C(e.slice(1));break;case"run":P(e.slice(1));break;default:console.error(`Unknown command: ${n}
3
+ `),k(),process.exit(1)}}catch(o){console.error("Error:",o instanceof Error?o.message:o),process.exit(1)}}function C(e){let n=w(e);n||(console.error("Usage: agentkit frontend init <app> --framework <nextjs|react|vue|angular|nuxt> [--archetype <landing|crud-list|dashboard>] [--package-manager <npm|yarn|pnpm>]"),process.exit(1));let o=p(e,"--framework");o||(console.log(b(n)),process.exit(0)),E(o)||(console.error(`Unknown framework "${o}". Expected one of: ${i.join(", ")}`),process.exit(1));let a=null,r=p(e,"--archetype");r&&(F(r)||(console.error(`Unknown archetype "${r}". Expected one of: ${f.join(", ")}`),process.exit(1)),a=r);let c=p(e,"--package-manager")??"npm";M(c)||(console.error(`Unknown package manager "${c}". Expected one of: ${d.join(", ")}`),process.exit(1));let l={framework:o,archetype:a,packageManager:c},g=s.join(process.cwd(),"plans",n);t.mkdirSync(g,{recursive:!0});let h=s.join(g,"frontend.config.json");t.writeFileSync(h,`${JSON.stringify(l,null,2)}
4
4
  `,"utf-8"),console.log(`\u2713 wrote ${s.relative(process.cwd(),h)}`),console.log(""),console.log(y(l,n))}function P(e){let n=w(e);n||(console.error("Usage: agentkit frontend run <app>"),process.exit(1));let o=s.join(process.cwd(),"plans",n,"frontend.config.json");t.existsSync(o)||(console.log(`No frontend.config.json for "${n}". Run "agentkit frontend init ${n} --framework <fw>" first, or invoke the workflow directly:
5
5
  `),console.log(b(n)),process.exit(0));let a=JSON.parse(t.readFileSync(o,"utf-8"));console.log(`Frontend Mode handoff for "${n}" (from ${s.relative(process.cwd(),o)}):
6
6
  `),console.log(y(a,n))}function y(e,n){let o=e.archetype?`archetype "${e.archetype}" \u2014 adopted as your answer, so the workflow skips the classify prompt`:"archetype classified from your prompt (the workflow confirms it if unsure)";return["Next \u2014 the clickable UI is generated by the AI agent, not this CLI. Run:","",` /bootstrap:frontend:${e.framework} "<describe ${n}>"`,"",` - package manager: ${e.packageManager} \u2014 adopted, so the workflow does not ask`,` - ${o}`,` - the workflow reads these from plans/${n}/frontend.config.json`," - the agent scaffolds via the framework's official CLI, applies ui-ux-pro-max"," tokens, generates screens/routing/state, and proves it with the"," build/boot/lint/Playwright-smoke gate."].join(`
@@ -27,7 +27,7 @@ Archetypes (derived): ${f.join(", ")} (landing = no state)
27
27
  Package managers: ${d.join(", ")} (default npm)
28
28
 
29
29
  Options (init):
30
- --framework <name> nextjs | react | vue | angular
30
+ --framework <name> nextjs | react | vue | angular | nuxt
31
31
  --archetype <name> landing | crud-list | dashboard (optional; else derived)
32
32
  --package-manager <name> npm | yarn | pnpm (default npm)
33
33
 
@@ -36,6 +36,7 @@ Run the workflow in your AI agent:
36
36
  /bootstrap:frontend:react "a SaaS landing page with hero, features and pricing"
37
37
  /bootstrap:frontend:vue "an analytics dashboard with 3 screens"
38
38
  /bootstrap:frontend:angular "a task manager"
39
+ /bootstrap:frontend:nuxt "a SaaS dashboard with analytics"
39
40
 
40
41
  Examples:
41
42
  agentkit frontend
@@ -1,4 +1,4 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,r,e,n){n===void 0&&(n=e);var a=Object.getOwnPropertyDescriptor(r,e);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,n,a)}):(function(t,r,e,n){n===void 0&&(n=e),t[n]=r[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}):function(t,r){t.default=r}),__importStar=this&&this.__importStar||(function(){var t=function(r){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[n.length]=a);return n},t(r)};return function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var n=t(r),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(e,r,n[a]);return __setModuleDefault(e,r),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.GUIDE_COMMANDS_END=exports.GUIDE_COMMANDS_START=exports.SKILL_STATUSES=exports.CATEGORY_TITLES=void 0,exports.collectSkills=collectSkills,exports.collectAgents=collectAgents,exports.collectCommands=collectCommands,exports.renderSkillsYaml=renderSkillsYaml,exports.renderAgentsYaml=renderAgentsYaml,exports.renderCommandsYaml=renderCommandsYaml,exports.renderSkillsReadme=renderSkillsReadme,exports.slashInvocation=slashInvocation,exports.renderGuideCommandSection=renderGuideCommandSection,exports.syncGuideCommandSections=syncGuideCommandSections,exports.generateCatalogs=generateCatalogs;const fs=__importStar(require("fs")),path=__importStar(require("path")),frontmatter_1=require("../lib/frontmatter"),agent_metadata_1=require("../lib/kit-installers/agent-metadata"),payload_roots_1=require("../lib/payload-roots"),SKILL_GROUPS=[],NOT_SKILLS=new Set(["common",...SKILL_GROUPS]);exports.CATEGORY_TITLES={"ai-ml":"AI & Machine Learning",frontend:"Frontend & Design",backend:"Backend Development",infrastructure:"Infrastructure & DevOps",database:"Database & Storage","dev-tools":"Development Tools",multimedia:"Multimedia & Processing",frameworks:"Frameworks & Platforms",security:"Security",design:"Design",documents:"Document Processing",marketing:"Marketing & Growth",seo:"SEO & Search",utilities:"Utilities & Helpers",other:"Other"},exports.SKILL_STATUSES=new Set(["experimental","stable","deprecated"]);function yamlString(t){return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function readSkill(t,r,e){const n=path.join(t,e),a=path.join(n,"SKILL.md");if(!fs.existsSync(a))return null;const s=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(a,"utf8")),i=(0,frontmatter_1.cleanFrontmatterValue)(s.category)||"other",o=(0,frontmatter_1.cleanFrontmatterValue)(s.status)||"stable";return{name:r,path:`${e}/SKILL.md`,description:(0,frontmatter_1.cleanFrontmatterValue)(s.description),category:i in exports.CATEGORY_TITLES?i:"other",status:exports.SKILL_STATUSES.has(o)?o:"stable",user_invocable:(0,frontmatter_1.cleanFrontmatterValue)(s["user-invocable"])==="true",has_scripts:fs.existsSync(path.join(n,"scripts")),has_references:fs.existsSync(path.join(n,"references")),...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)?{upstream:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)?{upstream_commit:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)?{upstream_version:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.synced)?{synced:(0,frontmatter_1.cleanFrontmatterValue)(s.synced)}:{}}}function collectSkills(t){const r=path.join(t,payload_roots_1.SKILL_SOURCE_DIR),e=[];for(const n of fs.readdirSync(r,{withFileTypes:!0})){if(!n.isDirectory()||n.name.startsWith("."))continue;if(SKILL_GROUPS.includes(n.name)){const s=path.join(r,n.name);for(const i of fs.readdirSync(s,{withFileTypes:!0})){if(!i.isDirectory())continue;const o=readSkill(r,i.name,`${n.name}/${i.name}`);o&&e.push({...o,category:"documents"})}continue}if(NOT_SKILLS.has(n.name))continue;const a=readSkill(r,n.name,n.name);a&&e.push(a)}return e.sort((n,a)=>n.name.localeCompare(a.name))}function collectAgents(t){const{agents:r}=(0,agent_metadata_1.readAgentsDir)(path.join(t,payload_roots_1.AGENTS_SOURCE_DIR));return r.map(e=>({name:e.name,path:`${e.name}.md`,description:(0,agent_metadata_1.trimmedDescription)(e.description),model:e.model??"inherit",read_only:e.readOnly,memory:e.memory??"none"}))}function collectCommands(t){const r=path.join(t,payload_roots_1.COMMAND_SOURCE_DIR),e=[],n=a=>{for(const s of fs.readdirSync(a,{withFileTypes:!0})){const i=path.join(a,s.name);if(s.isDirectory())n(i);else if(s.name.endsWith(".md")){const o=path.relative(r,i),l=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(i,"utf8"));e.push({name:o.replace(/\.md$/,""),path:o,description:(0,frontmatter_1.cleanFrontmatterValue)(l.description)})}}};return n(r),e.sort((a,s)=>a.name.localeCompare(s.name))}function renderSkillsYaml(t){const r=[...new Set(t.map(n=>n.category))].sort(),e=["# Generated by scripts/gen/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing a skill.","metadata:"," title: Skills Catalog"," description: Catalog of every skill in AgentKit Engineer, generated from skills/.",` total_skills: ${t.length}`,` user_invocable: ${t.filter(n=>n.user_invocable).length}`,"categories:",...r.map(n=>` ${n}: ${yamlString(exports.CATEGORY_TITLES[n])}`),"legend:"," user_invocable: Callable directly as /<name>"," has_scripts: Ships executable scripts"," has_references: Ships reference documentation"," status: Lifecycle label (experimental | stable | deprecated); deprecated still installs","skills:"];for(const n of r){e.push(` ${n}:`);for(const a of t.filter(s=>s.category===n))e.push(` - name: ${a.name}`,` path: ${a.path}`,` description: ${yamlString(a.description)}`,` status: ${a.status}`,` user_invocable: ${a.user_invocable}`,` has_scripts: ${a.has_scripts}`,` has_references: ${a.has_references}`),a.upstream&&(e.push(` upstream: ${yamlString(a.upstream)}`),a.upstream_version&&e.push(` upstream_version: ${yamlString(a.upstream_version)}`),a.upstream_commit&&e.push(` upstream_commit: ${yamlString(a.upstream_commit)}`),a.synced&&e.push(` synced: ${yamlString(a.synced)}`))}return`${e.join(`
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,r,e,n){n===void 0&&(n=e);var a=Object.getOwnPropertyDescriptor(r,e);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,n,a)}):(function(t,r,e,n){n===void 0&&(n=e),t[n]=r[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}):function(t,r){t.default=r}),__importStar=this&&this.__importStar||(function(){var t=function(r){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[n.length]=a);return n},t(r)};return function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var n=t(r),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(e,r,n[a]);return __setModuleDefault(e,r),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.GUIDE_COMMANDS_END=exports.GUIDE_COMMANDS_START=exports.SKILL_STATUSES=exports.CATEGORY_TITLES=void 0,exports.collectSkills=collectSkills,exports.collectAgents=collectAgents,exports.collectCommands=collectCommands,exports.renderSkillsYaml=renderSkillsYaml,exports.renderAgentsYaml=renderAgentsYaml,exports.renderCommandsYaml=renderCommandsYaml,exports.renderSkillsReadme=renderSkillsReadme,exports.slashInvocation=slashInvocation,exports.renderGuideCommandSection=renderGuideCommandSection,exports.syncGuideCommandSections=syncGuideCommandSections,exports.generateCatalogs=generateCatalogs;const fs=__importStar(require("fs")),path=__importStar(require("path")),frontmatter_1=require("../lib/frontmatter"),agent_metadata_1=require("../lib/kit-installers/agent-metadata"),payload_roots_1=require("../lib/payload-roots"),SKILL_GROUPS=[],NOT_SKILLS=new Set(["common",...SKILL_GROUPS]);exports.CATEGORY_TITLES={"ai-ml":"AI & Machine Learning",frontend:"Frontend & Design",backend:"Backend Development",infrastructure:"Infrastructure & DevOps",database:"Database & Storage","dev-tools":"Development Tools",multimedia:"Multimedia & Processing",frameworks:"Frameworks & Platforms",security:"Security",design:"Design",documents:"Document Processing",gamedev:"Game Development",marketing:"Marketing & Growth",seo:"SEO & Search",utilities:"Utilities & Helpers",other:"Other"},exports.SKILL_STATUSES=new Set(["experimental","stable","deprecated"]);function yamlString(t){return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function readSkill(t,r,e){const n=path.join(t,e),a=path.join(n,"SKILL.md");if(!fs.existsSync(a))return null;const s=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(a,"utf8")),i=(0,frontmatter_1.cleanFrontmatterValue)(s.category)||"other",o=(0,frontmatter_1.cleanFrontmatterValue)(s.status)||"stable";return{name:r,path:`${e}/SKILL.md`,description:(0,frontmatter_1.cleanFrontmatterValue)(s.description),category:i in exports.CATEGORY_TITLES?i:"other",status:exports.SKILL_STATUSES.has(o)?o:"stable",user_invocable:(0,frontmatter_1.cleanFrontmatterValue)(s["user-invocable"])==="true",has_scripts:fs.existsSync(path.join(n,"scripts")),has_references:fs.existsSync(path.join(n,"references")),...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)?{upstream:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)?{upstream_commit:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)?{upstream_version:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.synced)?{synced:(0,frontmatter_1.cleanFrontmatterValue)(s.synced)}:{}}}function collectSkills(t){const r=path.join(t,payload_roots_1.SKILL_SOURCE_DIR),e=[];for(const n of fs.readdirSync(r,{withFileTypes:!0})){if(!n.isDirectory()||n.name.startsWith("."))continue;if(SKILL_GROUPS.includes(n.name)){const s=path.join(r,n.name);for(const i of fs.readdirSync(s,{withFileTypes:!0})){if(!i.isDirectory())continue;const o=readSkill(r,i.name,`${n.name}/${i.name}`);o&&e.push({...o,category:"documents"})}continue}if(NOT_SKILLS.has(n.name))continue;const a=readSkill(r,n.name,n.name);a&&e.push(a)}return e.sort((n,a)=>n.name.localeCompare(a.name))}function collectAgents(t){const{agents:r}=(0,agent_metadata_1.readAgentsDir)(path.join(t,payload_roots_1.AGENTS_SOURCE_DIR));return r.map(e=>({name:e.name,path:`${e.name}.md`,description:(0,agent_metadata_1.trimmedDescription)(e.description),model:e.model??"inherit",read_only:e.readOnly,memory:e.memory??"none"}))}function collectCommands(t){const r=path.join(t,payload_roots_1.COMMAND_SOURCE_DIR),e=[],n=a=>{for(const s of fs.readdirSync(a,{withFileTypes:!0})){const i=path.join(a,s.name);if(s.isDirectory())n(i);else if(s.name.endsWith(".md")){const o=path.relative(r,i),l=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(i,"utf8"));e.push({name:o.replace(/\.md$/,""),path:o,description:(0,frontmatter_1.cleanFrontmatterValue)(l.description)})}}};return n(r),e.sort((a,s)=>a.name.localeCompare(s.name))}function renderSkillsYaml(t){const r=[...new Set(t.map(n=>n.category))].sort(),e=["# Generated by scripts/gen/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing a skill.","metadata:"," title: Skills Catalog"," description: Catalog of every skill in AgentKit Engineer, generated from skills/.",` total_skills: ${t.length}`,` user_invocable: ${t.filter(n=>n.user_invocable).length}`,"categories:",...r.map(n=>` ${n}: ${yamlString(exports.CATEGORY_TITLES[n])}`),"legend:"," user_invocable: Callable directly as /<name>"," has_scripts: Ships executable scripts"," has_references: Ships reference documentation"," status: Lifecycle label (experimental | stable | deprecated); deprecated still installs","skills:"];for(const n of r){e.push(` ${n}:`);for(const a of t.filter(s=>s.category===n))e.push(` - name: ${a.name}`,` path: ${a.path}`,` description: ${yamlString(a.description)}`,` status: ${a.status}`,` user_invocable: ${a.user_invocable}`,` has_scripts: ${a.has_scripts}`,` has_references: ${a.has_references}`),a.upstream&&(e.push(` upstream: ${yamlString(a.upstream)}`),a.upstream_version&&e.push(` upstream_version: ${yamlString(a.upstream_version)}`),a.upstream_commit&&e.push(` upstream_commit: ${yamlString(a.upstream_commit)}`),a.synced&&e.push(` synced: ${yamlString(a.synced)}`))}return`${e.join(`
2
2
  `)}
3
3
  `}function renderAgentsYaml(t){const r=["# Generated by scripts/gen/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing an agent.","metadata:"," title: Agents Catalog"," description: Catalog of every subagent in AgentKit Engineer, generated from agents/.",` total_agents: ${t.length}`,"legend:"," model: Pinned model, or `inherit` when the host decides"," read_only: Cannot edit files or shell out (derived from its tools)"," memory: Persistent-memory scope (project | user | none)","agents:"];for(const e of t)r.push(` - name: ${e.name}`,` path: ${e.path}`,` description: ${yamlString(e.description)}`,` model: ${e.model}`,` read_only: ${e.read_only}`,` memory: ${e.memory}`);return`${r.join(`
4
4
  `)}
@@ -0,0 +1,22 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),s=0;s<r.length;s++)r[s]!=="default"&&__createBinding(t,e,r[s]);return __setModuleDefault(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.AGENT_MAP=exports.SKILL_RENAME_MAP=exports.GAMEDEV_AGENTS=exports.SKIPPED_UPSTREAM_AGENTS=exports.SKIPPED_UPSTREAM_SKILLS=exports.GAMEDEV_UPSTREAM_URL=void 0,exports.stampSkillProvenance=stampSkillProvenance,exports.sanitizeUpstreamBody=sanitizeUpstreamBody,exports.transformUpstreamSkill=transformUpstreamSkill,exports.transformUpstreamAgent=transformUpstreamAgent,exports.syncGamedevFromDir=syncGamedevFromDir;const child_process_1=require("child_process"),fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),generate_catalogs_1=require("./generate-catalogs"),check_upstream_1=require("./check-upstream");exports.GAMEDEV_UPSTREAM_URL="https://github.com/donchitos/claude-code-game-studios",exports.SKIPPED_UPSTREAM_SKILLS=new Set(["adopt","brainstorm","changelog","code-review","help","onboard","retrospective","security-audit","settings","skill-improve","skill-test","start","tech-debt","architecture-decision","architecture-review","bug-report","bug-triage","create-architecture","create-epics","create-stories","dev-story","estimate","milestone-review","perf-profile","qa-plan","regression-suite","reverse-document","scope-check","smoke-check","sprint-plan","sprint-status","story-done","story-readiness","test-evidence-review","test-flakiness","test-helpers","test-setup","ux-design","ux-review"]),exports.SKIPPED_UPSTREAM_AGENTS=new Set(["analytics-engineer","devops-engineer","lead-programmer","performance-analyst","producer","qa-lead","qa-tester","release-manager","security-engineer","technical-director","ux-designer"]),exports.GAMEDEV_AGENTS=new Set(["accessibility-specialist","ai-programmer","art-director","audio-director","community-manager","creative-director","economy-designer","engine-programmer","game-designer","gameplay-programmer","godot-csharp-specialist","godot-gdextension-specialist","godot-gdscript-specialist","godot-shader-specialist","godot-specialist","level-designer","live-ops-designer","localization-lead","narrative-director","network-programmer","prototyper","sound-designer","systems-designer","technical-artist","tools-programmer","ue-blueprint-specialist","ue-gas-specialist","ue-replication-specialist","ue-umg-specialist","ui-programmer","unity-addressables-specialist","unity-dots-specialist","unity-shader-specialist","unity-specialist","unity-ui-specialist","unreal-specialist","world-builder","writer"]),exports.SKILL_RENAME_MAP={"design-system":"game-design-system"},exports.AGENT_MAP={producer:"project-manager","technical-director":"planner","lead-programmer":"fullstack-developer","devops-engineer":"fullstack-developer","security-engineer":"code-reviewer","performance-analyst":"debugger","analytics-engineer":"researcher","analytics-specialist":"researcher","qa-lead":"tester","qa-tester":"tester","release-manager":"git-manager","ux-designer":"ui-ux-designer","ui-designer":"ui-programmer","narrative-designer":"narrative-director","localization-specialist":"localization-lead"};const COMPLETION_CONTRACT=["## Completion Report","","End every run with this block (`rules/orchestration-protocol.md`, `rules/verification-before-completion.md`):","","```","Status: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT","Summary: <1-2 sentences \u2014 what changed, or what was found>","Concerns/Blockers: <required unless the status is DONE>","```"].join(`
2
+ `);function stampSkillProvenance(n,e){const t=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n/);if(!t)return n;const r=t[1].split(/\r?\n/).filter(s=>!/^(upstream|upstream_version|upstream_commit|synced):/.test(s.trim()));return r.push(`upstream: ${e.upstreamUrl}`),e.version&&r.push(`upstream_version: "${e.version}"`),e.commit&&r.push(`upstream_commit: "${e.commit}"`),r.push(`synced: "${e.synced}"`),`---
3
+ ${r.join(`
4
+ `)}
5
+ ---
6
+ ${n.slice(t[0].length)}`}function sanitizeUpstreamBody(n){let e=n.replace(/\r\n/g,`
7
+ `);return e=e.replace(/```bash\n[^`]*yaml-helper\.sh[\s\S]*?```\n?/g,""),e=e.replace(/^!`bash [^`\n]*yaml-helper\.sh[^`\n]*`\n?/gm,""),e=e.replace(/`\.claude\/rules\/scene-files\.md`/g,"the `.tscn`/`.tres` scene-file conventions"),e=e.replace(/\.claude\/(skills|scripts|agents|commands|templates|hooks|rules|plans|tasks|docs)\//g,"$1/"),e=e.replace(/subagent_type\s*([=:])\s*"?([A-Za-z][A-Za-z0-9_-]*)"?/g,(t,r,s)=>`subagent_type${r}"${exports.AGENT_MAP[s]??(exports.GAMEDEV_AGENTS.has(s)?s:"fullstack-developer")}"`),e=e.replace(/`([A-Za-z][A-Za-z0-9-]*)`(\s+(?:sub)?agents?\b)/g,(t,r,s)=>`\`${exports.AGENT_MAP[r]??(exports.GAMEDEV_AGENTS.has(r)?r:"fullstack-developer")}\`${s}`),e=e.replace(/`\.\.\/[\w./-]+\.md`/g,t=>t.replace(/^`\.\.\//,"`")),e=e.replace(/(?<![\w/.~<-])\/code-review(?![a-z0-9:/-])/g,"/ak-code-review"),e=e.replace(/(?<![\w/.~<-])\/(architecture-decision|art-bible|asset-audit|asset-spec|balance-check|consistency-check|content-audit|create-architecture|create-control-manifest|day-one-patch|design-review|game-design-system|gate-check|launch-checklist|localize|map-systems|milestone-review|patch-notes|perf-profile|playtest-report|project-stage-detect|propagate-design-change|prototype|quick-design|release-checklist|reverse-document|review-all-gdds|scope-check|setup-engine|soak-test|vertical-slice)(?![a-z0-9:/-])/g,"/gamedev $1"),e=e.replace(/\[%\/weight\/count\]/g,"[percent/weight/count]"),e=e.replace(/docs\/engine-reference\/\[engine\]\/deprecated-apis\.md/g,"docs/engine-reference/engine/deprecated-apis.md"),e.trim()+`
8
+ `}function parseMarkdownParts(n,e){const t=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/),r=t?t[1]:"",s=r.match(/^description:\s*(.+)$/m),i=s?s[1].trim().replace(/^["']|["']$/g,""):e;return{fm:r,desc:i.replace(/"/g,'\\"'),body:sanitizeUpstreamBody(t?t[2]:n)}}function transformUpstreamSkill(n,e,t){const{desc:r,body:s}=parseMarkdownParts(n,`Game studio ${e} workflow`),i=`---
9
+ name: ${e}
10
+ description: "${r}"
11
+ ---
12
+
13
+ ${s}`;return t?stampSkillProvenance(i,t):i}function transformUpstreamAgent(n,e){const{fm:t,desc:r,body:s}=parseMarkdownParts(n,`Game studio ${e} specialist`),i=t.match(/^tools:\s*(.+)$/m)?.[1]?.trim()??"Read, Glob, Grep, Write, Edit, Bash";return`---
14
+ name: ${e}
15
+ description: "${r}"
16
+ model: sonnet
17
+ tools: ${i}
18
+ ---
19
+
20
+ ${s}
21
+ ${COMPLETION_CONTRACT}
22
+ `}function shouldSync(n,e,t,r,s,i){if(i||!fs.existsSync(s))return!0;if(!e||e===t)return!1;try{return(0,child_process_1.execFileSync)("git",["-C",n,"diff","--quiet",e,t,"--",r]),!1}catch{return!0}}function syncGamedevFromDir(n,e,t,r=!1){const s=path.join(n,".claude","skills");if(!fs.existsSync(s))throw new Error(`Missing .claude/skills in upstream source: ${n}`);const i=path.join(e,"skills","gamedev");fs.mkdirSync(i,{recursive:!0});const d=path.join(i,"SKILL.md"),f=fs.existsSync(d)?fs.readFileSync(d,"utf8"):"",o=f.match(/^upstream_commit:\s*["']?([0-9a-f]{7,40})["']?/m)?.[1]??null,_=f.match(/^upstream_version:\s*["']?([^"'\r\n]+)["']?/m)?.[1]??null;let p=0;const v=[];for(const a of fs.readdirSync(s,{withFileTypes:!0}).filter(c=>c.isDirectory())){if(exports.SKIPPED_UPSTREAM_SKILLS.has(a.name))continue;const c=path.join(s,a.name),l=path.join(c,"SKILL.md");if(!fs.existsSync(l))continue;const u=exports.SKILL_RENAME_MAP[a.name]??a.name,y=path.join(i,u),m=path.join(y,"SKILL.md"),A=!fs.existsSync(m);if(shouldSync(n,o,t.commit,`.claude/skills/${a.name}/SKILL.md`,m,r)){fs.mkdirSync(y,{recursive:!0});const S=transformUpstreamSkill(fs.readFileSync(l,"utf8"),u);(A||S!==fs.readFileSync(m,"utf8"))&&(fs.writeFileSync(m,S,"utf8"),A&&v.push(u),p++)}for(const S of["CONTRACT.md","references"]){const x=path.join(c,S);if(!fs.existsSync(x))continue;const $=fs.statSync(x).isDirectory()?fs.readdirSync(x).filter(g=>g.endsWith(".md")).map(g=>path.join("references",g)):[S];for(const g of $){const h=path.join(y,g);if(shouldSync(n,o,t.commit,`.claude/skills/${a.name}/${g}`,h,r)){fs.mkdirSync(path.dirname(h),{recursive:!0});const w=sanitizeUpstreamBody(fs.readFileSync(path.join(c,g),"utf8"));(!fs.existsSync(h)||w!==fs.readFileSync(h,"utf8"))&&(fs.writeFileSync(h,w,"utf8"),p++)}}}}const E=path.join(n,".claude","agents");if(fs.existsSync(E)){const a=path.join(e,"agent-kit","shared","gamedev","agents");fs.mkdirSync(a,{recursive:!0});for(const c of fs.readdirSync(E).filter(l=>l.endsWith(".md"))){const l=c.replace(/\.md$/,"");if(exports.SKIPPED_UPSTREAM_AGENTS.has(l))continue;const u=path.join(a,c),y=!fs.existsSync(u);if(shouldSync(n,o,t.commit,`.claude/agents/${c}`,u,r)){const m=transformUpstreamAgent(fs.readFileSync(path.join(E,c),"utf8"),l);(y||m!==fs.readFileSync(u,"utf8"))&&(fs.writeFileSync(u,m,"utf8"),y&&v.push(`agents/${l}`),p++)}}}return f&&(o!==t.commit||_!==t.version)&&(fs.writeFileSync(d,stampSkillProvenance(f,t),"utf8"),p++),{updated:p,created:v}}function main(){const n=path.resolve(__dirname,"..",".."),e=process.argv.indexOf("--source");let t=e!==-1?path.resolve(process.argv[e+1]):"",r="";try{t||(r=fs.mkdtempSync(path.join(os.tmpdir(),"gamedev-upstream-")),(0,child_process_1.execFileSync)("git",["clone","--depth","50","--tags",`${exports.GAMEDEV_UPSTREAM_URL}.git`,r],{stdio:"inherit"}),t=r);const s=(0,child_process_1.execFileSync)("git",["-C",t,"rev-parse","HEAD"],{encoding:"utf8"}).trim(),i=(0,child_process_1.execFileSync)("git",["-C",t,"tag","--sort=-v:refname"],{encoding:"utf8"}).trim().split(/\r?\n/)[0]??"",d=new Date,f=`${String(d.getUTCFullYear()).slice(-2)}${String(d.getUTCMonth()+1).padStart(2,"0")}${String(d.getUTCDate()).padStart(2,"0")}`,o={upstreamUrl:exports.GAMEDEV_UPSTREAM_URL,version:(0,check_upstream_1.normalizeVersion)(i),commit:s,synced:f},{updated:_,created:p}=syncGamedevFromDir(t,n,o,process.argv.includes("--force"));(0,generate_catalogs_1.generateCatalogs)(n),console.log(`Synced gamedev upstream (${o.version} @ ${o.commit.slice(0,12)}): ${_} updated, ${p.length} created.`)}finally{r&&fs.rmSync(r,{recursive:!0,force:!0})}}require.main===module&&main();
@@ -0,0 +1 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,i,s){s===void 0&&(s=i);var t=Object.getOwnPropertyDescriptor(r,i);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(e,s,t)}):(function(e,r,i,s){s===void 0&&(s=i),e[s]=r[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(i){var s=[];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(s[s.length]=t);return s},e(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s=e(r),t=0;t<s.length;t++)s[t]!=="default"&&__createBinding(i,r,s[t]);return __setModuleDefault(i,r),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.UPSTREAM_SYNC_TARGETS=void 0,exports.resolveUpstreamTargets=resolveUpstreamTargets,exports.formatSyncDate=formatSyncDate,exports.probeRemoteHead=probeRemoteHead,exports.syncUpstreamTarget=syncUpstreamTarget;const child_process_1=require("child_process"),fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),check_upstream_1=require("./check-upstream"),generate_catalogs_1=require("./generate-catalogs"),sync_gamedev_upstream_1=require("./sync-gamedev-upstream"),upstream_skill_syncers_1=require("./upstream-skill-syncers"),upstream_suite_syncers_1=require("./upstream-suite-syncers");exports.UPSTREAM_SYNC_TARGETS=[{id:"gamedev",upstreamUrl:sync_gamedev_upstream_1.GAMEDEV_UPSTREAM_URL,skills:["gamedev"],routerSkill:"gamedev",pinBySemverTag:!0,syncFromDir:sync_gamedev_upstream_1.syncGamedevFromDir},{id:"seo",upstreamUrl:"https://github.com/AgriciDaniel/claude-seo",skills:["seo"],routerSkill:"seo",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncSeoFromDir},{id:"expo",upstreamUrl:"https://github.com/expo/skills",skills:["expo"],routerSkill:"expo",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncExpoFromDir},{id:"stripe",upstreamUrl:"https://github.com/stripe/ai",skills:["stripe"],routerSkill:"stripe",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncStripeFromDir},{id:"twilio",upstreamUrl:"https://github.com/twilio/ai",skills:["twilio"],routerSkill:"twilio",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncTwilioFromDir},{id:"cti-expert",upstreamUrl:"https://github.com/7onez/cti-expert",skills:["cti-expert"],routerSkill:"cti-expert",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncCtiExpertFromDir},{id:"typesafe-ai",upstreamUrl:"https://github.com/typesafe-ai/skills",skills:["typesafe-ai"],routerSkill:"typesafe-ai",pinBySemverTag:!0,syncFromDir:upstream_skill_syncers_1.syncTypesafeAiFromDir},{id:"fomo-cc",upstreamUrl:"https://github.com/zack-the-worker/fomo-cc",skills:["fomo-cc"],routerSkill:"fomo-cc",pinBySemverTag:!1,syncFromDir:upstream_skill_syncers_1.syncFomoCcFromDir},{id:"ui-ux-pro-max",upstreamUrl:"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill",skills:["ui-ux-pro-max"],routerSkill:"ui-ux-pro-max",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncUiUxProMaxFromDir},{id:"tech-graph",upstreamUrl:"https://github.com/yizhiyanhua-ai/fireworks-tech-graph",skills:["tech-graph"],routerSkill:"tech-graph",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncTechGraphFromDir},{id:"anthropics",upstreamUrl:"https://github.com/anthropics/skills",skills:["document-skills","mcp-builder","skill-creator"],routerSkill:"document-skills",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncAnthropicsFromDir},{id:"automation-recommender",upstreamUrl:"https://github.com/anthropics/claude-plugins-official",skills:["automation-recommender"],routerSkill:"automation-recommender",pinBySemverTag:!1,syncFromDir:upstream_skill_syncers_1.syncAutomationRecommenderFromDir}];function resolveUpstreamTargets(e="all"){const r=e.trim();if(!r||r==="all")return[...exports.UPSTREAM_SYNC_TARGETS];const i=r.split(",").map(t=>t.trim()).filter(Boolean),s=new Map;for(const t of i){const a=exports.UPSTREAM_SYNC_TARGETS.find(o=>o.id===t||o.skills.includes(t));if(!a){const o=exports.UPSTREAM_SYNC_TARGETS.map(c=>c.id).join(", ");throw new Error(`Unknown upstream target "${t}". Valid targets: all, ${o}`)}s.set(a.id,a)}return[...s.values()]}function formatSyncDate(e=new Date){return`${String(e.getUTCFullYear()).slice(-2)}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}function probeRemoteHead(e){try{return(0,child_process_1.execFileSync)("git",["ls-remote",`${e}.git`,"HEAD"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim().split(/\s+/)[0]||null}catch{return null}}function syncUpstreamTarget(e,r,i={}){const s=path.join(r,"skills",e.routerSkill,"SKILL.md"),t=(0,upstream_skill_syncers_1.readSkillProvenance)(s),a=!!i.force;if(!i.sourceDir&&!a&&t.commit){const l=probeRemoteHead(e.upstreamUrl);if(l&&l===t.commit)return{id:e.id,commit:l,version:t.version??"",updated:0,created:[],skippedUpToDate:!0}}let o=i.sourceDir?path.resolve(i.sourceDir):"",c="";try{o||(c=fs.mkdtempSync(path.join(os.tmpdir(),`${e.id}-upstream-`)),(0,child_process_1.execFileSync)("git",["clone","--depth","50","--tags",`${e.upstreamUrl}.git`,c],{stdio:"inherit"}),o=c);const l=(0,child_process_1.execFileSync)("git",["-C",o,"rev-parse","HEAD"],{encoding:"utf8"}).trim();let n="";e.pinBySemverTag&&(n=(0,child_process_1.execFileSync)("git",["-C",o,"tag","--sort=-v:refname"],{encoding:"utf8"}).trim().split(/\r?\n/).map(p=>(0,check_upstream_1.normalizeVersion)(p)).filter(p=>/^\d+\.\d+(?:\.\d+)?$/.test(p))[0]??t.version??"");const u=i.synced??formatSyncDate(),m={upstreamUrl:e.upstreamUrl,version:n,commit:l,synced:u},{updated:d,created:f}=e.syncFromDir(o,r,m,a);return{id:e.id,commit:l,version:n,updated:d,created:f,skippedUpToDate:!1}}finally{c&&fs.rmSync(c,{recursive:!0,force:!0})}}function main(){const e=path.resolve(__dirname,"..",".."),r=process.argv.indexOf("--target"),i=r!==-1?process.argv[r+1]??"all":"all",s=process.argv.indexOf("--source"),t=s!==-1?process.argv[s+1]:void 0,a=process.argv.includes("--force"),o=resolveUpstreamTargets(i);if(t&&o.length>1)throw new Error("--source can only be used when syncing a single --target.");let c=0;for(const l of o){const n=syncUpstreamTarget(l,e,{sourceDir:t,force:a});c+=n.updated;const u=n.version?`${n.version} @ ${n.commit.slice(0,12)}`:n.commit.slice(0,12),m=n.skippedUpToDate?"already at HEAD":`${n.updated} updated, ${n.created.length} created`;console.log(`[${n.id}] (${u}): ${m}`)}c>0&&(0,generate_catalogs_1.generateCatalogs)(e)}require.main===module&&main();
@@ -0,0 +1,5 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&__createBinding(n,t,r[i]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.readSkillProvenance=readSkillProvenance,exports.shouldSyncPath=shouldSyncPath,exports.syncDirectoryTree=syncDirectoryTree,exports.replaceBodyFromMarker=replaceBodyFromMarker,exports.stampRouterIfChanged=stampRouterIfChanged,exports.syncSkillBodyFromMarker=syncSkillBodyFromMarker,exports.syncTypesafeAiFromDir=syncTypesafeAiFromDir,exports.syncFomoCcFromDir=syncFomoCcFromDir,exports.syncAutomationRecommenderFromDir=syncAutomationRecommenderFromDir;const child_process_1=require("child_process"),fs=__importStar(require("fs")),path=__importStar(require("path")),sync_gamedev_upstream_1=require("./sync-gamedev-upstream"),IGNORED_NAMES=new Set([".git","__pycache__",".pytest_cache",".DS_Store"]),TEXT_EXTS=new Set([".md",".yaml",".yml",".json",".py",".sh",".ps1",".js",".ts",".txt",".html",".css",".csv",".xml",".xsd",".tex",".lock",".svg"]);function readSkillProvenance(e){if(!fs.existsSync(e))return{commit:null,version:null};const t=fs.readFileSync(e,"utf8"),n=t.match(/^upstream_commit:\s*["']?([0-9a-f]{7,40})["']?/m)?.[1]??null,r=t.match(/^upstream_version:\s*["']?([^"'\r\n]+)["']?/m)?.[1]??null;return{commit:n,version:r}}function shouldSyncPath(e,t,n,r,i,s){if(s||!fs.existsSync(i)||!t)return!0;if(t===n)return!1;try{return(0,child_process_1.execFileSync)("git",["-C",e,"diff","--quiet",t,n,"--",r]),!1}catch{return!0}}function isTextFile(e){const t=path.basename(e);return t==="LICENSE"||t==="NOTICE"?!0:TEXT_EXTS.has(path.extname(e).toLowerCase())}function syncDirectoryTree(e){const t=e.srcSubdir?path.join(e.sourceDir,e.srcSubdir):e.sourceDir;if(!fs.existsSync(t))return{updated:0,created:[]};let n=0;const r=[],i=(s,l)=>{for(const o of fs.readdirSync(s,{withFileTypes:!0})){if(IGNORED_NAMES.has(o.name)||o.name.endsWith(".pyc"))continue;const c=[...l,o.name],u=c.join("/");if(e.skipRel?.(u,o.isDirectory()))continue;const d=path.join(s,o.name);if(o.isDirectory()){i(d,c);continue}const f=path.join(e.destDir,...c),p=e.srcSubdir?`${e.srcSubdir.replace(/\\/g,"/")}/${u}`:u;if(!shouldSyncPath(e.sourceDir,e.oldCommit,e.newCommit,p,f,e.force))continue;const a=!fs.existsSync(f);if(fs.mkdirSync(path.dirname(f),{recursive:!0}),e.transformText&&isTextFile(d)){const m=e.transformText(fs.readFileSync(d,"utf8"),u);(a||m!==fs.readFileSync(f,"utf8"))&&(fs.writeFileSync(f,m,"utf8"),a&&r.push(u),n++)}else{const m=fs.readFileSync(d);(a||Buffer.compare(m,fs.readFileSync(f))!==0)&&(fs.copyFileSync(d,f),a&&r.push(u),n++)}}};return i(t,[]),{updated:n,created:r}}function replaceBodyFromMarker(e,t,n,r){const i=t.replace(/\r\n/g,`
2
+ `),s=e.indexOf(n),l=i.indexOf(n);if(s!==-1&&l!==-1)return(0,sync_gamedev_upstream_1.stampSkillProvenance)(e.slice(0,s)+i.slice(l),r);const o=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n/),c=i.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n/),u=o?o[0]:"",d=c?i.slice(c[0].length):i;return(0,sync_gamedev_upstream_1.stampSkillProvenance)(`${u}${d}`,r)}function stampRouterIfChanged(e,t,n){if(!fs.existsSync(e))return!1;const r=fs.readFileSync(e,"utf8"),i=n?n(r):r,s=(0,sync_gamedev_upstream_1.stampSkillProvenance)(i,t);return s===r?!1:(fs.writeFileSync(e,s,"utf8"),!0)}function syncSkillBodyFromMarker(e,t,n,r,i,s,l,o){const c=path.join(e,t,"SKILL.md"),u=t?`${t}/SKILL.md`:"SKILL.md";if(fs.existsSync(c)&&fs.existsSync(n)&&shouldSyncPath(e,r,i.commit,u,n,l)){const d=fs.readFileSync(c,"utf8"),f=replaceBodyFromMarker(fs.readFileSync(n,"utf8"),o?o(d):d,s,i);return f!==fs.readFileSync(n,"utf8")?(fs.writeFileSync(n,f,"utf8"),!0):!1}return stampRouterIfChanged(n,i)}function syncTypesafeAiFromDir(e,t,n,r=!1){const i=path.join(t,"skills","typesafe-ai"),s=path.join(i,"SKILL.md"),{commit:l}=readSkillProvenance(s),o=fs.existsSync(path.join(e,"skills","typesafe-ai"))?"skills/typesafe-ai":"",c=syncDirectoryTree({sourceDir:e,srcSubdir:o,destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:u=>u==="SKILL.md"});return syncSkillBodyFromMarker(e,o,s,l,n,`
3
+ # Build with TypeSafe`,r)&&c.updated++,c}function syncFomoCcFromDir(e,t,n,r=!1){const i=path.join(t,"skills","fomo-cc"),s=path.join(i,"SKILL.md"),{commit:l}=readSkillProvenance(s),o={...n,version:""},c=syncDirectoryTree({sourceDir:e,srcSubdir:"",destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:u=>u!=="README.md"&&u!=="references"&&!u.startsWith("references/")});return syncSkillBodyFromMarker(e,"",s,l,o,`
4
+ # FOMO-CC:`,r)&&c.updated++,c}function syncAutomationRecommenderFromDir(e,t,n,r=!1){const i=path.join(t,"skills","automation-recommender"),s=path.join(i,"SKILL.md"),{commit:l,version:o}=readSkillProvenance(s),c=fs.existsSync(path.join(e,"plugins","claude-code-setup"))?"plugins/claude-code-setup":"",u=c?`${c}/skills/claude-automation-recommender`:"",d=path.join(e,c,".claude-plugin","plugin.json"),f=fs.existsSync(d)?JSON.parse(fs.readFileSync(d,"utf8")).version:void 0,p={...n,version:n.version||f||o||""},a=syncDirectoryTree({sourceDir:e,srcSubdir:u,destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:y=>y==="SKILL.md"||y==="references/multi-kit-targets.md"}),m=syncDirectoryTree({sourceDir:e,srcSubdir:c,destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:y=>y!=="LICENSE"});return a.updated+=m.updated,a.created.push(...m.created),syncSkillBodyFromMarker(e,u,s,l,p,`
5
+ # Claude Automation Recommender`,r)&&a.updated++,a}
@@ -0,0 +1,12 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(s,n,e,i){i===void 0&&(i=e);var t=Object.getOwnPropertyDescriptor(n,e);(!t||("get"in t?!n.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(s,i,t)}):(function(s,n,e,i){i===void 0&&(i=e),s[i]=n[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(s,n){Object.defineProperty(s,"default",{enumerable:!0,value:n})}):function(s,n){s.default=n}),__importStar=this&&this.__importStar||(function(){var s=function(n){return s=Object.getOwnPropertyNames||function(e){var i=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[i.length]=t);return i},s(n)};return function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var i=s(n),t=0;t<i.length;t++)i[t]!=="default"&&__createBinding(e,n,i[t]);return __setModuleDefault(e,n),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.SKIPPED_EXPO_SKILLS=void 0,exports.sanitizeExpoSkillMarkdown=sanitizeExpoSkillMarkdown,exports.syncExpoFromDir=syncExpoFromDir,exports.syncStripeFromDir=syncStripeFromDir,exports.syncTwilioFromDir=syncTwilioFromDir,exports.syncCtiExpertFromDir=syncCtiExpertFromDir,exports.syncUiUxProMaxFromDir=syncUiUxProMaxFromDir,exports.syncTechGraphFromDir=syncTechGraphFromDir,exports.syncSeoFromDir=syncSeoFromDir,exports.syncAnthropicsFromDir=syncAnthropicsFromDir;const fs=__importStar(require("fs")),path=__importStar(require("path")),upstream_skill_syncers_1=require("./upstream-skill-syncers");exports.SKIPPED_EXPO_SKILLS=new Set(["expo-skill-feedback","expo-tailwind-setup"]);const CTI_EXPERT_PATHS=new Set(["AGENTS.md","LICENSE","README.md","requirements.txt","analysis","connectors","engine","experience","guides","handbook","intel_engine","output","scripts","techniques","validation","workflows"]);function sanitizeExpoSkillMarkdown(s,n){let e=s.replace(/\r\n/g,`
2
+ `).replace(/(?:\n+---\n+)?\n+## Submitting Feedback[\s\S]*$/,`
3
+ `);return n==="expo-overview/SKILL.md"&&(e=e.split(`
4
+ `).filter(i=>!i.includes("expo-tailwind-setup")&&!i.includes("expo-skill-feedback")).join(`
5
+ `)),e.endsWith(`
6
+ `)?e:`${e}
7
+ `}function syncExpoFromDir(s,n,e,i=!1){const t=path.join(n,"skills","expo"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=fs.existsSync(path.join(s,"plugins","expo","skills"))?"plugins/expo/skills":"skills",a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:o,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:(r,c)=>!c&&!r.includes("/")||exports.SKIPPED_EXPO_SKILLS.has(r.split("/")[0]),transformText:(r,c)=>c.endsWith("/SKILL.md")?sanitizeExpoSkillMarkdown(r,c):r});return(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,{...e,version:""})&&a.updated++,a}function syncStripeFromDir(s,n,e,i=!1){const t=path.join(n,"skills","stripe"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"skills",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:(c,m)=>!m&&!c.includes("/")}),a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:c=>c!=="LICENSE"});return o.updated+=a.updated,(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,{...e,version:""},c=>c.replace(/Provenance is pinned to commit `[0-9a-f]+`/,`Provenance is pinned to commit \`${e.commit}\``))&&o.updated++,o}function syncTwilioFromDir(s,n,e,i=!1){const t=path.join(n,"skills","twilio"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o={updated:0,created:[]};for(const r of["skills/twilio","skills/sendgrid"]){const c=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:r,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:m=>m.split("/").includes("assets"),transformText:(m,u)=>u.endsWith("/agents/openai.yaml")?m.replace(/^[ \t]*icon_(?:small|large):.*(?:\r?\n)?/gm,""):m});o.updated+=c.updated,o.created.push(...c.created)}const a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>r!=="LICENSE"});return o.updated+=a.updated,(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,{...e,version:""})&&o.updated++,o}function syncCtiExpertFromDir(s,n,e,i=!1){const t=path.join(n,"skills","cti-expert"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>!CTI_EXPERT_PATHS.has(r.split("/")[0]),transformText:(r,c)=>c==="handbook/operator-queries.md"?r.replace(/\.\/quiak-report\.md/g,"./quick-report.md"):r}),a=path.join(s,"SKILL.md");if(fs.existsSync(a)&&fs.existsSync(l)){const r=fs.readFileSync(a,"utf8"),c=r.match(/^version:\s*["']?([^"'\r\n]+)["']?/m)?.[1]??e.version,m={...e,version:c};if((0,upstream_skill_syncers_1.shouldSyncPath)(s,d,e.commit,"SKILL.md",l,i)||d!==e.commit){const u=(0,upstream_skill_syncers_1.replaceBodyFromMarker)(fs.readFileSync(l,"utf8"),r,`
8
+ ---
9
+
10
+ ## 1. Quick Start`,m);u!==fs.readFileSync(l,"utf8")&&(fs.writeFileSync(l,u,"utf8"),o.updated++)}}return o}function syncUiUxProMaxFromDir(s,n,e,i=!1){const t=path.join(n,"skills","ui-ux-pro-max"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=fs.existsSync(path.join(s,".claude","skills","ui-ux-pro-max"))?".claude/skills/ui-ux-pro-max":"",a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:o,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>r==="SKILL.md"||r==="scripts/tests/test_catalog_refresh.py"||r==="scripts/tests/test_relevance_evaluator.py"||r==="scripts/tests/fixtures"||r.startsWith("scripts/tests/fixtures/")});return(0,upstream_skill_syncers_1.syncSkillBodyFromMarker)(s,o,l,d,e,`
11
+ # UI/UX Pro Max`,i,r=>r.replace(/\$\{CLAUDE_PLUGIN_ROOT\}\/(?=\.claude\/skills\/ui-ux-pro-max\/)/g,""))&&a.updated++,a}function syncTechGraphFromDir(s,n,e,i=!1){const t=path.join(n,"skills","tech-graph"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=fs.existsSync(path.join(s,"skills","fireworks-tech-graph"))?"skills/fireworks-tech-graph":"",a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:o,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>r==="SKILL.md"||r==="README.md"||r==="README.zh.md"||r==="tests/test_skill_compatibility.py"||r==="assets/samples"||r.startsWith("assets/samples/")});return(0,upstream_skill_syncers_1.syncSkillBodyFromMarker)(s,o,l,d,e,`
12
+ # Fireworks Tech Graph`,i)&&a.updated++,a}function syncSeoFromDir(s,n,e,i=!1){const t=path.join(n,"skills","seo"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"skills/seo/references",destDir:path.join(t,"references"),oldCommit:d,newCommit:e.commit,force:i}),a=path.join(s,"skills");if(fs.existsSync(a)){const r=fs.readdirSync(a,{withFileTypes:!0}).filter(c=>c.isDirectory()&&c.name.startsWith("seo-")&&fs.existsSync(path.join(t,c.name)));for(const c of r)for(const m of["references","assets","templates"]){const u=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:`skills/${c.name}/${m}`,destDir:path.join(t,c.name,m),oldCommit:d,newCommit:e.commit,force:i});o.updated+=u.updated,o.created.push(...u.created.map(p=>`${c.name}/${m}/${p}`))}}return(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,e)&&o.updated++,o}function syncAnthropicsFromDir(s,n,e,i=!1){const t={...e,version:""},l=path.join(n,"skills","document-skills","SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o={updated:0,created:[]};for(const a of["docx","pdf","pptx","xlsx"]){const r=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:`skills/${a}`,destDir:path.join(n,"skills","document-skills",a),oldCommit:d,newCommit:e.commit,force:i});o.updated+=r.updated,o.created.push(...r.created.map(c=>`document-skills/${a}/${c}`))}for(const a of["mcp-builder","skill-creator"]){const r=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:`skills/${a}`,destDir:path.join(n,"skills",a),oldCommit:d,newCommit:e.commit,force:i,skipRel:c=>c==="SKILL.md"});o.updated+=r.updated,o.created.push(...r.created.map(c=>`${a}/${c}`)),(0,upstream_skill_syncers_1.stampRouterIfChanged)(path.join(n,"skills",a,"SKILL.md"),t)&&o.updated++}return(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,t)&&o.updated++,o}
@@ -1,2 +1,2 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&__createBinding(r,e,n[i]);return __setModuleDefault(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.readKitConfig=readKitConfig,exports.writeKitConfig=writeKitConfig,exports.readSection=readSection,exports.readHooksEnabled=readHooksEnabled,exports.writeHooksEnabled=writeHooksEnabled,exports.updateSection=updateSection;const fs=__importStar(require("fs")),path=__importStar(require("path"));function readKitConfig(t){if(!fs.existsSync(t))return{};try{const e=JSON.parse(fs.readFileSync(t,"utf8"));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}function writeKitConfig(t,e){fs.mkdirSync(path.dirname(t),{recursive:!0}),fs.writeFileSync(t,`${JSON.stringify(e,null,2)}
2
- `)}function readSection(t,e){const r=t[e];return typeof r=="object"&&r!==null?{...r}:{}}function readHooksEnabled(t){return readKitConfig(t).hooksEnabled!==!1}function writeHooksEnabled(t,e){const r=readKitConfig(t);r.hooksEnabled=e,writeKitConfig(t,r)}function updateSection(t,e,r){const n=readKitConfig(t),i=readSection(n,e);r(i),n[e]=i,writeKitConfig(t,n)}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&__createBinding(r,t,n[i]);return __setModuleDefault(r,t),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.readKitConfig=readKitConfig,exports.writeKitConfig=writeKitConfig,exports.readSection=readSection,exports.readHooksEnabled=readHooksEnabled,exports.writeHooksEnabled=writeHooksEnabled,exports.isPlainObject=isPlainObject,exports.mergePreserved=mergePreserved,exports.mergePreservedKitConfig=mergePreservedKitConfig,exports.updateSection=updateSection;const fs=__importStar(require("fs")),path=__importStar(require("path"));function readKitConfig(e){if(!fs.existsSync(e))return{};try{const t=JSON.parse(fs.readFileSync(e,"utf8"));return isPlainObject(t)?t:{}}catch{return{}}}function writeKitConfig(e,t){fs.mkdirSync(path.dirname(e),{recursive:!0}),fs.writeFileSync(e,`${JSON.stringify(t,null,2)}
2
+ `)}function readSection(e,t){const r=e[t];return typeof r=="object"&&r!==null?{...r}:{}}function readHooksEnabled(e){return readKitConfig(e).hooksEnabled!==!1}function writeHooksEnabled(e,t){const r=readKitConfig(e);r.hooksEnabled=t,writeKitConfig(e,r)}function isPlainObject(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mergePreserved(e,t){if(Array.isArray(e)&&Array.isArray(t)){const r=new Set(e.map(i=>JSON.stringify(i))),n=[...e];for(const i of t)r.has(JSON.stringify(i))||n.push(i);return n}if(isPlainObject(e)&&isPlainObject(t)){const r={...t};for(const[n,i]of Object.entries(e))r[n]=n in r?mergePreserved(i,r[n]):i;return r}return e}function mergePreservedKitConfig(e,t){if(Object.keys(t).length===0)return;const r=mergePreserved(t,readKitConfig(e));isPlainObject(r)&&writeKitConfig(e,r)}function updateSection(e,t,r){const n=readKitConfig(e),i=readSection(n,t);r(i),n[t]=i,writeKitConfig(e,n)}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,o,n){n===void 0&&(n=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(e,n,t)}):(function(e,r,o,n){n===void 0&&(n=o),e[n]=r[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(o){var n=[];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[n.length]=t);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var n=e(r),t=0;t<n.length;t++)n[t]!=="default"&&__createBinding(o,r,n[t]);return __setModuleDefault(o,r),o}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runLogin=runLogin,exports.runLogout=runLogout,exports.runWhoami=runWhoami;const p=__importStar(require("@clack/prompts")),path=__importStar(require("path")),agentkit_home_1=require("../agentkit-home"),cache_1=require("../entitlement/cache"),config_1=require("../entitlement/config"),check_1=require("../entitlement/check"),retention_1=require("../payload/retention"),open_browser_1=require("../open-browser"),version_check_1=require("../version-check"),source_1=require("../payload/source"),logger_1=require("../logger"),auth_file_1=require("./auth-file"),device_flow_1=require("./device-flow"),resolve_1=require("./resolve"),token_store_1=require("./token-store");async function fetchUserLogin(e,r){const t=await(await(r.fetchImpl??fetch)(`${(0,config_1.githubApiBase)(r.env)}/user`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},signal:AbortSignal.timeout(version_check_1.REQUEST_TIMEOUT_MS)})).json(),l=t&&typeof t=="object"?t.login:null;return typeof l=="string"?l:"unknown"}async function runLogin(e={},r={}){const o=e.env??process.env,n=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)(),t=(0,config_1.githubAppClientId)(o);if(!t)return(0,logger_1.printError)("No GitHub App client id is configured for this build."),(0,logger_1.printInfo)("Set AGENTKIT_GITHUB_CLIENT_ID, or update the CLI once the App exists."),1;const l=(0,config_1.githubOauthBase)(o),d=e.fetchImpl?{fetchImpl:e.fetchImpl}:{};let c;try{c=await(0,device_flow_1.requestDeviceCode)({clientId:t,oauthBase:l,...d})}catch(u){return(0,logger_1.printError)(`Could not start the device flow: ${u.message}`),1}(0,logger_1.printInfo)(`Open ${c.verificationUri} and enter ${c.userCode}`),r.openBrowser!==!1&&(0,open_browser_1.openBrowser)(c.verificationUri);const i=await(0,device_flow_1.pollForToken)({clientId:t,deviceCode:c.deviceCode,interval:c.interval,expiresIn:c.expiresIn,oauthBase:l,...e.sleepImpl?{sleepImpl:e.sleepImpl}:{},...d});if(!i.ok)return(0,logger_1.printError)(`Login failed: ${i.message}`),1;const h=await fetchUserLogin(i.token.accessToken,e).catch(()=>"unknown");let{store:a,warning:f}=e.store?{store:e.store,warning:null}:(0,token_store_1.getStore)({home:n});const s=p.progress({max:5});s.start("Setting up kit access");const m={accessToken:i.token.accessToken,...i.token.refreshToken?{refreshToken:i.token.refreshToken}:{},...i.token.expiresAt?{expiresAt:i.token.expiresAt}:{},...i.token.refreshExpiresAt?{refreshExpiresAt:i.token.refreshExpiresAt}:{},login:h};try{await a.set("github",JSON.stringify(m))}catch(u){if(a.kind==="keychain"&&!e.store){a=(0,token_store_1.getPlaintextStore)({home:n}),f=`\u2605 keychain write failed \u2014 stored in ${n.toDisplayPath(n.getCredentialsPath())} (0600)`;try{await a.set("github",JSON.stringify(m))}catch(v){return s.stop("Setup failed"),(0,logger_1.printError)(`Could not store the credential: ${v.message}`),1}}else return s.stop("Setup failed"),(0,logger_1.printError)(`Could not store the credential: ${u.message}`),1}s.advance(1,"Credential stored"),(0,auth_file_1.mergeAuth)({login:h,storedIn:a.kind,createdAt:Date.now(),...i.token.expiresAt?{expiresAt:i.token.expiresAt}:{},...i.token.refreshExpiresAt?{refreshExpiresAt:i.token.refreshExpiresAt}:{}},n)||(0,logger_1.printWarning)("Credential stored, but the auth metadata file could not be written."),(0,cache_1.deleteRecord)(n),s.advance(1,"Auth metadata written"),f&&(0,logger_1.printWarning)(f),(0,logger_1.printSuccess)(`Logged in as ${h} (credential: ${a.kind==="keychain"?"store":a.kind})`);const g=await(0,check_1.checkEntitlement)({interactive:!0,home:n,deps:{env:o,store:a,...d}});if(s.advance(1,"Access verified"),g.status==="active"){s.advance(1,"Fetching kit payload");try{const u=path.resolve(__dirname,"..","..",".."),v=await(0,source_1.resolveInstallSource)({version:(0,version_check_1.getPayloadVersion)(u)??"0.0.0",interactive:!0,cliRoot:u,home:n,deps:{env:o,store:a,...d}});s.advance(1,`Kit payload ready \u2014 v${v.version}`)}catch(u){s.advance(1,"Kit payload pending"),(0,logger_1.printWarning)(`Payload prefetch failed: ${u.message} \u2014 the first use will download it.`)}s.stop("Kit access ready \u2014 100%"),(0,logger_1.printSuccess)("Access to the kit repository confirmed.")}else s.stop("Verification finished"),(0,logger_1.printWarning)(`No access \u2014 ${h} cannot reach the kit repository (credential: ${g.credentialSource}).`),(0,logger_1.printInfo)("Ask the maintainer to add you as a collaborator, then run `agentkit login` again.");return g.status==="active"?0:1}async function runLogout(e={}){const r=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)();return await(e.store??(0,token_store_1.getStore)({home:r}).store).clear("github").catch(()=>{}),(0,auth_file_1.clearAuth)(r),(0,cache_1.deleteRecord)(r),(0,logger_1.printSuccess)("Logged out \u2014 the stored credential, auth metadata and entitlement cache were removed."),(0,logger_1.printInfo)(`Fetched payloads are kept at ${(0,retention_1.describePayloadPath)(r)} \u2014 remove with \`rm -rf ${r.getPayloadDir()}\` or \`agentkit uninstall\`.`),0}async function runWhoami(e={}){const r=e.env??process.env,o=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)(),n={env:r,home:o,...e.store?{store:e.store}:{},...e.fetchImpl?{fetchImpl:e.fetchImpl}:{}},t=await(0,resolve_1.resolveCredential)("github",n);if(!t.ok)return t.reason==="unusable"?(0,logger_1.printError)(`A credential exists but could not be used${t.detail?` \u2014 ${t.detail}`:""}.`):(0,logger_1.printError)("Not logged in."),(0,logger_1.printInfo)("Run `agentkit login` to authorize."),1;const l=t.source==="store"?(0,auth_file_1.readAuth)(o):null,d=t.stored?.login??l?.login??"",c=t.source==="store"?l?.storedIn??"store":t.source;(0,logger_1.printInfo)(`Login: ${d||"unknown"}`),(0,logger_1.printInfo)(`Credential: ${c}`),t.stored?.expiresAt&&(0,logger_1.printInfo)(`Token expires: ${new Date(t.stored.expiresAt).toISOString()}`);const i=await(0,check_1.checkEntitlement)({interactive:!1,home:o,deps:n});if(i.status==="active"){const h=i.via==="cache"?"via cache":i.via==="grace"?`in grace until ${new Date(i.checkedAt+cache_1.GRACE_MS).toISOString()}`:"verified live";(0,logger_1.printInfo)(`Entitlement: active (${h}, credential: ${i.credentialSource})`);const a=(0,cache_1.readRecord)(o);if(a?.deniedAt&&!a.confirmed){const f=Math.max(0,Math.ceil((a.deniedAt+cache_1.DENIAL_TTL_MS-Date.now())/6e4));(0,logger_1.printWarning)(`A recent probe suggested access was lost \u2014 confirming in ~${f}m.`)}return 0}return(0,logger_1.printInfo)(`Entitlement: revoked \u2014 credential ${i.credentialSource} has no access.`),1}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,o,n){n===void 0&&(n=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(e,n,t)}):(function(e,r,o,n){n===void 0&&(n=o),e[n]=r[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(o){var n=[];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[n.length]=t);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var n=e(r),t=0;t<n.length;t++)n[t]!=="default"&&__createBinding(o,r,n[t]);return __setModuleDefault(o,r),o}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runLogin=runLogin,exports.runLogout=runLogout,exports.runWhoami=runWhoami;const p=__importStar(require("@clack/prompts")),path=__importStar(require("path")),agentkit_home_1=require("../agentkit-home"),cache_1=require("../entitlement/cache"),config_1=require("../entitlement/config"),check_1=require("../entitlement/check"),open_browser_1=require("../open-browser"),version_check_1=require("../version-check"),source_1=require("../payload/source"),logger_1=require("../logger"),auth_file_1=require("./auth-file"),device_flow_1=require("./device-flow"),resolve_1=require("./resolve"),token_store_1=require("./token-store");async function fetchUserLogin(e,r){const t=await(await(r.fetchImpl??fetch)(`${(0,config_1.githubApiBase)(r.env)}/user`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},signal:AbortSignal.timeout(version_check_1.REQUEST_TIMEOUT_MS)})).json(),l=t&&typeof t=="object"?t.login:null;return typeof l=="string"?l:"unknown"}async function runLogin(e={},r={}){const o=e.env??process.env,n=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)(),t=(0,config_1.githubAppClientId)(o);if(!t)return(0,logger_1.printError)("No GitHub App client id is configured for this build."),(0,logger_1.printInfo)("Set AGENTKIT_GITHUB_CLIENT_ID, or update the CLI once the App exists."),1;const l=(0,config_1.githubOauthBase)(o),d=e.fetchImpl?{fetchImpl:e.fetchImpl}:{};let c;try{c=await(0,device_flow_1.requestDeviceCode)({clientId:t,oauthBase:l,...d})}catch(u){return(0,logger_1.printError)(`Could not start the device flow: ${u.message}`),1}(0,logger_1.printInfo)(`Open ${c.verificationUri} and enter ${c.userCode}`),r.openBrowser!==!1&&(0,open_browser_1.openBrowser)(c.verificationUri);const i=await(0,device_flow_1.pollForToken)({clientId:t,deviceCode:c.deviceCode,interval:c.interval,expiresIn:c.expiresIn,oauthBase:l,...e.sleepImpl?{sleepImpl:e.sleepImpl}:{},...d});if(!i.ok)return(0,logger_1.printError)(`Login failed: ${i.message}`),1;const h=await fetchUserLogin(i.token.accessToken,e).catch(()=>"unknown");let{store:a,warning:f}=e.store?{store:e.store,warning:null}:(0,token_store_1.getStore)({home:n});const s=p.progress({max:5});s.start("Setting up kit access");const m={accessToken:i.token.accessToken,...i.token.refreshToken?{refreshToken:i.token.refreshToken}:{},...i.token.expiresAt?{expiresAt:i.token.expiresAt}:{},...i.token.refreshExpiresAt?{refreshExpiresAt:i.token.refreshExpiresAt}:{},login:h};try{await a.set("github",JSON.stringify(m))}catch(u){if(a.kind==="keychain"&&!e.store){a=(0,token_store_1.getPlaintextStore)({home:n}),f=`\u2605 keychain write failed \u2014 stored in ${n.toDisplayPath(n.getCredentialsPath())} (0600)`;try{await a.set("github",JSON.stringify(m))}catch(v){return s.stop("Setup failed"),(0,logger_1.printError)(`Could not store the credential: ${v.message}`),1}}else return s.stop("Setup failed"),(0,logger_1.printError)(`Could not store the credential: ${u.message}`),1}s.advance(1,"Credential stored"),(0,auth_file_1.mergeAuth)({login:h,storedIn:a.kind,createdAt:Date.now(),...i.token.expiresAt?{expiresAt:i.token.expiresAt}:{},...i.token.refreshExpiresAt?{refreshExpiresAt:i.token.refreshExpiresAt}:{}},n)||(0,logger_1.printWarning)("Credential stored, but the auth metadata file could not be written."),(0,cache_1.deleteRecord)(n),s.advance(1,"Auth metadata written"),f&&(0,logger_1.printWarning)(f),(0,logger_1.printSuccess)(`Logged in as ${h} (credential: ${a.kind==="keychain"?"store":a.kind})`);const g=await(0,check_1.checkEntitlement)({interactive:!0,home:n,deps:{env:o,store:a,...d}});if(s.advance(1,"Access verified"),g.status==="active"){s.advance(1,"Fetching kit payload");try{const u=path.resolve(__dirname,"..","..",".."),v=await(0,source_1.resolveInstallSource)({version:(0,version_check_1.getPayloadVersion)(u)??"0.0.0",interactive:!0,cliRoot:u,home:n,deps:{env:o,store:a,...d}});s.advance(1,`Kit payload ready \u2014 v${v.version}`)}catch(u){s.advance(1,"Kit payload pending"),(0,logger_1.printWarning)(`Payload prefetch failed: ${u.message} \u2014 the first use will download it.`)}s.stop("Kit access ready \u2014 100%"),(0,logger_1.printSuccess)("Access to the kit repository confirmed.")}else s.stop("Verification finished"),(0,logger_1.printWarning)(`No access \u2014 ${h} cannot reach the kit repository (credential: ${g.credentialSource}).`),(0,logger_1.printInfo)("Ask the maintainer to add you as a collaborator, then run `agentkit login` again.");return g.status==="active"?0:1}async function runLogout(e={}){const r=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)();return await(e.store??(0,token_store_1.getStore)({home:r}).store).clear("github").catch(()=>{}),(0,auth_file_1.clearAuth)(r),(0,cache_1.deleteRecord)(r),(0,logger_1.printSuccess)("Logged out \u2014 the stored credential, auth metadata and entitlement cache were removed."),(0,logger_1.printInfo)("Fetched payloads are kept \u2014 remove them with `agentkit uninstall`."),0}async function runWhoami(e={}){const r=e.env??process.env,o=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)(),n={env:r,home:o,...e.store?{store:e.store}:{},...e.fetchImpl?{fetchImpl:e.fetchImpl}:{}},t=await(0,resolve_1.resolveCredential)("github",n);if(!t.ok)return t.reason==="unusable"?(0,logger_1.printError)(`A credential exists but could not be used${t.detail?` \u2014 ${t.detail}`:""}.`):(0,logger_1.printError)("Not logged in."),(0,logger_1.printInfo)("Run `agentkit login` to authorize."),1;const l=t.source==="store"?(0,auth_file_1.readAuth)(o):null,d=t.stored?.login??l?.login??"",c=t.source==="store"?l?.storedIn??"store":t.source;(0,logger_1.printInfo)(`Login: ${d||"unknown"}`),(0,logger_1.printInfo)(`Credential: ${c}`),t.stored?.expiresAt&&(0,logger_1.printInfo)(`Token expires: ${new Date(t.stored.expiresAt).toISOString()}`);const i=await(0,check_1.checkEntitlement)({interactive:!1,home:o,deps:n});if(i.status==="active"){const h=i.via==="cache"?"via cache":i.via==="grace"?`in grace until ${new Date(i.checkedAt+cache_1.GRACE_MS).toISOString()}`:"verified live";(0,logger_1.printInfo)(`Entitlement: active (${h}, credential: ${i.credentialSource})`);const a=(0,cache_1.readRecord)(o);if(a?.deniedAt&&!a.confirmed){const f=Math.max(0,Math.ceil((a.deniedAt+cache_1.DENIAL_TTL_MS-Date.now())/6e4));(0,logger_1.printWarning)(`A recent probe suggested access was lost \u2014 confirming in ~${f}m.`)}return 0}return(0,logger_1.printInfo)(`Entitlement: revoked \u2014 credential ${i.credentialSource} has no access.`),1}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,t,n,o){o===void 0&&(o=n);var e=Object.getOwnPropertyDescriptor(t,n);(!e||("get"in e?!t.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(r,o,e)}):(function(r,t,n,o){o===void 0&&(o=n),r[o]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),__importStar=this&&this.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(n){var o=[];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(o[o.length]=e);return o},r(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=r(t),e=0;e<o.length;e++)o[e]!=="default"&&__createBinding(n,t,o[e]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.syncCodexMcpConfig=syncCodexMcpConfig,exports.syncKimiMcpConfig=syncKimiMcpConfig,exports.syncOmpMcpConfig=syncOmpMcpConfig,exports.removePiCodegraphMcpConfig=removePiCodegraphMcpConfig,exports.isKitWrittenCodegraphEntry=isKitWrittenCodegraphEntry,exports.syncGrokMcpConfig=syncGrokMcpConfig,exports.syncDevinMcpConfig=syncDevinMcpConfig,exports.syncAugmentMcpConfig=syncAugmentMcpConfig,exports.syncCursorMcpConfig=syncCursorMcpConfig;const fs=__importStar(require("fs")),path=__importStar(require("path")),context_mode_remover_1=require("../context-mode-remover"),omp_home_1=require("../omp-home"),pi_home_1=require("../pi-home"),pi_config_json_1=require("../kit-installers/pi-config-json"),pi_packages_1=require("../kit-installers/pi-packages"),devin_home_1=require("../kit-installers/devin-home"),grok_payload_1=require("../kit-installers/grok-payload"),grok_1=require("../kit-installers/grok"),grok_config_toml_1=require("../kit-installers/grok-config-toml"),shared_1=require("../kit-installers/shared"),logger_1=require("../logger");function syncCodexMcpConfig(r,t,n){if(t==="codex"){const o=n==="global"?path.join(process.env.HOME||process.env.USERPROFILE||"",".codex","config.toml"):path.join(r,".codex","config.toml");try{(0,context_mode_remover_1.removeContextMode)({scope:n,platform:"codex",rootDir:path.dirname(o)}),(0,shared_1.ensureMcpServersInCodexConfig)(o),(0,logger_1.printSuccess)("Successfully verified MCP configuration in config.toml")}catch(e){(0,logger_1.printWarning)(`Could not ensure MCP servers in Codex config.toml: ${e.message}`)}}}function syncKimiMcpConfig(r,t,n){if(t!=="kimi")return;const o=process.env.KIMI_CODE_HOME||path.join(process.env.HOME||process.env.USERPROFILE||"",".kimi-code"),e=n==="global"?path.join(o,"mcp.json"):path.join(r,".kimi-code","mcp.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Kimi's mcp.json: ${s.message}`)}}function syncOmpMcpConfig(r,t){if(r!=="omp"||t!=="global")return;const n=path.join((0,omp_home_1.resolveOmpAgentDir)(),"mcp.json"),o={command:"codegraph",args:["serve","--mcp"]};try{const e=(0,shared_1.readJsonObject)(n);e.mcpServers={...e.mcpServers??{},codegraph:o},(0,shared_1.writeJsonObject)(n,e),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${n}`)}catch(e){(0,logger_1.printWarning)(`Could not write CodeGraph into omp's mcp.json: ${e.message}`)}}function removePiCodegraphMcpConfig(r,t,n){if(t!=="pi")return;const o=(0,pi_home_1.resolvePiBaseDir)(n,r),e=path.join(o,"mcp.json");try{const c=(0,shared_1.readJsonObject)(e),s=c.mcpServers;if(s===null||typeof s!="object"||Array.isArray(s))return;const a=s.codegraph;if(a===void 0)return;if(!isKitWrittenCodegraphEntry(a,r,n)){(0,logger_1.printWarning)(`Left the codegraph server in ${e} alone \u2014 it is not the entry this kit writes for ${n} scope here, so it is yours, a newer CodeGraph's, or a leftover aimed at another directory. Pi reaches CodeGraph through the pi-codegraph extension now; remove it by hand if it is a leftover.`);return}const i=(0,pi_home_1.piConfigPath)(o);if(!(0,pi_config_json_1.declaresPiPackage)(i,pi_packages_1.PI_CODEGRAPH_SPEC)){(0,logger_1.printWarning)(`Left the codegraph server in ${e} alone \u2014 ${i} does not declare ${pi_packages_1.PI_CODEGRAPH_SPEC}, so removing this entry would leave Pi with no route to CodeGraph. Fix that file, then re-run the installer to finish the switch.`);return}delete s.codegraph,(0,shared_1.writeJsonObject)(e,c),(0,logger_1.printSuccess)(`Removed this kit's codegraph MCP entry from ${e} \u2014 Pi reaches CodeGraph through the pi-codegraph extension now.`)}catch(c){(0,logger_1.printWarning)(`Could not clean up CodeGraph in Pi's mcp.json: ${c.message}`)}}function isKitWrittenCodegraphEntry(r,t,n){if(r===null||typeof r!="object"||Array.isArray(r))return!1;const{command:o,args:e}=r;if(o!=="codegraph"||!Array.isArray(e))return!1;const c=Object.keys(r).sort();if(c.length!==2||c[0]!=="args"||c[1]!=="command")return!1;const s=n==="project"?["serve","--mcp","--path",t]:["serve","--mcp"];if(e.length!==s.length)return!1;const a=s.indexOf("--path");return e.every((i,p)=>{if(typeof i!="string")return!1;if(p!==a+1)return i===s[p];const u=process.platform==="darwin"||process.platform==="win32",f=m=>{const g=path.resolve(m);return u?g.toLowerCase():g};return f(i)===f(s[p])})}function syncGrokMcpConfig(r,t,n){if(t!=="grok")return;const o=n==="global"?(0,grok_1.resolveGrokHome)():path.join(r,grok_payload_1.GROK_DIR),e=path.join(o,"config.toml"),c=n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"];try{(0,grok_config_toml_1.mergeGrokMcpServer)(e,"codegraph",c)&&(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Grok's config.toml: ${s.message}`)}}function syncDevinMcpConfig(r,t,n){if(t!=="devin")return;const o=n==="global"?(0,devin_home_1.resolveDevinConfigRoot)():path.join(r,devin_home_1.DEVIN_DIR),e=path.join(o,"mcp_config.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Devin's mcp_config.json: ${s.message}`)}}function syncAugmentMcpConfig(r,t,n){if(t!=="augment")return;const o=path.join(r,".augment","settings.json"),e={type:"stdio",command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"],env:{}};try{const c=(0,shared_1.readJsonObject)(o);c.mcpServers={...c.mcpServers??{},codegraph:e},(0,shared_1.writeJsonObject)(o,c),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${o}`)}catch(c){(0,logger_1.printWarning)(`Could not write CodeGraph into Augment's settings.json: ${c.message}`)}}function syncCursorMcpConfig(r,t,n){if(t==="cursor"){const o=path.join(process.env.HOME||process.env.USERPROFILE||"",".cursor"),e=(c,s)=>{if(fs.existsSync(c))try{const a=JSON.parse(fs.readFileSync(c,"utf8"));let i={mcpServers:{}};if(fs.existsSync(s))try{i=JSON.parse(fs.readFileSync(s,"utf8"))}catch{}i.mcpServers||(i.mcpServers={}),a.mcpServers&&(i.mcpServers={...i.mcpServers,...a.mcpServers});const p=path.dirname(s);fs.existsSync(p)||fs.mkdirSync(p,{recursive:!0}),(0,shared_1.writeJsonObject)(s,i),fs.unlinkSync(c),(0,logger_1.printSuccess)(`Successfully synced and cleaned up CodeGraph MCP config from ${path.basename(c)} into ${path.basename(s)}`)}catch(a){(0,logger_1.printWarning)(`Could not sync CodeGraph MCP config: ${a.message}`)}};if(n==="global"){const c=path.join(o,".mcp.json"),s=path.join(o,"mcp.json");e(c,s)}else{const c=path.join(r,".mcp.json"),s=path.join(r,"mcp.json"),a=path.join(r,".cursor",".mcp.json"),i=path.join(r,".cursor","mcp.json");e(c,i),e(s,i),e(a,i)}}}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,t,n,o){o===void 0&&(o=n);var e=Object.getOwnPropertyDescriptor(t,n);(!e||("get"in e?!t.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(r,o,e)}):(function(r,t,n,o){o===void 0&&(o=n),r[o]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),__importStar=this&&this.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(n){var o=[];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(o[o.length]=e);return o},r(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=r(t),e=0;e<o.length;e++)o[e]!=="default"&&__createBinding(n,t,o[e]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.syncCodexMcpConfig=syncCodexMcpConfig,exports.syncKimiMcpConfig=syncKimiMcpConfig,exports.syncOmpMcpConfig=syncOmpMcpConfig,exports.removePiCodegraphMcpConfig=removePiCodegraphMcpConfig,exports.isKitWrittenCodegraphEntry=isKitWrittenCodegraphEntry,exports.syncGrokMcpConfig=syncGrokMcpConfig,exports.syncDevinMcpConfig=syncDevinMcpConfig,exports.syncAugmentMcpConfig=syncAugmentMcpConfig,exports.syncCursorMcpConfig=syncCursorMcpConfig;const fs=__importStar(require("fs")),path=__importStar(require("path")),context_mode_remover_1=require("../context-mode-remover"),omp_home_1=require("../omp-home"),pi_home_1=require("../pi-home"),pi_config_json_1=require("../kit-installers/pi-config-json"),pi_packages_1=require("../kit-installers/pi-packages"),devin_home_1=require("../kit-installers/devin-home"),grok_payload_1=require("../kit-installers/grok-payload"),grok_1=require("../kit-installers/grok"),grok_config_toml_1=require("../kit-installers/grok-config-toml"),shared_1=require("../kit-installers/shared"),logger_1=require("../logger");function syncCodexMcpConfig(r,t,n){if(t==="codex"){const o=n==="global"?path.join(process.env.HOME||process.env.USERPROFILE||"",".codex","config.toml"):path.join(r,".codex","config.toml");try{(0,context_mode_remover_1.removeContextMode)({scope:n,platform:"codex",rootDir:path.dirname(o)}),(0,shared_1.ensureMcpServersInCodexConfig)(o),(0,logger_1.printSuccess)("Successfully verified MCP configuration in config.toml")}catch(e){(0,logger_1.printWarning)(`Could not ensure MCP servers in Codex config.toml: ${e.message}`)}}}function syncKimiMcpConfig(r,t,n){if(t!=="kimi")return;const o=process.env.KIMI_CODE_HOME||path.join(process.env.HOME||process.env.USERPROFILE||"",".kimi-code"),e=n==="global"?path.join(o,"mcp.json"):path.join(r,".kimi-code","mcp.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Kimi's mcp.json: ${s.message}`)}}function syncOmpMcpConfig(r,t){if(r!=="omp"||t!=="global")return;const n=path.join((0,omp_home_1.resolveOmpAgentDir)(),"mcp.json"),o={command:"codegraph",args:["serve","--mcp"]};try{const e=(0,shared_1.readJsonObject)(n);e.mcpServers={...e.mcpServers??{},codegraph:o},(0,shared_1.writeJsonObject)(n,e),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${n}`)}catch(e){(0,logger_1.printWarning)(`Could not write CodeGraph into omp's mcp.json: ${e.message}`)}}function removePiCodegraphMcpConfig(r,t,n){if(t!=="pi")return;const o=(0,pi_home_1.resolvePiBaseDir)(n,r),e=path.join(o,"mcp.json");try{const c=(0,shared_1.readJsonObject)(e),s=c.mcpServers;if(s===null||typeof s!="object"||Array.isArray(s))return;const p=s.codegraph;if(p===void 0)return;if(!isKitWrittenCodegraphEntry(p,r,n)){(0,logger_1.printWarning)(`Left the codegraph server in ${e} alone \u2014 it is not the entry this kit writes for ${n} scope here, so it is yours, a newer CodeGraph's, or a leftover aimed at another directory. Pi reaches CodeGraph through the pi-codegraph extension now; remove it by hand if it is a leftover.`);return}const i=(0,pi_home_1.piConfigPath)(o);if(!(0,pi_config_json_1.declaresPiPackage)(i,pi_packages_1.PI_CODEGRAPH_SPEC)){(0,logger_1.printWarning)(`Left the codegraph server in ${e} alone \u2014 ${i} does not declare ${pi_packages_1.PI_CODEGRAPH_SPEC}, so removing this entry would leave Pi with no route to CodeGraph. Fix that file, then re-run the installer to finish the switch.`);return}delete s.codegraph,(0,shared_1.writeJsonObject)(e,c),(0,logger_1.printSuccess)(`Removed this kit's codegraph MCP entry from ${e} \u2014 Pi reaches CodeGraph through the pi-codegraph extension now.`)}catch(c){(0,logger_1.printWarning)(`Could not clean up CodeGraph in Pi's mcp.json: ${c.message}`)}}function isKitWrittenCodegraphEntry(r,t,n){if(r===null||typeof r!="object"||Array.isArray(r))return!1;const{command:o,args:e}=r;if(o!=="codegraph"||!Array.isArray(e))return!1;const c=Object.keys(r).sort();if(c.length!==2||c[0]!=="args"||c[1]!=="command")return!1;const s=n==="project"?["serve","--mcp","--path",t]:["serve","--mcp"];if(e.length!==s.length)return!1;const p=s.indexOf("--path");return e.every((i,a)=>{if(typeof i!="string")return!1;if(a!==p+1)return i===s[a];const f=process.platform==="darwin"||process.platform==="win32",g=l=>{const u=path.resolve(l);return f?u.toLowerCase():u};return g(i)===g(s[a])})}function syncGrokMcpConfig(r,t,n){if(t!=="grok")return;const o=n==="global"?(0,grok_1.resolveGrokHome)():path.join(r,grok_payload_1.GROK_DIR),e=path.join(o,"config.toml"),c=n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"];try{(0,grok_config_toml_1.mergeGrokMcpServer)(e,"codegraph",c)&&(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Grok's config.toml: ${s.message}`)}}function syncDevinMcpConfig(r,t,n){if(t!=="devin")return;const o=n==="global"?(0,devin_home_1.resolveDevinConfigRoot)():path.join(r,devin_home_1.DEVIN_DIR),e=path.join(o,"mcp_config.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Devin's mcp_config.json: ${s.message}`)}}function syncAugmentMcpConfig(r,t,n){if(t!=="augment")return;const o=path.join(r,".augment","settings.json"),e={type:"stdio",command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"],env:{}};try{const c=(0,shared_1.readJsonObject)(o);c.mcpServers={...c.mcpServers??{},codegraph:e},(0,shared_1.writeJsonObject)(o,c),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${o}`)}catch(c){(0,logger_1.printWarning)(`Could not write CodeGraph into Augment's settings.json: ${c.message}`)}}function syncCursorMcpConfig(r,t,n){if(t==="cursor"){const o=path.join(process.env.HOME||process.env.USERPROFILE||"",".cursor"),e=(c,s,p=!0)=>{if(fs.existsSync(c))try{const i=JSON.parse(fs.readFileSync(c,"utf8"));let a={mcpServers:{}};if(fs.existsSync(s))try{a=JSON.parse(fs.readFileSync(s,"utf8"))}catch{}a.mcpServers||(a.mcpServers={}),i.mcpServers&&(a.mcpServers={...a.mcpServers,...i.mcpServers});const f=path.dirname(s);fs.existsSync(f)||fs.mkdirSync(f,{recursive:!0}),(0,shared_1.writeJsonObject)(s,a),p&&fs.unlinkSync(c),(0,logger_1.printSuccess)(`Successfully synced and cleaned up CodeGraph MCP config from ${path.basename(c)} into ${path.basename(s)}`)}catch(i){(0,logger_1.printWarning)(`Could not sync CodeGraph MCP config: ${i.message}`)}};if(n==="global"){const c=path.join(o,".mcp.json"),s=path.join(o,"mcp.json");e(c,s)}else{const c=path.join(r,".mcp.json"),s=path.join(r,"mcp.json"),p=path.join(r,".cursor",".mcp.json"),i=path.join(r,".cursor","mcp.json"),a=fs.existsSync(path.join(r,".claude"));e(c,i,!a),e(s,i),e(p,i)}}}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[i.length]=s);return i},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),s=0;s<i.length;s++)i[s]!=="default"&&__createBinding(r,t,i[s]);return __setModuleDefault(r,t),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.rulesDirFor=rulesDirFor,exports.checkRules=checkRules;const fs=__importStar(require("fs")),path=__importStar(require("path")),antigravity_1=require("../kit-installers/antigravity"),hermes_distribution_1=require("../kit-installers/hermes-distribution"),rules_digest_1=require("../kit-installers/rules-digest"),omp_home_1=require("../omp-home"),devin_home_1=require("../kit-installers/devin-home"),profile_resolution_1=require("./profile-resolution"),profile_rules_1=require("../profile-rules"),kit_layout_1=require("./kit-layout"),payload_roots_1=require("../payload-roots"),GROUP="Rules";function rulesDirFor(e){return e.kit==="antigravity"?path.join(e.kitRoot,antigravity_1.ANTIGRAVITY_PLUGIN_REL,"rules"):e.kit==="omp"?path.join(path.dirname(e.kitRoot),omp_home_1.OMP_RULES_DIR):e.kit==="devin"&&e.scope==="global"?path.join((0,devin_home_1.resolveDevinHomeDir)(),"rules"):path.join(e.kitRoot,"rules")}const NON_RULE_FILES=new Set(rules_digest_1.DIGEST_SLOTS.map(e=>e.replace(/\.mdc?$/,"")));function ruleNames(e){return fs.existsSync(e)?fs.readdirSync(e).filter(t=>t.endsWith(".md")||t.endsWith(".mdc")).map(t=>t.replace(/\.mdc?$/,"")).filter(t=>!NON_RULE_FILES.has(t)).sort():[]}function excludedFor(e){const t=e==="hermes"?hermes_distribution_1.EXCLUDED_RULES:[];return new Set(t.map(r=>r.replace(/\.mdc?$/,"")))}function checkGrokRulesReachable(e){if(e.kit!=="grok"||e.scope!=="project")return[];const t=path.join(path.dirname(e.kitRoot),"AGENTS.md");return[fs.existsSync(t)&&fs.readFileSync(t,"utf8").includes(rules_digest_1.DIGEST_HEADING)?{group:GROUP,name:"rules:grok-index",status:"pass",summary:"AGENTS.md carries the rules digest, which is how the rules reach Grok here",detail:t}:{group:GROUP,name:"rules:grok-index",status:"fail",summary:"AGENTS.md carries no rules digest \u2014 the installer keeps .grok/ gitignored, and Grok skips a gitignored project rules directory, so nothing in .grok/rules reaches the model",detail:t,remedy:"agentkit init"}]}function checkRules(e,t){if(kit_layout_1.KIT_LAYOUTS[e.kit].hasAgentkitSkills===!1)return[{group:GROUP,name:"rules:expected-set",status:"skip",summary:"this kit ships no Agentkit rules \u2014 its snapshot replaces that surface"}];const r=path.join(t,payload_roots_1.RULES_SOURCE_DIR),i=excludedFor(e.kit),{profile:s}=(0,profile_resolution_1.resolveCheckProfile)(e,t),p=s?new Set((0,profile_rules_1.ruleSkipFor)(s)):new Set,o=ruleNames(r).filter(n=>!i.has(n)&&!p.has(n));if(o.length===0)return[{group:GROUP,name:"rules:expected-set",status:"skip",summary:"cannot verify \u2014 this CLI ships no rules directory to compare against",detail:r}];const a=rulesDirFor(e),d=new Set(ruleNames(a)),l=o.filter(n=>!d.has(n)),u=[];u.push(l.length===0?{group:GROUP,name:"rules:expected-set",status:"pass",summary:`${o.length} rule(s) installed`,detail:a}:{group:GROUP,name:"rules:expected-set",status:"fail",summary:`${l.length} of ${o.length} rule(s) missing \u2014 the agent never sees them`,detail:`${l.join(", ")} (expected in ${a})`,remedy:"agentkit init"});const h=new Set([...o,...i]),c=[...d].filter(n=>!h.has(n));return c.length>0&&u.push({group:GROUP,name:"rules:orphaned",status:"warn",summary:`${c.length} installed rule(s) are no longer in the kit`,detail:`${c.join(", ")} \u2014 a rule this CLI dropped is still loading`,remedy:"agentkit init"}),u.push(...checkGrokRulesReachable(e)),u}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var i=[];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[i.length]=s);return i},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var i=e(t),s=0;s<i.length;s++)i[s]!=="default"&&__createBinding(r,t,i[s]);return __setModuleDefault(r,t),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.rulesDirFor=rulesDirFor,exports.checkRules=checkRules;const fs=__importStar(require("fs")),path=__importStar(require("path")),antigravity_1=require("../kit-installers/antigravity"),hermes_distribution_1=require("../kit-installers/hermes-distribution"),rules_digest_1=require("../kit-installers/rules-digest"),omp_home_1=require("../omp-home"),devin_home_1=require("../kit-installers/devin-home"),profile_resolution_1=require("./profile-resolution"),install_profile_config_1=require("../install-profile-config"),profile_rules_1=require("../profile-rules"),skill_profiles_1=require("../skill-profiles"),kit_layout_1=require("./kit-layout"),payload_roots_1=require("../payload-roots"),GROUP="Rules";function rulesDirFor(e){return e.kit==="antigravity"?path.join(e.kitRoot,antigravity_1.ANTIGRAVITY_PLUGIN_REL,"rules"):e.kit==="omp"?path.join(path.dirname(e.kitRoot),omp_home_1.OMP_RULES_DIR):e.kit==="devin"&&e.scope==="global"?path.join((0,devin_home_1.resolveDevinHomeDir)(),"rules"):path.join(e.kitRoot,"rules")}const NON_RULE_FILES=new Set(rules_digest_1.DIGEST_SLOTS.map(e=>e.replace(/\.mdc?$/,"")));function ruleNames(e){return fs.existsSync(e)?fs.readdirSync(e).filter(t=>t.endsWith(".md")||t.endsWith(".mdc")).map(t=>t.replace(/\.mdc?$/,"")).filter(t=>!NON_RULE_FILES.has(t)).sort():[]}function excludedFor(e){const t=e==="hermes"?hermes_distribution_1.EXCLUDED_RULES:[];return new Set(t.map(r=>r.replace(/\.mdc?$/,"")))}function checkGrokRulesReachable(e){if(e.kit!=="grok"||e.scope!=="project")return[];const t=path.join(path.dirname(e.kitRoot),"AGENTS.md");return[fs.existsSync(t)&&fs.readFileSync(t,"utf8").includes(rules_digest_1.DIGEST_HEADING)?{group:GROUP,name:"rules:grok-index",status:"pass",summary:"AGENTS.md carries the rules digest, which is how the rules reach Grok here",detail:t}:{group:GROUP,name:"rules:grok-index",status:"fail",summary:"AGENTS.md carries no rules digest \u2014 the installer keeps .grok/ gitignored, and Grok skips a gitignored project rules directory, so nothing in .grok/rules reaches the model",detail:t,remedy:"agentkit init"}]}function checkRules(e,t){if(kit_layout_1.KIT_LAYOUTS[e.kit].hasAgentkitSkills===!1)return[{group:GROUP,name:"rules:expected-set",status:"skip",summary:"this kit ships no Agentkit rules \u2014 its snapshot replaces that surface"}];const r=path.join(t,payload_roots_1.RULES_SOURCE_DIR),i=excludedFor(e.kit),{profile:s}=(0,profile_resolution_1.resolveCheckProfile)(e,t),p=s?new Set((0,profile_rules_1.ruleSkipFor)(s)):new Set,h=s==="gamedev"||(0,skill_profiles_1.withDependencies)((0,install_profile_config_1.readInstallSettings)(e.configPath).extraSkills).has("gamedev")?profile_rules_1.GAMEDEV_RULES:[],o=[...ruleNames(r),...h].filter(n=>!i.has(n)&&!p.has(n)).sort();if(o.length===0)return[{group:GROUP,name:"rules:expected-set",status:"skip",summary:"cannot verify \u2014 this CLI ships no rules directory to compare against",detail:r}];const l=rulesDirFor(e),d=new Set(ruleNames(l)),u=o.filter(n=>!d.has(n)),a=[];a.push(u.length===0?{group:GROUP,name:"rules:expected-set",status:"pass",summary:`${o.length} rule(s) installed`,detail:l}:{group:GROUP,name:"rules:expected-set",status:"fail",summary:`${u.length} of ${o.length} rule(s) missing \u2014 the agent never sees them`,detail:`${u.join(", ")} (expected in ${l})`,remedy:"agentkit init"});const f=new Set([...o,...i]),c=[...d].filter(n=>!f.has(n));return c.length>0&&a.push({group:GROUP,name:"rules:orphaned",status:"warn",summary:`${c.length} installed rule(s) are no longer in the kit`,detail:`${c.join(", ")} \u2014 a rule this CLI dropped is still loading`,remedy:"agentkit init"}),a.push(...checkGrokRulesReachable(e)),a}
@@ -1,4 +1,4 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&__createBinding(r,e,n[o]);return __setModuleDefault(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.AGENTKIT_MCP_SERVERS=exports.DROPPED_MCP_SERVERS=void 0,exports.removeAgentkitMcpServers=removeAgentkitMcpServers,exports.stripDroppedMcpServers=stripDroppedMcpServers,exports.stripDroppedMcpServersFromToml=stripDroppedMcpServersFromToml;const fs=__importStar(require("fs"));exports.DROPPED_MCP_SERVERS=[{name:"git",marker:"mcp-server-git"},{name:"sequential-thinking",marker:"@modelcontextprotocol/server-sequential-thinking"}],exports.AGENTKIT_MCP_SERVERS=[{name:"playwright",marker:"@playwright/mcp"},{name:"chrome-devtools",marker:"chrome-devtools-mcp"},{name:"mobile-mcp",marker:"@mobilenext/mobile-mcp"}];function removeAgentkitMcpServers(t){let e;try{e=JSON.parse(fs.readFileSync(t,"utf-8"))}catch{return{removed:[],remaining:null}}const r=e?.mcpServers;if(!r||typeof r!="object"||Array.isArray(r))return{removed:[],remaining:null};const n=[];for(const{name:i,marker:c}of exports.AGENTKIT_MCP_SERVERS)Object.prototype.hasOwnProperty.call(r,i)&&JSON.stringify(r[i]??"").includes(c)&&(delete r[i],n.push(i));const o=Object.keys(r).length;if(n.length===0)return{removed:n,remaining:o};try{if(o===0)return{removed:n,remaining:0};const i=`${t}.${process.pid}.tmp`;try{fs.writeFileSync(i,`${JSON.stringify(e,null,2)}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&__createBinding(r,e,n[o]);return __setModuleDefault(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.AGENTKIT_MCP_SERVERS=exports.DROPPED_MCP_SERVERS=void 0,exports.removeAgentkitMcpServers=removeAgentkitMcpServers,exports.stripDroppedMcpServers=stripDroppedMcpServers,exports.stripDroppedMcpServersFromToml=stripDroppedMcpServersFromToml;const fs=__importStar(require("fs"));exports.DROPPED_MCP_SERVERS=[{name:"git",marker:"mcp-server-git"},{name:"sequential-thinking",marker:"@modelcontextprotocol/server-sequential-thinking"}],exports.AGENTKIT_MCP_SERVERS=[{name:"playwright",marker:"@playwright/mcp"},{name:"chrome-devtools",marker:"chrome-devtools-mcp"},{name:"mobile-mcp",marker:"@mobilenext/mobile-mcp"},{name:"unityMCP",marker:"mcpforunityserver"}];function removeAgentkitMcpServers(t){let e;try{e=JSON.parse(fs.readFileSync(t,"utf-8"))}catch{return{removed:[],remaining:null}}const r=e?.mcpServers;if(!r||typeof r!="object"||Array.isArray(r))return{removed:[],remaining:null};const n=[];for(const{name:i,marker:c}of exports.AGENTKIT_MCP_SERVERS)Object.prototype.hasOwnProperty.call(r,i)&&JSON.stringify(r[i]??"").includes(c)&&(delete r[i],n.push(i));const o=Object.keys(r).length;if(n.length===0)return{removed:n,remaining:o};try{if(o===0)return{removed:n,remaining:0};const i=`${t}.${process.pid}.tmp`;try{fs.writeFileSync(i,`${JSON.stringify(e,null,2)}
2
2
  `,"utf8"),fs.renameSync(i,t)}catch(c){throw fs.rmSync(i,{force:!0}),c}}catch{}return{removed:n,remaining:o}}function stripDroppedMcpServers(t){if(!t||typeof t!="object")return[];const e=[];for(const{name:r,marker:n}of exports.DROPPED_MCP_SERVERS)Object.prototype.hasOwnProperty.call(t,r)&&JSON.stringify(t[r]??"").includes(n)&&(delete t[r],e.push(r));return e}function stripDroppedMcpServersFromToml(t){let e=t;for(const{name:r,marker:n}of exports.DROPPED_MCP_SERVERS)e=e.replace(new RegExp(`^\\[mcp_servers\\.${escapeRegExp(r)}\\][^\\n]*(?:\\n(?!\\[).*)*\\n?`,"gm"),o=>o.includes(n)?"":o);return e===t?t:e.replace(/\n{3,}/g,`
3
3
 
4
4
  `).trimStart()}function escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,t,o,i){i===void 0&&(i=o);var e=Object.getOwnPropertyDescriptor(t,o);(!e||("get"in e?!t.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(n,i,e)}):(function(n,t,o,i){i===void 0&&(i=o),n[i]=t[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}):function(n,t){n.default=t}),__importStar=this&&this.__importStar||(function(){var n=function(t){return n=Object.getOwnPropertyNames||function(o){var i=[];for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(i[i.length]=e);return i},n(t)};return function(t){if(t&&t.__esModule)return t;var o={};if(t!=null)for(var i=n(t),e=0;e<i.length;e++)i[e]!=="default"&&__createBinding(o,t,i[e]);return __setModuleDefault(o,t),o}})(),__importDefault=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.runInit=runInit;const chalk_1=__importDefault(require("chalk")),fs=__importStar(require("fs")),path=__importStar(require("path")),codegraph_installer_1=require("../codegraph-installer"),home_dir_1=require("../home-dir"),gitignore_1=require("../gitignore"),init_install_scope_1=require("../init-install-scope"),kit_install_dispatch_1=require("../kit-install-dispatch"),profile_context_1=require("../kit-installers/profile-context"),install_manifest_1=require("../install-manifest"),install_registry_1=require("../install-registry"),kit_context_1=require("../kit-context"),kits_1=require("../kits"),kit_remover_1=require("../kit-remover"),kit_switch_confirm_1=require("../kit-switch-confirm"),kits_2=require("../kits"),install_profile_config_1=require("../install-profile-config"),skill_profiles_1=require("../skill-profiles"),profile_switch_confirm_1=require("../profile-switch-confirm"),logger_1=require("../logger"),ui_1=require("../ui"),init_global_plan_1=require("../init-global-plan"),claude_agents_1=require("../kit-installers/claude-agents"),init_args_1=require("../init-args");function resolveSourceRoot(){const n=process.env.AGENTKIT_SOURCE_ROOT;return n&&fs.existsSync(path.join(n,"package.json"))?n:path.resolve(__dirname,"..","..","..")}function recordInstall(n,t,o,i,e){try{(0,install_registry_1.upsertInstall)({path:o,kit:n,scope:t,kitRoot:i,...e?{version:e}:{}})}catch{}}const globalConfigDir=init_install_scope_1.kitDirWithinGlobalRoot;function stampKit(n,t){t&&(0,install_profile_config_1.stampInstallVersion)(n,t)}function planInstallProfile(n,t,o,i,e){const f=t||(0,init_install_scope_1.destHasSkillDirs)(o),u=(0,skill_profiles_1.resolveEffectiveProfile)(n,f,i.profile,e),c=f&&i.profile!==u;return{effectiveProfile:u,profileChanged:c,needsConfirm:n===null&&c}}function retainedExtraSkills(n,t,o){return n&&(!t||o.profile===null)?o.extraSkills:[]}async function runGlobalInstall(n,t,o,i,e=!1){const{repoRoot:f,targetDir:u,cliVersion:c}=o;let p;if(i){if(!(0,kits_2.supportsGlobalInstall)(i))return(0,logger_1.printError)(`${kits_2.kitDefinitions[i].name} does not support global install \u2014 it installs into a project checkout.`),1;p=[i]}else{const r=await(0,ui_1.selectKitsGlobal)();if(r===null)return(0,logger_1.printInfo)("Installation cancelled."),0;if(p=r.filter(kits_2.supportsGlobalInstall),p.length===0)return(0,logger_1.printInfo)("No kits selected \u2014 nothing to install."),0}const{plans:h,skipped:I}=await(0,init_global_plan_1.planGlobalInstalls)(p,u,{agentModelsFlag:t,skipRootPrompt:i!==void 0});if(h.length===0)return console.log(""),(0,logger_1.printInfo)("Nothing left to install."),0;const S=[],D=h.map(({kit:r,hermesProfile:a,agentModels:m,globalRoot:b})=>{const w=b??(0,init_install_scope_1.resolveGlobalRoot)(r,u,a),l=path.join(globalConfigDir(r,w),".agentkit.json"),g=fs.existsSync(l),k=(0,install_profile_config_1.readInstallSettings)(l),d=path.join(globalConfigDir(r,w),kit_context_1.KIT_GLOBAL_SKILLS_DIR[r]);return{kit:r,hermesProfile:a,agentModels:m,globalRoot:w,kitConfigPath:l,isUpdate:g,persisted:k,...planInstallProfile(n,g,d,k,r)}});for(const r of D){if(!r.needsConfirm)continue;const a=await(0,profile_switch_confirm_1.confirmProfileSwitch)({existingProfile:r.persisted.profile,newProfile:r.effectiveProfile,kitConfigPath:r.kitConfigPath,kitName:kits_2.kitDefinitions[r.kit].name,targetDir:r.globalRoot});if(!a.proceed)return(0,logger_1.printInfo)("Profile switch cancelled. Nothing was changed."),a.reason==="non-tty"?1:0}for(const{kit:r,agentModels:a,globalRoot:m,kitConfigPath:b,isUpdate:w,persisted:l,effectiveProfile:g,profileChanged:k}of D){const d=retainedExtraSkills(w,k,l),_=(0,kit_install_dispatch_1.installGlobalKit)(r,f,m,(0,skill_profiles_1.resolveSkipDirs)(f,g,d),{...r==="claude"?{agentModels:a}:{},...e?{allowSharedRoot:!0}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(f,g)});if(!_.ok)return(0,logger_1.printError)(_.reason),1;stampKit(b,c),(0,install_profile_config_1.writeInstallSettings)(b,{profile:g,extraSkills:d,...a?{agentModels:a}:{}}),recordInstall(r,"global",globalConfigDir(r,m),globalConfigDir(r,m),c),(0,logger_1.printInfo)(chalk_1.default.dim(`Install profile: ${g}`)),a&&(0,logger_1.printInfo)(chalk_1.default.dim(`Agent models: ${a}`)),await(0,codegraph_installer_1.maybeInstallCodegraph)(r,"global",u),(0,install_manifest_1.writeManifest)((0,kit_context_1.globalContext)(r),c),S.push(kits_2.kitDefinitions[r].name)}return console.log(""),S.length>0&&((0,logger_1.printSection)("Installation Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" Installed globally: "+chalk_1.default.green(S.join(", "))),I.length>0&&(0,logger_1.printWarning)(`Skipped: ${I.join(", ")}`),console.log(""),(0,logger_1.printInfo)(chalk_1.default.dim("\u{1F4A1} Tip:")+" Read "+chalk_1.default.cyan.bold("README.md")+" for more information"),console.log("")),0}async function runInit(n,t={}){const o=t.sourceRoot??resolveSourceRoot(),i={repoRoot:o,targetDir:t.targetDir??process.cwd(),cliVersion:(0,install_profile_config_1.readCliVersion)(o),tty:t.isTTY??process.stdout.isTTY},{targetDir:e,cliVersion:f,tty:u}=i,c=n;(0,logger_1.printBanner)();const p=(0,init_args_1.parseKitFlag)(c);if(p.invalid)return(0,logger_1.printError)(`Unknown kit: "${p.invalid}".`),(0,logger_1.printInfo)(`Supported kits: ${kits_2.ALL_KIT_NAMES.join(", ")}.`),1;const h=p.kit,I=(0,init_args_1.parseProfileFlag)(c);if(I==="invalid")return(0,logger_1.printError)(`Unknown --profile value. Choose one of: ${skill_profiles_1.PROFILES.join(", ")}.`),1;const S=I==="prompt"?u?await(0,ui_1.selectProfile)():null:I,D=(0,init_args_1.parseAgentModelsFlag)(c);if(D==="invalid")return(0,logger_1.printError)(`Unknown --agent-models value. Choose one of: ${claude_agents_1.CLAUDE_AGENT_MODELS.join(", ")}.`),1;const r=D,a=(0,init_args_1.parseGlobalFlag)(c),m=(0,init_args_1.parseForceSharedRootFlag)(c);(0,ui_1.showMenu)(e);const b=(0,home_dir_1.isHomeDir)(e);if(a||b||h!==null&&kits_2.GLOBAL_ONLY_INSTALL_KITS.includes(h))return runGlobalInstall(S,r,i,h??void 0,m);const l=h??await(0,ui_1.selectKit)(e);if(!l||!(0,kits_2.isHostInstalled)(l)&&!await(0,ui_1.confirmUndetectedHost)(kits_2.kitDefinitions[l].name))return(0,logger_1.printInfo)("Installation cancelled."),0;if(!await(0,init_install_scope_1.confirmProjectInstallIfNeeded)(e))return(0,logger_1.printError)("Installation cancelled."),0;const k=kits_1.PROJECT_KITS.filter(s=>(0,init_install_scope_1.isKitInstalledInProject)(s,e)),d=k.includes(l),_=k.filter(s=>s!==l);if(d&&(console.log(""),(0,logger_1.printSection)("Update Mode"),(0,logger_1.printInfo)(chalk_1.default.bold("Updating")+" "+chalk_1.default.yellow.bold(kits_2.kitDefinitions[l].name)+" kit..."),console.log("")),_.length>0){console.log(""),(0,logger_1.printSection)("Switch Mode"),(0,logger_1.printWarning)(chalk_1.default.bold("Switching")+" from "+chalk_1.default.yellow(_.map(O=>kits_2.kitDefinitions[O].name).join(", "))+" to "+chalk_1.default.green.bold(kits_2.kitDefinitions[l].name)+"..."),(0,logger_1.printProgress)("A project holds one kit \u2014 removing the other(s) first..."),console.log("");const s=await(0,kit_switch_confirm_1.confirmKitSwitch)(_,l,e);if(!s.proceed)return s.reason==="declined"?((0,logger_1.printInfo)("Installation cancelled. Nothing was removed."),0):1}const P=path.join(e,kits_2.kitDefinitions[l].dir,".agentkit.json"),j=(0,install_profile_config_1.readInstallSettings)(P),{effectiveProfile:C,profileChanged:x,needsConfirm:M}=planInstallProfile(S,d,(0,kit_context_1.projectContext)(l,e).destSkillsDir,j,l);if(M){const s=await(0,profile_switch_confirm_1.confirmProfileSwitch)({existingProfile:j.profile,newProfile:C,kitConfigPath:P,kitName:kits_2.kitDefinitions[l].name,targetDir:e});if(!s.proceed)return(0,logger_1.printInfo)("Profile switch cancelled. Nothing was changed."),s.reason==="non-tty"?1:0}const y=retainedExtraSkills(d,x,j),E=(0,skill_profiles_1.resolveSkipDirs)(o,C,y),R=(0,gitignore_1.otherKitGitignoreEntries)(l);R.length>0&&((0,logger_1.printProgress)("Cleaning up .gitignore entries from other kits..."),(0,gitignore_1.cleanupGitignore)(R,e));for(const s of _)(0,logger_1.printProgress)(`Removing ${kits_2.kitDefinitions[s].name}...`),(0,kit_remover_1.removeKit)(s,e)?(0,logger_1.printSuccess)(`${kits_2.kitDefinitions[s].name} removed`):(0,logger_1.printWarning)(`Some files from ${kits_2.kitDefinitions[s].name} may not have been removed`);_.length>0&&console.log("");const v=l==="claude"?await(0,claude_agents_1.resolveClaudeAgentModelsForInstall)(r,j.agentModels,ui_1.selectClaudeAgentModels,u):void 0,q=(0,kit_install_dispatch_1.installProjectKit)(l,o,e,E,{...v?{agentModels:v}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(o,C)});return q.ok?(stampKit(P,f),recordInstall(l,"project",e,path.dirname(P),f),(0,install_profile_config_1.writeInstallSettings)(P,{profile:C,extraSkills:y,...v?{agentModels:v}:{}}),(0,logger_1.printInfo)(chalk_1.default.dim(`Install profile: ${C}`)),v&&(0,logger_1.printInfo)(chalk_1.default.dim(`Agent models: ${v}`)),(0,install_manifest_1.writeManifest)((0,kit_context_1.projectContext)(l,e),f),console.log(""),d?((0,logger_1.printSection)("Update Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" "+kits_2.kitDefinitions[l].name+" updated successfully!")):((0,logger_1.printSection)("Installation Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" "+kits_2.kitDefinitions[l].name+" installed successfully!")),await(0,codegraph_installer_1.maybeInstallCodegraph)(l,"project",e),console.log(""),(0,logger_1.printInfo)(chalk_1.default.dim("\u{1F4A1} Tip:")+" Read "+chalk_1.default.cyan.bold("README.md")+" for more information"),console.log(""),0):((0,logger_1.printError)(q.reason),1)}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,t,o,i){i===void 0&&(i=o);var e=Object.getOwnPropertyDescriptor(t,o);(!e||("get"in e?!t.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(n,i,e)}):(function(n,t,o,i){i===void 0&&(i=o),n[i]=t[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}):function(n,t){n.default=t}),__importStar=this&&this.__importStar||(function(){var n=function(t){return n=Object.getOwnPropertyNames||function(o){var i=[];for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&(i[i.length]=e);return i},n(t)};return function(t){if(t&&t.__esModule)return t;var o={};if(t!=null)for(var i=n(t),e=0;e<i.length;e++)i[e]!=="default"&&__createBinding(o,t,i[e]);return __setModuleDefault(o,t),o}})(),__importDefault=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.runInit=runInit;const chalk_1=__importDefault(require("chalk")),fs=__importStar(require("fs")),path=__importStar(require("path")),codegraph_installer_1=require("../codegraph-installer"),home_dir_1=require("../home-dir"),gitignore_1=require("../gitignore"),init_install_scope_1=require("../init-install-scope"),kit_install_dispatch_1=require("../kit-install-dispatch"),profile_context_1=require("../kit-installers/profile-context"),install_manifest_1=require("../install-manifest"),install_registry_1=require("../install-registry"),kit_context_1=require("../kit-context"),kits_1=require("../kits"),kit_remover_1=require("../kit-remover"),kit_switch_confirm_1=require("../kit-switch-confirm"),kits_2=require("../kits"),install_profile_config_1=require("../install-profile-config"),skill_profiles_1=require("../skill-profiles"),profile_switch_confirm_1=require("../profile-switch-confirm"),logger_1=require("../logger"),ui_1=require("../ui"),init_global_plan_1=require("../init-global-plan"),claude_agents_1=require("../kit-installers/claude-agents"),init_args_1=require("../init-args");function resolveSourceRoot(){const n=process.env.AGENTKIT_SOURCE_ROOT;return n&&fs.existsSync(path.join(n,"package.json"))?n:path.resolve(__dirname,"..","..","..")}function recordInstall(n,t,o,i,e){try{(0,install_registry_1.upsertInstall)({path:o,kit:n,scope:t,kitRoot:i,...e?{version:e}:{}})}catch{}}const globalConfigDir=init_install_scope_1.kitDirWithinGlobalRoot;function stampKit(n,t){t&&(0,install_profile_config_1.stampInstallVersion)(n,t)}function planInstallProfile(n,t,o,i,e){const f=t||(0,init_install_scope_1.destHasSkillDirs)(o),d=(0,skill_profiles_1.resolveEffectiveProfile)(n,f,i.profile,e),c=f&&i.profile!==d;return{effectiveProfile:d,profileChanged:c,needsConfirm:n===null&&c}}function retainedExtraSkills(n,t,o){return n&&(!t||o.profile===null)?o.extraSkills:[]}async function runGlobalInstall(n,t,o,i,e=!1){const{repoRoot:f,targetDir:d,cliVersion:c}=o;let p;if(i){if(!(0,kits_2.supportsGlobalInstall)(i))return(0,logger_1.printError)(`${kits_2.kitDefinitions[i].name} does not support global install \u2014 it installs into a project checkout.`),1;p=[i]}else{const r=await(0,ui_1.selectKitsGlobal)();if(r===null)return(0,logger_1.printInfo)("Installation cancelled."),0;if(p=r.filter(kits_2.supportsGlobalInstall),p.length===0)return(0,logger_1.printInfo)("No kits selected \u2014 nothing to install."),0}const{plans:h,skipped:I}=await(0,init_global_plan_1.planGlobalInstalls)(p,d,{agentModelsFlag:t,skipRootPrompt:i!==void 0});if(h.length===0)return console.log(""),(0,logger_1.printInfo)("Nothing left to install."),0;const S=[],D=h.map(({kit:r,hermesProfile:a,agentModels:m,globalRoot:b})=>{const w=b??(0,init_install_scope_1.resolveGlobalRoot)(r,d,a),l=path.join(globalConfigDir(r,w),".agentkit.json"),g=fs.existsSync(l),k=(0,install_profile_config_1.readInstallSettings)(l),u=path.join(globalConfigDir(r,w),kit_context_1.KIT_GLOBAL_SKILLS_DIR[r]);return{kit:r,hermesProfile:a,agentModels:m,globalRoot:w,kitConfigPath:l,isUpdate:g,persisted:k,...planInstallProfile(n,g,u,k,r)}});for(const r of D){if(!r.needsConfirm)continue;const a=await(0,profile_switch_confirm_1.confirmProfileSwitch)({existingProfile:r.persisted.profile,newProfile:r.effectiveProfile,kitConfigPath:r.kitConfigPath,kitName:kits_2.kitDefinitions[r.kit].name,targetDir:r.globalRoot});if(!a.proceed)return(0,logger_1.printInfo)("Profile switch cancelled. Nothing was changed."),a.reason==="non-tty"?1:0}for(const{kit:r,agentModels:a,globalRoot:m,kitConfigPath:b,isUpdate:w,persisted:l,effectiveProfile:g,profileChanged:k}of D){const u=retainedExtraSkills(w,k,l),_=(0,kit_install_dispatch_1.installGlobalKit)(r,f,m,(0,skill_profiles_1.resolveSkipDirs)(f,g,u),{...r==="claude"?{agentModels:a}:{},...e?{allowSharedRoot:!0}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(f,g,u)});if(!_.ok)return(0,logger_1.printError)(_.reason),1;stampKit(b,c),(0,install_profile_config_1.writeInstallSettings)(b,{profile:g,extraSkills:u,...a?{agentModels:a}:{}}),recordInstall(r,"global",globalConfigDir(r,m),globalConfigDir(r,m),c),(0,logger_1.printInfo)(chalk_1.default.dim(`Install profile: ${g}`)),a&&(0,logger_1.printInfo)(chalk_1.default.dim(`Agent models: ${a}`)),await(0,codegraph_installer_1.maybeInstallCodegraph)(r,"global",d),(0,install_manifest_1.writeManifest)((0,kit_context_1.globalContext)(r),c),S.push(kits_2.kitDefinitions[r].name)}return console.log(""),S.length>0&&((0,logger_1.printSection)("Installation Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" Installed globally: "+chalk_1.default.green(S.join(", "))),I.length>0&&(0,logger_1.printWarning)(`Skipped: ${I.join(", ")}`),console.log(""),(0,logger_1.printInfo)(chalk_1.default.dim("\u{1F4A1} Tip:")+" Read "+chalk_1.default.cyan.bold("README.md")+" for more information"),console.log("")),0}async function runInit(n,t={}){const o=t.sourceRoot??resolveSourceRoot(),i={repoRoot:o,targetDir:t.targetDir??process.cwd(),cliVersion:(0,install_profile_config_1.readCliVersion)(o),tty:t.isTTY??process.stdout.isTTY},{targetDir:e,cliVersion:f,tty:d}=i,c=n;(0,logger_1.printBanner)();const p=(0,init_args_1.parseKitFlag)(c);if(p.invalid)return(0,logger_1.printError)(`Unknown kit: "${p.invalid}".`),(0,logger_1.printInfo)(`Supported kits: ${kits_2.ALL_KIT_NAMES.join(", ")}.`),1;const h=p.kit,I=(0,init_args_1.parseProfileFlag)(c);if(I==="invalid")return(0,logger_1.printError)(`Unknown --profile value. Choose one of: ${skill_profiles_1.PROFILES.join(", ")}.`),1;const S=I==="prompt"?d?await(0,ui_1.selectProfile)():null:I,D=(0,init_args_1.parseAgentModelsFlag)(c);if(D==="invalid")return(0,logger_1.printError)(`Unknown --agent-models value. Choose one of: ${claude_agents_1.CLAUDE_AGENT_MODELS.join(", ")}.`),1;const r=D,a=(0,init_args_1.parseGlobalFlag)(c),m=(0,init_args_1.parseForceSharedRootFlag)(c);(0,ui_1.showMenu)(e);const b=(0,home_dir_1.isHomeDir)(e);if(a||b||h!==null&&kits_2.GLOBAL_ONLY_INSTALL_KITS.includes(h))return runGlobalInstall(S,r,i,h??void 0,m);const l=h??await(0,ui_1.selectKit)(e);if(!l||!(0,kits_2.isHostInstalled)(l)&&!await(0,ui_1.confirmUndetectedHost)(kits_2.kitDefinitions[l].name))return(0,logger_1.printInfo)("Installation cancelled."),0;if(!await(0,init_install_scope_1.confirmProjectInstallIfNeeded)(e))return(0,logger_1.printError)("Installation cancelled."),0;const k=kits_1.PROJECT_KITS.filter(s=>(0,init_install_scope_1.isKitInstalledInProject)(s,e)),u=k.includes(l),_=k.filter(s=>s!==l);if(u&&(console.log(""),(0,logger_1.printSection)("Update Mode"),(0,logger_1.printInfo)(chalk_1.default.bold("Updating")+" "+chalk_1.default.yellow.bold(kits_2.kitDefinitions[l].name)+" kit..."),console.log("")),_.length>0){console.log(""),(0,logger_1.printSection)("Switch Mode"),(0,logger_1.printWarning)(chalk_1.default.bold("Switching")+" from "+chalk_1.default.yellow(_.map(O=>kits_2.kitDefinitions[O].name).join(", "))+" to "+chalk_1.default.green.bold(kits_2.kitDefinitions[l].name)+"..."),(0,logger_1.printProgress)("A project holds one kit \u2014 removing the other(s) first..."),console.log("");const s=await(0,kit_switch_confirm_1.confirmKitSwitch)(_,l,e);if(!s.proceed)return s.reason==="declined"?((0,logger_1.printInfo)("Installation cancelled. Nothing was removed."),0):1}const P=path.join(e,kits_2.kitDefinitions[l].dir,".agentkit.json"),j=(0,install_profile_config_1.readInstallSettings)(P),{effectiveProfile:C,profileChanged:x,needsConfirm:M}=planInstallProfile(S,u,(0,kit_context_1.projectContext)(l,e).destSkillsDir,j,l);if(M){const s=await(0,profile_switch_confirm_1.confirmProfileSwitch)({existingProfile:j.profile,newProfile:C,kitConfigPath:P,kitName:kits_2.kitDefinitions[l].name,targetDir:e});if(!s.proceed)return(0,logger_1.printInfo)("Profile switch cancelled. Nothing was changed."),s.reason==="non-tty"?1:0}const y=retainedExtraSkills(u,x,j),E=(0,skill_profiles_1.resolveSkipDirs)(o,C,y),R=(0,gitignore_1.otherKitGitignoreEntries)(l);R.length>0&&((0,logger_1.printProgress)("Cleaning up .gitignore entries from other kits..."),(0,gitignore_1.cleanupGitignore)(R,e));for(const s of _)(0,logger_1.printProgress)(`Removing ${kits_2.kitDefinitions[s].name}...`),(0,kit_remover_1.removeKit)(s,e)?(0,logger_1.printSuccess)(`${kits_2.kitDefinitions[s].name} removed`):(0,logger_1.printWarning)(`Some files from ${kits_2.kitDefinitions[s].name} may not have been removed`);_.length>0&&console.log("");const v=l==="claude"?await(0,claude_agents_1.resolveClaudeAgentModelsForInstall)(r,j.agentModels,ui_1.selectClaudeAgentModels,d):void 0,q=(0,kit_install_dispatch_1.installProjectKit)(l,o,e,E,{...v?{agentModels:v}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(o,C,y)});return q.ok?(stampKit(P,f),recordInstall(l,"project",e,path.dirname(P),f),(0,install_profile_config_1.writeInstallSettings)(P,{profile:C,extraSkills:y,...v?{agentModels:v}:{}}),(0,logger_1.printInfo)(chalk_1.default.dim(`Install profile: ${C}`)),v&&(0,logger_1.printInfo)(chalk_1.default.dim(`Agent models: ${v}`)),(0,install_manifest_1.writeManifest)((0,kit_context_1.projectContext)(l,e),f),console.log(""),u?((0,logger_1.printSection)("Update Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" "+kits_2.kitDefinitions[l].name+" updated successfully!")):((0,logger_1.printSection)("Installation Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" "+kits_2.kitDefinitions[l].name+" installed successfully!")),await(0,codegraph_installer_1.maybeInstallCodegraph)(l,"project",e),console.log(""),(0,logger_1.printInfo)(chalk_1.default.dim("\u{1F4A1} Tip:")+" Read "+chalk_1.default.cyan.bold("README.md")+" for more information"),console.log(""),0):((0,logger_1.printError)(q.reason),1)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PROJECT_ONLY_INSTALL_KITS=void 0,exports.installProjectKit=installProjectKit,exports.installGlobalKit=installGlobalKit;const kit_installers_1=require("./kit-installers"),claude_agents_1=require("./kit-installers/claude-agents"),init_install_scope_1=require("./init-install-scope"),profile_context_1=require("./kit-installers/profile-context");var kits_1=require("./kits");Object.defineProperty(exports,"PROJECT_ONLY_INSTALL_KITS",{enumerable:!0,get:function(){return kits_1.PROJECT_ONLY_INSTALL_KITS}});const KIT_DESCRIPTORS={claude:{project:o=>(0,kit_installers_1.installClaude)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.agentModels,o.profile),global:o=>(0,kit_installers_1.installClaudeGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.agentModels,o.profile)},opencode:{project:o=>(0,kit_installers_1.installOpenCode)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installOpenCodeGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},cursor:{project:o=>(0,kit_installers_1.installCursor)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installCursorGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},antigravity:{project:o=>(0,kit_installers_1.installAntigravity)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installAntigravityGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},codex:{project:o=>(0,kit_installers_1.installCodex)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installCodexGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},kimi:{project:o=>(0,kit_installers_1.installKimi)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installKimiGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},grok:{project:o=>(0,kit_installers_1.installGrok)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installGrokGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},hermes:{projectRefusal:"Hermes Agent installs into a profile under ~/.hermes, not into a project. Run `agentkit init` from your home directory.",global:o=>(0,kit_installers_1.installHermesGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},openclaw:{projectRefusal:"OpenClaw installs into its state root at ~/.openclaw, not into a project. Run `agentkit init` from your home directory.",global:o=>(0,kit_installers_1.installOpenClawGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},omp:{projectRefusal:"Oh My Pi installs into its agent directory at ~/.omp/agent, not into a project. Run `agentkit init` from your home directory.",global:o=>(0,kit_installers_1.installOmpGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},augment:{project:o=>(0,kit_installers_1.installAugment)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},pi:{project:o=>(0,kit_installers_1.installPi)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installPiGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)},devin:{project:o=>(0,kit_installers_1.installDevin)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile),global:o=>(0,kit_installers_1.installDevinGlobal)(o.repoRoot,o.targetDir,o.profileSkipDirs,o.profile)}};function buildContext(o,i,l,e){return{repoRoot:o,targetDir:i,profileSkipDirs:l,profile:e.profileContext??profile_context_1.EMPTY_PROFILE_CONTEXT,agentModels:e.agentModels??claude_agents_1.DEFAULT_CLAUDE_AGENT_MODELS}}function installProjectKit(o,i,l,e,a={}){const r=KIT_DESCRIPTORS[o],t=r.project;return t?(t(buildContext(i,l,e,a)),{ok:!0}):{ok:!1,reason:r.projectRefusal??`No project installer for ${o}.`}}function installGlobalKit(o,i,l,e,a={}){const r=(0,init_install_scope_1.sharedRootConflict)(o);if(r&&!a.allowSharedRoot)return{ok:!1,reason:`${r.dir} already holds an ${r.other} install. Pi and ${r.other} both read ${r.envVar}, so they resolve to this same root and would overwrite each other's payload and marker. Unset ${r.envVar} to install into the default directory, or re-run with --force-shared-root to install here anyway.`};const t=KIT_DESCRIPTORS[o].global;return t?(t(buildContext(i,l,e,a)),{ok:!0}):{ok:!1,reason:"Global install is only supported for Claude, OpenCode, Antigravity, Codex, Cursor, Kimi Code, Hermes, OpenClaw, Oh My Pi, Grok Build, Pi and Devin CLI."}}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,t,o){o===void 0&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}):(function(e,r,t,o){o===void 0&&(o=t),e[o]=r[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(t){var o=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(o[o.length]=i);return o},e(r)};return function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var o=e(r),i=0;i<o.length;i++)o[i]!=="default"&&__createBinding(t,r,o[i]);return __setModuleDefault(t,r),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.PROJECT_ONLY_INSTALL_KITS=void 0,exports.installProjectKit=installProjectKit,exports.installGlobalKit=installGlobalKit;const path=__importStar(require("path")),kit_installers_1=require("./kit-installers"),claude_agents_1=require("./kit-installers/claude-agents"),init_install_scope_1=require("./init-install-scope"),shared_1=require("./kit-installers/shared"),kits_1=require("./kits"),logger_1=require("./logger"),agentkit_config_file_1=require("./agentkit-config-file"),profile_context_1=require("./kit-installers/profile-context");var kits_2=require("./kits");Object.defineProperty(exports,"PROJECT_ONLY_INSTALL_KITS",{enumerable:!0,get:function(){return kits_2.PROJECT_ONLY_INSTALL_KITS}});const KIT_DESCRIPTORS={claude:{project:e=>(0,kit_installers_1.installClaude)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.agentModels,e.profile),global:e=>(0,kit_installers_1.installClaudeGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.agentModels,e.profile)},opencode:{project:e=>(0,kit_installers_1.installOpenCode)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installOpenCodeGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},cursor:{project:e=>(0,kit_installers_1.installCursor)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installCursorGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},antigravity:{project:e=>(0,kit_installers_1.installAntigravity)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installAntigravityGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},codex:{project:e=>(0,kit_installers_1.installCodex)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installCodexGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},kimi:{project:e=>(0,kit_installers_1.installKimi)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installKimiGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},grok:{project:e=>(0,kit_installers_1.installGrok)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installGrokGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},hermes:{projectRefusal:"Hermes Agent installs into a profile under ~/.hermes, not into a project. Run `agentkit init` from your home directory.",global:e=>(0,kit_installers_1.installHermesGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},openclaw:{projectRefusal:"OpenClaw installs into its state root at ~/.openclaw, not into a project. Run `agentkit init` from your home directory.",global:e=>(0,kit_installers_1.installOpenClawGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},omp:{projectRefusal:"Oh My Pi installs into its agent directory at ~/.omp/agent, not into a project. Run `agentkit init` from your home directory.",global:e=>(0,kit_installers_1.installOmpGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},augment:{project:e=>(0,kit_installers_1.installAugment)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},pi:{project:e=>(0,kit_installers_1.installPi)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installPiGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)},devin:{project:e=>(0,kit_installers_1.installDevin)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile),global:e=>(0,kit_installers_1.installDevinGlobal)(e.repoRoot,e.targetDir,e.profileSkipDirs,e.profile)}},MARKER_TEMPLATE_KIT={claude:"claude",augment:"claude",cursor:"claude",antigravity:"claude",codex:"claude",grok:"claude",devin:"claude",opencode:"opencode",kimi:"kimi",hermes:"hermes",openclaw:"openclaw",omp:"omp",pi:"pi"};function installPreservingMarker(e,r,t,o){const i=path.join(o,".agentkit.json"),l=(0,agentkit_config_file_1.readKitConfig)(i);try{t(r)}finally{try{(0,agentkit_config_file_1.mergePreservedKitConfig)(i,l)}catch(a){(0,logger_1.printWarning)(`Could not restore ${i}: ${a.message}`)}}let n=[];try{n=(0,shared_1.refreshKitOwnedConfig)(r.repoRoot,MARKER_TEMPLATE_KIT[e],o)}catch(a){(0,logger_1.printWarning)(`Could not refresh kit-owned config in ${i}: ${a.message}`)}n.length>0&&(0,logger_1.printInfo)(`Updated kit-owned config keys: ${n.join(", ")}`)}function buildContext(e,r,t,o){return{repoRoot:e,targetDir:r,profileSkipDirs:t,profile:o.profileContext??profile_context_1.EMPTY_PROFILE_CONTEXT,agentModels:o.agentModels??claude_agents_1.DEFAULT_CLAUDE_AGENT_MODELS}}function installProjectKit(e,r,t,o,i={}){const l=KIT_DESCRIPTORS[e],n=l.project;return n?(installPreservingMarker(e,buildContext(r,t,o,i),n,path.join(t,kits_1.kitDefinitions[e].dir)),{ok:!0}):{ok:!1,reason:l.projectRefusal??`No project installer for ${e}.`}}function installGlobalKit(e,r,t,o,i={}){const l=(0,init_install_scope_1.sharedRootConflict)(e);if(l&&!i.allowSharedRoot)return{ok:!1,reason:`${l.dir} already holds an ${l.other} install. Pi and ${l.other} both read ${l.envVar}, so they resolve to this same root and would overwrite each other's payload and marker. Unset ${l.envVar} to install into the default directory, or re-run with --force-shared-root to install here anyway.`};const n=KIT_DESCRIPTORS[e].global;return n?(installPreservingMarker(e,buildContext(r,t,o,i),n,(0,init_install_scope_1.kitDirWithinGlobalRoot)(e,t)),{ok:!0}):{ok:!1,reason:"Global install is only supported for Claude, OpenCode, Antigravity, Codex, Cursor, Kimi Code, Hermes, OpenClaw, Oh My Pi, Grok Build, Pi and Devin CLI."}}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i<r.length;i++)r[i]!=="default"&&__createBinding(n,e,r[i]);return __setModuleDefault(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.VERSION_DIR_SHAPE=void 0,exports.pruneOtherVersions=pruneOtherVersions,exports.removeAllVersions=removeAllVersions,exports.describePayloadPath=describePayloadPath;const fs=__importStar(require("fs")),path=__importStar(require("path")),agentkit_home_1=require("../agentkit-home");exports.VERSION_DIR_SHAPE=/^[\w.+-]+$/;function pruneOtherVersions(t,e=(0,agentkit_home_1.loadAgentkitHomeCore)()){return sweepPayloadVersions(e,n=>n===t)}function removeAllVersions(t=(0,agentkit_home_1.loadAgentkitHomeCore)()){return sweepPayloadVersions(t,()=>!1)}function sweepPayloadVersions(t,e){const n=t.getPayloadDir(),r=[];let i;try{i=fs.readdirSync(n,{withFileTypes:!0})}catch{return r}for(const o of i)if(!(!o.isDirectory()||e(o.name))&&!(!exports.VERSION_DIR_SHAPE.test(o.name)||o.name.endsWith(".partial")))try{fs.rmSync(path.join(n,o.name),{recursive:!0,force:!0}),r.push(o.name)}catch{}return r}function describePayloadPath(t=(0,agentkit_home_1.loadAgentkitHomeCore)()){return t.toDisplayPath(t.getPayloadDir())}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,r,t){t===void 0&&(t=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(n,t,i)}):(function(n,e,r,t){t===void 0&&(t=r),n[t]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(r){var t=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[t.length]=i);return t},n(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t=n(e),i=0;i<t.length;i++)t[i]!=="default"&&__createBinding(r,e,t[i]);return __setModuleDefault(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.VERSION_DIR_SHAPE=void 0,exports.pruneOtherVersions=pruneOtherVersions,exports.removeAllVersions=removeAllVersions;const fs=__importStar(require("fs")),path=__importStar(require("path")),agentkit_home_1=require("../agentkit-home");exports.VERSION_DIR_SHAPE=/^[\w.+-]+$/;function pruneOtherVersions(n,e=(0,agentkit_home_1.loadAgentkitHomeCore)()){return sweepPayloadVersions(e,r=>r===n)}function removeAllVersions(n=(0,agentkit_home_1.loadAgentkitHomeCore)()){return sweepPayloadVersions(n,()=>!1)}function sweepPayloadVersions(n,e){const r=n.getPayloadDir(),t=[];let i;try{i=fs.readdirSync(r,{withFileTypes:!0})}catch{return t}for(const o of i)if(!(!o.isDirectory()||e(o.name))&&!(!exports.VERSION_DIR_SHAPE.test(o.name)||o.name.endsWith(".partial")))try{fs.rmSync(path.join(r,o.name),{recursive:!0,force:!0}),t.push(o.name)}catch{}return t}
@@ -1,4 +1,4 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,r,t){t===void 0&&(t=r);var l=Object.getOwnPropertyDescriptor(e,r);(!l||("get"in l?!e.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(n,t,l)}):(function(n,e,r,t){t===void 0&&(t=r),n[t]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(r){var t=[];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(t[t.length]=l);return t},n(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t=n(e),l=0;l<t.length;l++)t[l]!=="default"&&__createBinding(r,e,t[l]);return __setModuleDefault(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.MissingProfileProseError=exports.PROFILE_BLOCK_MAX_BYTES=void 0,exports.installedSkillsForProfile=installedSkillsForProfile,exports.renderProfileBlock=renderProfileBlock;const fs=__importStar(require("fs")),path=__importStar(require("path")),generate_catalogs_1=require("../gen/generate-catalogs"),skill_profiles_1=require("./skill-profiles"),payload_roots_1=require("./payload-roots");exports.PROFILE_BLOCK_MAX_BYTES=1800;class MissingProfileProseError extends Error{constructor(e,r){super(`profile block: no prose for the "${e}" profile \u2014 expected ${r}`),this.profile=e,this.file=r,this.name="MissingProfileProseError"}}exports.MissingProfileProseError=MissingProfileProseError;function installedSkillsForProfile(n,e){const r=new Set((0,skill_profiles_1.profileToSkipDirs)(n,e));return(0,generate_catalogs_1.collectSkills)(n).map(t=>t.name).filter(t=>!r.has(t))}function renderProfileBlock(n){const{repoRoot:e,profile:r,activeRules:t}=n,l=n.droppedRules??[];if(r==="core"||r==="full")return null;const u=readProfileProse(e,r),i=installedSkillsForProfile(e,r),o=(0,skill_profiles_1.isNameOnlyProfile)(r),a=o?i:i.filter(p=>!skill_profiles_1.CORE_SKILLS.has(p)),f=i.length-a.length,c=o?`${i.length} named skills \u2014 this profile installs by name rather than by category \u2014 and ${t.length} rules.`:`${i.length} skills (${a.length} from ${(0,skill_profiles_1.profileIncludeCategories)(r).join(", ")}, ${f} shared core) and ${t.length} rules.`,s=[`### Installed: \`${r}\` profile`,"",c,`${o?"Skills":"Profile skills"}: ${a.join(", ")}.`];return s.push(t.length>0?`Rules: ${t.join(", ")}.`:"No rules ship with this profile."),l.length>0&&s.push(`Rules left out: ${l.join(", ")}.`),s.push("`agentkit skills add <name>` restores a skill; `agentkit init --profile full` installs everything, rules included."),`${s.join(`
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,r,t){t===void 0&&(t=r);var l=Object.getOwnPropertyDescriptor(e,r);(!l||("get"in l?!e.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(n,t,l)}):(function(n,e,r,t){t===void 0&&(t=r),n[t]=e[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(r){var t=[];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(t[t.length]=l);return t},n(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t=n(e),l=0;l<t.length;l++)t[l]!=="default"&&__createBinding(r,e,t[l]);return __setModuleDefault(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.MissingProfileProseError=exports.PROFILE_BLOCK_MAX_BYTES=void 0,exports.installedSkillsForProfile=installedSkillsForProfile,exports.renderProfileBlock=renderProfileBlock;const fs=__importStar(require("fs")),path=__importStar(require("path")),generate_catalogs_1=require("../gen/generate-catalogs"),skill_profiles_1=require("./skill-profiles"),payload_roots_1=require("./payload-roots");exports.PROFILE_BLOCK_MAX_BYTES=2400;class MissingProfileProseError extends Error{constructor(e,r){super(`profile block: no prose for the "${e}" profile \u2014 expected ${r}`),this.profile=e,this.file=r,this.name="MissingProfileProseError"}}exports.MissingProfileProseError=MissingProfileProseError;function installedSkillsForProfile(n,e){const r=new Set((0,skill_profiles_1.profileToSkipDirs)(n,e));return(0,generate_catalogs_1.collectSkills)(n).map(t=>t.name).filter(t=>!r.has(t))}function renderProfileBlock(n){const{repoRoot:e,profile:r,activeRules:t}=n,l=n.droppedRules??[];if(r==="core"||r==="full")return null;const u=readProfileProse(e,r),i=installedSkillsForProfile(e,r),o=(0,skill_profiles_1.isNameOnlyProfile)(r),a=o?i:i.filter(p=>!skill_profiles_1.CORE_SKILLS.has(p)),f=i.length-a.length,c=o?`${i.length} named skills \u2014 this profile installs by name rather than by category \u2014 and ${t.length} rules.`:`${i.length} skills (${a.length} from ${(0,skill_profiles_1.profileIncludeCategories)(r).join(", ")}, ${f} shared core) and ${t.length} rules.`,s=[`### Installed: \`${r}\` profile`,"",c,`${o?"Skills":"Profile skills"}: ${a.join(", ")}.`];return s.push(t.length>0?`Rules: ${t.join(", ")}.`:"No rules ship with this profile."),l.length>0&&s.push(`Rules left out: ${l.join(", ")}.`),s.push("`agentkit skills add <name>` restores a skill; `agentkit init --profile full` installs everything, rules included."),`${s.join(`
2
2
  `)}
3
3
 
4
4
  ${u}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,n,t){t===void 0&&(t=n);var a=Object.getOwnPropertyDescriptor(e,n);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(r,t,a)}):(function(r,e,n,t){t===void 0&&(t=n),r[t]=e[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),__importStar=this&&this.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(n){var t=[];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[t.length]=a);return t},r(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t=r(e),a=0;a<t.length;a++)t[a]!=="default"&&__createBinding(n,e,t[a]);return __setModuleDefault(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.PROFILE_RULE_SKIP=void 0,exports.ruleSkipFor=ruleSkipFor,exports.rulesForProfile=rulesForProfile;const path=__importStar(require("path")),rule_metadata_1=require("./kit-installers/rule-metadata"),payload_roots_1=require("./payload-roots");exports.PROFILE_RULE_SKIP={frontend:["database-security","team-coordination-rules"],backend:["dart","kotlin","swift","team-coordination-rules"],mobile:["database-security","team-coordination-rules"],fullstack:["team-coordination-rules"],marketing:["dart","kotlin","swift","database-security","team-coordination-rules"],assistant:["dart","kotlin","swift","database-security","team-coordination-rules"]};function ruleSkipFor(r){return r==="core"||r==="full"?[]:exports.PROFILE_RULE_SKIP[r]}function rulesForProfile(r,e){const n=new Set(ruleSkipFor(e));return(0,rule_metadata_1.readRulesDir)(path.join(r,payload_roots_1.RULES_SOURCE_DIR)).rules.map(t=>t.name).filter(t=>!n.has(t))}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,a,t){t===void 0&&(t=a);var n=Object.getOwnPropertyDescriptor(e,a);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(r,t,n)}):(function(r,e,a,t){t===void 0&&(t=a),r[t]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),__importStar=this&&this.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(a){var t=[];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[t.length]=n);return t},r(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var t=r(e),n=0;n<t.length;n++)t[n]!=="default"&&__createBinding(a,e,t[n]);return __setModuleDefault(a,e),a}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.PROFILE_RULE_SKIP=exports.GAMEDEV_RULES=void 0,exports.ruleSkipFor=ruleSkipFor,exports.rulesForProfile=rulesForProfile;const path=__importStar(require("path")),rule_metadata_1=require("./kit-installers/rule-metadata"),payload_roots_1=require("./payload-roots");exports.GAMEDEV_RULES=["ai-code","data-files","design-docs","engine-code","game-narrative","game-test-standards","gameplay-code","network-code","prototype-code","scene-files","shader-code","ui-code"],exports.PROFILE_RULE_SKIP={frontend:["database-security","team-coordination-rules"],backend:["dart","kotlin","swift","team-coordination-rules"],mobile:["database-security","team-coordination-rules"],fullstack:["team-coordination-rules"],gamedev:["dart","kotlin","swift","database-security","team-coordination-rules"],marketing:["dart","kotlin","swift","database-security","team-coordination-rules"],assistant:["dart","kotlin","swift","database-security","team-coordination-rules"]};function ruleSkipFor(r){return r==="core"||r==="full"?[]:exports.PROFILE_RULE_SKIP[r]}function rulesForProfile(r,e){const a=new Set(ruleSkipFor(e));return(0,rule_metadata_1.readRulesDir)(path.join(r,payload_roots_1.RULES_SOURCE_DIR)).rules.map(t=>t.name).filter(t=>!a.has(t))}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,o)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),__importStar=this&&this.__importStar||(function(){var i=function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[r.length]=o);return r},i(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(t,e,r[o]);return __setModuleDefault(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.MASTER_HOOK=void 0,exports.setHook=setHook,exports.refreshKit=refreshKit,exports.previewKitRemoval=previewKitRemoval,exports.removeKitInstall=removeKitInstall;const path=__importStar(require("path")),agentkit_config_file_1=require("../agentkit-config-file"),hook_toggle_registry_1=require("../hook-toggle-registry"),agentkit_home_1=require("../agentkit-home"),init_install_scope_1=require("../init-install-scope"),install_registry_1=require("../install-registry"),kit_remover_1=require("../kit-remover"),kit_install_dispatch_1=require("../kit-install-dispatch"),profile_context_1=require("../kit-installers/profile-context"),install_manifest_1=require("../install-manifest"),install_profile_config_1=require("../install-profile-config"),profile_resolution_1=require("../doctor/profile-resolution"),skill_profiles_1=require("../skill-profiles"),hooks_write_policy_1=require("../hooks-write-policy"),kits_1=require("../kits"),kits_endpoint_1=require("./kits-endpoint"),kit_target_1=require("./kit-target");exports.MASTER_HOOK="*";function refused(i,e,t){return{status:i,body:{ok:!1,error:e,...t?{hint:t}:{}}}}function setHook(i,e){const t=(0,kit_target_1.targetFrom)(e);if(!t.ok)return refused(t.status,t.error);const r=e,o=r.hook,n=r.enabled;if(typeof o!="string"||!o)return refused(400,"hook is required");if(typeof n!="boolean")return refused(400,"enabled must be true or false");const{record:l,context:c}=t.target;if(o===exports.MASTER_HOOK){try{(0,agentkit_config_file_1.writeHooksEnabled)(c.configPath,n)}catch(a){return refused(500,`could not write the kit config: ${a.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,hook:o,enabled:n}}}const u=(0,hook_toggle_registry_1.hookRegistry)(i).find(a=>a.name===o);if(!u)return refused(404,"no such hook");const s=(0,hooks_write_policy_1.decideWrite)(l.kit,l.scope,o,u.readBy,kits_1.kitDefinitions[l.kit].name);if(!s.allowed)return refused(409,s.reason,s.hint);try{(0,agentkit_config_file_1.updateSection)(c.configPath,"hooks",a=>{a[o]=n})}catch(a){return refused(500,`could not write the kit config: ${a.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,hook:o,enabled:n,...s.warning?{warning:s.warning}:{}}}}function refreshKit(i,e){const t=(0,kit_target_1.targetFrom)(e);if(!t.ok)return refused(t.status,t.error);const{record:r,context:o}=t.target,n=(0,install_profile_config_1.readInstallSettings)(o.configPath),l=n.profile??(0,profile_resolution_1.resolveCheckProfile)(o,i).profile;if(!l)return refused(409,`${kits_1.kitDefinitions[r.kit].name} never recorded a profile and its installed skill set is ambiguous \u2014 run \`agentkit init\` to choose one before refreshing.`);const c=(0,skill_profiles_1.resolveSkipDirs)(i,l,n.extraSkills),f={...n.agentModels?{agentModels:n.agentModels}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(i,l)},u=r.scope==="global"?(0,kit_install_dispatch_1.installGlobalKit)(r.kit,i,(0,init_install_scope_1.resolveGlobalRoot)(r.kit,""),c,f):(0,kit_install_dispatch_1.installProjectKit)(r.kit,i,r.path,c,f);if(!u.ok)return refused(409,u.reason);const s=(0,install_profile_config_1.readCliVersion)(i);try{s&&(0,install_profile_config_1.stampInstallVersion)(o.configPath,s),(0,install_profile_config_1.writeInstallSettings)(o.configPath,{profile:n.profile??void 0,extraSkills:n.extraSkills,...n.agentModels?{agentModels:n.agentModels}:{}}),(0,install_manifest_1.writeManifest)(o,s)}catch(a){return refused(500,`the kit was refreshed but not stamped: ${a.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,kit:r.kit,version:s}}}function previewKitRemoval(i){const e=(0,kit_target_1.targetFrom)(i);if(!e.ok)return refused(e.status,e.error);const{record:t}=e.target,r=removalRefusal(t.scope);if(r)return r;const o=(0,agentkit_home_1.loadAgentkitHome)();return{status:200,body:{ok:!0,paths:(0,kit_remover_1.kitRemovalPaths)(t.kit,t.path).map(n=>o.toDisplayPath(path.join(t.path,n)))}}}function removalRefusal(i){return i!=="global"?null:refused(409,"Global installs cannot be removed from the dashboard.","Delete the kit directory yourself if you mean to; nothing here will do it for you.")}function removeKitInstall(i){const e=(0,kit_target_1.targetFrom)(i);if(!e.ok)return refused(e.status,e.error);const{record:t}=e.target,r=removalRefusal(t.scope);if(r)return r;if(i.confirmKitRoot!==(0,kit_target_1.wireRoot)(t.kitRoot))return refused(400,"confirmKitRoot must repeat the install root exactly");if(!(0,kit_remover_1.removeKit)(t.kit,t.path))return refused(500,"nothing was removed \u2014 the install may already be gone");try{(0,install_registry_1.removeInstall)(t.kitRoot,t.kit)}catch{}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,kit:t.kit}}}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,r,o)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),__importStar=this&&this.__importStar||(function(){var i=function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[r.length]=o);return r},i(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(t,e,r[o]);return __setModuleDefault(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.MASTER_HOOK=void 0,exports.setHook=setHook,exports.refreshKit=refreshKit,exports.previewKitRemoval=previewKitRemoval,exports.removeKitInstall=removeKitInstall;const path=__importStar(require("path")),agentkit_config_file_1=require("../agentkit-config-file"),hook_toggle_registry_1=require("../hook-toggle-registry"),agentkit_home_1=require("../agentkit-home"),init_install_scope_1=require("../init-install-scope"),install_registry_1=require("../install-registry"),kit_remover_1=require("../kit-remover"),kit_install_dispatch_1=require("../kit-install-dispatch"),profile_context_1=require("../kit-installers/profile-context"),install_manifest_1=require("../install-manifest"),install_profile_config_1=require("../install-profile-config"),profile_resolution_1=require("../doctor/profile-resolution"),skill_profiles_1=require("../skill-profiles"),hooks_write_policy_1=require("../hooks-write-policy"),kits_1=require("../kits"),kits_endpoint_1=require("./kits-endpoint"),kit_target_1=require("./kit-target");exports.MASTER_HOOK="*";function refused(i,e,t){return{status:i,body:{ok:!1,error:e,...t?{hint:t}:{}}}}function setHook(i,e){const t=(0,kit_target_1.targetFrom)(e);if(!t.ok)return refused(t.status,t.error);const r=e,o=r.hook,n=r.enabled;if(typeof o!="string"||!o)return refused(400,"hook is required");if(typeof n!="boolean")return refused(400,"enabled must be true or false");const{record:l,context:c}=t.target;if(o===exports.MASTER_HOOK){try{(0,agentkit_config_file_1.writeHooksEnabled)(c.configPath,n)}catch(a){return refused(500,`could not write the kit config: ${a.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,hook:o,enabled:n}}}const u=(0,hook_toggle_registry_1.hookRegistry)(i).find(a=>a.name===o);if(!u)return refused(404,"no such hook");const s=(0,hooks_write_policy_1.decideWrite)(l.kit,l.scope,o,u.readBy,kits_1.kitDefinitions[l.kit].name);if(!s.allowed)return refused(409,s.reason,s.hint);try{(0,agentkit_config_file_1.updateSection)(c.configPath,"hooks",a=>{a[o]=n})}catch(a){return refused(500,`could not write the kit config: ${a.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,hook:o,enabled:n,...s.warning?{warning:s.warning}:{}}}}function refreshKit(i,e){const t=(0,kit_target_1.targetFrom)(e);if(!t.ok)return refused(t.status,t.error);const{record:r,context:o}=t.target,n=(0,install_profile_config_1.readInstallSettings)(o.configPath),l=n.profile??(0,profile_resolution_1.resolveCheckProfile)(o,i).profile;if(!l)return refused(409,`${kits_1.kitDefinitions[r.kit].name} never recorded a profile and its installed skill set is ambiguous \u2014 run \`agentkit init\` to choose one before refreshing.`);const c=(0,skill_profiles_1.resolveSkipDirs)(i,l,n.extraSkills),f={...n.agentModels?{agentModels:n.agentModels}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(i,l,n.extraSkills)},u=r.scope==="global"?(0,kit_install_dispatch_1.installGlobalKit)(r.kit,i,(0,init_install_scope_1.resolveGlobalRoot)(r.kit,""),c,f):(0,kit_install_dispatch_1.installProjectKit)(r.kit,i,r.path,c,f);if(!u.ok)return refused(409,u.reason);const s=(0,install_profile_config_1.readCliVersion)(i);try{s&&(0,install_profile_config_1.stampInstallVersion)(o.configPath,s),(0,install_profile_config_1.writeInstallSettings)(o.configPath,{profile:n.profile??void 0,extraSkills:n.extraSkills,...n.agentModels?{agentModels:n.agentModels}:{}}),(0,install_manifest_1.writeManifest)(o,s)}catch(a){return refused(500,`the kit was refreshed but not stamped: ${a.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,kit:r.kit,version:s}}}function previewKitRemoval(i){const e=(0,kit_target_1.targetFrom)(i);if(!e.ok)return refused(e.status,e.error);const{record:t}=e.target,r=removalRefusal(t.scope);if(r)return r;const o=(0,agentkit_home_1.loadAgentkitHome)();return{status:200,body:{ok:!0,paths:(0,kit_remover_1.kitRemovalPaths)(t.kit,t.path).map(n=>o.toDisplayPath(path.join(t.path,n)))}}}function removalRefusal(i){return i!=="global"?null:refused(409,"Global installs cannot be removed from the dashboard.","Delete the kit directory yourself if you mean to; nothing here will do it for you.")}function removeKitInstall(i){const e=(0,kit_target_1.targetFrom)(i);if(!e.ok)return refused(e.status,e.error);const{record:t}=e.target,r=removalRefusal(t.scope);if(r)return r;if(i.confirmKitRoot!==(0,kit_target_1.wireRoot)(t.kitRoot))return refused(400,"confirmKitRoot must repeat the install root exactly");if(!(0,kit_remover_1.removeKit)(t.kit,t.path))return refused(500,"nothing was removed \u2014 the install may already be gone");try{(0,install_registry_1.removeInstall)(t.kitRoot,t.kit)}catch{}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,kit:t.kit}}}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SKILL_DEPENDENCIES=exports.DEFAULT_EXCLUDED_SKILLS=exports.CORE_SKILLS=exports.DEFAULT_PROFILE=exports.PROFILES=void 0,exports.defaultProfileForKit=defaultProfileForKit,exports.resolveEffectiveProfile=resolveEffectiveProfile,exports.withDependencies=withDependencies,exports.isNameOnlyProfile=isNameOnlyProfile,exports.profileSkillNames=profileSkillNames,exports.profileIncludeCategories=profileIncludeCategories,exports.profileExtraSkills=profileExtraSkills,exports.isValidProfile=isValidProfile,exports.profileToSkipDirs=profileToSkipDirs,exports.resolveSkipDirs=resolveSkipDirs;const generate_catalogs_1=require("../gen/generate-catalogs"),retired_skills_1=require("./retired-skills");exports.PROFILES=["core","full","frontend","backend","mobile","fullstack","marketing","assistant"],exports.DEFAULT_PROFILE="core";function defaultProfileForKit(e){return ASSISTANT_PROFILE_KITS.has(e)?"assistant":exports.DEFAULT_PROFILE}function resolveEffectiveProfile(e,t,s,n){return e??(t?s:null)??defaultProfileForKit(n)}const ASSISTANT_PROFILE_KITS=new Set(["hermes","openclaw"]);exports.CORE_SKILLS=new Set(["ak-plan","cook","ak-fix","test","ak-code-review","ak-debug","scout","brainstorm","ship","journal","git","worktree","docs","docs-seeker","find-skills","problem-solving","refactor","context-engineering","research","preview","mermaidjs-v11"]),exports.DEFAULT_EXCLUDED_SKILLS=new Set(["twilio","typesafe-ai","expo","flutter","gsap","shopify","zalo-mini-app","stitch","remotion","shader","threejs","clone-website","pentester","cti-expert","ai-artist","chrome-devtools","chrome-profile","xia","agentize","show-off","mintlify","seo","social-calendar","email-marketing","paid-ads","marketing-analytics","product-marketing","campaign-plan","crm-automation","pr-outreach","growth-referral","aso-app-marketing","video-content-repurposing","fomo-cc","enhance-ux-ax"]);const PROFILE_INCLUDES={frontend:["frontend","design","frameworks"],backend:["backend","database","infrastructure","security"],mobile:["frontend","frameworks","design"],fullstack:["frontend","backend","database","infrastructure","frameworks","design"],marketing:["marketing","design","seo","documents","multimedia","ai-ml"],assistant:[]},PROFILE_EXTRA_SKILLS={marketing:["copywriting","show-off","project-management","frontend-design","agent-browser","project-organization","ak-sowat","enhance-ux-ax"]};exports.SKILL_DEPENDENCIES={"enhance-ux-ax":["seo"]};function withDependencies(e){const t=new Set(e);let s=!0;for(;s;){s=!1;for(const n of[...t])for(const i of exports.SKILL_DEPENDENCIES[n]??[])t.has(i)||(t.add(i),s=!0)}return t}const NAME_ONLY_PROFILES=new Set(["assistant"]),PROFILE_SKILL_NAMES={assistant:["research","problem-solving","brainstorm","context-engineering","ak-advise","ak-plan","project-organization","retro","git","test","document-skills","docs-seeker","media-processing","copywriting","mermaidjs-v11"]};function isNameOnlyProfile(e){return NAME_ONLY_PROFILES.has(e)}function profileSkillNames(e){return e==="full"||e==="core"?[]:PROFILE_SKILL_NAMES[e]??[]}function profileIncludeCategories(e){return e==="full"||e==="core"?[]:PROFILE_INCLUDES[e]}function profileExtraSkills(e){return e==="full"||e==="core"?[]:PROFILE_EXTRA_SKILLS[e]??[]}function isValidProfile(e){return exports.PROFILES.includes(e)}function profileToSkipDirs(e,t){if(t==="full")return[];if(t==="core"){const r=(0,generate_catalogs_1.collectSkills)(e),a=withDependencies(r.filter(o=>!exports.DEFAULT_EXCLUDED_SKILLS.has(o.name)).map(o=>o.name));return r.filter(o=>!a.has(o.name)).map(o=>o.name).sort()}if(NAME_ONLY_PROFILES.has(t)){const r=withDependencies(PROFILE_SKILL_NAMES[t]??[]);return(0,generate_catalogs_1.collectSkills)(e).filter(a=>!r.has(a.name)).map(a=>a.name).sort()}const s=new Set(PROFILE_INCLUDES[t]),n=new Set(PROFILE_EXTRA_SKILLS[t]??[]),i=(0,generate_catalogs_1.collectSkills)(e),l=withDependencies(i.filter(r=>s.has(r.category)||exports.CORE_SKILLS.has(r.name)||n.has(r.name)).map(r=>r.name));return i.filter(r=>!l.has(r.name)).map(r=>r.name).sort()}function resolveSkipDirs(e,t,s=[]){const n=withDependencies(s);return[...new Set([...profileToSkipDirs(e,t),...retired_skills_1.RETIRED_SKILLS])].filter(l=>!n.has(l)).sort()}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SKILL_DEPENDENCIES=exports.DEFAULT_EXCLUDED_SKILLS=exports.CORE_SKILLS=exports.DEFAULT_PROFILE=exports.PROFILES=void 0,exports.defaultProfileForKit=defaultProfileForKit,exports.resolveEffectiveProfile=resolveEffectiveProfile,exports.withDependencies=withDependencies,exports.isNameOnlyProfile=isNameOnlyProfile,exports.profileSkillNames=profileSkillNames,exports.profileIncludeCategories=profileIncludeCategories,exports.profileExtraSkills=profileExtraSkills,exports.isValidProfile=isValidProfile,exports.profileToSkipDirs=profileToSkipDirs,exports.resolveSkipDirs=resolveSkipDirs;const generate_catalogs_1=require("../gen/generate-catalogs"),retired_skills_1=require("./retired-skills");exports.PROFILES=["core","full","frontend","backend","mobile","fullstack","gamedev","marketing","assistant"],exports.DEFAULT_PROFILE="core";function defaultProfileForKit(e){return ASSISTANT_PROFILE_KITS.has(e)?"assistant":exports.DEFAULT_PROFILE}function resolveEffectiveProfile(e,t,s,n){return e??(t?s:null)??defaultProfileForKit(n)}const ASSISTANT_PROFILE_KITS=new Set(["hermes","openclaw"]);exports.CORE_SKILLS=new Set(["ak-plan","cook","ak-fix","test","ak-code-review","ak-debug","scout","brainstorm","ship","journal","git","worktree","docs","docs-seeker","find-skills","problem-solving","refactor","context-engineering","research","preview","mermaidjs-v11"]),exports.DEFAULT_EXCLUDED_SKILLS=new Set(["twilio","expo","flutter","gsap","shopify","zalo-mini-app","stitch","remotion","shader","threejs","clone-website","pentester","cti-expert","ai-artist","chrome-devtools","chrome-profile","xia","agentize","show-off","mintlify","seo","social-calendar","email-marketing","paid-ads","marketing-analytics","product-marketing","campaign-plan","crm-automation","pr-outreach","growth-referral","aso-app-marketing","video-content-repurposing","fomo-cc","enhance-ux-ax","gamedev"]);const PROFILE_INCLUDES={frontend:["frontend","design","frameworks"],backend:["backend","database","infrastructure","security"],mobile:["frontend","frameworks","design"],fullstack:["frontend","backend","database","infrastructure","frameworks","design"],gamedev:["gamedev","multimedia"],marketing:["marketing","design","seo","documents","multimedia","ai-ml"],assistant:[]},PROFILE_EXTRA_SKILLS={gamedev:["threejs","shader","ai-artist","ai-multimodal","ui-ux-pro-max","ak-scenario","ak-optimize"],marketing:["copywriting","show-off","project-management","frontend-design","agent-browser","project-organization","ak-sowat","enhance-ux-ax"]};exports.SKILL_DEPENDENCIES={"enhance-ux-ax":["seo"]};function withDependencies(e){const t=new Set(e);let s=!0;for(;s;){s=!1;for(const n of[...t])for(const a of exports.SKILL_DEPENDENCIES[n]??[])t.has(a)||(t.add(a),s=!0)}return t}const NAME_ONLY_PROFILES=new Set(["assistant"]),PROFILE_SKILL_NAMES={assistant:["research","problem-solving","brainstorm","context-engineering","ak-advise","ak-plan","project-organization","retro","git","test","document-skills","docs-seeker","media-processing","copywriting","mermaidjs-v11"]};function isNameOnlyProfile(e){return NAME_ONLY_PROFILES.has(e)}function profileSkillNames(e){return e==="full"||e==="core"?[]:PROFILE_SKILL_NAMES[e]??[]}function profileIncludeCategories(e){return e==="full"||e==="core"?[]:PROFILE_INCLUDES[e]}function profileExtraSkills(e){return e==="full"||e==="core"?[]:PROFILE_EXTRA_SKILLS[e]??[]}function isValidProfile(e){return exports.PROFILES.includes(e)}function profileToSkipDirs(e,t){if(t==="full")return[];if(t==="core"){const r=(0,generate_catalogs_1.collectSkills)(e),i=withDependencies(r.filter(o=>!exports.DEFAULT_EXCLUDED_SKILLS.has(o.name)).map(o=>o.name));return r.filter(o=>!i.has(o.name)).map(o=>o.name).sort()}if(NAME_ONLY_PROFILES.has(t)){const r=withDependencies(PROFILE_SKILL_NAMES[t]??[]);return(0,generate_catalogs_1.collectSkills)(e).filter(i=>!r.has(i.name)).map(i=>i.name).sort()}const s=new Set(PROFILE_INCLUDES[t]),n=new Set(PROFILE_EXTRA_SKILLS[t]??[]),a=(0,generate_catalogs_1.collectSkills)(e),l=withDependencies(a.filter(r=>s.has(r.category)||exports.CORE_SKILLS.has(r.name)||n.has(r.name)).map(r=>r.name));return a.filter(r=>!l.has(r.name)).map(r=>r.name).sort()}function resolveSkipDirs(e,t,s=[]){const n=withDependencies(s);return[...new Set([...profileToSkipDirs(e,t),...retired_skills_1.RETIRED_SKILLS])].filter(l=>!n.has(l)).sort()}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,i,t){t===void 0&&(t=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(r,t,n)}):(function(r,e,i,t){t===void 0&&(t=i),r[t]=e[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),__importStar=this&&this.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(i){var t=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[t.length]=n);return t},r(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var t=r(e),n=0;n<t.length;n++)t[n]!=="default"&&__createBinding(i,e,t[n]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runSkills=runSkills;const fs=__importStar(require("fs")),path=__importStar(require("path")),p=__importStar(require("@clack/prompts")),file_operations_1=require("../file-operations"),install_profile_config_1=require("../install-profile-config"),kit_context_1=require("../kit-context"),kits_1=require("../kits"),logger_1=require("../logger"),install_manifest_1=require("../install-manifest"),skills_remove_1=require("../skills-remove"),skill_profiles_1=require("../skill-profiles"),generate_catalogs_1=require("../../gen/generate-catalogs"),payload_roots_1=require("../payload-roots");function installedSkillNames(r){return fs.existsSync(r)?new Set(fs.readdirSync(r,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)):new Set}function closeMatches(r,e){const i=r.toLowerCase();return e.filter(t=>t.includes(i)||i.includes(t)||t.slice(0,3)===i.slice(0,3)).slice(0,5)}function usage(){(0,logger_1.printInfo)("Usage:"),(0,logger_1.printInfo)(" agentkit skills pick skills to install (interactive)"),(0,logger_1.printInfo)(" agentkit skills list show the full skill catalog"),(0,logger_1.printInfo)(" agentkit skills add <name\u2026> install one or more named skills"),(0,logger_1.printInfo)(" agentkit skills remove <name\u2026> remove skills added with `add`"),(0,logger_1.printInfo)(" agentkit skills help show full help message")}function printList(r,e){(0,logger_1.printSection)(`Skill catalog (${r.length})`);const i=new Map;for(const t of r)(i.get(t.category)??i.set(t.category,[]).get(t.category)).push(t);for(const t of Object.keys(generate_catalogs_1.CATEGORY_TITLES)){const n=i.get(t);if(!(!n||n.length===0)){console.log(""),console.log(` ${generate_catalogs_1.CATEGORY_TITLES[t]} (${n.length})`);for(const s of n){const c=e.has(s.name)?" \u2713":" ",u=s.description?` \u2014 ${s.description}`:"";console.log(` ${c} ${s.name}${u}`)}}}console.log("")}function installSkills(r,e,i){const t=new Set(r),n=[...(0,skill_profiles_1.withDependencies)(r)].sort(),s=n.filter(l=>!fs.existsSync(path.join(i,payload_roots_1.SKILL_SOURCE_DIR,l)));if(s.length>0)return(0,logger_1.printError)(`Cannot install: ${s.join(", ")} missing from the shipped skills/.`),1;fs.mkdirSync(e.destSkillsDir,{recursive:!0});for(const l of n){const f=path.join(i,payload_roots_1.SKILL_SOURCE_DIR,l);(0,file_operations_1.copyDir)(f,path.join(e.destSkillsDir,l),{suppressSymlinkWarnings:!0})}const c=(0,install_profile_config_1.readInstallSettings)(e.configPath),u=c.profile??(0,skill_profiles_1.defaultProfileForKit)(e.kit),d=[...new Set([...c.extraSkills,...n])].sort();(0,install_profile_config_1.writeInstallSettings)(e.configPath,{profile:c.profile??void 0,extraSkills:d});const o=(0,install_profile_config_1.readCliVersion)(i);o&&(0,install_profile_config_1.stampInstallVersion)(e.configPath,o),(0,install_manifest_1.writeManifest)(e,o);for(const l of r)(0,logger_1.printSuccess)(`Installed ${l} into ${kits_1.kitDefinitions[e.kit].name} (${e.scope}).`);for(const l of n.filter(f=>!t.has(f))){const f=r.filter(g=>(0,skill_profiles_1.withDependencies)([g]).has(l));(0,logger_1.printInfo)(`Also installed ${l} \u2014 required by ${f.join(", ")}.`)}return(0,logger_1.printInfo)(`Recorded in install.extraSkills so re-install keeps them on the ${u} profile.`),0}async function removeSkills(r,e,i,t){const n=(0,install_profile_config_1.readInstallSettings)(e.configPath),s=n.profile??(0,skill_profiles_1.defaultProfileForKit)(e.kit),{extras:c,profileOwned:u}=(0,skills_remove_1.planRemoval)(r,n.extraSkills);for(const a of u)(0,logger_1.printError)(`${a} comes from the ${s} profile, not \`agentkit skills add\`.`),(0,logger_1.printInfo)("Removing it would not stick \u2014 the next `agentkit init` copies it back."),(0,logger_1.printInfo)("Install a narrower profile instead: agentkit init --profile <name>");if(c.length===0)return u.length>0?1:0;if(t.isTTY){const a=await t.confirm({message:`Delete ${c.map(m=>path.join(e.destSkillsDir,m)).join(", ")}?`,initialValue:!1});if(p.isCancel(a)||!a)return(0,logger_1.printInfo)("Nothing removed."),0}const d=(0,skills_remove_1.removeSkillDirs)(c,e.destSkillsDir);for(const a of d.rejected)(0,logger_1.printError)(`Refused to delete ${a}: it does not resolve inside ${e.destSkillsDir}.`);const o=[...d.removed,...d.missing],l=n.extraSkills.filter(a=>!o.includes(a));(0,install_profile_config_1.writeInstallSettings)(e.configPath,{profile:n.profile??void 0,extraSkills:l});const f=(0,install_profile_config_1.readCliVersion)(i);f&&(0,install_profile_config_1.stampInstallVersion)(e.configPath,f),(0,install_manifest_1.writeManifest)(e,f);for(const a of d.removed)(0,logger_1.printSuccess)(`Removed ${a} from ${kits_1.kitDefinitions[e.kit].name} (${e.scope}).`);for(const a of d.missing)(0,logger_1.printInfo)(`${a} was already gone from disk; cleared its install.extraSkills entry.`);const g=installedSkillNames(e.destSkillsDir);for(const[a,m]of(0,skills_remove_1.danglingDependencies)(o,g,skill_profiles_1.SKILL_DEPENDENCIES)){const k=n.extraSkills.includes(a)?`remove ${a} too`:`narrow the ${s} profile that carries it`;(0,logger_1.printWarning)(`${a} is still installed and requires ${m} \u2014 re-add it (\`agentkit skills add ${m}\`), or ${k}. The next \`agentkit init\` re-adds ${m} while ${a} stays installed.`)}return d.rejected.length>0||u.length>0?1:0}async function interactivePick(r,e,i){const t=installedSkillNames(e.destSkillsDir),n=await p.autocompleteMultiselect({message:"Select skills to install",placeholder:"Type to search by name, category, or description",required:!1,options:r.map(s=>({value:s.name,label:`${s.name}${t.has(s.name)?" \u2713":""}`,hint:`[${s.category}] ${s.description}`.slice(0,80)}))});return p.isCancel(n)||n.length===0?((0,logger_1.printInfo)("Nothing selected."),0):installSkills(n,e,i)}async function runSkills(r,e={}){const i=e.cwd??process.cwd(),t=e.repoRoot??path.resolve(__dirname,"..","..",".."),n={confirm:e.confirm??p.confirm,isTTY:e.isTTY??process.stdout.isTTY},[s,...c]=r,u=(0,generate_catalogs_1.collectSkills)(t),d=u.map(o=>o.name);if(s==="list"){const o=(0,kit_context_1.soleContext)(i);return printList(u,o?installedSkillNames(o.destSkillsDir):new Set),0}if(s==="add"||s==="remove"){if(c.length===0)return usage(),1;const o=c.filter(f=>!d.includes(f));if(o.length>0){(0,logger_1.printError)(`Unknown skill(s): ${o.join(", ")}`);for(const f of o){const g=closeMatches(f,d);g.length>0&&(0,logger_1.printInfo)(`Did you mean (for ${f}): ${g.join(", ")}?`)}return(0,logger_1.printInfo)("Run `agentkit skills list` to see the catalog."),1}const l=await(0,kit_context_1.resolveContext)(i);return l?s==="remove"?removeSkills(c,l,t,n):installSkills(c,l,t):1}if(!s){if(!n.isTTY){const l=(0,kit_context_1.soleContext)(i);return printList(u,l?installedSkillNames(l.destSkillsDir):new Set),usage(),0}const o=await(0,kit_context_1.resolveContext)(i);return o?interactivePick(u,o,t):1}return(0,logger_1.printError)(`Unknown subcommand: ${s}`),usage(),1}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(s,e,i,n){n===void 0&&(n=i);var t=Object.getOwnPropertyDescriptor(e,i);(!t||("get"in t?!e.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(s,n,t)}):(function(s,e,i,n){n===void 0&&(n=i),s[n]=e[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),__importStar=this&&this.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(i){var n=[];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(n[n.length]=t);return n},s(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var n=s(e),t=0;t<n.length;t++)n[t]!=="default"&&__createBinding(i,e,n[t]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runSkills=runSkills;const fs=__importStar(require("fs")),path=__importStar(require("path")),p=__importStar(require("@clack/prompts")),file_operations_1=require("../file-operations"),install_profile_config_1=require("../install-profile-config"),kits_1=require("../kits"),logger_1=require("../logger"),install_manifest_1=require("../install-manifest"),skills_remove_1=require("../skills-remove"),skill_profiles_1=require("../skill-profiles"),generate_catalogs_1=require("../../gen/generate-catalogs"),payload_roots_1=require("../payload-roots"),skill_companion_assets_1=require("./skill-companion-assets"),skills_context_options_1=require("./skills-context-options");function installedSkillNames(s){return fs.existsSync(s)?new Set(fs.readdirSync(s,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)):new Set}function closeMatches(s,e){const i=s.toLowerCase();return e.filter(n=>n.includes(i)||i.includes(n)||n.slice(0,3)===i.slice(0,3)).slice(0,5)}function usage(){(0,logger_1.printInfo)("Usage:"),(0,logger_1.printInfo)(" agentkit skills [options] pick skills to install (interactive)"),(0,logger_1.printInfo)(" agentkit skills list [options] show the full skill catalog"),(0,logger_1.printInfo)(" agentkit skills add <name\u2026> [options] install one or more named skills"),(0,logger_1.printInfo)(" agentkit skills remove <name\u2026> [options] remove skills added with `add`"),(0,logger_1.printInfo)(" agentkit skills help show full help message"),(0,logger_1.printInfo)(""),(0,logger_1.printInfo)("Options:"),(0,logger_1.printInfo)(" --project, -p target the current project directory"),(0,logger_1.printInfo)(" --global, -g target a global kit install"),(0,logger_1.printInfo)(" --kit, -k <name> target a specific kit by name")}function printList(s,e){(0,logger_1.printSection)(`Skill catalog (${s.length})`);const i=new Map;for(const n of s)(i.get(n.category)??i.set(n.category,[]).get(n.category)).push(n);for(const n of Object.keys(generate_catalogs_1.CATEGORY_TITLES)){const t=i.get(n);if(!(!t||t.length===0)){console.log(""),console.log(` ${generate_catalogs_1.CATEGORY_TITLES[n]} (${t.length})`);for(const r of t){const c=e.has(r.name)?" \u2713":" ",d=r.description?` \u2014 ${r.description}`:"";console.log(` ${c} ${r.name}${d}`)}}}console.log("")}function installSkills(s,e,i){const n=new Set(s),t=[...(0,skill_profiles_1.withDependencies)(s)].sort(),r=t.filter(o=>!fs.existsSync(path.join(i,payload_roots_1.SKILL_SOURCE_DIR,o)));if(r.length>0)return(0,logger_1.printError)(`Cannot install: ${r.join(", ")} missing from the shipped skills/.`),1;fs.mkdirSync(e.destSkillsDir,{recursive:!0});for(const o of t){const f=path.join(i,payload_roots_1.SKILL_SOURCE_DIR,o);(0,file_operations_1.copyDir)(f,path.join(e.destSkillsDir,o),{suppressSymlinkWarnings:!0})}const c=fs.existsSync(e.configPath);let d=(0,skill_profiles_1.defaultProfileForKit)(e.kit),u={gamedevInstalled:!1,gamedevRemoved:!1,seoInstalled:!1,seoRemoved:!1};if(c){const o=(0,install_profile_config_1.readInstallSettings)(e.configPath);d=o.profile??(0,skill_profiles_1.defaultProfileForKit)(e.kit);const f=[...new Set([...o.extraSkills,...t])].sort();(0,install_profile_config_1.writeInstallSettings)(e.configPath,{profile:o.profile??void 0,extraSkills:f}),u=(0,skill_companion_assets_1.syncSkillCompanionAssets)(e,i,d,f,{addedSkills:t});const a=(0,install_profile_config_1.readCliVersion)(i);a&&(0,install_profile_config_1.stampInstallVersion)(e.configPath,a),(0,install_manifest_1.writeManifest)(e,a)}for(const o of s)(0,logger_1.printSuccess)(`Installed ${o} into ${kits_1.kitDefinitions[e.kit].name} (${e.scope}).`);for(const o of t.filter(f=>!n.has(f))){const f=s.filter(a=>(0,skill_profiles_1.withDependencies)([a]).has(o));(0,logger_1.printInfo)(`Also installed ${o} \u2014 required by ${f.join(", ")}.`)}return u.gamedevInstalled&&(0,logger_1.printInfo)("Also installed 38 gamedev specialist agents and 12 game-studio rules."),u.seoInstalled&&(0,logger_1.printInfo)("Also installed 18 seo specialist agents and updated routing rules."),c?(0,logger_1.printInfo)(`Recorded in install.extraSkills so re-install keeps them on the ${d} profile.`):(0,logger_1.printInfo)(`Installed standalone into ${e.destSkillsDir}.`),0}async function removeSkills(s,e,i,n){const t=fs.existsSync(e.configPath),r=t?(0,install_profile_config_1.readInstallSettings)(e.configPath):{profile:null,extraSkills:[]},c=r.profile??(0,skill_profiles_1.defaultProfileForKit)(e.kit),{extras:d,profileOwned:u}=t?(0,skills_remove_1.planRemoval)(s,r.extraSkills):{extras:s,profileOwned:[]};for(const l of u)(0,logger_1.printError)(`${l} comes from the ${c} profile, not \`agentkit skills add\`.`),(0,logger_1.printInfo)("Removing it would not stick \u2014 the next `agentkit init` copies it back."),(0,logger_1.printInfo)("Install a narrower profile instead: agentkit init --profile <name>");if(d.length===0)return u.length>0?1:0;if(n.isTTY){const l=await n.confirm({message:`Delete ${d.map(g=>path.join(e.destSkillsDir,g)).join(", ")}?`,initialValue:!1});if(p.isCancel(l)||!l)return(0,logger_1.printInfo)("Nothing removed."),0}const o=(0,skills_remove_1.removeSkillDirs)(d,e.destSkillsDir);for(const l of o.rejected)(0,logger_1.printError)(`Refused to delete ${l}: it does not resolve inside ${e.destSkillsDir}.`);const f=[...o.removed,...o.missing];let a={gamedevInstalled:!1,gamedevRemoved:!1,seoInstalled:!1,seoRemoved:!1};if(t){const l=r.extraSkills.filter(k=>!f.includes(k));(0,install_profile_config_1.writeInstallSettings)(e.configPath,{profile:r.profile??void 0,extraSkills:l}),a=(0,skill_companion_assets_1.syncSkillCompanionAssets)(e,i,c,l,{removedSkills:f});const g=(0,install_profile_config_1.readCliVersion)(i);g&&(0,install_profile_config_1.stampInstallVersion)(e.configPath,g),(0,install_manifest_1.writeManifest)(e,g)}for(const l of o.removed)(0,logger_1.printSuccess)(`Removed ${l} from ${kits_1.kitDefinitions[e.kit].name} (${e.scope}).`);for(const l of o.missing)(0,logger_1.printInfo)(t?`${l} was already gone from disk; cleared its install.extraSkills entry.`:`${l} was not installed in ${e.destSkillsDir}.`);a.gamedevRemoved&&(0,logger_1.printInfo)("Also removed 38 gamedev specialist agents and 12 game-studio rules."),a.seoRemoved&&(0,logger_1.printInfo)("Also removed 18 seo specialist agents.");const m=installedSkillNames(e.destSkillsDir);for(const[l,g]of(0,skills_remove_1.danglingDependencies)(f,m,skill_profiles_1.SKILL_DEPENDENCIES)){const k=!t||r.extraSkills.includes(l)?`remove ${l} too`:`narrow the ${c} profile that carries it`;(0,logger_1.printWarning)(`${l} is still installed and requires ${g} \u2014 re-add it (\`agentkit skills add ${g}\`), or ${k}. The next \`agentkit init\` re-adds ${g} while ${l} stays installed.`)}return o.rejected.length>0||u.length>0?1:0}async function interactivePick(s,e,i){const n=installedSkillNames(e.destSkillsDir),t=await p.autocompleteMultiselect({message:"Select skills to install",placeholder:"Type to search by name, category, or description",required:!1,options:s.map(r=>({value:r.name,label:`${r.name}${n.has(r.name)?" \u2713":""}`,hint:`[${r.category}] ${r.description}`.slice(0,80)}))});return p.isCancel(t)||t.length===0?((0,logger_1.printInfo)("Nothing selected."),0):installSkills(t,e,i)}async function runSkills(s,e={}){const i=e.cwd??process.cwd(),n=e.repoRoot??path.resolve(__dirname,"..","..",".."),t={confirm:e.confirm??p.confirm,isTTY:e.isTTY??process.stdout.isTTY},r=(0,skills_context_options_1.parseSkillsArgs)(s);if(!r.ok)return usage(),1;const[c,...d]=r.positionals,{flags:u}=r,o=(0,generate_catalogs_1.collectSkills)(n),f=o.map(a=>a.name);if(c==="list"){const a=(0,skills_context_options_1.soleSkillsContext)(i,u);return printList(o,a?installedSkillNames(a.destSkillsDir):new Set),0}if(c==="add"||c==="remove"){if(d.length===0)return usage(),1;const a=d.filter(l=>!f.includes(l));if(a.length>0){(0,logger_1.printError)(`Unknown skill(s): ${a.join(", ")}`);for(const l of a){const g=closeMatches(l,f);g.length>0&&(0,logger_1.printInfo)(`Did you mean (for ${l}): ${g.join(", ")}?`)}return(0,logger_1.printInfo)("Run `agentkit skills list` to see the catalog."),1}const m=await(0,skills_context_options_1.resolveSkillsContext)(i,u,!!t.isTTY);return m?c==="remove"?removeSkills(d,m,n,t):installSkills(d,m,n):1}if(!c){if(!t.isTTY){const m=(0,skills_context_options_1.soleSkillsContext)(i,u);return printList(o,m?installedSkillNames(m.destSkillsDir):new Set),usage(),0}const a=await(0,skills_context_options_1.resolveSkillsContext)(i,u,!!t.isTTY);return a?interactivePick(o,a,n):1}return(0,logger_1.printError)(`Unknown subcommand: ${c}`),usage(),1}
@@ -0,0 +1,6 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,n,s){s===void 0&&(s=n);var r=Object.getOwnPropertyDescriptor(e,n);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,s,r)}):(function(t,e,n,s){s===void 0&&(s=n),t[s]=e[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var s=[];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(s[s.length]=r);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var s=t(e),r=0;r<s.length;r++)s[r]!=="default"&&__createBinding(n,e,s[r]);return __setModuleDefault(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.agentsDirFor=agentsDirFor,exports.installAgentsForKit=installAgentsForKit,exports.syncSkillCompanionAssets=syncSkillCompanionAssets;const fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),checks_rules_1=require("../doctor/checks-rules"),kit_layout_1=require("../doctor/kit-layout"),install_profile_config_1=require("../install-profile-config"),antigravity_1=require("../kit-installers/antigravity"),claude_agents_1=require("../kit-installers/claude-agents"),codex_subagents_1=require("../kit-installers/codex-subagents"),cursor_agents_1=require("../kit-installers/cursor-agents"),gamedev_profile_assets_1=require("../kit-installers/gamedev-profile-assets"),gamedev_mcp_1=require("../kit-installers/gamedev-mcp"),grok_agents_1=require("../kit-installers/grok-agents"),kimi_agents_1=require("../kit-installers/kimi-agents"),omp_agents_1=require("../kit-installers/omp-agents"),omp_managed_1=require("../kit-installers/omp-managed"),opencode_agents_1=require("../kit-installers/opencode-agents"),profile_context_1=require("../kit-installers/profile-context"),routing_rule_prune_1=require("../kit-installers/routing-rule-prune"),omp_home_1=require("../omp-home"),payload_roots_1=require("../payload-roots"),skill_profiles_1=require("../skill-profiles");function agentsDirFor(t){return t.kit==="hermes"||t.kit==="openclaw"||t.kit==="pi"?null:t.kit==="antigravity"?path.join(t.kitRoot,antigravity_1.ANTIGRAVITY_PLUGIN_REL,"agents"):t.kit==="omp"?path.join(path.dirname(t.kitRoot),omp_home_1.OMP_AGENTS_DIR):path.join(t.kitRoot,"agents")}function writeOmpAgentsIncremental(t,e){if(fs.existsSync(t)){fs.mkdirSync(e,{recursive:!0});for(const n of fs.readdirSync(t).filter(s=>s.endsWith(".md")).sort()){const s=fs.readFileSync(path.join(t,n),"utf8"),{body:r}=(0,omp_agents_1.parseAgentFile)(s),a=n.slice(0,-3),i=(0,omp_agents_1.buildAgentFrontmatter)(a,s),o=[`name: ${i.name}`];i.description&&o.push(`description: ${JSON.stringify(i.description)}`),i.tools&&o.push(`tools: ${i.tools}`),i.model&&o.push(`model: ${i.model}`),o.push(omp_managed_1.MANAGED_MARKER_LINE),(0,omp_managed_1.writeManagedFile)(e,n,`---
2
+ ${o.join(`
3
+ `)}
4
+ ---
5
+
6
+ ${r}`)}}}function installAgentsForKit(t,e,n){if(fs.existsSync(e))switch(fs.mkdirSync(n,{recursive:!0}),t.kit){case"claude":{(0,gamedev_profile_assets_1.copyMarkdownAgents)(e,n);const s=(0,install_profile_config_1.readInstallSettings)(t.configPath).agentModels??claude_agents_1.DEFAULT_CLAUDE_AGENT_MODELS;(0,claude_agents_1.applyClaudeAgentModels)(n,s);break}case"augment":case"antigravity":(0,gamedev_profile_assets_1.copyMarkdownAgents)(e,n);break;case"cursor":(0,cursor_agents_1.convertAgentsToCursor)(e,n);break;case"opencode":(0,opencode_agents_1.convertAgentsToOpenCode)(e,n);break;case"codex":(0,codex_subagents_1.convertAgentsToCodexToml)(e,n);break;case"kimi":(0,kimi_agents_1.convertAgentsToKimi)(e,n);break;case"grok":(0,grok_agents_1.convertAgentsToGrok)(e,n);break;case"devin":(0,gamedev_profile_assets_1.writeDevinGamedevAgents)(e,n);break;case"omp":writeOmpAgentsIncremental(e,n);break}}function installSeoAgentsForKit(t,e,n){const s=path.join(e,payload_roots_1.AGENTS_SOURCE_DIR);if(!fs.existsSync(s))return!1;const r=fs.readdirSync(s).filter(i=>/^seo-[a-z0-9-]+\.md$/.test(i)).sort();if(r.length===0)return!1;const a=fs.mkdtempSync(path.join(os.tmpdir(),"agentkit-seo-agents-"));try{for(const i of r)fs.copyFileSync(path.join(s,i),path.join(a,i));return installAgentsForKit(t,a,n),!0}finally{fs.rmSync(a,{recursive:!0,force:!0})}}function syncRoutingRules(t,e,n,s){if(kit_layout_1.KIT_LAYOUTS[t.kit].hasAgentkitSkills===!1)return;const r=(0,checks_rules_1.rulesDirFor)(t);if(!fs.existsSync(r))return;const a=path.join(e,payload_roots_1.RULES_SOURCE_DIR);for(const i of routing_rule_prune_1.PRUNED_RULES){const o=i.replace(/\.md$/,""),d=fs.existsSync(path.join(r,`${o}.md`))||fs.existsSync(path.join(r,`${o}.mdc`)),c=path.join(a,i);d&&fs.existsSync(c)&&(0,gamedev_profile_assets_1.writeRuleInHostFormat)(r,o,fs.readFileSync(c,"utf8"))}(0,routing_rule_prune_1.pruneRoutingRulesForInstall)(e,r,(0,skill_profiles_1.resolveSkipDirs)(e,n,[...s]))}function syncSkillCompanionAssets(t,e,n,s,r={}){const a=new Set(r.addedSkills??[]),i=new Set(r.removedSkills??[]),o=(0,profile_context_1.buildProfileInstallContext)(e,n,s),d=(0,gamedev_profile_assets_1.carriesGamedevCompanion)(o),c=(0,gamedev_profile_assets_1.carriesSeoCompanion)(o),u=(0,checks_rules_1.rulesDirFor)(t),l=agentsDirFor(t);let m=!1,_=!1,g=!1,p=!1;if(a.has("gamedev")||d)fs.existsSync(u)&&(0,gamedev_profile_assets_1.syncGamedevRules)(u,o,e),l&&installAgentsForKit(t,path.join(e,gamedev_profile_assets_1.GAMEDEV_AGENTS_SUBDIR),l),(0,gamedev_mcp_1.syncGamedevMcpForKit)(t,!0),m=a.has("gamedev");else if(i.has("gamedev")){const f=fs.existsSync(u)?(0,gamedev_profile_assets_1.removeGamedevRulesFromDir)(u):0,v=l?(0,gamedev_profile_assets_1.removeGamedevAgentsFromDir)(e,l):0,k=(0,gamedev_mcp_1.syncGamedevMcpForKit)(t,!1);_=f>0||v>0||k}if(a.has("seo")||c){const f=l?installSeoAgentsForKit(t,e,l):!1;g=a.has("seo")&&f}else i.has("seo")&&!c&&(p=(l?(0,gamedev_profile_assets_1.removeSeoAgentsFromDir)(l):0)>0);return syncRoutingRules(t,e,n,s),{gamedevInstalled:m,gamedevRemoved:_,seoInstalled:g,seoRemoved:p}}
@@ -0,0 +1 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var o=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[o.length]=i);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=e(t),i=0;i<o.length;i++)o[i]!=="default"&&__createBinding(n,t,o[i]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseSkillsArgs=parseSkillsArgs,exports.soleSkillsContext=soleSkillsContext,exports.resolveSkillsContext=resolveSkillsContext;const fs=__importStar(require("fs")),path=__importStar(require("path")),p=__importStar(require("@clack/prompts")),home_dir_1=require("../home-dir"),init_install_scope_1=require("../init-install-scope"),kit_context_1=require("../kit-context"),kits_1=require("../kits"),logger_1=require("../logger"),PROJECT_CAPABLE_KITS=kit_context_1.GLOBAL_KITS.filter(e=>(0,kits_1.supportsProjectInstall)(e));function hasProjectKitDir(e,t){const n=e==="pi"?".pi":kits_1.kitDefinitions[e].dir;return fs.existsSync(path.join(t,n))}function parseSkillsArgs(e){const t=[];let n=!1,o=!1,i;for(let s=0;s<e.length;s++){const r=e[s];if(r==="--project"||r==="-p"){n=!0;continue}if(r==="--global"||r==="-g"){o=!0;continue}if(r==="--kit"||r==="-k"||r.startsWith("--kit=")||r.startsWith("-k=")){const u=r.includes("="),a=u?r.slice(r.indexOf("=")+1):e[s+1];if(u||(s+=1),!a||!u&&a.startsWith("-"))return(0,logger_1.printError)("--kit needs a kit name, e.g. `--kit claude`."),{ok:!1};const c=(0,kits_1.normalizeKitName)(a);if(!c)return(0,logger_1.printError)(`Unknown kit: "${a}". Supported kits: ${kits_1.ALL_KIT_NAMES.join(", ")}.`),{ok:!1};i=c;continue}if(r.startsWith("-"))return(0,logger_1.printError)(`Unknown option: ${r}`),{ok:!1};t.push(r)}if(n&&o)return(0,logger_1.printError)("Cannot combine --project and --global."),{ok:!1};const l=n?"project":o?"global":void 0;return l==="project"&&i&&!(0,kits_1.supportsProjectInstall)(i)?((0,logger_1.printError)(`${kits_1.kitDefinitions[i].name} is a global-only kit and does not support --project.`),{ok:!1}):l==="global"&&i&&!(0,kits_1.supportsGlobalInstall)(i)?((0,logger_1.printError)(`${kits_1.kitDefinitions[i].name} does not support --global.`),{ok:!1}):{ok:!0,positionals:t,flags:{scope:l,kit:i}}}function projectCandidatesForCwd(e){const t=PROJECT_CAPABLE_KITS.filter(i=>(0,init_install_scope_1.isKitInstalledInProject)(i,e));if(t.length>0)return t.map(i=>(0,kit_context_1.projectContext)(i,e));const n=PROJECT_CAPABLE_KITS.filter(i=>hasProjectKitDir(i,e));return n.length>0?n.map(i=>(0,kit_context_1.projectContext)(i,e)):PROJECT_CAPABLE_KITS.filter(i=>(0,init_install_scope_1.isKitInstalledGlobally)(i)).map(i=>(0,kit_context_1.projectContext)(i,e))}function soleSkillsContext(e,t){if(!t.scope&&!t.kit)return(0,kit_context_1.soleContext)(e);if(t.scope==="project"){if((0,home_dir_1.isHomeDir)(e))return null;if(t.kit)return(0,kit_context_1.projectContext)(t.kit,e);const o=projectCandidatesForCwd(e);return o.length===1?o[0]:null}if(t.scope==="global"){if(t.kit)return(0,init_install_scope_1.isKitInstalledGlobally)(t.kit)?(0,kit_context_1.globalContext)(t.kit):null;const o=kit_context_1.GLOBAL_KITS.filter(i=>(0,init_install_scope_1.isKitInstalledGlobally)(i)).map(kit_context_1.globalContext);return o.length===1?o[0]:null}const n=t.kit;return!(0,home_dir_1.isHomeDir)(e)&&(0,kits_1.supportsProjectInstall)(n)&&(0,init_install_scope_1.isKitInstalledInProject)(n,e)?(0,kit_context_1.projectContext)(n,e):(0,kits_1.supportsGlobalInstall)(n)&&(0,init_install_scope_1.isKitInstalledGlobally)(n)?(0,kit_context_1.globalContext)(n):!(0,home_dir_1.isHomeDir)(e)&&(0,kits_1.supportsProjectInstall)(n)&&hasProjectKitDir(n,e)?(0,kit_context_1.projectContext)(n,e):null}async function resolveSkillsContext(e,t,n){if(!t.scope&&!t.kit)return(0,kit_context_1.resolveContext)(e);if(t.scope==="project"){if((0,home_dir_1.isHomeDir)(e))return(0,logger_1.printError)("Cannot use --project in the home directory. Run inside a project or use --global."),null;if(t.kit)return(0,kit_context_1.projectContext)(t.kit,e);const l=projectCandidatesForCwd(e);if(l.length===1)return l[0];if(l.length===0)return(0,logger_1.printError)("Could not determine which kit to target in this project."),(0,logger_1.printInfo)("Pass --kit <name>, e.g. `agentkit skills add <skill> --project --kit claude`."),null;if(!n)return(0,logger_1.printError)(`Multiple kits available for --project: ${l.map(r=>r.kit).join(", ")}.`),(0,logger_1.printInfo)("Pass --kit <name>, e.g. `agentkit skills add <skill> --project --kit claude`."),null;const s=await p.select({message:"Which kit to target in this project?",options:l.map(r=>({value:r.kit,label:`${kits_1.kitDefinitions[r.kit].name} (project)`}))});return p.isCancel(s)?null:l.find(r=>r.kit===s)??null}if(t.scope==="global"){if(t.kit)return(0,init_install_scope_1.isKitInstalledGlobally)(t.kit)?(0,kit_context_1.globalContext)(t.kit):((0,logger_1.printError)(`No global install of ${kits_1.kitDefinitions[t.kit].name} found. Run \`agentkit init ${t.kit} --global\` first.`),null);const l=kit_context_1.GLOBAL_KITS.filter(r=>(0,init_install_scope_1.isKitInstalledGlobally)(r)).map(kit_context_1.globalContext);if(l.length===0)return(0,logger_1.printError)("No global AgentKit install detected. Run `agentkit init --global` first."),null;if(l.length===1)return l[0];if(!n)return(0,logger_1.printError)(`Multiple global kits installed: ${l.map(r=>r.kit).join(", ")}.`),(0,logger_1.printInfo)("Pass --kit <name>, e.g. `agentkit skills add <skill> --global --kit claude`."),null;const s=await p.select({message:"Which global kit to target?",options:l.map(r=>({value:r.kit,label:`${kits_1.kitDefinitions[r.kit].name} (global)`}))});return p.isCancel(s)?null:l.find(r=>r.kit===s)??null}const o=t.kit,i=soleSkillsContext(e,t);return i||((0,logger_1.printError)(`No install of ${kits_1.kitDefinitions[o].name} found. Run \`agentkit init ${o}\` or add --project to install skills into this repository.`),null)}
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,o,n){n===void 0&&(n=o);var i=Object.getOwnPropertyDescriptor(e,o);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,i)}):(function(t,e,o,n){n===void 0&&(n=o),t[n]=e[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(o){var n=[];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&__createBinding(o,e,n[i]);return __setModuleDefault(o,e),o}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.supportsGlobalInstall=void 0,exports.selectProfile=selectProfile,exports.isProjectBasedDetection=isProjectBasedDetection,exports.showMenu=showMenu,exports.kitGroup=kitGroup,exports.selectKit=selectKit,exports.selectKitsGlobal=selectKitsGlobal,exports.selectHermesProfile=selectHermesProfile,exports.selectTargetsToRemove=selectTargetsToRemove,exports.confirmUndetectedHost=confirmUndetectedHost,exports.selectClaudeAgentModels=selectClaudeAgentModels,exports.askPathWithDefault=askPathWithDefault;const p=__importStar(require("@clack/prompts")),fs=__importStar(require("fs")),path=__importStar(require("path")),chalk_1=__importDefault(require("chalk")),home_dir_1=require("./home-dir"),logger_1=require("./logger"),kits_1=require("./kits"),init_install_scope_1=require("./init-install-scope"),hermes_home_1=require("./hermes-home"),skill_profiles_1=require("./skill-profiles"),claude_agents_1=require("./kit-installers/claude-agents"),PROFILE_HINTS={core:"engineering default \u2014 skips vendor suites (twilio, expo, gsap, \u2026)",full:"all skills",frontend:"core + frontend, design, frameworks",backend:"core + backend, database, infra, security",mobile:"core + frontend, frameworks, design",fullstack:"core + frontend, backend, data, infra",marketing:"core + marketing, design, seo, docs, media, AI + 7 named extras",assistant:"15 host-portable skills (no subagents, no CLI)"};async function selectProfile(t=skill_profiles_1.DEFAULT_PROFILE){const e=await p.select({message:"Select install profile",initialValue:t,options:Object.keys(PROFILE_HINTS).map(o=>({value:o,label:o,hint:PROFILE_HINTS[o]}))});return p.isCancel(e)?null:e}function isProjectBasedDetection(t,e){if((0,home_dir_1.isHomeDir)(t))return!1;const o=path.join(t,kits_1.kitDefinitions[e].dir);return fs.existsSync(o)&&(fs.statSync(o).isDirectory()||fs.statSync(o).isFile())}function showMenu(t){const e=(0,kits_1.detectCurrentKit)(t),o=e?e.kit:null;if((0,logger_1.printSection)("Select AI Development Kit"),o){console.log("");const i=e&&isProjectBasedDetection(t,o)?"project":"global CLI";(0,logger_1.printInfo)(chalk_1.default.bold("Detected:")+" "+chalk_1.default.yellow.bold(kits_1.kitDefinitions[o].name)+" "+chalk_1.default.dim(`(${i})`)),(0,logger_1.printInfo)(chalk_1.default.dim("Select the same kit to update, or choose a different one to switch.")),console.log("")}else{const n=(0,kits_1.detectAllGlobalCLIs)();if(n.length>1){console.log("");const i=n.map(l=>kits_1.kitDefinitions[l].name).join(", ");(0,logger_1.printInfo)(chalk_1.default.bold("Multiple hosts detected:")+" "+chalk_1.default.cyan(i)),(0,logger_1.printInfo)(chalk_1.default.dim("No primary host selected. Choose which one to configure.")),console.log("")}else n.length===1?(console.log(""),(0,logger_1.printInfo)(chalk_1.default.bold("Detected:")+" "+chalk_1.default.yellow.bold(kits_1.kitDefinitions[n[0]].name)+" "+chalk_1.default.dim("(installed on this machine)")),(0,logger_1.printInfo)(chalk_1.default.dim("Select the same kit to update, or choose a different one to switch.")),console.log("")):(console.log(""),(0,logger_1.printWarning)(chalk_1.default.bold("Note:")+" Each kit is designed for its specific platform. Choose carefully!"),console.log(""))}}const GROUP_LABELS={coding:"Coding agents",personal:"Personal agents"},GROUP_ORDER=["coding","personal"],MENU_KITS=[{kit:"claude",label:"\u{1F535} Claude Code",hint:"Shared for Augment + Anthropic CLI + IDE",group:"coding"},{kit:"opencode",label:"\u26AB OpenCode",hint:"Open-source AI coding assistant",group:"coding"},{kit:"cursor",label:"\u{1F7E3} Cursor AI",hint:"AI-first code editor (Desktop + CLI)",group:"coding"},{kit:"antigravity",label:"\u{1F7E2} Antigravity",hint:"Google's agentic AI IDE (Gemini)",group:"coding"},{kit:"codex",label:"\u26AA OpenAI Codex",hint:"OpenAI coding agent for CLI and IDE",group:"coding"},{kit:"kimi",label:"\u{1F319} Kimi Code",hint:"Moonshot's CLI coding agent (kimi)",group:"coding"},{kit:"grok",label:"\u{1F6F0}\uFE0F Grok Build",hint:"xAI's CLI coding agent (grok)",group:"coding"},{kit:"omp",label:"\u{1F967} Oh My Pi",hint:"Terminal coding agent with LSP + DAP (omp)",group:"coding"},{kit:"pi",label:"\u03C0 Pi",hint:"Minimal terminal coding harness; omp forks this (pi)",group:"coding"},{kit:"devin",label:"\u{1F9E0} Devin CLI",hint:"Cognition's local coding agent (devin)",group:"coding"},{kit:"hermes",label:"\u{1F54A}\uFE0F Hermes Agent",hint:"Nous Research's personal agent (hermes)",group:"personal"},{kit:"openclaw",label:"\u{1F99E} OpenClaw",hint:"Personal agent across your chat channels (openclaw)",group:"personal"}];function kitsInGroup(t){return MENU_KITS.filter(e=>e.group===t)}function kitGroup(t){return MENU_KITS.find(e=>e.kit===t)?.group??"coding"}function projectKitsInGroup(t){return kitsInGroup(t).filter(({kit:e})=>(0,kits_1.supportsProjectInstall)(e))}async function selectKit(t){const e=(0,home_dir_1.isHomeDir)(t),o=s=>e?(0,init_install_scope_1.isKitInstalledGlobally)(s):(0,init_install_scope_1.isKitInstalledInProject)(s,t),n=e?kitsInGroup:projectKitsInGroup,i=GROUP_ORDER.flatMap(n),l=GROUP_ORDER.filter(s=>n(s).length>0),a=i.find(({kit:s})=>o(s))?.kit??i.find(({kit:s})=>(0,kits_1.isHostInstalled)(s))?.kit??i[0].kit,r=await p.select({message:"Select a kit to install",initialValue:a,options:l.flatMap(s=>n(s).map(({kit:c,label:u,hint:d})=>{const f=o(c)?chalk_1.default.green.bold(" [UPDATE]"):"",g=(0,kits_1.isHostInstalled)(c)?chalk_1.default.green(" \u2713"):chalk_1.default.dim(" (not detected)"),h=l.length>1?`${GROUP_LABELS[s]} \u2014 `:"";return{value:c,label:u+g+f,hint:h+d}}))});return p.isCancel(r)?null:r}async function selectKitsGlobal(){const t=MENU_KITS.filter(({kit:n})=>(0,init_install_scope_1.isKitInstalledGlobally)(n)).map(({kit:n})=>n),e=({kit:n,label:i,hint:l})=>{const a=(0,init_install_scope_1.isKitInstalledGlobally)(n)?chalk_1.default.green.bold(" [UPDATE]"):"",r=(0,kits_1.isHostInstalled)(n)?chalk_1.default.green(" \u2713"):chalk_1.default.dim(" (not detected)");return{value:n,label:i+r+a,hint:l}},o=await p.groupMultiselect({message:"Select kits to install (space to toggle, enter to confirm)",initialValues:t,required:!1,selectableGroups:!1,options:Object.fromEntries(GROUP_ORDER.map(n=>[GROUP_LABELS[n],kitsInGroup(n).map(e)]))});return p.isCancel(o)?null:o}async function selectHermesProfile(){const t=(0,hermes_home_1.listHermesProfiles)(),e=new Set((0,hermes_home_1.listAgentkitHermesProfiles)()),o=t.find(i=>e.has(i))??hermes_home_1.HERMES_DEFAULT_PROFILE,n=await p.select({message:"Which Hermes profile should the kit install into?",initialValue:o,options:t.map(i=>({value:i,label:i+(e.has(i)?chalk_1.default.green.bold(" [UPDATE]"):""),hint:i===hermes_home_1.HERMES_DEFAULT_PROFILE?"Hermes\u2019s own profile \u2014 what `hermes` loads with no -p":`loaded by \`hermes -p ${i}\``}))});return p.isCancel(n)?null:n}async function selectTargetsToRemove(t){const e=GROUP_ORDER.map(n=>[GROUP_LABELS[n],t.filter(i=>i.group===n).map(({value:i,label:l})=>({value:i,label:`${l}${chalk_1.default.green.bold(" [INSTALLED]")}`}))]).filter(([,n])=>n.length>0),o=await p.groupMultiselect({message:"Select what to remove (space to toggle, enter to confirm)",initialValues:[],required:!1,selectableGroups:!1,options:Object.fromEntries(e)});return p.isCancel(o)?null:o}async function confirmUndetectedHost(t){const e=await p.confirm({message:`${t} was not detected on this machine. Install its kit anyway?`,initialValue:!1});return p.isCancel(e)?!1:e}async function selectClaudeAgentModels(){const t=await p.select({message:"Claude Code agent models",initialValue:claude_agents_1.DEFAULT_CLAUDE_AGENT_MODELS,options:[{value:"pinned",label:"Keep kit defaults",hint:"opus for planner/reviewer/simplifier, sonnet for most, haiku for journal"},{value:"inherit",label:"Inherit session model",hint:"no opus/sonnet/haiku pin \u2014 subagents follow whatever this session uses"}]});return p.isCancel(t)?null:t}var kits_2=require("./kits");Object.defineProperty(exports,"supportsGlobalInstall",{enumerable:!0,get:function(){return kits_2.supportsGlobalInstall}});async function askPathWithDefault(t,e){const o=await p.text({message:t,placeholder:e,defaultValue:e});return p.isCancel(o)||!o?e:o}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,o,n){n===void 0&&(n=o);var i=Object.getOwnPropertyDescriptor(e,o);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,n,i)}):(function(t,e,o,n){n===void 0&&(n=o),t[n]=e[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(o){var n=[];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&__createBinding(o,e,n[i]);return __setModuleDefault(o,e),o}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.supportsGlobalInstall=void 0,exports.selectProfile=selectProfile,exports.isProjectBasedDetection=isProjectBasedDetection,exports.showMenu=showMenu,exports.kitGroup=kitGroup,exports.selectKit=selectKit,exports.selectKitsGlobal=selectKitsGlobal,exports.selectHermesProfile=selectHermesProfile,exports.selectTargetsToRemove=selectTargetsToRemove,exports.confirmUndetectedHost=confirmUndetectedHost,exports.selectClaudeAgentModels=selectClaudeAgentModels,exports.askPathWithDefault=askPathWithDefault;const p=__importStar(require("@clack/prompts")),fs=__importStar(require("fs")),path=__importStar(require("path")),chalk_1=__importDefault(require("chalk")),home_dir_1=require("./home-dir"),logger_1=require("./logger"),kits_1=require("./kits"),init_install_scope_1=require("./init-install-scope"),hermes_home_1=require("./hermes-home"),skill_profiles_1=require("./skill-profiles"),claude_agents_1=require("./kit-installers/claude-agents"),PROFILE_HINTS={core:"engineering default \u2014 skips vendor suites (twilio, expo, gsap, \u2026)",full:"all skills",frontend:"core + frontend, design, frameworks",backend:"core + backend, database, infra, security",mobile:"core + frontend, frameworks, design",fullstack:"core + frontend, backend, data, infra",gamedev:"core + gamedev, multimedia + 7 named extras",marketing:"core + marketing, design, seo, docs, media, AI + 7 named extras",assistant:"15 host-portable skills (no subagents, no CLI)"};async function selectProfile(t=skill_profiles_1.DEFAULT_PROFILE){const e=await p.select({message:"Select install profile",initialValue:t,options:Object.keys(PROFILE_HINTS).map(o=>({value:o,label:o,hint:PROFILE_HINTS[o]}))});return p.isCancel(e)?null:e}function isProjectBasedDetection(t,e){if((0,home_dir_1.isHomeDir)(t))return!1;const o=path.join(t,kits_1.kitDefinitions[e].dir);return fs.existsSync(o)&&(fs.statSync(o).isDirectory()||fs.statSync(o).isFile())}function showMenu(t){const e=(0,kits_1.detectCurrentKit)(t),o=e?e.kit:null;if((0,logger_1.printSection)("Select AI Development Kit"),o){console.log("");const i=e&&isProjectBasedDetection(t,o)?"project":"global CLI";(0,logger_1.printInfo)(chalk_1.default.bold("Detected:")+" "+chalk_1.default.yellow.bold(kits_1.kitDefinitions[o].name)+" "+chalk_1.default.dim(`(${i})`)),(0,logger_1.printInfo)(chalk_1.default.dim("Select the same kit to update, or choose a different one to switch.")),console.log("")}else{const n=(0,kits_1.detectAllGlobalCLIs)();if(n.length>1){console.log("");const i=n.map(l=>kits_1.kitDefinitions[l].name).join(", ");(0,logger_1.printInfo)(chalk_1.default.bold("Multiple hosts detected:")+" "+chalk_1.default.cyan(i)),(0,logger_1.printInfo)(chalk_1.default.dim("No primary host selected. Choose which one to configure.")),console.log("")}else n.length===1?(console.log(""),(0,logger_1.printInfo)(chalk_1.default.bold("Detected:")+" "+chalk_1.default.yellow.bold(kits_1.kitDefinitions[n[0]].name)+" "+chalk_1.default.dim("(installed on this machine)")),(0,logger_1.printInfo)(chalk_1.default.dim("Select the same kit to update, or choose a different one to switch.")),console.log("")):(console.log(""),(0,logger_1.printWarning)(chalk_1.default.bold("Note:")+" Each kit is designed for its specific platform. Choose carefully!"),console.log(""))}}const GROUP_LABELS={coding:"Coding agents",personal:"Personal agents"},GROUP_ORDER=["coding","personal"],MENU_KITS=[{kit:"claude",label:"\u{1F535} Claude Code",hint:"Shared for Augment + Anthropic CLI + IDE",group:"coding"},{kit:"opencode",label:"\u26AB OpenCode",hint:"Open-source AI coding assistant",group:"coding"},{kit:"cursor",label:"\u{1F7E3} Cursor AI",hint:"AI-first code editor (Desktop + CLI)",group:"coding"},{kit:"antigravity",label:"\u{1F7E2} Antigravity",hint:"Google's agentic AI IDE (Gemini)",group:"coding"},{kit:"codex",label:"\u26AA OpenAI Codex",hint:"OpenAI coding agent for CLI and IDE",group:"coding"},{kit:"kimi",label:"\u{1F319} Kimi Code",hint:"Moonshot's CLI coding agent (kimi)",group:"coding"},{kit:"grok",label:"\u{1F6F0}\uFE0F Grok Build",hint:"xAI's CLI coding agent (grok)",group:"coding"},{kit:"omp",label:"\u{1F967} Oh My Pi",hint:"Terminal coding agent with LSP + DAP (omp)",group:"coding"},{kit:"pi",label:"\u03C0 Pi",hint:"Minimal terminal coding harness; omp forks this (pi)",group:"coding"},{kit:"devin",label:"\u{1F9E0} Devin CLI",hint:"Cognition's local coding agent (devin)",group:"coding"},{kit:"hermes",label:"\u{1F54A}\uFE0F Hermes Agent",hint:"Nous Research's personal agent (hermes)",group:"personal"},{kit:"openclaw",label:"\u{1F99E} OpenClaw",hint:"Personal agent across your chat channels (openclaw)",group:"personal"}];function kitsInGroup(t){return MENU_KITS.filter(e=>e.group===t)}function kitGroup(t){return MENU_KITS.find(e=>e.kit===t)?.group??"coding"}function projectKitsInGroup(t){return kitsInGroup(t).filter(({kit:e})=>(0,kits_1.supportsProjectInstall)(e))}async function selectKit(t){const e=(0,home_dir_1.isHomeDir)(t),o=s=>e?(0,init_install_scope_1.isKitInstalledGlobally)(s):(0,init_install_scope_1.isKitInstalledInProject)(s,t),n=e?kitsInGroup:projectKitsInGroup,i=GROUP_ORDER.flatMap(n),l=GROUP_ORDER.filter(s=>n(s).length>0),a=i.find(({kit:s})=>o(s))?.kit??i.find(({kit:s})=>(0,kits_1.isHostInstalled)(s))?.kit??i[0].kit,r=await p.select({message:"Select a kit to install",initialValue:a,options:l.flatMap(s=>n(s).map(({kit:c,label:u,hint:d})=>{const f=o(c)?chalk_1.default.green.bold(" [UPDATE]"):"",g=(0,kits_1.isHostInstalled)(c)?chalk_1.default.green(" \u2713"):chalk_1.default.dim(" (not detected)"),h=l.length>1?`${GROUP_LABELS[s]} \u2014 `:"";return{value:c,label:u+g+f,hint:h+d}}))});return p.isCancel(r)?null:r}async function selectKitsGlobal(){const t=MENU_KITS.filter(({kit:n})=>(0,init_install_scope_1.isKitInstalledGlobally)(n)).map(({kit:n})=>n),e=({kit:n,label:i,hint:l})=>{const a=(0,init_install_scope_1.isKitInstalledGlobally)(n)?chalk_1.default.green.bold(" [UPDATE]"):"",r=(0,kits_1.isHostInstalled)(n)?chalk_1.default.green(" \u2713"):chalk_1.default.dim(" (not detected)");return{value:n,label:i+r+a,hint:l}},o=await p.groupMultiselect({message:"Select kits to install (space to toggle, enter to confirm)",initialValues:t,required:!1,selectableGroups:!1,options:Object.fromEntries(GROUP_ORDER.map(n=>[GROUP_LABELS[n],kitsInGroup(n).map(e)]))});return p.isCancel(o)?null:o}async function selectHermesProfile(){const t=(0,hermes_home_1.listHermesProfiles)(),e=new Set((0,hermes_home_1.listAgentkitHermesProfiles)()),o=t.find(i=>e.has(i))??hermes_home_1.HERMES_DEFAULT_PROFILE,n=await p.select({message:"Which Hermes profile should the kit install into?",initialValue:o,options:t.map(i=>({value:i,label:i+(e.has(i)?chalk_1.default.green.bold(" [UPDATE]"):""),hint:i===hermes_home_1.HERMES_DEFAULT_PROFILE?"Hermes\u2019s own profile \u2014 what `hermes` loads with no -p":`loaded by \`hermes -p ${i}\``}))});return p.isCancel(n)?null:n}async function selectTargetsToRemove(t){const e=GROUP_ORDER.map(n=>[GROUP_LABELS[n],t.filter(i=>i.group===n).map(({value:i,label:l})=>({value:i,label:`${l}${chalk_1.default.green.bold(" [INSTALLED]")}`}))]).filter(([,n])=>n.length>0),o=await p.groupMultiselect({message:"Select what to remove (space to toggle, enter to confirm)",initialValues:[],required:!1,selectableGroups:!1,options:Object.fromEntries(e)});return p.isCancel(o)?null:o}async function confirmUndetectedHost(t){const e=await p.confirm({message:`${t} was not detected on this machine. Install its kit anyway?`,initialValue:!1});return p.isCancel(e)?!1:e}async function selectClaudeAgentModels(){const t=await p.select({message:"Claude Code agent models",initialValue:claude_agents_1.DEFAULT_CLAUDE_AGENT_MODELS,options:[{value:"pinned",label:"Keep kit defaults",hint:"opus for planner/reviewer/simplifier, sonnet for most, haiku for journal"},{value:"inherit",label:"Inherit session model",hint:"no opus/sonnet/haiku pin \u2014 subagents follow whatever this session uses"}]});return p.isCancel(t)?null:t}var kits_2=require("./kits");Object.defineProperty(exports,"supportsGlobalInstall",{enumerable:!0,get:function(){return kits_2.supportsGlobalInstall}});async function askPathWithDefault(t,e){const o=await p.text({message:t,placeholder:e,defaultValue:e});return p.isCancel(o)||!o?e:o}