@forinda/kickjs-cli 8.17.3 → 8.18.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/dist/{agent-docs-BxHRHi1r.mjs → agent-docs-CbVUB2eN.mjs} +11 -11
- package/dist/{agent-docs-BkQx62G6.mjs → agent-docs-xZISEduq.mjs} +16 -16
- package/dist/{agent-docs-BkQx62G6.mjs.map → agent-docs-xZISEduq.mjs.map} +1 -1
- package/dist/build-BLQQMQtM.mjs +13 -0
- package/dist/{build-CARdsp9F.mjs.map → build-BLQQMQtM.mjs.map} +1 -1
- package/dist/build-CKmAKaJ1.mjs +12 -0
- package/dist/{builtins-BOWp16P2.mjs → builtins-4IV5eliu.mjs} +80 -80
- package/dist/{builtins-Cb02IU36.mjs → builtins-4OFjCWYj.mjs} +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/{config-DoZ1J2Kh.mjs → config-B3kSZiSh.mjs} +3 -3
- package/dist/{config-DoZ1J2Kh.mjs.map → config-B3kSZiSh.mjs.map} +1 -1
- package/dist/{config-CadmyiYh.mjs → config-v0mtdiYe.mjs} +2 -2
- package/dist/{doctor-C4bdYrM6.mjs → doctor-DJxEocJ5.mjs} +8 -8
- package/dist/{doctor-C4bdYrM6.mjs.map → doctor-DJxEocJ5.mjs.map} +1 -1
- package/dist/{fullstack-DjV35qtY.mjs → fullstack-DM0a3A8G.mjs} +4 -4
- package/dist/{fullstack-DjV35qtY.mjs.map → fullstack-DM0a3A8G.mjs.map} +1 -1
- package/dist/{fullstack-CiPh1wb_.mjs → fullstack-iWO7BFX6.mjs} +10 -10
- package/dist/index.d.mts +3 -50
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{plugin-BAlAQlkw.mjs → plugin-BCMbxzi5.mjs} +2 -2
- package/dist/{plugin-D8VpKAVP.mjs → plugin-P1F0k7kH.mjs} +2 -2
- package/dist/{project-CzMPptXL.mjs → project-6h_j0VK0.mjs} +25 -12
- package/dist/project-6h_j0VK0.mjs.map +1 -0
- package/dist/project-9QfIRkON.mjs +152 -0
- package/dist/{project-root-BHqLKyr9.mjs → project-root-DcfsBtCw.mjs} +3 -3
- package/dist/{project-root-BHqLKyr9.mjs.map → project-root-DcfsBtCw.mjs.map} +1 -1
- package/dist/{project-root-Ck8UKRHG.mjs → project-root-rs5vJCt5.mjs} +2 -2
- package/dist/{rolldown-runtime-BjnQdm0J.mjs → rolldown-runtime-CQE1JsWD.mjs} +1 -1
- package/dist/{run-plugins-BrI7b2Y5.mjs → run-plugins-BONtomzM.mjs} +147 -147
- package/dist/run-plugins-BONtomzM.mjs.map +1 -0
- package/dist/{typegen-D17TQ6Uy.mjs → typegen-FLvIFR3i.mjs} +5 -5
- package/dist/{typegen-D17TQ6Uy.mjs.map → typegen-FLvIFR3i.mjs.map} +1 -1
- package/dist/{typegen-0Ffq-YuL.mjs → typegen-ZG4nzOUN.mjs} +4 -4
- package/dist/{types-Bp0MoCVq.mjs → types-Doudtd8d.mjs} +1 -1
- package/package.json +12 -12
- package/templates/feature-storage/files/_dot_env.example.append +6 -0
- package/templates/feature-storage/files/src/adapters/storage.ts +2 -2
- package/templates/inertia-react/feature.json +13 -0
- package/templates/inertia-svelte/feature.json +13 -0
- package/templates/inertia-svelte/files/src/client/Layout.svelte +19 -0
- package/templates/inertia-svelte/files/src/client/Seo.svelte +47 -0
- package/templates/inertia-svelte/files/src/client/main.ts +16 -0
- package/templates/inertia-svelte/files/src/client/pages/Error.svelte +14 -0
- package/templates/inertia-svelte/files/src/client/pages/Home.svelte +13 -0
- package/templates/inertia-svelte/files/src/client/pages/Posts/Index.svelte +33 -0
- package/templates/inertia-svelte/files/src/client/ssr.ts +16 -0
- package/templates/inertia-svelte/files/src/client/svelte.d.ts +7 -0
- package/templates/inertia-svelte/files/vite.client.config.ts +32 -0
- package/templates/inertia-svelte/files/vite.config.ts +42 -0
- package/templates/inertia-vue/feature.json +13 -0
- package/templates/inertia-vue/files/src/client/Layout.vue +21 -0
- package/templates/inertia-vue/files/src/client/Seo.ts +49 -0
- package/templates/inertia-vue/files/src/client/main.ts +17 -0
- package/templates/inertia-vue/files/src/client/pages/Error.vue +16 -0
- package/templates/inertia-vue/files/src/client/pages/Home.vue +15 -0
- package/templates/inertia-vue/files/src/client/pages/Posts/Index.vue +31 -0
- package/templates/inertia-vue/files/src/client/ssr.ts +21 -0
- package/templates/inertia-vue/files/src/client/vue.d.ts +7 -0
- package/templates/inertia-vue/files/vite.client.config.ts +32 -0
- package/templates/inertia-vue/files/vite.config.ts +42 -0
- package/templates/template-inertia/feature.json +3 -13
- package/templates/template-inertia/files/src/client/app.css +1 -1
- package/templates/template-inertia/files/src/index.ts +4 -4
- package/templates/template-inertia/files/src/modules/pages/pages.controller.ts +1 -1
- package/dist/build-CARdsp9F.mjs +0 -13
- package/dist/build-I3pY30S2.mjs +0 -12
- package/dist/project-Bjk2dJc2.mjs +0 -139
- package/dist/project-CzMPptXL.mjs.map +0 -1
- package/dist/run-plugins-BrI7b2Y5.mjs.map +0 -1
- /package/templates/{template-inertia → inertia-react}/files/src/client/Layout.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/src/client/Seo.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/src/client/main.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/src/client/pages/Error.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/src/client/pages/Home.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/src/client/pages/Posts/Index.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/src/client/ssr.tsx +0 -0
- /package/templates/{template-inertia → inertia-react}/files/vite.client.config.ts +0 -0
- /package/templates/{template-inertia → inertia-react}/files/vite.config.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.
|
|
2
|
+
* @forinda/kickjs-cli v8.18.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{t as e}from"./rolldown-runtime-
|
|
11
|
+
import{t as e}from"./rolldown-runtime-CQE1JsWD.mjs";import{f as t,o as n,r,t as i}from"./config-v0mtdiYe.mjs";import{createRequire as a}from"node:module";import{existsSync as o,readFileSync as s,readdirSync as c,statSync as l}from"node:fs";import{basename as u,dirname as d,extname as f,join as p,relative as m,resolve as h,sep as g}from"node:path";import{fileURLToPath as ee}from"node:url";import{access as te,mkdir as ne,readFile as _,writeFile as v}from"node:fs/promises";import*as y from"@clack/prompts";import b from"picocolors";let x=!1;function re(e){x=e}const ie=/* @__PURE__ */ new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.json`,`.md`]);async function S(e,t){x||(await ne(d(e),{recursive:!0}),await v(e,t,`utf-8`),ie.has(f(e))&&await oe(e,t).catch(()=>{}))}let C;async function ae(e){if(C!==void 0)return C;try{C=await import(a(p(e,`package.json`)).resolve(`oxfmt`))}catch{C=await import(`oxfmt`).catch(()=>null)}return C}async function oe(e,t){let n=await ae(process.cwd());if(!n)return;let r=await se(e);if(r===null)return;let i=await n.format(e,t,r);i.code!==t&&await v(e,i.code,`utf-8`)}const w=/* @__PURE__ */ new Map;async function se(e){let t=d(e),n=t;if(w.has(n))return w.get(n);for(;;){let e=p(t,`.oxfmtrc.json`);if(o(e))try{let t=await _(e,`utf-8`),r=JSON.parse(t);return delete r.$schema,delete r.ignorePatterns,w.set(n,r),r}catch{return w.set(n,null),null}let r=d(t);if(r===t)return w.set(n,null),null;t=r}}async function ce(e){try{return await te(e),!0}catch{return!1}}const T=d(ee(import.meta.url)),E=[p(T,`..`,`templates`),p(T,`..`,`..`,`templates`)].find(e=>o(p(e,`base`)));function le(e){return e.split(`/`).map(e=>e.startsWith(`_dot_`)?`.${e.slice(5)}`:e).join(`/`)}function ue(e,t={}){let n=t.templatesDir??E,r=/* @__PURE__ */ new Map,i=[],a=[],u={},d=[],f={};for(let t of e){let e=p(n,t);if(!o(e))throw Error(`Unknown scaffold layer "${t}" (${e})`);let m=p(e,`feature.json`);if(o(m)){let e=JSON.parse(s(m,`utf-8`));i.push(...e.dependencies??[]),a.push(...e.devDependencies??[]),Object.assign(u,e.builds),d.push(...e.integrations??[]),Object.assign(f,e.scripts)}let h=p(e,`files`);if(o(h))for(let e of c(h,{recursive:!0,encoding:`utf-8`}).toSorted()){let t=p(h,e);if(!l(t).isFile())continue;let n=s(t,`utf-8`),i=le(e.split(g).join(`/`));if(i.endsWith(`.append`)){let e=i.slice(0,-7);r.set(e,(r.get(e)??``)+n)}else r.set(i,n)}}d.push(...t.extra??[]);let m=t.vars??{},h=e=>e.replace(/\{\{(\w+)\}\}/g,(e,t)=>m[t]??e);for(let[e,t]of r)t.includes(`// @kick:`)&&r.set(e,de(t,d,h));return{files:r,dependencies:[...new Set(i)],devDependencies:[...new Set(a)].filter(e=>!i.includes(e)),builds:u,integrations:d,scripts:f}}function D(e,t){let n=e=>e.replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?t[n]:e);return new Map([...e].map(([e,t])=>[e,n(t)]))}const O=/^([ \t]*)\/\/ @kick:([\w-]+)[ \t]*$/;function de(e,t,n=e=>e){let r=e.split(`
|
|
12
12
|
`),i=new Set(r.map(e=>O.exec(e)?.[2]).filter(Boolean)),a=t.filter(e=>!e.slot||i.has(e.slot)),o=[],s=-1;for(let e=0;e<r.length;e++){let t=O.exec(r[e]);if(!t){o.push(r[e]);continue}let[,i,c]=t;if(c===`imports`){s=o.length;continue}let l=a.filter(e=>e.slot===c&&e.code).map(e=>fe(`${n(e.code)},`,i));l.length>0?o.push(...l):o.at(-1)?.trimEnd().endsWith(`[`)&&r[e+1]?.trim().startsWith(`]`)&&(o.pop(),e++)}if(s>=0){let e=e=>RegExp(`(?<![\\w$])${e.replace(/\$/g,`\\$`)}(?![\\w$])`),t=o.join(`
|
|
13
13
|
`),n=/^import\b[^;]*?\bfrom\s*['"][^'"]+['"]/gm,r=(t.match(n)??[]).join(`
|
|
14
14
|
`),i=t.replace(n,``).replace(/^[ \t]*\/\/.*$/gm,``),c=t=>e(t).test(i)&&!e(t).test(r),l=a.flatMap(e=>{if(!e.import)return[];let{names:t,default:n,from:r}=e.import,i={from:r,names:t?.filter(c),default:n&&c(n)?n:void 0};return i.names?.length||i.default?[i]:[]});o.splice(s,0,...pe(l))}return o.join(`
|
|
15
15
|
`)}function fe(e,t){return e.split(`
|
|
16
16
|
`).map(e=>e&&t+e).join(`
|
|
17
17
|
`)}function pe(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=t.get(n.from)??{names:[]};e.default??=n.default;for(let t of n.names??[])e.names.includes(t)||e.names.push(t);t.set(n.from,e)}return[...t].map(([e,{names:t,default:n}])=>{let r=`import ${[n,t.length?`{ ${t.join(`, `)} }`:void 0].filter(Boolean).join(`, `)} from '${e}'`;return r.length<=100||t.length===0?r:`import ${n?`${n}, `:``}{\n${t.map(e=>` ${e},`).join(`
|
|
18
|
-
`)}\n} from '${e}'`})}const me={GET:b.green,POST:b.cyan,PUT:b.yellow,PATCH:b.magenta,DELETE:b.red};function
|
|
18
|
+
`)}\n} from '${e}'`})}const me={GET:b.green,POST:b.cyan,PUT:b.yellow,PATCH:b.magenta,DELETE:b.red};function k(e){return(me[e]??b.dim)(e.padEnd(7))}function A(e){let t=`[${e}]`.padEnd(10);switch(e){case`CRITICAL`:return b.red(t);case`WARNING`:return b.yellow(t);case`INFO`:return b.blue(b.dim(t));default:return t}}b.green(`✓`),b.red(`✖`),b.yellow(`⚠`),b.blue(`ℹ`);function j(e){y.intro(b.bgCyan(b.black(` ${e} `)))}function M(e){y.outro(e)}function N(e){y.isCancel(e)&&(y.cancel(`Operation cancelled.`),process.exit(0))}async function P(e){let t=await y.text(e);return N(t),t}async function F(e){let t=await y.select(e);return N(t),t}async function I(e){let t=await y.multiselect(e);return N(t),t}async function L(e){let t=await y.confirm(e);return N(t),t}function R(){return y.spinner()}const z=y.log,he=[[`pnpm-lock.yaml`,`pnpm`],[`yarn.lock`,`yarn`],[`bun.lock`,`bun`],[`bun.lockb`,`bun`],[`package-lock.json`,`npm`]];function B(e){for(let t=e;;t=d(t)){let e=he.find(([e])=>o(h(t,e)));if(e)return e[1];if(d(t)===t)return null}}function V(e){let t=e;for(;t;){let e=h(t,`package.json`);if(o(e))try{let t=JSON.parse(s(e,`utf-8`)).packageManager;if(typeof t==`string`){let e=t.split(`@`)[0];if(i.includes(e))return e}}catch{}let n=d(t);if(n===t)return null;t=n}return null}async function H(e,t=process.cwd()){if(e&&i.includes(e))return{pm:e,source:`flag`};let r=await n(t);if(r?.packageManager&&i.includes(r.packageManager))return{pm:r.packageManager,source:`config`};let a=V(t);if(a)return{pm:a,source:`package.json`};let o=B(t);if(o)return{pm:o,source:`lockfile`};let s=process.env.npm_config_user_agent?.split(`/`)[0];return s&&i.includes(s)?{pm:s,source:`user-agent`}:{pm:`npm`,source:`default`}}async function U(e,t=process.cwd()){let{pm:n}=await H(e,t);return n}function ge(e=process.cwd()){return V(e)??B(e)??`npm`}function W(e,n){return{pm:e,kick:r(e,`kick`),test:t(e,`test`),moduleEntry:n===`class`?`UserModule`:`UserModule()`}}function G(e,t,n=E){let r=[];for(let i of e){let e=p(n,i,`skills`);if(o(e))for(let n of c(e).filter(e=>e.endsWith(`.txt`)).toSorted()){let a=s(p(e,n),`utf8`),o=/^---\nname: (.*)\ndescription: (.*)\n---\n\n([\s\S]*)$/.exec(a);if(!o)throw Error(`${i}/skills/${n}: expected a name / description frontmatter`);let c=D(/* @__PURE__ */ new Map([[`body`,o[3].replace(/\n$/,``)]]),{...t});r.push({slug:n.slice(0,-4),name:o[1],description:o[2],body:c.get(`body`)})}}return r}function _e(e,t=E){let n=[e];!o(p(e,`kick.config.ts`))&&o(p(e,`server/kick.config.ts`))&&n.push(p(e,`server`));let r=/* @__PURE__ */ new Set;for(let e of n){let t;try{t=JSON.parse(s(p(e,`package.json`),`utf8`))}catch{continue}for(let e of Object.keys({...t.dependencies,...t.devDependencies}))r.add(e)}return r.size?c(t).filter(e=>e.startsWith(`feature-`)).toSorted().filter(e=>{let n=p(t,e,`feature.json`);if(!o(n))return!1;let i=JSON.parse(s(n,`utf8`)).dependencies;return!!i?.length&&i.every(e=>r.has(e))}):[]}function K(e,n){let r=e;return n===`fullstack`&&r!==`pnpm`?`${t(r,`dev:server`)} + ${t(r,`dev:web`)}`:t(r,`dev`)}function ve(e,n,i){return`# CLAUDE.md — ${e}
|
|
19
19
|
|
|
20
20
|
**Read \`./.agents/AGENTS.md\` first.** It is the canonical, multi-agent
|
|
21
21
|
reference for this project (Claude, Copilot, Codex, Gemini, etc.) —
|
|
@@ -64,7 +64,7 @@ prose.
|
|
|
64
64
|
|
|
65
65
|
\`\`\`bash
|
|
66
66
|
${i} install
|
|
67
|
-
${
|
|
67
|
+
${K(i,n)} # Dev server with HMR + typegen
|
|
68
68
|
${t(i,`build`)} && ${t(i,`start`)} # Production
|
|
69
69
|
${t(i,`test`)} # Vitest
|
|
70
70
|
${n===`fullstack`?t(i,`typecheck`):`${r(i,`kick`)} typecheck`} # tsc/tsgo, whichever the project has
|
|
@@ -93,7 +93,7 @@ When generating or modifying code in this project, stay aligned with the v4 conv
|
|
|
93
93
|
- **Refresh these files**: \`kick g agents -f\` regenerates \`CLAUDE.md\` at the project root and \`.agents/AGENTS.md\` + \`.agents/GEMINI.md\` + \`.agents/COPILOT.md\` + every \`.agents/skills/<name>/SKILL.md\` from the latest CLI templates. Hand-edited content is overwritten — keep customisation in \`.agents/AGENTS.local.md\` or per-skill \`SKILL.local.md\` files alongside.
|
|
94
94
|
|
|
95
95
|
For everything else (controllers, services, modules, RequestContext API, generators, CLI commands, package additions, env wiring, troubleshooting) → \`.agents/AGENTS.md\`.
|
|
96
|
-
`}function
|
|
96
|
+
`}function ye(e,n,i){return`# AGENTS.md — AI Agent Guide for ${e}
|
|
97
97
|
|
|
98
98
|
This guide is the **canonical, multi-agent reference** for this KickJS
|
|
99
99
|
application — Claude, Copilot, Codex, Gemini, etc. all read it first.
|
|
@@ -103,7 +103,7 @@ add tool-specific affordances on top.
|
|
|
103
103
|
## Before You Start
|
|
104
104
|
|
|
105
105
|
1. Run \`${i} install\` to install dependencies
|
|
106
|
-
2. Run \`${
|
|
106
|
+
2. Run \`${K(i,n)}\` to verify the app starts
|
|
107
107
|
|
|
108
108
|
\`kick\` is this project's dev dependency, not a global command: every \`kick …\`
|
|
109
109
|
below runs as \`${r(i,`kick`)} …\` in a shell.${n===`fullstack`?`
|
|
@@ -111,7 +111,7 @@ below runs as \`${r(i,`kick`)} …\` in a shell.${n===`fullstack`?`
|
|
|
111
111
|
## Fullstack workspace layout
|
|
112
112
|
|
|
113
113
|
This is a WORKSPACE root — the KickJS API lives in \`server/\`, the typed web
|
|
114
|
-
app in \`web/\`. Run both with \`${
|
|
114
|
+
app in \`web/\`. Run both with \`${K(i,n)}\`. From this root,
|
|
115
115
|
\`${t(i,`test`)}\`, \`${t(i,`typecheck`)}\` and \`${t(i,`format`)}\` reach into
|
|
116
116
|
\`server/\` (and \`web/\` for typecheck).
|
|
117
117
|
|
|
@@ -512,7 +512,7 @@ page and lists the local tools (\`kick explain\`, \`kick doctor\`, \`kick inspec
|
|
|
512
512
|
|
|
513
513
|
Start at <https://kickjs.app/>.
|
|
514
514
|
|
|
515
|
-
`}function
|
|
515
|
+
`}function q(e,t,n,r=`define`,i=[]){let a=`<!-- Generated by \`kick g agents\` for ${e}. Edits are overwritten on the next refresh; keep customisation in a SKILL.local.md alongside. -->`;return G([`base`,...i],W(n,r)).map(e=>({slug:e.slug,content:`---
|
|
516
516
|
name: ${e.name}
|
|
517
517
|
description: ${e.description}
|
|
518
518
|
---
|
|
@@ -520,7 +520,7 @@ description: ${e.description}
|
|
|
520
520
|
${a}
|
|
521
521
|
|
|
522
522
|
${e.body}
|
|
523
|
-
`}))}function
|
|
523
|
+
`}))}function be(e,t,n){return`# GEMINI.md — ${e}
|
|
524
524
|
|
|
525
525
|
**Read \`./AGENTS.md\` first.** It is the canonical, multi-agent
|
|
526
526
|
reference for this project — every convention, structure, decorator
|
|
@@ -554,7 +554,7 @@ without us copy-pasting.
|
|
|
554
554
|
\`kick g agents --only gemini -f\` regenerates this file from the
|
|
555
555
|
CLI template. Hand-edited content is overwritten — keep customisation
|
|
556
556
|
in \`.agents/GEMINI.local.md\`.
|
|
557
|
-
`}function
|
|
557
|
+
`}function xe(e,t,n){return`# COPILOT.md — ${e}
|
|
558
558
|
|
|
559
559
|
**Read \`./AGENTS.md\` first.** It is the canonical, multi-agent
|
|
560
560
|
reference for this project — every convention, structure, decorator
|
|
@@ -587,4 +587,4 @@ Codex / Cursor / Gemini / Claude Code without copy-pasting.
|
|
|
587
587
|
\`kick g agents --only copilot -f\` regenerates this file from the
|
|
588
588
|
CLI template. Hand-edited content is overwritten — keep customisation
|
|
589
589
|
in \`.agents/COPILOT.local.md\`.
|
|
590
|
-
`}var
|
|
590
|
+
`}var J=/* @__PURE__ */ e({generateAgentDocs:()=>$});const Y=`.agents`,Se=/* @__PURE__ */ new Set([`rest`,`minimal`,`fullstack`,`inertia`]);function X(e,t){if(t)return t;try{let t=JSON.parse(s(p(e,`package.json`),`utf-8`));if(t.name)return t.name.replace(/^@[^/]+\//,``)}catch{}return e.split(`/`).findLast(Boolean)??`app`}async function Z(e){try{return(await n(e))?.modules?.style===`class`?`class`:`define`}catch{return`define`}}async function Q(e,t){if(t)return t;try{let t=(await n(e))?.pattern;if(t&&Se.has(t))return t}catch{}return`rest`}async function $(e){let t=e.only??`all`,n=X(e.outDir,e.name),r=await U(e.pm,e.outDir),i=await Q(e.outDir,e.template),a=await Z(e.outDir),s=t===`agents`||t===`both`||t===`all`,c=t===`claude`||t===`both`||t===`all`,l=t===`skills`||t===`all`,u=t===`gemini`||t===`all`,d=t===`copilot`||t===`all`,f=[];if(s&&f.push({file:p(e.outDir,Y,`AGENTS.md`),render:()=>ye(n,i,r)}),c&&f.push({file:p(e.outDir,`CLAUDE.md`),render:()=>ve(n,i,r)}),l){let t=_e(e.outDir);for(let o of q(n,i,r,a,t))f.push({file:p(e.outDir,Y,`skills`,o.slug,`SKILL.md`),render:()=>o.content})}u&&f.push({file:p(e.outDir,Y,`GEMINI.md`),render:()=>be(n,i,r)}),d&&f.push({file:p(e.outDir,Y,`COPILOT.md`),render:()=>xe(n,i,r)});let m=[];for(let{file:t,render:n}of f)o(t)&&!e.force&&!await L({message:`${t.replace(e.outDir+`/`,``)} already exists. Overwrite?`,initialValue:!1})?console.log(` Skipped — existing ${t.replace(e.outDir+`/`,``)} preserved.`):(await S(t,n()),m.push(t));return m}async function Ce(e,t,n){let r=(u(e)===`server`?[e,d(e)]:[e]).find(e=>o(p(e,Y,`skills`)));if(!t.length||!r)return[];let i=await Z(e),a=new Set(G(t,W(n,i)).map(e=>e.slug)),s=q(X(e),await Q(e),n,i,t).filter(e=>a.has(e.slug)),c=[];for(let t of s){let n=p(r,Y,`skills`,t.slug,`SKILL.md`);o(n)||(await S(n,t.content),c.push(m(e,n)))}return c}export{S as C,re as S,A as _,U as a,ue as b,j as c,M as d,F as f,b as g,k as h,ge as i,z as l,P as m,$ as n,H as o,R as p,Ce as r,L as s,J as t,I as u,E as v,ce as x,D as y};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.
|
|
2
|
+
* @forinda/kickjs-cli v8.18.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{t as e}from"./rolldown-runtime-
|
|
12
|
-
`),i=new Set(r.map(e=>
|
|
11
|
+
import{t as e}from"./rolldown-runtime-CQE1JsWD.mjs";import{i as t,p as n,s as r,t as i}from"./config-B3kSZiSh.mjs";import{createRequire as a}from"node:module";import{basename as o,dirname as s,extname as c,join as l,relative as u,resolve as d,sep as f}from"node:path";import{existsSync as p,readFileSync as m,readdirSync as h,statSync as g}from"node:fs";import{access as _,mkdir as ee,readFile as te,writeFile as v}from"node:fs/promises";import*as y from"@clack/prompts";import b from"picocolors";import{fileURLToPath as ne}from"node:url";let x=!1;function S(e){x=e}const C=/* @__PURE__ */ new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.json`,`.md`]);async function w(e,t){x||(await ee(s(e),{recursive:!0}),await v(e,t,`utf-8`),C.has(c(e))&&await ie(e,t).catch(()=>{}))}let T;async function re(e){if(T!==void 0)return T;try{T=await import(a(l(e,`package.json`)).resolve(`oxfmt`))}catch{T=await import(`oxfmt`).catch(()=>null)}return T}async function ie(e,t){let n=await re(process.cwd());if(!n)return;let r=await ae(e);if(r===null)return;let i=await n.format(e,t,r);i.code!==t&&await v(e,i.code,`utf-8`)}const E=/* @__PURE__ */ new Map;async function ae(e){let t=s(e),n=t;if(E.has(n))return E.get(n);for(;;){let e=l(t,`.oxfmtrc.json`);if(p(e))try{let t=await te(e,`utf-8`),r=JSON.parse(t);return delete r.$schema,delete r.ignorePatterns,E.set(n,r),r}catch{return E.set(n,null),null}let r=s(t);if(r===t)return E.set(n,null),null;t=r}}async function oe(e){try{return await _(e),!0}catch{return!1}}const se={GET:b.green,POST:b.cyan,PUT:b.yellow,PATCH:b.magenta,DELETE:b.red};function ce(e){return(se[e]??b.dim)(e.padEnd(7))}function le(e){let t=`[${e}]`.padEnd(10);switch(e){case`CRITICAL`:return b.red(t);case`WARNING`:return b.yellow(t);case`INFO`:return b.blue(b.dim(t));default:return t}}b.green(`✓`),b.red(`✖`),b.yellow(`⚠`),b.blue(`ℹ`);function ue(e){y.intro(b.bgCyan(b.black(` ${e} `)))}function de(e){y.outro(e)}function D(e){y.isCancel(e)&&(y.cancel(`Operation cancelled.`),process.exit(0))}async function fe(e){let t=await y.text(e);return D(t),t}async function pe(e){let t=await y.select(e);return D(t),t}async function me(e){let t=await y.multiselect(e);return D(t),t}async function O(e){let t=await y.confirm(e);return D(t),t}function k(){return y.spinner()}const A=y.log,j=s(ne(import.meta.url)),M=[l(j,`..`,`templates`),l(j,`..`,`..`,`templates`)].find(e=>p(l(e,`base`)));function N(e){return e.split(`/`).map(e=>e.startsWith(`_dot_`)?`.${e.slice(5)}`:e).join(`/`)}function P(e,t={}){let n=t.templatesDir??M,r=/* @__PURE__ */ new Map,i=[],a=[],o={},s=[],c={};for(let t of e){let e=l(n,t);if(!p(e))throw Error(`Unknown scaffold layer "${t}" (${e})`);let u=l(e,`feature.json`);if(p(u)){let e=JSON.parse(m(u,`utf-8`));i.push(...e.dependencies??[]),a.push(...e.devDependencies??[]),Object.assign(o,e.builds),s.push(...e.integrations??[]),Object.assign(c,e.scripts)}let d=l(e,`files`);if(p(d))for(let e of h(d,{recursive:!0,encoding:`utf-8`}).toSorted()){let t=l(d,e);if(!g(t).isFile())continue;let n=m(t,`utf-8`),i=N(e.split(f).join(`/`));if(i.endsWith(`.append`)){let e=i.slice(0,-7);r.set(e,(r.get(e)??``)+n)}else r.set(i,n)}}s.push(...t.extra??[]);let u=t.vars??{},d=e=>e.replace(/\{\{(\w+)\}\}/g,(e,t)=>u[t]??e);for(let[e,t]of r)t.includes(`// @kick:`)&&r.set(e,L(t,s,d));return{files:r,dependencies:[...new Set(i)],devDependencies:[...new Set(a)].filter(e=>!i.includes(e)),builds:o,integrations:s,scripts:c}}function F(e,t){let n=e=>e.replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?t[n]:e);return new Map([...e].map(([e,t])=>[e,n(t)]))}const I=/^([ \t]*)\/\/ @kick:([\w-]+)[ \t]*$/;function L(e,t,n=e=>e){let r=e.split(`
|
|
12
|
+
`),i=new Set(r.map(e=>I.exec(e)?.[2]).filter(Boolean)),a=t.filter(e=>!e.slot||i.has(e.slot)),o=[],s=-1;for(let e=0;e<r.length;e++){let t=I.exec(r[e]);if(!t){o.push(r[e]);continue}let[,i,c]=t;if(c===`imports`){s=o.length;continue}let l=a.filter(e=>e.slot===c&&e.code).map(e=>R(`${n(e.code)},`,i));l.length>0?o.push(...l):o.at(-1)?.trimEnd().endsWith(`[`)&&r[e+1]?.trim().startsWith(`]`)&&(o.pop(),e++)}if(s>=0){let e=e=>RegExp(`(?<![\\w$])${e.replace(/\$/g,`\\$`)}(?![\\w$])`),t=o.join(`
|
|
13
13
|
`),n=/^import\b[^;]*?\bfrom\s*['"][^'"]+['"]/gm,r=(t.match(n)??[]).join(`
|
|
14
|
-
`),i=t.replace(n,``).replace(/^[ \t]*\/\/.*$/gm,``),c=t=>e(t).test(i)&&!e(t).test(r),l=a.flatMap(e=>{if(!e.import)return[];let{names:t,default:n,from:r}=e.import,i={from:r,names:t?.filter(c),default:n&&c(n)?n:void 0};return i.names?.length||i.default?[i]:[]});o.splice(s,0,...
|
|
15
|
-
`)}function
|
|
14
|
+
`),i=t.replace(n,``).replace(/^[ \t]*\/\/.*$/gm,``),c=t=>e(t).test(i)&&!e(t).test(r),l=a.flatMap(e=>{if(!e.import)return[];let{names:t,default:n,from:r}=e.import,i={from:r,names:t?.filter(c),default:n&&c(n)?n:void 0};return i.names?.length||i.default?[i]:[]});o.splice(s,0,...z(l))}return o.join(`
|
|
15
|
+
`)}function R(e,t){return e.split(`
|
|
16
16
|
`).map(e=>e&&t+e).join(`
|
|
17
|
-
`)}function
|
|
18
|
-
`)}\n} from '${e}'`})}const
|
|
17
|
+
`)}function z(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=t.get(n.from)??{names:[]};e.default??=n.default;for(let t of n.names??[])e.names.includes(t)||e.names.push(t);t.set(n.from,e)}return[...t].map(([e,{names:t,default:n}])=>{let r=`import ${[n,t.length?`{ ${t.join(`, `)} }`:void 0].filter(Boolean).join(`, `)} from '${e}'`;return r.length<=100||t.length===0?r:`import ${n?`${n}, `:``}{\n${t.map(e=>` ${e},`).join(`
|
|
18
|
+
`)}\n} from '${e}'`})}const he=[[`pnpm-lock.yaml`,`pnpm`],[`yarn.lock`,`yarn`],[`bun.lock`,`bun`],[`bun.lockb`,`bun`],[`package-lock.json`,`npm`]];function B(e){for(let t=e;;t=s(t)){let e=he.find(([e])=>p(d(t,e)));if(e)return e[1];if(s(t)===t)return null}}function V(e){let t=e;for(;t;){let e=d(t,`package.json`);if(p(e))try{let t=JSON.parse(m(e,`utf-8`)).packageManager;if(typeof t==`string`){let e=t.split(`@`)[0];if(i.includes(e))return e}}catch{}let n=s(t);if(n===t)return null;t=n}return null}async function H(e,t=process.cwd()){if(e&&i.includes(e))return{pm:e,source:`flag`};let n=await r(t);if(n?.packageManager&&i.includes(n.packageManager))return{pm:n.packageManager,source:`config`};let a=V(t);if(a)return{pm:a,source:`package.json`};let o=B(t);if(o)return{pm:o,source:`lockfile`};let s=process.env.npm_config_user_agent?.split(`/`)[0];return s&&i.includes(s)?{pm:s,source:`user-agent`}:{pm:`npm`,source:`default`}}async function U(e,t=process.cwd()){let{pm:n}=await H(e,t);return n}function ge(e=process.cwd()){return V(e)??B(e)??`npm`}function W(e,r){return{pm:e,kick:t(e,`kick`),test:n(e,`test`),moduleEntry:r===`class`?`UserModule`:`UserModule()`}}function G(e,t,n=M){let r=[];for(let i of e){let e=l(n,i,`skills`);if(p(e))for(let n of h(e).filter(e=>e.endsWith(`.txt`)).toSorted()){let a=m(l(e,n),`utf8`),o=/^---\nname: (.*)\ndescription: (.*)\n---\n\n([\s\S]*)$/.exec(a);if(!o)throw Error(`${i}/skills/${n}: expected a name / description frontmatter`);let s=F(/* @__PURE__ */ new Map([[`body`,o[3].replace(/\n$/,``)]]),{...t});r.push({slug:n.slice(0,-4),name:o[1],description:o[2],body:s.get(`body`)})}}return r}function _e(e,t=M){let n=[e];!p(l(e,`kick.config.ts`))&&p(l(e,`server/kick.config.ts`))&&n.push(l(e,`server`));let r=/* @__PURE__ */ new Set;for(let e of n){let t;try{t=JSON.parse(m(l(e,`package.json`),`utf8`))}catch{continue}for(let e of Object.keys({...t.dependencies,...t.devDependencies}))r.add(e)}return r.size?h(t).filter(e=>e.startsWith(`feature-`)).toSorted().filter(e=>{let n=l(t,e,`feature.json`);if(!p(n))return!1;let i=JSON.parse(m(n,`utf8`)).dependencies;return!!i?.length&&i.every(e=>r.has(e))}):[]}function K(e,t){let r=e;return t===`fullstack`&&r!==`pnpm`?`${n(r,`dev:server`)} + ${n(r,`dev:web`)}`:n(r,`dev`)}function ve(e,r,i){return`# CLAUDE.md — ${e}
|
|
19
19
|
|
|
20
20
|
**Read \`./.agents/AGENTS.md\` first.** It is the canonical, multi-agent
|
|
21
21
|
reference for this project (Claude, Copilot, Codex, Gemini, etc.) —
|
|
@@ -64,7 +64,7 @@ prose.
|
|
|
64
64
|
|
|
65
65
|
\`\`\`bash
|
|
66
66
|
${i} install
|
|
67
|
-
${
|
|
67
|
+
${K(i,r)} # Dev server with HMR + typegen
|
|
68
68
|
${n(i,`build`)} && ${n(i,`start`)} # Production
|
|
69
69
|
${n(i,`test`)} # Vitest
|
|
70
70
|
${r===`fullstack`?n(i,`typecheck`):`${t(i,`kick`)} typecheck`} # tsc/tsgo, whichever the project has
|
|
@@ -93,7 +93,7 @@ When generating or modifying code in this project, stay aligned with the v4 conv
|
|
|
93
93
|
- **Refresh these files**: \`kick g agents -f\` regenerates \`CLAUDE.md\` at the project root and \`.agents/AGENTS.md\` + \`.agents/GEMINI.md\` + \`.agents/COPILOT.md\` + every \`.agents/skills/<name>/SKILL.md\` from the latest CLI templates. Hand-edited content is overwritten — keep customisation in \`.agents/AGENTS.local.md\` or per-skill \`SKILL.local.md\` files alongside.
|
|
94
94
|
|
|
95
95
|
For everything else (controllers, services, modules, RequestContext API, generators, CLI commands, package additions, env wiring, troubleshooting) → \`.agents/AGENTS.md\`.
|
|
96
|
-
`}function
|
|
96
|
+
`}function ye(e,r,i){return`# AGENTS.md — AI Agent Guide for ${e}
|
|
97
97
|
|
|
98
98
|
This guide is the **canonical, multi-agent reference** for this KickJS
|
|
99
99
|
application — Claude, Copilot, Codex, Gemini, etc. all read it first.
|
|
@@ -103,7 +103,7 @@ add tool-specific affordances on top.
|
|
|
103
103
|
## Before You Start
|
|
104
104
|
|
|
105
105
|
1. Run \`${i} install\` to install dependencies
|
|
106
|
-
2. Run \`${
|
|
106
|
+
2. Run \`${K(i,r)}\` to verify the app starts
|
|
107
107
|
|
|
108
108
|
\`kick\` is this project's dev dependency, not a global command: every \`kick …\`
|
|
109
109
|
below runs as \`${t(i,`kick`)} …\` in a shell.${r===`fullstack`?`
|
|
@@ -111,7 +111,7 @@ below runs as \`${t(i,`kick`)} …\` in a shell.${r===`fullstack`?`
|
|
|
111
111
|
## Fullstack workspace layout
|
|
112
112
|
|
|
113
113
|
This is a WORKSPACE root — the KickJS API lives in \`server/\`, the typed web
|
|
114
|
-
app in \`web/\`. Run both with \`${
|
|
114
|
+
app in \`web/\`. Run both with \`${K(i,r)}\`. From this root,
|
|
115
115
|
\`${n(i,`test`)}\`, \`${n(i,`typecheck`)}\` and \`${n(i,`format`)}\` reach into
|
|
116
116
|
\`server/\` (and \`web/\` for typecheck).
|
|
117
117
|
|
|
@@ -512,7 +512,7 @@ page and lists the local tools (\`kick explain\`, \`kick doctor\`, \`kick inspec
|
|
|
512
512
|
|
|
513
513
|
Start at <https://kickjs.app/>.
|
|
514
514
|
|
|
515
|
-
`}function
|
|
515
|
+
`}function q(e,t,n,r=`define`,i=[]){let a=`<!-- Generated by \`kick g agents\` for ${e}. Edits are overwritten on the next refresh; keep customisation in a SKILL.local.md alongside. -->`;return G([`base`,...i],W(n,r)).map(e=>({slug:e.slug,content:`---
|
|
516
516
|
name: ${e.name}
|
|
517
517
|
description: ${e.description}
|
|
518
518
|
---
|
|
@@ -520,7 +520,7 @@ description: ${e.description}
|
|
|
520
520
|
${a}
|
|
521
521
|
|
|
522
522
|
${e.body}
|
|
523
|
-
`}))}function
|
|
523
|
+
`}))}function be(e,t,n){return`# GEMINI.md — ${e}
|
|
524
524
|
|
|
525
525
|
**Read \`./AGENTS.md\` first.** It is the canonical, multi-agent
|
|
526
526
|
reference for this project — every convention, structure, decorator
|
|
@@ -554,7 +554,7 @@ without us copy-pasting.
|
|
|
554
554
|
\`kick g agents --only gemini -f\` regenerates this file from the
|
|
555
555
|
CLI template. Hand-edited content is overwritten — keep customisation
|
|
556
556
|
in \`.agents/GEMINI.local.md\`.
|
|
557
|
-
`}function
|
|
557
|
+
`}function xe(e,t,n){return`# COPILOT.md — ${e}
|
|
558
558
|
|
|
559
559
|
**Read \`./AGENTS.md\` first.** It is the canonical, multi-agent
|
|
560
560
|
reference for this project — every convention, structure, decorator
|
|
@@ -587,5 +587,5 @@ Codex / Cursor / Gemini / Claude Code without copy-pasting.
|
|
|
587
587
|
\`kick g agents --only copilot -f\` regenerates this file from the
|
|
588
588
|
CLI template. Hand-edited content is overwritten — keep customisation
|
|
589
589
|
in \`.agents/COPILOT.local.md\`.
|
|
590
|
-
`}var
|
|
591
|
-
//# sourceMappingURL=agent-docs-
|
|
590
|
+
`}var J=/* @__PURE__ */ e({generateAgentDocs:()=>$});const Y=`.agents`,Se=/* @__PURE__ */ new Set([`rest`,`minimal`,`fullstack`,`inertia`]);function X(e,t){if(t)return t;try{let t=JSON.parse(m(l(e,`package.json`),`utf-8`));if(t.name)return t.name.replace(/^@[^/]+\//,``)}catch{}return e.split(`/`).findLast(Boolean)??`app`}async function Z(e){try{return(await r(e))?.modules?.style===`class`?`class`:`define`}catch{return`define`}}async function Q(e,t){if(t)return t;try{let t=(await r(e))?.pattern;if(t&&Se.has(t))return t}catch{}return`rest`}async function $(e){let t=e.only??`all`,n=X(e.outDir,e.name),r=await U(e.pm,e.outDir),i=await Q(e.outDir,e.template),a=await Z(e.outDir),o=t===`agents`||t===`both`||t===`all`,s=t===`claude`||t===`both`||t===`all`,c=t===`skills`||t===`all`,u=t===`gemini`||t===`all`,d=t===`copilot`||t===`all`,f=[];if(o&&f.push({file:l(e.outDir,Y,`AGENTS.md`),render:()=>ye(n,i,r)}),s&&f.push({file:l(e.outDir,`CLAUDE.md`),render:()=>ve(n,i,r)}),c){let t=_e(e.outDir);for(let o of q(n,i,r,a,t))f.push({file:l(e.outDir,Y,`skills`,o.slug,`SKILL.md`),render:()=>o.content})}u&&f.push({file:l(e.outDir,Y,`GEMINI.md`),render:()=>be(n,i,r)}),d&&f.push({file:l(e.outDir,Y,`COPILOT.md`),render:()=>xe(n,i,r)});let m=[];for(let{file:t,render:n}of f)p(t)&&!e.force&&!await O({message:`${t.replace(e.outDir+`/`,``)} already exists. Overwrite?`,initialValue:!1})?console.log(` Skipped — existing ${t.replace(e.outDir+`/`,``)} preserved.`):(await w(t,n()),m.push(t));return m}async function Ce(e,t,n){let r=(o(e)===`server`?[e,s(e)]:[e]).find(e=>p(l(e,Y,`skills`)));if(!t.length||!r)return[];let i=await Z(e),a=new Set(G(t,W(n,i)).map(e=>e.slug)),c=q(X(e),await Q(e),n,i,t).filter(e=>a.has(e.slug)),d=[];for(let t of c){let n=l(r,Y,`skills`,t.slug,`SKILL.md`);p(n)||(await w(n,t.content),d.push(u(e,n)))}return d}export{w as C,S,fe as _,U as a,le as b,F as c,ue as d,A as f,k as g,pe as h,ge as i,P as l,de as m,$ as n,H as o,me as p,Ce as r,M as s,J as t,O as u,ce as v,oe as x,b as y};
|
|
591
|
+
//# sourceMappingURL=agent-docs-xZISEduq.mjs.map
|