@stacksjs/buddy 0.74.42 → 0.74.43
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readdirSync,readFileSync,statSync,writeFileSync}from"node:fs";import{join}from"node:path";import process from"node:process";import{assertFrameworkRepo}from"./framework-repo";const root=new URL("../../../../../../../",import.meta.url).pathname;function abs(relative){return join(root,relative)}function countFiles(dir,extension){let entries;try{entries=readdirSync(abs(dir))}catch{return 0}return entries.reduce((total,entry)=>{const full=join(abs(dir),entry);if(statSync(full).isDirectory())return total+countFiles(join(dir,entry),extension);if(!entry.endsWith(extension)||entry==="index.ts")return total;return total+1},0)}function countDirs(dir){return readdirSync(abs(dir)).filter((entry)=>statSync(join(abs(dir),entry)).isDirectory()).length}const SKILLS="storage/framework/defaults/ai/skills",AGENTS="AGENTS.md",CLAIMS=[{what:"built-in models",measure:()=>countFiles("storage/framework/defaults/app/Models",".ts"),sites:[{file:AGENTS,pattern:/(\d+) built-in models you can use or override/},{file:AGENTS,pattern:/All (\d+) models \(`User`/},{file:`${SKILLS}/stacks-orm/SKILL.md`,pattern:/(\d+) models/},{file:`${SKILLS}/stacks-auto-imports/SKILL.md`,pattern:/\((\d+) models\)/}]},{what:"commerce models",measure:()=>countFiles("storage/framework/defaults/app/Models/commerce",".ts"),sites:[{file:`${SKILLS}/stacks-commerce/SKILL.md`,pattern:/and (\d+) models/},{file:`${SKILLS}/stacks-types/SKILL.md`,pattern:/Commerce \((\d+) models\)/}]},{what:"components",measure:()=>countFiles("storage/framework/defaults/resources/components",".stx"),sites:[{file:AGENTS,pattern:/widgets \((\d+) components\)/},{file:`${SKILLS}/stacks-dashboard/SKILL.md`,pattern:/(\d+) built-in dashboard components/}]},{what:"default actions",measure:()=>readFileSync(abs("storage/framework/auto-imports/actions.ts"),"utf-8").split(`
|
|
2
|
-
`).filter((line)=>/^\s+'/.test(line)).length,sites:[{file:AGENTS,pattern:/(\d+) default actions/}]},{what:"migrations",measure:()=>countFiles("database/migrations",".sql"),sites:[{file:AGENTS,pattern:/(\d+) migrations ship for/}]},{what:"browser auto-imports",measure:()=>Object.keys(JSON.parse(readFileSync(abs("storage/framework/browser-auto-imports.json"),"utf-8")).globals).length,sites:[{file:AGENTS,pattern:/There are \*\*(\d+)\*\* of/}]},{what:"composables",measure:()=>new Set(readFileSync(abs("storage/framework/core/composables/src/index.ts"),"utf-8").match(/\buse[A-Z][A-Za-z0-9]*/g)??[]).size,sites:[{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/(\d+) composables/}]},{what:"skills",measure:()=>countDirs(SKILLS),sites:[{file:`${SKILLS}/stacks-writing-for-agents/SKILL.md`,pattern:/ships (\d+) skills/}]}];function inspect(){const drift=[];let checked=0;for(const claim of CLAIMS){const actual=claim.measure();for(const site of claim.sites){checked++;const match=readFileSync(abs(site.file),"utf-8").match(site.pattern),stated=match?Number(match[1]):null;if(stated!==actual)drift.push({what:claim.what,file:site.file,stated,actual})}}return{drift,checked}}function write(){let rewritten=0;for(const claim of CLAIMS){const actual=claim.measure();for(const site of claim.sites){const source=readFileSync(abs(site.file),"utf-8"),match=source.match(site.pattern);if(!match||Number(match[1])===actual)continue;const updated=match[0].replace(String(match[1]),String(actual));writeFileSync(abs(site.file),source.replace(match[0],updated),"utf-8");rewritten++}}return rewritten}export async function run(){assertFrameworkRepo(root,"docs:agent-counts");if(process.argv.includes("--write")){const rewritten=write();console.log(rewritten===0?"\u2713 agent-facing counts were already current":`\u2713 updated ${rewritten} count(s); run \`buddy setup:ai\` to refresh the installed copies`);return}const{drift,checked}=inspect();if(drift.length===0){console.log(`\u2713 agent-facing counts are current (${checked} checked)`);return}console.error(`\u2717 ${drift.length} of ${checked} agent-facing count(s) no longer match the tree:`);for(const entry of drift)console.error(entry.stated===null?` ${entry.file}: the ${entry.what} claim is gone - reword the check, or restore the sentence`:` ${entry.file}: says ${entry.stated} ${entry.what}, tree has ${entry.actual}`);console.error("\nRun `buddy docs:agent-counts` to rewrite them from the tree.");if(process.argv.includes("--check"))process.exit(1)}if(import.meta.main)await run();
|
|
1
|
+
import{readdirSync,readFileSync,statSync,writeFileSync}from"node:fs";import{join}from"node:path";import process from"node:process";import{assertFrameworkRepo}from"./framework-repo";const root=new URL("../../../../../../../",import.meta.url).pathname;function abs(relative){return join(root,relative)}function countFiles(dir,extension){let entries;try{entries=readdirSync(abs(dir))}catch{return 0}return entries.reduce((total,entry)=>{const full=join(abs(dir),entry);if(statSync(full).isDirectory())return total+countFiles(join(dir,entry),extension);if(!entry.endsWith(extension)||entry==="index.ts")return total;return total+1},0)}function countDirs(dir){return readdirSync(abs(dir)).filter((entry)=>statSync(join(abs(dir),entry)).isDirectory()).length}const SKILLS="storage/framework/defaults/ai/skills",AGENTS="AGENTS.md",CLAIMS=[{what:"built-in models",measure:()=>countFiles("storage/framework/defaults/app/Models",".ts"),sites:[{file:AGENTS,pattern:/(\d+) built-in models you can use or override/},{file:AGENTS,pattern:/All (\d+) models \(`User`/},{file:`${SKILLS}/stacks-orm/SKILL.md`,pattern:/(\d+) models/},{file:`${SKILLS}/stacks-auto-imports/SKILL.md`,pattern:/\((\d+) models\)/},{file:AGENTS,pattern:/including the (\d+) built-in `Models\/`/},{file:AGENTS,pattern:/\((\d+) built-ins, grouped into/},{file:`${SKILLS}/stacks-models/SKILL.md`,pattern:/holds (\d+), and that/},{file:`${SKILLS}/stacks-models/SKILL.md`,pattern:/the (\d+) built-in framework models/},{file:`${SKILLS}/stacks-orm/SKILL.md`,pattern:/(\d+) built-in models/}]},{what:"commerce models",measure:()=>countFiles("storage/framework/defaults/app/Models/commerce",".ts"),sites:[{file:`${SKILLS}/stacks-commerce/SKILL.md`,pattern:/and (\d+) models/},{file:`${SKILLS}/stacks-types/SKILL.md`,pattern:/Commerce \((\d+) models\)/}]},{what:"components",measure:()=>countFiles("storage/framework/defaults/resources/components",".stx"),sites:[{file:AGENTS,pattern:/widgets \((\d+) components\)/},{file:`${SKILLS}/stacks-dashboard/SKILL.md`,pattern:/(\d+) built-in dashboard components/},{file:`${SKILLS}/stacks-dashboard/SKILL.md`,pattern:/route views, (\d+) components,/}]},{what:"default actions",measure:()=>readFileSync(abs("storage/framework/auto-imports/actions.ts"),"utf-8").split(`
|
|
2
|
+
`).filter((line)=>/^\s+'/.test(line)).length,sites:[{file:AGENTS,pattern:/(\d+) default actions/},{file:`${SKILLS}/stacks-actions/SKILL.md`,pattern:/(\d+) default framework actions/}]},{what:"migrations",measure:()=>countFiles("database/migrations",".sql"),sites:[{file:AGENTS,pattern:/(\d+) migrations ship for/},{file:`${SKILLS}/stacks-migrations/SKILL.md`,pattern:/(\d+) built-in migration files/},{file:`${SKILLS}/stacks-migrations/SKILL.md`,pattern:/(\d+) migration files exist by default/},{file:`${SKILLS}/stacks-database/SKILL.md`,pattern:/\((\d+) migration files/}]},{what:"browser auto-imports",measure:()=>Object.keys(JSON.parse(readFileSync(abs("storage/framework/browser-auto-imports.json"),"utf-8")).globals).length,sites:[{file:AGENTS,pattern:/There are \*\*(\d+)\*\* of/}]},{what:"composables",measure:()=>new Set(readFileSync(abs("storage/framework/core/composables/src/index.ts"),"utf-8").match(/\buse[A-Z][A-Za-z0-9]*/g)??[]).size,sites:[{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/(\d+) composables/},{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/(\d+) reactive composables for STX/},{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/Only 27 of the (\d+) composables/}]},{what:"auto-imported composables",measure:()=>Object.keys(JSON.parse(readFileSync(abs("storage/framework/browser-auto-imports.json"),"utf-8")).globals).filter((name)=>/^use[A-Z]/.test(name)).length,sites:[{file:AGENTS,pattern:/(\d+) of which are `use\*` composables/},{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/\*\*(\d+) of them are auto-imported\*\*/},{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/Only (\d+) of the \d+ composables/},{file:`${SKILLS}/stacks-composables/SKILL.md`,pattern:/83 names in total, (\d+) of which/}]},{what:"config files",measure:()=>countFiles("config",".ts"),sites:[{file:AGENTS,pattern:/~(\d+) typed config files/}]},{what:"skills",measure:()=>countDirs(SKILLS),sites:[{file:`${SKILLS}/stacks-writing-for-agents/SKILL.md`,pattern:/ships (\d+) skills/}]}];function inspect(){const drift=[];let checked=0;for(const claim of CLAIMS){const actual=claim.measure();for(const site of claim.sites){checked++;const match=readFileSync(abs(site.file),"utf-8").match(site.pattern),stated=match?Number(match[1]):null;if(stated!==actual)drift.push({what:claim.what,file:site.file,stated,actual})}}return{drift,checked}}function write(){let rewritten=0;for(const claim of CLAIMS){const actual=claim.measure();for(const site of claim.sites){const source=readFileSync(abs(site.file),"utf-8"),match=source.match(site.pattern);if(!match||Number(match[1])===actual)continue;const updated=match[0].replace(String(match[1]),String(actual));writeFileSync(abs(site.file),source.replace(match[0],updated),"utf-8");rewritten++}}return rewritten}export async function run(){assertFrameworkRepo(root,"docs:agent-counts");if(process.argv.includes("--write")){const rewritten=write();console.log(rewritten===0?"\u2713 agent-facing counts were already current":`\u2713 updated ${rewritten} count(s); run \`buddy setup:ai\` to refresh the installed copies`);return}const{drift,checked}=inspect();if(drift.length===0){console.log(`\u2713 agent-facing counts are current (${checked} checked)`);return}console.error(`\u2717 ${drift.length} of ${checked} agent-facing count(s) no longer match the tree:`);for(const entry of drift)console.error(entry.stated===null?` ${entry.file}: the ${entry.what} claim is gone - reword the check, or restore the sentence`:` ${entry.file}: says ${entry.stated} ${entry.what}, tree has ${entry.actual}`);console.error("\nRun `buddy docs:agent-counts` to rewrite them from the tree.");if(process.argv.includes("--check"))process.exit(1)}if(import.meta.main)await run();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/buddy",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.43",
|
|
6
6
|
"description": "Meet Buddy. The Stacks runtime.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -95,69 +95,69 @@
|
|
|
95
95
|
"prepublishOnly": "bun run build"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@stacksjs/actions": "^0.74.
|
|
99
|
-
"@stacksjs/ai": "^0.74.
|
|
100
|
-
"@stacksjs/alias": "^0.74.
|
|
101
|
-
"@stacksjs/analytics": "^0.74.
|
|
102
|
-
"@stacksjs/api": "^0.74.
|
|
103
|
-
"@stacksjs/arrays": "^0.74.
|
|
104
|
-
"@stacksjs/auth": "^0.74.
|
|
105
|
-
"@stacksjs/browser-extension": "^0.74.
|
|
106
|
-
"@stacksjs/build": "^0.74.
|
|
107
|
-
"@stacksjs/cache": "^0.74.
|
|
108
|
-
"@stacksjs/chat": "^0.74.
|
|
98
|
+
"@stacksjs/actions": "^0.74.43",
|
|
99
|
+
"@stacksjs/ai": "^0.74.43",
|
|
100
|
+
"@stacksjs/alias": "^0.74.43",
|
|
101
|
+
"@stacksjs/analytics": "^0.74.43",
|
|
102
|
+
"@stacksjs/api": "^0.74.43",
|
|
103
|
+
"@stacksjs/arrays": "^0.74.43",
|
|
104
|
+
"@stacksjs/auth": "^0.74.43",
|
|
105
|
+
"@stacksjs/browser-extension": "^0.74.43",
|
|
106
|
+
"@stacksjs/build": "^0.74.43",
|
|
107
|
+
"@stacksjs/cache": "^0.74.43",
|
|
108
|
+
"@stacksjs/chat": "^0.74.43",
|
|
109
109
|
"@stacksjs/clapp": "^0.2.12",
|
|
110
|
-
"@stacksjs/cli": "^0.74.
|
|
111
|
-
"@stacksjs/cloud": "^0.74.
|
|
112
|
-
"@stacksjs/cms": "^0.74.
|
|
113
|
-
"@stacksjs/collections": "^0.74.
|
|
114
|
-
"@stacksjs/config": "^0.74.
|
|
115
|
-
"@stacksjs/database": "^0.74.
|
|
116
|
-
"@stacksjs/desktop-build": "^0.74.
|
|
117
|
-
"@stacksjs/dns": "^0.74.
|
|
110
|
+
"@stacksjs/cli": "^0.74.43",
|
|
111
|
+
"@stacksjs/cloud": "^0.74.43",
|
|
112
|
+
"@stacksjs/cms": "^0.74.43",
|
|
113
|
+
"@stacksjs/collections": "^0.74.43",
|
|
114
|
+
"@stacksjs/config": "^0.74.43",
|
|
115
|
+
"@stacksjs/database": "^0.74.43",
|
|
116
|
+
"@stacksjs/desktop-build": "^0.74.43",
|
|
117
|
+
"@stacksjs/dns": "^0.74.43",
|
|
118
118
|
"@stacksjs/dnsx": "^0.2.3",
|
|
119
|
-
"@stacksjs/email": "^0.74.
|
|
120
|
-
"@stacksjs/enums": "^0.74.
|
|
121
|
-
"@stacksjs/env": "^0.74.
|
|
122
|
-
"@stacksjs/error-handling": "^0.74.
|
|
123
|
-
"@stacksjs/events": "^0.74.
|
|
124
|
-
"@stacksjs/features": "^0.74.
|
|
125
|
-
"@stacksjs/git": "^0.74.
|
|
119
|
+
"@stacksjs/email": "^0.74.43",
|
|
120
|
+
"@stacksjs/enums": "^0.74.43",
|
|
121
|
+
"@stacksjs/env": "^0.74.43",
|
|
122
|
+
"@stacksjs/error-handling": "^0.74.43",
|
|
123
|
+
"@stacksjs/events": "^0.74.43",
|
|
124
|
+
"@stacksjs/features": "^0.74.43",
|
|
125
|
+
"@stacksjs/git": "^0.74.43",
|
|
126
126
|
"@stacksjs/gitit": "^0.2.5",
|
|
127
|
-
"@stacksjs/health": "^0.74.
|
|
127
|
+
"@stacksjs/health": "^0.74.43",
|
|
128
128
|
"@stacksjs/httx": "^0.1.10",
|
|
129
|
-
"@stacksjs/image": "^0.74.
|
|
130
|
-
"@stacksjs/lint": "^0.74.
|
|
131
|
-
"@stacksjs/logging": "^0.74.
|
|
132
|
-
"@stacksjs/notifications": "^0.74.
|
|
133
|
-
"@stacksjs/objects": "^0.74.
|
|
134
|
-
"@stacksjs/orm": "^0.74.
|
|
135
|
-
"@stacksjs/path": "^0.74.
|
|
136
|
-
"@stacksjs/payments": "^0.74.
|
|
137
|
-
"@stacksjs/realtime": "^0.74.
|
|
138
|
-
"@stacksjs/router": "^0.74.
|
|
129
|
+
"@stacksjs/image": "^0.74.43",
|
|
130
|
+
"@stacksjs/lint": "^0.74.43",
|
|
131
|
+
"@stacksjs/logging": "^0.74.43",
|
|
132
|
+
"@stacksjs/notifications": "^0.74.43",
|
|
133
|
+
"@stacksjs/objects": "^0.74.43",
|
|
134
|
+
"@stacksjs/orm": "^0.74.43",
|
|
135
|
+
"@stacksjs/path": "^0.74.43",
|
|
136
|
+
"@stacksjs/payments": "^0.74.43",
|
|
137
|
+
"@stacksjs/realtime": "^0.74.43",
|
|
138
|
+
"@stacksjs/router": "^0.74.43",
|
|
139
139
|
"@stacksjs/rpx": "^0.11.53",
|
|
140
|
-
"@stacksjs/scheduler": "^0.74.
|
|
141
|
-
"@stacksjs/search-engine": "^0.74.
|
|
142
|
-
"@stacksjs/security": "^0.74.
|
|
143
|
-
"@stacksjs/server": "^0.74.
|
|
144
|
-
"@stacksjs/sites": "^0.74.
|
|
145
|
-
"@stacksjs/skills": "^0.74.
|
|
146
|
-
"@stacksjs/storage": "^0.74.
|
|
147
|
-
"@stacksjs/strings": "^0.74.
|
|
148
|
-
"@stacksjs/stx": "^0.2.
|
|
149
|
-
"@stacksjs/testing": "^0.74.
|
|
150
|
-
"@stacksjs/tinker": "^0.74.
|
|
140
|
+
"@stacksjs/scheduler": "^0.74.43",
|
|
141
|
+
"@stacksjs/search-engine": "^0.74.43",
|
|
142
|
+
"@stacksjs/security": "^0.74.43",
|
|
143
|
+
"@stacksjs/server": "^0.74.43",
|
|
144
|
+
"@stacksjs/sites": "^0.74.43",
|
|
145
|
+
"@stacksjs/skills": "^0.74.43",
|
|
146
|
+
"@stacksjs/storage": "^0.74.43",
|
|
147
|
+
"@stacksjs/strings": "^0.74.43",
|
|
148
|
+
"@stacksjs/stx": "^0.2.286",
|
|
149
|
+
"@stacksjs/testing": "^0.74.43",
|
|
150
|
+
"@stacksjs/tinker": "^0.74.43",
|
|
151
151
|
"@stacksjs/tlsx": "^0.13.19",
|
|
152
152
|
"@stacksjs/ts-cloud": "^0.16.0",
|
|
153
|
-
"@stacksjs/tunnel": "^0.74.
|
|
154
|
-
"@stacksjs/types": "^0.74.
|
|
155
|
-
"@stacksjs/ui": "^0.74.
|
|
156
|
-
"@stacksjs/utils": "^0.74.
|
|
157
|
-
"@stacksjs/validation": "^0.74.
|
|
153
|
+
"@stacksjs/tunnel": "^0.74.43",
|
|
154
|
+
"@stacksjs/types": "^0.74.43",
|
|
155
|
+
"@stacksjs/ui": "^0.74.43",
|
|
156
|
+
"@stacksjs/utils": "^0.74.43",
|
|
157
|
+
"@stacksjs/validation": "^0.74.43",
|
|
158
158
|
"ajv": "^8.20.0",
|
|
159
159
|
"ajv-formats": "^3.0.1",
|
|
160
|
-
"bun-plugin-stx": "^0.2.
|
|
160
|
+
"bun-plugin-stx": "^0.2.286",
|
|
161
161
|
"ts-pantry": "^0.11.35"
|
|
162
162
|
},
|
|
163
163
|
"devDependencies": {
|