@stacksjs/buddy 0.75.643 → 0.75.647

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.
@@ -0,0 +1,10 @@
1
+ export declare function createCpuSampler(read?: unknown): () => unknown;
2
+ export declare function activeMemoryBytes(stats: string): number | undefined;
3
+ export declare function createSystemSampler(): () => Promise<{
4
+ cpu: unknown;
5
+ memory: {
6
+ used: unknown;
7
+ total: unknown;
8
+ raw: boolean
9
+ }
10
+ }>;
@@ -0,0 +1 @@
1
+ import{cpus,freemem,totalmem}from"node:os";export function createCpuSampler(read=cpus){const totals=()=>read().reduce(({idle,total},{times})=>({idle:idle+times.idle,total:total+times.user+times.nice+times.sys+times.idle+times.irq}),{idle:0,total:0});let previous=totals();let percent=null;return()=>{const next=totals();const elapsed=next.total-previous.total;const idle=next.idle-previous.idle;previous=next;if(elapsed>0)percent=Math.round(100*Math.max(0,Math.min(1,(elapsed-idle)/elapsed)));return percent}}export function activeMemoryBytes(stats){const pageSize=Number(stats.match(/page size of (\d+) bytes/)?.[1]);const active=Number(stats.match(/^Pages active:\s+(\d+)/m)?.[1]);const wired=Number(stats.match(/^Pages wired down:\s+(\d+)/m)?.[1]);const compressed=Number(stats.match(/^Pages occupied by compressor:\s+(\d+)/m)?.[1]);const bytes=pageSize*(active+wired+compressed);return Number.isSafeInteger(bytes)&&bytes>=0?bytes:undefined}export function createSystemSampler(){const sampleCpu=createCpuSampler();return async()=>{const cpu=sampleCpu();const total=totalmem();const command=Bun.spawn(["/usr/bin/vm_stat"],{stderr:"ignore",stdout:"pipe",timeout:1500});const[code,stats]=await Promise.all([command.exited,new Response(command.stdout).text()]);const active=code===0?activeMemoryBytes(stats):undefined;const used=Math.max(0,Math.min(total,active??total-freemem()));return{cpu,memory:{used,total,raw:active===undefined}}}}
@@ -0,0 +1,10 @@
1
+ import type { DefineComponent } from '@stacksjs/stx';
2
+ declare const __dtsx_component__: __DtsxStxComponentType;
3
+ declare type __DtsxStxComponentType = DefineComponent<{}>;
4
+ declare type Project = { id: string, name: string, path: string, pending: number, issue: string }
5
+ declare type Snapshot = { online: boolean, watched: number, running: boolean, failed: number, projects: Project[], system: { cpu: number | null, memory: { used: number, total: number, raw: boolean } } }
6
+ declare type Package = { name: string, version: string, managed?: boolean }
7
+ declare type CatalogMatch = { name: string, domain: string }
8
+ declare type PantryJob = { id: string, domain: string, operation?: string, status: string, error?: string }
9
+ declare type PantryStatus = { state: 'offline' | 'pair' | 'ready', issue?: string, packages?: Package[], jobs?: PantryJob[], removal?: boolean }
10
+ export default __dtsx_component__;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.643",
5
+ "version": "0.75.647",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -95,71 +95,71 @@
95
95
  "prepublishOnly": "bun run build"
96
96
  },
97
97
  "dependencies": {
98
- "@stacksjs/actions": "0.75.643",
99
- "@stacksjs/docs": "0.75.643",
100
- "@stacksjs/ai": "0.75.643",
101
- "@stacksjs/alias": "0.75.643",
102
- "@stacksjs/analytics": "0.75.643",
103
- "@stacksjs/api": "0.75.643",
104
- "@stacksjs/arrays": "0.75.643",
105
- "@stacksjs/auth": "0.75.643",
106
- "@stacksjs/browser-extension": "0.75.643",
107
- "@stacksjs/build": "0.75.643",
98
+ "@stacksjs/actions": "0.75.647",
99
+ "@stacksjs/docs": "0.75.647",
100
+ "@stacksjs/ai": "0.75.647",
101
+ "@stacksjs/alias": "0.75.647",
102
+ "@stacksjs/analytics": "0.75.647",
103
+ "@stacksjs/api": "0.75.647",
104
+ "@stacksjs/arrays": "0.75.647",
105
+ "@stacksjs/auth": "0.75.647",
106
+ "@stacksjs/browser-extension": "0.75.647",
107
+ "@stacksjs/build": "0.75.647",
108
108
  "@stacksjs/bumpx": "^0.2.32",
109
- "@stacksjs/cache": "0.75.643",
110
- "@stacksjs/chat": "0.75.643",
109
+ "@stacksjs/cache": "0.75.647",
110
+ "@stacksjs/chat": "0.75.647",
111
111
  "@stacksjs/clapp": "^0.2.17",
112
- "@stacksjs/cli": "0.75.643",
113
- "@stacksjs/cloud": "0.75.643",
114
- "@stacksjs/cms": "0.75.643",
115
- "@stacksjs/collections": "0.75.643",
116
- "@stacksjs/commerce": "0.75.643",
117
- "@stacksjs/config": "0.75.643",
118
- "@stacksjs/database": "0.75.643",
119
- "@stacksjs/desktop-build": "0.75.643",
120
- "@stacksjs/dns": "0.75.643",
112
+ "@stacksjs/cli": "0.75.647",
113
+ "@stacksjs/cloud": "0.75.647",
114
+ "@stacksjs/cms": "0.75.647",
115
+ "@stacksjs/collections": "0.75.647",
116
+ "@stacksjs/commerce": "0.75.647",
117
+ "@stacksjs/config": "0.75.647",
118
+ "@stacksjs/database": "0.75.647",
119
+ "@stacksjs/desktop-build": "0.75.647",
120
+ "@stacksjs/dns": "0.75.647",
121
121
  "@stacksjs/dnsx": "^0.2.3",
122
- "@stacksjs/email": "0.75.643",
123
- "@stacksjs/enums": "0.75.643",
124
- "@stacksjs/env": "0.75.643",
125
- "@stacksjs/error-handling": "0.75.643",
126
- "@stacksjs/events": "0.75.643",
127
- "@stacksjs/features": "0.75.643",
128
- "@stacksjs/git": "0.75.643",
122
+ "@stacksjs/email": "0.75.647",
123
+ "@stacksjs/enums": "0.75.647",
124
+ "@stacksjs/env": "0.75.647",
125
+ "@stacksjs/error-handling": "0.75.647",
126
+ "@stacksjs/events": "0.75.647",
127
+ "@stacksjs/features": "0.75.647",
128
+ "@stacksjs/git": "0.75.647",
129
129
  "@stacksjs/gitit": "^0.2.5",
130
- "@stacksjs/health": "0.75.643",
131
- "@stacksjs/hq": "0.75.643",
130
+ "@stacksjs/health": "0.75.647",
131
+ "@stacksjs/hq": "0.75.647",
132
132
  "@stacksjs/httx": "^0.1.10",
133
- "@stacksjs/image": "0.75.643",
134
- "@stacksjs/lint": "0.75.643",
135
- "@stacksjs/logging": "0.75.643",
136
- "@stacksjs/notifications": "0.75.643",
137
- "@stacksjs/objects": "0.75.643",
138
- "@stacksjs/orm": "0.75.643",
139
- "@stacksjs/path": "0.75.643",
140
- "@stacksjs/payments": "0.75.643",
141
- "@stacksjs/realtime": "0.75.643",
142
- "@stacksjs/router": "0.75.643",
133
+ "@stacksjs/image": "0.75.647",
134
+ "@stacksjs/lint": "0.75.647",
135
+ "@stacksjs/logging": "0.75.647",
136
+ "@stacksjs/notifications": "0.75.647",
137
+ "@stacksjs/objects": "0.75.647",
138
+ "@stacksjs/orm": "0.75.647",
139
+ "@stacksjs/path": "0.75.647",
140
+ "@stacksjs/payments": "0.75.647",
141
+ "@stacksjs/realtime": "0.75.647",
142
+ "@stacksjs/router": "0.75.647",
143
143
  "@stacksjs/rpx": "^0.11.54",
144
- "@stacksjs/scheduler": "0.75.643",
145
- "@stacksjs/search-engine": "0.75.643",
146
- "@stacksjs/security": "0.75.643",
147
- "@stacksjs/server": "0.75.643",
148
- "@stacksjs/sites": "0.75.643",
149
- "@stacksjs/skills": "0.75.643",
150
- "@stacksjs/socials": "0.75.643",
151
- "@stacksjs/storage": "0.75.643",
152
- "@stacksjs/strings": "0.75.643",
144
+ "@stacksjs/scheduler": "0.75.647",
145
+ "@stacksjs/search-engine": "0.75.647",
146
+ "@stacksjs/security": "0.75.647",
147
+ "@stacksjs/server": "0.75.647",
148
+ "@stacksjs/sites": "0.75.647",
149
+ "@stacksjs/skills": "0.75.647",
150
+ "@stacksjs/socials": "0.75.647",
151
+ "@stacksjs/storage": "0.75.647",
152
+ "@stacksjs/strings": "0.75.647",
153
153
  "@stacksjs/stx": "^0.2.908",
154
- "@stacksjs/testing": "0.75.643",
155
- "@stacksjs/tinker": "0.75.643",
154
+ "@stacksjs/testing": "0.75.647",
155
+ "@stacksjs/tinker": "0.75.647",
156
156
  "@stacksjs/tlsx": "^0.13.19",
157
157
  "@stacksjs/ts-cloud": "^0.16.144",
158
- "@stacksjs/tunnel": "0.75.643",
159
- "@stacksjs/types": "0.75.643",
160
- "@stacksjs/ui": "0.75.643",
161
- "@stacksjs/utils": "0.75.643",
162
- "@stacksjs/validation": "0.75.643",
158
+ "@stacksjs/tunnel": "0.75.647",
159
+ "@stacksjs/types": "0.75.647",
160
+ "@stacksjs/ui": "0.75.647",
161
+ "@stacksjs/utils": "0.75.647",
162
+ "@stacksjs/validation": "0.75.647",
163
163
  "ajv": "^8.20.0",
164
164
  "ajv-formats": "^3.0.1",
165
165
  "bun-plugin-stx": "^0.2.908",