orynacode-ai 1.16.8 → 1.16.9
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/package.json +1 -1
- package/src/installation/index.ts +11 -49
package/package.json
CHANGED
|
@@ -136,11 +136,9 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
|
|
|
136
136
|
)
|
|
137
137
|
|
|
138
138
|
const getBrewFormula = Effect.fnUntraced(function* () {
|
|
139
|
-
const tapFormula = yield* text(["brew", "list", "--formula", "
|
|
140
|
-
if (tapFormula.includes("
|
|
141
|
-
|
|
142
|
-
if (coreFormula.includes("opencode")) return "opencode"
|
|
143
|
-
return "opencode"
|
|
139
|
+
const tapFormula = yield* text(["brew", "list", "--formula", "oryna-ai/tap/orynacode"])
|
|
140
|
+
if (tapFormula.includes("orynacode")) return "oryna-ai/tap/orynacode"
|
|
141
|
+
return "oryna-ai/tap/orynacode"
|
|
144
142
|
})
|
|
145
143
|
|
|
146
144
|
const upgradeFailure = (method: Method, result?: { code: number; stdout: string; stderr: string }) => {
|
|
@@ -194,9 +192,7 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
|
|
|
194
192
|
{ name: "yarn", command: () => text(["yarn", "global", "list"]) },
|
|
195
193
|
{ name: "pnpm", command: () => text(["pnpm", "list", "-g", "--depth=0"]) },
|
|
196
194
|
{ name: "bun", command: () => text(["bun", "pm", "ls", "-g"]) },
|
|
197
|
-
{ name: "brew", command: () => text(["brew", "list", "--formula", "
|
|
198
|
-
{ name: "scoop", command: () => text(["scoop", "list", "opencode"]) },
|
|
199
|
-
{ name: "choco", command: () => text(["choco", "list", "--limit-output", "opencode"]) },
|
|
195
|
+
{ name: "brew", command: () => text(["brew", "list", "--formula", "orynacode"]) },
|
|
200
196
|
]
|
|
201
197
|
|
|
202
198
|
checks.sort((a, b) => {
|
|
@@ -209,8 +205,7 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
|
|
|
209
205
|
|
|
210
206
|
for (const check of checks) {
|
|
211
207
|
const output = yield* check.command()
|
|
212
|
-
const installedName =
|
|
213
|
-
check.name === "brew" || check.name === "choco" || check.name === "scoop" ? "opencode" : "opencode-ai"
|
|
208
|
+
const installedName = check.name === "brew" ? "orynacode" : "orynacode-ai"
|
|
214
209
|
if (output.includes(installedName)) {
|
|
215
210
|
return check.name
|
|
216
211
|
}
|
|
@@ -228,45 +223,18 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
|
|
|
228
223
|
const info = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(BrewInfoV2))(infoJson)
|
|
229
224
|
return info.formulae[0].versions.stable
|
|
230
225
|
}
|
|
231
|
-
const response = yield* httpOk.execute(
|
|
232
|
-
HttpClientRequest.get("https://formulae.brew.sh/api/formula/opencode.json").pipe(
|
|
233
|
-
HttpClientRequest.acceptJson,
|
|
234
|
-
),
|
|
235
|
-
)
|
|
236
|
-
const data = yield* HttpClientResponse.schemaBodyJson(BrewFormula)(response)
|
|
237
|
-
return data.versions.stable
|
|
238
226
|
}
|
|
239
227
|
|
|
240
228
|
if (detectedMethod === "npm" || detectedMethod === "bun" || detectedMethod === "pnpm") {
|
|
241
229
|
const response = yield* httpOk.execute(
|
|
242
230
|
HttpClientRequest.get(
|
|
243
|
-
`${yield* NpmConfig.registry(process.cwd())}/
|
|
231
|
+
`${yield* NpmConfig.registry(process.cwd())}/orynacode-ai/${InstallationChannel}`,
|
|
244
232
|
).pipe(HttpClientRequest.acceptJson),
|
|
245
233
|
)
|
|
246
234
|
const data = yield* HttpClientResponse.schemaBodyJson(NpmPackage)(response)
|
|
247
235
|
return data.version
|
|
248
236
|
}
|
|
249
237
|
|
|
250
|
-
if (detectedMethod === "choco") {
|
|
251
|
-
const response = yield* httpOk.execute(
|
|
252
|
-
HttpClientRequest.get(
|
|
253
|
-
"https://community.chocolatey.org/api/v2/Packages?$filter=Id%20eq%20%27opencode%27%20and%20IsLatestVersion&$select=Version",
|
|
254
|
-
).pipe(HttpClientRequest.setHeaders({ Accept: "application/json;odata=verbose" })),
|
|
255
|
-
)
|
|
256
|
-
const data = yield* HttpClientResponse.schemaBodyJson(ChocoPackage)(response)
|
|
257
|
-
return data.d.results[0].Version
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (detectedMethod === "scoop") {
|
|
261
|
-
const response = yield* httpOk.execute(
|
|
262
|
-
HttpClientRequest.get(
|
|
263
|
-
"https://raw.githubusercontent.com/ScoopInstaller/Main/master/bucket/opencode.json",
|
|
264
|
-
).pipe(HttpClientRequest.setHeaders({ Accept: "application/json" })),
|
|
265
|
-
)
|
|
266
|
-
const data = yield* HttpClientResponse.schemaBodyJson(ScoopManifest)(response)
|
|
267
|
-
return data.version
|
|
268
|
-
}
|
|
269
|
-
|
|
270
238
|
const response = yield* httpOk.execute(
|
|
271
239
|
HttpClientRequest.get("https://api.github.com/repos/oryna-ai/orynacode/releases/latest").pipe(
|
|
272
240
|
HttpClientRequest.acceptJson,
|
|
@@ -282,24 +250,24 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
|
|
|
282
250
|
upgradeResult = yield* upgradeCurl(target)
|
|
283
251
|
break
|
|
284
252
|
case "npm":
|
|
285
|
-
upgradeResult = yield* run(["npm", "install", "-g", `
|
|
253
|
+
upgradeResult = yield* run(["npm", "install", "-g", `orynacode-ai@${target}`])
|
|
286
254
|
break
|
|
287
255
|
case "pnpm":
|
|
288
|
-
upgradeResult = yield* run(["pnpm", "install", "-g", `
|
|
256
|
+
upgradeResult = yield* run(["pnpm", "install", "-g", `orynacode-ai@${target}`])
|
|
289
257
|
break
|
|
290
258
|
case "bun":
|
|
291
|
-
upgradeResult = yield* run(["bun", "install", "-g", `
|
|
259
|
+
upgradeResult = yield* run(["bun", "install", "-g", `orynacode-ai@${target}`])
|
|
292
260
|
break
|
|
293
261
|
case "brew": {
|
|
294
262
|
const formula = yield* getBrewFormula()
|
|
295
263
|
const env = { HOMEBREW_NO_AUTO_UPDATE: "1" }
|
|
296
264
|
if (formula.includes("/")) {
|
|
297
|
-
const tap = yield* run(["brew", "tap", "
|
|
265
|
+
const tap = yield* run(["brew", "tap", "oryna-ai/tap"], { env })
|
|
298
266
|
if (tap.code !== 0) {
|
|
299
267
|
upgradeResult = tap
|
|
300
268
|
break
|
|
301
269
|
}
|
|
302
|
-
const repo = yield* text(["brew", "--repo", "
|
|
270
|
+
const repo = yield* text(["brew", "--repo", "oryna-ai/tap"])
|
|
303
271
|
const dir = repo.trim()
|
|
304
272
|
if (dir) {
|
|
305
273
|
const pull = yield* run(["git", "pull", "--ff-only"], { cwd: dir, env })
|
|
@@ -312,12 +280,6 @@ export const layer: Layer.Layer<Service, never, HttpClient.HttpClient | AppProce
|
|
|
312
280
|
upgradeResult = yield* run(["brew", "upgrade", formula], { env })
|
|
313
281
|
break
|
|
314
282
|
}
|
|
315
|
-
case "choco":
|
|
316
|
-
upgradeResult = yield* run(["choco", "upgrade", "opencode", `--version=${target}`, "-y"])
|
|
317
|
-
break
|
|
318
|
-
case "scoop":
|
|
319
|
-
upgradeResult = yield* run(["scoop", "install", `opencode@${target}`])
|
|
320
|
-
break
|
|
321
283
|
default:
|
|
322
284
|
return yield* new UpgradeFailedError({ stderr: `Unknown installation method: ${m}` })
|
|
323
285
|
}
|