@linhnguyen96114/agentkit-engineer 1.4.3 → 1.6.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 +64 -0
- package/README.md +2 -2
- package/bin/agentkit.js +1 -1
- package/package.json +2 -2
- package/scripts-dist/cli/agentkit-logout.js +2 -2
- package/scripts-dist/cli/agentkit-skills.js +10 -5
- package/scripts-dist/gen/check-upstream.js +6 -6
- package/scripts-dist/gen/frontend-cli.js +4 -3
- package/scripts-dist/gen/generate-catalogs.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/upstream-skill-syncers.js +5 -0
- package/scripts-dist/gen/upstream-suite-syncers.js +12 -0
- package/scripts-dist/lib/agentkit-config-file.js +2 -2
- package/scripts-dist/lib/auth/cli.js +1 -1
- package/scripts-dist/lib/codegraph-installer/mcp-sync.js +1 -1
- package/scripts-dist/lib/doctor/checks-rules.js +1 -1
- package/scripts-dist/lib/dropped-mcp-servers.js +1 -1
- package/scripts-dist/lib/init/cli.js +1 -1
- package/scripts-dist/lib/kit-context.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/kits.js +1 -1
- package/scripts-dist/lib/payload/retention.js +1 -1
- package/scripts-dist/lib/profile-block.js +1 -1
- package/scripts-dist/lib/profile-rules.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/skills/cli.js +1 -1
- package/scripts-dist/lib/skills/skill-companion-assets.js +1 -0
- package/scripts-dist/lib/skills/skills-context-options.js +1 -0
- package/scripts-dist/lib/ui.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
+
## [7.11.0](https://github.com/linhnguyen-gt/agentkit-engineer/compare/v7.10.0...v7.11.0) (2026-10-29)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
* **init:** install project-scope skills into .agents/skills across non-claude kits ([aca9a77](https://github.com/linhnguyen-gt/agentkit-engineer/commit/aca9a779c58155641f0303c3e6195fc0ea46a833))
|
|
6
|
+
* **profile:** exclude dev-only skills, agents, and rules from marketing profile ([7dca11a](https://github.com/linhnguyen-gt/agentkit-engineer/commit/7dca11a20dea92825ed896f558448ac977068c2e))
|
|
7
|
+
* **profiles:** add godot mcp server to gamedev profile ([7b504bb](https://github.com/linhnguyen-gt/agentkit-engineer/commit/7b504bbba59660199a566f5633bec358c0f47121))
|
|
8
|
+
* **skills:** add devin runtime to ak-orchestrate and wire --orchestrate routes ([62da33f](https://github.com/linhnguyen-gt/agentkit-engineer/commit/62da33f345d5678dce4a526ecbd8853194d815c8))
|
|
9
|
+
|
|
10
|
+
### 🐞 Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **init:** install gamedev companion agents and rules on the omp kit ([46a6f31](https://github.com/linhnguyen-gt/agentkit-engineer/commit/46a6f314d29769bd293f92d01bc6d7a37675301d))
|
|
13
|
+
* **release:** publish public client in semantic-release prepare step ([1f4bf94](https://github.com/linhnguyen-gt/agentkit-engineer/commit/1f4bf940557c591572f3d8afa7b885acc92f7018))
|
|
14
|
+
* **release:** scope client release notes to client-surface commits ([af86828](https://github.com/linhnguyen-gt/agentkit-engineer/commit/af86828b9c369eccc81d7629b92a96be1372fa10))
|
|
15
|
+
|
|
16
|
+
### ♻️ Code Refactoring
|
|
17
|
+
|
|
18
|
+
* **agents:** make root AGENTS.md instructions kit-neutral ([f2aeae3](https://github.com/linhnguyen-gt/agentkit-engineer/commit/f2aeae3541abeec3c446a350b415cce7a450a584))
|
|
19
|
+
* **rules:** compress skill-domain-routing prose ([87627bb](https://github.com/linhnguyen-gt/agentkit-engineer/commit/87627bbb7b1182cb8d401c358758841d01dd8095))
|
|
20
|
+
|
|
21
|
+
### ✅ Tests
|
|
22
|
+
|
|
23
|
+
* **skills:** ignore agent skill compound noun in agent-reference-drift ([4ea19bf](https://github.com/linhnguyen-gt/agentkit-engineer/commit/4ea19bf6bc5e6e2ac0e99e306b74497cf3cc10bf))
|
|
24
|
+
|
|
25
|
+
## [7.10.0](https://github.com/linhnguyen-gt/agentkit-engineer/compare/v7.9.0...v7.10.0) (2026-10-23)
|
|
26
|
+
|
|
27
|
+
### 🚀 Features
|
|
28
|
+
|
|
29
|
+
* **ak-orchestrate:** distill v2.2.0 routing, graph optimizer, 3-layer arbiter, and pi runtime ([003a1eb](https://github.com/linhnguyen-gt/agentkit-engineer/commit/003a1ebba960331bd3b1f5806d041a834df64484))
|
|
30
|
+
* **bootstrap:** add Nuxt 4 frontend adapter, CLI target, and .vue token check ([4e0ca01](https://github.com/linhnguyen-gt/agentkit-engineer/commit/4e0ca01905a76b901775bcb7217512001a003ce8))
|
|
31
|
+
* **claude:** use native autoCompactWindow and 1h subagentPromptCacheTtl in settings.json ([61d4fc6](https://github.com/linhnguyen-gt/agentkit-engineer/commit/61d4fc6f90e9a272ee1673f803671ae6997da0f3))
|
|
32
|
+
* **gamedev:** add gamedev profile with studio skills, specialist agents, and rules ([5c526c3](https://github.com/linhnguyen-gt/agentkit-engineer/commit/5c526c366501593523c70e90396af68860e7fb27))
|
|
33
|
+
* **gamedev:** bundle CoplayDev unityMCP server with gamedev profile and skill ([6433e94](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6433e94c908f106303253c869330dfe76cb971a0))
|
|
34
|
+
* **scout:** modularize scanner and refine compound token ranking ([5bc235c](https://github.com/linhnguyen-gt/agentkit-engineer/commit/5bc235cfe11a2447a186103d76996a8f9c9dabcb))
|
|
35
|
+
* **skills:** add --project, --global, and --kit flags to agentkit skills CLI ([ac7befd](https://github.com/linhnguyen-gt/agentkit-engineer/commit/ac7befd6bcbfeec8e6a920505fabf0b07707a862))
|
|
36
|
+
* **skills:** add create, audit, and blast-radius optimize modes to test skill ([0633f1c](https://github.com/linhnguyen-gt/agentkit-engineer/commit/0633f1c92017d338f0816c810e9448957b735a6f))
|
|
37
|
+
* **skills:** install companion agents and rules for seo and gamedev skills ([1390557](https://github.com/linhnguyen-gt/agentkit-engineer/commit/13905576ad3ede92f888777afd341e2a2e04877f))
|
|
38
|
+
* **skills:** integrate agentkit CLI discovery and install flow into automation-recommender ([b3cf500](https://github.com/linhnguyen-gt/agentkit-engineer/commit/b3cf500239c6d1542b5eb5afacc91666aa60d10a))
|
|
39
|
+
* **skills:** ship typesafe-ai in core and wire ak-orchestrate into semantic decisions ([dce8438](https://github.com/linhnguyen-gt/agentkit-engineer/commit/dce8438d90e0580c2c9aaa567212c9c8bee4e4e7))
|
|
40
|
+
* **skills:** vendor multi-kit automation-recommender skill across all 12 kits ([22a8121](https://github.com/linhnguyen-gt/agentkit-engineer/commit/22a8121eb0c2c72b3f41e550357e5bfa6a7bc3e8))
|
|
41
|
+
* **sync:** expand upstream sync workflow to all vendor skill sources ([7173e9e](https://github.com/linhnguyen-gt/agentkit-engineer/commit/7173e9ea9f0a6a59e02b51e81964d589f7598ab4))
|
|
42
|
+
|
|
43
|
+
### 🐞 Bug Fixes
|
|
44
|
+
|
|
45
|
+
* **gamedev:** omit seo specialist agents when installing gamedev profile ([e35d6a4](https://github.com/linhnguyen-gt/agentkit-engineer/commit/e35d6a4dd4b9d669fe4ddf0a06b548a8ce2141cd))
|
|
46
|
+
* **installer:** preserve .agentkit.json user state across kit re-install ([6a3e1b8](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6a3e1b8b7dc84bcbeeb4a64866f7641b0834ea8f))
|
|
47
|
+
* **installer:** preserve user MCP servers across init updates ([5d2b79f](https://github.com/linhnguyen-gt/agentkit-engineer/commit/5d2b79f4e5a6c80757a271635ed0fad6d9ad8ed7))
|
|
48
|
+
* **skills:** restrict seo companion agents to marketing and full profiles ([125564d](https://github.com/linhnguyen-gt/agentkit-engineer/commit/125564dba9a8c6679ef64a848f599598d9e14247))
|
|
49
|
+
|
|
50
|
+
### 📚 Documentation
|
|
51
|
+
|
|
52
|
+
* **guide:** update SETUP-ANTIGRAVITY.md for Antigravity 2.0 ([6aff249](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6aff24962ad51d9b17b7a9ee27daf76ff62f1af6))
|
|
53
|
+
* update project docs to 7.9.0 ([6832f77](https://github.com/linhnguyen-gt/agentkit-engineer/commit/6832f7722a2caa0883fe70086a172eec3485f6cc))
|
|
54
|
+
|
|
55
|
+
### ♻️ Code Refactoring
|
|
56
|
+
|
|
57
|
+
* **cli:** drop the literal payload path from logout copy and docs ([713ef88](https://github.com/linhnguyen-gt/agentkit-engineer/commit/713ef88dcb5517c8366021c8cfa819f1608f7165))
|
|
58
|
+
* **cli:** replace the dispatch ladders in bin/agentkit.js with a route table ([9f45305](https://github.com/linhnguyen-gt/agentkit-engineer/commit/9f453057cfa25fd8b7c03b491cb05d88a54d549b))
|
|
59
|
+
* **rules:** tighten chat reply casing and ban dash connectors in prose ([cf27d29](https://github.com/linhnguyen-gt/agentkit-engineer/commit/cf27d29d2e0ece7d3259623350c2f99ead925875))
|
|
60
|
+
|
|
61
|
+
### ✅ Tests
|
|
62
|
+
|
|
63
|
+
* **skills:** isolate global kit-root env overrides in kit context and skills tests ([4da6fa0](https://github.com/linhnguyen-gt/agentkit-engineer/commit/4da6fa0721dcc2affd2a28848e35f317fdb9998f))
|
|
64
|
+
|
|
1
65
|
## [7.9.0](https://github.com/linhnguyen-gt/agentkit-engineer/compare/v7.8.2...v7.9.0) (2026-10-12)
|
|
2
66
|
|
|
3
67
|
### 🚀 Features
|
package/README.md
CHANGED
|
@@ -11,8 +11,8 @@ agentkit init # pick a kit, install it globally
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Access is gated: `agentkit login` authorizes a GitHub App through the device
|
|
14
|
-
flow, and the first gated command downloads the kit payload into
|
|
15
|
-
|
|
14
|
+
flow, and the first gated command downloads the kit payload into the local
|
|
15
|
+
payload cache. Without an authorized login, every gated command
|
|
16
16
|
answers `no access` and writes nothing.
|
|
17
17
|
|
|
18
18
|
## Commands
|
package/bin/agentkit.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const path=require("path"),fs=require("fs"),{spawnSync}=require("child_process"),args=process.argv.slice(2),command=args[0],packageRoot=path.join(__dirname,".."),PAYLOAD_ROOTS=["skills","rules","agents","agent-kit"],clientHasPayload=PAYLOAD_ROOTS.every(n=>{try{return fs.statSync(path.join(packageRoot,n)).isDirectory()}catch{return!1}});async function runInPayload(n){const{resolveInstallSource:a,NoAccessError:l}=require("../scripts-dist/lib/payload/source.js"),{execPayload:e}=require("../scripts-dist/lib/payload/exec.js"),s=n.indexOf("--ref"),o=s!==-1?n[s+1]:void 0;s!==-1&&(!o||o.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit <command> --ref <tag|branch|sha>"),process.exit(1));const{getPayloadVersion:t}=require("../scripts-dist/lib/version-check.js");try{const i=await a({version:t(packageRoot)??"0.0.0",ref:o,interactive:!0,cliRoot:packageRoot}),r=path.join(packageRoot,"node_modules"),g=e(process.execPath,[path.join(i.root,"bin","agentkit.js"),...n],{env:{...process.env,NODE_PATH:r,AGENTKIT_NODE_MODULES:r}});process.exit(g.status==null?1:g.status)}catch(i){i instanceof l?console.error(`\u2717 ${i.message}`):console.error(`\u2717 Could not resolve the kit payload: ${i.message}`),process.exit(1)}}function scheduleUpdateNotice(){try{const{maybeNotifyUpdate:n}=require("../scripts-dist/lib/update-notifier"),{getPayloadVersion:a}=require("../scripts-dist/lib/version-check.js");let l=a(packageRoot);try{const{newestTagInstalledTree:e}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:s}=require("../scripts-dist/lib/agentkit-home.js");l=e(s())?.version??l}catch{}n({currentVersion:l??"0.0.0"})}catch{}}function printProfilesGuide(){console.log("Profiles:"),console.log(" Every install takes a slice of the skill catalog. Leave --profile out and you get the"),console.log(" default for your kit; name one to take a different slice."),console.log(""),console.log(" core Workflow + tooling, minus vendor suites and niche extras (default)"),console.log(" full Every skill the kit ships"),console.log(" frontend core + frontend, design, frameworks"),console.log(" backend core + backend, database, infrastructure, security"),console.log(" mobile core + frontend, frameworks, design"),console.log(" fullstack core + frontend, backend, database, infrastructure, frameworks, design"),console.log(" marketing core + marketing, design, seo, documents, multimedia, ai-ml"),console.log(" also names: copywriting, show-off, project-management, frontend-design, agent-browser,"),console.log(" project-organization, ak-sowat, enhance-ux-ax"),console.log(" dependency: enhance-ux-ax installs with seo (its AX engine)"),console.log(" assistant The personal agents' set \u2014 hermes and openclaw default here"),console.log(""),console.log(" The choice is recorded per kit (.agentkit.json) and reapplied on update, so a later"),console.log(" agentkit init keeps it without the flag; --profile overrides it."),console.log(""),console.log(" Missing a skill a wider profile would have installed?"),console.log(" agentkit skills list Browse the whole catalog (\u2713 = installed here)"),console.log(" agentkit skills add <name> Install one; later updates keep it"),console.log("")}function printGeneralHelp(){console.log("Agentkit CLI"),console.log(""),console.log("Usage:"),console.log(" agentkit <command> [options]"),console.log(" agentkit help [command]"),console.log(""),console.log("Commands:"),console.log(" agentkit init [kit] Initialize AI development kit (project or global)"),console.log(" agentkit login Authorize this machine to reach the kit repository"),console.log(" agentkit logout Remove the stored login and entitlement cache"),console.log(" agentkit whoami Show the logged-in account and its entitlement"),console.log(" agentkit profile Manage install profiles (remove)"),console.log(" agentkit update Upgrade the Agentkit CLI itself to the latest release"),console.log(" agentkit clear Remove Agentkit installations (project or global)"),console.log(" agentkit uninstall Remove Agentkit CLI from your system (global uninstall)"),console.log(" agentkit config Manage auto-update settings"),console.log(" agentkit skills Discover and install skills (list / pick / add / remove)"),console.log(" agentkit doctor Report the health of the installed kit"),console.log(" agentkit status List every kit install on this machine"),console.log(" agentkit dashboard Open the local dashboard in your browser"),console.log(" agentkit hooks See and set hook toggles (list / enable / disable)"),console.log(" agentkit db-first Scaffold a database-first backend project"),console.log(" agentkit mobile Scaffold a mobile project (Expo or Flutter)"),console.log(" agentkit frontend Scaffold a web frontend (agent workflow handoff)"),console.log(" agentkit stack Full-stack workflow tools (typed API client generator)"),console.log(""),console.log("Options:"),console.log(" --help, -h Show this help message"),console.log(" --version, -v Show CLI version"),console.log(""),printProfilesGuide(),console.log("Examples:"),console.log(" agentkit init # Run interactive installer"),console.log(" agentkit init claude # Initialize Claude Code directly (no kit menu)"),console.log(" agentkit init omp # Target a global-only kit (hermes, openclaw, omp)"),console.log(" agentkit init --profile frontend # Install only frontend-relevant skills"),console.log(" agentkit profile remove claude # Reinstall Claude with the core profile"),console.log(" agentkit profile remove --global # Remove profiles from global installs"),console.log(" # Switching an existing profile with init asks for confirmation"),console.log(" agentkit skills # Browse and pick skills to install"),console.log(" agentkit skills add databases # Add one or more skills by name"),console.log(" agentkit skills remove databases # Undo an add: delete it and forget it"),console.log(" agentkit doctor # Check the installed kit's health"),console.log(" agentkit doctor --json # Same, machine-readable"),console.log(" agentkit status # Every kit install and version"),console.log(" agentkit status --scan # Choose the directories to search"),console.log(" agentkit hooks list # Show every hook toggle"),console.log(" agentkit hooks disable scout-block # Turn one hook off"),console.log(" agentkit update # Upgrade the Agentkit CLI itself"),console.log(" agentkit clear # Remove Agentkit files from project/global"),console.log(" agentkit uninstall # Remove Agentkit CLI from system"),console.log(" agentkit config autoupdate # Show auto-update status"),console.log(" agentkit config autoupdate on # Enable auto-update"),console.log(" agentkit config semantic # Semantic decisions: status (off by default)"),console.log(" agentkit config semantic enable # Enable the semantic-decision layer"),console.log(" agentkit decide < payload.json # Ask a decision model one typed question set"),console.log(" agentkit db-first init myapp postgresql # Scaffold a backend project"),console.log(" agentkit mobile init myapp # Scaffold a mobile project"),console.log(" agentkit frontend init myapp --framework nextjs # Frontend Mode handoff"),console.log(" agentkit stack client ./api ./web/src # Typed client from the API's schema"),console.log(" agentkit help <command> # Show detailed help for a command"),console.log(" agentkit help profile # What each install profile includes"),console.log(" agentkit -v # Check version"),console.log("")}async function main(){scheduleUpdateNotice();const n=new Set(["login","logout","whoami","uninstall","config","help","--help","-h","--version","-v"]),a=args[1]==="--help"||args[1]==="-h"||args[1]==="help",l=command!==void 0&&!n.has(command);if(l&&!a){const{checkEntitlement:e}=require("../scripts-dist/lib/entitlement/check.js");(await e({interactive:!0}).catch(()=>null))?.status!=="active"&&(console.error("\u2717 no access \u2014 this command needs an authorized login. Run `agentkit login`."),process.exit(1))}if(l&&!clientHasPayload&&await runInPayload(args),command==="db-first"){const e=path.join(__dirname,"db-first.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="mobile"){const e=path.join(__dirname,"mobile.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="frontend"){const e=path.join(__dirname,"frontend.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="stack"){const e=path.join(__dirname,"stack.js"),s=spawnSync(process.execPath,[e,...args.slice(1)],{stdio:"inherit"});process.exit(s.status==null?1:s.status)}else if(command==="login")require("../scripts-dist/cli/agentkit-login.js");else if(command==="logout")require("../scripts-dist/cli/agentkit-logout.js");else if(command==="whoami")require("../scripts-dist/cli/agentkit-whoami.js");else if(command==="init"){const{resolveInstallSource:e,NoAccessError:s}=require("../scripts-dist/lib/payload/source.js"),{getPayloadVersion:o}=require("../scripts-dist/lib/version-check.js"),t=path.join(__dirname,".."),i=args.indexOf("--ref"),r=i!==-1?args[i+1]:void 0;i!==-1&&(!r||r.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit init --ref <tag|branch|sha>"),process.exit(1));const g=i!==-1?r:void 0;i!==-1&&process.argv.splice(2+i,2);try{const c=await e({version:o(t)??"0.0.0",ref:g,interactive:!0,cliRoot:t});process.env.AGENTKIT_SOURCE_ROOT=c.root,require("../scripts-dist/cli/agentkit-init.js")}catch(c){c instanceof s?console.error(`\u2717 ${c.message}`):console.error(`\u2717 Could not resolve the kit payload: ${c.message}`),process.exit(1)}}else if(command==="profile")require("../scripts-dist/cli/agentkit-profile.js");else if(command==="update")require("../scripts-dist/cli/agentkit-update.js");else if(command==="clear")require("../scripts-dist/cli/agentkit-clear.js");else if(command==="uninstall")require("../scripts-dist/cli/agentkit-uninstall.js");else if(command==="config")require("../scripts-dist/cli/agentkit-config.js");else if(command==="decide")require("../scripts-dist/cli/agentkit-decide.js");else if(command==="skills")require("../scripts-dist/cli/agentkit-skills.js");else if(command==="doctor")require("../scripts-dist/cli/agentkit-doctor.js");else if(command==="status")require("../scripts-dist/cli/agentkit-status.js");else if(command==="dashboard")require("../scripts-dist/cli/agentkit-dashboard.js");else if(command==="hooks")require("../scripts-dist/cli/agentkit-hooks.js");else if(command==="help"&&args[1]){const e=args[1];if(!clientHasPayload&&!new Set(["profile","profiles","login","logout","whoami","uninstall"]).has(e)&&await runInPayload(["help",e]),e==="profile"||e==="profiles")printProfilesGuide();else if(e==="db-first"){const o=path.join(__dirname,"db-first.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else if(e==="mobile"){const o=path.join(__dirname,"mobile.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else if(e==="frontend"){const o=path.join(__dirname,"frontend.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else if(e==="stack"){const o=path.join(__dirname,"stack.js"),t=spawnSync(process.execPath,[o,"--help"],{stdio:"inherit"});process.exit(t.status==null?1:t.status)}else e==="login"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-login.js"),"--help"],require("../scripts-dist/cli/agentkit-login.js")):e==="logout"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-logout.js"),"--help"],require("../scripts-dist/cli/agentkit-logout.js")):e==="whoami"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-whoami.js"),"--help"],require("../scripts-dist/cli/agentkit-whoami.js")):e==="init"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-init.js"),"--help"],require("../scripts-dist/cli/agentkit-init.js")):e==="update"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-update.js"),"--help"],require("../scripts-dist/cli/agentkit-update.js")):e==="clear"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-clear.js"),"--help"],require("../scripts-dist/cli/agentkit-clear.js")):e==="uninstall"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-uninstall.js"),"--help"],require("../scripts-dist/cli/agentkit-uninstall.js")):e==="config"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-config.js"),"--help"],require("../scripts-dist/cli/agentkit-config.js")):e==="decide"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-decide.js"),"--help"],require("../scripts-dist/cli/agentkit-decide.js")):e==="skills"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-skills.js"),"help"],require("../scripts-dist/cli/agentkit-skills.js")):e==="doctor"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-doctor.js"),"--help"],require("../scripts-dist/cli/agentkit-doctor.js")):e==="status"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-status.js"),"--help"],require("../scripts-dist/cli/agentkit-status.js")):e==="dashboard"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-dashboard.js"),"--help"],require("../scripts-dist/cli/agentkit-dashboard.js")):e==="hooks"?(process.argv=[process.argv[0],path.join(__dirname,"..","scripts-dist","cli","agentkit-hooks.js"),"help"],require("../scripts-dist/cli/agentkit-hooks.js")):(console.log(`Unknown command: ${e}`),console.log(""),printGeneralHelp(),process.exit(1))}else if(command==="--version"||command==="-v"){const e=require("../package.json");let s=typeof e.payloadVersion=="string"?e.payloadVersion:null;try{const{newestTagInstalledTree:t}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:i}=require("../scripts-dist/lib/agentkit-home.js");s=t(i())?.version??s}catch{}const o=s&&s!==e.version?` (payload v${s})`:"";console.log(`v${e.version}${o}`)}else printGeneralHelp()}main();
|
|
2
|
+
const path=require("path"),fs=require("fs"),{spawnSync}=require("child_process"),args=process.argv.slice(2),command=args[0],packageRoot=path.join(__dirname,".."),PAYLOAD_ROOTS=["skills","rules","agents","agent-kit"],clientHasPayload=PAYLOAD_ROOTS.every(e=>{try{return fs.statSync(path.join(packageRoot,e)).isDirectory()}catch{return!1}});async function runInPayload(e){const{resolveInstallSource:t,NoAccessError:o}=require("../scripts-dist/lib/payload/source.js"),{execPayload:n}=require("../scripts-dist/lib/payload/exec.js"),s=e.indexOf("--ref"),l=s!==-1?e[s+1]:void 0;s!==-1&&(!l||l.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit <command> --ref <tag|branch|sha>"),process.exit(1));const{getPayloadVersion:i}=require("../scripts-dist/lib/version-check.js");try{const a=await t({version:i(packageRoot)??"0.0.0",ref:l,interactive:!0,cliRoot:packageRoot}),r=path.join(packageRoot,"node_modules"),c=n(process.execPath,[path.join(a.root,"bin","agentkit.js"),...e],{env:{...process.env,NODE_PATH:r,AGENTKIT_NODE_MODULES:r}});process.exit(c.status==null?1:c.status)}catch(a){a instanceof o?console.error(`\u2717 ${a.message}`):console.error(`\u2717 Could not resolve the kit payload: ${a.message}`),process.exit(1)}}function scheduleUpdateNotice(){try{const{maybeNotifyUpdate:e}=require("../scripts-dist/lib/update-notifier"),{getPayloadVersion:t}=require("../scripts-dist/lib/version-check.js");let o=t(packageRoot);try{const{newestTagInstalledTree:n}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:s}=require("../scripts-dist/lib/agentkit-home.js");o=n(s())?.version??o}catch{}e({currentVersion:o??"0.0.0"})}catch{}}function printProfilesGuide(){console.log("Profiles:"),console.log(" Every install takes a slice of the skill catalog. Leave --profile out and you get the"),console.log(" default for your kit; name one to take a different slice."),console.log(""),console.log(" core Workflow + tooling, minus vendor suites and niche extras (default)"),console.log(" full Every skill the kit ships"),console.log(" frontend core + frontend, design, frameworks"),console.log(" backend core + backend, database, infrastructure, security"),console.log(" mobile core + frontend, frameworks, design"),console.log(" fullstack core + frontend, backend, database, infrastructure, frameworks, design"),console.log(" gamedev core + gamedev, multimedia"),console.log(" also names: threejs, shader, ai-artist, ai-multimodal, ui-ux-pro-max, ak-scenario, ak-optimize"),console.log(" marketing core + marketing, design, seo, documents, multimedia"),console.log(" also names: ai-artist, ai-multimodal, copywriting, show-off, project-management,"),console.log(" frontend-design, agent-browser, project-organization, ak-sowat, enhance-ux-ax"),console.log(" dependency: enhance-ux-ax installs with seo (its AX engine)"),console.log(" assistant The personal agents' set \u2014 hermes and openclaw default here"),console.log(""),console.log(" The choice is recorded per kit (.agentkit.json) and reapplied on update, so a later"),console.log(" agentkit init keeps it without the flag; --profile overrides it."),console.log(""),console.log(" Missing a skill a wider profile would have installed?"),console.log(" agentkit skills list Browse the whole catalog (\u2713 = installed here)"),console.log(" agentkit skills add <name> Install one; later updates keep it"),console.log(" agentkit skills add <name> --project Install into the current project (--kit <kit>)"),console.log("")}function printGeneralHelp(){console.log("Agentkit CLI"),console.log(""),console.log("Usage:"),console.log(" agentkit <command> [options]"),console.log(" agentkit help [command]"),console.log(""),console.log("Commands:"),console.log(" agentkit init [kit] Initialize AI development kit (project or global)"),console.log(" agentkit login Authorize this machine to reach the kit repository"),console.log(" agentkit logout Remove the stored login and entitlement cache"),console.log(" agentkit whoami Show the logged-in account and its entitlement"),console.log(" agentkit profile Manage install profiles (remove)"),console.log(" agentkit update Upgrade the Agentkit CLI itself to the latest release"),console.log(" agentkit clear Remove Agentkit installations (project or global)"),console.log(" agentkit uninstall Remove Agentkit CLI from your system (global uninstall)"),console.log(" agentkit config Manage auto-update settings"),console.log(" agentkit skills Discover and install skills (list / pick / add / remove)"),console.log(" agentkit doctor Report the health of the installed kit"),console.log(" agentkit status List every kit install on this machine"),console.log(" agentkit dashboard Open the local dashboard in your browser"),console.log(" agentkit hooks See and set hook toggles (list / enable / disable)"),console.log(" agentkit db-first Scaffold a database-first backend project"),console.log(" agentkit mobile Scaffold a mobile project (Expo or Flutter)"),console.log(" agentkit frontend Scaffold a web frontend (agent workflow handoff)"),console.log(" agentkit stack Full-stack workflow tools (typed API client generator)"),console.log(""),console.log("Options:"),console.log(" --help, -h Show this help message"),console.log(" --version, -v Show CLI version"),console.log(""),printProfilesGuide(),console.log("Examples:"),console.log(" agentkit init # Run interactive installer"),console.log(" agentkit init claude # Initialize Claude Code directly (no kit menu)"),console.log(" agentkit init omp # Target a global-only kit (hermes, openclaw, omp)"),console.log(" agentkit init --profile frontend # Install only frontend-relevant skills"),console.log(" agentkit profile remove claude # Reinstall Claude with the core profile"),console.log(" agentkit profile remove --global # Remove profiles from global installs"),console.log(" # Switching an existing profile with init asks for confirmation"),console.log(" agentkit skills # Browse and pick skills to install"),console.log(" agentkit skills add databases # Add one or more skills by name"),console.log(" agentkit skills add expo --project # Add a skill into the current project"),console.log(" agentkit skills remove databases # Undo an add: delete it and forget it"),console.log(" agentkit doctor # Check the installed kit's health"),console.log(" agentkit doctor --json # Same, machine-readable"),console.log(" agentkit status # Every kit install and version"),console.log(" agentkit status --scan # Choose the directories to search"),console.log(" agentkit hooks list # Show every hook toggle"),console.log(" agentkit hooks disable scout-block # Turn one hook off"),console.log(" agentkit update # Upgrade the Agentkit CLI itself"),console.log(" agentkit clear # Remove Agentkit files from project/global"),console.log(" agentkit uninstall # Remove Agentkit CLI from system"),console.log(" agentkit config autoupdate # Show auto-update status"),console.log(" agentkit config autoupdate on # Enable auto-update"),console.log(" agentkit config semantic # Semantic decisions: status (off by default)"),console.log(" agentkit config semantic enable # Enable the semantic-decision layer"),console.log(" agentkit decide < payload.json # Ask a decision model one typed question set"),console.log(" agentkit db-first init myapp postgresql # Scaffold a backend project"),console.log(" agentkit mobile init myapp # Scaffold a mobile project"),console.log(" agentkit frontend init myapp --framework nextjs # Frontend Mode handoff"),console.log(" agentkit stack client ./api ./web/src # Typed client from the API's schema"),console.log(" agentkit help <command> # Show detailed help for a command"),console.log(" agentkit help profile # What each install profile includes"),console.log(" agentkit -v # Check version"),console.log("")}function runSiblingBin(e,t){const o=spawnSync(process.execPath,[path.join(__dirname,e),...t],{stdio:"inherit"});process.exit(o.status==null?1:o.status)}function cliEntryPath(e){return path.join(packageRoot,"scripts-dist","cli",`agentkit-${e}.js`)}function requireCliEntry(e){require(cliEntryPath(e))}async function runInit(){const{resolveInstallSource:e,NoAccessError:t}=require("../scripts-dist/lib/payload/source.js"),{getPayloadVersion:o}=require("../scripts-dist/lib/version-check.js"),n=args.indexOf("--ref"),s=n!==-1?args[n+1]:void 0;n!==-1&&(!s||s.startsWith("--"))&&(console.error("\u2717 --ref needs a value: agentkit init --ref <tag|branch|sha>"),process.exit(1));const l=n!==-1?s:void 0;n!==-1&&process.argv.splice(2+n,2);try{const i=await e({version:o(packageRoot)??"0.0.0",ref:l,interactive:!0,cliRoot:packageRoot});process.env.AGENTKIT_SOURCE_ROOT=i.root,requireCliEntry("init")}catch(i){i instanceof t?console.error(`\u2717 ${i.message}`):console.error(`\u2717 Could not resolve the kit payload: ${i.message}`),process.exit(1)}}async function runHelpTopic(e){!clientHasPayload&&!new Set(["profile","profiles","login","logout","whoami","uninstall"]).has(e)&&await runInPayload(["help",e]);const o=new Set(["db-first","mobile","frontend","stack"]),n=new Map([["login","--help"],["logout","--help"],["whoami","--help"],["init","--help"],["update","--help"],["clear","--help"],["uninstall","--help"],["config","--help"],["decide","--help"],["doctor","--help"],["status","--help"],["dashboard","--help"],["skills","help"],["hooks","help"]]);e==="profile"||e==="profiles"?printProfilesGuide():o.has(e)?runSiblingBin(`${e}.js`,["--help"]):n.has(e)?(process.argv=[process.argv[0],cliEntryPath(e),n.get(e)],requireCliEntry(e)):(console.log(`Unknown command: ${e}`),console.log(""),printGeneralHelp(),process.exit(1))}function printVersion(){const e=require("../package.json");let t=typeof e.payloadVersion=="string"?e.payloadVersion:null;try{const{newestTagInstalledTree:n}=require("../scripts-dist/lib/payload/source.js"),{loadAgentkitHomeCore:s}=require("../scripts-dist/lib/agentkit-home.js");t=n(s())?.version??t}catch{}const o=t&&t!==e.version?` (payload v${t})`:"";console.log(`v${e.version}${o}`)}async function main(){scheduleUpdateNotice();const e=new Set(["login","logout","whoami","uninstall","config","help","--help","-h","--version","-v"]),t=args[1]==="--help"||args[1]==="-h"||args[1]==="help",o=command!==void 0&&!e.has(command);if(o&&!t){const{checkEntitlement:l}=require("../scripts-dist/lib/entitlement/check.js");(await l({interactive:!0}).catch(()=>null))?.status!=="active"&&(console.error("\u2717 no access \u2014 this command needs an authorized login. Run `agentkit login`."),process.exit(1))}o&&!clientHasPayload&&await runInPayload(args);const s=[{when:command==="db-first",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="mobile",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="frontend",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="stack",run:()=>runSiblingBin(`${command}.js`,args.slice(1))},{when:command==="login",run:()=>requireCliEntry(command)},{when:command==="logout",run:()=>requireCliEntry(command)},{when:command==="whoami",run:()=>requireCliEntry(command)},{when:command==="init",run:runInit},{when:command==="profile",run:()=>requireCliEntry(command)},{when:command==="update",run:()=>requireCliEntry(command)},{when:command==="clear",run:()=>requireCliEntry(command)},{when:command==="uninstall",run:()=>requireCliEntry(command)},{when:command==="config",run:()=>requireCliEntry(command)},{when:command==="decide",run:()=>requireCliEntry(command)},{when:command==="skills",run:()=>requireCliEntry(command)},{when:command==="doctor",run:()=>requireCliEntry(command)},{when:command==="status",run:()=>requireCliEntry(command)},{when:command==="dashboard",run:()=>requireCliEntry(command)},{when:command==="hooks",run:()=>requireCliEntry(command)},{when:command==="help"&&args[1],run:()=>runHelpTopic(args[1])},{when:command==="--version"||command==="-v",run:printVersion}].find(l=>l.when);s?await s.run():printGeneralHelp()}main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linhnguyen96114/agentkit-engineer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Agentkit thin client — downloads and installs the Agentkit payload after `agentkit login` entitlement.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/linhnguyen-gt/agentkit-engineer.git"
|
|
22
22
|
},
|
|
23
|
-
"payloadVersion": "7.
|
|
23
|
+
"payloadVersion": "7.11.0",
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
}
|
|
@@ -7,6 +7,6 @@ Usage:
|
|
|
7
7
|
agentkit logout
|
|
8
8
|
|
|
9
9
|
Clears the credential-store entry, ~/.agentkit/auth.json and
|
|
10
|
-
~/.agentkit/entitlement.json. Fetched payload versions
|
|
11
|
-
|
|
10
|
+
~/.agentkit/entitlement.json. Fetched payload versions are kept;
|
|
11
|
+
'agentkit uninstall' removes them.
|
|
12
12
|
`)}(0,cli_2.runCli)({command:"logout",printHelp,helpArgs:cli_2.helpFlagsOnly,handler:()=>(0,cli_1.runLogout)()});
|
|
@@ -14,12 +14,17 @@ Commands:
|
|
|
14
14
|
help Show this help message
|
|
15
15
|
|
|
16
16
|
Options:
|
|
17
|
+
--project, -p Target the current project directory
|
|
18
|
+
--global, -g Target a global kit install
|
|
19
|
+
--kit, -k <name> Target a specific kit by name (e.g. claude, cursor, codex)
|
|
17
20
|
--help, -h Show this help message
|
|
18
21
|
|
|
19
22
|
Examples:
|
|
20
|
-
agentkit skills
|
|
21
|
-
agentkit skills list
|
|
22
|
-
agentkit skills add databases
|
|
23
|
-
agentkit skills add
|
|
24
|
-
agentkit skills
|
|
23
|
+
agentkit skills # Interactive skill picker
|
|
24
|
+
agentkit skills list # Print all available skills
|
|
25
|
+
agentkit skills add databases # Add skill to active kit (project or global)
|
|
26
|
+
agentkit skills add databases --project # Add skill to current project
|
|
27
|
+
agentkit skills add expo -p -k claude # Add skill to project for a specific kit
|
|
28
|
+
agentkit skills add gsap --global # Add skill to global install
|
|
29
|
+
agentkit skills remove databases --project # Remove a previously added project skill
|
|
25
30
|
`)}(0,cli_1.runCli)({command:"skills",printHelp,helpArgs:l=>l.includes("--help")||l.includes("-h")||l[0]==="help"||l[1]==="help",handler:cli_2.runSkills});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,a,r){r===void 0&&(r=a);var o=Object.getOwnPropertyDescriptor(e,a);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,o)}):(function(t,e,a,r){r===void 0&&(r=a),t[r]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(a){var r=[];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[r.length]=o);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var r=t(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(a,e,r[o]);return __setModuleDefault(a,e),a}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseOwnerRepo=parseOwnerRepo,exports.normalizeVersion=normalizeVersion,exports.interpretTagOutput=interpretTagOutput,exports.fetchLatestTag=fetchLatestTag,exports.fetchCommitsBehind=fetchCommitsBehind,exports.buildDriftRow=buildDriftRow;const child_process_1=require("child_process"),generate_catalogs_1=require("./generate-catalogs"),path=__importStar(require("path")),REPO_ROOT=path.resolve(__dirname,"..","..");function parseOwnerRepo(t){const e=t.match(/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return e?`${e[1]}/${e[2]}`:null}function normalizeVersion(t){return t.replace(/^v/,"").trim()}function interpretTagOutput(t){return{reachable:!0,tag:t.trim()||null}}function fetchLatestTag(t){try{return interpretTagOutput((0,child_process_1.execFileSync)("gh",["api",`repos/${t}/tags`,"--jq",".[0].name"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}))}catch{return{reachable:!1}}}function fetchCommitsBehind(t,e){try{const a=(0,child_process_1.execFileSync)("gh",["api",`repos/${t}/compare/${e}...HEAD`,"--jq",".ahead_by"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim(),r=Number.parseInt(a,10);return Number.isNaN(r)?null:r}catch{return null}}function buildDriftRow(t,e,a=null){const r=parseOwnerRepo(t.upstream??"")??t.upstream??"?",o=t.upstream_version?normalizeVersion(t.upstream_version):null,u=e.reachable?e.tag:null,
|
|
2
|
-
`);const e=[];for(const n of t){const s=parseOwnerRepo(n.upstream??"")
|
|
3
|
-
\u26A0 ${
|
|
4
|
-
\u2139 ${
|
|
5
|
-
Version comparison is impossible by design there \u2014 compare by commit, or re-sync on a date.`)}
|
|
6
|
-
\u26A0 ${
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,a,r){r===void 0&&(r=a);var o=Object.getOwnPropertyDescriptor(e,a);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(t,r,o)}):(function(t,e,a,r){r===void 0&&(r=a),t[r]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(a){var r=[];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(r[r.length]=o);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var r=t(e),o=0;o<r.length;o++)r[o]!=="default"&&__createBinding(a,e,r[o]);return __setModuleDefault(a,e),a}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseOwnerRepo=parseOwnerRepo,exports.normalizeVersion=normalizeVersion,exports.interpretTagOutput=interpretTagOutput,exports.fetchLatestTag=fetchLatestTag,exports.fetchCommitsBehind=fetchCommitsBehind,exports.buildDriftRow=buildDriftRow;const child_process_1=require("child_process"),generate_catalogs_1=require("./generate-catalogs"),path=__importStar(require("path")),REPO_ROOT=path.resolve(__dirname,"..","..");function parseOwnerRepo(t){const e=t.match(/github\.com\/([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return e?`${e[1]}/${e[2]}`:null}function normalizeVersion(t){return t.replace(/^v/,"").trim()}function interpretTagOutput(t){return{reachable:!0,tag:t.trim()||null}}function fetchLatestTag(t){try{return interpretTagOutput((0,child_process_1.execFileSync)("gh",["api",`repos/${t}/tags`,"--jq",".[0].name"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}))}catch{return{reachable:!1}}}function fetchCommitsBehind(t,e){try{const a=(0,child_process_1.execFileSync)("gh",["api",`repos/${t}/compare/${e}...HEAD`,"--jq",".ahead_by"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim(),r=Number.parseInt(a,10);return Number.isNaN(r)?null:r}catch{return null}}function buildDriftRow(t,e,a=null){const r=parseOwnerRepo(t.upstream??"")??t.upstream??"?",o=t.upstream_version?normalizeVersion(t.upstream_version):null,u=e.reachable?e.tag:null,p=!!(t.upstream_commit&&e.reachable&&(!t.upstream_version||e.tag===null));let i;if(!e.reachable)i="unreachable";else if(p){if(a!==null)return{skill:t.name,ownerRepo:r,local:t.upstream_commit.slice(0,12),latest:`HEAD~${a}`,state:a===0?"current":"behind"};i="untagged"}else e.tag===null?i="untagged":o===null?i="unpinned":i=normalizeVersion(e.tag)===o?"current":"behind";return{skill:t.name,ownerRepo:r,local:o,latest:u,state:i}}function main(){const t=(0,generate_catalogs_1.collectSkills)(REPO_ROOT).filter(n=>n.upstream);if(t.length===0){console.log("No vendored skills declare an `upstream` \u2014 nothing to check.");return}console.log(`Checking ${t.length} vendored skill(s) against upstream tags...
|
|
2
|
+
`);const e=[],a=new Map,r=new Map;for(const n of t){const s=parseOwnerRepo(n.upstream??"");let l={reachable:!1};s&&(a.has(s)||a.set(s,fetchLatestTag(s)),l=a.get(s));let d=null;if(s&&n.upstream_commit&&l.reachable&&(!n.upstream_version||l.tag===null)){const f=`${s}@${n.upstream_commit}`;r.has(f)||r.set(f,fetchCommitsBehind(s,n.upstream_commit)),d=r.get(f)}e.push(buildDriftRow(n,l,d))}const o=(n,s)=>Math.max(n.length,...s.map(l=>(l??"\u2014").length))+2,u=o("LOCAL",e.map(n=>n.local)),p=o("LATEST",e.map(n=>n.latest)),i=o("SKILL",e.map(n=>n.skill)),c=(n,s)=>n.padEnd(s);console.log(c("SKILL",i)+c("LOCAL",u)+c("LATEST",p)+"STATE");for(const n of e)console.log(c(n.skill,i)+c(n.local??"\u2014",u)+c(n.latest??"\u2014",p)+n.state);const g=e.filter(n=>n.state==="behind"),h=e.filter(n=>n.state==="untagged"),m=e.filter(n=>n.state==="unreachable");if(g.length>0&&console.warn(`
|
|
3
|
+
\u26A0 ${g.length} skill(s) behind upstream \u2014 consider a re-sync.`),h.length>0){const n=[...new Set(h.map(s=>s.ownerRepo))].join(", ");console.warn(`
|
|
4
|
+
\u2139 ${h.length} skill(s) track an upstream that publishes no tags (${n}).
|
|
5
|
+
Version comparison is impossible by design there \u2014 compare by commit, or re-sync on a date.`)}m.length>0&&console.warn(`
|
|
6
|
+
\u26A0 ${m.length} upstream(s) unreachable (no network / no gh auth / repo gone) \u2014 skipped.`)}require.main===module&&main();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`),k(),process.exit(1)}}catch(o){console.error("Error:",o instanceof Error?o.message:o),process.exit(1)}}function C(e){let n=w(e);n||(console.error("Usage: agentkit frontend init <app> --framework <nextjs|react|vue|angular> [--archetype <landing|crud-list|dashboard>] [--package-manager <npm|yarn|pnpm>]"),process.exit(1));let o=p(e,"--framework");o||(console.log(b(n)),process.exit(0)),
|
|
2
|
+
"use strict";var x=Object.create,u=Object.defineProperty,v=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,A=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,S=(e,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of $(n))!j.call(e,r)&&r!==o&&u(e,r,{get:()=>n[r],enumerable:!(a=v(n,r))||a.enumerable});return e},m=(e,n,o)=>(o=e!=null?x(A(e)):{},S(n||!e||!e.__esModule?u(o,"default",{value:e,enumerable:!0}):o,e)),t=m(require("fs")),s=m(require("path")),i=["nextjs","react","vue","angular","nuxt"],f=["landing","crud-list","dashboard"],d=["npm","yarn","pnpm"];function E(e){return i.includes(e)}function F(e){return f.includes(e)}function M(e){return d.includes(e)}function p(e,n){let o=e.indexOf(n);return o>=0&&o+1<e.length?e[o+1]:void 0}function w(e){return e.find(n=>!n.startsWith("-"))}function R(){let e=process.argv.slice(2),n=e[0];(!n||n==="help"||n==="--help"||n==="-h")&&(k(),process.exit(0));try{switch(n){case"init":C(e.slice(1));break;case"run":P(e.slice(1));break;default:console.error(`Unknown command: ${n}
|
|
3
|
+
`),k(),process.exit(1)}}catch(o){console.error("Error:",o instanceof Error?o.message:o),process.exit(1)}}function C(e){let n=w(e);n||(console.error("Usage: agentkit frontend init <app> --framework <nextjs|react|vue|angular|nuxt> [--archetype <landing|crud-list|dashboard>] [--package-manager <npm|yarn|pnpm>]"),process.exit(1));let o=p(e,"--framework");o||(console.log(b(n)),process.exit(0)),E(o)||(console.error(`Unknown framework "${o}". Expected one of: ${i.join(", ")}`),process.exit(1));let a=null,r=p(e,"--archetype");r&&(F(r)||(console.error(`Unknown archetype "${r}". Expected one of: ${f.join(", ")}`),process.exit(1)),a=r);let c=p(e,"--package-manager")??"npm";M(c)||(console.error(`Unknown package manager "${c}". Expected one of: ${d.join(", ")}`),process.exit(1));let l={framework:o,archetype:a,packageManager:c},g=s.join(process.cwd(),"plans",n);t.mkdirSync(g,{recursive:!0});let h=s.join(g,"frontend.config.json");t.writeFileSync(h,`${JSON.stringify(l,null,2)}
|
|
4
4
|
`,"utf-8"),console.log(`\u2713 wrote ${s.relative(process.cwd(),h)}`),console.log(""),console.log(y(l,n))}function P(e){let n=w(e);n||(console.error("Usage: agentkit frontend run <app>"),process.exit(1));let o=s.join(process.cwd(),"plans",n,"frontend.config.json");t.existsSync(o)||(console.log(`No frontend.config.json for "${n}". Run "agentkit frontend init ${n} --framework <fw>" first, or invoke the workflow directly:
|
|
5
5
|
`),console.log(b(n)),process.exit(0));let a=JSON.parse(t.readFileSync(o,"utf-8"));console.log(`Frontend Mode handoff for "${n}" (from ${s.relative(process.cwd(),o)}):
|
|
6
6
|
`),console.log(y(a,n))}function y(e,n){let o=e.archetype?`archetype "${e.archetype}" \u2014 adopted as your answer, so the workflow skips the classify prompt`:"archetype classified from your prompt (the workflow confirms it if unsure)";return["Next \u2014 the clickable UI is generated by the AI agent, not this CLI. Run:","",` /bootstrap:frontend:${e.framework} "<describe ${n}>"`,"",` - package manager: ${e.packageManager} \u2014 adopted, so the workflow does not ask`,` - ${o}`,` - the workflow reads these from plans/${n}/frontend.config.json`," - the agent scaffolds via the framework's official CLI, applies ui-ux-pro-max"," tokens, generates screens/routing/state, and proves it with the"," build/boot/lint/Playwright-smoke gate."].join(`
|
|
@@ -27,7 +27,7 @@ Archetypes (derived): ${f.join(", ")} (landing = no state)
|
|
|
27
27
|
Package managers: ${d.join(", ")} (default npm)
|
|
28
28
|
|
|
29
29
|
Options (init):
|
|
30
|
-
--framework <name> nextjs | react | vue | angular
|
|
30
|
+
--framework <name> nextjs | react | vue | angular | nuxt
|
|
31
31
|
--archetype <name> landing | crud-list | dashboard (optional; else derived)
|
|
32
32
|
--package-manager <name> npm | yarn | pnpm (default npm)
|
|
33
33
|
|
|
@@ -36,6 +36,7 @@ Run the workflow in your AI agent:
|
|
|
36
36
|
/bootstrap:frontend:react "a SaaS landing page with hero, features and pricing"
|
|
37
37
|
/bootstrap:frontend:vue "an analytics dashboard with 3 screens"
|
|
38
38
|
/bootstrap:frontend:angular "a task manager"
|
|
39
|
+
/bootstrap:frontend:nuxt "a SaaS dashboard with analytics"
|
|
39
40
|
|
|
40
41
|
Examples:
|
|
41
42
|
agentkit frontend
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,r,e,n){n===void 0&&(n=e);var a=Object.getOwnPropertyDescriptor(r,e);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,n,a)}):(function(t,r,e,n){n===void 0&&(n=e),t[n]=r[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}):function(t,r){t.default=r}),__importStar=this&&this.__importStar||(function(){var t=function(r){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[n.length]=a);return n},t(r)};return function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var n=t(r),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(e,r,n[a]);return __setModuleDefault(e,r),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.GUIDE_COMMANDS_END=exports.GUIDE_COMMANDS_START=exports.SKILL_STATUSES=exports.CATEGORY_TITLES=void 0,exports.collectSkills=collectSkills,exports.collectAgents=collectAgents,exports.collectCommands=collectCommands,exports.renderSkillsYaml=renderSkillsYaml,exports.renderAgentsYaml=renderAgentsYaml,exports.renderCommandsYaml=renderCommandsYaml,exports.renderSkillsReadme=renderSkillsReadme,exports.slashInvocation=slashInvocation,exports.renderGuideCommandSection=renderGuideCommandSection,exports.syncGuideCommandSections=syncGuideCommandSections,exports.generateCatalogs=generateCatalogs;const fs=__importStar(require("fs")),path=__importStar(require("path")),frontmatter_1=require("../lib/frontmatter"),agent_metadata_1=require("../lib/kit-installers/agent-metadata"),payload_roots_1=require("../lib/payload-roots"),SKILL_GROUPS=[],NOT_SKILLS=new Set(["common",...SKILL_GROUPS]);exports.CATEGORY_TITLES={"ai-ml":"AI & Machine Learning",frontend:"Frontend & Design",backend:"Backend Development",infrastructure:"Infrastructure & DevOps",database:"Database & Storage","dev-tools":"Development Tools",multimedia:"Multimedia & Processing",frameworks:"Frameworks & Platforms",security:"Security",design:"Design",documents:"Document Processing",marketing:"Marketing & Growth",seo:"SEO & Search",utilities:"Utilities & Helpers",other:"Other"},exports.SKILL_STATUSES=new Set(["experimental","stable","deprecated"]);function yamlString(t){return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function readSkill(t,r,e){const n=path.join(t,e),a=path.join(n,"SKILL.md");if(!fs.existsSync(a))return null;const s=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(a,"utf8")),i=(0,frontmatter_1.cleanFrontmatterValue)(s.category)||"other",o=(0,frontmatter_1.cleanFrontmatterValue)(s.status)||"stable";return{name:r,path:`${e}/SKILL.md`,description:(0,frontmatter_1.cleanFrontmatterValue)(s.description),category:i in exports.CATEGORY_TITLES?i:"other",status:exports.SKILL_STATUSES.has(o)?o:"stable",user_invocable:(0,frontmatter_1.cleanFrontmatterValue)(s["user-invocable"])==="true",has_scripts:fs.existsSync(path.join(n,"scripts")),has_references:fs.existsSync(path.join(n,"references")),...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)?{upstream:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)?{upstream_commit:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)?{upstream_version:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.synced)?{synced:(0,frontmatter_1.cleanFrontmatterValue)(s.synced)}:{}}}function collectSkills(t){const r=path.join(t,payload_roots_1.SKILL_SOURCE_DIR),e=[];for(const n of fs.readdirSync(r,{withFileTypes:!0})){if(!n.isDirectory()||n.name.startsWith("."))continue;if(SKILL_GROUPS.includes(n.name)){const s=path.join(r,n.name);for(const i of fs.readdirSync(s,{withFileTypes:!0})){if(!i.isDirectory())continue;const o=readSkill(r,i.name,`${n.name}/${i.name}`);o&&e.push({...o,category:"documents"})}continue}if(NOT_SKILLS.has(n.name))continue;const a=readSkill(r,n.name,n.name);a&&e.push(a)}return e.sort((n,a)=>n.name.localeCompare(a.name))}function collectAgents(t){const{agents:r}=(0,agent_metadata_1.readAgentsDir)(path.join(t,payload_roots_1.AGENTS_SOURCE_DIR));return r.map(e=>({name:e.name,path:`${e.name}.md`,description:(0,agent_metadata_1.trimmedDescription)(e.description),model:e.model??"inherit",read_only:e.readOnly,memory:e.memory??"none"}))}function collectCommands(t){const r=path.join(t,payload_roots_1.COMMAND_SOURCE_DIR),e=[],n=a=>{for(const s of fs.readdirSync(a,{withFileTypes:!0})){const i=path.join(a,s.name);if(s.isDirectory())n(i);else if(s.name.endsWith(".md")){const o=path.relative(r,i),l=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(i,"utf8"));e.push({name:o.replace(/\.md$/,""),path:o,description:(0,frontmatter_1.cleanFrontmatterValue)(l.description)})}}};return n(r),e.sort((a,s)=>a.name.localeCompare(s.name))}function renderSkillsYaml(t){const r=[...new Set(t.map(n=>n.category))].sort(),e=["# Generated by scripts/gen/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing a skill.","metadata:"," title: Skills Catalog"," description: Catalog of every skill in AgentKit Engineer, generated from skills/.",` total_skills: ${t.length}`,` user_invocable: ${t.filter(n=>n.user_invocable).length}`,"categories:",...r.map(n=>` ${n}: ${yamlString(exports.CATEGORY_TITLES[n])}`),"legend:"," user_invocable: Callable directly as /<name>"," has_scripts: Ships executable scripts"," has_references: Ships reference documentation"," status: Lifecycle label (experimental | stable | deprecated); deprecated still installs","skills:"];for(const n of r){e.push(` ${n}:`);for(const a of t.filter(s=>s.category===n))e.push(` - name: ${a.name}`,` path: ${a.path}`,` description: ${yamlString(a.description)}`,` status: ${a.status}`,` user_invocable: ${a.user_invocable}`,` has_scripts: ${a.has_scripts}`,` has_references: ${a.has_references}`),a.upstream&&(e.push(` upstream: ${yamlString(a.upstream)}`),a.upstream_version&&e.push(` upstream_version: ${yamlString(a.upstream_version)}`),a.upstream_commit&&e.push(` upstream_commit: ${yamlString(a.upstream_commit)}`),a.synced&&e.push(` synced: ${yamlString(a.synced)}`))}return`${e.join(`
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,r,e,n){n===void 0&&(n=e);var a=Object.getOwnPropertyDescriptor(r,e);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,n,a)}):(function(t,r,e,n){n===void 0&&(n=e),t[n]=r[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}):function(t,r){t.default=r}),__importStar=this&&this.__importStar||(function(){var t=function(r){return t=Object.getOwnPropertyNames||function(e){var n=[];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[n.length]=a);return n},t(r)};return function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var n=t(r),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(e,r,n[a]);return __setModuleDefault(e,r),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.GUIDE_COMMANDS_END=exports.GUIDE_COMMANDS_START=exports.SKILL_STATUSES=exports.CATEGORY_TITLES=void 0,exports.collectSkills=collectSkills,exports.collectAgents=collectAgents,exports.collectCommands=collectCommands,exports.renderSkillsYaml=renderSkillsYaml,exports.renderAgentsYaml=renderAgentsYaml,exports.renderCommandsYaml=renderCommandsYaml,exports.renderSkillsReadme=renderSkillsReadme,exports.slashInvocation=slashInvocation,exports.renderGuideCommandSection=renderGuideCommandSection,exports.syncGuideCommandSections=syncGuideCommandSections,exports.generateCatalogs=generateCatalogs;const fs=__importStar(require("fs")),path=__importStar(require("path")),frontmatter_1=require("../lib/frontmatter"),agent_metadata_1=require("../lib/kit-installers/agent-metadata"),payload_roots_1=require("../lib/payload-roots"),SKILL_GROUPS=[],NOT_SKILLS=new Set(["common",...SKILL_GROUPS]);exports.CATEGORY_TITLES={"ai-ml":"AI & Machine Learning",frontend:"Frontend & Design",backend:"Backend Development",infrastructure:"Infrastructure & DevOps",database:"Database & Storage","dev-tools":"Development Tools",multimedia:"Multimedia & Processing",frameworks:"Frameworks & Platforms",security:"Security",design:"Design",documents:"Document Processing",gamedev:"Game Development",marketing:"Marketing & Growth",seo:"SEO & Search",utilities:"Utilities & Helpers",other:"Other"},exports.SKILL_STATUSES=new Set(["experimental","stable","deprecated"]);function yamlString(t){return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function readSkill(t,r,e){const n=path.join(t,e),a=path.join(n,"SKILL.md");if(!fs.existsSync(a))return null;const s=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(a,"utf8")),i=(0,frontmatter_1.cleanFrontmatterValue)(s.category)||"other",o=(0,frontmatter_1.cleanFrontmatterValue)(s.status)||"stable";return{name:r,path:`${e}/SKILL.md`,description:(0,frontmatter_1.cleanFrontmatterValue)(s.description),category:i in exports.CATEGORY_TITLES?i:"other",status:exports.SKILL_STATUSES.has(o)?o:"stable",user_invocable:(0,frontmatter_1.cleanFrontmatterValue)(s["user-invocable"])==="true",has_scripts:fs.existsSync(path.join(n,"scripts")),has_references:fs.existsSync(path.join(n,"references")),...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)?{upstream:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)?{upstream_commit:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_commit)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)?{upstream_version:(0,frontmatter_1.cleanFrontmatterValue)(s.upstream_version)}:{},...(0,frontmatter_1.cleanFrontmatterValue)(s.synced)?{synced:(0,frontmatter_1.cleanFrontmatterValue)(s.synced)}:{}}}function collectSkills(t){const r=path.join(t,payload_roots_1.SKILL_SOURCE_DIR),e=[];for(const n of fs.readdirSync(r,{withFileTypes:!0})){if(!n.isDirectory()||n.name.startsWith("."))continue;if(SKILL_GROUPS.includes(n.name)){const s=path.join(r,n.name);for(const i of fs.readdirSync(s,{withFileTypes:!0})){if(!i.isDirectory())continue;const o=readSkill(r,i.name,`${n.name}/${i.name}`);o&&e.push({...o,category:"documents"})}continue}if(NOT_SKILLS.has(n.name))continue;const a=readSkill(r,n.name,n.name);a&&e.push(a)}return e.sort((n,a)=>n.name.localeCompare(a.name))}function collectAgents(t){const{agents:r}=(0,agent_metadata_1.readAgentsDir)(path.join(t,payload_roots_1.AGENTS_SOURCE_DIR));return r.map(e=>({name:e.name,path:`${e.name}.md`,description:(0,agent_metadata_1.trimmedDescription)(e.description),model:e.model??"inherit",read_only:e.readOnly,memory:e.memory??"none"}))}function collectCommands(t){const r=path.join(t,payload_roots_1.COMMAND_SOURCE_DIR),e=[],n=a=>{for(const s of fs.readdirSync(a,{withFileTypes:!0})){const i=path.join(a,s.name);if(s.isDirectory())n(i);else if(s.name.endsWith(".md")){const o=path.relative(r,i),l=(0,frontmatter_1.parseFrontmatter)(fs.readFileSync(i,"utf8"));e.push({name:o.replace(/\.md$/,""),path:o,description:(0,frontmatter_1.cleanFrontmatterValue)(l.description)})}}};return n(r),e.sort((a,s)=>a.name.localeCompare(s.name))}function renderSkillsYaml(t){const r=[...new Set(t.map(n=>n.category))].sort(),e=["# Generated by scripts/gen/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing a skill.","metadata:"," title: Skills Catalog"," description: Catalog of every skill in AgentKit Engineer, generated from skills/.",` total_skills: ${t.length}`,` user_invocable: ${t.filter(n=>n.user_invocable).length}`,"categories:",...r.map(n=>` ${n}: ${yamlString(exports.CATEGORY_TITLES[n])}`),"legend:"," user_invocable: Callable directly as /<name>"," has_scripts: Ships executable scripts"," has_references: Ships reference documentation"," status: Lifecycle label (experimental | stable | deprecated); deprecated still installs","skills:"];for(const n of r){e.push(` ${n}:`);for(const a of t.filter(s=>s.category===n))e.push(` - name: ${a.name}`,` path: ${a.path}`,` description: ${yamlString(a.description)}`,` status: ${a.status}`,` user_invocable: ${a.user_invocable}`,` has_scripts: ${a.has_scripts}`,` has_references: ${a.has_references}`),a.upstream&&(e.push(` upstream: ${yamlString(a.upstream)}`),a.upstream_version&&e.push(` upstream_version: ${yamlString(a.upstream_version)}`),a.upstream_commit&&e.push(` upstream_commit: ${yamlString(a.upstream_commit)}`),a.synced&&e.push(` synced: ${yamlString(a.synced)}`))}return`${e.join(`
|
|
2
2
|
`)}
|
|
3
3
|
`}function renderAgentsYaml(t){const r=["# Generated by scripts/gen/generate-catalogs.ts -- do not edit by hand.","# Run `npm run catalog:sync` after adding or removing an agent.","metadata:"," title: Agents Catalog"," description: Catalog of every subagent in AgentKit Engineer, generated from agents/.",` total_agents: ${t.length}`,"legend:"," model: Pinned model, or `inherit` when the host decides"," read_only: Cannot edit files or shell out (derived from its tools)"," memory: Persistent-memory scope (project | user | none)","agents:"];for(const e of t)r.push(` - name: ${e.name}`,` path: ${e.path}`,` description: ${yamlString(e.description)}`,` model: ${e.model}`,` read_only: ${e.read_only}`,` memory: ${e.memory}`);return`${r.join(`
|
|
4
4
|
`)}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,s)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),s=0;s<r.length;s++)r[s]!=="default"&&__createBinding(t,e,r[s]);return __setModuleDefault(t,e),t}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.AGENT_MAP=exports.SKILL_RENAME_MAP=exports.GAMEDEV_AGENTS=exports.SKIPPED_UPSTREAM_AGENTS=exports.SKIPPED_UPSTREAM_SKILLS=exports.GAMEDEV_UPSTREAM_URL=void 0,exports.stampSkillProvenance=stampSkillProvenance,exports.sanitizeUpstreamBody=sanitizeUpstreamBody,exports.transformUpstreamSkill=transformUpstreamSkill,exports.transformUpstreamAgent=transformUpstreamAgent,exports.syncGamedevFromDir=syncGamedevFromDir;const child_process_1=require("child_process"),fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),generate_catalogs_1=require("./generate-catalogs"),check_upstream_1=require("./check-upstream");exports.GAMEDEV_UPSTREAM_URL="https://github.com/donchitos/claude-code-game-studios",exports.SKIPPED_UPSTREAM_SKILLS=new Set(["adopt","brainstorm","changelog","code-review","help","onboard","retrospective","security-audit","settings","skill-improve","skill-test","start","tech-debt","architecture-decision","architecture-review","bug-report","bug-triage","create-architecture","create-epics","create-stories","dev-story","estimate","milestone-review","perf-profile","qa-plan","regression-suite","reverse-document","scope-check","smoke-check","sprint-plan","sprint-status","story-done","story-readiness","test-evidence-review","test-flakiness","test-helpers","test-setup","ux-design","ux-review"]),exports.SKIPPED_UPSTREAM_AGENTS=new Set(["analytics-engineer","devops-engineer","lead-programmer","performance-analyst","producer","qa-lead","qa-tester","release-manager","security-engineer","technical-director","ux-designer"]),exports.GAMEDEV_AGENTS=new Set(["accessibility-specialist","ai-programmer","art-director","audio-director","community-manager","creative-director","economy-designer","engine-programmer","game-designer","gameplay-programmer","godot-csharp-specialist","godot-gdextension-specialist","godot-gdscript-specialist","godot-shader-specialist","godot-specialist","level-designer","live-ops-designer","localization-lead","narrative-director","network-programmer","prototyper","sound-designer","systems-designer","technical-artist","tools-programmer","ue-blueprint-specialist","ue-gas-specialist","ue-replication-specialist","ue-umg-specialist","ui-programmer","unity-addressables-specialist","unity-dots-specialist","unity-shader-specialist","unity-specialist","unity-ui-specialist","unreal-specialist","world-builder","writer"]),exports.SKILL_RENAME_MAP={"design-system":"game-design-system"},exports.AGENT_MAP={producer:"project-manager","technical-director":"planner","lead-programmer":"fullstack-developer","devops-engineer":"fullstack-developer","security-engineer":"code-reviewer","performance-analyst":"debugger","analytics-engineer":"researcher","analytics-specialist":"researcher","qa-lead":"tester","qa-tester":"tester","release-manager":"git-manager","ux-designer":"ui-ux-designer","ui-designer":"ui-programmer","narrative-designer":"narrative-director","localization-specialist":"localization-lead"};const COMPLETION_CONTRACT=["## Completion Report","","End every run with this block (`rules/orchestration-protocol.md`, `rules/verification-before-completion.md`):","","```","Status: DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT","Summary: <1-2 sentences \u2014 what changed, or what was found>","Concerns/Blockers: <required unless the status is DONE>","```"].join(`
|
|
2
|
+
`);function stampSkillProvenance(n,e){const t=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n/);if(!t)return n;const r=t[1].split(/\r?\n/).filter(s=>!/^(upstream|upstream_version|upstream_commit|synced):/.test(s.trim()));return r.push(`upstream: ${e.upstreamUrl}`),e.version&&r.push(`upstream_version: "${e.version}"`),e.commit&&r.push(`upstream_commit: "${e.commit}"`),r.push(`synced: "${e.synced}"`),`---
|
|
3
|
+
${r.join(`
|
|
4
|
+
`)}
|
|
5
|
+
---
|
|
6
|
+
${n.slice(t[0].length)}`}function sanitizeUpstreamBody(n){let e=n.replace(/\r\n/g,`
|
|
7
|
+
`);return e=e.replace(/```bash\n[^`]*yaml-helper\.sh[\s\S]*?```\n?/g,""),e=e.replace(/^!`bash [^`\n]*yaml-helper\.sh[^`\n]*`\n?/gm,""),e=e.replace(/`\.claude\/rules\/scene-files\.md`/g,"the `.tscn`/`.tres` scene-file conventions"),e=e.replace(/\.claude\/(skills|scripts|agents|commands|templates|hooks|rules|plans|tasks|docs)\//g,"$1/"),e=e.replace(/subagent_type\s*([=:])\s*"?([A-Za-z][A-Za-z0-9_-]*)"?/g,(t,r,s)=>`subagent_type${r}"${exports.AGENT_MAP[s]??(exports.GAMEDEV_AGENTS.has(s)?s:"fullstack-developer")}"`),e=e.replace(/`([A-Za-z][A-Za-z0-9-]*)`(\s+(?:sub)?agents?\b)/g,(t,r,s)=>`\`${exports.AGENT_MAP[r]??(exports.GAMEDEV_AGENTS.has(r)?r:"fullstack-developer")}\`${s}`),e=e.replace(/`\.\.\/[\w./-]+\.md`/g,t=>t.replace(/^`\.\.\//,"`")),e=e.replace(/(?<![\w/.~<-])\/code-review(?![a-z0-9:/-])/g,"/ak-code-review"),e=e.replace(/(?<![\w/.~<-])\/(architecture-decision|art-bible|asset-audit|asset-spec|balance-check|consistency-check|content-audit|create-architecture|create-control-manifest|day-one-patch|design-review|game-design-system|gate-check|launch-checklist|localize|map-systems|milestone-review|patch-notes|perf-profile|playtest-report|project-stage-detect|propagate-design-change|prototype|quick-design|release-checklist|reverse-document|review-all-gdds|scope-check|setup-engine|soak-test|vertical-slice)(?![a-z0-9:/-])/g,"/gamedev $1"),e=e.replace(/\[%\/weight\/count\]/g,"[percent/weight/count]"),e=e.replace(/docs\/engine-reference\/\[engine\]\/deprecated-apis\.md/g,"docs/engine-reference/engine/deprecated-apis.md"),e.trim()+`
|
|
8
|
+
`}function parseMarkdownParts(n,e){const t=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/),r=t?t[1]:"",s=r.match(/^description:\s*(.+)$/m),i=s?s[1].trim().replace(/^["']|["']$/g,""):e;return{fm:r,desc:i.replace(/"/g,'\\"'),body:sanitizeUpstreamBody(t?t[2]:n)}}function transformUpstreamSkill(n,e,t){const{desc:r,body:s}=parseMarkdownParts(n,`Game studio ${e} workflow`),i=`---
|
|
9
|
+
name: ${e}
|
|
10
|
+
description: "${r}"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
${s}`;return t?stampSkillProvenance(i,t):i}function transformUpstreamAgent(n,e){const{fm:t,desc:r,body:s}=parseMarkdownParts(n,`Game studio ${e} specialist`),i=t.match(/^tools:\s*(.+)$/m)?.[1]?.trim()??"Read, Glob, Grep, Write, Edit, Bash";return`---
|
|
14
|
+
name: ${e}
|
|
15
|
+
description: "${r}"
|
|
16
|
+
model: sonnet
|
|
17
|
+
tools: ${i}
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
${s}
|
|
21
|
+
${COMPLETION_CONTRACT}
|
|
22
|
+
`}function shouldSync(n,e,t,r,s,i){if(i||!fs.existsSync(s))return!0;if(!e||e===t)return!1;try{return(0,child_process_1.execFileSync)("git",["-C",n,"diff","--quiet",e,t,"--",r]),!1}catch{return!0}}function syncGamedevFromDir(n,e,t,r=!1){const s=path.join(n,".claude","skills");if(!fs.existsSync(s))throw new Error(`Missing .claude/skills in upstream source: ${n}`);const i=path.join(e,"skills","gamedev");fs.mkdirSync(i,{recursive:!0});const d=path.join(i,"SKILL.md"),f=fs.existsSync(d)?fs.readFileSync(d,"utf8"):"",o=f.match(/^upstream_commit:\s*["']?([0-9a-f]{7,40})["']?/m)?.[1]??null,_=f.match(/^upstream_version:\s*["']?([^"'\r\n]+)["']?/m)?.[1]??null;let p=0;const v=[];for(const a of fs.readdirSync(s,{withFileTypes:!0}).filter(c=>c.isDirectory())){if(exports.SKIPPED_UPSTREAM_SKILLS.has(a.name))continue;const c=path.join(s,a.name),l=path.join(c,"SKILL.md");if(!fs.existsSync(l))continue;const u=exports.SKILL_RENAME_MAP[a.name]??a.name,y=path.join(i,u),m=path.join(y,"SKILL.md"),A=!fs.existsSync(m);if(shouldSync(n,o,t.commit,`.claude/skills/${a.name}/SKILL.md`,m,r)){fs.mkdirSync(y,{recursive:!0});const S=transformUpstreamSkill(fs.readFileSync(l,"utf8"),u);(A||S!==fs.readFileSync(m,"utf8"))&&(fs.writeFileSync(m,S,"utf8"),A&&v.push(u),p++)}for(const S of["CONTRACT.md","references"]){const x=path.join(c,S);if(!fs.existsSync(x))continue;const $=fs.statSync(x).isDirectory()?fs.readdirSync(x).filter(g=>g.endsWith(".md")).map(g=>path.join("references",g)):[S];for(const g of $){const h=path.join(y,g);if(shouldSync(n,o,t.commit,`.claude/skills/${a.name}/${g}`,h,r)){fs.mkdirSync(path.dirname(h),{recursive:!0});const w=sanitizeUpstreamBody(fs.readFileSync(path.join(c,g),"utf8"));(!fs.existsSync(h)||w!==fs.readFileSync(h,"utf8"))&&(fs.writeFileSync(h,w,"utf8"),p++)}}}}const E=path.join(n,".claude","agents");if(fs.existsSync(E)){const a=path.join(e,"agent-kit","shared","gamedev","agents");fs.mkdirSync(a,{recursive:!0});for(const c of fs.readdirSync(E).filter(l=>l.endsWith(".md"))){const l=c.replace(/\.md$/,"");if(exports.SKIPPED_UPSTREAM_AGENTS.has(l))continue;const u=path.join(a,c),y=!fs.existsSync(u);if(shouldSync(n,o,t.commit,`.claude/agents/${c}`,u,r)){const m=transformUpstreamAgent(fs.readFileSync(path.join(E,c),"utf8"),l);(y||m!==fs.readFileSync(u,"utf8"))&&(fs.writeFileSync(u,m,"utf8"),y&&v.push(`agents/${l}`),p++)}}}return f&&(o!==t.commit||_!==t.version)&&(fs.writeFileSync(d,stampSkillProvenance(f,t),"utf8"),p++),{updated:p,created:v}}function main(){const n=path.resolve(__dirname,"..",".."),e=process.argv.indexOf("--source");let t=e!==-1?path.resolve(process.argv[e+1]):"",r="";try{t||(r=fs.mkdtempSync(path.join(os.tmpdir(),"gamedev-upstream-")),(0,child_process_1.execFileSync)("git",["clone","--depth","50","--tags",`${exports.GAMEDEV_UPSTREAM_URL}.git`,r],{stdio:"inherit"}),t=r);const s=(0,child_process_1.execFileSync)("git",["-C",t,"rev-parse","HEAD"],{encoding:"utf8"}).trim(),i=(0,child_process_1.execFileSync)("git",["-C",t,"tag","--sort=-v:refname"],{encoding:"utf8"}).trim().split(/\r?\n/)[0]??"",d=new Date,f=`${String(d.getUTCFullYear()).slice(-2)}${String(d.getUTCMonth()+1).padStart(2,"0")}${String(d.getUTCDate()).padStart(2,"0")}`,o={upstreamUrl:exports.GAMEDEV_UPSTREAM_URL,version:(0,check_upstream_1.normalizeVersion)(i),commit:s,synced:f},{updated:_,created:p}=syncGamedevFromDir(t,n,o,process.argv.includes("--force"));(0,generate_catalogs_1.generateCatalogs)(n),console.log(`Synced gamedev upstream (${o.version} @ ${o.commit.slice(0,12)}): ${_} updated, ${p.length} created.`)}finally{r&&fs.rmSync(r,{recursive:!0,force:!0})}}require.main===module&&main();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,i,s){s===void 0&&(s=i);var t=Object.getOwnPropertyDescriptor(r,i);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(e,s,t)}):(function(e,r,i,s){s===void 0&&(s=i),e[s]=r[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(i){var s=[];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(s[s.length]=t);return s},e(r)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s=e(r),t=0;t<s.length;t++)s[t]!=="default"&&__createBinding(i,r,s[t]);return __setModuleDefault(i,r),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.UPSTREAM_SYNC_TARGETS=void 0,exports.resolveUpstreamTargets=resolveUpstreamTargets,exports.formatSyncDate=formatSyncDate,exports.probeRemoteHead=probeRemoteHead,exports.syncUpstreamTarget=syncUpstreamTarget;const child_process_1=require("child_process"),fs=__importStar(require("fs")),os=__importStar(require("os")),path=__importStar(require("path")),check_upstream_1=require("./check-upstream"),generate_catalogs_1=require("./generate-catalogs"),sync_gamedev_upstream_1=require("./sync-gamedev-upstream"),upstream_skill_syncers_1=require("./upstream-skill-syncers"),upstream_suite_syncers_1=require("./upstream-suite-syncers");exports.UPSTREAM_SYNC_TARGETS=[{id:"gamedev",upstreamUrl:sync_gamedev_upstream_1.GAMEDEV_UPSTREAM_URL,skills:["gamedev"],routerSkill:"gamedev",pinBySemverTag:!0,syncFromDir:sync_gamedev_upstream_1.syncGamedevFromDir},{id:"seo",upstreamUrl:"https://github.com/AgriciDaniel/claude-seo",skills:["seo"],routerSkill:"seo",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncSeoFromDir},{id:"expo",upstreamUrl:"https://github.com/expo/skills",skills:["expo"],routerSkill:"expo",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncExpoFromDir},{id:"stripe",upstreamUrl:"https://github.com/stripe/ai",skills:["stripe"],routerSkill:"stripe",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncStripeFromDir},{id:"twilio",upstreamUrl:"https://github.com/twilio/ai",skills:["twilio"],routerSkill:"twilio",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncTwilioFromDir},{id:"cti-expert",upstreamUrl:"https://github.com/7onez/cti-expert",skills:["cti-expert"],routerSkill:"cti-expert",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncCtiExpertFromDir},{id:"typesafe-ai",upstreamUrl:"https://github.com/typesafe-ai/skills",skills:["typesafe-ai"],routerSkill:"typesafe-ai",pinBySemverTag:!0,syncFromDir:upstream_skill_syncers_1.syncTypesafeAiFromDir},{id:"fomo-cc",upstreamUrl:"https://github.com/zack-the-worker/fomo-cc",skills:["fomo-cc"],routerSkill:"fomo-cc",pinBySemverTag:!1,syncFromDir:upstream_skill_syncers_1.syncFomoCcFromDir},{id:"ui-ux-pro-max",upstreamUrl:"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill",skills:["ui-ux-pro-max"],routerSkill:"ui-ux-pro-max",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncUiUxProMaxFromDir},{id:"tech-graph",upstreamUrl:"https://github.com/yizhiyanhua-ai/fireworks-tech-graph",skills:["tech-graph"],routerSkill:"tech-graph",pinBySemverTag:!0,syncFromDir:upstream_suite_syncers_1.syncTechGraphFromDir},{id:"anthropics",upstreamUrl:"https://github.com/anthropics/skills",skills:["document-skills","mcp-builder","skill-creator"],routerSkill:"document-skills",pinBySemverTag:!1,syncFromDir:upstream_suite_syncers_1.syncAnthropicsFromDir},{id:"automation-recommender",upstreamUrl:"https://github.com/anthropics/claude-plugins-official",skills:["automation-recommender"],routerSkill:"automation-recommender",pinBySemverTag:!1,syncFromDir:upstream_skill_syncers_1.syncAutomationRecommenderFromDir}];function resolveUpstreamTargets(e="all"){const r=e.trim();if(!r||r==="all")return[...exports.UPSTREAM_SYNC_TARGETS];const i=r.split(",").map(t=>t.trim()).filter(Boolean),s=new Map;for(const t of i){const a=exports.UPSTREAM_SYNC_TARGETS.find(o=>o.id===t||o.skills.includes(t));if(!a){const o=exports.UPSTREAM_SYNC_TARGETS.map(c=>c.id).join(", ");throw new Error(`Unknown upstream target "${t}". Valid targets: all, ${o}`)}s.set(a.id,a)}return[...s.values()]}function formatSyncDate(e=new Date){return`${String(e.getUTCFullYear()).slice(-2)}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}function probeRemoteHead(e){try{return(0,child_process_1.execFileSync)("git",["ls-remote",`${e}.git`,"HEAD"],{encoding:"utf8",timeout:15e3,stdio:["ignore","pipe","ignore"]}).trim().split(/\s+/)[0]||null}catch{return null}}function syncUpstreamTarget(e,r,i={}){const s=path.join(r,"skills",e.routerSkill,"SKILL.md"),t=(0,upstream_skill_syncers_1.readSkillProvenance)(s),a=!!i.force;if(!i.sourceDir&&!a&&t.commit){const l=probeRemoteHead(e.upstreamUrl);if(l&&l===t.commit)return{id:e.id,commit:l,version:t.version??"",updated:0,created:[],skippedUpToDate:!0}}let o=i.sourceDir?path.resolve(i.sourceDir):"",c="";try{o||(c=fs.mkdtempSync(path.join(os.tmpdir(),`${e.id}-upstream-`)),(0,child_process_1.execFileSync)("git",["clone","--depth","50","--tags",`${e.upstreamUrl}.git`,c],{stdio:"inherit"}),o=c);const l=(0,child_process_1.execFileSync)("git",["-C",o,"rev-parse","HEAD"],{encoding:"utf8"}).trim();let n="";e.pinBySemverTag&&(n=(0,child_process_1.execFileSync)("git",["-C",o,"tag","--sort=-v:refname"],{encoding:"utf8"}).trim().split(/\r?\n/).map(p=>(0,check_upstream_1.normalizeVersion)(p)).filter(p=>/^\d+\.\d+(?:\.\d+)?$/.test(p))[0]??t.version??"");const u=i.synced??formatSyncDate(),m={upstreamUrl:e.upstreamUrl,version:n,commit:l,synced:u},{updated:d,created:f}=e.syncFromDir(o,r,m,a);return{id:e.id,commit:l,version:n,updated:d,created:f,skippedUpToDate:!1}}finally{c&&fs.rmSync(c,{recursive:!0,force:!0})}}function main(){const e=path.resolve(__dirname,"..",".."),r=process.argv.indexOf("--target"),i=r!==-1?process.argv[r+1]??"all":"all",s=process.argv.indexOf("--source"),t=s!==-1?process.argv[s+1]:void 0,a=process.argv.includes("--force"),o=resolveUpstreamTargets(i);if(t&&o.length>1)throw new Error("--source can only be used when syncing a single --target.");let c=0;for(const l of o){const n=syncUpstreamTarget(l,e,{sourceDir:t,force:a});c+=n.updated;const u=n.version?`${n.version} @ ${n.commit.slice(0,12)}`:n.commit.slice(0,12),m=n.skippedUpToDate?"already at HEAD":`${n.updated} updated, ${n.created.length} created`;console.log(`[${n.id}] (${u}): ${m}`)}c>0&&(0,generate_catalogs_1.generateCatalogs)(e)}require.main===module&&main();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&__createBinding(n,t,r[i]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.readSkillProvenance=readSkillProvenance,exports.shouldSyncPath=shouldSyncPath,exports.syncDirectoryTree=syncDirectoryTree,exports.replaceBodyFromMarker=replaceBodyFromMarker,exports.stampRouterIfChanged=stampRouterIfChanged,exports.syncSkillBodyFromMarker=syncSkillBodyFromMarker,exports.syncTypesafeAiFromDir=syncTypesafeAiFromDir,exports.syncFomoCcFromDir=syncFomoCcFromDir,exports.syncAutomationRecommenderFromDir=syncAutomationRecommenderFromDir;const child_process_1=require("child_process"),fs=__importStar(require("fs")),path=__importStar(require("path")),sync_gamedev_upstream_1=require("./sync-gamedev-upstream"),IGNORED_NAMES=new Set([".git","__pycache__",".pytest_cache",".DS_Store"]),TEXT_EXTS=new Set([".md",".yaml",".yml",".json",".py",".sh",".ps1",".js",".ts",".txt",".html",".css",".csv",".xml",".xsd",".tex",".lock",".svg"]);function readSkillProvenance(e){if(!fs.existsSync(e))return{commit:null,version:null};const t=fs.readFileSync(e,"utf8"),n=t.match(/^upstream_commit:\s*["']?([0-9a-f]{7,40})["']?/m)?.[1]??null,r=t.match(/^upstream_version:\s*["']?([^"'\r\n]+)["']?/m)?.[1]??null;return{commit:n,version:r}}function shouldSyncPath(e,t,n,r,i,s){if(s||!fs.existsSync(i)||!t)return!0;if(t===n)return!1;try{return(0,child_process_1.execFileSync)("git",["-C",e,"diff","--quiet",t,n,"--",r]),!1}catch{return!0}}function isTextFile(e){const t=path.basename(e);return t==="LICENSE"||t==="NOTICE"?!0:TEXT_EXTS.has(path.extname(e).toLowerCase())}function syncDirectoryTree(e){const t=e.srcSubdir?path.join(e.sourceDir,e.srcSubdir):e.sourceDir;if(!fs.existsSync(t))return{updated:0,created:[]};let n=0;const r=[],i=(s,l)=>{for(const o of fs.readdirSync(s,{withFileTypes:!0})){if(IGNORED_NAMES.has(o.name)||o.name.endsWith(".pyc"))continue;const c=[...l,o.name],u=c.join("/");if(e.skipRel?.(u,o.isDirectory()))continue;const d=path.join(s,o.name);if(o.isDirectory()){i(d,c);continue}const f=path.join(e.destDir,...c),p=e.srcSubdir?`${e.srcSubdir.replace(/\\/g,"/")}/${u}`:u;if(!shouldSyncPath(e.sourceDir,e.oldCommit,e.newCommit,p,f,e.force))continue;const a=!fs.existsSync(f);if(fs.mkdirSync(path.dirname(f),{recursive:!0}),e.transformText&&isTextFile(d)){const m=e.transformText(fs.readFileSync(d,"utf8"),u);(a||m!==fs.readFileSync(f,"utf8"))&&(fs.writeFileSync(f,m,"utf8"),a&&r.push(u),n++)}else{const m=fs.readFileSync(d);(a||Buffer.compare(m,fs.readFileSync(f))!==0)&&(fs.copyFileSync(d,f),a&&r.push(u),n++)}}};return i(t,[]),{updated:n,created:r}}function replaceBodyFromMarker(e,t,n,r){const i=t.replace(/\r\n/g,`
|
|
2
|
+
`),s=e.indexOf(n),l=i.indexOf(n);if(s!==-1&&l!==-1)return(0,sync_gamedev_upstream_1.stampSkillProvenance)(e.slice(0,s)+i.slice(l),r);const o=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n/),c=i.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n/),u=o?o[0]:"",d=c?i.slice(c[0].length):i;return(0,sync_gamedev_upstream_1.stampSkillProvenance)(`${u}${d}`,r)}function stampRouterIfChanged(e,t,n){if(!fs.existsSync(e))return!1;const r=fs.readFileSync(e,"utf8"),i=n?n(r):r,s=(0,sync_gamedev_upstream_1.stampSkillProvenance)(i,t);return s===r?!1:(fs.writeFileSync(e,s,"utf8"),!0)}function syncSkillBodyFromMarker(e,t,n,r,i,s,l,o){const c=path.join(e,t,"SKILL.md"),u=t?`${t}/SKILL.md`:"SKILL.md";if(fs.existsSync(c)&&fs.existsSync(n)&&shouldSyncPath(e,r,i.commit,u,n,l)){const d=fs.readFileSync(c,"utf8"),f=replaceBodyFromMarker(fs.readFileSync(n,"utf8"),o?o(d):d,s,i);return f!==fs.readFileSync(n,"utf8")?(fs.writeFileSync(n,f,"utf8"),!0):!1}return stampRouterIfChanged(n,i)}function syncTypesafeAiFromDir(e,t,n,r=!1){const i=path.join(t,"skills","typesafe-ai"),s=path.join(i,"SKILL.md"),{commit:l}=readSkillProvenance(s),o=fs.existsSync(path.join(e,"skills","typesafe-ai"))?"skills/typesafe-ai":"",c=syncDirectoryTree({sourceDir:e,srcSubdir:o,destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:u=>u==="SKILL.md"});return syncSkillBodyFromMarker(e,o,s,l,n,`
|
|
3
|
+
# Build with TypeSafe`,r)&&c.updated++,c}function syncFomoCcFromDir(e,t,n,r=!1){const i=path.join(t,"skills","fomo-cc"),s=path.join(i,"SKILL.md"),{commit:l}=readSkillProvenance(s),o={...n,version:""},c=syncDirectoryTree({sourceDir:e,srcSubdir:"",destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:u=>u!=="README.md"&&u!=="references"&&!u.startsWith("references/")});return syncSkillBodyFromMarker(e,"",s,l,o,`
|
|
4
|
+
# FOMO-CC:`,r)&&c.updated++,c}function syncAutomationRecommenderFromDir(e,t,n,r=!1){const i=path.join(t,"skills","automation-recommender"),s=path.join(i,"SKILL.md"),{commit:l,version:o}=readSkillProvenance(s),c=fs.existsSync(path.join(e,"plugins","claude-code-setup"))?"plugins/claude-code-setup":"",u=c?`${c}/skills/claude-automation-recommender`:"",d=path.join(e,c,".claude-plugin","plugin.json"),f=fs.existsSync(d)?JSON.parse(fs.readFileSync(d,"utf8")).version:void 0,p={...n,version:n.version||f||o||""},a=syncDirectoryTree({sourceDir:e,srcSubdir:u,destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:y=>y==="SKILL.md"||y==="references/multi-kit-targets.md"}),m=syncDirectoryTree({sourceDir:e,srcSubdir:c,destDir:i,oldCommit:l,newCommit:n.commit,force:r,skipRel:y=>y!=="LICENSE"});return a.updated+=m.updated,a.created.push(...m.created),syncSkillBodyFromMarker(e,u,s,l,p,`
|
|
5
|
+
# Claude Automation Recommender`,r)&&a.updated++,a}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(s,n,e,i){i===void 0&&(i=e);var t=Object.getOwnPropertyDescriptor(n,e);(!t||("get"in t?!n.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(s,i,t)}):(function(s,n,e,i){i===void 0&&(i=e),s[i]=n[e]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(s,n){Object.defineProperty(s,"default",{enumerable:!0,value:n})}):function(s,n){s.default=n}),__importStar=this&&this.__importStar||(function(){var s=function(n){return s=Object.getOwnPropertyNames||function(e){var i=[];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[i.length]=t);return i},s(n)};return function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var i=s(n),t=0;t<i.length;t++)i[t]!=="default"&&__createBinding(e,n,i[t]);return __setModuleDefault(e,n),e}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.SKIPPED_EXPO_SKILLS=void 0,exports.sanitizeExpoSkillMarkdown=sanitizeExpoSkillMarkdown,exports.syncExpoFromDir=syncExpoFromDir,exports.syncStripeFromDir=syncStripeFromDir,exports.syncTwilioFromDir=syncTwilioFromDir,exports.syncCtiExpertFromDir=syncCtiExpertFromDir,exports.syncUiUxProMaxFromDir=syncUiUxProMaxFromDir,exports.syncTechGraphFromDir=syncTechGraphFromDir,exports.syncSeoFromDir=syncSeoFromDir,exports.syncAnthropicsFromDir=syncAnthropicsFromDir;const fs=__importStar(require("fs")),path=__importStar(require("path")),upstream_skill_syncers_1=require("./upstream-skill-syncers");exports.SKIPPED_EXPO_SKILLS=new Set(["expo-skill-feedback","expo-tailwind-setup"]);const CTI_EXPERT_PATHS=new Set(["AGENTS.md","LICENSE","README.md","requirements.txt","analysis","connectors","engine","experience","guides","handbook","intel_engine","output","scripts","techniques","validation","workflows"]);function sanitizeExpoSkillMarkdown(s,n){let e=s.replace(/\r\n/g,`
|
|
2
|
+
`).replace(/(?:\n+---\n+)?\n+## Submitting Feedback[\s\S]*$/,`
|
|
3
|
+
`);return n==="expo-overview/SKILL.md"&&(e=e.split(`
|
|
4
|
+
`).filter(i=>!i.includes("expo-tailwind-setup")&&!i.includes("expo-skill-feedback")).join(`
|
|
5
|
+
`)),e.endsWith(`
|
|
6
|
+
`)?e:`${e}
|
|
7
|
+
`}function syncExpoFromDir(s,n,e,i=!1){const t=path.join(n,"skills","expo"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=fs.existsSync(path.join(s,"plugins","expo","skills"))?"plugins/expo/skills":"skills",a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:o,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:(r,c)=>!c&&!r.includes("/")||exports.SKIPPED_EXPO_SKILLS.has(r.split("/")[0]),transformText:(r,c)=>c.endsWith("/SKILL.md")?sanitizeExpoSkillMarkdown(r,c):r});return(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,{...e,version:""})&&a.updated++,a}function syncStripeFromDir(s,n,e,i=!1){const t=path.join(n,"skills","stripe"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"skills",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:(c,m)=>!m&&!c.includes("/")}),a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:c=>c!=="LICENSE"});return o.updated+=a.updated,(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,{...e,version:""},c=>c.replace(/Provenance is pinned to commit `[0-9a-f]+`/,`Provenance is pinned to commit \`${e.commit}\``))&&o.updated++,o}function syncTwilioFromDir(s,n,e,i=!1){const t=path.join(n,"skills","twilio"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o={updated:0,created:[]};for(const r of["skills/twilio","skills/sendgrid"]){const c=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:r,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:m=>m.split("/").includes("assets"),transformText:(m,u)=>u.endsWith("/agents/openai.yaml")?m.replace(/^[ \t]*icon_(?:small|large):.*(?:\r?\n)?/gm,""):m});o.updated+=c.updated,o.created.push(...c.created)}const a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>r!=="LICENSE"});return o.updated+=a.updated,(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,{...e,version:""})&&o.updated++,o}function syncCtiExpertFromDir(s,n,e,i=!1){const t=path.join(n,"skills","cti-expert"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"",destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>!CTI_EXPERT_PATHS.has(r.split("/")[0]),transformText:(r,c)=>c==="handbook/operator-queries.md"?r.replace(/\.\/quiak-report\.md/g,"./quick-report.md"):r}),a=path.join(s,"SKILL.md");if(fs.existsSync(a)&&fs.existsSync(l)){const r=fs.readFileSync(a,"utf8"),c=r.match(/^version:\s*["']?([^"'\r\n]+)["']?/m)?.[1]??e.version,m={...e,version:c};if((0,upstream_skill_syncers_1.shouldSyncPath)(s,d,e.commit,"SKILL.md",l,i)||d!==e.commit){const u=(0,upstream_skill_syncers_1.replaceBodyFromMarker)(fs.readFileSync(l,"utf8"),r,`
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. Quick Start`,m);u!==fs.readFileSync(l,"utf8")&&(fs.writeFileSync(l,u,"utf8"),o.updated++)}}return o}function syncUiUxProMaxFromDir(s,n,e,i=!1){const t=path.join(n,"skills","ui-ux-pro-max"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=fs.existsSync(path.join(s,".claude","skills","ui-ux-pro-max"))?".claude/skills/ui-ux-pro-max":"",a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:o,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>r==="SKILL.md"||r==="scripts/tests/test_catalog_refresh.py"||r==="scripts/tests/test_relevance_evaluator.py"||r==="scripts/tests/fixtures"||r.startsWith("scripts/tests/fixtures/")});return(0,upstream_skill_syncers_1.syncSkillBodyFromMarker)(s,o,l,d,e,`
|
|
11
|
+
# UI/UX Pro Max`,i,r=>r.replace(/\$\{CLAUDE_PLUGIN_ROOT\}\/(?=\.claude\/skills\/ui-ux-pro-max\/)/g,""))&&a.updated++,a}function syncTechGraphFromDir(s,n,e,i=!1){const t=path.join(n,"skills","tech-graph"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=fs.existsSync(path.join(s,"skills","fireworks-tech-graph"))?"skills/fireworks-tech-graph":"",a=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:o,destDir:t,oldCommit:d,newCommit:e.commit,force:i,skipRel:r=>r==="SKILL.md"||r==="README.md"||r==="README.zh.md"||r==="tests/test_skill_compatibility.py"||r==="assets/samples"||r.startsWith("assets/samples/")});return(0,upstream_skill_syncers_1.syncSkillBodyFromMarker)(s,o,l,d,e,`
|
|
12
|
+
# Fireworks Tech Graph`,i)&&a.updated++,a}function syncSeoFromDir(s,n,e,i=!1){const t=path.join(n,"skills","seo"),l=path.join(t,"SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:"skills/seo/references",destDir:path.join(t,"references"),oldCommit:d,newCommit:e.commit,force:i}),a=path.join(s,"skills");if(fs.existsSync(a)){const r=fs.readdirSync(a,{withFileTypes:!0}).filter(c=>c.isDirectory()&&c.name.startsWith("seo-")&&fs.existsSync(path.join(t,c.name)));for(const c of r)for(const m of["references","assets","templates"]){const u=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:`skills/${c.name}/${m}`,destDir:path.join(t,c.name,m),oldCommit:d,newCommit:e.commit,force:i});o.updated+=u.updated,o.created.push(...u.created.map(p=>`${c.name}/${m}/${p}`))}}return(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,e)&&o.updated++,o}function syncAnthropicsFromDir(s,n,e,i=!1){const t={...e,version:""},l=path.join(n,"skills","document-skills","SKILL.md"),{commit:d}=(0,upstream_skill_syncers_1.readSkillProvenance)(l),o={updated:0,created:[]};for(const a of["docx","pdf","pptx","xlsx"]){const r=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:`skills/${a}`,destDir:path.join(n,"skills","document-skills",a),oldCommit:d,newCommit:e.commit,force:i});o.updated+=r.updated,o.created.push(...r.created.map(c=>`document-skills/${a}/${c}`))}for(const a of["mcp-builder","skill-creator"]){const r=(0,upstream_skill_syncers_1.syncDirectoryTree)({sourceDir:s,srcSubdir:`skills/${a}`,destDir:path.join(n,"skills",a),oldCommit:d,newCommit:e.commit,force:i,skipRel:c=>c==="SKILL.md"});o.updated+=r.updated,o.created.push(...r.created.map(c=>`${a}/${c}`)),(0,upstream_skill_syncers_1.stampRouterIfChanged)(path.join(n,"skills",a,"SKILL.md"),t)&&o.updated++}return(0,upstream_skill_syncers_1.stampRouterIfChanged)(l,t)&&o.updated++,o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(t,
|
|
2
|
-
`)}function readSection(t
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&__createBinding(r,t,n[i]);return __setModuleDefault(r,t),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.readKitConfig=readKitConfig,exports.writeKitConfig=writeKitConfig,exports.readSection=readSection,exports.readHooksEnabled=readHooksEnabled,exports.writeHooksEnabled=writeHooksEnabled,exports.isPlainObject=isPlainObject,exports.mergePreserved=mergePreserved,exports.mergePreservedKitConfig=mergePreservedKitConfig,exports.updateSection=updateSection;const fs=__importStar(require("fs")),path=__importStar(require("path"));function readKitConfig(e){if(!fs.existsSync(e))return{};try{const t=JSON.parse(fs.readFileSync(e,"utf8"));return isPlainObject(t)?t:{}}catch{return{}}}function writeKitConfig(e,t){fs.mkdirSync(path.dirname(e),{recursive:!0}),fs.writeFileSync(e,`${JSON.stringify(t,null,2)}
|
|
2
|
+
`)}function readSection(e,t){const r=e[t];return typeof r=="object"&&r!==null?{...r}:{}}function readHooksEnabled(e){return readKitConfig(e).hooksEnabled!==!1}function writeHooksEnabled(e,t){const r=readKitConfig(e);r.hooksEnabled=t,writeKitConfig(e,r)}function isPlainObject(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mergePreserved(e,t){if(Array.isArray(e)&&Array.isArray(t)){const r=new Set(e.map(i=>JSON.stringify(i))),n=[...e];for(const i of t)r.has(JSON.stringify(i))||n.push(i);return n}if(isPlainObject(e)&&isPlainObject(t)){const r={...t};for(const[n,i]of Object.entries(e))r[n]=n in r?mergePreserved(i,r[n]):i;return r}return e}function mergePreservedKitConfig(e,t){if(Object.keys(t).length===0)return;const r=mergePreserved(t,readKitConfig(e));isPlainObject(r)&&writeKitConfig(e,r)}function updateSection(e,t,r){const n=readKitConfig(e),i=readSection(n,t);r(i),n[t]=i,writeKitConfig(e,n)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,o,n){n===void 0&&(n=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(e,n,t)}):(function(e,r,o,n){n===void 0&&(n=o),e[n]=r[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(o){var n=[];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[n.length]=t);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var n=e(r),t=0;t<n.length;t++)n[t]!=="default"&&__createBinding(o,r,n[t]);return __setModuleDefault(o,r),o}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runLogin=runLogin,exports.runLogout=runLogout,exports.runWhoami=runWhoami;const p=__importStar(require("@clack/prompts")),path=__importStar(require("path")),agentkit_home_1=require("../agentkit-home"),cache_1=require("../entitlement/cache"),config_1=require("../entitlement/config"),check_1=require("../entitlement/check"),
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,r,o,n){n===void 0&&(n=o);var t=Object.getOwnPropertyDescriptor(r,o);(!t||("get"in t?!r.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(e,n,t)}):(function(e,r,o,n){n===void 0&&(n=o),e[n]=r[o]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),__importStar=this&&this.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(o){var n=[];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[n.length]=t);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var o={};if(r!=null)for(var n=e(r),t=0;t<n.length;t++)n[t]!=="default"&&__createBinding(o,r,n[t]);return __setModuleDefault(o,r),o}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.runLogin=runLogin,exports.runLogout=runLogout,exports.runWhoami=runWhoami;const p=__importStar(require("@clack/prompts")),path=__importStar(require("path")),agentkit_home_1=require("../agentkit-home"),cache_1=require("../entitlement/cache"),config_1=require("../entitlement/config"),check_1=require("../entitlement/check"),open_browser_1=require("../open-browser"),version_check_1=require("../version-check"),source_1=require("../payload/source"),logger_1=require("../logger"),auth_file_1=require("./auth-file"),device_flow_1=require("./device-flow"),resolve_1=require("./resolve"),token_store_1=require("./token-store");async function fetchUserLogin(e,r){const t=await(await(r.fetchImpl??fetch)(`${(0,config_1.githubApiBase)(r.env)}/user`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},signal:AbortSignal.timeout(version_check_1.REQUEST_TIMEOUT_MS)})).json(),l=t&&typeof t=="object"?t.login:null;return typeof l=="string"?l:"unknown"}async function runLogin(e={},r={}){const o=e.env??process.env,n=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)(),t=(0,config_1.githubAppClientId)(o);if(!t)return(0,logger_1.printError)("No GitHub App client id is configured for this build."),(0,logger_1.printInfo)("Set AGENTKIT_GITHUB_CLIENT_ID, or update the CLI once the App exists."),1;const l=(0,config_1.githubOauthBase)(o),d=e.fetchImpl?{fetchImpl:e.fetchImpl}:{};let c;try{c=await(0,device_flow_1.requestDeviceCode)({clientId:t,oauthBase:l,...d})}catch(u){return(0,logger_1.printError)(`Could not start the device flow: ${u.message}`),1}(0,logger_1.printInfo)(`Open ${c.verificationUri} and enter ${c.userCode}`),r.openBrowser!==!1&&(0,open_browser_1.openBrowser)(c.verificationUri);const i=await(0,device_flow_1.pollForToken)({clientId:t,deviceCode:c.deviceCode,interval:c.interval,expiresIn:c.expiresIn,oauthBase:l,...e.sleepImpl?{sleepImpl:e.sleepImpl}:{},...d});if(!i.ok)return(0,logger_1.printError)(`Login failed: ${i.message}`),1;const h=await fetchUserLogin(i.token.accessToken,e).catch(()=>"unknown");let{store:a,warning:f}=e.store?{store:e.store,warning:null}:(0,token_store_1.getStore)({home:n});const s=p.progress({max:5});s.start("Setting up kit access");const m={accessToken:i.token.accessToken,...i.token.refreshToken?{refreshToken:i.token.refreshToken}:{},...i.token.expiresAt?{expiresAt:i.token.expiresAt}:{},...i.token.refreshExpiresAt?{refreshExpiresAt:i.token.refreshExpiresAt}:{},login:h};try{await a.set("github",JSON.stringify(m))}catch(u){if(a.kind==="keychain"&&!e.store){a=(0,token_store_1.getPlaintextStore)({home:n}),f=`\u2605 keychain write failed \u2014 stored in ${n.toDisplayPath(n.getCredentialsPath())} (0600)`;try{await a.set("github",JSON.stringify(m))}catch(v){return s.stop("Setup failed"),(0,logger_1.printError)(`Could not store the credential: ${v.message}`),1}}else return s.stop("Setup failed"),(0,logger_1.printError)(`Could not store the credential: ${u.message}`),1}s.advance(1,"Credential stored"),(0,auth_file_1.mergeAuth)({login:h,storedIn:a.kind,createdAt:Date.now(),...i.token.expiresAt?{expiresAt:i.token.expiresAt}:{},...i.token.refreshExpiresAt?{refreshExpiresAt:i.token.refreshExpiresAt}:{}},n)||(0,logger_1.printWarning)("Credential stored, but the auth metadata file could not be written."),(0,cache_1.deleteRecord)(n),s.advance(1,"Auth metadata written"),f&&(0,logger_1.printWarning)(f),(0,logger_1.printSuccess)(`Logged in as ${h} (credential: ${a.kind==="keychain"?"store":a.kind})`);const g=await(0,check_1.checkEntitlement)({interactive:!0,home:n,deps:{env:o,store:a,...d}});if(s.advance(1,"Access verified"),g.status==="active"){s.advance(1,"Fetching kit payload");try{const u=path.resolve(__dirname,"..","..",".."),v=await(0,source_1.resolveInstallSource)({version:(0,version_check_1.getPayloadVersion)(u)??"0.0.0",interactive:!0,cliRoot:u,home:n,deps:{env:o,store:a,...d}});s.advance(1,`Kit payload ready \u2014 v${v.version}`)}catch(u){s.advance(1,"Kit payload pending"),(0,logger_1.printWarning)(`Payload prefetch failed: ${u.message} \u2014 the first use will download it.`)}s.stop("Kit access ready \u2014 100%"),(0,logger_1.printSuccess)("Access to the kit repository confirmed.")}else s.stop("Verification finished"),(0,logger_1.printWarning)(`No access \u2014 ${h} cannot reach the kit repository (credential: ${g.credentialSource}).`),(0,logger_1.printInfo)("Ask the maintainer to add you as a collaborator, then run `agentkit login` again.");return g.status==="active"?0:1}async function runLogout(e={}){const r=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)();return await(e.store??(0,token_store_1.getStore)({home:r}).store).clear("github").catch(()=>{}),(0,auth_file_1.clearAuth)(r),(0,cache_1.deleteRecord)(r),(0,logger_1.printSuccess)("Logged out \u2014 the stored credential, auth metadata and entitlement cache were removed."),(0,logger_1.printInfo)("Fetched payloads are kept \u2014 remove them with `agentkit uninstall`."),0}async function runWhoami(e={}){const r=e.env??process.env,o=e.home??(0,agentkit_home_1.loadAgentkitHomeCore)(),n={env:r,home:o,...e.store?{store:e.store}:{},...e.fetchImpl?{fetchImpl:e.fetchImpl}:{}},t=await(0,resolve_1.resolveCredential)("github",n);if(!t.ok)return t.reason==="unusable"?(0,logger_1.printError)(`A credential exists but could not be used${t.detail?` \u2014 ${t.detail}`:""}.`):(0,logger_1.printError)("Not logged in."),(0,logger_1.printInfo)("Run `agentkit login` to authorize."),1;const l=t.source==="store"?(0,auth_file_1.readAuth)(o):null,d=t.stored?.login??l?.login??"",c=t.source==="store"?l?.storedIn??"store":t.source;(0,logger_1.printInfo)(`Login: ${d||"unknown"}`),(0,logger_1.printInfo)(`Credential: ${c}`),t.stored?.expiresAt&&(0,logger_1.printInfo)(`Token expires: ${new Date(t.stored.expiresAt).toISOString()}`);const i=await(0,check_1.checkEntitlement)({interactive:!1,home:o,deps:n});if(i.status==="active"){const h=i.via==="cache"?"via cache":i.via==="grace"?`in grace until ${new Date(i.checkedAt+cache_1.GRACE_MS).toISOString()}`:"verified live";(0,logger_1.printInfo)(`Entitlement: active (${h}, credential: ${i.credentialSource})`);const a=(0,cache_1.readRecord)(o);if(a?.deniedAt&&!a.confirmed){const f=Math.max(0,Math.ceil((a.deniedAt+cache_1.DENIAL_TTL_MS-Date.now())/6e4));(0,logger_1.printWarning)(`A recent probe suggested access was lost \u2014 confirming in ~${f}m.`)}return 0}return(0,logger_1.printInfo)(`Entitlement: revoked \u2014 credential ${i.credentialSource} has no access.`),1}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,t,n,o){o===void 0&&(o=n);var e=Object.getOwnPropertyDescriptor(t,n);(!e||("get"in e?!t.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(r,o,e)}):(function(r,t,n,o){o===void 0&&(o=n),r[o]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),__importStar=this&&this.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(n){var o=[];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(o[o.length]=e);return o},r(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=r(t),e=0;e<o.length;e++)o[e]!=="default"&&__createBinding(n,t,o[e]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.syncCodexMcpConfig=syncCodexMcpConfig,exports.syncKimiMcpConfig=syncKimiMcpConfig,exports.syncOmpMcpConfig=syncOmpMcpConfig,exports.removePiCodegraphMcpConfig=removePiCodegraphMcpConfig,exports.isKitWrittenCodegraphEntry=isKitWrittenCodegraphEntry,exports.syncGrokMcpConfig=syncGrokMcpConfig,exports.syncDevinMcpConfig=syncDevinMcpConfig,exports.syncAugmentMcpConfig=syncAugmentMcpConfig,exports.syncCursorMcpConfig=syncCursorMcpConfig;const fs=__importStar(require("fs")),path=__importStar(require("path")),context_mode_remover_1=require("../context-mode-remover"),omp_home_1=require("../omp-home"),pi_home_1=require("../pi-home"),pi_config_json_1=require("../kit-installers/pi-config-json"),pi_packages_1=require("../kit-installers/pi-packages"),devin_home_1=require("../kit-installers/devin-home"),grok_payload_1=require("../kit-installers/grok-payload"),grok_1=require("../kit-installers/grok"),grok_config_toml_1=require("../kit-installers/grok-config-toml"),shared_1=require("../kit-installers/shared"),logger_1=require("../logger");function syncCodexMcpConfig(r,t,n){if(t==="codex"){const o=n==="global"?path.join(process.env.HOME||process.env.USERPROFILE||"",".codex","config.toml"):path.join(r,".codex","config.toml");try{(0,context_mode_remover_1.removeContextMode)({scope:n,platform:"codex",rootDir:path.dirname(o)}),(0,shared_1.ensureMcpServersInCodexConfig)(o),(0,logger_1.printSuccess)("Successfully verified MCP configuration in config.toml")}catch(e){(0,logger_1.printWarning)(`Could not ensure MCP servers in Codex config.toml: ${e.message}`)}}}function syncKimiMcpConfig(r,t,n){if(t!=="kimi")return;const o=process.env.KIMI_CODE_HOME||path.join(process.env.HOME||process.env.USERPROFILE||"",".kimi-code"),e=n==="global"?path.join(o,"mcp.json"):path.join(r,".kimi-code","mcp.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Kimi's mcp.json: ${s.message}`)}}function syncOmpMcpConfig(r,t){if(r!=="omp"||t!=="global")return;const n=path.join((0,omp_home_1.resolveOmpAgentDir)(),"mcp.json"),o={command:"codegraph",args:["serve","--mcp"]};try{const e=(0,shared_1.readJsonObject)(n);e.mcpServers={...e.mcpServers??{},codegraph:o},(0,shared_1.writeJsonObject)(n,e),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${n}`)}catch(e){(0,logger_1.printWarning)(`Could not write CodeGraph into omp's mcp.json: ${e.message}`)}}function removePiCodegraphMcpConfig(r,t,n){if(t!=="pi")return;const o=(0,pi_home_1.resolvePiBaseDir)(n,r),e=path.join(o,"mcp.json");try{const c=(0,shared_1.readJsonObject)(e),s=c.mcpServers;if(s===null||typeof s!="object"||Array.isArray(s))return;const
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,t,n,o){o===void 0&&(o=n);var e=Object.getOwnPropertyDescriptor(t,n);(!e||("get"in e?!t.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(r,o,e)}):(function(r,t,n,o){o===void 0&&(o=n),r[o]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}):function(r,t){r.default=t}),__importStar=this&&this.__importStar||(function(){var r=function(t){return r=Object.getOwnPropertyNames||function(n){var o=[];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(o[o.length]=e);return o},r(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=r(t),e=0;e<o.length;e++)o[e]!=="default"&&__createBinding(n,t,o[e]);return __setModuleDefault(n,t),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.syncCodexMcpConfig=syncCodexMcpConfig,exports.syncKimiMcpConfig=syncKimiMcpConfig,exports.syncOmpMcpConfig=syncOmpMcpConfig,exports.removePiCodegraphMcpConfig=removePiCodegraphMcpConfig,exports.isKitWrittenCodegraphEntry=isKitWrittenCodegraphEntry,exports.syncGrokMcpConfig=syncGrokMcpConfig,exports.syncDevinMcpConfig=syncDevinMcpConfig,exports.syncAugmentMcpConfig=syncAugmentMcpConfig,exports.syncCursorMcpConfig=syncCursorMcpConfig;const fs=__importStar(require("fs")),path=__importStar(require("path")),context_mode_remover_1=require("../context-mode-remover"),omp_home_1=require("../omp-home"),pi_home_1=require("../pi-home"),pi_config_json_1=require("../kit-installers/pi-config-json"),pi_packages_1=require("../kit-installers/pi-packages"),devin_home_1=require("../kit-installers/devin-home"),grok_payload_1=require("../kit-installers/grok-payload"),grok_1=require("../kit-installers/grok"),grok_config_toml_1=require("../kit-installers/grok-config-toml"),shared_1=require("../kit-installers/shared"),logger_1=require("../logger");function syncCodexMcpConfig(r,t,n){if(t==="codex"){const o=n==="global"?path.join(process.env.HOME||process.env.USERPROFILE||"",".codex","config.toml"):path.join(r,".codex","config.toml");try{(0,context_mode_remover_1.removeContextMode)({scope:n,platform:"codex",rootDir:path.dirname(o)}),(0,shared_1.ensureMcpServersInCodexConfig)(o),(0,logger_1.printSuccess)("Successfully verified MCP configuration in config.toml")}catch(e){(0,logger_1.printWarning)(`Could not ensure MCP servers in Codex config.toml: ${e.message}`)}}}function syncKimiMcpConfig(r,t,n){if(t!=="kimi")return;const o=process.env.KIMI_CODE_HOME||path.join(process.env.HOME||process.env.USERPROFILE||"",".kimi-code"),e=n==="global"?path.join(o,"mcp.json"):path.join(r,".kimi-code","mcp.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Kimi's mcp.json: ${s.message}`)}}function syncOmpMcpConfig(r,t){if(r!=="omp"||t!=="global")return;const n=path.join((0,omp_home_1.resolveOmpAgentDir)(),"mcp.json"),o={command:"codegraph",args:["serve","--mcp"]};try{const e=(0,shared_1.readJsonObject)(n);e.mcpServers={...e.mcpServers??{},codegraph:o},(0,shared_1.writeJsonObject)(n,e),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${n}`)}catch(e){(0,logger_1.printWarning)(`Could not write CodeGraph into omp's mcp.json: ${e.message}`)}}function removePiCodegraphMcpConfig(r,t,n){if(t!=="pi")return;const o=(0,pi_home_1.resolvePiBaseDir)(n,r),e=path.join(o,"mcp.json");try{const c=(0,shared_1.readJsonObject)(e),s=c.mcpServers;if(s===null||typeof s!="object"||Array.isArray(s))return;const p=s.codegraph;if(p===void 0)return;if(!isKitWrittenCodegraphEntry(p,r,n)){(0,logger_1.printWarning)(`Left the codegraph server in ${e} alone \u2014 it is not the entry this kit writes for ${n} scope here, so it is yours, a newer CodeGraph's, or a leftover aimed at another directory. Pi reaches CodeGraph through the pi-codegraph extension now; remove it by hand if it is a leftover.`);return}const i=(0,pi_home_1.piConfigPath)(o);if(!(0,pi_config_json_1.declaresPiPackage)(i,pi_packages_1.PI_CODEGRAPH_SPEC)){(0,logger_1.printWarning)(`Left the codegraph server in ${e} alone \u2014 ${i} does not declare ${pi_packages_1.PI_CODEGRAPH_SPEC}, so removing this entry would leave Pi with no route to CodeGraph. Fix that file, then re-run the installer to finish the switch.`);return}delete s.codegraph,(0,shared_1.writeJsonObject)(e,c),(0,logger_1.printSuccess)(`Removed this kit's codegraph MCP entry from ${e} \u2014 Pi reaches CodeGraph through the pi-codegraph extension now.`)}catch(c){(0,logger_1.printWarning)(`Could not clean up CodeGraph in Pi's mcp.json: ${c.message}`)}}function isKitWrittenCodegraphEntry(r,t,n){if(r===null||typeof r!="object"||Array.isArray(r))return!1;const{command:o,args:e}=r;if(o!=="codegraph"||!Array.isArray(e))return!1;const c=Object.keys(r).sort();if(c.length!==2||c[0]!=="args"||c[1]!=="command")return!1;const s=n==="project"?["serve","--mcp","--path",t]:["serve","--mcp"];if(e.length!==s.length)return!1;const p=s.indexOf("--path");return e.every((i,a)=>{if(typeof i!="string")return!1;if(a!==p+1)return i===s[a];const f=process.platform==="darwin"||process.platform==="win32",g=l=>{const u=path.resolve(l);return f?u.toLowerCase():u};return g(i)===g(s[a])})}function syncGrokMcpConfig(r,t,n){if(t!=="grok")return;const o=n==="global"?(0,grok_1.resolveGrokHome)():path.join(r,grok_payload_1.GROK_DIR),e=path.join(o,"config.toml"),c=n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"];try{(0,grok_config_toml_1.mergeGrokMcpServer)(e,"codegraph",c)&&(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Grok's config.toml: ${s.message}`)}}function syncDevinMcpConfig(r,t,n){if(t!=="devin")return;const o=n==="global"?(0,devin_home_1.resolveDevinConfigRoot)():path.join(r,devin_home_1.DEVIN_DIR),e=path.join(o,"mcp_config.json"),c={command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"]};try{const s=(0,shared_1.readJsonObject)(e);s.mcpServers={...s.mcpServers??{},codegraph:c},(0,shared_1.writeJsonObject)(e,s),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${e}`)}catch(s){(0,logger_1.printWarning)(`Could not write CodeGraph into Devin's mcp_config.json: ${s.message}`)}}function syncAugmentMcpConfig(r,t,n){if(t!=="augment")return;const o=path.join(r,".augment","settings.json"),e={type:"stdio",command:"codegraph",args:n==="project"?["serve","--mcp","--path",r]:["serve","--mcp"],env:{}};try{const c=(0,shared_1.readJsonObject)(o);c.mcpServers={...c.mcpServers??{},codegraph:e},(0,shared_1.writeJsonObject)(o,c),(0,logger_1.printSuccess)(`CodeGraph MCP server written to ${o}`)}catch(c){(0,logger_1.printWarning)(`Could not write CodeGraph into Augment's settings.json: ${c.message}`)}}function syncCursorMcpConfig(r,t,n){if(t==="cursor"){const o=path.join(process.env.HOME||process.env.USERPROFILE||"",".cursor"),e=(c,s,p=!0)=>{if(fs.existsSync(c))try{const i=JSON.parse(fs.readFileSync(c,"utf8"));let a={mcpServers:{}};if(fs.existsSync(s))try{a=JSON.parse(fs.readFileSync(s,"utf8"))}catch{}a.mcpServers||(a.mcpServers={}),i.mcpServers&&(a.mcpServers={...a.mcpServers,...i.mcpServers});const f=path.dirname(s);fs.existsSync(f)||fs.mkdirSync(f,{recursive:!0}),(0,shared_1.writeJsonObject)(s,a),p&&fs.unlinkSync(c),(0,logger_1.printSuccess)(`Successfully synced and cleaned up CodeGraph MCP config from ${path.basename(c)} into ${path.basename(s)}`)}catch(i){(0,logger_1.printWarning)(`Could not sync CodeGraph MCP config: ${i.message}`)}};if(n==="global"){const c=path.join(o,".mcp.json"),s=path.join(o,"mcp.json");e(c,s)}else{const c=path.join(r,".mcp.json"),s=path.join(r,"mcp.json"),p=path.join(r,".cursor",".mcp.json"),i=path.join(r,".cursor","mcp.json"),a=fs.existsSync(path.join(r,".claude"));e(c,i,!a),e(s,i),e(p,i)}}}
|