@barnaby.build/barnaby 0.0.131 → 0.0.132

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/README.md CHANGED
@@ -28,6 +28,8 @@ barnaby
28
28
  ```
29
29
  *PowerShell: use single quotes around the package name.*
30
30
 
31
+ **Windows (npm install):** A Start menu shortcut is created automatically. Search "Barnaby" in Start. For correct taskbar icon, **pin the shortcut** (right‑click → Pin to taskbar), not the running window.
32
+
31
33
  ---
32
34
 
33
35
  Latest Binary Release
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@barnaby.build/barnaby",
3
3
  "productName": "Barnaby",
4
- "version": "0.0.131",
4
+ "version": "0.0.132",
5
5
  "main": "dist-electron/main/index.js",
6
6
  "bin": {
7
7
  "barnaby": "bin/barnaby.cjs"
@@ -11,6 +11,7 @@
11
11
  "dist-electron",
12
12
  "public",
13
13
  "bin",
14
+ "scripts",
14
15
  "package.json"
15
16
  ],
16
17
  "description": "Barnaby: local agent loops without API keys.",
@@ -44,6 +45,7 @@
44
45
  "release:notes": "node scripts/create-release-notes.mjs",
45
46
  "release:prepare": "npm run bump:version && npm run release:notes && npm run build:portable:raw",
46
47
  "publish": "gh workflow run release.yml -f releasable=true --ref main",
48
+ "postinstall": "node scripts/shortcut-win.mjs",
47
49
  "publish:npm": "npm run build && npm publish",
48
50
  "package:win": "npm run build:dist && electron-packager . Barnaby --platform=win32 --arch=x64 --out=release/0.0.1/packaged --overwrite --asar --prune=true --icon=build/icon.png",
49
51
  "preview": "vite preview",
@@ -0,0 +1,35 @@
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+
4
+ const root = process.cwd()
5
+ const packageJsonPath = path.join(root, 'package.json')
6
+ const packageLockPath = path.join(root, 'package-lock.json')
7
+
8
+ function bumpPatch(version) {
9
+ const parts = String(version).trim().split('.')
10
+ if (parts.length !== 3) {
11
+ throw new Error(`Expected semantic version x.y.z, got "${version}"`)
12
+ }
13
+ const [major, minor, patch] = parts.map((p) => Number(p))
14
+ if ([major, minor, patch].some((n) => Number.isNaN(n))) {
15
+ throw new Error(`Expected numeric semantic version, got "${version}"`)
16
+ }
17
+ return `${major}.${minor}.${patch + 1}`
18
+ }
19
+
20
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
21
+ const currentVersion = packageJson.version
22
+ const nextVersion = bumpPatch(currentVersion)
23
+ packageJson.version = nextVersion
24
+ fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf8')
25
+
26
+ if (fs.existsSync(packageLockPath)) {
27
+ const packageLock = JSON.parse(fs.readFileSync(packageLockPath, 'utf8'))
28
+ if (typeof packageLock.version === 'string') packageLock.version = nextVersion
29
+ if (packageLock.packages && packageLock.packages[''] && typeof packageLock.packages[''].version === 'string') {
30
+ packageLock.packages[''].version = nextVersion
31
+ }
32
+ fs.writeFileSync(packageLockPath, `${JSON.stringify(packageLock, null, 2)}\n`, 'utf8')
33
+ }
34
+
35
+ console.log(`Version bumped: ${currentVersion} -> ${nextVersion}`)
@@ -0,0 +1,47 @@
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+
4
+ const root = process.cwd()
5
+ const packageJsonPath = path.join(root, 'package.json')
6
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
7
+ const version = String(packageJson.version || '').trim()
8
+
9
+ if (!version) {
10
+ throw new Error('package.json version is missing.')
11
+ }
12
+
13
+ const notesFilename = `RELEASE_NOTES_${version}.md`
14
+ const notesPath = path.join(root, notesFilename)
15
+
16
+ if (fs.existsSync(notesPath)) {
17
+ console.log(`Release notes already exist: ${notesFilename}`)
18
+ process.exit(0)
19
+ }
20
+
21
+ const now = new Date()
22
+ const month = now.toLocaleString('en-US', { month: 'long' })
23
+ const year = now.getFullYear()
24
+
25
+ const template = `# Barnaby ${version} - Release Notes
26
+
27
+ **Released:** ${month} ${year}
28
+
29
+ ## Added
30
+
31
+ - TODO
32
+
33
+ ## Changed
34
+
35
+ - TODO
36
+
37
+ ## Fixed
38
+
39
+ - TODO
40
+
41
+ ## Notes
42
+
43
+ - Artifact: \`release/${version}/Barnaby_${version}_portable.exe\`
44
+ `
45
+
46
+ fs.writeFileSync(notesPath, template, 'utf8')
47
+ console.log(`Created ${notesFilename}`)
@@ -0,0 +1,27 @@
1
+ import { execSync } from 'node:child_process'
2
+
3
+ function run(cmd) {
4
+ try {
5
+ execSync(cmd, { stdio: 'pipe', windowsHide: true })
6
+ } catch {
7
+ // best effort cleanup only
8
+ }
9
+ }
10
+
11
+ if (process.platform === 'win32') {
12
+ // Free Vite default port if stale process is still attached.
13
+ run(
14
+ `powershell -NoProfile -ExecutionPolicy Bypass -Command "$p = netstat -ano | Select-String ':5173' | ForEach-Object { ($_ -split '\\s+')[-1] } | Sort-Object -Unique; foreach ($id in $p) { try { Stop-Process -Id ([int]$id) -Force -ErrorAction Stop } catch {} }"`,
15
+ )
16
+
17
+ // Kill stale Electron instances from this workspace.
18
+ run(
19
+ `powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-Process electron -ErrorAction SilentlyContinue | Where-Object { $_.Path -like '*AgentOrchestrator*\\\\node_modules\\\\electron\\\\dist\\\\electron.exe' } | ForEach-Object { try { Stop-Process -Id $_.Id -Force -ErrorAction Stop } catch {} }"`,
20
+ )
21
+ } else {
22
+ // Unix-like fallback: free 5173 and terminate matching electron instances.
23
+ run(`sh -lc "lsof -ti :5173 | xargs -r kill -9"`)
24
+ run(`sh -lc "ps aux | grep '[e]lectron' | grep 'AgentOrchestrator' | awk '{print $2}' | xargs -r kill -9"`)
25
+ }
26
+
27
+ console.log('dev-clean completed')
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Creates a Start menu shortcut for Barnaby on Windows (global install only).
4
+ * Fixes: (1) App not findable in Windows search (2) Taskbar pinning shows Electron.
5
+ * Tip: Pin the "Barnaby" shortcut from Start menu to taskbar for correct icon.
6
+ */
7
+ import { platform } from 'node:os'
8
+ import { existsSync, writeFileSync } from 'node:fs'
9
+ import { dirname, join } from 'node:path'
10
+ import { fileURLToPath } from 'node:url'
11
+ import { execSync } from 'node:child_process'
12
+
13
+ function main() {
14
+ if (platform() !== 'win32') return
15
+ if (process.env.npm_config_global !== 'true') return
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url))
18
+ const pkgRoot = join(__dirname, '..')
19
+
20
+ // Use node + our script directly (barnaby.cmd may not exist yet when postinstall runs)
21
+ const barnabyScript = join(pkgRoot, 'bin', 'barnaby.cjs')
22
+ if (!existsSync(barnabyScript)) return
23
+ const nodeExe = process.execPath
24
+
25
+ const iconPath = [
26
+ join(pkgRoot, 'dist', 'appicon.png'),
27
+ join(pkgRoot, 'public', 'appicon.png'),
28
+ join(pkgRoot, 'dist', 'favicon.ico'),
29
+ join(pkgRoot, 'public', 'favicon.ico'),
30
+ join(pkgRoot, 'build', 'icon.png')
31
+ ].find(existsSync)
32
+ const startMenuDir = join(process.env.APPDATA || '', 'Microsoft', 'Windows', 'Start Menu', 'Programs')
33
+ const shortcutPath = join(startMenuDir, 'Barnaby.lnk')
34
+
35
+ const ps = `
36
+ $WshShell = New-Object -ComObject WScript.Shell
37
+ $Shortcut = $WshShell.CreateShortcut('${shortcutPath.replace(/'/g, "''")}')
38
+ $Shortcut.TargetPath = '${nodeExe.replace(/'/g, "''")}'
39
+ $Shortcut.Arguments = '${barnabyScript.replace(/'/g, "''")}'
40
+ $Shortcut.WorkingDirectory = '${(process.env.USERPROFILE || '').replace(/'/g, "''")}'
41
+ $Shortcut.Description = 'Barnaby - AI agent IDE'
42
+ ${iconPath ? `if (Test-Path '${iconPath.replace(/'/g, "''")}') { $Shortcut.IconLocation = '${iconPath.replace(/'/g, "''")},0' }` : ''}
43
+ $Shortcut.Save()
44
+ `
45
+ try {
46
+ const tmp = join(process.env.TEMP || '', 'barnaby-shortcut.ps1')
47
+ writeFileSync(tmp, ps.trim(), 'utf8')
48
+ execSync(`powershell -NoProfile -ExecutionPolicy Bypass -File "${tmp}"`, { stdio: 'pipe' })
49
+ console.log('[Barnaby] Start menu shortcut created. Pin it to taskbar for the correct icon.')
50
+ } catch {
51
+ // Silent fail - shortcut is optional
52
+ }
53
+ }
54
+
55
+ main()