@linhnguyen96114/agentkit-engineer 1.4.2 → 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.
Files changed (87) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +2 -2
  3. package/bin/agentkit.js +1 -1
  4. package/package.json +2 -2
  5. package/scripts-dist/cli/agentkit-clear.js +18 -0
  6. package/scripts-dist/{agentkit-config.js → cli/agentkit-config.js} +3 -3
  7. package/scripts-dist/cli/agentkit-dashboard.js +19 -0
  8. package/scripts-dist/{agentkit-decide.js → cli/agentkit-decide.js} +1 -1
  9. package/scripts-dist/cli/agentkit-doctor.js +20 -0
  10. package/scripts-dist/cli/agentkit-hooks.js +36 -0
  11. package/scripts-dist/cli/agentkit-init.js +39 -0
  12. package/scripts-dist/{agentkit-login.js → cli/agentkit-login.js} +2 -2
  13. package/scripts-dist/cli/agentkit-logout.js +12 -0
  14. package/scripts-dist/cli/agentkit-profile.js +4 -0
  15. package/scripts-dist/cli/agentkit-skills.js +30 -0
  16. package/scripts-dist/cli/agentkit-status.js +22 -0
  17. package/scripts-dist/cli/agentkit-uninstall.js +18 -0
  18. package/scripts-dist/cli/agentkit-update.js +17 -0
  19. package/scripts-dist/{agentkit-whoami.js → cli/agentkit-whoami.js} +2 -2
  20. package/scripts-dist/gen/check-upstream.js +6 -0
  21. package/scripts-dist/gen/frontend-cli.js +4 -3
  22. package/scripts-dist/gen/generate-agentkit-configs.js +2 -0
  23. package/scripts-dist/gen/generate-catalogs.js +10 -0
  24. package/scripts-dist/{run-skill-tests.js → gen/run-skill-tests.js} +1 -1
  25. package/scripts-dist/gen/sync-gamedev-upstream.js +22 -0
  26. package/scripts-dist/gen/sync-upstream.js +1 -0
  27. package/scripts-dist/gen/update-check-worker.js +2 -0
  28. package/scripts-dist/gen/upstream-skill-syncers.js +5 -0
  29. package/scripts-dist/gen/upstream-suite-syncers.js +12 -0
  30. package/scripts-dist/{validate-agents-registry.js → gen/validate-agents-registry.js} +1 -1
  31. package/scripts-dist/lib/agentkit-config-file.js +2 -2
  32. package/scripts-dist/lib/auth/cli.js +1 -1
  33. package/scripts-dist/lib/clear/cli.js +4 -0
  34. package/scripts-dist/lib/cli.js +3 -0
  35. package/scripts-dist/lib/codegraph-installer/mcp-sync.js +1 -1
  36. package/scripts-dist/lib/doctor/checks-hooks.js +2 -2
  37. package/scripts-dist/lib/doctor/checks-rules.js +1 -1
  38. package/scripts-dist/lib/doctor/checks-skills.js +1 -1
  39. package/scripts-dist/lib/doctor/checks-soul.js +1 -1
  40. package/scripts-dist/lib/doctor/profile-resolution.js +1 -1
  41. package/scripts-dist/lib/dropped-mcp-servers.js +1 -1
  42. package/scripts-dist/lib/file-operations.js +2 -2
  43. package/scripts-dist/lib/frontmatter.js +2 -0
  44. package/scripts-dist/lib/gitignore.js +5 -5
  45. package/scripts-dist/lib/global-clear-targets.js +1 -1
  46. package/scripts-dist/lib/hook-toggle-registry.js +1 -1
  47. package/scripts-dist/lib/hooks/cli.js +1 -0
  48. package/scripts-dist/lib/init/cli.js +1 -0
  49. package/scripts-dist/lib/install-profile-config.js +1 -1
  50. package/scripts-dist/lib/kit-install-dispatch.js +1 -1
  51. package/scripts-dist/lib/kit-remover.js +1 -1
  52. package/scripts-dist/lib/kit-scan.js +1 -1
  53. package/scripts-dist/lib/kits.js +1 -1
  54. package/scripts-dist/lib/payload/extract.js +1 -1
  55. package/scripts-dist/lib/payload/retention.js +1 -1
  56. package/scripts-dist/lib/payload-roots.js +1 -0
  57. package/scripts-dist/lib/profile-block.js +2 -2
  58. package/scripts-dist/lib/profile-remove.js +1 -1
  59. package/scripts-dist/lib/profile-rules.js +1 -1
  60. package/scripts-dist/lib/profile-switch-confirm.js +1 -1
  61. package/scripts-dist/lib/publish/payload-manifest.js +1 -1
  62. package/scripts-dist/lib/publish/public-client-manifest.js +1 -1
  63. package/scripts-dist/lib/server/kit-actions.js +1 -1
  64. package/scripts-dist/lib/skill-profiles.js +1 -1
  65. package/scripts-dist/lib/skill-tests.js +1 -1
  66. package/scripts-dist/lib/skills/cli.js +1 -0
  67. package/scripts-dist/lib/skills/skill-companion-assets.js +6 -0
  68. package/scripts-dist/lib/skills/skills-context-options.js +1 -0
  69. package/scripts-dist/lib/ui.js +1 -1
  70. package/scripts-dist/lib/update/cli.js +4 -0
  71. package/scripts-dist/lib/update-notifier.js +1 -1
  72. package/scripts-dist/{build-hermes-distribution.js → ops/build-hermes-distribution.js} +1 -1
  73. package/scripts-dist/agentkit-clear.js +0 -21
  74. package/scripts-dist/agentkit-dashboard.js +0 -19
  75. package/scripts-dist/agentkit-doctor.js +0 -20
  76. package/scripts-dist/agentkit-hooks.js +0 -36
  77. package/scripts-dist/agentkit-init.js +0 -39
  78. package/scripts-dist/agentkit-logout.js +0 -12
  79. package/scripts-dist/agentkit-profile.js +0 -4
  80. package/scripts-dist/agentkit-skills.js +0 -25
  81. package/scripts-dist/agentkit-status.js +0 -22
  82. package/scripts-dist/agentkit-uninstall.js +0 -18
  83. package/scripts-dist/agentkit-update.js +0 -20
  84. package/scripts-dist/check-upstream.js +0 -6
  85. package/scripts-dist/generate-agentkit-configs.js +0 -2
  86. package/scripts-dist/generate-catalogs.js +0 -10
  87. package/scripts-dist/update-check-worker.js +0 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GATED_PATHS=exports.ALLOWED_IN_GATED=exports.PUBLIC_CLIENT_DIRS=exports.PUBLIC_CLIENT_FILES=void 0,exports.isGated=isGated,exports.isAllowed=isAllowed,exports.gatedPathsIn=gatedPathsIn,exports.PUBLIC_CLIENT_FILES=["bin/agentkit.js","CHANGELOG.md"],exports.PUBLIC_CLIENT_DIRS=["scripts-dist/"],exports.ALLOWED_IN_GATED=["scripts-dist/lib/kit-installers/shared-hooks-source.js"],exports.GATED_PATHS=["agent-kit/","skills/","rules/","agents/",".agents/","command/","docs/","guide/","plans/","scripts/","src/","dashboard/","dashboard-dist/","templates/","schemas/","types/","utils/","scripts-agentkit/","scripts-dist/lib/kit-installers/"];const EXCLUDED_RE=[/\/__tests__\//,/\.test\.[^/]*$/,/\.d\.ts$/,/\.map$/],norm=t=>t.replace(/\\/g,"/").replace(/^\.\//,"");function isGated(t){const s=norm(t);return exports.ALLOWED_IN_GATED.includes(s)?!1:exports.GATED_PATHS.some(e=>s===e.slice(0,-1)||s.startsWith(e))}function isAllowed(t){const s=norm(t);return EXCLUDED_RE.some(e=>e.test(s))||isGated(s)?!1:exports.PUBLIC_CLIENT_FILES.includes(s)||s==="package.json"||s==="LICENSE"||s==="README.md"?!0:exports.PUBLIC_CLIENT_DIRS.some(e=>s.startsWith(e))}function gatedPathsIn(t){return t.filter(isGated)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GATED_PATHS=exports.ALLOWED_IN_GATED=exports.PUBLIC_CLIENT_DIRS=exports.PUBLIC_CLIENT_FILES=void 0,exports.isGated=isGated,exports.isAllowed=isAllowed,exports.gatedPathsIn=gatedPathsIn,exports.PUBLIC_CLIENT_FILES=["bin/agentkit.js","CHANGELOG.md"],exports.PUBLIC_CLIENT_DIRS=["scripts-dist/"],exports.ALLOWED_IN_GATED=["scripts-dist/lib/kit-installers/shared-hooks-source.js"];const payload_roots_1=require("../payload-roots");exports.GATED_PATHS=[`${payload_roots_1.AGENT_KIT_DIR}/`,`${payload_roots_1.SKILL_SOURCE_DIR}/`,`${payload_roots_1.RULES_SOURCE_DIR}/`,`${payload_roots_1.AGENTS_SOURCE_DIR}/`,".agents/",`${payload_roots_1.COMMAND_SOURCE_DIR}/`,"docs/",`${payload_roots_1.GUIDE_DIR}/`,"plans/","scripts/","src/","dashboard/","dashboard-dist/",`${payload_roots_1.TEMPLATES_DIR}/`,"schemas/","types/","utils/",`${payload_roots_1.AGENT_SCRIPTS_DIR}/`,"scripts-dist/lib/kit-installers/"];const EXCLUDED_RE=[/\/__tests__\//,/\.test\.[^/]*$/,/\.d\.ts$/,/\.map$/],norm=t=>t.replace(/\\/g,"/").replace(/^\.\//,"");function isGated(t){const s=norm(t);return exports.ALLOWED_IN_GATED.includes(s)?!1:exports.GATED_PATHS.some(e=>s===e.slice(0,-1)||s.startsWith(e))}function isAllowed(t){const s=norm(t);return EXCLUDED_RE.some(e=>e.test(s))||isGated(s)?!1:exports.PUBLIC_CLIENT_FILES.includes(s)||s==="package.json"||s==="LICENSE"||s==="README.md"?!0:exports.PUBLIC_CLIENT_DIRS.some(e=>s.startsWith(e))}function gatedPathsIn(t){return t.filter(isGated)}
@@ -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"),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:c,context:u}=t.target;if(o===exports.MASTER_HOOK){try{(0,agentkit_config_file_1.writeHooksEnabled)(u.configPath,n)}catch(l){return refused(500,`could not write the kit config: ${l.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,hook:o,enabled:n}}}const s=(0,hook_toggle_registry_1.hookRegistry)(i).find(l=>l.name===o);if(!s)return refused(404,"no such hook");const a=(0,hooks_write_policy_1.decideWrite)(c.kit,c.scope,o,s.readBy,kits_1.kitDefinitions[c.kit].name);if(!a.allowed)return refused(409,a.reason,a.hint);try{(0,agentkit_config_file_1.updateSection)(u.configPath,"hooks",l=>{l[o]=n})}catch(l){return refused(500,`could not write the kit config: ${l.message}`)}return(0,kits_endpoint_1.clearKitsCache)(),{status:200,body:{ok:!0,hook:o,enabled:n,...a.warning?{warning:a.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),c=(0,skill_profiles_1.resolveSkipDirs)(i,n.profile,n.extraSkills),u={...n.agentModels?{agentModels:n.agentModels}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(i,n.profile)},f=r.scope==="global"?(0,kit_install_dispatch_1.installGlobalKit)(r.kit,i,(0,init_install_scope_1.resolveGlobalRoot)(r.kit,""),c,u):(0,kit_install_dispatch_1.installProjectKit)(r.kit,i,r.path,c,u);if(!f.ok)return refused(409,f.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,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.UNRECORDED_PROFILE=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("../generate-catalogs"),retired_skills_1=require("./retired-skills");exports.PROFILES=["core","full","frontend","backend","mobile","fullstack","marketing","assistant"],exports.DEFAULT_PROFILE="core",exports.UNRECORDED_PROFILE="full";function defaultProfileForKit(e){return ASSISTANT_PROFILE_KITS.has(e)?"assistant":exports.DEFAULT_PROFILE}function resolveEffectiveProfile(e,t,s,n){return e??(t?s: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(t,e,s,r){r===void 0&&(r=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,r,n)}):(function(t,e,s,r){r===void 0&&(r=s),t[r]=e[s]})),__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(s){var r=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var s={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&__createBinding(s,e,r[n]);return __setModuleDefault(s,e),s}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.KNOWN_UNTESTED=exports.KNOWN_UNWIRED=exports.PYTHON_RUNNERS=exports.WIRED_RUNNERS=exports.SKILLS_DIR=exports.REPO_ROOT=void 0,exports.allowlistReason=allowlistReason,exports.allowlistPath=allowlistPath,exports.runnerFor=runnerFor,exports.isVendoredSkill=isVendoredSkill,exports.isUnderVendoredSkill=isUnderVendoredSkill,exports.inScopeSkills=inScopeSkills,exports.summarizeSkills=summarizeSkills,exports.discoverSkillTests=discoverSkillTests;const fs=__importStar(require("fs")),path=__importStar(require("path"));exports.REPO_ROOT=path.resolve(__dirname,"..",".."),exports.SKILLS_DIR=path.join(exports.REPO_ROOT,"skills");const NOT_SKILLS=new Set(["common"]),CODE_EXT=new Set([".py",".cjs",".js",".mjs",".ts",".sh",".ps1"]),SKIP_DIRS=new Set(["__pycache__","node_modules",".git",".pytest_cache",".venv","venv"]),TEST_DIR=new Set(["tests","test","__tests__"]),TEST_NAME=/(^test[-_.]|[-_.]test\.|_test\.|^run\.sh$)/i;exports.WIRED_RUNNERS=["pytest","python:unittest","node:test","node:bespoke","shell"],exports.PYTHON_RUNNERS=["pytest","python:unittest"],exports.KNOWN_UNWIRED=new Set(["skills/pentester/tests/lib/assert.sh # W16 harness","skills/pentester/tests/lib/manifest.sh # W16 harness","skills/pentester/tests/run.sh # W16 harness","skills/use-mcp/scripts/smoke-test.sh # W10 runner","skills/docs-seeker/scripts/tests/run-tests.js # W17 harness"]);function allowlistReason(t){return(t.split(" # ")[1]??"").split(" ").slice(1).join(" ")}exports.KNOWN_UNTESTED=new Set([]);function allowlistPath(t){return t.split(" # ")[0]}function readIfPossible(t){try{return fs.readFileSync(t,"utf8")}catch{return null}}function runnerFor(t){const e=path.extname(t);if(e===".py"){const s=readIfPossible(t);return s===null?"python:unreadable":/^\s*import pytest|^\s*from pytest/m.test(s)?"pytest":s.includes("unittest")?"python:unittest":"python:plain"}if(e===".cjs"||e===".mjs"||e===".js"){const s=readIfPossible(t);return s===null?"node:unreadable":/require\(['"]node:test['"]\)|from ['"]node:test['"]/.test(s)?"node:test":"node:bespoke"}return e===".sh"?"shell":`unknown:${e}`}function isVendoredSkill(t,e=exports.SKILLS_DIR){const s=path.join(e,t,"SKILL.md");if(!fs.existsSync(s))return!1;const r=fs.readFileSync(s,"utf8").match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1]??"";return/^upstream:/m.test(r)}function isUnderVendoredSkill(t){const e=t.replace(/\\/g,"/").split("/");return e[0]==="skills"&&e.length>=2&&isVendoredSkill(e[1])}function inScopeSkills(t=exports.SKILLS_DIR){return fs.existsSync(t)?fs.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()&&!e.name.startsWith(".")&&!NOT_SKILLS.has(e.name)).map(e=>e.name).filter(e=>{const s=path.join(t,e,"SKILL.md");return fs.existsSync(s)&&!isVendoredSkill(e,t)}).sort():[]}function walk(t,e){let s;try{s=fs.readdirSync(t,{withFileTypes:!0})}catch(r){console.error(`skill-tests: cannot read ${path.relative(exports.REPO_ROOT,t)} \u2014 ${String(r)}`);return}for(const r of s){const n=path.join(t,r.name);if(r.isDirectory()){if(SKIP_DIRS.has(r.name))continue;walk(n,e)}else r.isFile()&&e.push(n)}}function isTestFile(t,e){const s=path.relative(t,e);return path.dirname(s).split(path.sep).some(n=>TEST_DIR.has(n))?!0:TEST_NAME.test(path.basename(e))}function repoRelative(t){return path.relative(exports.REPO_ROOT,t).split(path.sep).join("/")}function summarizeSkills(t=exports.SKILLS_DIR){return inScopeSkills(t).map(e=>{const s=path.join(t,e),r=[];walk(s,r);const n=[],i=[];for(const o of r.sort())CODE_EXT.has(path.extname(o))&&(isTestFile(s,o)?i:n).push(repoRelative(o));return{skill:e,codeFiles:n,testFiles:i}})}function discoverSkillTests(t=exports.SKILLS_DIR){const e=[];for(const{skill:s,testFiles:r}of summarizeSkills(t)){const n=path.join(t,s);for(const i of r){const o=path.join(exports.REPO_ROOT,i);e.push({file:i,skill:s,dir:path.dirname(path.relative(n,o)).split(path.sep).join("/"),runner:runnerFor(o)})}}return e}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,s,r){r===void 0&&(r=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,r,n)}):(function(t,e,s,r){r===void 0&&(r=s),t[r]=e[s]})),__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(s){var r=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var s={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&__createBinding(s,e,r[n]);return __setModuleDefault(s,e),s}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.KNOWN_UNTESTED=exports.KNOWN_UNWIRED=exports.PYTHON_RUNNERS=exports.WIRED_RUNNERS=exports.SKILLS_DIR=exports.REPO_ROOT=void 0,exports.allowlistReason=allowlistReason,exports.allowlistPath=allowlistPath,exports.runnerFor=runnerFor,exports.isVendoredSkill=isVendoredSkill,exports.isUnderVendoredSkill=isUnderVendoredSkill,exports.inScopeSkills=inScopeSkills,exports.summarizeSkills=summarizeSkills,exports.discoverSkillTests=discoverSkillTests;const fs=__importStar(require("fs")),path=__importStar(require("path")),payload_roots_1=require("./payload-roots");exports.REPO_ROOT=path.resolve(__dirname,"..",".."),exports.SKILLS_DIR=path.join(exports.REPO_ROOT,payload_roots_1.SKILL_SOURCE_DIR);const NOT_SKILLS=new Set(["common"]),CODE_EXT=new Set([".py",".cjs",".js",".mjs",".ts",".sh",".ps1"]),SKIP_DIRS=new Set(["__pycache__","node_modules",".git",".pytest_cache",".venv","venv"]),TEST_DIR=new Set(["tests","test","__tests__"]),TEST_NAME=/(^test[-_.]|[-_.]test\.|_test\.|^run\.sh$)/i;exports.WIRED_RUNNERS=["pytest","python:unittest","node:test","node:bespoke","shell"],exports.PYTHON_RUNNERS=["pytest","python:unittest"],exports.KNOWN_UNWIRED=new Set(["skills/pentester/tests/lib/assert.sh # W16 harness","skills/pentester/tests/lib/manifest.sh # W16 harness","skills/pentester/tests/run.sh # W16 harness","skills/use-mcp/scripts/smoke-test.sh # W10 runner","skills/docs-seeker/scripts/tests/run-tests.js # W17 harness"]);function allowlistReason(t){return(t.split(" # ")[1]??"").split(" ").slice(1).join(" ")}exports.KNOWN_UNTESTED=new Set([]);function allowlistPath(t){return t.split(" # ")[0]}function readIfPossible(t){try{return fs.readFileSync(t,"utf8")}catch{return null}}function runnerFor(t){const e=path.extname(t);if(e===".py"){const s=readIfPossible(t);return s===null?"python:unreadable":/^\s*import pytest|^\s*from pytest/m.test(s)?"pytest":s.includes("unittest")?"python:unittest":"python:plain"}if(e===".cjs"||e===".mjs"||e===".js"){const s=readIfPossible(t);return s===null?"node:unreadable":/require\(['"]node:test['"]\)|from ['"]node:test['"]/.test(s)?"node:test":"node:bespoke"}return e===".sh"?"shell":`unknown:${e}`}function isVendoredSkill(t,e=exports.SKILLS_DIR){const s=path.join(e,t,"SKILL.md");if(!fs.existsSync(s))return!1;const r=fs.readFileSync(s,"utf8").match(/^---\r?\n([\s\S]*?)\r?\n---/)?.[1]??"";return/^upstream:/m.test(r)}function isUnderVendoredSkill(t){const e=t.replace(/\\/g,"/").split("/");return e[0]==="skills"&&e.length>=2&&isVendoredSkill(e[1])}function inScopeSkills(t=exports.SKILLS_DIR){return fs.existsSync(t)?fs.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()&&!e.name.startsWith(".")&&!NOT_SKILLS.has(e.name)).map(e=>e.name).filter(e=>{const s=path.join(t,e,"SKILL.md");return fs.existsSync(s)&&!isVendoredSkill(e,t)}).sort():[]}function walk(t,e){let s;try{s=fs.readdirSync(t,{withFileTypes:!0})}catch(r){console.error(`skill-tests: cannot read ${path.relative(exports.REPO_ROOT,t)} \u2014 ${String(r)}`);return}for(const r of s){const n=path.join(t,r.name);if(r.isDirectory()){if(SKIP_DIRS.has(r.name))continue;walk(n,e)}else r.isFile()&&e.push(n)}}function isTestFile(t,e){const s=path.relative(t,e);return path.dirname(s).split(path.sep).some(n=>TEST_DIR.has(n))?!0:TEST_NAME.test(path.basename(e))}function repoRelative(t){return path.relative(exports.REPO_ROOT,t).split(path.sep).join("/")}function summarizeSkills(t=exports.SKILLS_DIR){return inScopeSkills(t).map(e=>{const s=path.join(t,e),r=[];walk(s,r);const n=[],i=[];for(const o of r.sort())CODE_EXT.has(path.extname(o))&&(isTestFile(s,o)?i:n).push(repoRelative(o));return{skill:e,codeFiles:n,testFiles:i}})}function discoverSkillTests(t=exports.SKILLS_DIR){const e=[];for(const{skill:s,testFiles:r}of summarizeSkills(t)){const n=path.join(t,s);for(const i of r){const o=path.join(exports.REPO_ROOT,i);e.push({file:i,skill:s,dir:path.dirname(path.relative(n,o)).split(path.sep).join("/"),runner:runnerFor(o)})}}return e}
@@ -0,0 +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}
@@ -0,0 +1,4 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,t,e,n){n===void 0&&(n=e);var o=Object.getOwnPropertyDescriptor(t,e);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,o)}):(function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]})),__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(e){var n=[];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[n.length]=o);return n},r(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n=r(t),o=0;o<n.length;o++)n[o]!=="default"&&__createBinding(e,t,n[o]);return __setModuleDefault(e,t),e}})(),__importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.runUpdate=runUpdate;const p=__importStar(require("@clack/prompts")),fs=__importStar(require("fs")),path=__importStar(require("path")),child_process_1=require("child_process"),chalk_1=__importDefault(require("chalk")),logger_1=require("../logger"),exec_1=require("../payload/exec"),source_1=require("../payload/source"),agentkit_home_1=require("../agentkit-home"),version_check_1=require("../version-check"),update_notifier_1=require("../update-notifier"),MAX_NOTES_SHOWN=5,MAX_NOTE_LINES=15;async function updateNpmClient(r,t,e){let n;try{n=JSON.parse(fs.readFileSync(path.join(t,"package.json"),"utf8"))}catch{return}if(typeof n.payloadVersion!="string"||typeof n.name!="string")return;const o=typeof n.version=="string"?n.version:"0.0.0";(0,logger_1.printProgress)("Checking npm for client updates...");let a=null;try{const u=await fetch(`https://registry.npmjs.org/${n.name.replace("/","%2F")}/latest`,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(version_check_1.REQUEST_TIMEOUT_MS)});if(u.ok){const f=await u.json();a=typeof f.version=="string"?f.version:null}}catch{}if(!a)return;if((0,version_check_1.compareVersions)(a,o)<=0){(0,logger_1.printInfo)(`Client is latest (v${o}).`);return}(0,logger_1.printInfo)(`Client update available: v${o} \u2192 v${a}`);const l=r?!0:await e({message:"Update the client package now?"});if(p.isCancel(l)||!l)return;const c=process.platform==="win32"?"npm.cmd":"npm";(0,child_process_1.spawnSync)(c,["install","-g",`${n.name}@latest`],{stdio:"inherit"}).status===0?(0,logger_1.printSuccess)(`Client updated to v${a}.`):(0,logger_1.printError)(`npm install failed \u2014 run \`npm i -g ${n.name}@latest\` manually.`)}async function executeCliUpdate(r,t){try{(0,logger_1.printProgress)("Resolving the payload...");const e=await(0,source_1.resolveInstallSource)({version:r,...t?{ref:t}:{},interactive:!1});e.origin!=="local"&&(0,logger_1.printInfo)(`Payload ${e.version} (${e.ref}) \u2014 ${e.origin} tree.`),(0,logger_1.printProgress)("Running the installation script...");const n=process.platform==="win32"?(0,exec_1.execPayload)("powershell",["-ExecutionPolicy","Bypass","-File",path.join(e.root,"install.ps1")]):(0,exec_1.execPayload)("bash",[path.join(e.root,"install.sh")]);return n.status!==0?((0,logger_1.printError)(n.error?`The installer could not start: ${n.error.message}`:"The installer exited non-zero."),!1):!0}catch(e){return e instanceof source_1.NoAccessError?(0,logger_1.printError)(e.message):(0,logger_1.printError)(`Failed to update CLI: ${e.message}`),!1}}function printReleaseNotes(r){console.log(""),(0,logger_1.printSection)("Release Notes");for(const t of r.slice(0,MAX_NOTES_SHOWN)){console.log(`
2
+ ${chalk_1.default.bold.cyan(`\u2501\u2501\u2501 v${(0,version_check_1.normalizeVersion)(t.tag_name)} \u2501\u2501\u2501`)}`);const e=(t.body||"").split(`
3
+ `);t.body?(console.log(chalk_1.default.dim(e.slice(0,MAX_NOTE_LINES).join(`
4
+ `))),e.length>MAX_NOTE_LINES&&(0,logger_1.printInfo)(`... (full notes: ${t.html_url})`)):(0,logger_1.printInfo)("(No release notes)"),console.log("")}r.length>MAX_NOTES_SHOWN&&(0,logger_1.printInfo)(`... and ${r.length-MAX_NOTES_SHOWN} more release(s)`)}async function runUpdate(r,t={}){const e=t.repoRoot??path.resolve(__dirname,"..","..",".."),n=t.confirm??p.confirm,o=r.includes("--yes")||r.includes("-y"),a=r.indexOf("--ref"),l=a!==-1?r[a+1]:void 0;if(a!==-1&&(!l||l.startsWith("--")))return(0,logger_1.printError)("--ref needs a value: agentkit update --ref <tag|branch|sha>"),1;const c=a!==-1?l:void 0,i=(0,source_1.newestTagInstalledTree)((0,agentkit_home_1.loadAgentkitHomeCore)())?.version??(0,version_check_1.getPayloadVersion)(e);if(!i)return(0,logger_1.printBanner)("CLI Update Manager"),(0,logger_1.printSection)("Checking CLI Version"),(0,logger_1.printError)("Could not determine current CLI version."),(0,logger_1.printInfo)("Please ensure Agentkit CLI is properly installed."),console.log(""),1;if(c)return(0,logger_1.printBanner)("CLI Update Manager"),(0,logger_1.printSection)("Updating CLI Tool"),(0,logger_1.printInfo)(`Installing ref ${c} over v${i}`),await executeCliUpdate(i,c)?((0,update_notifier_1.suppressUpdateNotice)(),console.log(""),(0,logger_1.printSuccess)(`Update completed from ref ${c}.`),console.log(""),0):(console.log(""),(0,logger_1.printError)("Update failed."),console.log(""),1);(0,logger_1.printBanner)("CLI Update Manager"),(0,logger_1.printSection)("Checking for Updates"),(0,logger_1.printInfo)(`Current version: v${i}`),await updateNpmClient(o,e,n),(0,logger_1.printProgress)("Fetching release info from GitHub...");let u;try{if(u=await(0,version_check_1.fetchReleases)(),u.length===0)throw new Error("No releases found")}catch(s){return(0,logger_1.printError)(`Failed to check for updates: ${s.message}`),(0,logger_1.printInfo)("Please check your internet connection and try again."),console.log(""),1}const f=u.filter(s=>!s.draft&&!s.prerelease);if(f.length===0)return(0,logger_1.printError)("No published releases found."),console.log(""),1;const m=[...f].sort((s,v)=>(0,version_check_1.compareVersions)(v.tag_name,s.tag_name)),g=m[0],d=(0,version_check_1.normalizeVersion)(g.tag_name);if((0,version_check_1.writeUpdateCache)({lastUpdateCheck:Date.now(),latestVersion:d}),(0,version_check_1.compareVersions)(i,d)>=0)return(0,logger_1.printSuccess)(`You are already on the latest version (v${i})`),console.log(""),0;const _=m.filter(s=>(0,version_check_1.compareVersions)(s.tag_name,i)>0);if(console.log(""),(0,logger_1.printSection)("Update Available"),(0,logger_1.printWarning)(`A new version is available: v${d}`),(0,logger_1.printInfo)(`Current version: v${i}`),(0,logger_1.printInfo)(`Versions behind: ${_.length}`),printReleaseNotes(_),(0,logger_1.printInfo)(`See ${g.html_url} for the full changelog`),console.log(""),!o){const s=await n({message:"Do you want to update the CLI tool now?"});if(p.isCancel(s)||!s)return console.log(""),(0,logger_1.printInfo)("Update cancelled."),(0,logger_1.printInfo)(`You can update manually later from: ${g.html_url}`),console.log(""),0}if((0,logger_1.printSection)("Updating CLI Tool"),!await executeCliUpdate(d))return console.log(""),(0,logger_1.printError)("Update failed. Please try updating manually."),console.log(""),1;(0,update_notifier_1.suppressUpdateNotice)(),console.log(""),(0,logger_1.printSection)("Verification");const h=(0,version_check_1.getPayloadVersion)(e);return h&&(0,version_check_1.compareVersions)(h,i)>0?(0,logger_1.printSuccess)(`CLI tool updated: v${i} \u2192 v${h}`):((0,logger_1.printSuccess)("Update completed."),(0,logger_1.printInfo)("Run 'agentkit -v' to confirm the installed version.")),console.log(""),0}
@@ -1,3 +1,3 @@
1
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}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.isEnvironmentSuppressed=isEnvironmentSuppressed,exports.renderNotice=renderNotice,exports.workerPath=workerPath,exports.suppressUpdateNotice=suppressUpdateNotice,exports.maybeNotifyUpdate=maybeNotifyUpdate;const child_process_1=require("child_process"),fs=__importStar(require("fs")),path=__importStar(require("path")),chalk_1=__importDefault(require("chalk")),version_check_1=require("./version-check");function defaultEnvironment(){return{isTTY:!!process.stderr.isTTY,env:process.env}}function isEnvironmentSuppressed(e){return e.isTTY?!!e.env.CI:!0}function renderNotice(e,t){return["",`${chalk_1.default.yellow("Update available")} ${chalk_1.default.dim(e)} ${chalk_1.default.dim("\u2192")} ${chalk_1.default.green(t)}`,`Run ${chalk_1.default.cyan("agentkit update")} to install it.`,""].join(`
2
- `)}function workerPath(){return path.join(__dirname,"..","update-check-worker.js")}let noticeSuppressed=!1;function suppressUpdateNotice(){noticeSuppressed=!0}function spawnBackgroundCheck(){try{const e=(0,child_process_1.spawn)(process.execPath,[workerPath()],{detached:!0,stdio:"ignore",windowsHide:!0});e.on("error",()=>{}),e.unref()}catch{}}function writeToStderr(e){try{fs.writeSync(2,`${e}
2
+ `)}function workerPath(){return path.join(__dirname,"..","gen","update-check-worker.js")}let noticeSuppressed=!1;function suppressUpdateNotice(){noticeSuppressed=!0}function spawnBackgroundCheck(){try{const e=(0,child_process_1.spawn)(process.execPath,[workerPath()],{detached:!0,stdio:"ignore",windowsHide:!0});e.on("error",()=>{}),e.unref()}catch{}}function writeToStderr(e){try{fs.writeSync(2,`${e}
3
3
  `)}catch{}}function maybeNotifyUpdate(e){noticeSuppressed=!1;const t=e.environment??defaultEnvironment();if(isEnvironmentSuppressed(t))return null;const n=(0,version_check_1.readUpdateCache)();if(n.autoUpdate===!1)return null;(0,version_check_1.isCacheStale)(n,e.now??Date.now())&&(e.spawnCheck??spawnBackgroundCheck)();const{currentVersion:r}=e;if(!r)return null;const i=e.onNotice??writeToStderr;return process.on("exit",()=>{if(noticeSuppressed)return;const s=(0,version_check_1.readUpdateCache)();s.latestVersion&&(0,version_check_1.compareVersions)(r,s.latestVersion)<0&&i(renderNotice(r,s.latestVersion))}),!n.latestVersion||(0,version_check_1.compareVersions)(r,n.latestVersion)>=0?null:renderNotice(r,n.latestVersion)}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env tsx
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,i,n){n===void 0&&(n=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,r)}):(function(t,e,i,n){n===void 0&&(n=i),t[n]=e[i]})),__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(i){var n=[];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[n.length]=r);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var n=t(e),r=0;r<n.length;r++)n[r]!=="default"&&__createBinding(i,e,n[r]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.assertOutsideRepo=assertOutsideRepo,exports.assertReleaseDestination=assertReleaseDestination,exports.findSecretShapes=findSecretShapes;const child_process_1=require("child_process"),fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),yaml=__importStar(require("js-yaml")),hermes_distribution_1=require("./lib/kit-installers/hermes-distribution"),logger_1=require("./lib/logger"),skill_profiles_1=require("./lib/skill-profiles"),REPO_ROOT=path.resolve(__dirname,".."),FORBIDDEN_NAMES=[".env",".env.local","auth.json","state.db","state.db-wal","state.db-shm"],FORBIDDEN_DIRS=["memories","sessions","logs"],SECRET_SHAPES=[{name:"private key block",regex:/-----BEGIN (?:RSA |EC |OPENSSH |PGP |DSA )?PRIVATE KEY-----[\s\S]{0,120}?[A-Za-z0-9+/=]{40}/,whole:!0},{name:"OpenAI-style key",regex:/\bsk-(?:ant-)?[A-Za-z0-9_-]{24,}/},{name:"GitHub token",regex:/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{30,}|\bgithub_pat_[A-Za-z0-9_]{20,}/},{name:"AWS access key id",regex:/\bAKIA(?!IOSFODNN7EXAMPLE)[0-9A-Z]{16}\b/},{name:"Slack token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}/},{name:"Google API key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/},{name:"assigned opaque literal",regex:/(api[_-]?key|token|secret|password)["']?\s*[:=]\s*["'][A-Za-z0-9_\-.]{24,}["']/i},{name:"credentials embedded in a URL",regex:/https?:\/\/[^/\s:@]+:[^@\s/]+@/}],BINARY_EXTENSIONS=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".svgz",".avif",".heic",".pdf",".zip",".gz",".tgz",".bz2",".xz",".7z",".tar",".jar",".whl",".mp3",".mp4",".wav",".ogg",".webm",".mov",".avi",".flac",".m4a",".ttf",".otf",".woff",".woff2",".eot",".so",".dylib",".dll",".exe",".bin",".wasm",".node",".pyc",".class",".db",".sqlite",".sqlite3"]),MAX_SCAN_BYTES=2*1024*1024;function parseArgs(t){const e={},i=[];for(let n=0;n<t.length;n+=1){const r=t[n];if(r==="--")continue;if(!r.startsWith("--")){i.push(r);continue}const s=r.indexOf("=");if(s!==-1){e[r.slice(2,s)]=r.slice(s+1);continue}e[r.slice(2)]=t[n+1]??"",n+=1}if(i.length!==1)throw new Error("Usage: pnpm build:hermes-dist -- <outDir> [--version X] [--source URL]");return{outDir:path.resolve(i[0]),version:e.version,source:e.source}}function assertPrivateRemote(t){let e;try{e=(0,child_process_1.execFileSync)("git",["-C",t,"remote","get-url","origin"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{(0,logger_1.printInfo)("No git remote on the output directory yet \u2014 privacy check skipped.");return}const i=/[:/]([^/:]+\/[^/]+?)(?:\.git)?$/.exec(e)?.[1];if(!i){(0,logger_1.printWarning)(`Could not read an owner/repo out of ${e} \u2014 verify privacy by hand.`);return}let n;try{n=JSON.parse((0,child_process_1.execFileSync)("gh",["repo","view",i,"--json","isPrivate"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]})).isPrivate}catch{(0,logger_1.printWarning)(`Could not ask gh whether ${i} is private. Verify it by hand before pushing \u2014 this payload is meant for a private repo.`);return}if(n!==!0)throw new Error(`${i} is PUBLIC. This distribution is built for a private team repo; publishing it would hand the payload, and every path in it, to anyone.`);(0,logger_1.printSuccess)(`${i} is private`)}function assertOutsideRepo(t){const e=path.relative(REPO_ROOT,t);if(e===""||!e.startsWith("..")&&!path.isAbsolute(e))throw new Error(`${t} is inside this repository. The release repo is separate: \`hermes profile install\` requires distribution.yaml at the CLONE ROOT.`)}function assertReleaseDestination(t){if(!fs.existsSync(t))return;const e=fs.readdirSync(t).filter(i=>i!==".git");if(e.length!==0&&!e.includes("distribution.yaml"))throw new Error(`${t} is not empty and holds no distribution.yaml, so it is not a release repo \u2014 and this script empties its destination. Point it at a fresh clone of the release repo, or at an empty directory.`)}function walk(t,e,i=t){for(const n of fs.readdirSync(t,{withFileTypes:!0})){const r=path.join(t,n.name);e(r,path.relative(i,r)),n.isDirectory()&&walk(r,e,i)}}function assertNoUserData(t){const e=[];if(walk(t,(i,n)=>{const r=path.basename(n);FORBIDDEN_NAMES.includes(r)&&e.push(n),FORBIDDEN_DIRS.includes(r)&&fs.statSync(i).isDirectory()&&e.push(`${n}/`)}),e.length>0)throw new Error(`The built payload contains user data or credentials: ${e.join(", ")}. A released distribution is cloned by everyone on the team.`)}function findSecretShapes(t){const e=[];return walk(t,(i,n)=>{const r=fs.statSync(i);if(!r.isFile()||BINARY_EXTENSIONS.has(path.extname(i).toLowerCase())||r.size>MAX_SCAN_BYTES)return;const s=fs.readFileSync(i);if(s.includes(0))return;const a=s.toString("utf8"),c=a.split(`
2
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,i,n){n===void 0&&(n=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,r)}):(function(t,e,i,n){n===void 0&&(n=i),t[n]=e[i]})),__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(i){var n=[];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[n.length]=r);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var n=t(e),r=0;r<n.length;r++)n[r]!=="default"&&__createBinding(i,e,n[r]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.assertOutsideRepo=assertOutsideRepo,exports.assertReleaseDestination=assertReleaseDestination,exports.findSecretShapes=findSecretShapes;const child_process_1=require("child_process"),fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),yaml=__importStar(require("js-yaml")),hermes_distribution_1=require("../lib/kit-installers/hermes-distribution"),logger_1=require("../lib/logger"),skill_profiles_1=require("../lib/skill-profiles"),REPO_ROOT=path.resolve(__dirname,"..",".."),FORBIDDEN_NAMES=[".env",".env.local","auth.json","state.db","state.db-wal","state.db-shm"],FORBIDDEN_DIRS=["memories","sessions","logs"],SECRET_SHAPES=[{name:"private key block",regex:/-----BEGIN (?:RSA |EC |OPENSSH |PGP |DSA )?PRIVATE KEY-----[\s\S]{0,120}?[A-Za-z0-9+/=]{40}/,whole:!0},{name:"OpenAI-style key",regex:/\bsk-(?:ant-)?[A-Za-z0-9_-]{24,}/},{name:"GitHub token",regex:/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{30,}|\bgithub_pat_[A-Za-z0-9_]{20,}/},{name:"AWS access key id",regex:/\bAKIA(?!IOSFODNN7EXAMPLE)[0-9A-Z]{16}\b/},{name:"Slack token",regex:/\bxox[baprs]-[A-Za-z0-9-]{10,}/},{name:"Google API key",regex:/\bAIza[0-9A-Za-z_-]{35}\b/},{name:"assigned opaque literal",regex:/(api[_-]?key|token|secret|password)["']?\s*[:=]\s*["'][A-Za-z0-9_\-.]{24,}["']/i},{name:"credentials embedded in a URL",regex:/https?:\/\/[^/\s:@]+:[^@\s/]+@/}],BINARY_EXTENSIONS=new Set([".png",".jpg",".jpeg",".gif",".webp",".bmp",".ico",".svgz",".avif",".heic",".pdf",".zip",".gz",".tgz",".bz2",".xz",".7z",".tar",".jar",".whl",".mp3",".mp4",".wav",".ogg",".webm",".mov",".avi",".flac",".m4a",".ttf",".otf",".woff",".woff2",".eot",".so",".dylib",".dll",".exe",".bin",".wasm",".node",".pyc",".class",".db",".sqlite",".sqlite3"]),MAX_SCAN_BYTES=2*1024*1024;function parseArgs(t){const e={},i=[];for(let n=0;n<t.length;n+=1){const r=t[n];if(r==="--")continue;if(!r.startsWith("--")){i.push(r);continue}const s=r.indexOf("=");if(s!==-1){e[r.slice(2,s)]=r.slice(s+1);continue}e[r.slice(2)]=t[n+1]??"",n+=1}if(i.length!==1)throw new Error("Usage: pnpm build:hermes-dist -- <outDir> [--version X] [--source URL]");return{outDir:path.resolve(i[0]),version:e.version,source:e.source}}function assertPrivateRemote(t){let e;try{e=(0,child_process_1.execFileSync)("git",["-C",t,"remote","get-url","origin"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{(0,logger_1.printInfo)("No git remote on the output directory yet \u2014 privacy check skipped.");return}const i=/[:/]([^/:]+\/[^/]+?)(?:\.git)?$/.exec(e)?.[1];if(!i){(0,logger_1.printWarning)(`Could not read an owner/repo out of ${e} \u2014 verify privacy by hand.`);return}let n;try{n=JSON.parse((0,child_process_1.execFileSync)("gh",["repo","view",i,"--json","isPrivate"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]})).isPrivate}catch{(0,logger_1.printWarning)(`Could not ask gh whether ${i} is private. Verify it by hand before pushing \u2014 this payload is meant for a private repo.`);return}if(n!==!0)throw new Error(`${i} is PUBLIC. This distribution is built for a private team repo; publishing it would hand the payload, and every path in it, to anyone.`);(0,logger_1.printSuccess)(`${i} is private`)}function assertOutsideRepo(t){const e=path.relative(REPO_ROOT,t);if(e===""||!e.startsWith("..")&&!path.isAbsolute(e))throw new Error(`${t} is inside this repository. The release repo is separate: \`hermes profile install\` requires distribution.yaml at the CLONE ROOT.`)}function assertReleaseDestination(t){if(!fs.existsSync(t))return;const e=fs.readdirSync(t).filter(i=>i!==".git");if(e.length!==0&&!e.includes("distribution.yaml"))throw new Error(`${t} is not empty and holds no distribution.yaml, so it is not a release repo \u2014 and this script empties its destination. Point it at a fresh clone of the release repo, or at an empty directory.`)}function walk(t,e,i=t){for(const n of fs.readdirSync(t,{withFileTypes:!0})){const r=path.join(t,n.name);e(r,path.relative(i,r)),n.isDirectory()&&walk(r,e,i)}}function assertNoUserData(t){const e=[];if(walk(t,(i,n)=>{const r=path.basename(n);FORBIDDEN_NAMES.includes(r)&&e.push(n),FORBIDDEN_DIRS.includes(r)&&fs.statSync(i).isDirectory()&&e.push(`${n}/`)}),e.length>0)throw new Error(`The built payload contains user data or credentials: ${e.join(", ")}. A released distribution is cloned by everyone on the team.`)}function findSecretShapes(t){const e=[];return walk(t,(i,n)=>{const r=fs.statSync(i);if(!r.isFile()||BINARY_EXTENSIONS.has(path.extname(i).toLowerCase())||r.size>MAX_SCAN_BYTES)return;const s=fs.readFileSync(i);if(s.includes(0))return;const a=s.toString("utf8"),c=a.split(`
3
3
  `);for(const o of SECRET_SHAPES){if(o.whole){o.regex.test(a)&&e.push(`${n} \u2014 ${o.name}`);continue}for(const[l,u]of c.entries())o.regex.test(u)&&e.push(`${n}:${l+1} \u2014 ${o.name}`)}}),e}function assertNoSecrets(t){const e=findSecretShapes(t);if(e.length>0)throw new Error(`Credential-shaped values in the built payload:
4
4
  ${e.join(`
5
5
  `)}
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,i,t,o){o===void 0&&(o=t);var r=Object.getOwnPropertyDescriptor(i,t);(!r||("get"in r?!i.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return i[t]}}),Object.defineProperty(e,o,r)}):(function(e,i,t,o){o===void 0&&(o=t),e[o]=i[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,i){Object.defineProperty(e,"default",{enumerable:!0,value:i})}):function(e,i){e.default=i}),__importStar=this&&this.__importStar||(function(){var e=function(i){return e=Object.getOwnPropertyNames||function(t){var o=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[o.length]=r);return o},e(i)};return function(i){if(i&&i.__esModule)return i;var t={};if(i!=null)for(var o=e(i),r=0;r<o.length;r++)o[r]!=="default"&&__createBinding(t,i,o[r]);return __setModuleDefault(t,i),t}})();Object.defineProperty(exports,"__esModule",{value:!0});const fs=__importStar(require("fs")),path=__importStar(require("path")),readline=__importStar(require("readline")),os=__importStar(require("os")),install_registry_1=require("./lib/install-registry"),logger_1=require("./lib/logger"),ui_1=require("./lib/ui"),codex_agents_1=require("./lib/codex-agents"),kimi_hooks_toml_1=require("./lib/kit-installers/kimi-hooks-toml"),kimi_1=require("./lib/kit-installers/kimi"),grok_config_toml_1=require("./lib/kit-installers/grok-config-toml"),grok_session_toml_1=require("./lib/kit-installers/grok-session-toml"),hermes_hooks_yaml_1=require("./lib/kit-installers/hermes-hooks-yaml"),openclaw_config_json_1=require("./lib/kit-installers/openclaw-config-json"),omp_config_yml_1=require("./lib/kit-installers/omp-config-yml"),omp_home_1=require("./lib/omp-home"),pi_home_1=require("./lib/pi-home"),devin_hooks_1=require("./lib/kit-installers/devin-hooks"),devin_home_1=require("./lib/kit-installers/devin-home"),dropped_mcp_servers_1=require("./lib/dropped-mcp-servers"),retired_skills_1=require("./lib/retired-skills"),devin_rules_1=require("./lib/kit-installers/devin-rules"),devin_agents_1=require("./lib/kit-installers/devin-agents"),devin_hooks_2=require("./lib/kit-installers/devin-hooks"),commands_to_skills_1=require("./lib/kit-installers/commands-to-skills"),file_operations_1=require("./lib/file-operations"),package_root_1=require("./lib/package-root"),install_manifest_1=require("./lib/install-manifest"),kit_remover_1=require("./lib/kit-remover"),openclaw_home_1=require("./lib/openclaw-home"),hermes_clear_targets_1=require("./lib/hermes-clear-targets"),global_clear_targets_1=require("./lib/global-clear-targets"),hermes_home_context_1=require("./lib/kit-installers/hermes-home-context"),colors={reset:"\x1B[0m",yellow:"\x1B[33m",cyan:"\x1B[36m"},cwd=process.cwd(),homeDir=os.homedir(),projectPlatformDefs=[{key:"claude",name:"Claude Code",dirPath:path.join(cwd,".claude"),filePaths:[path.join(cwd,"CLAUDE.md")]},{key:"cursor",name:"Cursor AI",dirPath:path.join(cwd,".cursor"),filePaths:[path.join(cwd,"AGENTS.md"),path.join(cwd,".cursorrules"),path.join(cwd,"CLAUDE.md")]},{key:"augment",name:"Augment Code",dirPath:path.join(cwd,".claude"),filePaths:[path.join(cwd,"CLAUDE.md")]},{key:"antigravity",name:"Antigravity",dirPath:path.join(cwd,".agents"),filePaths:[path.join(cwd,"GEMINI.md")]},{key:"opencode",name:"OpenCode",dirPath:path.join(cwd,".opencode"),filePaths:[]},{key:"codex",name:"OpenAI Codex",dirPath:path.join(cwd,".codex"),filePaths:[]},{key:"kimi",name:"Kimi Code",dirPath:path.join(cwd,".kimi-code"),filePaths:[]},{key:"hermes",name:"Hermes Agent",dirPath:path.join(cwd,".hermes-kit"),filePaths:[],group:(0,ui_1.kitGroup)("hermes")},{key:"openclaw",name:"OpenClaw",dirPath:path.join(cwd,".openclaw-kit"),filePaths:[],group:(0,ui_1.kitGroup)("openclaw")},{key:"grok",name:"Grok Build",dirPath:path.join(cwd,".grok"),filePaths:[]},{key:"pi",name:"Pi",dirPath:path.join(cwd,".pi","agentkit"),filePaths:[]},{key:"devin",name:"Devin CLI",dirPath:path.join(cwd,".devin"),filePaths:[],requiresMarker:path.join(cwd,".devin",".agentkit.json"),ownedPaths:[...(0,devin_rules_1.devinOwnedRuleNames)(path.join(cwd,".devin","rules")).map(e=>path.join(cwd,".devin","rules",e)),...(0,devin_agents_1.devinOwnedAgentNames)(path.join(cwd,".devin","agents")).map(e=>path.join(cwd,".devin","agents",e)),...(0,file_operations_1.shippedSkillEntries)((0,package_root_1.packageRoot)()).map(e=>path.join(cwd,".devin","skills",e.name)),...(0,commands_to_skills_1.commandSkillNames)(path.join((0,package_root_1.packageRoot)(),"command")).map(e=>path.join(cwd,".devin","skills",e)),...(0,retired_skills_1.retiredSkillNames)().map(e=>path.join(cwd,".devin","skills",e)),path.join(cwd,".devin","scripts"),...(0,devin_hooks_2.devinHookFileNames)().map(e=>path.join(cwd,".devin",e)),path.join(cwd,".devin","schemas"),path.join(cwd,".devin",".agentkit.json"),path.join(cwd,".devin",".agentkitignore"),path.join(cwd,".devin",install_manifest_1.MANIFEST_FILENAME)]}],globalPlatformDefs=[...(0,global_clear_targets_1.globalClearTargets)().map(e=>({...e,filePaths:[]})),...(0,hermes_clear_targets_1.hermesProfileClearTargets)().map(e=>({...e,filePaths:[],group:(0,ui_1.kitGroup)("hermes")}))],sharedDirs=["docs","plans"],MAX_LISTED_PATHS=6;function print(e,i="reset"){console.log(`${colors[i]}${e}${colors.reset}`)}function isProjectDir(e){const i=fs.existsSync(path.join(e,"package.json")),t=fs.existsSync(path.join(e,".git"));return i||t}function parseScopeFromArgs(){const e=process.argv.slice(2);return e.includes("--global")||e.includes("-g")?"global":e.includes("--project")||e.includes("-p")?"project":null}async function askScope(){const e=readline.createInterface({input:process.stdin,output:process.stdout});return console.log(""),(0,logger_1.printSection)("Clear Scope"),console.log(" 1) Current project"),console.log(" 2) Global (user machine)"),console.log(""),new Promise(i=>{e.question("Select scope [1-2] (default: 1): ",t=>{e.close(),i(t.trim()==="2"?"global":"project")})})}function detectInstalledPlatforms(e){return(e==="global"?globalPlatformDefs:projectPlatformDefs).map(t=>{const o=!t.requiresMarker||fs.existsSync(t.requiresMarker),r=t.ownedPaths?o&&t.ownedPaths.some(g=>fs.existsSync(g)):fs.existsSync(t.dirPath),u=t.filePaths.some(g=>fs.existsSync(g));return{...t,hasDir:r,hasFiles:u}}).filter(t=>t.hasDir||t.hasFiles)}function detectSharedDirs(){return sharedDirs.filter(e=>fs.existsSync(path.join(cwd,e)))}function removeDir(e){if(!fs.existsSync(e))return!1;try{return fs.rmSync(e,{recursive:!0,force:!0}),!0}catch(i){return(0,logger_1.printError)(`Failed to remove ${e}: ${i.message}`),!1}}function removeFile(e){if(!fs.existsSync(e))return!1;try{return fs.unlinkSync(e),!0}catch{return!1}}function cleanupGitignore(e){const i=path.join(cwd,".gitignore");if(!fs.existsSync(i))return!1;const t=fs.readFileSync(i,"utf-8").split(`
3
- `),o=new Set;e.forEach(g=>{const d=g.trim();o.add(d),o.add(d.endsWith("/")?d.slice(0,-1):`${d}/`)});let r=0;const u=t.filter(g=>{const d=g.trim();if(d===""||d.startsWith("#"))return!0;const m=d.endsWith("/")?d.slice(0,-1):d;for(const h of o){const n=h.endsWith("/")?h.slice(0,-1):h;if(m===n)return r++,!1}return!0});return fs.writeFileSync(i,`${u.join(`
4
- `).replace(/\n+$/,"")}
5
- `),r>0}async function askConfirmation(e){const i=readline.createInterface({input:process.stdin,output:process.stdout});return new Promise(t=>{i.question(e,o=>{i.close();const r=o.trim().toLowerCase();t(r==="y"||r==="yes")})})}function removeAgentkitAgentsBlock(e,i="AGENTS.md"){const t=path.join(e,i);if(!fs.existsSync(t))return!1;const o=fs.readFileSync(t,"utf-8");if(!(0,codex_agents_1.hasAikitCodexBlock)(o))return!1;const r=(0,codex_agents_1.stripAikitCodexBlock)(o);return r.removedWholeFile?removeFile(t)?((0,logger_1.printSuccess)(`Removed ${t} \u2014 it held nothing but the Agentkit block`),!0):!1:r.removed?(fs.writeFileSync(t,r.content),(0,logger_1.printSuccess)(`Removed the Agentkit block from ${t}`),!0):!1}function displayItems(e,i){const t=[];if(e.hasDir&&e.ownedPaths){const o=e.ownedPaths.filter(u=>fs.existsSync(u)),r=o.slice(0,MAX_LISTED_PATHS).map(u=>path.relative(e.dirPath,u));o.length>r.length&&r.push(`+${o.length-r.length} more`),t.push(`${e.dirPath}/{${r.join(", ")}}`)}else e.hasDir&&t.push(i==="global"?e.dirPath:`${path.basename(e.dirPath)}/`);if(e.hasFiles&&t.push(...e.filePaths.map(o=>path.basename(o))),i==="project"&&e.key==="codex"&&fs.existsSync(path.join(cwd,".agents"))&&t.push(".agents/"),i==="project"&&(e.key==="codex"||e.key==="kimi"||e.key==="grok"||e.key==="devin")&&fs.existsSync(path.join(cwd,"AGENTS.md"))){const o=fs.readFileSync(path.join(cwd,"AGENTS.md"),"utf-8");(0,codex_agents_1.hasAikitCodexBlock)(o)&&t.push("AGENTS.md")}if(e.key==="pi"||e.key==="pi-global"){const o=e.key==="pi"?path.join(cwd,"AGENTS.md"):path.join(e.dirPath,"AGENTS.md");if(fs.existsSync(o))try{(0,codex_agents_1.hasAikitCodexBlock)(fs.readFileSync(o,"utf-8"))&&t.push(path.relative(cwd,o))}catch{}}return t.join(", ")}function printHelp(){console.log(`
6
- Agentkit Clear
7
- Remove Agentkit installations from current project or global user directories
8
-
9
- Usage:
10
- agentkit clear [options]
11
-
12
- Options:
13
- --project, -p Remove Agentkit from the current project
14
- --global, -g Remove Agentkit from global user directories
15
- --help, -h Show this help message
16
-
17
- Examples:
18
- agentkit clear # Interactive removal picker
19
- agentkit clear --project # Clear project-scoped files
20
- agentkit clear --global # Clear globally-installed platforms
21
- `)}async function main(){const e=process.argv.slice(2);if(e.includes("--help")||e.includes("-h")||e.includes("help")){printHelp();return}(0,logger_1.printSection)("Agentkit Clear - Remove Installations");let i=parseScopeFromArgs();i||(!isProjectDir(cwd)&&cwd===homeDir?i="global":i=await askScope()),(0,logger_1.printInfo)(`Scanning for Agentkit installations (${i})...`);const t=detectInstalledPlatforms(i),o=i==="project"?detectSharedDirs():[];if(t.length===0&&o.length===0){console.log(""),(0,logger_1.printInfo)(`No Agentkit installations found in ${i==="global"?"global scope":"this project"}.`),console.log("");return}if(console.log(""),(0,logger_1.printWarning)("Found the following Agentkit installations:"),console.log(""),i==="project"&&o.length>0){print("Shared Directories:","yellow");for(const n of o)print(` \u2022 ${n}/`,"cyan");console.log("")}(0,logger_1.printWarning)("WARNING: This action cannot be undone!"),console.log("");let r=[];if(t.length>0){const n=await(0,ui_1.selectTargetsToRemove)(t.map(s=>({value:s.key,label:s.name,group:s.group??"coding"})));if(n===null){console.log(""),(0,logger_1.printInfo)("Operation cancelled. No files were removed."),console.log("");return}r=t.filter(s=>n.includes(s.key))}if(r.length===0&&o.length===0){console.log(""),(0,logger_1.printInfo)("Nothing selected \u2014 no files were removed."),console.log("");return}if(r.length>0){console.log("");for(const s of r)print(` \u2022 ${s.name}: ${displayItems(s,i)}`,"cyan");if(console.log(""),!await askConfirmation(`Remove ${r.length} selected installation${r.length===1?"":"s"}? (y/n): `)){console.log(""),(0,logger_1.printInfo)("Operation cancelled. No files were removed."),console.log("");return}}const u=n=>(0,hermes_clear_targets_1.isHermesProfileKey)(n.key),g=r.filter(u).length,d=g>0&&g===t.filter(u).length;console.log(""),(0,logger_1.printSection)("Removing Agentkit Installations");const m=[];let h=0;for(const n of r){let s=!1;if(n.ownedPaths)for(const l of n.ownedPaths)fs.existsSync(l)&&removeDir(l)&&((0,logger_1.printSuccess)(`Removed ${l}`),s=!0);else n.hasDir&&removeDir(n.dirPath)&&((0,logger_1.printSuccess)(`Removed ${i==="global"?n.dirPath:`${path.basename(n.dirPath)}/`}`),s=!0,i==="project"&&m.push(`${path.basename(n.dirPath)}/`));if(i==="project"&&n.key==="codex"){const l=path.join(cwd,".agents");fs.existsSync(l)&&removeDir(l)&&((0,logger_1.printSuccess)("Removed .agents/"),s=!0,m.push(".agents/"));const c=path.join(cwd,"AGENTS.md");if(fs.existsSync(c)){const a=fs.readFileSync(c,"utf-8");if((0,codex_agents_1.hasAikitCodexBlock)(a)){const f=(0,codex_agents_1.stripAikitCodexBlock)(a);f.removedWholeFile?removeFile(c)&&((0,logger_1.printSuccess)("Removed AGENTS.md"),s=!0):f.removed&&(fs.writeFileSync(c,f.content),(0,logger_1.printSuccess)("Removed Agentkit Codex block from AGENTS.md"),s=!0)}}}if(n.key==="grok"||n.key==="grok-global"){i==="project"&&removeAgentkitAgentsBlock(cwd)&&(s=!0);const l=path.join(i==="global"?n.dirPath:path.join(cwd,".grok"),"config.toml");(0,grok_config_toml_1.removeGrokMcpServers)(l)&&((0,logger_1.printSuccess)(`Removed the Agentkit MCP block from ${l}`),s=!0),(0,grok_session_toml_1.removeGrokSessionDefaults)(l)&&((0,logger_1.printSuccess)(`Removed the Agentkit session block from ${l}`),s=!0)}if((n.key==="kimi"||n.key==="kimi-global")&&(i==="project"&&removeAgentkitAgentsBlock(cwd)&&(s=!0),(0,kimi_hooks_toml_1.removeKimiHooks)((0,kimi_1.resolveKimiHomeConfig)())&&((0,logger_1.printSuccess)("Removed Agentkit hooks from the Kimi user config"),s=!0)),n.key==="devin"||n.key==="devin-global"){i==="project"&&removeAgentkitAgentsBlock(cwd)&&(s=!0);const l=path.join(i==="global"?n.dirPath:path.join(cwd,".devin"),i==="global"?"config.json":"hooks.v1.json");if((0,devin_hooks_1.removeDevinHooks)(l,i==="global"?"hooksKey":"whole")&&((0,logger_1.printSuccess)(`Removed Agentkit hook handlers from ${l}`),s=!0),i==="global"){const a=path.join((0,devin_home_1.resolveDevinHomeDir)(),"rules");let f=0;for(const p of(0,devin_rules_1.devinOwnedRuleNames)(a))removeFile(path.join(a,p))&&(f+=1);f>0&&((0,logger_1.printSuccess)(`Removed ${f} rule(s) from ~/.devin/rules`),s=!0)}const c=path.join(i==="global"?n.dirPath:path.join(cwd,".devin"),"mcp_config.json");if(fs.existsSync(c)){const{remaining:a}=(0,dropped_mcp_servers_1.removeAgentkitMcpServers)(c);a===0?(removeFile(c),(0,logger_1.printSuccess)(`Removed ${c}`)):a===null?(0,logger_1.printWarning)(`Kept ${c} \u2014 it could not be read as an mcpServers map`):(0,logger_1.printWarning)(`Kept ${c} \u2014 it still holds ${a} of your own server(s)`),s=!0}}if(n.key==="hermes"&&removeAgentkitAgentsBlock(cwd)&&(s=!0),n.key==="openclaw-global"){const l=(0,openclaw_home_1.openClawWorkspaceDir)(n.dirPath);removeAgentkitAgentsBlock(l)&&(s=!0);const c=(0,openclaw_config_json_1.unregisterOpenClawKit)((0,openclaw_home_1.openClawConfigPath)(n.dirPath),{skills:path.join(n.dirPath,openclaw_home_1.OPENCLAW_SKILLS_SUBDIR),plugin:path.join(n.dirPath,openclaw_home_1.OPENCLAW_PLUGIN_SUBDIR),legacyHooks:path.join(n.dirPath,openclaw_home_1.OPENCLAW_HOOKS_SUBDIR)});for(const a of c.warnings)(0,logger_1.printWarning)(a);c.removed.length>0&&c.written?((0,logger_1.printSuccess)(`Unregistered ${c.removed.length} directories from openclaw.json`),s=!0):c.removed.length>0&&(0,logger_1.printWarning)(`Could not update ${(0,openclaw_home_1.openClawConfigPath)(n.dirPath)} \u2014 it still registers ${c.removed.length} directories this removal deleted. Edit it by hand, or OpenClaw will scan paths that are no longer there.`)}if(n.key==="omp-global"){removeAgentkitAgentsBlock(n.dirPath)&&(s=!0),removeAgentkitAgentsBlock(n.dirPath,"RULES.md")&&(s=!0);const l=(0,omp_config_yml_1.resolveOmpConfigFile)(n.dirPath),c=(0,omp_config_yml_1.removeOmpSkillsDir)(l,path.join(n.dirPath,omp_home_1.OMP_SKILLS_SUBDIR));for(const a of c.warnings)(0,logger_1.printWarning)(a);c.added.length>0&&c.written?((0,logger_1.printSuccess)(`Unregistered the Agentkit skills directory from ${l}`),s=!0):!c.written&&fs.existsSync(l)&&(0,logger_1.printWarning)(`Could not update ${l} \u2014 it may still register the skills directory this removal deleted. Edit it by hand, or omp will scan a path that is no longer there.`);try{const a=path.join(n.dirPath,omp_home_1.OMP_KIT_SUBDIR);fs.readdirSync(a).length===0&&fs.rmdirSync(a)}catch{}}if((0,hermes_clear_targets_1.isHermesProfileKey)(n.key)){const l=path.join(n.dirPath,"config.yaml");fs.existsSync(l)&&(0,hermes_hooks_yaml_1.removeHermesHooks)(l)&&((0,logger_1.printSuccess)(`Removed Agentkit hooks from ${n.name}'s config`),s=!0),fs.existsSync(l)&&(0,hermes_hooks_yaml_1.removeHermesPlugins)(l)&&((0,logger_1.printSuccess)(`Removed Agentkit plugin registration from ${n.name}'s config`),s=!0),d&&(0,hermes_home_context_1.removeHermesHomeContext)(homeDir)&&((0,logger_1.printSuccess)(`Removed ${hermes_home_context_1.HERMES_HOME_CONTEXT_FILE} from ${homeDir}`),s=!0)}if(n.key==="pi"||n.key==="pi-global"){const l=n.key==="pi-global",c=l?n.dirPath:path.dirname(n.dirPath),a=l?path.join(c,"AGENTS.md"):path.join(cwd,"AGENTS.md");if((0,kit_remover_1.removePiExtras)(c,a)&&(s=!0),l)try{const f=path.join(c,pi_home_1.PI_KIT_SUBDIR);fs.readdirSync(f).length===0&&fs.rmdirSync(f)}catch{}}for(const l of n.filePaths)removeFile(l)&&((0,logger_1.printSuccess)(`Removed ${path.basename(l)}`),s=!0,i==="project"&&m.push(path.basename(l)));s&&h++}if(i==="project"&&o.length>0)if(console.log(""),(0,logger_1.printWarning)("Shared directories (docs/, plans/) may contain your content."),await askConfirmation("Do you want to remove shared directories too? (y/n): "))for(const s of o){const l=path.join(cwd,s);removeDir(l)&&((0,logger_1.printSuccess)(`Removed ${s}/`),m.push(`${s}/`))}else(0,logger_1.printInfo)("Shared directories preserved.");i==="project"&&(console.log(""),(0,logger_1.printInfo)("Cleaning up .gitignore..."),cleanupGitignore(m)?(0,logger_1.printSuccess)(".gitignore cleaned"):(0,logger_1.printInfo)(".gitignore already clean"));try{(0,install_registry_1.pruneRegistry)()}catch{}console.log(""),(0,logger_1.printSection)("Removal Complete"),(0,logger_1.printSuccess)(`Removed ${h} Agentkit platform(s)`),console.log(""),(0,logger_1.printInfo)(`Agentkit ${i} scope is now clean.`),console.log("")}main().catch(e=>{(0,logger_1.printError)(`Error: ${e.message}`),process.exit(1)});
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}):(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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[r.length]=o);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(n,e,r[o]);return __setModuleDefault(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0});const fs=__importStar(require("fs")),path=__importStar(require("path")),agentkit_home_1=require("./lib/agentkit-home"),logger_1=require("./lib/logger"),open_browser_1=require("./lib/open-browser"),auth_token_1=require("./lib/server/auth-token"),bundle_info_1=require("./lib/server/bundle-info"),http_server_1=require("./lib/server/http-server"),instance_lock_1=require("./lib/server/instance-lock"),repoRoot=path.dirname(__dirname);function parseFlags(t){const e=t.indexOf("--port"),n=t.indexOf("--token-file"),r=e>=0?Number(t[e+1]):0;return{port:Number.isInteger(r)&&r>=0&&r<=65535?r:0,open:!t.includes("--no-open"),tokenFile:n>=0?t[n+1]??null:null}}function resolveServeRoot(){const t=(0,bundle_info_1.bundleRoot)(repoRoot);return fs.existsSync(path.join(t,"index.html"))||((0,logger_1.printError)("The dashboard UI is missing. Run: pnpm build:dashboard"),process.exit(1)),t}function printHelp(){console.log(`
3
- Agentkit Dashboard
4
- Open the local observability dashboard in your browser
5
-
6
- Usage:
7
- agentkit dashboard [options]
8
-
9
- Options:
10
- --port <number> Bind to a specific port (default: auto-assigned / 4321)
11
- --no-open Do not automatically open the dashboard in browser
12
- --token-file <path> Write authentication token to a specific file
13
- --help, -h Show this help message
14
-
15
- Examples:
16
- agentkit dashboard # Start server and open dashboard in browser
17
- agentkit dashboard --port 3000 # Use custom port 3000
18
- agentkit dashboard --no-open # Start server without launching browser
19
- `)}async function main(){const t=process.argv.slice(2);if(t.includes("--help")||t.includes("-h")||t.includes("help")){printHelp();return}const e=parseFlags(t);(0,agentkit_home_1.loadAgentkitHomeCore)().ensureHome();const n=(0,instance_lock_1.readLiveLock)();n&&((0,logger_1.printInfo)(`A dashboard is already running: http://127.0.0.1:${n.port}/`),(0,logger_1.printInfo)("Stop it with Ctrl+C in its terminal, then start a new one."),process.exit(0));const r=process.env.AGENTKIT_DASHBOARD_TOKEN||(0,auth_token_1.generateToken)();let o;try{o=await(0,http_server_1.startServer)({serveRoot:resolveServeRoot(),port:e.port,context:{repoRoot,token:r,startedAt:new Date().toISOString(),bundleGitSha:(0,bundle_info_1.readBundleGitSha)(repoRoot)}})}catch(i){i.code==="EADDRINUSE"?(0,logger_1.printError)(`port ${e.port} is in use \u2014 omit --port to pick a free one`):(0,logger_1.printError)(`Could not start the dashboard: ${i.message}`),process.exit(1)}if((0,instance_lock_1.writeLock)(o.port),e.tokenFile)try{fs.rmSync(e.tokenFile,{force:!0}),fs.writeFileSync(e.tokenFile,r,{mode:384})}catch(i){(0,logger_1.printError)(`Could not write the token file: ${i.message}`)}const s=`http://127.0.0.1:${o.port}/#t=${r}`;(0,logger_1.printSuccess)(`Dashboard: ${s}`),(0,logger_1.printInfo)("Press Ctrl+C to stop");for(const i of["SIGINT","SIGTERM"])process.on(i,()=>{if(e.tokenFile)try{fs.rmSync(e.tokenFile,{force:!0})}catch{}o.shutdown()});process.on("exit",instance_lock_1.removeLock),e.open&&(0,open_browser_1.openBrowser)(s)}main().catch(t=>{(0,logger_1.printError)(`Error: ${t.message}`),process.exit(1)});
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(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 r in n)Object.prototype.hasOwnProperty.call(n,r)&&(o[o.length]=r);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=e(t),r=0;r<o.length;r++)o[r]!=="default"&&__createBinding(n,t,o[r]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runChecks=runChecks;const path=__importStar(require("path")),checks_entitlement_1=require("./lib/doctor/checks-entitlement"),checks_hooks_1=require("./lib/doctor/checks-hooks"),checks_install_1=require("./lib/doctor/checks-install"),checks_rules_1=require("./lib/doctor/checks-rules"),checks_semantic_1=require("./lib/doctor/checks-semantic"),checks_skills_1=require("./lib/doctor/checks-skills"),checks_soul_1=require("./lib/doctor/checks-soul"),render_1=require("./lib/doctor/render"),types_1=require("./lib/doctor/types"),install_profile_config_1=require("./lib/install-profile-config"),kit_context_1=require("./lib/kit-context"),scriptDir=__dirname,repoRoot=path.dirname(scriptDir),targetDir=process.cwd();function parseFlags(e){return{json:e.includes("--json"),verbose:e.includes("--verbose")}}async function resolveKit(e){const t={promptMessage:"Which kit to check?",nonTtyHint:"Pick one with `agentkit doctor` in a terminal, or cd into a project."};if(!e)return(0,kit_context_1.resolveContext)(targetDir,t);const n=console.log;console.log=(...o)=>{process.stderr.write(`${o.join(" ")}
3
- `)};try{return await(0,kit_context_1.resolveContext)(targetDir,t)}finally{console.log=n}}function runChecks(e,t){return[...(0,checks_entitlement_1.checkEntitlementGroup)(),...(0,checks_install_1.checkInstall)(e,repoRoot),...(0,checks_install_1.checkStore)(),...(0,checks_install_1.checkVersion)(e,t),...(0,checks_install_1.checkStructure)(e),...(0,checks_soul_1.checkSoul)(e,repoRoot),...(0,checks_rules_1.checkRules)(e,repoRoot),...(0,checks_skills_1.checkSkills)(e,repoRoot),...(0,checks_hooks_1.checkHooks)(e,repoRoot),...(0,checks_semantic_1.checkSemanticDecision)(e)]}function printHelp(){console.log(`
4
- Agentkit Doctor
5
- Report the health and integrity of an installed AI development kit
6
-
7
- Usage:
8
- agentkit doctor [options]
9
-
10
- Options:
11
- --verbose Include passing checks in the output
12
- --json Output machine-readable JSON CheckResult[]
13
- --help, -h Show this help message
14
-
15
- Examples:
16
- agentkit doctor # Check health of the detected kit
17
- agentkit doctor --verbose # Show all passing, warning, and failed checks
18
- agentkit doctor --json # Machine-readable output for CI/automation
19
- `)}async function main(){const e=process.argv.slice(2);if(e.includes("--help")||e.includes("-h")||e.includes("help")){printHelp();return}const t=parseFlags(e),n=await resolveKit(t.json);n||process.exit(1);const o=runChecks(n,(0,install_profile_config_1.readCliVersion)(repoRoot));if(t.json)process.stdout.write(`${(0,render_1.renderJson)(o)}
20
- `);else{console.log("");for(const r of(0,render_1.renderText)(o,t.verbose))console.log(r);console.log("")}process.exit((0,types_1.exitCodeFor)(o))}main();
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(o,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(o,t,n)}):(function(o,e,i,t){t===void 0&&(t=i),o[t]=e[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(o,e){Object.defineProperty(o,"default",{enumerable:!0,value:e})}):function(o,e){o.default=e}),__importStar=this&&this.__importStar||(function(){var o=function(e){return o=Object.getOwnPropertyNames||function(i){var t=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[t.length]=n);return t},o(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var t=o(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});const path=__importStar(require("path")),p=__importStar(require("@clack/prompts")),agentkit_config_file_1=require("./lib/agentkit-config-file"),hook_toggle_registry_1=require("./lib/hook-toggle-registry"),home_dir_1=require("./lib/home-dir"),hooks_write_policy_1=require("./lib/hooks-write-policy"),kit_context_1=require("./lib/kit-context"),init_install_scope_1=require("./lib/init-install-scope"),kits_1=require("./lib/kits"),logger_1=require("./lib/logger"),scriptDir=__dirname,repoRoot=path.dirname(scriptDir),targetDir=process.cwd();function effectiveValue(o,e){const i=e[o.name];return i===!1?!1:i===!0?!0:i&&typeof i=="object"&&i.enabled===!1?!1:o.defaultEnabled}function closeMatches(o,e){const i=o.toLowerCase();return e.filter(t=>t.includes(i)||i.includes(t)||t.slice(0,3)===i.slice(0,3)).slice(0,5)}function printHelp(){console.log(`
3
- Agentkit Hooks Manager
4
- See and set hook toggles in .agentkit.json
5
-
6
- Usage:
7
- agentkit hooks <command> [options]
8
- agentkit hooks pick toggles interactively
9
-
10
- Commands:
11
- list One kit's toggles; picks the kit when it has to
12
- enable <name...> Turn one or more hooks on
13
- disable <name...> Turn one or more hooks off
14
- enable --all Turn EVERY hook of the target kit on
15
- disable --all Turn EVERY hook of the target kit off
16
- help Show this help message
17
-
18
- Options:
19
- --kit <name> Target one kit by name, whatever the cwd
20
- --global Every global install, rather than one kit
21
- --all Write the master switch instead of named hooks
22
- --help, -h Show this help message
23
-
24
- Examples:
25
- agentkit hooks list # Pick a kit, see its toggles
26
- agentkit hooks list --kit omp # omp's toggles, no prompt
27
- agentkit hooks list --global # Every global kit
28
- agentkit hooks disable --kit omp language-guard
29
- agentkit hooks disable scout-block # The kit resolved from this directory
30
- agentkit hooks disable --all # Master switch: every hook, one command
31
- agentkit hooks # Interactive picker (asks which kit)
32
-
33
- The master switch is \`hooksEnabled\`, top-level in .agentkit.json. \`false\` turns
34
- every hook of that install off, whatever the per-hook keys say; the per-hook
35
- values are kept, so \`enable --all\` restores the kit to exactly what it was.
36
- `)}function usage(){(0,logger_1.printInfo)("Usage:"),(0,logger_1.printInfo)(" agentkit hooks pick toggles interactively"),(0,logger_1.printInfo)(" agentkit hooks list one kit \u2014 picks it when it has to"),(0,logger_1.printInfo)(" agentkit hooks list --kit <name> one named kit, no prompt"),(0,logger_1.printInfo)(" agentkit hooks list --global every global install"),(0,logger_1.printInfo)(" agentkit hooks enable <name\u2026> turn one or more hooks on"),(0,logger_1.printInfo)(" agentkit hooks disable <name\u2026> turn one or more hooks off"),(0,logger_1.printInfo)(" agentkit hooks enable --all master switch: every hook on"),(0,logger_1.printInfo)(" agentkit hooks disable --all master switch: every hook off"),(0,logger_1.printInfo)(" agentkit hooks help show full help message"),(0,logger_1.printInfo)(""),(0,logger_1.printInfo)("Options:"),(0,logger_1.printInfo)(" --kit <name> target one kit by name, whatever the cwd"),(0,logger_1.printInfo)(" --global global installs only"),(0,logger_1.printInfo)(" --all the master switch, not named hooks")}function contextLabel(o,e){const i=`${kits_1.kitDefinitions[o.kit].name} (${o.scope})`;return e?`${i} \u2014 ${logger_1.chalk.dim(o.configPath)}`:i}function printToggleTable(o,e){const i=(0,agentkit_config_file_1.readSection)((0,agentkit_config_file_1.readKitConfig)(e.configPath),"hooks");(0,agentkit_config_file_1.readHooksEnabled)(e.configPath)||console.log(` ${logger_1.chalk.red("DISABLED")} ${logger_1.chalk.bold("all hooks")} ${logger_1.chalk.dim("(hooksEnabled: false \u2014 every row below is off)")}`);let n=!1;for(const s of o){const l=effectiveValue(s,i)?logger_1.chalk.green("enabled "):logger_1.chalk.red("disabled"),a=s.name in i?"":logger_1.chalk.dim(" (default)"),k=s.readBy.has(e.kit)?"":logger_1.chalk.yellow(` \u2014 not read by ${e.kit}`);k&&(n=!0),console.log(` ${l} ${s.name}${a}${k}`)}return n}function printLists(o,e,i={}){const{note:t}=i,n=e.length>1;let s=!1;for(const h of e)(0,logger_1.printSection)(`Hook toggles \u2014 ${contextLabel(h,n)}`),console.log(""),printToggleTable(o,h)&&(s=!0),console.log("");s&&((0,logger_1.printInfo)(logger_1.chalk.dim("A toggle this kit does not read is still written. Re-installing the same kit keeps it; switching this project to another kit deletes it with the old kit.")),console.log("")),t&&((0,logger_1.printInfo)(logger_1.chalk.dim(t)),console.log(""))}const SHOW_ALL="__all__";async function pickKitsToList(o){if(!process.stdout.isTTY||o.length<=1)return null;const e=n=>`${n.kit}:${n.scope}`,i=await p.select({message:"Which kit?",options:[...o.map(n=>({value:e(n),label:contextLabel(n,!0)})),{value:SHOW_ALL,label:`Show every kit (${o.length})`}]});if(p.isCancel(i)||i===SHOW_ALL)return null;const t=o.find(n=>e(n)===i);return t?[t]:null}function listNote(o,e,i){const t=[],n=o!==null&&o.length===1?o[0]:null,s=i.length===1?i[0]:null,h=l=>n!==null&&n.kit===l.kit&&n.scope===l.scope;if(o===null&&e.length>1&&t.push(process.stdout.isTTY?`Every installed kit (${e.length}) is shown.`:`Every installed kit (${e.length}) is shown: no terminal here to ask which one.`),s!==null&&!h(s)){const l=`${kits_1.kitDefinitions[s.kit].name} (${s.scope})`;t.push(n!==null?`A bare enable/disable here writes ${l} instead. Use \`--kit ${n.kit}\` to write the kit on screen.`:`A bare enable/disable here writes ${l}.`)}else s===null&&n!==null?t.push(`Use \`--kit ${n.kit}\` to enable or disable what is on screen.`):s===null&&i.length>1&&t.push(process.stdout.isTTY?"A bare enable/disable would ask which kit; --kit <name> answers it instead.":"A bare enable/disable cannot choose between them without a terminal, and refuses; --kit <name> names one instead.");return t.length>0?t.join(" "):void 0}function contextFor(o,e,i=[]){const t=o.trim().toLowerCase(),n=e.filter(s=>s.kit===t);if(n.length===0){const s=[...new Set(e.map(l=>l.kit))].sort();(0,logger_1.printError)(`No install of \`${t}\` found.`),(0,logger_1.printInfo)(`Installed here: ${s.length>0?s.join(", "):"(none)"}`);const h=[...new Set(i.filter(l=>l.kit===t).map(l=>l.scope))].sort();return h.length>0&&(0,logger_1.printInfo)(`\`${t}\` is installed at ${h.join(" and ")} scope \u2014 drop the scope flag to reach it.`),null}if(n.length>1){(0,logger_1.printError)(`\`${t}\` is installed at both scopes \u2014 say which with --global.`);for(const s of n)(0,logger_1.printInfo)(` ${s.scope}: ${s.configPath}`);return null}return n[0]}function allContexts(o){const i=(0,home_dir_1.isHomeDir)(o)?[]:kit_context_1.GLOBAL_KITS.filter(n=>(0,init_install_scope_1.isKitInstalledInProject)(n,o)).map(n=>(0,kit_context_1.projectContext)(n,o)),t=kit_context_1.GLOBAL_KITS.filter(n=>(0,init_install_scope_1.isKitInstalledGlobally)(n)).map(kit_context_1.globalContext);return[...i,...t]}function applyToggle(o,e,i,t){const n=i.map(a=>a.name),s=o.filter(a=>!n.includes(a));if(s.length>0){(0,logger_1.printError)(`Unknown hook(s): ${s.join(", ")}`);for(const a of s){const k=closeMatches(a,n);k.length>0&&(0,logger_1.printInfo)(`Did you mean (for ${a}): ${k.join(", ")}?`)}return(0,logger_1.printInfo)("Run `agentkit hooks list` to see every toggle."),1}const h=kits_1.kitDefinitions[t.kit].name,l=[];for(const a of o){const k=i.find(f=>f.name===a),r=(0,hooks_write_policy_1.decideWrite)(t.kit,t.scope,a,k.readBy,h);if(!r.allowed)return(0,logger_1.printError)(r.reason),(0,logger_1.printInfo)(`Run instead: ${r.hint}`),1;r.warning&&l.push(r.warning)}(0,agentkit_config_file_1.updateSection)(t.configPath,"hooks",a=>{for(const k of o){const r=a[k];r&&typeof r=="object"?r.enabled=e:a[k]=e}});for(const a of l)(0,logger_1.printWarning)(a);for(const a of o)(0,logger_1.printSuccess)(`${e?"Enabled":"Disabled"} ${a} for ${h} (${t.scope}).`);return(0,logger_1.printInfo)(logger_1.chalk.dim(t.configPath)),e&&!(0,agentkit_config_file_1.readHooksEnabled)(t.configPath)&&(0,logger_1.printWarning)(`The master switch is off for ${h}, so ${o.length===1?"this hook stays":"these hooks stay"} off until you run \`agentkit hooks enable --all\`.`),0}function applyMasterSwitch(o,e,i,t){if(o.length>0)return(0,logger_1.printError)("`--all` writes every hook of a kit, so it cannot be combined with a name."),(0,logger_1.printInfo)(`Drop either the flag or \`${o[0]}\`: \`agentkit hooks ${e?"enable":"disable"} --all\``),1;const n=kits_1.kitDefinitions[t.kit].name;return i.some(s=>s.readBy.has(t.kit))||(0,logger_1.printWarning)(`${n} ships no code that reads a hook toggle \u2014 setting the master switch here has no effect on this kit today.`),(0,agentkit_config_file_1.writeHooksEnabled)(t.configPath,e),(0,logger_1.printSuccess)(e?`Every hook enabled for ${n} (${t.scope}).`:`Every hook disabled for ${n} (${t.scope}).`),(0,logger_1.printInfo)(logger_1.chalk.dim(t.configPath)),e||(0,logger_1.printInfo)(logger_1.chalk.dim("Per-hook values are untouched, so `agentkit hooks enable --all` restores them.")),0}async function pickToggles(o,e,i){const t=(0,agentkit_config_file_1.readSection)((0,agentkit_config_file_1.readKitConfig)(e.configPath),"hooks"),n="__master__",s=await p.multiselect({message:`Hooks for ${contextLabel(e,!1)}`,options:[{value:n,label:i?"All hooks \u2014 enabled":"All hooks \u2014 DISABLED",hint:"master switch"},...o.map(c=>{const g=effectiveValue(c,t),u=c.readBy.has(e.kit)?"":` (not read by ${e.kit})`;return{value:c.name,label:`${c.name}${u}`,hint:g?"enabled":"disabled"}})],initialValues:[...i?[n]:[],...o.filter(c=>effectiveValue(c,t)).map(c=>c.name)],required:!1});if(p.isCancel(s))return(0,logger_1.printInfo)("Cancelled \u2014 nothing written."),0;const h=s,l=h.includes(n),a=new Set(h.filter(c=>c!==n));let k=0;l!==i&&((0,agentkit_config_file_1.writeHooksEnabled)(e.configPath,l),k+=1);const r=o.filter(c=>effectiveValue(c,t)!==a.has(c.name));r.length>0&&((0,agentkit_config_file_1.updateSection)(e.configPath,"hooks",c=>{for(const g of r){const u=c[g.name];u&&typeof u=="object"?u.enabled=a.has(g.name):c[g.name]=a.has(g.name)}}),k+=r.length);const f=kits_1.kitDefinitions[e.kit].name;return k===0?((0,logger_1.printInfo)(`No change \u2014 ${f} (${e.scope}) is already in that state.`),0):((0,logger_1.printSuccess)(`Updated ${k} setting${k===1?"":"s"} for ${f} (${e.scope}).`),(0,logger_1.printInfo)(logger_1.chalk.dim(e.configPath)),0)}async function main(){const o=process.argv.slice(2);if(o.includes("--help")||o.includes("-h")||o[0]==="help"||o[1]==="help"||o[1]==="--help"||o[1]==="-h"){printHelp();return}const[,e,...i]=o;if(!e){process.stdout.isTTY||(usage(),process.exit(0));const r=await(0,kit_context_1.resolveContext)(targetDir,{promptMessage:"Which kit to configure?",nonTtyHint:"Pick one with `agentkit hooks list`, or cd into a project."});r||process.exit(1);const f=(0,hook_toggle_registry_1.hookRegistry)(repoRoot);process.exit(await pickToggles(f,r,(0,agentkit_config_file_1.readHooksEnabled)(r.configPath)))}["list","enable","disable"].includes(e)||((0,logger_1.printError)(`Unknown subcommand: ${e}`),usage(),process.exit(1));const t=i.findIndex(r=>r==="--kit"||r.startsWith("--kit=")),n=i.includes("--global"),s=i.includes("--all");let h=null;if(t!==-1){const r=i[t];h=r.includes("=")?r.slice(r.indexOf("=")+1):i[t+1]??"",h||((0,logger_1.printError)("--kit needs a kit name, e.g. `--kit omp`."),process.exit(1))}const l=i.filter((r,f)=>!r.startsWith("--kit")&&r!=="--global"&&r!=="--all"&&!(t!==-1&&!i[t].includes("=")&&f===t+1));if(h!==null||n){const r=allContexts(targetDir),f=r.filter(d=>n?d.scope==="global":!0);f.length===0&&(n&&r.length>0?((0,logger_1.printError)("No global AgentKit install detected."),(0,logger_1.printInfo)("This machine has a project install only. Run `agentkit init --global` first.")):(0,logger_1.printError)("No AgentKit install detected. Run `agentkit init` first."),process.exit(1));const c=h!==null?contextFor(h,f,r):null;h!==null&&c===null&&process.exit(1);const g=c??(f.length===1?f[0]:null);if(g!==null){const d=(0,hook_toggle_registry_1.hookRegistry)(repoRoot);if(e==="list"){printLists(d,[g],{note:c!==null?listNote([c],[c],(0,kit_context_1.candidateContexts)(targetDir)):void 0});return}s&&process.exit(applyMasterSwitch(l,e==="enable",d,g)),l.length===0&&((0,logger_1.printError)(`\`agentkit hooks ${e}\` needs at least one hook name.`),usage(),process.exit(1)),process.exit(applyToggle(l,e==="enable",d,g))}const u=(0,hook_toggle_registry_1.hookRegistry)(repoRoot);if(e==="list"){printLists(u,f,{note:`Every global kit (${f.length}); --kit <name> narrows it to one.`});return}(0,logger_1.printError)(`--global names ${f.length} kits, so it cannot choose which to write.`),(0,logger_1.printInfo)(`Add --kit <name>: ${[...new Set(f.map(d=>d.kit))].sort().join(", ")}`),process.exit(1)}if(e==="list"){const r=(0,hook_toggle_registry_1.hookRegistry)(repoRoot),f=allContexts(targetDir);f.length===0&&((0,logger_1.printError)("No AgentKit install detected. Run `agentkit init` first."),process.exit(1));const c=await pickKitsToList(f),g=(0,kit_context_1.candidateContexts)(targetDir);printLists(r,c??f,{note:listNote(c,f,g)});return}const a=await(0,kit_context_1.resolveContext)(targetDir,{promptMessage:"Which kit to configure?",nonTtyHint:"Pick one with `agentkit hooks list`, or cd into a project."});a||process.exit(1);const k=(0,hook_toggle_registry_1.hookRegistry)(repoRoot);s&&process.exit(applyMasterSwitch(l,e==="enable",k,a)),l.length===0&&((0,logger_1.printError)(`\`agentkit hooks ${e}\` needs at least one hook name.`),usage(),process.exit(1)),process.exit(applyToggle(l,e==="enable",k,a))}main();
@@ -1,39 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,i,r){r===void 0&&(r=i);var o=Object.getOwnPropertyDescriptor(t,i);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,r,o)}):(function(e,t,i,r){r===void 0&&(r=i),e[r]=t[i]})),__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(i){var r=[];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[r.length]=o);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var r=e(t),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(i,t,r[o]);return __setModuleDefault(i,t),i}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseProfileFlag=exports.parseKitFlag=exports.parseGlobalFlag=exports.parseForceSharedRootFlag=exports.parseAgentModelsFlag=void 0,exports.otherKitGitignoreEntries=otherKitGitignoreEntries;const chalk_1=__importDefault(require("chalk")),fs=__importStar(require("fs")),path=__importStar(require("path")),codegraph_installer_1=require("./lib/codegraph-installer"),home_dir_1=require("./lib/home-dir"),gitignore_1=require("./lib/gitignore"),init_install_scope_1=require("./lib/init-install-scope"),kit_install_dispatch_1=require("./lib/kit-install-dispatch"),profile_context_1=require("./lib/kit-installers/profile-context"),install_manifest_1=require("./lib/install-manifest"),install_registry_1=require("./lib/install-registry"),kit_context_1=require("./lib/kit-context"),kit_scan_1=require("./lib/kit-scan"),kit_remover_1=require("./lib/kit-remover"),kit_switch_confirm_1=require("./lib/kit-switch-confirm"),kits_1=require("./lib/kits"),install_profile_config_1=require("./lib/install-profile-config"),skill_profiles_1=require("./lib/skill-profiles"),profile_switch_confirm_1=require("./lib/profile-switch-confirm"),logger_1=require("./lib/logger"),ui_1=require("./lib/ui"),init_global_plan_1=require("./lib/init-global-plan"),claude_agents_1=require("./lib/kit-installers/claude-agents"),init_args_1=require("./lib/init-args");Object.defineProperty(exports,"parseAgentModelsFlag",{enumerable:!0,get:function(){return init_args_1.parseAgentModelsFlag}}),Object.defineProperty(exports,"parseForceSharedRootFlag",{enumerable:!0,get:function(){return init_args_1.parseForceSharedRootFlag}}),Object.defineProperty(exports,"parseGlobalFlag",{enumerable:!0,get:function(){return init_args_1.parseGlobalFlag}}),Object.defineProperty(exports,"parseKitFlag",{enumerable:!0,get:function(){return init_args_1.parseKitFlag}}),Object.defineProperty(exports,"parseProfileFlag",{enumerable:!0,get:function(){return init_args_1.parseProfileFlag}});const scriptDir=__dirname,envSourceRoot=process.env.AGENTKIT_SOURCE_ROOT,repoRoot=envSourceRoot&&fs.existsSync(path.join(envSourceRoot,"package.json"))?envSourceRoot:path.dirname(scriptDir),targetDir=process.cwd();function recordInstall(e,t,i,r){try{(0,install_registry_1.upsertInstall)({path:i,kit:e,scope:t,kitRoot:r,...cliVersion?{version:cliVersion}:{}})}catch{}}const cliVersion=(0,install_profile_config_1.readCliVersion)(repoRoot),globalConfigDir=init_install_scope_1.kitDirWithinGlobalRoot;function stampKit(e){cliVersion&&(0,install_profile_config_1.stampInstallVersion)(e,cliVersion)}function otherKitGitignoreEntries(e){const t=kits_1.kitDefinitions[e],i=[];for(const r of kit_scan_1.PROJECT_KITS){const o=kits_1.kitDefinitions[r];o.dir!==t.dir&&i.push(o.dir+"/");for(const g of o.files)t.files.includes(g)||i.push(g)}return i}async function runGlobalInstall(e,t,i,r=!1){let o;if(i)(0,kits_1.supportsGlobalInstall)(i)||((0,logger_1.printError)(`${kits_1.kitDefinitions[i].name} does not support global install \u2014 it installs into a project checkout.`),process.exit(1)),o=[i];else{const n=await(0,ui_1.selectKitsGlobal)();if(n===null){(0,logger_1.printInfo)("Installation cancelled.");return}if(o=n.filter(kits_1.supportsGlobalInstall),o.length===0){(0,logger_1.printInfo)("No kits selected \u2014 nothing to install.");return}}const{plans:g,skipped:I}=await(0,init_global_plan_1.planGlobalInstalls)(o,targetDir,{agentModelsFlag:t,skipRootPrompt:i!==void 0});if(g.length===0){console.log(""),(0,logger_1.printInfo)("Nothing left to install.");return}const m=[],S=g.map(({kit:n,hermesProfile:a,agentModels:b,globalRoot:l})=>{const _=l??(0,init_install_scope_1.resolveGlobalRoot)(n,targetDir,a),u=path.join(globalConfigDir(n,_),".agentkit.json"),c=fs.existsSync(u),f=(0,install_profile_config_1.readInstallSettings)(u),p=path.join(globalConfigDir(n,_),kit_context_1.KIT_GLOBAL_SKILLS_DIR[n]),d=(0,skill_profiles_1.resolveEffectiveProfile)(e,c||(0,init_install_scope_1.destHasSkillDirs)(p),f.profile,n),h=(0,install_profile_config_1.hasPersistedProfile)(u)&&f.profile!==d;return{kit:n,hermesProfile:a,agentModels:b,globalRoot:_,kitConfigPath:u,isUpdate:c,persisted:f,effectiveProfile:d,profileChanged:h}});for(const n of S){if(!n.profileChanged)continue;const a=await(0,profile_switch_confirm_1.confirmProfileSwitch)({existingProfile:n.persisted.profile,newProfile:n.effectiveProfile,kitConfigPath:n.kitConfigPath,kitName:kits_1.kitDefinitions[n.kit].name,targetDir:n.globalRoot});if(!a.proceed){(0,logger_1.printInfo)("Profile switch cancelled. Nothing was changed."),a.reason==="non-tty"&&(process.exitCode=1);return}}for(const{kit:n,agentModels:a,globalRoot:b,kitConfigPath:l,isUpdate:_,persisted:u,effectiveProfile:c,profileChanged:f}of S){const p=_&&!f?u.extraSkills:[],d=(0,kit_install_dispatch_1.installGlobalKit)(n,repoRoot,b,(0,skill_profiles_1.resolveSkipDirs)(repoRoot,c,p),{...n==="claude"?{agentModels:a}:{},...r?{allowSharedRoot:!0}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(repoRoot,c)});d.ok||((0,logger_1.printError)(d.reason),process.exit(1)),stampKit(l),(0,install_profile_config_1.writeInstallSettings)(l,{profile:c,extraSkills:p,...a?{agentModels:a}:{}}),recordInstall(n,"global",globalConfigDir(n,b),globalConfigDir(n,b)),(0,logger_1.printInfo)(chalk_1.default.dim(`Install profile: ${c}`)),a&&(0,logger_1.printInfo)(chalk_1.default.dim(`Agent models: ${a}`)),await(0,codegraph_installer_1.maybeInstallCodegraph)(n,"global",targetDir),(0,install_manifest_1.writeManifest)((0,kit_context_1.globalContext)(n),cliVersion),m.push(kits_1.kitDefinitions[n].name)}console.log(""),m.length>0&&((0,logger_1.printSection)("Installation Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" Installed globally: "+chalk_1.default.green(m.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(""))}function printHelp(){console.log(`
3
- Agentkit Installer
4
- Initialize AI development kit (project or global)
5
-
6
- Usage:
7
- agentkit init [kit] [options]
8
-
9
- Arguments:
10
- [kit] Target a specific kit directly (${kits_1.ALL_KIT_NAMES.join(", ")})
11
-
12
- Options:
13
- --global, -g Install globally regardless of current directory
14
- --profile <name> Install only skills for a profile (${skill_profiles_1.PROFILES.join(", ")})
15
- Run \`agentkit help profile\` for what each one installs
16
- --agent-models <mode> Claude Code only: ${claude_agents_1.CLAUDE_AGENT_MODELS.join(" | ")} (default pinned)
17
- --force-shared-root Proceed when this kit's global root already holds another kit
18
- --ref <ref> Install the payload from a specific tag/branch/sha (dev)
19
- --help, -h Show this help message
20
-
21
- Supported Platforms:
22
- Claude Code, Cursor AI, Augment Code, Antigravity, OpenCode,
23
- OpenAI Codex, Kimi CLI, Hermes Agent, OpenClaw, Oh My Pi, Grok Build, Pi,
24
- Devin CLI
25
-
26
- Scope:
27
- - Inside a project directory: installs into the current project (single kit)
28
- - Inside home directory (~): installs globally (supports selecting multiple kits)
29
- - With [kit]: directly targets that kit without the interactive selection menu
30
- - With --global / -g: forces global installation for the targeted kit
31
-
32
- Examples:
33
- agentkit init # Interactive installer
34
- agentkit init claude # Initialize Claude Code directly
35
- agentkit init claude --agent-models # Initialize Claude Code with model selection prompt
36
- agentkit init cursor --profile full # Initialize Cursor with full profile
37
- agentkit init omp # Initialize Oh My Pi globally
38
- agentkit init hermes # Initialize Hermes Agent globally
39
- `)}async function main(){const e=process.argv.slice(2);if(e.includes("--help")||e.includes("-h")||e.includes("help")){printHelp();return}const t=e[0]==="init"||e[0]?.endsWith(".test.ts")?e.slice(1):e;(0,logger_1.printBanner)();const i=(0,init_args_1.parseKitFlag)(t);i.invalid&&((0,logger_1.printError)(`Unknown kit: "${i.invalid}".`),(0,logger_1.printInfo)(`Supported kits: ${kits_1.ALL_KIT_NAMES.join(", ")}.`),process.exit(1));const r=i.kit,o=(0,init_args_1.parseProfileFlag)(t);o==="invalid"&&((0,logger_1.printError)(`Unknown --profile value. Choose one of: ${skill_profiles_1.PROFILES.join(", ")}.`),process.exit(1));const g=o==="prompt"?process.stdout.isTTY?await(0,ui_1.selectProfile)():null:o,I=(0,init_args_1.parseAgentModelsFlag)(t);I==="invalid"&&((0,logger_1.printError)(`Unknown --agent-models value. Choose one of: ${claude_agents_1.CLAUDE_AGENT_MODELS.join(", ")}.`),process.exit(1));const m=I,S=(0,init_args_1.parseGlobalFlag)(t),n=(0,init_args_1.parseForceSharedRootFlag)(t);(0,ui_1.showMenu)(targetDir);const a=(0,home_dir_1.isHomeDir)(targetDir);if(S||a||r!==null&&kits_1.GLOBAL_ONLY_INSTALL_KITS.includes(r)){await runGlobalInstall(g,m,r??void 0,n);return}const l=r??await(0,ui_1.selectKit)(targetDir);if(!l){(0,logger_1.printInfo)("Installation cancelled.");return}if(!(0,kits_1.isHostInstalled)(l)&&!await(0,ui_1.confirmUndetectedHost)(kits_1.kitDefinitions[l].name)){(0,logger_1.printInfo)("Installation cancelled.");return}await(0,init_install_scope_1.confirmProjectInstallIfNeeded)(targetDir)||((0,logger_1.printError)("Installation cancelled."),process.exit(0));const u=kit_scan_1.PROJECT_KITS.filter(s=>(0,init_install_scope_1.isKitInstalledInProject)(s,targetDir)),c=u.includes(l),f=u.filter(s=>s!==l);if(c&&(console.log(""),(0,logger_1.printSection)("Update Mode"),(0,logger_1.printInfo)(chalk_1.default.bold("Updating")+" "+chalk_1.default.yellow.bold(kits_1.kitDefinitions[l].name)+" kit..."),console.log("")),f.length>0){console.log(""),(0,logger_1.printSection)("Switch Mode"),(0,logger_1.printWarning)(chalk_1.default.bold("Switching")+" from "+chalk_1.default.yellow(f.map(x=>kits_1.kitDefinitions[x].name).join(", "))+" to "+chalk_1.default.green.bold(kits_1.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)(f,l,targetDir);s.proceed||(s.reason==="declined"&&((0,logger_1.printInfo)("Installation cancelled. Nothing was removed."),process.exit(0)),process.exit(1))}const p=path.join(targetDir,kits_1.kitDefinitions[l].dir,".agentkit.json"),d=(0,install_profile_config_1.readInstallSettings)(p),h=(0,skill_profiles_1.resolveEffectiveProfile)(g,c||(0,init_install_scope_1.destHasSkillDirs)((0,kit_context_1.projectContext)(l,targetDir).destSkillsDir),d.profile,l),P=c&&(0,install_profile_config_1.hasPersistedProfile)(p)&&d.profile!==h;if(P){const s=await(0,profile_switch_confirm_1.confirmProfileSwitch)({existingProfile:d.profile,newProfile:h,kitConfigPath:p,kitName:kits_1.kitDefinitions[l].name,targetDir});s.proceed||((0,logger_1.printInfo)("Profile switch cancelled. Nothing was changed."),process.exit(s.reason==="non-tty"?1:0))}const v=c&&!P?d.extraSkills:[],y=(0,skill_profiles_1.resolveSkipDirs)(repoRoot,h,v),w=otherKitGitignoreEntries(l);w.length>0&&((0,logger_1.printProgress)("Cleaning up .gitignore entries from other kits..."),(0,gitignore_1.cleanupGitignore)(w,targetDir));for(const s of f)(0,logger_1.printProgress)(`Removing ${kits_1.kitDefinitions[s].name}...`),(0,kit_remover_1.removeKit)(s,targetDir)?(0,logger_1.printSuccess)(`${kits_1.kitDefinitions[s].name} removed`):(0,logger_1.printWarning)(`Some files from ${kits_1.kitDefinitions[s].name} may not have been removed`);f.length>0&&console.log("");const k=l==="claude"?await(0,claude_agents_1.resolveClaudeAgentModelsForInstall)(m,d.agentModels,ui_1.selectClaudeAgentModels,process.stdout.isTTY):void 0,C=(0,kit_install_dispatch_1.installProjectKit)(l,repoRoot,targetDir,y,{...k?{agentModels:k}:{},profileContext:(0,profile_context_1.buildProfileInstallContext)(repoRoot,h)});C.ok||((0,logger_1.printError)(C.reason),process.exit(1)),stampKit(p),recordInstall(l,"project",targetDir,path.dirname(p)),(0,install_profile_config_1.writeInstallSettings)(p,{profile:h,extraSkills:v,...k?{agentModels:k}:{}}),(0,logger_1.printInfo)(chalk_1.default.dim(`Install profile: ${h}`)),k&&(0,logger_1.printInfo)(chalk_1.default.dim(`Agent models: ${k}`)),(0,install_manifest_1.writeManifest)((0,kit_context_1.projectContext)(l,targetDir),cliVersion),console.log(""),c?((0,logger_1.printSection)("Update Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" "+kits_1.kitDefinitions[l].name+" updated successfully!")):((0,logger_1.printSection)("Installation Complete"),(0,logger_1.printSuccess)(chalk_1.default.bold("\u2713")+" "+kits_1.kitDefinitions[l].name+" installed successfully!")),await(0,codegraph_installer_1.maybeInstallCodegraph)(l,"project",targetDir),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("")}main().catch(e=>{(0,logger_1.printError)(`Error: ${e.message}`),process.exit(1)});
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const cli_1=require("./lib/auth/cli");async function main(){const e=process.argv.slice(2);if(e.includes("--help")||e.includes("-h")){console.log(`
3
- Agentkit Logout
4
- Remove the stored credential and entitlement cache
5
-
6
- Usage:
7
- agentkit logout
8
-
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.
12
- `);return}process.exit(await(0,cli_1.runLogout)())}main();