open-azdo 0.2.3 → 0.2.4

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/dist/open-azdo.js CHANGED
@@ -47236,6 +47236,26 @@ var buildOpenCodeArgs = (request3) => [
47236
47236
  var extractFinalResponse = (output) => {
47237
47237
  const texts = [];
47238
47238
  const structuredCandidates = [];
47239
+ const reportedErrors = [];
47240
+ const describeError = (value3) => {
47241
+ if (value3 === null || value3 === undefined) {
47242
+ return;
47243
+ }
47244
+ if (typeof value3 === "string") {
47245
+ const trimmed = value3.trim();
47246
+ return trimmed.length > 0 ? trimmed : undefined;
47247
+ }
47248
+ if (typeof value3 !== "object" || Array.isArray(value3)) {
47249
+ return String(value3);
47250
+ }
47251
+ const record3 = value3;
47252
+ const message = describeError(record3.message) ?? describeError(record3.detail) ?? describeError(record3.data) ?? describeError(record3.error) ?? describeError(record3.cause);
47253
+ if (!message) {
47254
+ return stringifyJson2(record3);
47255
+ }
47256
+ const name = typeof record3.name === "string" ? record3.name.trim() : "";
47257
+ return name.length > 0 && !message.startsWith(`${name}:`) ? `${name}: ${message}` : message;
47258
+ };
47239
47259
  const maybeCollectStructuredCandidate = (value3) => {
47240
47260
  if (!value3 || typeof value3 !== "object" || Array.isArray(value3)) {
47241
47261
  return;
@@ -47290,6 +47310,12 @@ var extractFinalResponse = (output) => {
47290
47310
  texts.push(event);
47291
47311
  continue;
47292
47312
  }
47313
+ if (event && typeof event === "object" && !Array.isArray(event) && event.type === "error" && "error" in event) {
47314
+ const message = describeError(event.error);
47315
+ if (message) {
47316
+ reportedErrors.push(message);
47317
+ }
47318
+ }
47293
47319
  collectTextCandidates(event);
47294
47320
  } catch {
47295
47321
  texts.push(trimmed);
@@ -47303,7 +47329,7 @@ var extractFinalResponse = (output) => {
47303
47329
  `).trim();
47304
47330
  if (!response) {
47305
47331
  throw new OpenCodeOutputError({
47306
- message: "OpenCode did not return a final response.",
47332
+ message: reportedErrors.at(-1) ?? "OpenCode did not return a final response.",
47307
47333
  output
47308
47334
  });
47309
47335
  }
@@ -48445,7 +48471,7 @@ var reviewCommandConfig = {
48445
48471
  var reviewCommand = make33("review", reviewCommandConfig).pipe(withDescription3("Review an Azure DevOps pull request with OpenCode."), withHandler((input) => runReviewCommand(input)));
48446
48472
  var openAzdoCli = make33("open-azdo").pipe(withDescription3("Secure Azure DevOps pull-request review CLI powered by OpenCode."), withSubcommands([reviewCommand]));
48447
48473
  // package.json
48448
- var version2 = "0.2.3";
48474
+ var version2 = "0.2.4";
48449
48475
 
48450
48476
  // src/Main.ts
48451
48477
  var cliProgram = run3(openAzdoCli, { version: version2 }).pipe(exports_Effect.scoped, exports_Effect.provide(BaseRuntimeLayer));
@@ -48454,4 +48480,4 @@ var main = () => runMain2(cliProgram, { disableErrorReporting: true });
48454
48480
  // bin/open-azdo.ts
48455
48481
  main();
48456
48482
 
48457
- //# debugId=66CFFC8AFEDD190A64756E2164756E21
48483
+ //# debugId=7528100F803103A764756E2164756E21