@lovek4d/kickflip 0.7.2 → 0.7.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/CONTEXT.md +10 -10
- package/SKILL.md +5 -3
- package/bin/event-lines.mjs +1 -1
- package/bin/install.mjs +3 -3
- package/bin/wait-events.mjs +2 -2
- package/board/bin/board.mjs +42 -32
- package/board/domain.mjs +7 -7
- package/board/finish.mjs +4 -4
- package/board/headless.mjs +8 -8
- package/board/hub-lines.mjs +1 -1
- package/board/permissions.mjs +2 -2
- package/board/public/app-asks.js +2 -14
- package/board/public/app-banner.js +8 -3
- package/board/public/app-cards.js +6 -19
- package/board/public/app-core.js +2 -2
- package/board/public/app-lanes.js +5 -12
- package/board/public/app-snapshot.js +1 -1
- package/board/public/style.css +11 -14
- package/board/public/ui-cards.js +28 -25
- package/board/public/ui-enums.js +2 -2
- package/board/public/ui-links.js +0 -1
- package/board/public/ui-questions.js +3 -3
- package/board/public/ui-threads.js +5 -6
- package/board/public/ui.js +3 -5
- package/board/public/view-hub.js +4 -2
- package/board/public/view-questions.js +1 -1
- package/board/server.mjs +18 -18
- package/board/store.mjs +30 -26
- package/board/tickets.mjs +3 -3
- package/board/worktree.mjs +15 -15
- package/hub/github.mjs +3 -3
- package/hub/hub.mjs +11 -11
- package/hub/pr-report.mjs +2 -2
- package/hub/readiness.mjs +1 -1
- package/hub/repos.mjs +3 -3
- package/hub/schedule.mjs +1 -1
- package/hub/try.mjs +8 -6
- package/package.json +1 -1
- package/shared/fake-gh.mjs +19 -4
- package/shared/gh.mjs +4 -0
- package/shared/owner-check.mjs +4 -3
- package/shared/service.mjs +12 -12
package/shared/service.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var S=Object.defineProperty;var n=(
|
|
2
|
-
`)[0]}}n(
|
|
1
|
+
var S=Object.defineProperty;var n=(s,l)=>S(s,"name",{value:l,configurable:!0});import p from"node:fs";import v from"node:os";import $ from"node:path";import{spawnSync as A}from"node:child_process";import{ghSync as T}from"./gh.mjs";const m="local.claude.kickflip-hub",g="kickflip-hub.service";function E(s,l,{env:c=process.env,timeout:o=1e4}={}){const r=s==="gh"?T(l,{env:c,timeout:o}):A(s,l,{encoding:"utf8",env:c,timeout:o});return{status:r.status??1,stdout:r.stdout||"",error:(r.error?.message||r.stderr||`exit ${r.status}`).trim().split(`
|
|
2
|
+
`)[0]}}n(E,"runCommand");function U({platform:s=process.platform,home:l=v.homedir(),uid:c=process.getuid?.(),env:o=process.env,run:r=E}={}){const a=n((t,i,d={})=>{try{return r(t,i,{env:o,...d})}catch(u){return{status:1,stdout:"",error:u.message}}},"exec");if(s==="darwin")return L({home:l,uid:c,exec:a});if(s==="linux")return x({home:l,uid:c,exec:a});const e=`kickflip keeps the hub running with launchd on macOS or systemd on Linux, not on ${s}`;return{manager:null,item:"hub service",file:null,id:null,restartCommand:"node hub/hub.mjs from the kickflip folder",definition:n(()=>null,"definition"),install:n(async()=>{throw new Error(e)},"install"),restart:n(()=>e,"restart"),remove:n(()=>{},"remove"),status:n(()=>({installed:!1,running:!1,detail:e}),"status"),notes:n(()=>[],"notes")}}n(U,"hubService");const b=12e4;function L({home:s,uid:l,exec:c}){const o=$.join(s,"Library","LaunchAgents"),r=`gui/${l}`,a=$.join(o,`${m}.plist`),e=n((t,i)=>c("launchctl",t,i),"launchctl");return{manager:"launchd",item:"hub login item",file:a,id:`${r}/${m}`,restartCommand:`launchctl kickstart -k gui/$(id -u)/${m}`,definition({node:t,entry:i,state:d,port:u,log:h}){const y=n(w=>String(w).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"),"xml");return`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
4
4
|
<plist version="1.0">
|
|
5
5
|
<dict>
|
|
6
|
-
<key>Label</key><string>${
|
|
6
|
+
<key>Label</key><string>${m}</string>
|
|
7
7
|
<key>ProgramArguments</key>
|
|
8
|
-
<array><string>${y(t)}</string><string>${y(
|
|
9
|
-
<key>WorkingDirectory</key><string>${y(
|
|
8
|
+
<array><string>${y(t)}</string><string>${y(i)}</string></array>
|
|
9
|
+
<key>WorkingDirectory</key><string>${y(d)}</string>
|
|
10
10
|
<key>EnvironmentVariables</key>
|
|
11
|
-
<dict><key>PATH</key><string>${y($.dirname(t))}:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string><key>KICKFLIP_HUB_PORT</key><string>${
|
|
11
|
+
<dict><key>PATH</key><string>${y($.dirname(t))}:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string><key>KICKFLIP_HUB_PORT</key><string>${u}</string></dict>
|
|
12
12
|
<key>RunAtLoad</key><true/>
|
|
13
13
|
<key>KeepAlive</key><true/>
|
|
14
14
|
<key>StandardOutPath</key><string>${y(h)}</string>
|
|
15
15
|
<key>StandardErrorPath</key><string>${y(h)}</string>
|
|
16
16
|
</dict>
|
|
17
17
|
</plist>
|
|
18
|
-
`},async install(t,{wait:
|
|
18
|
+
`},async install(t,{wait:i=n(u=>new Promise(h=>setTimeout(h,u)),"wait"),dryRun:d=!1}={}){if(d)return[`would write ${a} and start ${r}/${m}`];p.mkdirSync(o,{recursive:!0}),p.writeFileSync(a,t),e(["bootout",`${r}/${m}`]),await i(500);const u=e(["bootstrap",r,a]);if(u.status===0)return[`started ${r}/${m} from ${a}`];throw new Error(u.error)},restart(){const t=e(["kickstart","-k",`${r}/${m}`],{timeout:b});return t.status===0?null:t.error},remove(){e(["bootout",`${r}/${m}`]),p.rmSync(a,{force:!0})},status(){const t=e(["print",`${r}/${m}`]),i=p.existsSync(a),d=i&&t.status===0&&/\bstate = running\b/.test(t.stdout||"");return{installed:i,running:d,detail:d?"running":i?"not running":"not installed"}},notes:n(()=>[],"notes")}}n(L,"launchd");const k=n(s=>String(s).replaceAll("%","%%").replaceAll("$","$$$$").replace(/[\r\n]/g," "),"unitValue"),f=n(s=>`"${k(s).replaceAll("\\","\\\\").replaceAll('"','\\"')}"`,"execWord");function x({home:s,uid:l,exec:c}){const o=$.join(s,".config","systemd","user",g),r=n((e,t)=>c("systemctl",["--user",...e],t),"systemctl"),a=n(e=>{const t=r(e);if(t.status!==0)throw new Error(`systemctl --user ${e.join(" ")}: ${t.error}`)},"step");return{manager:"systemd",item:"hub service",file:o,id:g,restartCommand:`systemctl --user restart ${g}`,definition({node:e,entry:t,state:i,port:d,log:u}){return`[Unit]
|
|
19
19
|
Description=kickflip hub
|
|
20
20
|
|
|
21
21
|
[Service]
|
|
22
22
|
ExecStart=${f(e)} ${f(t)}
|
|
23
|
-
WorkingDirectory=${k(
|
|
23
|
+
WorkingDirectory=${k(i)}
|
|
24
24
|
Environment=${f(`PATH=${$.dirname(e)}:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin`)}
|
|
25
|
-
Environment=KICKFLIP_HUB_PORT=${
|
|
25
|
+
Environment=KICKFLIP_HUB_PORT=${d}
|
|
26
26
|
Restart=always
|
|
27
27
|
RestartSec=2
|
|
28
|
-
StandardOutput=append:${k(
|
|
29
|
-
StandardError=append:${k(
|
|
28
|
+
StandardOutput=append:${k(u)}
|
|
29
|
+
StandardError=append:${k(u)}
|
|
30
30
|
|
|
31
31
|
[Install]
|
|
32
32
|
WantedBy=default.target
|
|
33
|
-
`},async install(e,{dryRun:t=!1}={}){return t?[`would write ${o}, enable and start ${
|
|
33
|
+
`},async install(e,{dryRun:t=!1}={}){return t?[`would write ${o}, enable and start ${g}`]:(p.mkdirSync($.dirname(o),{recursive:!0}),p.writeFileSync(o,e),a(["daemon-reload"]),a(["enable",g]),a(["restart",g]),[`enabled and started ${g} from ${o}`])},restart(){const e=r(["restart",g],{timeout:b});return e.status===0?null:e.error},remove(){r(["disable","--now",g]),p.rmSync(o,{force:!0}),r(["daemon-reload"])},status(){const e=r(["is-active",g]),t=p.existsSync(o),i=t&&e.status===0&&(e.stdout||"").trim()==="active";return{installed:t,running:i,detail:i?"running":t?"not running":"not installed"}},notes(){const e=c("loginctl",["show-user",String(l),"--property=Linger"]),t=e.status===0&&/^Linger=yes$/m.test(e.stdout||"");return[{item:"hub without a login",state:t?"ok":"optional",detail:t?"the user lingers, so the hub runs with nobody logged in":"the hub stops when your last login session ends",fix:'sudo loginctl enable-linger "$USER"'},{item:"macOS-only parts",state:"note",detail:"The owner reads away from the host, since presence comes from macOS ioreg, so only a page tap makes the hub check every minute"}]}}}n(x,"systemd");export{m as LOGIN_LABEL,g as UNIT,U as hubService,E as runCommand};
|