@linhnguyen96114/agentkit-engineer 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- 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/{agentkit-logout.js → cli/agentkit-logout.js} +2 -2
- package/scripts-dist/cli/agentkit-profile.js +4 -0
- package/scripts-dist/cli/agentkit-skills.js +25 -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/{check-upstream.js → gen/check-upstream.js} +1 -1
- 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/update-check-worker.js +2 -0
- package/scripts-dist/{validate-agents-registry.js → gen/validate-agents-registry.js} +1 -1
- package/scripts-dist/lib/clear/cli.js +4 -0
- package/scripts-dist/lib/cli.js +3 -0
- 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/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-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/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-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/generate-agentkit-configs.js +0 -2
- package/scripts-dist/generate-catalogs.js +0 -10
- package/scripts-dist/update-check-worker.js +0 -2
|
@@ -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,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,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));
|