1- // Stage claude-code + codex + gh + glab into `sidecar/dist/vendor/`
1+ // Stage claude-code + codex + gh + glab + tea into `sidecar/dist/vendor/`
22// for Tauri to ship as bundle resources. macOS host only.
33//
44// Cross-arch staging: in CI the host is always Apple Silicon (macos-26
@@ -34,6 +34,7 @@ const BUNDLE_CACHE = join(SIDECAR_ROOT, ".bundle-cache");
3434// Bumping any version: update SHA256 below + wipe sidecar/.bundle-cache.
3535// gh: github.com/cli/cli/releases/download/v$VER/gh_${VER}_checksums.txt
3636// glab: gitlab.com/gitlab-org/cli/-/releases/v$VER/downloads/checksums.txt
37+ // tea: gitea.com/gitea/tea/releases/download/v$VER/checksums.txt
3738// codex: shasum -a 256 of the npm tarball at
3839// registry.npmjs.org/@openai /codex/-/codex-$VER-darwin-{arm64,x64}.tgz
3940// claude-code: shasum -a 256 of the npm tarballs at
@@ -51,6 +52,12 @@ const GLAB_SHA256 = {
5152 amd64 : "79d1a4f933919689c5fb7774feb1dd08f30b9c896dff4283b4a7387689ee0531" ,
5253} as const ;
5354
55+ const TEA_VERSION = "0.14.1" ;
56+ const TEA_SHA256 = {
57+ arm64 : "52c482b964de63977b5a836b4976f0b098a1dfde6486ca7b8d0a6ee29b4f7945" ,
58+ amd64 : "4b6828c7dec67cfbd4b911e9391fc9e32eddeea693025ee99a20c444c251f53a" ,
59+ } as const ;
60+
5461// Codex version is whatever sidecar/package.json pulled in. The SHAs below
5562// must match THAT version — bump them together (or staging cross-arch will
5663// abort with a clear error).
@@ -97,6 +104,8 @@ interface TargetInfo {
97104 ghArch : "arm64" | "amd64" ;
98105 /** `glab` release naming: `arm64` / `amd64`. */
99106 glabArch : "arm64" | "amd64" ;
107+ /** `tea` release naming: `arm64` / `amd64`. */
108+ teaArch : "arm64" | "amd64" ;
100109}
101110
102111function infoForArch ( arch : DarwinArch ) : TargetInfo {
@@ -110,6 +119,7 @@ function infoForArch(arch: DarwinArch): TargetInfo {
110119 codexNpmSuffix : "darwin-arm64" ,
111120 ghArch : "arm64" ,
112121 glabArch : "arm64" ,
122+ teaArch : "arm64" ,
113123 } ;
114124 }
115125 return {
@@ -121,6 +131,7 @@ function infoForArch(arch: DarwinArch): TargetInfo {
121131 codexNpmSuffix : "darwin-x64" ,
122132 ghArch : "amd64" ,
123133 glabArch : "amd64" ,
134+ teaArch : "amd64" ,
124135 } ;
125136}
126137
@@ -335,6 +346,20 @@ function stageGlabBinary(arch: "arm64" | "amd64"): string {
335346 return binDest ;
336347}
337348
349+ function stageTeaBinary ( arch : "arm64" | "amd64" ) : string {
350+ ensureCacheDir ( ) ;
351+ const slug = `tea-${ TEA_VERSION } -darwin-${ arch } ` ;
352+ const archive = join ( BUNDLE_CACHE , slug ) ;
353+ const url = `https://gitea.com/gitea/tea/releases/download/v${ TEA_VERSION } /${ slug } ` ;
354+ downloadAndVerify ( url , archive , TEA_SHA256 [ arch ] ) ;
355+
356+ const binDest = join ( DIST_VENDOR , "tea" , "tea" ) ;
357+ copyFile ( archive , binDest ) ;
358+ chmodSync ( binDest , 0o755 ) ;
359+ maybeSignMacBinary ( binDest , false ) ;
360+ return binDest ;
361+ }
362+
338363// ---------------------------------------------------------------------------
339364// claude-code — prefer the platform sub-package already on disk; fall back to
340365// downloading the npm tarball when staging for a non-host architecture.
@@ -527,13 +552,15 @@ stageClaudeCodeBinary(target);
527552// ----- Codex -----
528553stageCodexBinary ( target ) ;
529554
530- // ----- gh + glab (forge CLIs) -----
555+ // ----- gh + glab + tea (forge CLIs) -----
531556stageGhBinary ( target . ghArch ) ;
532557stageGlabBinary ( target . glabArch ) ;
558+ stageTeaBinary ( target . teaArch ) ;
533559
534560// ----- Summary -----
535561console . log ( `[stage-vendor] ✓ staged → ${ DIST_VENDOR } ` ) ;
536562console . log ( ` claude-code ${ humanSize ( join ( DIST_VENDOR , "claude-code" ) ) } ` ) ;
537563console . log ( ` codex ${ humanSize ( join ( DIST_VENDOR , "codex" ) ) } ` ) ;
538564console . log ( ` gh ${ humanSize ( join ( DIST_VENDOR , "gh" ) ) } ` ) ;
539565console . log ( ` glab ${ humanSize ( join ( DIST_VENDOR , "glab" ) ) } ` ) ;
566+ console . log ( ` tea ${ humanSize ( join ( DIST_VENDOR , "tea" ) ) } ` ) ;
0 commit comments