btca 0.3.0 → 0.3.2
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/bin.js +1 -0
- package/dist/btca-darwin-arm64 +0 -0
- package/dist/btca-darwin-x64 +0 -0
- package/dist/btca-linux-arm64 +0 -0
- package/dist/btca-linux-x64 +0 -0
- package/dist/btca-windows-x64.exe +0 -0
- package/dist/index.js +58 -3
- package/package.json +1 -1
package/bin.js
CHANGED
package/dist/btca-darwin-arm64
CHANGED
|
Binary file
|
package/dist/btca-darwin-x64
CHANGED
|
Binary file
|
package/dist/btca-linux-arm64
CHANGED
|
Binary file
|
package/dist/btca-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -58985,6 +58985,8 @@ var withHandler2 = withHandler;
|
|
|
58985
58985
|
var withSubcommands3 = withSubcommands2;
|
|
58986
58986
|
var wizard7 = wizard6;
|
|
58987
58987
|
var run9 = run8;
|
|
58988
|
+
// src/services/cli.ts
|
|
58989
|
+
import * as readline2 from "readline";
|
|
58988
58990
|
// ../../node_modules/.bun/@opencode-ai+sdk@1.0.122/node_modules/@opencode-ai/sdk/dist/gen/core/serverSentEvents.gen.js
|
|
58989
58991
|
var createSseClient = ({ onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options7 }) => {
|
|
58990
58992
|
let lastEventId;
|
|
@@ -60649,7 +60651,8 @@ var configService = exports_Effect.gen(function* () {
|
|
|
60649
60651
|
config2 = { ...config2, repos: [...config2.repos, repo] };
|
|
60650
60652
|
yield* writeConfig(config2);
|
|
60651
60653
|
return repo;
|
|
60652
|
-
})
|
|
60654
|
+
}),
|
|
60655
|
+
getReposDirectory: () => exports_Effect.succeed(config2.reposDirectory)
|
|
60653
60656
|
};
|
|
60654
60657
|
});
|
|
60655
60658
|
|
|
@@ -60830,7 +60833,7 @@ class OcService extends exports_Effect.Service()("OcService", {
|
|
|
60830
60833
|
}
|
|
60831
60834
|
|
|
60832
60835
|
// src/services/cli.ts
|
|
60833
|
-
var VERSION = "0.3.
|
|
60836
|
+
var VERSION = "0.3.2";
|
|
60834
60837
|
var programLayer = exports_Layer.mergeAll(OcService.Default, ConfigService.Default);
|
|
60835
60838
|
var questionOption = exports_Options.text("question").pipe(exports_Options.withAlias("q"));
|
|
60836
60839
|
var techOption = exports_Options.text("tech").pipe(exports_Options.withAlias("t"));
|
|
@@ -60991,13 +60994,65 @@ var configReposAddCommand = exports_Command2.make("add", {
|
|
|
60991
60994
|
console.error(`Error: ${e.message}`);
|
|
60992
60995
|
process.exit(1);
|
|
60993
60996
|
})), exports_Effect.provide(programLayer)));
|
|
60997
|
+
var askConfirmation = (question) => exports_Effect.async((resume2) => {
|
|
60998
|
+
const rl = readline2.createInterface({
|
|
60999
|
+
input: process.stdin,
|
|
61000
|
+
output: process.stdout
|
|
61001
|
+
});
|
|
61002
|
+
rl.question(question, (answer) => {
|
|
61003
|
+
rl.close();
|
|
61004
|
+
const normalized = answer.toLowerCase().trim();
|
|
61005
|
+
resume2(exports_Effect.succeed(normalized === "y" || normalized === "yes"));
|
|
61006
|
+
});
|
|
61007
|
+
});
|
|
61008
|
+
var configReposClearCommand = exports_Command2.make("clear", {}, () => exports_Effect.gen(function* () {
|
|
61009
|
+
const config2 = yield* ConfigService;
|
|
61010
|
+
const fs = yield* exports_FileSystem.FileSystem;
|
|
61011
|
+
const reposDir = yield* config2.getReposDirectory();
|
|
61012
|
+
const exists5 = yield* fs.exists(reposDir);
|
|
61013
|
+
if (!exists5) {
|
|
61014
|
+
console.log("Repos directory does not exist. Nothing to clear.");
|
|
61015
|
+
return;
|
|
61016
|
+
}
|
|
61017
|
+
const entries2 = yield* fs.readDirectory(reposDir);
|
|
61018
|
+
const repoPaths = [];
|
|
61019
|
+
for (const entry of entries2) {
|
|
61020
|
+
const fullPath = `${reposDir}/${entry}`;
|
|
61021
|
+
const stat3 = yield* fs.stat(fullPath);
|
|
61022
|
+
if (stat3.type === "Directory") {
|
|
61023
|
+
repoPaths.push(fullPath);
|
|
61024
|
+
}
|
|
61025
|
+
}
|
|
61026
|
+
if (repoPaths.length === 0) {
|
|
61027
|
+
console.log("No repos found in the repos directory. Nothing to clear.");
|
|
61028
|
+
return;
|
|
61029
|
+
}
|
|
61030
|
+
console.log(`The following repos will be deleted:
|
|
61031
|
+
`);
|
|
61032
|
+
for (const repoPath of repoPaths) {
|
|
61033
|
+
console.log(` ${repoPath}`);
|
|
61034
|
+
}
|
|
61035
|
+
console.log();
|
|
61036
|
+
const confirmed = yield* askConfirmation("Are you sure you want to delete these repos? (y/N): ");
|
|
61037
|
+
if (!confirmed) {
|
|
61038
|
+
console.log("Aborted.");
|
|
61039
|
+
return;
|
|
61040
|
+
}
|
|
61041
|
+
for (const repoPath of repoPaths) {
|
|
61042
|
+
yield* fs.remove(repoPath, { recursive: true });
|
|
61043
|
+
console.log(`Deleted: ${repoPath}`);
|
|
61044
|
+
}
|
|
61045
|
+
console.log(`
|
|
61046
|
+
All repos have been cleared.`);
|
|
61047
|
+
}).pipe(exports_Effect.provide(programLayer)));
|
|
60994
61048
|
var configReposCommand = exports_Command2.make("repos", {}, () => exports_Effect.sync(() => {
|
|
60995
61049
|
console.log("Usage: btca config repos <command>");
|
|
60996
61050
|
console.log("");
|
|
60997
61051
|
console.log("Commands:");
|
|
60998
61052
|
console.log(" list List all configured repos");
|
|
60999
61053
|
console.log(" add Add a new repo");
|
|
61000
|
-
|
|
61054
|
+
console.log(" clear Clear all downloaded repos");
|
|
61055
|
+
})).pipe(exports_Command2.withSubcommands([configReposListCommand, configReposAddCommand, configReposClearCommand]));
|
|
61001
61056
|
var configCommand = exports_Command2.make("config", {}, () => exports_Effect.gen(function* () {
|
|
61002
61057
|
const config2 = yield* ConfigService;
|
|
61003
61058
|
const configPath = yield* config2.getConfigPath();
|