@vpxa/aikit 0.1.3 → 0.1.4
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/package.json +1 -1
- package/packages/cli/dist/commands/init/constants.d.ts +3 -1
- package/packages/cli/dist/commands/init/constants.js +1 -1
- package/packages/cli/dist/commands/init/index.js +4 -4
- package/packages/cli/dist/commands/init/scaffold.d.ts +8 -1
- package/packages/cli/dist/commands/init/scaffold.js +1 -1
- package/packages/cli/dist/commands/init/user.js +4 -4
- package/packages/cli/dist/commands/upgrade.js +1 -1
package/package.json
CHANGED
|
@@ -14,6 +14,8 @@ declare const MCP_SERVER_ENTRY: {
|
|
|
14
14
|
};
|
|
15
15
|
/** Skills shipped with the AI Kit package and installed during init. */
|
|
16
16
|
declare const SKILL_NAMES: readonly ["aikit", "brainstorming", "multi-agents-development", "session-handoff", "requirements-clarity", "lesson-learned", "c4-architecture", "adr-skill", "present"];
|
|
17
|
+
/** Built-in flow directories shipped with the package (under scaffold/flows/). */
|
|
18
|
+
declare const FLOW_DIRS: readonly ["aikit-basic", "aikit-advanced"];
|
|
17
19
|
/**
|
|
18
20
|
* VS Code settings merged into each VS Code-family IDE's settings.json.
|
|
19
21
|
*
|
|
@@ -38,4 +40,4 @@ declare const SKILL_NAMES: readonly ["aikit", "brainstorming", "multi-agents-dev
|
|
|
38
40
|
*/
|
|
39
41
|
declare const VSCODE_SETTINGS: Record<string, unknown>;
|
|
40
42
|
//#endregion
|
|
41
|
-
export { MCP_SERVER_ENTRY, SERVER_NAME, SKILL_NAMES, VSCODE_SETTINGS };
|
|
43
|
+
export { FLOW_DIRS, MCP_SERVER_ENTRY, SERVER_NAME, SKILL_NAMES, VSCODE_SETTINGS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=`aikit`,t={type:`stdio`,command:`npx`,args:[`-y`,`@vpxa/aikit`,`serve`]},n=[`aikit`,`brainstorming`,`multi-agents-development`,`session-handoff`,`requirements-clarity`,`lesson-learned`,`c4-architecture`,`adr-skill`,`present`],r={"chat.agentFilesLocations":{"~/.claude/agents":!1},"github.copilot.chat.copilotMemory.enabled":!0,"chat.customAgentInSubagent.enabled":!0,"chat.useNestedAgentsMdFiles":!0,"chat.useAgentSkills":!0,"github.copilot.chat.switchAgent.enabled":!0,"workbench.browser.enableChatTools":!0,"chat.mcp.apps.enabled":!0};export{t as MCP_SERVER_ENTRY,e as SERVER_NAME,n as SKILL_NAMES,
|
|
1
|
+
const e=`aikit`,t={type:`stdio`,command:`npx`,args:[`-y`,`@vpxa/aikit`,`serve`]},n=[`aikit`,`brainstorming`,`multi-agents-development`,`session-handoff`,`requirements-clarity`,`lesson-learned`,`c4-architecture`,`adr-skill`,`present`],r=[`aikit-basic`,`aikit-advanced`],i={"chat.agentFilesLocations":{"~/.claude/agents":!1},"github.copilot.chat.copilotMemory.enabled":!0,"chat.customAgentInSubagent.enabled":!0,"chat.useNestedAgentsMdFiles":!0,"chat.useAgentSkills":!0,"github.copilot.chat.switchAgent.enabled":!0,"workbench.browser.enableChatTools":!0,"chat.mcp.apps.enabled":!0};export{r as FLOW_DIRS,t as MCP_SERVER_ENTRY,e as SERVER_NAME,n as SKILL_NAMES,i as VSCODE_SETTINGS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{SKILL_NAMES as
|
|
2
|
-
AI Kit initialized! Next steps:`),console.log(` aikit reindex Index your codebase`),console.log(` aikit search Search indexed content`),console.log(` aikit serve Start MCP server for IDE integration`),
|
|
3
|
-
Note: User-level AI Kit is also installed. This workspace uses its own local data store.`)}async function
|
|
1
|
+
import{FLOW_DIRS as e,SKILL_NAMES as t}from"./constants.js";import{detectIde as n,getAdapter as r}from"./adapters.js";import{ensureGitignore as i,getServerName as a,writeKbConfig as o}from"./config.js";import{createCuratedDirs as s}from"./curated.js";import{guideFlows as c,guideScaffold as l,guideSkills as u,smartCopyFlows as d,smartCopyScaffold as f,smartCopySkills as p}from"./scaffold.js";import{readFileSync as m}from"node:fs";import{dirname as h,resolve as g}from"node:path";import{fileURLToPath as _}from"node:url";import{isUserInstalled as v}from"../../../../core/dist/index.js";async function y(c){let l=process.cwd();if(!o(l,c.force))return;i(l);let u=a(),y=r(n(l));y.writeMcpConfig(l,u),y.writeInstructions(l,u),y.writeAgentsMd(l,u);let b=g(h(_(import.meta.url)),`..`,`..`,`..`,`..`,`..`),x=JSON.parse(m(g(b,`package.json`),`utf-8`)).version;p(l,b,[...t],x,c.force),d(l,b,[...e],x,c.force),f(l,b,y.scaffoldDir,x,c.force),s(l),console.log(`
|
|
2
|
+
AI Kit initialized! Next steps:`),console.log(` aikit reindex Index your codebase`),console.log(` aikit search Search indexed content`),console.log(` aikit serve Start MCP server for IDE integration`),v()&&console.log(`
|
|
3
|
+
Note: User-level AI Kit is also installed. This workspace uses its own local data store.`)}async function b(e){v()?await x(e):await y(e)}async function x(t){let o=process.cwd(),c=a(),l=r(n(o));l.writeInstructions(o,c),l.writeAgentsMd(o,c);let u=g(h(_(import.meta.url)),`..`,`..`,`..`,`..`,`..`),p=JSON.parse(m(g(u,`package.json`),`utf-8`)).version;f(o,u,l.scaffoldDir,p,t.force),d(o,u,[...e],p,t.force),s(o),i(o),console.log(`
|
|
4
4
|
Workspace scaffolded for user-level AI Kit! Files added:`),console.log(` Instruction files (AGENTS.md, copilot-instructions.md, etc.)`),console.log(` .ai/curated/ directories`),console.log(` .github/agents/ & .github/prompts/`),console.log(`
|
|
5
|
-
The user-level AI Kit server will auto-index this workspace when opened in your IDE.`)}async function
|
|
5
|
+
The user-level AI Kit server will auto-index this workspace when opened in your IDE.`)}async function S(){let i=process.cwd(),a=r(n(i)),o=g(h(_(import.meta.url)),`..`,`..`,`..`,`..`,`..`),s=[...u(i,o,[...t]),...c(i,o,[...e]),...l(i,o,a.scaffoldDir)],d={summary:{total:s.length,new:s.filter(e=>e.status===`new`).length,outdated:s.filter(e=>e.status===`outdated`).length,current:s.filter(e=>e.status===`current`).length},files:s};console.log(JSON.stringify(d,null,2))}export{S as guideProject,y as initProject,x as initScaffoldOnly,b as initSmart};
|
|
@@ -42,5 +42,12 @@ declare function copySkills(cwd: string, pkgRoot: string, skillNames: string[],
|
|
|
42
42
|
declare function guideScaffold(cwd: string, pkgRoot: string, ide: string): GuideFileEntry[];
|
|
43
43
|
/** Generate guide report for skill files — compare source vs destination. */
|
|
44
44
|
declare function guideSkills(cwd: string, pkgRoot: string, skillNames: string[]): GuideFileEntry[];
|
|
45
|
+
/**
|
|
46
|
+
* Smart-copy built-in flow skill files with manifest tracking.
|
|
47
|
+
* Copies from scaffold/flows/<flowName>/skills/ into .github/flows/<flowName>/skills/.
|
|
48
|
+
*/
|
|
49
|
+
declare function smartCopyFlows(cwd: string, pkgRoot: string, flowDirs: string[], version: string, force?: boolean): void;
|
|
50
|
+
/** Generate guide report for flow skill files. */
|
|
51
|
+
declare function guideFlows(cwd: string, pkgRoot: string, flowDirs: string[]): GuideFileEntry[];
|
|
45
52
|
//#endregion
|
|
46
|
-
export { GuideFileEntry, copyDirectoryRecursive, copyScaffold, copySkills, guideScaffold, guideSkills, smartCopyDirectory, smartCopyScaffold, smartCopySkills, smartCopySubdir };
|
|
53
|
+
export { GuideFileEntry, copyDirectoryRecursive, copyScaffold, copySkills, guideFlows, guideScaffold, guideSkills, smartCopyDirectory, smartCopyFlows, smartCopyScaffold, smartCopySkills, smartCopySubdir };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mergeFrontmatter as e}from"./frontmatter.js";import{createManifest as t,getFileStatus as n,getUpdateStrategy as r,readManifest as i,recordDeployment as a,writeManifest as o}from"./manifest.js";import{copyFileSync as s,existsSync as c,mkdirSync as l,readFileSync as u,readdirSync as d,statSync as f,writeFileSync as p}from"node:fs";import{dirname as m,resolve as h}from"node:path";function g(e,t,n=``,r=!1){l(t,{recursive:!0});for(let i of d(e)){let a=h(e,i),o=h(t,i),l=n?`${n}/${i}`:i;f(a).isDirectory()?g(a,o,l,r):(r||!c(o))&&s(a,o)}}function _(t,i,o,s=``,g=!1){if(c(t)){l(i,{recursive:!0});for(let v of d(t)){let d=h(t,v),y=h(i,v),b=s?`${s}/${v}`:v;if(f(d).isDirectory()){_(d,y,o,b,g);continue}let x=u(d,`utf-8`);if(g){l(m(y),{recursive:!0}),p(y,x,`utf-8`),a(o,b,x);continue}let S=n(o,b,x);if(S!==`current`){if(S===`new`&&!c(y)){l(m(y),{recursive:!0}),p(y,x,`utf-8`),a(o,b,x);continue}if(S===`new`&&c(y)){a(o,b,x);continue}r(b)===`merge-frontmatter`&&c(y)?p(y,e(x,u(y,`utf-8`)),`utf-8`):(l(m(y),{recursive:!0}),p(y,x,`utf-8`)),a(o,b,x)}}}}function v(e,n,r,a,s=!1){let l=h(n,`scaffold`,r),u=h(e,`.github`),d=h(u,`.aikit-scaffold.json`),f=i(d)??t(a);f.version=a;for(let e of[`agents`,`prompts`]){let t=h(l,e);c(t)&&_(t,h(u,e),f,e,s)}o(d,f)}function y(e,n,r,a,s=!1){let l=h(e,`.github`),u=h(l,`.aikit-scaffold.json`),d=i(u)??t(a);d.version=a;for(let e of r){let t=h(n,`scaffold`,`general`,`skills`,e);c(t)&&_(t,h(l,`skills`,e),d,`skills/${e}`,s)}o(u,d)}function b(e,n,r,a,s=!1){let l=h(e,r);if(!c(l))return;let u=h(n,r),d=h(n,`.aikit-scaffold.json`),f=i(d)??t(a);f.version=a,_(l,u,f,r,s),o(d,f)}function x(e,t,n,r){if(c(e))for(let i of d(e)){let a=h(e,i),o=n?`${n}/${i}`:i;if(f(a).isDirectory())x(a,h(t,i),o,r);else{let e=h(t,i),n=u(a,`utf-8`);c(e)?n===u(e,`utf-8`)?r.push({status:`current`,relativePath:o,sourcePath:a}):r.push({status:`outdated`,relativePath:o,sourcePath:a,content:n}):r.push({status:`new`,relativePath:o,sourcePath:a,content:n})}}}function S(e,t,n,r=!1){let i=h(t,`scaffold`,n);for(let t of[`agents`,`prompts`]){let n=h(i,t),a=h(e,`.github`,t);c(n)&&g(n,a,``,r)}}function C(e,t,n,r=!1){for(let i of n){let n=h(t,`scaffold`,`general`,`skills`,i);c(n)&&g(n,h(e,`.github`,`skills`,i),`skills/${i}`,r)}}function w(e,t,n){let r=[],i=h(t,`scaffold`,n);for(let t of[`agents`,`prompts`])x(h(i,t),h(e,`.github`,t),t,r);return r}function T(e,t,n){let r=[];for(let i of n){let n=h(t,`scaffold`,`general`,`skills`,i);c(n)&&x(n,h(e,`.github`,`skills`,i),`skills/${i}`,r)}return r}export{g as copyDirectoryRecursive,S as copyScaffold,C as copySkills,w as guideScaffold,T as guideSkills,_ as smartCopyDirectory,v as smartCopyScaffold,y as smartCopySkills,b as smartCopySubdir};
|
|
1
|
+
import{mergeFrontmatter as e}from"./frontmatter.js";import{createManifest as t,getFileStatus as n,getUpdateStrategy as r,readManifest as i,recordDeployment as a,writeManifest as o}from"./manifest.js";import{copyFileSync as s,existsSync as c,mkdirSync as l,readFileSync as u,readdirSync as d,statSync as f,writeFileSync as p}from"node:fs";import{dirname as m,resolve as h}from"node:path";function g(e,t,n=``,r=!1){l(t,{recursive:!0});for(let i of d(e)){let a=h(e,i),o=h(t,i),l=n?`${n}/${i}`:i;f(a).isDirectory()?g(a,o,l,r):(r||!c(o))&&s(a,o)}}function _(t,i,o,s=``,g=!1){if(c(t)){l(i,{recursive:!0});for(let v of d(t)){let d=h(t,v),y=h(i,v),b=s?`${s}/${v}`:v;if(f(d).isDirectory()){_(d,y,o,b,g);continue}let x=u(d,`utf-8`);if(g){l(m(y),{recursive:!0}),p(y,x,`utf-8`),a(o,b,x);continue}let S=n(o,b,x);if(S!==`current`){if(S===`new`&&!c(y)){l(m(y),{recursive:!0}),p(y,x,`utf-8`),a(o,b,x);continue}if(S===`new`&&c(y)){a(o,b,x);continue}r(b)===`merge-frontmatter`&&c(y)?p(y,e(x,u(y,`utf-8`)),`utf-8`):(l(m(y),{recursive:!0}),p(y,x,`utf-8`)),a(o,b,x)}}}}function v(e,n,r,a,s=!1){let l=h(n,`scaffold`,r),u=h(e,`.github`),d=h(u,`.aikit-scaffold.json`),f=i(d)??t(a);f.version=a;for(let e of[`agents`,`prompts`]){let t=h(l,e);c(t)&&_(t,h(u,e),f,e,s)}o(d,f)}function y(e,n,r,a,s=!1){let l=h(e,`.github`),u=h(l,`.aikit-scaffold.json`),d=i(u)??t(a);d.version=a;for(let e of r){let t=h(n,`scaffold`,`general`,`skills`,e);c(t)&&_(t,h(l,`skills`,e),d,`skills/${e}`,s)}o(u,d)}function b(e,n,r,a,s=!1){let l=h(e,r);if(!c(l))return;let u=h(n,r),d=h(n,`.aikit-scaffold.json`),f=i(d)??t(a);f.version=a,_(l,u,f,r,s),o(d,f)}function x(e,t,n,r){if(c(e))for(let i of d(e)){let a=h(e,i),o=n?`${n}/${i}`:i;if(f(a).isDirectory())x(a,h(t,i),o,r);else{let e=h(t,i),n=u(a,`utf-8`);c(e)?n===u(e,`utf-8`)?r.push({status:`current`,relativePath:o,sourcePath:a}):r.push({status:`outdated`,relativePath:o,sourcePath:a,content:n}):r.push({status:`new`,relativePath:o,sourcePath:a,content:n})}}}function S(e,t,n,r=!1){let i=h(t,`scaffold`,n);for(let t of[`agents`,`prompts`]){let n=h(i,t),a=h(e,`.github`,t);c(n)&&g(n,a,``,r)}}function C(e,t,n,r=!1){for(let i of n){let n=h(t,`scaffold`,`general`,`skills`,i);c(n)&&g(n,h(e,`.github`,`skills`,i),`skills/${i}`,r)}}function w(e,t,n){let r=[],i=h(t,`scaffold`,n);for(let t of[`agents`,`prompts`])x(h(i,t),h(e,`.github`,t),t,r);return r}function T(e,t,n){let r=[];for(let i of n){let n=h(t,`scaffold`,`general`,`skills`,i);c(n)&&x(n,h(e,`.github`,`skills`,i),`skills/${i}`,r)}return r}function E(e,n,r,a,s=!1){let l=h(e,`.github`),u=h(l,`.aikit-scaffold.json`),d=i(u)??t(a);d.version=a;for(let e of r){let t=h(n,`scaffold`,`flows`,e,`skills`);c(t)&&_(t,h(l,`flows`,e,`skills`),d,`flows/${e}/skills`,s)}o(u,d)}function D(e,t,n){let r=[];for(let i of n){let n=h(t,`scaffold`,`flows`,i,`skills`);c(n)&&x(n,h(e,`.github`,`flows`,i,`skills`),`flows/${i}/skills`,r)}return r}export{g as copyDirectoryRecursive,S as copyScaffold,C as copySkills,D as guideFlows,w as guideScaffold,T as guideSkills,_ as smartCopyDirectory,E as smartCopyFlows,v as smartCopyScaffold,y as smartCopySkills,b as smartCopySubdir};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
No supported IDEs detected. You can manually add the MCP server config.`);else{console.log(`\n Detected ${o.length} IDE(s):`);for(let
|
|
3
|
-
Installing scaffold files:`),
|
|
1
|
+
import{FLOW_DIRS as e,MCP_SERVER_ENTRY as t,SERVER_NAME as n,SKILL_NAMES as r,VSCODE_SETTINGS as i}from"./constants.js";import{buildAgentsMd as a,buildCopilotInstructions as o}from"./templates.js";import{smartCopySubdir as s}from"./scaffold.js";import{existsSync as c,mkdirSync as l,readFileSync as u,writeFileSync as d}from"node:fs";import{dirname as f,resolve as p}from"node:path";import{fileURLToPath as m}from"node:url";import{getGlobalDataDir as h,saveRegistry as g}from"../../../../core/dist/index.js";import{homedir as _}from"node:os";function v(){let e=_(),t=process.platform,n=[],r=p(e,`.copilot`),i=p(r,`instructions`),a=p(e,`.claude`),o=p(e,`.cursor`),s=p(e,`.windsurf`);if(t===`win32`){let t=process.env.APPDATA??p(e,`AppData`,`Roaming`);n.push({ide:`VS Code`,configDir:p(t,`Code`,`User`),mcpConfigPath:p(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:p(t,`Code - Insiders`,`User`),mcpConfigPath:p(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:p(t,`VSCodium`,`User`),mcpConfigPath:p(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:p(t,`Cursor`,`User`),mcpConfigPath:p(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:p(t,`Cursor Nightly`,`User`),mcpConfigPath:p(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:p(t,`Windsurf`,`User`),mcpConfigPath:p(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}else if(t===`darwin`){let t=p(e,`Library`,`Application Support`);n.push({ide:`VS Code`,configDir:p(t,`Code`,`User`),mcpConfigPath:p(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:p(t,`Code - Insiders`,`User`),mcpConfigPath:p(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:p(t,`VSCodium`,`User`),mcpConfigPath:p(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:p(t,`Cursor`,`User`),mcpConfigPath:p(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:p(t,`Cursor Nightly`,`User`),mcpConfigPath:p(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:p(t,`Windsurf`,`User`),mcpConfigPath:p(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}else{let t=process.env.XDG_CONFIG_HOME??p(e,`.config`);n.push({ide:`VS Code`,configDir:p(t,`Code`,`User`),mcpConfigPath:p(t,`Code`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VS Code Insiders`,configDir:p(t,`Code - Insiders`,`User`),mcpConfigPath:p(t,`Code - Insiders`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`VSCodium`,configDir:p(t,`VSCodium`,`User`),mcpConfigPath:p(t,`VSCodium`,`User`,`mcp.json`),globalScaffoldRoot:r,instructionsRoot:i},{ide:`Cursor`,configDir:p(t,`Cursor`,`User`),mcpConfigPath:p(t,`Cursor`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Cursor Nightly`,configDir:p(t,`Cursor Nightly`,`User`),mcpConfigPath:p(t,`Cursor Nightly`,`User`,`mcp.json`),globalScaffoldRoot:o,instructionsRoot:null},{ide:`Windsurf`,configDir:p(t,`Windsurf`,`User`),mcpConfigPath:p(t,`Windsurf`,`User`,`mcp.json`),globalScaffoldRoot:s,instructionsRoot:null})}return n.push({ide:`Claude Code`,configDir:p(e,`.claude`),mcpConfigPath:p(e,`.claude`,`mcp.json`),globalScaffoldRoot:a,instructionsRoot:null}),n.filter(e=>c(e.configDir))}function y(e,n,r=!1){let{mcpConfigPath:i,configDir:a}=e,o={...t},s={};if(c(i)){try{let e=u(i,`utf-8`);s=JSON.parse(e)}catch{let e=`${i}.bak`;d(e,u(i,`utf-8`),`utf-8`),console.log(` Backed up invalid ${i} to ${e}`),s={}}if((s.servers??s.mcpServers??{})[n]&&!r){console.log(` ${e.ide}: ${n} already configured (use --force to update)`);return}}let f=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`,`Windsurf`]).has(e.ide)?`servers`:`mcpServers`,p=s[f]??{};p[n]=o,s[f]=p,l(a,{recursive:!0}),d(i,`${JSON.stringify(s,null,2)}\n`,`utf-8`),console.log(` ${e.ide}: configured ${n} in ${i}`)}const b=new Set([`VS Code`,`VS Code Insiders`,`VSCodium`]);function x(e,t=!1){if(!b.has(e.ide))return;let n=p(e.configDir,`settings.json`),r={};if(c(n))try{let e=u(n,`utf-8`);r=JSON.parse(e)}catch{console.log(` ${e.ide}: skipped settings.json (invalid JSON)`);return}let a=!1;for(let[e,n]of Object.entries(i))if(typeof n==`object`&&n){let t=typeof r[e]==`object`&&r[e]!==null?r[e]:{},i={...t,...n};JSON.stringify(i)!==JSON.stringify(t)&&(r[e]=i,a=!0)}else (t||!(e in r))&&(r[e]=n,a=!0);a&&(d(n,`${JSON.stringify(r,null,2)}\n`,`utf-8`),console.log(` ${e.ide}: updated settings.json`))}function S(t,n,i,u,f=!1){let m=new Set;for(let e of n)e.globalScaffoldRoot&&m.add(e.globalScaffoldRoot);if(m.size===0){console.log(` No IDEs with global scaffold support detected.`);return}let h=p(t,`scaffold`,`general`);for(let n of m){s(h,n,`agents`,u,f),s(h,n,`prompts`,u,f);let i=0;for(let e of r)c(p(h,`skills`,e))&&(s(h,n,`skills/${e}`,u,f),i++);for(let r of e){let e=p(t,`scaffold`,`flows`,r);c(p(e,`skills`))&&s(e,p(n,`flows`,r),`skills`,u,f)}console.log(` ${n}: scaffold updated (${i} skills)`)}let g=new Set,_=o(`aikit`,i),v=a(`aikit`,i);for(let e of n){if(!e.globalScaffoldRoot)continue;let t=e.globalScaffoldRoot;if(e.ide===`Claude Code`){let e=p(t,`CLAUDE.md`);d(e,`${_}\n---\n\n${v}`,`utf-8`),g.add(e)}else if(e.ide===`VS Code`||e.ide===`VS Code Insiders`||e.ide===`VSCodium`){let n=e.instructionsRoot??t;l(n,{recursive:!0});let r=p(n,`kb.instructions.md`);g.has(r)||(d(r,`---\napplyTo: "**"\n---\n\n${_}\n---\n\n${v}`,`utf-8`),g.add(r))}else if(e.ide===`Cursor`||e.ide===`Cursor Nightly`){let e=p(t,`rules`);l(e,{recursive:!0});let n=p(e,`kb.mdc`);g.has(n)||(d(n,`${_}\n---\n\n${v}`,`utf-8`),g.add(n))}else if(e.ide===`Windsurf`){let e=p(t,`rules`);l(e,{recursive:!0});let n=p(e,`kb.md`);g.has(n)||(d(n,`${_}\n---\n\n${v}`,`utf-8`),g.add(n))}}g.size>0&&console.log(` Instruction files: ${[...g].join(`, `)}`)}async function C(e){let t=n,r=p(f(m(import.meta.url)),`..`,`..`,`..`,`..`,`..`,`package.json`),i=JSON.parse(u(r,`utf-8`)).version;console.log(`Initializing @vpxa/aikit v${i}...\n`);let a=h();l(a,{recursive:!0}),console.log(` Global data store: ${a}`),g({version:1,workspaces:{}}),console.log(` Created registry.json`);let o=v();if(o.length===0)console.log(`
|
|
2
|
+
No supported IDEs detected. You can manually add the MCP server config.`);else{console.log(`\n Detected ${o.length} IDE(s):`);for(let n of o)y(n,t,e.force),x(n,e.force)}let s=p(f(m(import.meta.url)),`..`,`..`,`..`,`..`,`..`);console.log(`
|
|
3
|
+
Installing scaffold files:`),S(s,o,t,i,e.force),console.log(`
|
|
4
4
|
User-level AI Kit installation complete!`),console.log(`
|
|
5
|
-
Next steps:`),console.log(` 1. Open any workspace in your IDE`),console.log(` 2. The AI Kit server will auto-start and index the workspace`),console.log(` 3. Agents, prompts, skills & instructions are available globally`),console.log(` 4. No per-workspace init needed — just open a project and start coding`)}export{
|
|
5
|
+
Next steps:`),console.log(` 1. Open any workspace in your IDE`),console.log(` 2. The AI Kit server will auto-start and index the workspace`),console.log(` 3. Agents, prompts, skills & instructions are available globally`),console.log(` 4. No per-workspace init needed — just open a project and start coding`)}export{v as detectInstalledIdes,C as initUser,S as installGlobalScaffold,y as writeUserLevelMcpConfig,x as writeVscodeSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SKILL_NAMES as
|
|
1
|
+
import{FLOW_DIRS as e,SKILL_NAMES as t}from"./init/constants.js";import{existsSync as n,readFileSync as r}from"node:fs";import{dirname as i,resolve as a}from"node:path";import{fileURLToPath as o}from"node:url";const s=[{name:`upgrade`,description:`Upgrade AI Kit agents, prompts, and skills to the latest version (user-level and workspace-level)`,usage:`aikit upgrade`,run:async()=>{let{initUser:s}=await import(`./init/user.js`);if(await s({force:!0}),n(a(process.cwd(),`.github`,`.aikit-scaffold.json`))){let{initScaffoldOnly:s}=await import(`./init/index.js`);if(await s({force:!0}),n(a(process.cwd(),`.github`,`skills`))){let{smartCopySkills:n}=await import(`./init/scaffold.js`),s=a(i(o(import.meta.url)),`..`,`..`,`..`,`..`),c=JSON.parse(r(a(s,`package.json`),`utf-8`)).version;n(process.cwd(),s,[...t],c,!0);let{smartCopyFlows:l}=await import(`./init/scaffold.js`);l(process.cwd(),s,[...e],c,!0)}}}}];export{s as upgradeCommands};
|