@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.
- package/CHANGELOG.md +69 -0
- package/README.md +2 -2
- package/bin/agentkit.js +1 -1
- package/package.json +2 -2
- package/scripts-dist/cli/agentkit-clear.js +18 -0
- package/scripts-dist/{agentkit-config.js → cli/agentkit-config.js} +3 -3
- package/scripts-dist/cli/agentkit-dashboard.js +19 -0
- package/scripts-dist/{agentkit-decide.js → cli/agentkit-decide.js} +1 -1
- package/scripts-dist/cli/agentkit-doctor.js +20 -0
- package/scripts-dist/cli/agentkit-hooks.js +36 -0
- package/scripts-dist/cli/agentkit-init.js +39 -0
- package/scripts-dist/{agentkit-login.js → cli/agentkit-login.js} +2 -2
- package/scripts-dist/cli/agentkit-logout.js +12 -0
- package/scripts-dist/cli/agentkit-profile.js +4 -0
- package/scripts-dist/cli/agentkit-skills.js +30 -0
- package/scripts-dist/cli/agentkit-status.js +22 -0
- package/scripts-dist/cli/agentkit-uninstall.js +18 -0
- package/scripts-dist/cli/agentkit-update.js +17 -0
- package/scripts-dist/{agentkit-whoami.js → cli/agentkit-whoami.js} +2 -2
- package/scripts-dist/gen/check-upstream.js +6 -0
- package/scripts-dist/gen/frontend-cli.js +4 -3
- package/scripts-dist/gen/generate-agentkit-configs.js +2 -0
- package/scripts-dist/gen/generate-catalogs.js +10 -0
- package/scripts-dist/{run-skill-tests.js → gen/run-skill-tests.js} +1 -1
- package/scripts-dist/gen/sync-gamedev-upstream.js +22 -0
- package/scripts-dist/gen/sync-upstream.js +1 -0
- package/scripts-dist/gen/update-check-worker.js +2 -0
- package/scripts-dist/gen/upstream-skill-syncers.js +5 -0
- package/scripts-dist/gen/upstream-suite-syncers.js +12 -0
- package/scripts-dist/{validate-agents-registry.js → gen/validate-agents-registry.js} +1 -1
- package/scripts-dist/lib/agentkit-config-file.js +2 -2
- package/scripts-dist/lib/auth/cli.js +1 -1
- package/scripts-dist/lib/clear/cli.js +4 -0
- package/scripts-dist/lib/cli.js +3 -0
- package/scripts-dist/lib/codegraph-installer/mcp-sync.js +1 -1
- package/scripts-dist/lib/doctor/checks-hooks.js +2 -2
- package/scripts-dist/lib/doctor/checks-rules.js +1 -1
- package/scripts-dist/lib/doctor/checks-skills.js +1 -1
- package/scripts-dist/lib/doctor/checks-soul.js +1 -1
- package/scripts-dist/lib/doctor/profile-resolution.js +1 -1
- package/scripts-dist/lib/dropped-mcp-servers.js +1 -1
- package/scripts-dist/lib/file-operations.js +2 -2
- package/scripts-dist/lib/frontmatter.js +2 -0
- package/scripts-dist/lib/gitignore.js +5 -5
- package/scripts-dist/lib/global-clear-targets.js +1 -1
- package/scripts-dist/lib/hook-toggle-registry.js +1 -1
- package/scripts-dist/lib/hooks/cli.js +1 -0
- package/scripts-dist/lib/init/cli.js +1 -0
- package/scripts-dist/lib/install-profile-config.js +1 -1
- package/scripts-dist/lib/kit-install-dispatch.js +1 -1
- package/scripts-dist/lib/kit-remover.js +1 -1
- package/scripts-dist/lib/kit-scan.js +1 -1
- package/scripts-dist/lib/kits.js +1 -1
- package/scripts-dist/lib/payload/extract.js +1 -1
- package/scripts-dist/lib/payload/retention.js +1 -1
- package/scripts-dist/lib/payload-roots.js +1 -0
- package/scripts-dist/lib/profile-block.js +2 -2
- package/scripts-dist/lib/profile-remove.js +1 -1
- package/scripts-dist/lib/profile-rules.js +1 -1
- package/scripts-dist/lib/profile-switch-confirm.js +1 -1
- package/scripts-dist/lib/publish/payload-manifest.js +1 -1
- package/scripts-dist/lib/publish/public-client-manifest.js +1 -1
- package/scripts-dist/lib/server/kit-actions.js +1 -1
- package/scripts-dist/lib/skill-profiles.js +1 -1
- package/scripts-dist/lib/skill-tests.js +1 -1
- package/scripts-dist/lib/skills/cli.js +1 -0
- package/scripts-dist/lib/skills/skill-companion-assets.js +6 -0
- package/scripts-dist/lib/skills/skills-context-options.js +1 -0
- package/scripts-dist/lib/ui.js +1 -1
- package/scripts-dist/lib/update/cli.js +4 -0
- package/scripts-dist/lib/update-notifier.js +1 -1
- package/scripts-dist/{build-hermes-distribution.js → ops/build-hermes-distribution.js} +1 -1
- package/scripts-dist/agentkit-clear.js +0 -21
- package/scripts-dist/agentkit-dashboard.js +0 -19
- package/scripts-dist/agentkit-doctor.js +0 -20
- package/scripts-dist/agentkit-hooks.js +0 -36
- package/scripts-dist/agentkit-init.js +0 -39
- package/scripts-dist/agentkit-logout.js +0 -12
- package/scripts-dist/agentkit-profile.js +0 -4
- package/scripts-dist/agentkit-skills.js +0 -25
- package/scripts-dist/agentkit-status.js +0 -22
- package/scripts-dist/agentkit-uninstall.js +0 -18
- package/scripts-dist/agentkit-update.js +0 -20
- package/scripts-dist/check-upstream.js +0 -6
- package/scripts-dist/generate-agentkit-configs.js +0 -2
- package/scripts-dist/generate-catalogs.js +0 -10
- package/scripts-dist/update-check-worker.js +0 -2
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,i,r){r===void 0&&(r=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(t,r,n)}):(function(t,e,i,r){r===void 0&&(r=i),t[r]=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 r=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&__createBinding(i,e,r[n]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0});const path=__importStar(require("path")),init_args_1=require("./lib/init-args"),kits_1=require("./lib/kits"),logger_1=require("./lib/logger"),profile_remove_1=require("./lib/profile-remove"),targetDir=process.cwd(),repoRoot=path.dirname(__dirname);function printHelp(){console.log(`Usage: agentkit profile remove [kit] [--global]
|
|
3
|
-
|
|
4
|
-
Remove a non-core install profile by reinstalling the kit with the core profile.`)}async function main(){const t=process.argv.slice(2),e=t[0]==="profile"?t.slice(1):t;if(e.includes("--help")||e.includes("-h"))return printHelp();if(e[0]!=="remove"){printHelp(),process.exitCode=1;return}const i=e.slice(1),r=(0,init_args_1.parseKitFlag)(i);if(r.invalid){(0,logger_1.printError)(`Unknown kit: "${r.invalid}". Supported kits: ${kits_1.ALL_KIT_NAMES.join(", ")}.`),process.exitCode=1;return}const n=(0,init_args_1.parseGlobalFlag)(i);if(n&&r.kit&&!(0,kits_1.supportsGlobalInstall)(r.kit)){(0,logger_1.printError)(`${kits_1.kitDefinitions[r.kit].name} does not support global install.`),process.exitCode=1;return}const o=(0,profile_remove_1.resolveRemovalContexts)(targetDir,r.kit,n);if(o.length===0){(0,logger_1.printError)("No matching AgentKit install detected."),process.exitCode=1;return}const{removals:s,proceed:l,refuseReason:a}=await(0,profile_remove_1.planProfileRemovals)(o);if(!l){a==="non-tty"&&(process.exitCode=1);return}for(const c of s)(0,profile_remove_1.applyProfileRemoval)(c,repoRoot,targetDir)||(process.exitCode=1)}main().catch(t=>{(0,logger_1.printError)(`Error: ${t.message}`),process.exitCode=1});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,i,t){t===void 0&&(t=i);var s=Object.getOwnPropertyDescriptor(e,i);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(n,t,s)}):(function(n,e,i,t){t===void 0&&(t=i),n[t]=e[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(i){var t=[];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[t.length]=s);return t},n(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var t=n(e),s=0;s<t.length;s++)t[s]!=="default"&&__createBinding(i,e,t[s]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0});const fs=__importStar(require("fs")),path=__importStar(require("path")),p=__importStar(require("@clack/prompts")),file_operations_1=require("./lib/file-operations"),install_profile_config_1=require("./lib/install-profile-config"),kit_context_1=require("./lib/kit-context"),kits_1=require("./lib/kits"),logger_1=require("./lib/logger"),install_manifest_1=require("./lib/install-manifest"),skills_remove_1=require("./lib/skills-remove"),skill_profiles_1=require("./lib/skill-profiles"),generate_catalogs_1=require("./generate-catalogs"),scriptDir=__dirname,repoRoot=path.dirname(scriptDir),targetDir=process.cwd(),soleContext=()=>(0,kit_context_1.soleContext)(targetDir),resolveContext=()=>(0,kit_context_1.resolveContext)(targetDir);function installedSkillNames(n){return fs.existsSync(n)?new Set(fs.readdirSync(n,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)):new Set}function closeMatches(n,e){const i=n.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 Skills Manager
|
|
4
|
-
Discover and install skills on top of the active profile
|
|
5
|
-
|
|
6
|
-
Usage:
|
|
7
|
-
agentkit skills [command] [options]
|
|
8
|
-
|
|
9
|
-
Commands:
|
|
10
|
-
(none) Pick skills to install (interactive in TTY)
|
|
11
|
-
list Show the full skill catalog grouped by category
|
|
12
|
-
add <name...> Install one or more named skills
|
|
13
|
-
remove <name...> Remove skills added with \`add\` and update config
|
|
14
|
-
help Show this help message
|
|
15
|
-
|
|
16
|
-
Options:
|
|
17
|
-
--help, -h Show this help message
|
|
18
|
-
|
|
19
|
-
Examples:
|
|
20
|
-
agentkit skills # Interactive skill picker
|
|
21
|
-
agentkit skills list # Print all available skills
|
|
22
|
-
agentkit skills add databases # Add databases skill to active kit
|
|
23
|
-
agentkit skills add gsap expo # Add multiple skills
|
|
24
|
-
agentkit skills remove databases # Remove a previously added skill
|
|
25
|
-
`)}function usage(){(0,logger_1.printInfo)("Usage:"),(0,logger_1.printInfo)(" agentkit skills pick skills to install (interactive)"),(0,logger_1.printInfo)(" agentkit skills list show the full skill catalog"),(0,logger_1.printInfo)(" agentkit skills add <name\u2026> install one or more named skills"),(0,logger_1.printInfo)(" agentkit skills remove <name\u2026> remove skills added with `add`"),(0,logger_1.printInfo)(" agentkit skills help show full help message")}function printList(n,e){(0,logger_1.printSection)(`Skill catalog (${n.length})`);const i=new Map;for(const t of n)(i.get(t.category)??i.set(t.category,[]).get(t.category)).push(t);for(const t of Object.keys(generate_catalogs_1.CATEGORY_TITLES)){const s=i.get(t);if(!(!s||s.length===0)){console.log(""),console.log(` ${generate_catalogs_1.CATEGORY_TITLES[t]} (${s.length})`);for(const l of s){const a=e.has(l.name)?" \u2713":" ",c=l.description?` \u2014 ${l.description}`:"";console.log(` ${a} ${l.name}${c}`)}}}console.log("")}function installSkills(n,e){const i=new Set(n),t=[...(0,skill_profiles_1.withDependencies)(n)].sort(),s=t.filter(r=>!fs.existsSync(path.join(repoRoot,"skills",r)));s.length>0&&((0,logger_1.printError)(`Cannot install: ${s.join(", ")} missing from the shipped skills/.`),process.exit(1)),fs.mkdirSync(e.destSkillsDir,{recursive:!0});for(const r of t){const f=path.join(repoRoot,"skills",r);(0,file_operations_1.copyDir)(f,path.join(e.destSkillsDir,r),{suppressSymlinkWarnings:!0})}const l=(0,install_profile_config_1.readInstallSettings)(e.configPath),a=[...new Set([...l.extraSkills,...t])].sort();(0,install_profile_config_1.writeInstallSettings)(e.configPath,{profile:l.profile,extraSkills:a});const c=(0,install_profile_config_1.readCliVersion)(repoRoot);c&&(0,install_profile_config_1.stampInstallVersion)(e.configPath,c),(0,install_manifest_1.writeManifest)(e,c);for(const r of n)(0,logger_1.printSuccess)(`Installed ${r} into ${kits_1.kitDefinitions[e.kit].name} (${e.scope}).`);for(const r of t.filter(f=>!i.has(f))){const f=n.filter(o=>(0,skill_profiles_1.withDependencies)([o]).has(r));(0,logger_1.printInfo)(`Also installed ${r} \u2014 required by ${f.join(", ")}.`)}(0,logger_1.printInfo)(`Recorded in install.extraSkills so re-install keeps them on the ${l.profile} profile.`)}async function removeSkills(n,e){const i=(0,install_profile_config_1.readInstallSettings)(e.configPath),{extras:t,profileOwned:s}=(0,skills_remove_1.planRemoval)(n,i.extraSkills);for(const o of s)(0,logger_1.printError)(`${o} comes from the ${i.profile} 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(t.length===0)return s.length>0?1:0;if(process.stdout.isTTY){const o=await p.confirm({message:`Delete ${t.map(d=>path.join(e.destSkillsDir,d)).join(", ")}?`,initialValue:!1});if(p.isCancel(o)||!o)return(0,logger_1.printInfo)("Nothing removed."),0}const l=(0,skills_remove_1.removeSkillDirs)(t,e.destSkillsDir);for(const o of l.rejected)(0,logger_1.printError)(`Refused to delete ${o}: it does not resolve inside ${e.destSkillsDir}.`);const a=[...l.removed,...l.missing],c=i.extraSkills.filter(o=>!a.includes(o));(0,install_profile_config_1.writeInstallSettings)(e.configPath,{profile:i.profile,extraSkills:c});const r=(0,install_profile_config_1.readCliVersion)(repoRoot);r&&(0,install_profile_config_1.stampInstallVersion)(e.configPath,r),(0,install_manifest_1.writeManifest)(e,r);for(const o of l.removed)(0,logger_1.printSuccess)(`Removed ${o} from ${kits_1.kitDefinitions[e.kit].name} (${e.scope}).`);for(const o of l.missing)(0,logger_1.printInfo)(`${o} was already gone from disk; cleared its install.extraSkills entry.`);const f=installedSkillNames(e.destSkillsDir);for(const[o,d]of(0,skills_remove_1.danglingDependencies)(a,f,skill_profiles_1.SKILL_DEPENDENCIES)){const u=i.extraSkills.includes(o)?`remove ${o} too`:`narrow the ${i.profile} profile that carries it`;(0,logger_1.printWarning)(`${o} is still installed and requires ${d} \u2014 re-add it (\`agentkit skills add ${d}\`), or ${u}. The next \`agentkit init\` re-adds ${d} while ${o} stays installed.`)}return l.rejected.length>0||s.length>0?1:0}async function interactivePick(n,e){const i=installedSkillNames(e.destSkillsDir),t=await p.autocompleteMultiselect({message:"Select skills to install",placeholder:"Type to search by name, category, or description",required:!1,options:n.map(s=>({value:s.name,label:`${s.name}${i.has(s.name)?" \u2713":""}`,hint:`[${s.category}] ${s.description}`.slice(0,80)}))});if(p.isCancel(t)||t.length===0){(0,logger_1.printInfo)("Nothing selected.");return}installSkills(t,e)}async function main(){const n=process.argv.slice(2);if(n.includes("--help")||n.includes("-h")||n[0]==="help"||n[1]==="help"||n[1]==="--help"||n[1]==="-h"){printHelp();return}const[,e,...i]=n,t=(0,generate_catalogs_1.collectSkills)(repoRoot),s=t.map(l=>l.name);if(e==="list"){const l=soleContext();printList(t,l?installedSkillNames(l.destSkillsDir):new Set);return}if(e==="add"||e==="remove"){i.length===0&&(usage(),process.exit(1));const l=i.filter(c=>!s.includes(c));if(l.length>0){(0,logger_1.printError)(`Unknown skill(s): ${l.join(", ")}`);for(const c of l){const r=closeMatches(c,s);r.length>0&&(0,logger_1.printInfo)(`Did you mean (for ${c}): ${r.join(", ")}?`)}(0,logger_1.printInfo)("Run `agentkit skills list` to see the catalog."),process.exit(1)}const a=await resolveContext();a||process.exit(1),e==="remove"&&process.exit(await removeSkills(i,a)),installSkills(i,a);return}if(!e){if(!process.stdout.isTTY){const a=soleContext();printList(t,a?installedSkillNames(a.destSkillsDir):new Set),usage();return}const l=await resolveContext();l||process.exit(1),await interactivePick(t,l);return}(0,logger_1.printError)(`Unknown subcommand: ${e}`),usage(),process.exit(1)}main();
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,o,s){s===void 0&&(s=o);var n=Object.getOwnPropertyDescriptor(e,o);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,s,n)}):(function(t,e,o,s){s===void 0&&(s=o),t[s]=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 s=[];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(s[s.length]=n);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var s=t(e),n=0;n<s.length;n++)s[n]!=="default"&&__createBinding(o,e,s[n]);return __setModuleDefault(o,e),o}})();Object.defineProperty(exports,"__esModule",{value:!0});const path=__importStar(require("path")),install_profile_config_1=require("./lib/install-profile-config"),logger_1=require("./lib/logger"),scan_roots_1=require("./lib/scan-roots"),collect_1=require("./lib/status/collect"),render_1=require("./lib/status/render"),repoRoot=path.dirname(__dirname);function parseFlags(t){return{json:t.includes("--json"),verbose:t.includes("--verbose"),scan:t.includes("--scan")}}async function resolveScanRoots(t){const e=(0,scan_roots_1.readScanRoots)();if(t.scan){const o=await(0,scan_roots_1.promptScanRoots)();return o||(process.stdout.isTTY||(0,logger_1.printWarning)("--scan needs an interactive terminal."),e)}return e}function printHelp(){console.log(`
|
|
3
|
-
Agentkit Status
|
|
4
|
-
List every Agentkit installation on this machine
|
|
5
|
-
|
|
6
|
-
Usage:
|
|
7
|
-
agentkit status [options]
|
|
8
|
-
|
|
9
|
-
Options:
|
|
10
|
-
--scan Interactively select directories to scan for project installs
|
|
11
|
-
--verbose Include kit roots and unread toggles
|
|
12
|
-
--json Output machine-readable JSON StatusRow[]
|
|
13
|
-
--help, -h Show this help message
|
|
14
|
-
|
|
15
|
-
Examples:
|
|
16
|
-
agentkit status # Summary table of all installed kits
|
|
17
|
-
agentkit status --scan # Configure and run project directory scanning
|
|
18
|
-
agentkit status --verbose # Detailed status including file paths
|
|
19
|
-
agentkit status --json # Machine-readable JSON output
|
|
20
|
-
`)}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),o=console.log;e.json&&(console.log=(...n)=>{process.stderr.write(`${n.join(" ")}
|
|
21
|
-
`)});let s;try{const n=await resolveScanRoots(e);n.length===0&&!e.json&&((0,logger_1.printInfo)("No scan roots configured \u2014 showing global installs only."),(0,logger_1.printInfo)("Run `agentkit status --scan` to add project directories.")),s=(0,collect_1.collectStatusRows)({repoRoot,scanRoots:n,cliVersion:(0,install_profile_config_1.readCliVersion)(repoRoot)})}finally{console.log=o}if(e.json)process.stdout.write(`${(0,render_1.renderJson)(s)}
|
|
22
|
-
`);else{(0,logger_1.printSection)("AgentKit installs"),console.log("");for(const n of(0,render_1.renderText)(s,e.verbose))console.log(n);console.log("")}process.exit(s.length===0?1:0)}main();
|
|
@@ -1,18 +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 i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i<r.length;i++)r[i]!=="default"&&__createBinding(n,e,r[i]);return __setModuleDefault(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0});const fs=__importStar(require("fs")),path=__importStar(require("path")),child_process_1=require("child_process"),logger_1=require("./lib/logger"),agentkit_home_1=require("./lib/agentkit-home");function packageName(){try{const t=JSON.parse(fs.readFileSync(path.join(path.dirname(__dirname),"package.json"),"utf8"));if(typeof t.name=="string")return t.name}catch{}return"@linhnguyen96114/agentkit-engineer"}function removableConfigFiles(){const t=(0,agentkit_home_1.loadAgentkitHomeCore)(),e=t.getDbPath();return[t.getConfigPath(),t.getLockPath(),t.getAuthJsonPath(),t.getCredentialsPath(),t.getEntitlementPath(),e,`${e}-wal`,`${e}-shm`]}function printHelp(){console.log(`
|
|
3
|
-
Agentkit Uninstall
|
|
4
|
-
Remove Agentkit CLI from your system (global uninstall)
|
|
5
|
-
|
|
6
|
-
Usage:
|
|
7
|
-
agentkit uninstall [options]
|
|
8
|
-
|
|
9
|
-
Options:
|
|
10
|
-
--help, -h Show this help message
|
|
11
|
-
|
|
12
|
-
Notes:
|
|
13
|
-
This uninstalls the global npm package and removes CLI configuration.
|
|
14
|
-
Usage history and install registry in ~/.agentkit are preserved.
|
|
15
|
-
|
|
16
|
-
Examples:
|
|
17
|
-
agentkit uninstall # Uninstall the Agentkit CLI
|
|
18
|
-
`)}function uninstall(){const t=process.argv.slice(2);if(t.includes("--help")||t.includes("-h")||t.includes("help")){printHelp();return}(0,logger_1.printSection)("Uninstalling Agentkit CLI"),(0,logger_1.printProgress)("Removing global package...");try{(0,child_process_1.execSync)(`npm uninstall -g ${packageName()}`,{stdio:"inherit",windowsHide:!0}),(0,logger_1.printSuccess)("Package removed")}catch(n){(0,logger_1.printError)(`Failed to uninstall: ${n.message}`),(0,logger_1.printInfo)("Try manually: npm uninstall -g "+packageName()),process.exit(1)}try{const{getStore:n}=require("./lib/auth/token-store");n({}).store.clear("github").catch(()=>{})}catch{}const e=(0,agentkit_home_1.loadAgentkitHomeCore)().getAgentkitHome();if(fs.existsSync(e)){(0,logger_1.printProgress)("Removing CLI config...");for(const r of removableConfigFiles())try{fs.rmSync(r,{force:!0})}catch(i){(0,logger_1.printInfo)(`Could not remove ${path.basename(r)}: ${i.message}`)}(0,logger_1.printSuccess)("CLI config removed");const n=(0,agentkit_home_1.loadAgentkitHomeCore)().getPayloadDir();if(fs.existsSync(n))try{fs.rmSync(n,{recursive:!0,force:!0}),(0,logger_1.printSuccess)("Fetched payloads removed")}catch(r){(0,logger_1.printInfo)(`Could not remove payloads: ${r.message}`),(0,logger_1.printInfo)(` Remove them with: rm -rf ${n}`)}(0,logger_1.printInfo)(`Usage history and install registry kept in ${e}`),console.log(` Remove them with: rm -rf ${e}`)}console.log(""),(0,logger_1.printSuccess)("Agentkit CLI uninstalled successfully!"),console.log(""),(0,logger_1.printInfo)("To reinstall:"),console.log(` npm i -g ${packageName()}`),console.log(" agentkit login"),console.log("")}uninstall();
|
|
@@ -1,20 +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}})(),__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});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("./lib/logger"),exec_1=require("./lib/payload/exec"),source_1=require("./lib/payload/source"),agentkit_home_1=require("./lib/agentkit-home"),version_check_1=require("./lib/version-check"),update_notifier_1=require("./lib/update-notifier"),repoRoot=path.dirname(__dirname),MAX_NOTES_SHOWN=5,MAX_NOTE_LINES=15;async function confirmUpdate(){const t=await p.confirm({message:"Do you want to update the CLI tool now?"});return!p.isCancel(t)&&t}async function updateNpmClient(t){let e;try{e=JSON.parse(fs.readFileSync(path.join(repoRoot,"package.json"),"utf8"))}catch{return}if(typeof e.payloadVersion!="string"||typeof e.name!="string")return;const n=typeof e.version=="string"?e.version:"0.0.0";(0,logger_1.printProgress)("Checking npm for client updates...");let r=null;try{const a=await fetch(`https://registry.npmjs.org/${e.name.replace("/","%2F")}/latest`,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(version_check_1.REQUEST_TIMEOUT_MS)});if(a.ok){const l=await a.json();r=typeof l.version=="string"?l.version:null}}catch{}if(!r)return;if((0,version_check_1.compareVersions)(r,n)<=0){(0,logger_1.printInfo)(`Client is latest (v${n}).`);return}(0,logger_1.printInfo)(`Client update available: v${n} \u2192 v${r}`);const o=t?!0:await p.confirm({message:"Update the client package now?"});if(p.isCancel(o)||!o)return;const i=process.platform==="win32"?"npm.cmd":"npm";(0,child_process_1.spawnSync)(i,["install","-g",`${e.name}@latest`],{stdio:"inherit"}).status===0?(0,logger_1.printSuccess)(`Client updated to v${r}.`):(0,logger_1.printError)(`npm install failed \u2014 run \`npm i -g ${e.name}@latest\` manually.`)}async function executeCliUpdate(t,e){try{(0,logger_1.printProgress)("Resolving the payload...");const n=await(0,source_1.resolveInstallSource)({version:t,...e?{ref:e}:{},interactive:!1});n.origin!=="local"&&(0,logger_1.printInfo)(`Payload ${n.version} (${n.ref}) \u2014 ${n.origin} tree.`),(0,logger_1.printProgress)("Running the installation script...");const r=process.platform==="win32"?(0,exec_1.execPayload)("powershell",["-ExecutionPolicy","Bypass","-File",path.join(n.root,"install.ps1")]):(0,exec_1.execPayload)("bash",[path.join(n.root,"install.sh")]);return r.status!==0?((0,logger_1.printError)(r.error?`The installer could not start: ${r.error.message}`:"The installer exited non-zero."),!1):!0}catch(n){return n instanceof source_1.NoAccessError?(0,logger_1.printError)(n.message):(0,logger_1.printError)(`Failed to update CLI: ${n.message}`),!1}}function printReleaseNotes(t){console.log(""),(0,logger_1.printSection)("Release Notes");for(const e of t.slice(0,MAX_NOTES_SHOWN)){console.log(`
|
|
3
|
-
${chalk_1.default.bold.cyan(`\u2501\u2501\u2501 v${(0,version_check_1.normalizeVersion)(e.tag_name)} \u2501\u2501\u2501`)}`);const n=(e.body||"").split(`
|
|
4
|
-
`);e.body?(console.log(chalk_1.default.dim(n.slice(0,MAX_NOTE_LINES).join(`
|
|
5
|
-
`))),n.length>MAX_NOTE_LINES&&(0,logger_1.printInfo)(`... (full notes: ${e.html_url})`)):(0,logger_1.printInfo)("(No release notes)"),console.log("")}t.length>MAX_NOTES_SHOWN&&(0,logger_1.printInfo)(`... and ${t.length-MAX_NOTES_SHOWN} more release(s)`)}function printHelp(){console.log(`
|
|
6
|
-
Agentkit CLI Update Manager
|
|
7
|
-
Client and payload version independently: npm for the client, GitHub releases for the kit
|
|
8
|
-
|
|
9
|
-
Usage:
|
|
10
|
-
agentkit update [options]
|
|
11
|
-
|
|
12
|
-
Options:
|
|
13
|
-
--yes, -y Skip confirmation prompt and update immediately
|
|
14
|
-
--ref <ref> Install a specific tag/branch/sha instead of the latest release (dev)
|
|
15
|
-
--help, -h Show this help message
|
|
16
|
-
|
|
17
|
-
Examples:
|
|
18
|
-
agentkit update # Check for updates and prompt to install
|
|
19
|
-
agentkit update --yes # Update without confirmation prompt
|
|
20
|
-
`)}async function main(){const t=process.argv.slice(2);if(t.includes("--help")||t.includes("-h")||t.includes("help")){printHelp();return}const e=t.includes("--yes")||t.includes("-y"),n=t.indexOf("--ref"),r=n!==-1?t[n+1]:void 0;n!==-1&&(!r||r.startsWith("--"))&&((0,logger_1.printError)("--ref needs a value: agentkit update --ref <tag|branch|sha>"),process.exit(1));const o=n!==-1?r:void 0,i=(0,source_1.newestTagInstalledTree)((0,agentkit_home_1.loadAgentkitHomeCore)())?.version??(0,version_check_1.getPayloadVersion)(repoRoot);if(i||((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(""),process.exit(1)),o){(0,logger_1.printBanner)("CLI Update Manager"),(0,logger_1.printSection)("Updating CLI Tool"),(0,logger_1.printInfo)(`Installing ref ${o} over v${i}`),await executeCliUpdate(i,o)||(console.log(""),(0,logger_1.printError)("Update failed."),console.log(""),process.exit(1)),(0,update_notifier_1.suppressUpdateNotice)(),console.log(""),(0,logger_1.printSuccess)(`Update completed from ref ${o}.`),console.log("");return}(0,logger_1.printBanner)("CLI Update Manager"),(0,logger_1.printSection)("Checking for Updates"),(0,logger_1.printInfo)(`Current version: v${i}`),await updateNpmClient(e),(0,logger_1.printProgress)("Fetching release info from GitHub...");let c;try{if(c=await(0,version_check_1.fetchReleases)(),c.length===0)throw new Error("No releases found")}catch(s){(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(""),process.exit(1)}const a=c.filter(s=>!s.draft&&!s.prerelease);a.length===0&&((0,logger_1.printError)("No published releases found."),console.log(""),process.exit(1));const l=[...a].sort((s,h)=>(0,version_check_1.compareVersions)(h.tag_name,s.tag_name)),f=l[0],u=(0,version_check_1.normalizeVersion)(f.tag_name);if((0,version_check_1.writeUpdateCache)({lastUpdateCheck:Date.now(),latestVersion:u}),(0,version_check_1.compareVersions)(i,u)>=0){(0,logger_1.printSuccess)(`You are already on the latest version (v${i})`),console.log("");return}const g=l.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${u}`),(0,logger_1.printInfo)(`Current version: v${i}`),(0,logger_1.printInfo)(`Versions behind: ${g.length}`),printReleaseNotes(g),(0,logger_1.printInfo)(`See ${f.html_url} for the full changelog`),console.log(""),!e&&!await confirmUpdate()){console.log(""),(0,logger_1.printInfo)("Update cancelled."),(0,logger_1.printInfo)(`You can update manually later from: ${f.html_url}`),console.log("");return}(0,logger_1.printSection)("Updating CLI Tool"),await executeCliUpdate(u)||(console.log(""),(0,logger_1.printError)("Update failed. Please try updating manually."),console.log(""),process.exit(1)),(0,update_notifier_1.suppressUpdateNotice)(),console.log(""),(0,logger_1.printSection)("Verification");const d=(0,version_check_1.getPayloadVersion)(repoRoot);d&&(0,version_check_1.compareVersions)(d,i)>0?(0,logger_1.printSuccess)(`CLI tool updated: v${i} \u2192 v${d}`):((0,logger_1.printSuccess)("Update completed."),(0,logger_1.printInfo)("Run 'agentkit -v' to confirm the installed version.")),console.log("")}const isImportedInJest=require.main&&require.main.filename&&require.main.filename.includes("jest")||process.argv[1]&&process.argv[1].includes("jest");isImportedInJest||main().catch(t=>{(0,logger_1.printError)(`Fatal error: ${t.message}`),process.exit(1)});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,a,r){r===void 0&&(r=a);var o=Object.getOwnPropertyDescriptor(e,a);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,o)}):(function(t,e,a,r){r===void 0&&(r=a),t[r]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(a){var r=[];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[r.length]=o);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var r=t(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(a,e,r[o]);return __setModuleDefault(a,e),a}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseOwnerRepo=parseOwnerRepo,exports.normalizeVersion=normalizeVersion,exports.interpretTagOutput=interpretTagOutput,exports.fetchLatestTag=fetchLatestTag,exports.fetchCommitsBehind=fetchCommitsBehind,exports.buildDriftRow=buildDriftRow;const child_process_1=require("child_process"),generate_catalogs_1=require("./generate-catalogs"),path=__importStar(require("path")),REPO_ROOT=path.resolve(__dirname,"..");function parseOwnerRepo(t){const e=t.match(/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return e?`${e[1]}/${e[2]}`:null}function normalizeVersion(t){return t.replace(/^v/,"").trim()}function interpretTagOutput(t){return{reachable:!0,tag:t.trim()||null}}function fetchLatestTag(t){try{return interpretTagOutput((0,child_process_1.execFileSync)("gh",["api",`repos/${t}/tags`,"--jq",".[0].name"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}))}catch{return{reachable:!1}}}function fetchCommitsBehind(t,e){try{const a=(0,child_process_1.execFileSync)("gh",["api",`repos/${t}/compare/${e}...HEAD`,"--jq",".ahead_by"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim(),r=Number.parseInt(a,10);return Number.isNaN(r)?null:r}catch{return null}}function buildDriftRow(t,e,a=null){const r=parseOwnerRepo(t.upstream??"")??t.upstream??"?",o=t.upstream_version?normalizeVersion(t.upstream_version):null,u=e.reachable?e.tag:null,l=!!(t.upstream_commit&&e.reachable&&(!t.upstream_version||e.tag===null));let i;if(!e.reachable)i="unreachable";else if(l){if(a!==null)return{skill:t.name,ownerRepo:r,local:t.upstream_commit.slice(0,12),latest:`HEAD~${a}`,state:a===0?"current":"behind"};i="untagged"}else e.tag===null?i="untagged":o===null?i="unpinned":i=normalizeVersion(e.tag)===o?"current":"behind";return{skill:t.name,ownerRepo:r,local:o,latest:u,state:i}}function main(){const t=(0,generate_catalogs_1.collectSkills)(REPO_ROOT).filter(n=>n.upstream);if(t.length===0){console.log("No vendored skills declare an `upstream` \u2014 nothing to check.");return}console.log(`Checking ${t.length} vendored skill(s) against upstream tags...
|
|
2
|
-
`);const e=[];for(const n of t){const s=parseOwnerRepo(n.upstream??""),c=s?fetchLatestTag(s):{reachable:!1},f=s&&n.upstream_commit&&c.reachable&&(!n.upstream_version||c.tag===null)?fetchCommitsBehind(s,n.upstream_commit):null;e.push(buildDriftRow(n,c,f))}const a=(n,s)=>Math.max(n.length,...s.map(c=>(c??"\u2014").length))+2,r=a("LOCAL",e.map(n=>n.local)),o=a("LATEST",e.map(n=>n.latest)),u=a("SKILL",e.map(n=>n.skill)),l=(n,s)=>n.padEnd(s);console.log(l("SKILL",u)+l("LOCAL",r)+l("LATEST",o)+"STATE");for(const n of e)console.log(l(n.skill,u)+l(n.local??"\u2014",r)+l(n.latest??"\u2014",o)+n.state);const i=e.filter(n=>n.state==="behind"),p=e.filter(n=>n.state==="untagged"),h=e.filter(n=>n.state==="unreachable");if(i.length>0&&console.warn(`
|
|
3
|
-
\u26A0 ${i.length} skill(s) behind upstream \u2014 consider a re-sync.`),p.length>0){const n=[...new Set(p.map(s=>s.ownerRepo))].join(", ");console.warn(`
|
|
4
|
-
\u2139 ${p.length} skill(s) track an upstream that publishes no tags (${n}).
|
|
5
|
-
Version comparison is impossible by design there \u2014 compare by commit, or re-sync on a date.`)}h.length>0&&console.warn(`
|
|
6
|
-
\u26A0 ${h.length} upstream(s) unreachable (no network / no gh auth / repo gone) \u2014 skipped.`)}require.main===module&&main();
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,i,r){r===void 0&&(r=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(t,r,n)}):(function(t,e,i,r){r===void 0&&(r=i),t[r]=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 r=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&__createBinding(i,e,r[n]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.DELTAS=exports.BASE=exports.KEY_ORDER=exports.KITS=void 0,exports.renderConfig=renderConfig,exports.generateConfigs=generateConfigs;const fs=__importStar(require("fs")),path=__importStar(require("path")),{deepMerge}=require(path.join(__dirname,"..","agent-kit","shared","hooks","lib","agentkit-config-utils.cjs"));exports.KITS=["claude","codex","devin","hermes","kimi","omp","openclaw","opencode"],exports.KEY_ORDER=["$schema","statusline","privacyBlock","docs","plan","paths","locale","trust","project","antigravity","skills","hooks","assertions"],exports.BASE={$schema:"./schemas/agentkit-config.schema.json",privacyBlock:!0,docs:{maxLoc:800},plan:{namingFormat:"{date}-{issue}-{slug}",dateFormat:"YYMMDD-HHmm",issuePrefix:"GH-",reportsDir:"reports",resolution:{order:["session","branch"],branchPattern:"(?:feat|fix|chore|refactor|docs)/(?:[^/]+/)?(.+)"},validation:{mode:"prompt",minQuestions:3,maxQuestions:8,focusAreas:["assumptions","risks","tradeoffs","architecture"]}},paths:{docs:"docs",plans:"plans"},locale:{thinkingLanguage:null,responseLanguage:null},trust:{passphrase:null,enabled:!1},project:{type:"auto",packageManager:"auto",framework:"auto"},hooks:{},assertions:[]},exports.DELTAS={claude:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}},codex:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}},devin:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}},hermes:{statusline:"minimal",skills:{research:{useAntigravity:!1}}},kimi:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}},omp:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}},openclaw:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}},opencode:{statusline:"minimal",antigravity:{model:"gemini-3.8-flash-high"},skills:{research:{useAntigravity:!0}}}};function renderConfig(t){const e=exports.DELTAS[t];if(e===void 0)throw new Error(`no delta defined for kit "${t}"`);const i=deepMerge({...exports.BASE},e),r={};for(const s of exports.KEY_ORDER)s in i&&(r[s]=i[s]);const n=new Set(Object.keys(r));for(const s of Object.keys(i))if(!n.has(s))throw new Error(`kit "${t}": key "${s}" is not in KEY_ORDER and would be dropped`);return`${JSON.stringify(r,null,2)}
|
|
2
|
-
`}function generateConfigs(t){for(const e of exports.KITS){const i=path.join(t,"agent-kit",e,".agentkit.json");fs.writeFileSync(i,renderConfig(e))}return[...exports.KITS]}if(require.main===module){const t=path.resolve(__dirname,".."),e=generateConfigs(t);console.log(`agent-kit/*/.agentkit.json \u2014 ${e.length} kits: ${e.join(", ")}`)}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,s,e,n){n===void 0&&(n=e);var r=Object.getOwnPropertyDescriptor(s,e);(!r||("get"in r?!s.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return s[e]}}),Object.defineProperty(t,n,r)}):(function(t,s,e,n){n===void 0&&(n=e),t[n]=s[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,s){Object.defineProperty(t,"default",{enumerable:!0,value:s})}):function(t,s){t.default=s}),__importStar=this&&this.__importStar||(function(){var t=function(s){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[n.length]=r);return n},t(s)};return function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var n=t(s),r=0;r<n.length;r++)n[r]!=="default"&&__createBinding(e,s,n[r]);return __setModuleDefault(e,s),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.GUIDE_COMMANDS_END=exports.GUIDE_COMMANDS_START=exports.SKILL_STATUSES=exports.CATEGORY_TITLES=void 0,exports.parseFrontmatter=parseFrontmatter,exports.collectSkills=collectSkills,exports.collectAgents=collectAgents,exports.collectCommands=collectCommands,exports.renderSkillsYaml=renderSkillsYaml,exports.renderAgentsYaml=renderAgentsYaml,exports.renderCommandsYaml=renderCommandsYaml,exports.renderSkillsReadme=renderSkillsReadme,exports.slashInvocation=slashInvocation,exports.renderGuideCommandSection=renderGuideCommandSection,exports.syncGuideCommandSections=syncGuideCommandSections,exports.generateCatalogs=generateCatalogs;const fs=__importStar(require("fs")),path=__importStar(require("path")),agent_metadata_1=require("./lib/kit-installers/agent-metadata"),SKILL_GROUPS=[],NOT_SKILLS=new Set(["common",...SKILL_GROUPS]);exports.CATEGORY_TITLES={"ai-ml":"AI & Machine Learning",frontend:"Frontend & Design",backend:"Backend Development",infrastructure:"Infrastructure & DevOps",database:"Database & Storage","dev-tools":"Development Tools",multimedia:"Multimedia & Processing",frameworks:"Frameworks & Platforms",security:"Security",design:"Design",documents:"Document Processing",marketing:"Marketing & Growth",seo:"SEO & Search",utilities:"Utilities & Helpers",other:"Other"},exports.SKILL_STATUSES=new Set(["experimental","stable","deprecated"]);function parseFrontmatter(t){const s=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!s)return{};const e={};let n=null;for(const r of s[1].split(/\r?\n/)){const o=r.match(/^([A-Za-z_][\w-]*):\s*(.*)$/);o?(n=o[1],e[n]=o[2].trim()):n&&/^\s+\S/.test(r)&&(e[n]=`${e[n]} ${r.trim()}`.trim())}return e}function cleanValue(t){return t?t.replace(/^[>|][-+]?\s*/,"").replace(/^"(.*)"$/s,"$1").replace(/^'(.*)'$/s,"$1").replace(/\s+/g," ").trim():""}function yamlString(t){return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function readSkill(t,s,e){const n=path.join(t,e),r=path.join(n,"SKILL.md");if(!fs.existsSync(r))return null;const o=parseFrontmatter(fs.readFileSync(r,"utf8")),i=cleanValue(o.category)||"other",a=cleanValue(o.status)||"stable";return{name:s,path:`${e}/SKILL.md`,description:cleanValue(o.description),category:i in exports.CATEGORY_TITLES?i:"other",status:exports.SKILL_STATUSES.has(a)?a:"stable",user_invocable:cleanValue(o["user-invocable"])==="true",has_scripts:fs.existsSync(path.join(n,"scripts")),has_references:fs.existsSync(path.join(n,"references")),...cleanValue(o.upstream)?{upstream:cleanValue(o.upstream)}:{},...cleanValue(o.upstream_commit)?{upstream_commit:cleanValue(o.upstream_commit)}:{},...cleanValue(o.upstream_version)?{upstream_version:cleanValue(o.upstream_version)}:{},...cleanValue(o.synced)?{synced:cleanValue(o.synced)}:{}}}function collectSkills(t){const s=path.join(t,"skills"),e=[];for(const n of fs.readdirSync(s,{withFileTypes:!0})){if(!n.isDirectory()||n.name.startsWith("."))continue;if(SKILL_GROUPS.includes(n.name)){const o=path.join(s,n.name);for(const i of fs.readdirSync(o,{withFileTypes:!0})){if(!i.isDirectory())continue;const a=readSkill(s,i.name,`${n.name}/${i.name}`);a&&e.push({...a,category:"documents"})}continue}if(NOT_SKILLS.has(n.name))continue;const r=readSkill(s,n.name,n.name);r&&e.push(r)}return e.sort((n,r)=>n.name.localeCompare(r.name))}function collectAgents(t){const{agents:s}=(0,agent_metadata_1.readAgentsDir)(path.join(t,"agents"));return s.map(e=>({name:e.name,path:`${e.name}.md`,description:(0,agent_metadata_1.trimmedDescription)(e.description),model:e.model??"inherit",read_only:e.readOnly,memory:e.memory??"none"}))}function collectCommands(t){const s=path.join(t,"command"),e=[],n=r=>{for(const o of fs.readdirSync(r,{withFileTypes:!0})){const i=path.join(r,o.name);if(o.isDirectory())n(i);else if(o.name.endsWith(".md")){const a=path.relative(s,i),c=parseFrontmatter(fs.readFileSync(i,"utf8"));e.push({name:a.replace(/\.md$/,""),path:a,description:cleanValue(c.description)})}}};return n(s),e.sort((r,o)=>r.name.localeCompare(o.name))}function renderSkillsYaml(t){const s=[...new Set(t.map(n=>n.category))].sort(),e=["# Generated by scripts/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing a skill.","metadata:"," title: Skills Catalog"," description: Catalog of every skill in AgentKit Engineer, generated from skills/.",` total_skills: ${t.length}`,` user_invocable: ${t.filter(n=>n.user_invocable).length}`,"categories:",...s.map(n=>` ${n}: ${yamlString(exports.CATEGORY_TITLES[n])}`),"legend:"," user_invocable: Callable directly as /<name>"," has_scripts: Ships executable scripts"," has_references: Ships reference documentation"," status: Lifecycle label (experimental | stable | deprecated); deprecated still installs","skills:"];for(const n of s){e.push(` ${n}:`);for(const r of t.filter(o=>o.category===n))e.push(` - name: ${r.name}`,` path: ${r.path}`,` description: ${yamlString(r.description)}`,` status: ${r.status}`,` user_invocable: ${r.user_invocable}`,` has_scripts: ${r.has_scripts}`,` has_references: ${r.has_references}`),r.upstream&&(e.push(` upstream: ${yamlString(r.upstream)}`),r.upstream_version&&e.push(` upstream_version: ${yamlString(r.upstream_version)}`),r.upstream_commit&&e.push(` upstream_commit: ${yamlString(r.upstream_commit)}`),r.synced&&e.push(` synced: ${yamlString(r.synced)}`))}return`${e.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`}function renderAgentsYaml(t){const s=["# Generated by scripts/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing an agent.","metadata:"," title: Agents Catalog"," description: Catalog of every subagent in AgentKit Engineer, generated from agents/.",` total_agents: ${t.length}`,"legend:"," model: Pinned model, or `inherit` when the host decides"," read_only: Cannot edit files or shell out (derived from its tools)"," memory: Persistent-memory scope (project | user | none)","agents:"];for(const e of t)s.push(` - name: ${e.name}`,` path: ${e.path}`,` description: ${yamlString(e.description)}`,` model: ${e.model}`,` read_only: ${e.read_only}`,` memory: ${e.memory}`);return`${s.join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}function renderCommandsYaml(t){const s=["# Generated by scripts/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing a command.","metadata:"," title: Commands Catalog"," description: Catalog of every slash command in AgentKit Engineer, generated from command/.",` total_commands: ${t.length}`," note: Most workflows are skills, not commands. See SKILLS.yaml for the full set.","commands:"];for(const e of t)s.push(` - name: ${e.name}`,` path: ${e.path}`,` description: ${yamlString(e.description)}`);return`${s.join(`
|
|
6
|
-
`)}
|
|
7
|
-
`}function firstSentence(t){const s=t.trim(),e=s.match(/^(.*?[.!?])(\s|$)/),n=e?e[1]:s;return n.length>160?`${n.slice(0,157).trimEnd()}...`:n}function cell(t){return t.replace(/\|/g,"\\|")}function renderSkillsReadme(t,s){const e=[...new Set(t.map(o=>o.category))].sort(),n=t.filter(o=>o.user_invocable).length,r=["<!-- Generated by scripts/generate-catalogs.ts -- do not edit by hand. -->","<!-- Run `npm run catalog:sync` after adding or removing a skill. -->","","# Skills Library","",`**${t.length} skills.** ${n} are invocable directly as \`/<name>\`; the rest`,"activate when the model judges them relevant. Machine-readable catalog:","[`guide/SKILLS.yaml`](../guide/SKILLS.yaml).","","Generated from each skill's own frontmatter, so it cannot drift from what ships.","Run `npm run catalog:sync` after adding or removing one.","","---","","## How to Use Skills","","### Name one directly","","```bash",'/ak-plan "add OAuth login" # research and write a phased plan',"/cook plans/<dir>/plan.md # execute that plan",'/ak-fix "TypeError in auth.ts" # diagnose the root cause, then fix it','/scout "where is payment handled"',"```","","### Or just describe the task","","The model routes to the right skill from the description alone. Naming one is an","override, not a requirement.","","```text",'"Investigate why the dashboard crashes after login" -> ak-debug','"Build a pricing page that does not look AI-generated" -> frontend-design','"Set up the memory MCP server" -> use-mcp',"```","",`Workflows that are not skills ship as ${s} slash ${s===1?"command":"commands"} --`,"see [`guide/COMMANDS.md`](../guide/COMMANDS.md).","","---","","## Catalog",""];for(const o of e){const i=t.filter(a=>a.category===o);r.push(`### ${exports.CATEGORY_TITLES[o]} (${i.length})`,"","| Skill | Invoke | What it does |","|-------|--------|--------------|",...i.map(a=>{const c=a.user_invocable?`\`/${a.name}\``:"_auto_",l=a.status==="stable"?"":a.status==="deprecated"?" \u26D4 _deprecated_":" \u26A0\uFE0F _experimental_";return`| **${a.name}**${l} | ${c} | ${cell(firstSentence(a.description))} |`}),"")}return r.push("---","","## Creating a Skill","","Use [`skill-creator`](./skill-creator/) -- it scaffolds the directory, writes the","frontmatter, and validates the result. After adding one, run `npm run catalog:sync`","so this page and the YAML catalogs pick it up.",""),r.join(`
|
|
8
|
-
`)}exports.GUIDE_COMMANDS_START="<!-- AGENTKIT:COMMANDS start - generated, do not edit -->",exports.GUIDE_COMMANDS_END="<!-- AGENTKIT:COMMANDS end -->";function slashInvocation(t){return`/${t.split(path.sep).join(":").split("/").join(":")}`}function renderGuideCommandSection(t){const s=t.map(n=>`| \`${slashInvocation(n.name)}\` | ${cell(firstSentence(n.description))} |`).join(`
|
|
9
|
-
`),e=t.length===1?"slash command is":"slash commands are";return[exports.GUIDE_COMMANDS_START,"",`These ${t.length} ${e} the complete set. Anything else you have`,"seen written as a slash command in older docs is a **skill**, invoked by name","(`ak-plan`, `cook`, `ak-fix`, `ak-debug`, `docs`, `ship`, `scout`, `git`, `design`).","Run `/ak-help <keyword>` to find the right one.","","| Command | Purpose |","| --- | --- |",s,"",exports.GUIDE_COMMANDS_END].join(`
|
|
10
|
-
`)}function syncGuideCommandSections(t,s){const e=path.join(t,"guide");if(!fs.existsSync(e))return[];const n=renderGuideCommandSection(s),r=[];for(const o of fs.readdirSync(e)){if(!o.startsWith("SETUP-")||!o.endsWith(".md"))continue;const i=path.join(e,o),a=fs.readFileSync(i,"utf8"),c=a.indexOf(exports.GUIDE_COMMANDS_START),l=a.indexOf(exports.GUIDE_COMMANDS_END);if(c===-1||l===-1)continue;const d=a.slice(0,c)+n+a.slice(l+exports.GUIDE_COMMANDS_END.length);d!==a&&(fs.writeFileSync(i,d),r.push(o))}return r}function generateCatalogs(t){const s=collectSkills(t),e=collectCommands(t),n=collectAgents(t);return fs.writeFileSync(path.join(t,"guide","SKILLS.yaml"),renderSkillsYaml(s)),fs.writeFileSync(path.join(t,"guide","COMMANDS.yaml"),renderCommandsYaml(e)),fs.writeFileSync(path.join(t,"guide","AGENTS.yaml"),renderAgentsYaml(n)),fs.writeFileSync(path.join(t,"skills","README.md"),renderSkillsReadme(s,e.length)),syncGuideCommandSections(t,e),{skills:s.length,commands:e.length,agents:n.length}}if(require.main===module){const t=path.resolve(__dirname,".."),{skills:s,commands:e,agents:n}=generateCatalogs(t);console.log(`guide/SKILLS.yaml \u2014 ${s} skills`),console.log(`guide/COMMANDS.yaml \u2014 ${e} commands`),console.log(`guide/AGENTS.yaml \u2014 ${n} agents`),console.log(`skills/README.md \u2014 ${s} skills`)}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const version_check_1=require("./lib/version-check"),HARD_EXIT_MS=2e4;async function main(){const e=Date.now();(0,version_check_1.writeUpdateCache)({lastUpdateCheck:e});try{const t=await(0,version_check_1.fetchLatestRelease)();(0,version_check_1.writeUpdateCache)({lastUpdateCheck:e,latestVersion:(0,version_check_1.normalizeVersion)(t.tag_name)})}catch{}}const guard=setTimeout(()=>process.exit(0),HARD_EXIT_MS);guard.unref(),main().catch(()=>{}).finally(()=>clearTimeout(guard));
|