@dosu/cli 0.35.4 → 0.36.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.
- package/bin/dosu.js +13 -4
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -4759,7 +4759,7 @@ var init_dist4 = __esm(() => {
|
|
|
4759
4759
|
function getVersionString() {
|
|
4760
4760
|
return `v${VERSION}`;
|
|
4761
4761
|
}
|
|
4762
|
-
var VERSION = "0.
|
|
4762
|
+
var VERSION = "0.36.0", INSTALL_CHANNEL = "npm";
|
|
4763
4763
|
|
|
4764
4764
|
// src/debug/logger.ts
|
|
4765
4765
|
import {
|
|
@@ -4893,7 +4893,7 @@ var init_logger = __esm(() => {
|
|
|
4893
4893
|
});
|
|
4894
4894
|
|
|
4895
4895
|
// src/client/contract.ts
|
|
4896
|
-
var CLI_CONTRACT_HASH = "
|
|
4896
|
+
var CLI_CONTRACT_HASH = "663c43d2937c";
|
|
4897
4897
|
|
|
4898
4898
|
// src/client/trpc.ts
|
|
4899
4899
|
var exports_trpc = {};
|
|
@@ -13644,6 +13644,7 @@ init_commander();
|
|
|
13644
13644
|
init_config();
|
|
13645
13645
|
init_logger();
|
|
13646
13646
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
13647
|
+
var DEFAULT_TIMEOUT_SECONDS = 600;
|
|
13647
13648
|
function requireConfig2() {
|
|
13648
13649
|
const cfg = loadConfig();
|
|
13649
13650
|
if (!cfg.active_account?.target?.api_key) {
|
|
@@ -13657,16 +13658,24 @@ function requireConfig2() {
|
|
|
13657
13658
|
return cfg;
|
|
13658
13659
|
}
|
|
13659
13660
|
function askCommand() {
|
|
13660
|
-
const cmd = new Command("ask").description("Ask a question and get an AI-generated answer").argument("<question>", "The question to ask").option("--session <id>", "Continue a previous ask session").option("--json", "Output as JSON").action(async (question, opts) => {
|
|
13661
|
+
const cmd = new Command("ask").description("Ask a question and get an AI-generated answer").argument("<question>", "The question to ask").option("--session <id>", "Continue a previous ask session").option("--timeout <seconds>", `Request timeout in seconds (default: ${DEFAULT_TIMEOUT_SECONDS})`).option("--json", "Output as JSON").action(async (question, opts) => {
|
|
13661
13662
|
const cfg = requireConfig2();
|
|
13662
13663
|
const backendURL = getBackendURL();
|
|
13663
13664
|
if (!backendURL) {
|
|
13664
13665
|
console.error(import_picocolors5.default.red("Backend URL not configured."));
|
|
13665
13666
|
process.exit(1);
|
|
13666
13667
|
}
|
|
13668
|
+
let timeoutSeconds = DEFAULT_TIMEOUT_SECONDS;
|
|
13669
|
+
if (opts.timeout !== undefined) {
|
|
13670
|
+
timeoutSeconds = Number(opts.timeout);
|
|
13671
|
+
if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
|
|
13672
|
+
console.error(import_picocolors5.default.red("--timeout must be a positive number of seconds."));
|
|
13673
|
+
process.exit(1);
|
|
13674
|
+
}
|
|
13675
|
+
}
|
|
13667
13676
|
logger.debug("ask", `Asking: ${question}`);
|
|
13668
13677
|
const controller = new AbortController;
|
|
13669
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
13678
|
+
const timeout = setTimeout(() => controller.abort(), timeoutSeconds * 1000);
|
|
13670
13679
|
try {
|
|
13671
13680
|
const resp = await fetch(`${backendURL}/ask`, {
|
|
13672
13681
|
method: "POST",
|