@ai-vibeway/cli 0.0.191 → 0.0.192
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/client-config.snapshot.json +56 -70
- package/components.json +5 -6
- package/dist/brand.json +5 -4
- package/dist/client-config.snapshot.json +56 -70
- package/dist/components.json +5 -6
- package/dist/lib/components.js +1 -1
- package/dist/lib/tools/chatgpt-desktop.js +1 -1
- package/dist/lib/tools/claude-desktop-app.js +1 -1
- package/dist/lib/tools/claude-desktop-cli.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{spawnSync as t}from"child_process";import{logger as n}from"../../utils/logger.js";import{brand as e}from"../brand.js";import{powerShellEnv as r}from"../powershell-env.js";import{existsSync as i}from"fs";import{join as o}from"path";import{appPlatform as s,createDesktopAppInstaller as a,isArm64Machine as p,macAppVersion as l,macBundleId as c}from"./desktop-app-installer.js";import{toolHome as u}from"./types.js";export const OPENAI_TEAM_ID="2DC432GLL2";const d="com.openai.codex";export const CHATGPT_PACKAGE_FAMILY="OpenAI.Codex_2p2nqsd0c76g0";const g=a({id:"chatgpt-desktop",mirror:()=>e().installMirror?.chatgptDesktop,asset:(t,n)=>"darwin"===t?n?"
|
|
1
|
+
import{spawnSync as t}from"child_process";import{logger as n}from"../../utils/logger.js";import{brand as e}from"../brand.js";import{powerShellEnv as r}from"../powershell-env.js";import{existsSync as i}from"fs";import{join as o}from"path";import{appPlatform as s,createDesktopAppInstaller as a,isArm64Machine as p,macAppVersion as l,macBundleId as c}from"./desktop-app-installer.js";import{toolHome as u}from"./types.js";export const OPENAI_TEAM_ID="2DC432GLL2";const d="com.openai.codex";export const CHATGPT_PACKAGE_FAMILY="OpenAI.Codex_2p2nqsd0c76g0";const g=a({id:"chatgpt-desktop",mirror:()=>e().installMirror?.chatgptDesktop,asset:(t,n)=>"darwin"===t?n?"d2-mac-arm64.dmg":null:"win32"===t?n?"d2-win-arm64.msix":"d2-win-x64.msix":null,versionFile:(t,n)=>"win32"===t?`version-win-${n?"arm64":"x64"}.txt`:"version.txt",macApp:{source:"ChatGPT.app",installedNames:["ChatGPT.app","Codex.app"],bundleId:d,teamId:"2DC432GLL2"},windows:{signer:new RegExp("^CN=50BDFD77-8903-4850-9FFE-6E8522F64D5B$"),packageFilter:`$_.PackageFamilyName -eq '${CHATGPT_PACKAGE_FAMILY}'`},extraBlocker:t=>"darwin"===t&&!g.installedMacApp()&&["/Applications",o(u(),"Applications")].some(t=>{const n=o(t,"ChatGPT.app");return i(o(n,"Contents","Info.plist"))&&c(n)!==d})?"other_app":null});export const chatgptInstaller=g;let m=(e,i,o=3e4)=>{const s=t(e,i,{encoding:"utf-8",timeout:o,windowsHide:!0,stdio:["ignore","pipe","pipe"],env:r()});return s.error&&n.logError(`chatgpt-desktop: ${e}`,s.error),{status:s.status,stdout:`${s.stdout??""}`,stderr:`${s.stderr??""}`}};export function setChatgptProcessRunnerForTests(t){m=t}function f(t,n){return m("powershell.exe",["-NoProfile","-NonInteractive","-Command",t],n)}const h=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C="Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.Path -like '*\\WindowsApps\\OpenAI.Codex_*\\app\\ChatGPT.exe' }";function w(t){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,t)}export function isChatgptRunning(){if("darwin"===s()){const t=g.installedMacApp();return Boolean(t)&&0===m("pgrep",["-f",`^${h(t)}/Contents/MacOS/`]).status}return"win32"===s()&&Number(f(`@(${C}).Count`).stdout.trim())>0}let A=!1;export function chatgptQuitRefused(){return A}export function quitChatgpt(){if(A=!1,"darwin"===s()){const t=g.installedMacApp();if(macQuitRefused(m("osascript",["-e",`tell application id "${d}" to quit`]))&&(A=isChatgptRunning(),A))return!1;for(let t=0;t<30&&isChatgptRunning();t++)w(500);t&&isChatgptRunning()&&m("pkill",["-f",`^${h(t)}/Contents/MacOS/`]),w(1e3)}else{if("win32"!==s())return!1;f([`$p = @(${C})`,"$p | ForEach-Object { [void]$_.CloseMainWindow() }","Start-Sleep -Seconds 3",`@(${C}) | Stop-Process -Force -ErrorAction SilentlyContinue`,"Start-Sleep -Seconds 1"].join("\n"),6e4)}return!isChatgptRunning()}export function launchChatgpt(){if("darwin"===s()){const t=g.installedMacApp();if(!t)return!1;m("open",[t])}else{if("win32"!==s())return!1;f(`Start-Process 'shell:AppsFolder\\${CHATGPT_PACKAGE_FAMILY}!App'`,6e4)}for(let t=0;t<20;t++){if(isChatgptRunning())return!0;w(500)}return!1}export function macQuitRefused(t){return null===t.status||/\(-128\)|-1712/.test(t.stderr??"")}export const chatgptDesktopApp={name:"chatgpt",displayName:"ChatGPT",installedVersion:function(){if("darwin"===s()){const t=g.installedMacApp();return t?l(t):null}return"win32"===s()?g.windowsPackageVersion():null},runningApp:{isRunning:isChatgptRunning,quit:quitChatgpt,quitRefused:chatgptQuitRefused,launch:launchChatgpt},appInstaller:{vendor:"OpenAI",sizeMb:()=>"darwin"===s()?800:p()?1050:1e3,downloadPage:"https://chatgpt.com/download",blocker:g.blocker,latestVersion:()=>g.latestVersion(),installedPath:()=>"darwin"===s()?g.installedMacApp():"win32"!==s()?null:g.windowsPackageVersion()?"MSIX":null,install:t=>g.install(t)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as e}from"fs";import{join as s}from"path";import{brand as t}from"../brand.js";import{WINDOWS_PACKAGE_FAMILIES as o}from"./desktop-process.js";import{createDesktopAppInstaller as
|
|
1
|
+
import{existsSync as e}from"fs";import{join as s}from"path";import{brand as t}from"../brand.js";import{WINDOWS_PACKAGE_FAMILIES as o}from"./desktop-process.js";import{createDesktopAppInstaller as r}from"./desktop-app-installer.js";import{toolHome as a}from"./types.js";export const ANTHROPIC_TEAM_ID="Q6L2SF6YDW";export{DesktopInstallError,parseSha256Sums,setDesktopAppDepsForTests}from"./desktop-app-installer.js";const p=r({id:"claude-desktop",mirror:()=>t().installMirror?.claudeDesktop,asset:(e,s)=>"darwin"===e?"d1-mac-universal.dmg":"win32"===e?s?"d1-win-arm64.msix":"d1-win-x64.msix":null,versionFile:()=>"version.txt",releaseTag:e=>`v${e}`,macApp:{source:"Claude.app",installedNames:["Claude.app"],bundleId:"com.anthropic.claudefordesktop",teamId:"Q6L2SF6YDW"},windows:{signer:/(^|,\s*)O="?Anthropic, PBC"?(,|$)/,packageFilter:`@(${o.map(e=>`'${e}'`).join(",")}) -contains $_.PackageFamilyName`},extraBlocker:t=>"win32"===t&&function(){const t=process.env.LOCALAPPDATA||s(a(),"AppData","Local");return e(s(t,"AnthropicClaude","Update.exe"))}()?"classic_install":null});export const desktopAssetName=p.assetName;export const desktopInstallBlocker=p.blocker;export const fetchLatestDesktopVersion=(e=8e3)=>p.latestVersion(e);export const installedMacApp=p.installedMacApp;export const verifyMacApp=p.verifyMacApp;export const verifyWindowsPackage=p.verifyWindowsPackage;export function installLatestDesktop(e={}){return p.install(e)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{execFileSync as
|
|
1
|
+
import{execFileSync as r}from"child_process";import{createHash as e}from"crypto";import{createReadStream as t,createWriteStream as o,existsSync as s,readdirSync as n,readFileSync as i}from"fs";import{copyFile as a,mkdir as l,readFile as c,rename as u,rm as f,writeFile as p}from"fs/promises";import{isAbsolute as d,join as m,normalize as h,sep as w}from"path";import{Readable as g,Writable as b}from"stream";import{pipeline as v}from"stream/promises";import*as D from"zlib";import{logger as y}from"../../utils/logger.js";import{brand as k,brandEnv as $}from"../brand.js";import{downloadNativeBinary as C,nativeLayout as S,nativePlatformKey as x}from"./claude-native-mirror.js";import{WINDOWS_PACKAGE_FAMILIES as N}from"./desktop-process.js";import{toolHome as A}from"./types.js";import{mirrorFileUrl as P,withDownloadFallback as L}from"../mirror-url.js";import{powerShellEnv as O}from"../powershell-env.js";export function readDesktopCliPin(r,e,t=!1){const o=r.indexOf('claude-code-releases","sdkWrapperVersion"');if(o<0)return null;const s=r.lastIndexOf("JSON.parse('",o),n=r.indexOf("')",o);if(s<0||n<0)return null;try{const o=JSON.parse(r.subarray(s+12,n).toString("utf-8")),i="string"==typeof o.version?o.version:"",a=o.manifest?.platforms?.[e],l=t?a?.bundle?.checksum:a?.checksum;return/^\d+\.\d+\.\d+$/.test(i)&&"string"==typeof l&&/^[0-9a-f]{64}$/.test(l)?{version:i,checksum:l}:null}catch{return null}}function E(){const e=m(process.env.LOCALAPPDATA||"","AnthropicClaude");if(process.env.LOCALAPPDATA&&s(e)){const r=n(e).filter(r=>/^app-\d+\.\d+\.\d+$/.test(r)).sort((r,e)=>e.localeCompare(r,void 0,{numeric:!0}));for(const t of r){const r=m(e,t,"resources","app.asar");if(s(r))return r}}try{const e=r("powershell.exe",["-NoProfile","-Command",`Get-AppxPackage | Where-Object { @(${N.map(r=>`'${r}'`).join(",")}) -contains $_.PackageFamilyName } | ForEach-Object { $_.InstallLocation }`],{encoding:"utf-8",timeout:15e3,windowsHide:!0,stdio:["ignore","pipe","ignore"],env:O()});for(const r of e.split(/\r?\n/).map(r=>r.trim()).filter(Boolean)){const e=m(r,"app","resources","app.asar");if(s(e))return e}}catch(r){y.logError("claude-desktop-cli.windowsAsarPath",r)}return null}function j(){if($("TEST_HOME")?.trim())return null;for(const r of["/usr/lib/claude-desktop","/opt/Claude"]){const e=m(r,"resources","app.asar");if(s(e))return e}return null}function F(){for(const r of["/Applications/Claude.app",m(A(),"Applications","Claude.app")]){const e=m(r,"Contents","Resources","app.asar");if(s(e))return e}return null}export function installedDesktopAsarPath(){return"win32"===process.platform?E():"darwin"===process.platform?F():"linux"===process.platform?j():null}class T extends b{dest;buffer=Buffer.alloc(0);remaining=0;padding=0;file=null;longName=null;collectingLongName=null;constructor(r){super(),this.dest=r}_write(r,e,t){this.buffer=this.buffer.length?Buffer.concat([this.buffer,r]):r,this.drain().then(()=>t()).catch(t)}_final(r){this.remaining>0?r(new Error("archive ends inside an entry")):r()}target(r){const e=h(r);if(!e||d(e)||".."===e||e.startsWith(`..${w}`))throw new Error(`unsafe path in archive: ${r}`);return m(this.dest,e)}async closeFile(){const r=this.file;this.file=null,r&&await new Promise((e,t)=>r.end(r=>r?t(r):e()))}async drain(){for(;;){if(this.remaining>0){if(0===this.buffer.length)return;const r=this.buffer.subarray(0,Math.min(this.remaining,this.buffer.length));this.buffer=this.buffer.subarray(r.length),this.remaining-=r.length,this.collectingLongName?this.collectingLongName.push(r):this.file&&!this.file.write(r)&&await new Promise(r=>this.file.once("drain",()=>r())),0===this.remaining&&(this.collectingLongName&&(this.longName=Buffer.concat(this.collectingLongName).toString("utf-8").replace(/\0.*$/s,""),this.collectingLongName=null),await this.closeFile());continue}if(this.padding>0){if(this.buffer.length<this.padding)return;this.buffer=this.buffer.subarray(this.padding),this.padding=0}if(this.buffer.length<512)return;const r=this.buffer.subarray(0,512);if(this.buffer=this.buffer.subarray(512),r.every(r=>0===r))continue;const e=(e,t)=>r.subarray(e,e+t).toString("utf-8").replace(/\0.*$/s,""),t=e(345,155);let s=t?`${t}/${e(0,100)}`:e(0,100);null!==this.longName&&(s=this.longName,this.longName=null);const n=parseInt(e(124,12).trim()||"0",8),i=511&parseInt(e(100,8).trim()||"644",8),a=e(156,1)||"0";if(this.remaining=n,this.padding=(512-n%512)%512,"L"===a)this.collectingLongName=[];else if("x"===a||"g"===a);else if("5"===a)await l(this.target(s),{recursive:!0});else{if("0"!==a)throw new Error(`unexpected entry type ${a} in archive: ${s}`);{const r=this.target(s);await l(m(r,".."),{recursive:!0}),this.file=o(r,{mode:i||420}),0===n&&await this.closeFile()}}}}}export async function installDesktopCli(r){const o=readDesktopCliPin(r.asar,r.platformKey,r.bundle);if(!o)return{status:"skipped",reason:"unknown app layout"};if(r.bundle&&!r.download)return{status:"skipped",reason:"no bundle mirror"};const n=r.platformKey.startsWith("win32")?"claude.exe":"claude",i=m(r.userDataDir,"claude-code",o.version),d=m(i,o.checksum.slice(0,12)),h=r.bundle?m(d,"claude.app","Contents","MacOS","claude"):m(d,n),w=m(d,".verified");try{if(s(h)&&(await c(w,"utf-8")).trim()===o.checksum)return{status:"present",version:o.version}}catch{}await l(i,{recursive:!0});const g=m(i,`.partial-${o.checksum.slice(0,12)}`),y=`${g}.download`;try{await f(w,{force:!0}),await f(g,{recursive:!0,force:!0});let n="mirror";if(r.bundle){if(r.onStart?.(o.version,"mirror"),r.onDownload?.(o.version),await r.download(o.version,y),await async function(r,o,s){const n=e("sha256");if(await v(t(r),new b({write(r,e,t){n.update(r),t()}})),n.digest("hex")!==o)throw new Error("downloaded bundle does not match the app's checksum");const i=D.createZstdDecompress;if(!i)throw new Error(`Node ${process.version} cannot decompress zstd (needs 22.15 or newer)`);await v(t(r),i(),new T(s))}(y,o.checksum,g),!s(m(g,"claude.app","Contents","MacOS","claude")))throw new Error("bundle has no claude.app");await f(d,{recursive:!0,force:!0}),await u(g,d)}else{const e=r.localVersionsDir?m(r.localVersionsDir,o.version):null;if(e&&s(e))r.onStart?.(o.version,"local"),await a(e,g),n="local";else{r.onStart?.(o.version,"mirror"),r.onDownload?.(o.version);const e=r.download??((e,t)=>C(r.platformKey,e,t));await e(o.version,g)}await l(d,{recursive:!0}),await u(g,h)}return await p(w,o.checksum),{status:"installed",version:o.version,source:n}}finally{await f(g,{recursive:!0,force:!0}),await f(y,{force:!0}),await f(`${g}.download`,{force:!0})}}let K=(...r)=>fetch(...r);export function setDesktopCliFetchForTests(r){K=r}export async function ensureDesktopCli(r){const e=x();if(!e)return{status:"skipped",reason:"unsupported architecture"};if("win32"===process.platform){const t=E();return t?installDesktopCli({userDataDir:r.userDataDir,asar:i(t),platformKey:e,localVersionsDir:S().versionsDir,onDownload:r.onDownload,onStart:r.onStart}):{status:"skipped",reason:"app.asar not found"}}if("darwin"===process.platform){const t=F();if(!t)return{status:"skipped",reason:"app.asar not found"};const{mirror:s,desktopVersion:n}=r;return installDesktopCli({userDataDir:r.userDataDir,asar:i(t),platformKey:e,bundle:!0,onDownload:r.onDownload,onStart:r.onStart,download:s&&n?(r,t)=>L(P(s,`d1-cli-${r}-${e}.tar.zst`,`v${n}`),k().installMirror?.downloadCounter,r=>async function(r,e){const t=await K(r,{signal:AbortSignal.timeout(9e5)});if(!t.ok||!t.body)throw new Error(`${r}: HTTP ${t.status}`);await v(g.fromWeb(t.body),o(e))}(r,t)):void 0})}if("linux"===process.platform){const t=j();return t?installDesktopCli({userDataDir:r.userDataDir,asar:i(t),platformKey:e.replace(/-musl$/,""),localVersionsDir:e.endsWith("-musl")?void 0:S().versionsDir,onDownload:r.onDownload,onStart:r.onStart}):{status:"skipped",reason:"app.asar not found"}}return{status:"skipped",reason:"unsupported platform"}}
|