* fix: prevent bundled OpenCode self-upgrades * feat(vscode): support OpenCode upgrades * fix: refresh OpenCode update status on runtime switch --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
37 lines
621 B
JavaScript
37 lines
621 B
JavaScript
export const resolveOpenCodeUpgradeCapability = ({
|
|
isExternal,
|
|
hasManagedProcess,
|
|
activeBinary,
|
|
isBundledBinary,
|
|
}) => {
|
|
if (isExternal) {
|
|
return {
|
|
supported: false,
|
|
manager: 'external',
|
|
reason: 'external',
|
|
};
|
|
}
|
|
|
|
if (!hasManagedProcess || !activeBinary) {
|
|
return {
|
|
supported: false,
|
|
manager: null,
|
|
reason: 'unavailable',
|
|
};
|
|
}
|
|
|
|
if (isBundledBinary(activeBinary)) {
|
|
return {
|
|
supported: false,
|
|
manager: 'openchamber',
|
|
reason: 'bundled',
|
|
};
|
|
}
|
|
|
|
return {
|
|
supported: true,
|
|
manager: 'opencode',
|
|
reason: null,
|
|
};
|
|
};
|