opencode-studio-server 1.22.0 → 1.23.0

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.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1104,7 +1104,11 @@ async function ensureGitHubRepo(token, repoName) {
1104
1104
 
1105
1105
  if (response.ok) {
1106
1106
  const data = await response.json();
1107
- if (!data.default_branch) {
1107
+ const branch = data.default_branch || 'main';
1108
+ const refRes = await fetch(`https://api.github.com/repos/${owner}/${repo}/git/refs/heads/${branch}`, {
1109
+ headers: { 'Authorization': `Bearer ${token}` }
1110
+ });
1111
+ if (refRes.status === 404 || refRes.status === 409) {
1108
1112
  await bootstrapEmptyRepo(token, owner, repo);
1109
1113
  }
1110
1114
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-studio-server",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Backend server for OpenCode Studio - manages opencode configurations",
5
5
  "main": "index.js",
6
6
  "bin": {