open-azdo 0.3.2 → 0.3.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
@@ -6779,18 +6779,18 @@ var require_set = __commonJS((exports) => {
6779
6779
  }
6780
6780
  static from(schema2, iterable, ctx) {
6781
6781
  const { replacer } = ctx;
6782
- const set7 = new this(schema2);
6782
+ const set8 = new this(schema2);
6783
6783
  if (iterable && Symbol.iterator in Object(iterable))
6784
6784
  for (let value3 of iterable) {
6785
6785
  if (typeof replacer === "function")
6786
6786
  value3 = replacer.call(iterable, value3, value3);
6787
- set7.items.push(Pair.createPair(value3, null, ctx));
6787
+ set8.items.push(Pair.createPair(value3, null, ctx));
6788
6788
  }
6789
- return set7;
6789
+ return set8;
6790
6790
  }
6791
6791
  }
6792
6792
  YAMLSet.tag = "tag:yaml.org,2002:set";
6793
- var set6 = {
6793
+ var set7 = {
6794
6794
  collection: "map",
6795
6795
  identify: (value3) => value3 instanceof Set,
6796
6796
  nodeClass: YAMLSet,
@@ -6809,7 +6809,7 @@ var require_set = __commonJS((exports) => {
6809
6809
  }
6810
6810
  };
6811
6811
  exports.YAMLSet = YAMLSet;
6812
- exports.set = set6;
6812
+ exports.set = set7;
6813
6813
  });
6814
6814
 
6815
6815
  // ../../node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
@@ -6907,7 +6907,7 @@ var require_schema3 = __commonJS((exports) => {
6907
6907
  var merge6 = require_merge();
6908
6908
  var omap = require_omap();
6909
6909
  var pairs = require_pairs();
6910
- var set6 = require_set();
6910
+ var set7 = require_set();
6911
6911
  var timestamp = require_timestamp();
6912
6912
  var schema2 = [
6913
6913
  map15.map,
@@ -6927,7 +6927,7 @@ var require_schema3 = __commonJS((exports) => {
6927
6927
  merge6.merge,
6928
6928
  omap.omap,
6929
6929
  pairs.pairs,
6930
- set6.set,
6930
+ set7.set,
6931
6931
  timestamp.intTime,
6932
6932
  timestamp.floatTime,
6933
6933
  timestamp.timestamp
@@ -6951,7 +6951,7 @@ var require_tags = __commonJS((exports) => {
6951
6951
  var omap = require_omap();
6952
6952
  var pairs = require_pairs();
6953
6953
  var schema$2 = require_schema3();
6954
- var set6 = require_set();
6954
+ var set7 = require_set();
6955
6955
  var timestamp = require_timestamp();
6956
6956
  var schemas = new Map([
6957
6957
  ["core", schema2.schema],
@@ -6977,7 +6977,7 @@ var require_tags = __commonJS((exports) => {
6977
6977
  omap: omap.omap,
6978
6978
  pairs: pairs.pairs,
6979
6979
  seq: seq.seq,
6980
- set: set6.set,
6980
+ set: set7.set,
6981
6981
  timestamp: timestamp.timestamp
6982
6982
  };
6983
6983
  var coreKnownTags = {
@@ -6985,7 +6985,7 @@ var require_tags = __commonJS((exports) => {
6985
6985
  "tag:yaml.org,2002:merge": merge6.merge,
6986
6986
  "tag:yaml.org,2002:omap": omap.omap,
6987
6987
  "tag:yaml.org,2002:pairs": pairs.pairs,
6988
- "tag:yaml.org,2002:set": set6.set,
6988
+ "tag:yaml.org,2002:set": set7.set,
6989
6989
  "tag:yaml.org,2002:timestamp": timestamp.timestamp
6990
6990
  };
6991
6991
  function getTags(customTags, schemaName, addMergeTag) {
@@ -21105,11 +21105,11 @@ var require_HTMLParser = __commonJS((exports, module) => {
21105
21105
  }
21106
21106
  return result4;
21107
21107
  }
21108
- function isA(elt, set9) {
21109
- if (typeof set9 === "string") {
21110
- return elt.namespaceURI === NAMESPACE.HTML && elt.localName === set9;
21108
+ function isA(elt, set10) {
21109
+ if (typeof set10 === "string") {
21110
+ return elt.namespaceURI === NAMESPACE.HTML && elt.localName === set10;
21111
21111
  }
21112
- var tagnames = set9[elt.namespaceURI];
21112
+ var tagnames = set10[elt.namespaceURI];
21113
21113
  return tagnames && tagnames[elt.localName];
21114
21114
  }
21115
21115
  function isMathmlTextIntegrationPoint(n) {
@@ -21209,9 +21209,9 @@ var require_HTMLParser = __commonJS((exports, module) => {
21209
21209
  this.elements.splice(idx, 1);
21210
21210
  }
21211
21211
  };
21212
- HTMLParser.ElementStack.prototype.clearToContext = function(set9) {
21212
+ HTMLParser.ElementStack.prototype.clearToContext = function(set10) {
21213
21213
  for (var i = this.elements.length - 1;i > 0; i--) {
21214
- if (isA(this.elements[i], set9))
21214
+ if (isA(this.elements[i], set10))
21215
21215
  break;
21216
21216
  }
21217
21217
  this.elements.length = i + 1;
@@ -21220,32 +21220,32 @@ var require_HTMLParser = __commonJS((exports, module) => {
21220
21220
  HTMLParser.ElementStack.prototype.contains = function(tag2) {
21221
21221
  return this.inSpecificScope(tag2, Object.create(null));
21222
21222
  };
21223
- HTMLParser.ElementStack.prototype.inSpecificScope = function(tag2, set9) {
21223
+ HTMLParser.ElementStack.prototype.inSpecificScope = function(tag2, set10) {
21224
21224
  for (var i = this.elements.length - 1;i >= 0; i--) {
21225
21225
  var elt = this.elements[i];
21226
21226
  if (isA(elt, tag2))
21227
21227
  return true;
21228
- if (isA(elt, set9))
21228
+ if (isA(elt, set10))
21229
21229
  return false;
21230
21230
  }
21231
21231
  return false;
21232
21232
  };
21233
- HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set9) {
21233
+ HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set10) {
21234
21234
  for (var i = this.elements.length - 1;i >= 0; i--) {
21235
21235
  var elt = this.elements[i];
21236
21236
  if (elt === target)
21237
21237
  return true;
21238
- if (isA(elt, set9))
21238
+ if (isA(elt, set10))
21239
21239
  return false;
21240
21240
  }
21241
21241
  return false;
21242
21242
  };
21243
- HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set9) {
21243
+ HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set10) {
21244
21244
  for (var i = this.elements.length - 1;i >= 0; i--) {
21245
21245
  var elt = this.elements[i];
21246
21246
  if (elt instanceof target)
21247
21247
  return true;
21248
- if (isA(elt, set9))
21248
+ if (isA(elt, set10))
21249
21249
  return false;
21250
21250
  }
21251
21251
  return false;
@@ -30300,6 +30300,12 @@ var fiberInterruptAll = (fibers) => withFiber((parent) => {
30300
30300
  }
30301
30301
  return asVoid2(fiberAwaitAll(fibers));
30302
30302
  });
30303
+ var fiberInterruptAllAs = /* @__PURE__ */ dual(2, (fibers, fiberId) => withFiber((parent) => {
30304
+ const annotations = fiberStackAnnotations(parent);
30305
+ for (const fiber of fibers)
30306
+ fiber.interruptUnsafe(fiberId, annotations);
30307
+ return asVoid2(fiberAwaitAll(fibers));
30308
+ }));
30303
30309
  var succeed3 = exitSucceed;
30304
30310
  var failCause = exitFailCause;
30305
30311
  var fail3 = exitFail;
@@ -32047,6 +32053,14 @@ var logWithLevel = (level) => (...message) => {
32047
32053
  return void_2;
32048
32054
  });
32049
32055
  };
32056
+ var withColor = (text, ...colors) => {
32057
+ let out = "";
32058
+ for (let i = 0;i < colors.length; i++) {
32059
+ out += `\x1B[${colors[i]}m`;
32060
+ }
32061
+ return out + text + "\x1B[0m";
32062
+ };
32063
+ var withColorNoop = (text, ..._colors) => text;
32050
32064
  var colors = {
32051
32065
  bold: "1",
32052
32066
  red: "31",
@@ -32069,10 +32083,139 @@ var logLevelColors = {
32069
32083
  Error: [colors.red],
32070
32084
  Fatal: [colors.bgBrightRed, colors.black]
32071
32085
  };
32086
+ var logLevelStyle = {
32087
+ None: "",
32088
+ All: "",
32089
+ Trace: "color:gray",
32090
+ Debug: "color:blue",
32091
+ Info: "color:green",
32092
+ Warn: "color:orange",
32093
+ Error: "color:red",
32094
+ Fatal: "background-color:red;color:white"
32095
+ };
32072
32096
  var defaultDateFormat = (date) => `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}.${date.getMilliseconds().toString().padStart(3, "0")}`;
32073
32097
  var hasProcessStdout = typeof process === "object" && process !== null && typeof process.stdout === "object" && process.stdout !== null;
32074
32098
  var processStdoutIsTTY = hasProcessStdout && process.stdout.isTTY === true;
32075
32099
  var hasProcessStdoutOrDeno = hasProcessStdout || "Deno" in globalThis;
32100
+ var consolePretty = (options) => {
32101
+ const mode_ = options?.mode ?? "auto";
32102
+ const mode = mode_ === "auto" ? hasProcessStdoutOrDeno ? "tty" : "browser" : mode_;
32103
+ const isBrowser = mode === "browser";
32104
+ const showColors = typeof options?.colors === "boolean" ? options.colors : processStdoutIsTTY || isBrowser;
32105
+ const formatDate2 = options?.formatDate ?? defaultDateFormat;
32106
+ return isBrowser ? prettyLoggerBrowser({
32107
+ colors: showColors,
32108
+ formatDate: formatDate2
32109
+ }) : prettyLoggerTty({
32110
+ colors: showColors,
32111
+ formatDate: formatDate2
32112
+ });
32113
+ };
32114
+ var prettyLoggerTty = (options) => {
32115
+ const processIsBun = typeof process === "object" && "isBun" in process && process.isBun === true;
32116
+ const color = options.colors ? withColor : withColorNoop;
32117
+ return loggerMake(({
32118
+ cause,
32119
+ date,
32120
+ fiber: fiber2,
32121
+ logLevel,
32122
+ message: message_
32123
+ }) => {
32124
+ const console2 = fiber2.getRef(ConsoleRef);
32125
+ const log = fiber2.getRef(LogToStderr) ? console2.error : console2.log;
32126
+ const message = Array.isArray(message_) ? message_.slice() : [message_];
32127
+ let firstLine = color(`[${options.formatDate(date)}]`, colors.white) + ` ${color(logLevel.toUpperCase(), ...logLevelColors[logLevel])}` + ` (#${fiber2.id})`;
32128
+ const now = date.getTime();
32129
+ const spans = fiber2.getRef(CurrentLogSpans);
32130
+ for (const span of spans) {
32131
+ firstLine += " " + formatLogSpan(span, now);
32132
+ }
32133
+ firstLine += ":";
32134
+ let messageIndex = 0;
32135
+ if (message.length > 0) {
32136
+ const firstMaybeString = structuredMessage(message[0]);
32137
+ if (typeof firstMaybeString === "string") {
32138
+ firstLine += " " + color(firstMaybeString, colors.bold, colors.cyan);
32139
+ messageIndex++;
32140
+ }
32141
+ }
32142
+ log(firstLine);
32143
+ if (!processIsBun)
32144
+ console2.group();
32145
+ if (cause.reasons.length > 0) {
32146
+ log(causePretty(cause));
32147
+ }
32148
+ if (messageIndex < message.length) {
32149
+ for (;messageIndex < message.length; messageIndex++) {
32150
+ log(redact(message[messageIndex]));
32151
+ }
32152
+ }
32153
+ const annotations = fiber2.getRef(CurrentLogAnnotations);
32154
+ for (const [key, value] of Object.entries(annotations)) {
32155
+ log(color(`${key}:`, colors.bold, colors.white), redact(value));
32156
+ }
32157
+ if (!processIsBun)
32158
+ console2.groupEnd();
32159
+ });
32160
+ };
32161
+ var prettyLoggerBrowser = (options) => {
32162
+ const color = options.colors ? "%c" : "";
32163
+ return loggerMake(({
32164
+ cause,
32165
+ date,
32166
+ fiber: fiber2,
32167
+ logLevel,
32168
+ message: message_
32169
+ }) => {
32170
+ const console2 = fiber2.getRef(ConsoleRef);
32171
+ const message = Array.isArray(message_) ? message_.slice() : [message_];
32172
+ let firstLine = `${color}[${options.formatDate(date)}]`;
32173
+ const firstParams = [];
32174
+ if (options.colors) {
32175
+ firstParams.push("color:gray");
32176
+ }
32177
+ firstLine += ` ${color}${logLevel.toUpperCase()}${color} (#${fiber2.id})`;
32178
+ if (options.colors) {
32179
+ firstParams.push(logLevelStyle[logLevel], "");
32180
+ }
32181
+ const now = date.getTime();
32182
+ const spans = fiber2.getRef(CurrentLogSpans);
32183
+ for (const span of spans) {
32184
+ firstLine += " " + formatLogSpan(span, now);
32185
+ }
32186
+ firstLine += ":";
32187
+ let messageIndex = 0;
32188
+ if (message.length > 0) {
32189
+ const firstMaybeString = structuredMessage(message[0]);
32190
+ if (typeof firstMaybeString === "string") {
32191
+ firstLine += ` ${color}${firstMaybeString}`;
32192
+ if (options.colors) {
32193
+ firstParams.push("color:deepskyblue");
32194
+ }
32195
+ messageIndex++;
32196
+ }
32197
+ }
32198
+ console2.groupCollapsed(firstLine, ...firstParams);
32199
+ if (cause.reasons.length > 0) {
32200
+ console2.error(causePretty(cause));
32201
+ }
32202
+ if (messageIndex < message.length) {
32203
+ for (;messageIndex < message.length; messageIndex++) {
32204
+ console2.log(redact(message[messageIndex]));
32205
+ }
32206
+ }
32207
+ const annotations = fiber2.getRef(CurrentLogAnnotations);
32208
+ for (const [key, value] of Object.entries(annotations)) {
32209
+ const redacted = redact(value);
32210
+ if (options.colors) {
32211
+ console2.log(`%c${key}:`, "color:gray", redacted);
32212
+ } else {
32213
+ console2.log(`${key}:`, redacted);
32214
+ }
32215
+ }
32216
+ console2.groupEnd();
32217
+ });
32218
+ };
32076
32219
  var defaultLogger = /* @__PURE__ */ loggerMake(({
32077
32220
  cause,
32078
32221
  date,
@@ -37505,10 +37648,30 @@ var getUnsafe3 = /* @__PURE__ */ dual(2, (self, index) => {
37505
37648
  var size = (self) => self.length;
37506
37649
 
37507
37650
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Fiber.js
37651
+ var exports_Fiber = {};
37652
+ __export(exports_Fiber, {
37653
+ runIn: () => runIn,
37654
+ joinAll: () => joinAll,
37655
+ join: () => join2,
37656
+ isFiber: () => isFiber,
37657
+ interruptAs: () => interruptAs,
37658
+ interruptAllAs: () => interruptAllAs,
37659
+ interruptAll: () => interruptAll,
37660
+ interrupt: () => interrupt5,
37661
+ getCurrent: () => getCurrent,
37662
+ awaitAll: () => awaitAll,
37663
+ await: () => await_
37664
+ });
37508
37665
  var TypeId21 = `~effect/Fiber/${version}`;
37666
+ var await_ = fiberAwait;
37667
+ var awaitAll = fiberAwaitAll;
37509
37668
  var join2 = fiberJoin;
37510
37669
  var joinAll = fiberJoinAll;
37511
37670
  var interrupt5 = fiberInterrupt;
37671
+ var interruptAs = fiberInterruptAs;
37672
+ var interruptAll = fiberInterruptAll;
37673
+ var interruptAllAs = fiberInterruptAllAs;
37674
+ var isFiber = (u) => hasProperty(u, FiberTypeId);
37512
37675
  var getCurrent = getCurrentFiber;
37513
37676
  var runIn = fiberRunIn;
37514
37677
 
@@ -58923,6 +59086,92 @@ function date2(name) {
58923
59086
  return schema(DateValid, name);
58924
59087
  }
58925
59088
  var nested2 = /* @__PURE__ */ dual(2, (self, name) => make30((provider) => self.parse(nested(provider, name))));
59089
+ // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Ref.js
59090
+ var exports_Ref = {};
59091
+ __export(exports_Ref, {
59092
+ updateSomeAndGet: () => updateSomeAndGet,
59093
+ updateSome: () => updateSome,
59094
+ updateAndGet: () => updateAndGet,
59095
+ update: () => update2,
59096
+ setAndGet: () => setAndGet,
59097
+ set: () => set6,
59098
+ modifySome: () => modifySome,
59099
+ modify: () => modify3,
59100
+ makeUnsafe: () => makeUnsafe9,
59101
+ make: () => make31,
59102
+ getUnsafe: () => getUnsafe5,
59103
+ getAndUpdateSome: () => getAndUpdateSome,
59104
+ getAndUpdate: () => getAndUpdate,
59105
+ getAndSet: () => getAndSet,
59106
+ get: () => get9
59107
+ });
59108
+ var TypeId37 = "~effect/Ref";
59109
+ var RefProto = {
59110
+ [TypeId37]: {
59111
+ _A: identity
59112
+ },
59113
+ ...PipeInspectableProto,
59114
+ toJSON() {
59115
+ return {
59116
+ _id: "Ref",
59117
+ ref: this.ref
59118
+ };
59119
+ }
59120
+ };
59121
+ var makeUnsafe9 = (value3) => {
59122
+ const self = Object.create(RefProto);
59123
+ self.ref = make16(value3);
59124
+ return self;
59125
+ };
59126
+ var make31 = (value3) => sync3(() => makeUnsafe9(value3));
59127
+ var get9 = (self) => sync3(() => self.ref.current);
59128
+ var set6 = /* @__PURE__ */ dual(2, (self, value3) => sync3(() => set2(self.ref, value3)));
59129
+ var getAndSet = /* @__PURE__ */ dual(2, (self, value3) => sync3(() => {
59130
+ const current = self.ref.current;
59131
+ self.ref.current = value3;
59132
+ return current;
59133
+ }));
59134
+ var getAndUpdate = /* @__PURE__ */ dual(2, (self, f) => sync3(() => {
59135
+ const current = self.ref.current;
59136
+ self.ref.current = f(current);
59137
+ return current;
59138
+ }));
59139
+ var getAndUpdateSome = /* @__PURE__ */ dual(2, (self, pf) => sync3(() => {
59140
+ const current = self.ref.current;
59141
+ const option5 = pf(current);
59142
+ if (option5._tag === "Some") {
59143
+ self.ref.current = option5.value;
59144
+ }
59145
+ return current;
59146
+ }));
59147
+ var setAndGet = /* @__PURE__ */ dual(2, (self, value3) => sync3(() => self.ref.current = value3));
59148
+ var modify3 = /* @__PURE__ */ dual(2, (self, f) => sync3(() => {
59149
+ const [b, a] = f(self.ref.current);
59150
+ self.ref.current = a;
59151
+ return b;
59152
+ }));
59153
+ var modifySome = /* @__PURE__ */ dual(2, (self, pf) => modify3(self, (value3) => {
59154
+ const [b, option5] = pf(value3);
59155
+ return [b, option5._tag === "None" ? value3 : option5.value];
59156
+ }));
59157
+ var update2 = /* @__PURE__ */ dual(2, (self, f) => sync3(() => {
59158
+ self.ref.current = f(self.ref.current);
59159
+ }));
59160
+ var updateAndGet = /* @__PURE__ */ dual(2, (self, f) => sync3(() => self.ref.current = f(self.ref.current)));
59161
+ var updateSome = /* @__PURE__ */ dual(2, (self, f) => sync3(() => {
59162
+ const option5 = f(self.ref.current);
59163
+ if (option5._tag === "Some") {
59164
+ self.ref.current = option5.value;
59165
+ }
59166
+ }));
59167
+ var updateSomeAndGet = /* @__PURE__ */ dual(2, (self, pf) => sync3(() => {
59168
+ const option5 = pf(self.ref.current);
59169
+ if (option5._tag === "Some") {
59170
+ self.ref.current = option5.value;
59171
+ }
59172
+ return self.ref.current;
59173
+ }));
59174
+ var getUnsafe5 = (self) => self.ref.current;
58926
59175
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Console.js
58927
59176
  var Console2 = ConsoleRef;
58928
59177
  var consoleWith = (f) => withFiber((fiber3) => f(fiber3.getRef(Console2)));
@@ -58934,34 +59183,34 @@ var log2 = (...args2) => consoleWith((console2) => sync(() => {
58934
59183
  }));
58935
59184
 
58936
59185
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Stdio.js
58937
- var TypeId37 = "~effect/Stdio";
58938
- var Stdio2 = /* @__PURE__ */ Service(TypeId37);
58939
- var make31 = (options) => ({
58940
- [TypeId37]: TypeId37,
59186
+ var TypeId38 = "~effect/Stdio";
59187
+ var Stdio2 = /* @__PURE__ */ Service(TypeId38);
59188
+ var make32 = (options) => ({
59189
+ [TypeId38]: TypeId38,
58941
59190
  ...options
58942
59191
  });
58943
59192
 
58944
59193
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Terminal.js
58945
- var TypeId38 = "~effect/platform/Terminal";
59194
+ var TypeId39 = "~effect/platform/Terminal";
58946
59195
  var QuitErrorTypeId = "effect/platform/Terminal/QuitError";
58947
59196
  var isQuitError = (u) => hasProperty(u, QuitErrorTypeId);
58948
59197
  var Terminal2 = /* @__PURE__ */ Service("effect/platform/Terminal");
58949
- var make32 = (impl) => Terminal2.of({
59198
+ var make33 = (impl) => Terminal2.of({
58950
59199
  ...impl,
58951
- [TypeId38]: TypeId38
59200
+ [TypeId39]: TypeId39
58952
59201
  });
58953
59202
 
58954
59203
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/cli/CliError.js
58955
- var TypeId39 = "~effect/cli/CliError";
58956
- var isCliError = (u) => hasProperty(u, TypeId39);
59204
+ var TypeId40 = "~effect/cli/CliError";
59205
+ var isCliError = (u) => hasProperty(u, TypeId40);
58957
59206
 
58958
- class UnrecognizedOption extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/UnrecognizedOption`)({
59207
+ class UnrecognizedOption extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/UnrecognizedOption`)({
58959
59208
  _tag: /* @__PURE__ */ tag("UnrecognizedOption"),
58960
59209
  option: String5,
58961
59210
  command: /* @__PURE__ */ optional(/* @__PURE__ */ Array4(String5)),
58962
59211
  suggestions: /* @__PURE__ */ Array4(String5)
58963
59212
  })) {
58964
- [TypeId39] = TypeId39;
59213
+ [TypeId40] = TypeId40;
58965
59214
  get message() {
58966
59215
  const suggestionText = this.suggestions.length > 0 ? `
58967
59216
 
@@ -58973,46 +59222,46 @@ class UnrecognizedOption extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/Unreco
58973
59222
  }
58974
59223
  }
58975
59224
 
58976
- class DuplicateOption extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/DuplicateOption`)({
59225
+ class DuplicateOption extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/DuplicateOption`)({
58977
59226
  _tag: /* @__PURE__ */ tag("DuplicateOption"),
58978
59227
  option: String5,
58979
59228
  parentCommand: String5,
58980
59229
  childCommand: String5
58981
59230
  })) {
58982
- [TypeId39] = TypeId39;
59231
+ [TypeId40] = TypeId40;
58983
59232
  get message() {
58984
59233
  return `Duplicate flag name "${this.option}" in parent command "${this.parentCommand}" and subcommand "${this.childCommand}". ` + `Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.`;
58985
59234
  }
58986
59235
  }
58987
59236
 
58988
- class MissingOption extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/MissingOption`)({
59237
+ class MissingOption extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/MissingOption`)({
58989
59238
  _tag: /* @__PURE__ */ tag("MissingOption"),
58990
59239
  option: String5
58991
59240
  })) {
58992
- [TypeId39] = TypeId39;
59241
+ [TypeId40] = TypeId40;
58993
59242
  get message() {
58994
59243
  return `Missing required flag: --${this.option}`;
58995
59244
  }
58996
59245
  }
58997
59246
 
58998
- class MissingArgument extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/MissingArgument`)({
59247
+ class MissingArgument extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/MissingArgument`)({
58999
59248
  _tag: /* @__PURE__ */ tag("MissingArgument"),
59000
59249
  argument: String5
59001
59250
  })) {
59002
- [TypeId39] = TypeId39;
59251
+ [TypeId40] = TypeId40;
59003
59252
  get message() {
59004
59253
  return `Missing required argument: ${this.argument}`;
59005
59254
  }
59006
59255
  }
59007
59256
 
59008
- class InvalidValue2 extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/InvalidValue`)({
59257
+ class InvalidValue2 extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/InvalidValue`)({
59009
59258
  _tag: /* @__PURE__ */ tag("InvalidValue"),
59010
59259
  option: String5,
59011
59260
  value: String5,
59012
59261
  expected: String5,
59013
59262
  kind: /* @__PURE__ */ Union2([/* @__PURE__ */ Literal2("flag"), /* @__PURE__ */ Literal2("argument")])
59014
59263
  })) {
59015
- [TypeId39] = TypeId39;
59264
+ [TypeId40] = TypeId40;
59016
59265
  get message() {
59017
59266
  if (this.kind === "argument") {
59018
59267
  return `Invalid value for argument <${this.option}>: "${this.value}". Expected: ${this.expected}`;
@@ -59021,13 +59270,13 @@ class InvalidValue2 extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/InvalidValu
59021
59270
  }
59022
59271
  }
59023
59272
 
59024
- class UnknownSubcommand extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/UnknownSubcommand`)({
59273
+ class UnknownSubcommand extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/UnknownSubcommand`)({
59025
59274
  _tag: /* @__PURE__ */ tag("UnknownSubcommand"),
59026
59275
  subcommand: String5,
59027
59276
  parent: /* @__PURE__ */ optional(/* @__PURE__ */ Array4(String5)),
59028
59277
  suggestions: /* @__PURE__ */ Array4(String5)
59029
59278
  })) {
59030
- [TypeId39] = TypeId39;
59279
+ [TypeId40] = TypeId40;
59031
59280
  get message() {
59032
59281
  const suggestionText = this.suggestions.length > 0 ? `
59033
59282
 
@@ -59038,20 +59287,20 @@ class UnknownSubcommand extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/Unknown
59038
59287
  }
59039
59288
  }
59040
59289
 
59041
- class UserError extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/UserError`)({
59290
+ class UserError extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/UserError`)({
59042
59291
  _tag: /* @__PURE__ */ tag("UserError"),
59043
59292
  cause: Defect
59044
59293
  })) {
59045
- [TypeId39] = TypeId39;
59294
+ [TypeId40] = TypeId40;
59046
59295
  }
59047
59296
  var NonShowHelpErrors = /* @__PURE__ */ Union2([UnrecognizedOption, DuplicateOption, MissingOption, MissingArgument, InvalidValue2, UnknownSubcommand, UserError]);
59048
59297
 
59049
- class ShowHelp extends (/* @__PURE__ */ ErrorClass(`${TypeId39}/ShowHelp`)({
59298
+ class ShowHelp extends (/* @__PURE__ */ ErrorClass(`${TypeId40}/ShowHelp`)({
59050
59299
  _tag: /* @__PURE__ */ tag("ShowHelp"),
59051
59300
  commandPath: /* @__PURE__ */ Array4(String5),
59052
59301
  errors: /* @__PURE__ */ Array4(NonShowHelpErrors)
59053
59302
  })) {
59054
- [TypeId39] = TypeId39;
59303
+ [TypeId40] = TypeId40;
59055
59304
  [errorExitCode] = this.errors.length ? 1 : 0;
59056
59305
  [errorReported] = false;
59057
59306
  get message() {
@@ -59819,9 +60068,9 @@ var $visit = visit.visit;
59819
60068
  var $visitAsync = visit.visitAsync;
59820
60069
 
59821
60070
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/cli/Primitive.js
59822
- var TypeId40 = "~effect/cli/Primitive";
60071
+ var TypeId41 = "~effect/cli/Primitive";
59823
60072
  var Proto7 = {
59824
- [TypeId40]: {
60073
+ [TypeId41]: {
59825
60074
  _A: identity
59826
60075
  }
59827
60076
  };
@@ -59888,18 +60137,18 @@ var getTypeName = (primitive) => {
59888
60137
  var getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choiceKeys : undefined;
59889
60138
 
59890
60139
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/cli/Param.js
59891
- var TypeId41 = "~effect/cli/Param";
60140
+ var TypeId42 = "~effect/cli/Param";
59892
60141
  var argumentKind = "argument";
59893
60142
  var flagKind = "flag";
59894
60143
  var Proto8 = {
59895
- [TypeId41]: {
60144
+ [TypeId42]: {
59896
60145
  _A: identity
59897
60146
  },
59898
60147
  pipe() {
59899
60148
  return pipeArguments(this, arguments);
59900
60149
  }
59901
60150
  };
59902
- var isParam = (u) => hasProperty(u, TypeId41);
60151
+ var isParam = (u) => hasProperty(u, TypeId42);
59903
60152
  var isFlagParam = (single) => single.kind === "flag";
59904
60153
  var makeSingle = (params) => {
59905
60154
  const parse3 = (args2) => params.kind === argumentKind ? parsePositional(params.name, params.primitiveType, args2) : parseFlag(params.name, params.primitiveType, args2);
@@ -60252,7 +60501,7 @@ var reconstructTree = (tree, results) => {
60252
60501
  };
60253
60502
 
60254
60503
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/cli/internal/command.js
60255
- var TypeId42 = "~effect/cli/Command";
60504
+ var TypeId43 = "~effect/cli/Command";
60256
60505
  var toImpl = (self) => self;
60257
60506
  var Proto9 = {
60258
60507
  ...YieldableProto,
@@ -60266,7 +60515,7 @@ var Proto9 = {
60266
60515
  var makeCommand = (options) => {
60267
60516
  const config = options.config;
60268
60517
  const contextConfig = options.contextConfig ?? emptyConfig;
60269
- const service3 = options.service ?? Service(`${TypeId42}/${options.name}`);
60518
+ const service3 = options.service ?? Service(`${TypeId43}/${options.name}`);
60270
60519
  const annotations2 = options.annotations ?? empty3();
60271
60520
  const globalFlags = options.globalFlags ?? [];
60272
60521
  const subcommands = options.subcommands ?? [];
@@ -60337,7 +60586,7 @@ var makeCommand = (options) => {
60337
60586
  };
60338
60587
  };
60339
60588
  return Object.assign(Object.create(Proto9), {
60340
- [TypeId42]: TypeId42,
60589
+ [TypeId43]: TypeId43,
60341
60590
  name: options.name,
60342
60591
  examples: options.examples ?? [],
60343
60592
  annotations: annotations2,
@@ -61074,8 +61323,8 @@ var scanCommandLevel = (tokens, context2) => {
61074
61323
  };
61075
61324
 
61076
61325
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/cli/Command.js
61077
- var isCommand = (u) => hasProperty(u, TypeId42);
61078
- var make33 = (name, config, handler) => {
61326
+ var isCommand = (u) => hasProperty(u, TypeId43);
61327
+ var make34 = (name, config, handler) => {
61079
61328
  const parsedConfig = parseConfig(config ?? {});
61080
61329
  return makeCommand({
61081
61330
  name,
@@ -61331,7 +61580,7 @@ var HandleProto = {
61331
61580
  }
61332
61581
  };
61333
61582
  var makeHandle = (params) => Object.assign(Object.create(HandleProto), params);
61334
- var make34 = (spawn) => {
61583
+ var make35 = (spawn) => {
61335
61584
  const streamString = (command, options) => spawn(command).pipe(map8((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap4);
61336
61585
  const streamLines = (command, options) => splitLines2(streamString(command, options));
61337
61586
  return ChildProcessSpawner.of({
@@ -61348,11 +61597,11 @@ class ChildProcessSpawner extends (/* @__PURE__ */ Service()("effect/process/Chi
61348
61597
  }
61349
61598
 
61350
61599
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/process/ChildProcess.js
61351
- var TypeId43 = "~effect/unstable/process/ChildProcess";
61600
+ var TypeId44 = "~effect/unstable/process/ChildProcess";
61352
61601
  var Proto10 = {
61353
61602
  ...PipeInspectableProto,
61354
61603
  ...YieldableProto,
61355
- [TypeId43]: TypeId43,
61604
+ [TypeId44]: TypeId44,
61356
61605
  asEffect() {
61357
61606
  return ChildProcessSpawner.use((_) => _.spawn(this));
61358
61607
  }
@@ -61363,7 +61612,7 @@ var makeStandardCommand = (command, args2, options) => Object.assign(Object.crea
61363
61612
  args: args2,
61364
61613
  options
61365
61614
  });
61366
- var make35 = function make36(...args2) {
61615
+ var make36 = function make37(...args2) {
61367
61616
  if (isTemplateString(args2[0])) {
61368
61617
  const [templates, ...expressions] = args2;
61369
61618
  const tokens = parseTemplates(templates, expressions);
@@ -61623,7 +61872,7 @@ var toPlatformError = (method, error2, command) => {
61623
61872
  }, "");
61624
61873
  return handleErrnoException("ChildProcess", method)(error2, [commandStr]);
61625
61874
  };
61626
- var make37 = /* @__PURE__ */ gen3(function* () {
61875
+ var make38 = /* @__PURE__ */ gen3(function* () {
61627
61876
  const fs = yield* FileSystem;
61628
61877
  const path3 = yield* Path;
61629
61878
  const resolveWorkingDirectory = fnUntraced2(function* (options) {
@@ -61955,7 +62204,7 @@ var make37 = /* @__PURE__ */ gen3(function* () {
61955
62204
  const sourceStream = unwrap4(map8(handle, (h2) => getSourceStream(h2, options.from)));
61956
62205
  const toOption2 = options.to ?? "stdin";
61957
62206
  if (toOption2 === "stdin") {
61958
- handle = spawnCommand(make35(command.command, command.args, {
62207
+ handle = spawnCommand(make36(command.command, command.args, {
61959
62208
  ...command.options,
61960
62209
  stdin: {
61961
62210
  ...stdinConfig,
@@ -61967,7 +62216,7 @@ var make37 = /* @__PURE__ */ gen3(function* () {
61967
62216
  if (isNotUndefined(fd)) {
61968
62217
  const fdName2 = fdName(fd);
61969
62218
  const existingFds = command.options.additionalFds ?? {};
61970
- handle = spawnCommand(make35(command.command, command.args, {
62219
+ handle = spawnCommand(make36(command.command, command.args, {
61971
62220
  ...command.options,
61972
62221
  additionalFds: {
61973
62222
  ...existingFds,
@@ -61978,7 +62227,7 @@ var make37 = /* @__PURE__ */ gen3(function* () {
61978
62227
  }
61979
62228
  }));
61980
62229
  } else {
61981
- handle = spawnCommand(make35(command.command, command.args, {
62230
+ handle = spawnCommand(make36(command.command, command.args, {
61982
62231
  ...command.options,
61983
62232
  stdin: {
61984
62233
  ...stdinConfig,
@@ -61992,9 +62241,9 @@ var make37 = /* @__PURE__ */ gen3(function* () {
61992
62241
  }
61993
62242
  }
61994
62243
  });
61995
- return make34(spawnCommand);
62244
+ return make35(spawnCommand);
61996
62245
  });
61997
- var layer = /* @__PURE__ */ effect(ChildProcessSpawner, make37);
62246
+ var layer = /* @__PURE__ */ effect(ChildProcessSpawner, make38);
61998
62247
  var flattenCommand = (command) => {
61999
62248
  const commands2 = [];
62000
62249
  const pipeOptions = [];
@@ -62446,7 +62695,7 @@ var layer4 = /* @__PURE__ */ succeed5(Path)({
62446
62695
  var layer5 = layer4;
62447
62696
 
62448
62697
  // ../../node_modules/.bun/@effect+platform-node-shared@4.0.0-beta.33+af2afa6dfab141e3/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
62449
- var layer6 = /* @__PURE__ */ succeed5(Stdio2, /* @__PURE__ */ make31({
62698
+ var layer6 = /* @__PURE__ */ succeed5(Stdio2, /* @__PURE__ */ make32({
62450
62699
  args: /* @__PURE__ */ sync3(() => process.argv.slice(2)),
62451
62700
  stdout: (options) => fromWritable({
62452
62701
  evaluate: () => process.stdout,
@@ -62485,7 +62734,7 @@ var layer7 = layer6;
62485
62734
 
62486
62735
  // ../../node_modules/.bun/@effect+platform-node-shared@4.0.0-beta.33+af2afa6dfab141e3/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
62487
62736
  import * as readline from "readline";
62488
- var make38 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
62737
+ var make39 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
62489
62738
  const stdin = process.stdin;
62490
62739
  const stdout = process.stdout;
62491
62740
  const rlRef = yield* make21({
@@ -62542,14 +62791,14 @@ var make38 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
62542
62791
  cause: err
62543
62792
  }))));
62544
62793
  }));
62545
- return make32({
62794
+ return make33({
62546
62795
  columns,
62547
62796
  readInput,
62548
62797
  readLine,
62549
62798
  display
62550
62799
  });
62551
62800
  });
62552
- var layer8 = /* @__PURE__ */ effect(Terminal2, /* @__PURE__ */ make38(defaultShouldQuit));
62801
+ var layer8 = /* @__PURE__ */ effect(Terminal2, /* @__PURE__ */ make39(defaultShouldQuit));
62553
62802
  function defaultShouldQuit(input) {
62554
62803
  return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
62555
62804
  }
@@ -62561,10 +62810,11 @@ var layer9 = layer8;
62561
62810
  var layer10 = /* @__PURE__ */ layer.pipe(/* @__PURE__ */ provideMerge(/* @__PURE__ */ mergeAll2(layer3, layer5, layer7, layer9)));
62562
62811
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Logger.js
62563
62812
  var CurrentLoggers2 = CurrentLoggers;
62813
+ var LogToStderr2 = LogToStderr;
62564
62814
  var map17 = /* @__PURE__ */ dual(2, (self, f) => loggerMake((options) => f(self.log(options))));
62565
- var withConsoleLog = (self) => loggerMake((options) => {
62815
+ var withConsoleError = (self) => loggerMake((options) => {
62566
62816
  const console2 = options.fiber.getRef(ConsoleRef);
62567
- return console2.log(self.log(options));
62817
+ return console2.error(self.log(options));
62568
62818
  });
62569
62819
  var formatFiberId = (fiberId3) => `#${fiberId3}`;
62570
62820
  var formatStructured = /* @__PURE__ */ loggerMake(({
@@ -62597,7 +62847,7 @@ var formatStructured = /* @__PURE__ */ loggerMake(({
62597
62847
  };
62598
62848
  });
62599
62849
  var formatJson2 = /* @__PURE__ */ map17(formatStructured, formatJson);
62600
- var consoleJson = /* @__PURE__ */ withConsoleLog(formatJson2);
62850
+ var consolePretty2 = consolePretty;
62601
62851
  var layer11 = (loggers, options) => effect(CurrentLoggers2, withFiber(fnUntraced(function* (fiber3) {
62602
62852
  const currentLoggers = new Set(options?.mergeWithExisting === true ? fiber3.getRef(CurrentLoggers) : []);
62603
62853
  for (const logger of loggers) {
@@ -62606,9 +62856,6 @@ var layer11 = (loggers, options) => effect(CurrentLoggers2, withFiber(fnUntraced
62606
62856
  return currentLoggers;
62607
62857
  })));
62608
62858
 
62609
- // ../../packages/core/src/BaseRuntimeLayer.ts
62610
- var BaseRuntimeLayer = exports_Layer.mergeAll(exports_BunServices.layer, layer11([consoleJson]));
62611
-
62612
62859
  // ../../packages/core/src/Logging.ts
62613
62860
  var REDACTED = "<redacted>";
62614
62861
  var DEFAULT_PREVIEW_LENGTH = 400;
@@ -62653,15 +62900,23 @@ var truncateForLog = (value3, maxLength = DEFAULT_PREVIEW_LENGTH) => {
62653
62900
  }
62654
62901
  return `${value3.slice(0, maxLength)}... [truncated ${value3.length - maxLength} chars]`;
62655
62902
  };
62903
+ var makeRuntimeLogger = (jsonLogs) => jsonLogs ? withConsoleError(formatJson2) : consolePretty2({ colors: true, mode: "tty" });
62656
62904
  var withSanitizedAnnotations = (effect2, fields) => {
62657
62905
  if (!fields || Object.keys(fields).length === 0) {
62658
62906
  return effect2;
62659
62907
  }
62660
62908
  return effect2.pipe(exports_Effect.annotateLogs(sanitizeForLog(fields)));
62661
62909
  };
62662
- var withLogAnnotations = (fields) => (effect2) => withSanitizedAnnotations(effect2, fields);
62663
62910
  var logInfo2 = (message, fields) => withSanitizedAnnotations(exports_Effect.logInfo(message), fields);
62664
62911
  var logError2 = (message, fields) => withSanitizedAnnotations(exports_Effect.logError(message), fields);
62912
+ var logWarning2 = (message, fields) => withSanitizedAnnotations(exports_Effect.logWarning(message), fields);
62913
+ var logDebug2 = (message, fields) => withSanitizedAnnotations(exports_Effect.logDebug(message), fields);
62914
+
62915
+ // ../../packages/core/src/BaseRuntimeLayer.ts
62916
+ var makeBaseRuntimeLayer = ({ jsonLogs }) => exports_Layer.mergeAll(exports_BunServices.layer, layer11([makeRuntimeLogger(jsonLogs)]), exports_Layer.succeed(LogToStderr2)(true));
62917
+ var BaseRuntimeLayer = makeBaseRuntimeLayer({
62918
+ jsonLogs: false
62919
+ });
62665
62920
 
62666
62921
  // ../../node_modules/.bun/jsonrepair@3.13.3/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js
62667
62922
  class JSONRepairError extends Error {
@@ -63362,11 +63617,11 @@ __export(exports_FetchHttpClient, {
63362
63617
  });
63363
63618
 
63364
63619
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/http/Headers.js
63365
- var TypeId44 = /* @__PURE__ */ Symbol.for("~effect/http/Headers");
63620
+ var TypeId45 = /* @__PURE__ */ Symbol.for("~effect/http/Headers");
63366
63621
  var Proto11 = /* @__PURE__ */ Object.create(null);
63367
63622
  Object.defineProperties(Proto11, {
63368
- [TypeId44]: {
63369
- value: TypeId44
63623
+ [TypeId45]: {
63624
+ value: TypeId45
63370
63625
  },
63371
63626
  [symbolRedactable]: {
63372
63627
  value(context2) {
@@ -63395,7 +63650,7 @@ Object.defineProperties(Proto11, {
63395
63650
  value: BaseProto[NodeInspectSymbol]
63396
63651
  }
63397
63652
  });
63398
- var make39 = (input) => Object.assign(Object.create(Proto11), input);
63653
+ var make40 = (input) => Object.assign(Object.create(Proto11), input);
63399
63654
  var Equivalence6 = /* @__PURE__ */ makeEquivalence4(/* @__PURE__ */ strictEqual());
63400
63655
  var empty12 = /* @__PURE__ */ Object.create(Proto11);
63401
63656
  var fromInput2 = (input) => {
@@ -63419,22 +63674,22 @@ var fromInput2 = (input) => {
63419
63674
  return out;
63420
63675
  };
63421
63676
  var fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto11);
63422
- var set6 = /* @__PURE__ */ dual(3, (self, key, value3) => {
63423
- const out = make39(self);
63677
+ var set7 = /* @__PURE__ */ dual(3, (self, key, value3) => {
63678
+ const out = make40(self);
63424
63679
  out[key.toLowerCase()] = value3;
63425
63680
  return out;
63426
63681
  });
63427
- var setAll = /* @__PURE__ */ dual(2, (self, headers) => make39({
63682
+ var setAll = /* @__PURE__ */ dual(2, (self, headers) => make40({
63428
63683
  ...self,
63429
63684
  ...fromInput2(headers)
63430
63685
  }));
63431
63686
  var merge6 = /* @__PURE__ */ dual(2, (self, headers) => {
63432
- const out = make39(self);
63687
+ const out = make40(self);
63433
63688
  Object.assign(out, headers);
63434
63689
  return out;
63435
63690
  });
63436
63691
  var remove7 = /* @__PURE__ */ dual(2, (self, key) => {
63437
- const out = make39(self);
63692
+ const out = make40(self);
63438
63693
  delete out[key.toLowerCase()];
63439
63694
  return out;
63440
63695
  });
@@ -63442,7 +63697,7 @@ var redact4 = /* @__PURE__ */ dual(2, (self, key) => {
63442
63697
  const out = {
63443
63698
  ...self
63444
63699
  };
63445
- const modify3 = (key2) => {
63700
+ const modify4 = (key2) => {
63446
63701
  if (typeof key2 === "string") {
63447
63702
  const k = key2.toLowerCase();
63448
63703
  if (k in self) {
@@ -63458,10 +63713,10 @@ var redact4 = /* @__PURE__ */ dual(2, (self, key) => {
63458
63713
  };
63459
63714
  if (Array.isArray(key)) {
63460
63715
  for (let i = 0;i < key.length; i++) {
63461
- modify3(key[i]);
63716
+ modify4(key[i]);
63462
63717
  }
63463
63718
  } else {
63464
- modify3(key);
63719
+ modify4(key);
63465
63720
  }
63466
63721
  return out;
63467
63722
  });
@@ -63491,7 +63746,7 @@ __export(exports_HttpClient, {
63491
63746
  mapRequestEffect: () => mapRequestEffect,
63492
63747
  mapRequest: () => mapRequest,
63493
63748
  makeWith: () => makeWith2,
63494
- make: () => make42,
63749
+ make: () => make43,
63495
63750
  layerMergedServices: () => layerMergedServices,
63496
63751
  isHttpClient: () => isHttpClient,
63497
63752
  head: () => head2,
@@ -63512,25 +63767,6 @@ __export(exports_HttpClient, {
63512
63767
  HttpClient: () => HttpClient
63513
63768
  });
63514
63769
 
63515
- // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/Ref.js
63516
- var TypeId45 = "~effect/Ref";
63517
- var RefProto = {
63518
- [TypeId45]: {
63519
- _A: identity
63520
- },
63521
- ...PipeInspectableProto,
63522
- toJSON() {
63523
- return {
63524
- _id: "Ref",
63525
- ref: this.ref
63526
- };
63527
- }
63528
- };
63529
- var get9 = (self) => sync3(() => self.ref.current);
63530
- var update2 = /* @__PURE__ */ dual(2, (self, f) => sync3(() => {
63531
- self.ref.current = f(self.ref.current);
63532
- }));
63533
-
63534
63770
  // ../../node_modules/.bun/effect@4.0.0-beta.33/node_modules/effect/dist/unstable/http/Cookies.js
63535
63771
  var TypeId46 = "~effect/http/Cookies";
63536
63772
  var CookieTypeId = "~effect/http/Cookies/Cookie";
@@ -63853,9 +64089,9 @@ __export(exports_HttpClientRequest, {
63853
64089
  post: () => post,
63854
64090
  patch: () => patch,
63855
64091
  options: () => options,
63856
- modify: () => modify3,
64092
+ modify: () => modify4,
63857
64093
  makeWith: () => makeWith,
63858
- make: () => make41,
64094
+ make: () => make42,
63859
64095
  isHttpClientRequest: () => isHttpClientRequest,
63860
64096
  head: () => head,
63861
64097
  get: () => get10,
@@ -63901,7 +64137,7 @@ var Proto13 = {
63901
64137
  return array(this.params.flat());
63902
64138
  }
63903
64139
  };
63904
- var make40 = (params) => {
64140
+ var make41 = (params) => {
63905
64141
  const self = Object.create(Proto13);
63906
64142
  self.params = params;
63907
64143
  return self;
@@ -63917,7 +64153,7 @@ var fromInput3 = (input) => {
63917
64153
  out.push(parsed[i]);
63918
64154
  }
63919
64155
  }
63920
- return make40(out);
64156
+ return make41(out);
63921
64157
  };
63922
64158
  var fromInputNested = (input) => {
63923
64159
  const entries3 = typeof input[Symbol.iterator] === "function" ? fromIterable2(input) : Object.entries(input);
@@ -63955,13 +64191,13 @@ var UrlParamsSchema = /* @__PURE__ */ declare(isUrlParams, {
63955
64191
  expected: "UrlParams",
63956
64192
  toEquivalence: () => Equivalence7,
63957
64193
  toCodec: () => link()(Array4(Tuple2([String5, String5])), transform2({
63958
- decode: make40,
64194
+ decode: make41,
63959
64195
  encode: (self) => self.params
63960
64196
  }))
63961
64197
  });
63962
- var empty13 = /* @__PURE__ */ make40([]);
63963
- var set8 = /* @__PURE__ */ dual(3, (self, key, value3) => make40(append(filter4(self.params, ([k]) => k !== key), [key, String(value3)])));
63964
- var transform4 = /* @__PURE__ */ dual(2, (self, f) => make40(f(self.params)));
64198
+ var empty13 = /* @__PURE__ */ make41([]);
64199
+ var set9 = /* @__PURE__ */ dual(3, (self, key, value3) => make41(append(filter4(self.params, ([k]) => k !== key), [key, String(value3)])));
64200
+ var transform4 = /* @__PURE__ */ dual(2, (self, f) => make41(f(self.params)));
63965
64201
  var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
63966
64202
  const out = fromInput3(input);
63967
64203
  const params = out.params;
@@ -63976,7 +64212,7 @@ var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
63976
64212
  }
63977
64213
  return out;
63978
64214
  });
63979
- var append3 = /* @__PURE__ */ dual(3, (self, key, value3) => make40(append(self.params, [key, String(value3)])));
64215
+ var append3 = /* @__PURE__ */ dual(3, (self, key, value3) => make41(append(self.params, [key, String(value3)])));
63980
64216
  var appendAll3 = /* @__PURE__ */ dual(2, (self, input) => transform4(self, appendAll(fromInput3(input).params)));
63981
64217
  class UrlParamsError extends (/* @__PURE__ */ TaggedError2("UrlParamsError")) {
63982
64218
  }
@@ -64203,20 +64439,20 @@ function makeWith(method, url2, urlParams2, hash3, headers, body) {
64203
64439
  return self;
64204
64440
  }
64205
64441
  var empty15 = /* @__PURE__ */ makeWith("GET", "", empty13, /* @__PURE__ */ none2(), empty12, empty14);
64206
- var make41 = (method) => (url2, options) => modify3(empty15, {
64442
+ var make42 = (method) => (url2, options) => modify4(empty15, {
64207
64443
  method,
64208
64444
  url: url2,
64209
64445
  ...options ?? undefined
64210
64446
  });
64211
- var get10 = /* @__PURE__ */ make41("GET");
64212
- var post = /* @__PURE__ */ make41("POST");
64213
- var patch = /* @__PURE__ */ make41("PATCH");
64214
- var put = /* @__PURE__ */ make41("PUT");
64215
- var del = /* @__PURE__ */ make41("DELETE");
64216
- var head = /* @__PURE__ */ make41("HEAD");
64217
- var options = /* @__PURE__ */ make41("OPTIONS");
64218
- var trace = /* @__PURE__ */ make41("TRACE");
64219
- var modify3 = /* @__PURE__ */ dual(2, (self, options2) => {
64447
+ var get10 = /* @__PURE__ */ make42("GET");
64448
+ var post = /* @__PURE__ */ make42("POST");
64449
+ var patch = /* @__PURE__ */ make42("PATCH");
64450
+ var put = /* @__PURE__ */ make42("PUT");
64451
+ var del = /* @__PURE__ */ make42("DELETE");
64452
+ var head = /* @__PURE__ */ make42("HEAD");
64453
+ var options = /* @__PURE__ */ make42("OPTIONS");
64454
+ var trace = /* @__PURE__ */ make42("TRACE");
64455
+ var modify4 = /* @__PURE__ */ dual(2, (self, options2) => {
64220
64456
  let result4 = self;
64221
64457
  if (options2.method) {
64222
64458
  result4 = setMethod(result4, options2.method);
@@ -64245,7 +64481,7 @@ var modify3 = /* @__PURE__ */ dual(2, (self, options2) => {
64245
64481
  return result4;
64246
64482
  });
64247
64483
  var setMethod = /* @__PURE__ */ dual(2, (self, method) => makeWith(method, self.url, self.urlParams, self.hash, self.headers, self.body));
64248
- var setHeader = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, self.urlParams, self.hash, set6(self.headers, key, value3), self.body));
64484
+ var setHeader = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, self.urlParams, self.hash, set7(self.headers, key, value3), self.body));
64249
64485
  var setHeaders = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, self.urlParams, self.hash, setAll(self.headers, input), self.body));
64250
64486
  var basicAuth = /* @__PURE__ */ dual(3, (self, username, password) => setHeader(self, "Authorization", `Basic ${btoa(`${stringOrRedacted(username)}:${stringOrRedacted(password)}`)}`));
64251
64487
  var bearerToken = /* @__PURE__ */ dual(2, (self, token) => setHeader(self, "Authorization", `Bearer ${stringOrRedacted(token)}`));
@@ -64280,7 +64516,7 @@ var joinSegments = (first, second) => {
64280
64516
  return needsTrim ? first + second.slice(1) : needsSlash ? first + "/" + second : first + second;
64281
64517
  };
64282
64518
  var updateUrl = /* @__PURE__ */ dual(2, (self, f) => makeWith(self.method, f(self.url), self.urlParams, self.hash, self.headers, self.body));
64283
- var setUrlParam = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, set8(self.urlParams, key, value3), self.hash, self.headers, self.body));
64519
+ var setUrlParam = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, set9(self.urlParams, key, value3), self.hash, self.headers, self.body));
64284
64520
  var setUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, setAll2(self.urlParams, input), self.hash, self.headers, self.body));
64285
64521
  var appendUrlParam = /* @__PURE__ */ dual(3, (self, key, value3) => makeWith(self.method, self.url, append3(self.urlParams, key, value3), self.hash, self.headers, self.body));
64286
64522
  var appendUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeWith(self.method, self.url, appendAll3(self.urlParams, input), self.hash, self.headers, self.body));
@@ -64292,10 +64528,10 @@ var setBody = /* @__PURE__ */ dual(2, (self, body) => {
64292
64528
  headers = remove7(remove7(headers, "Content-Type"), "Content-length");
64293
64529
  } else {
64294
64530
  if (body.contentType) {
64295
- headers = set6(headers, "content-type", body.contentType);
64531
+ headers = set7(headers, "content-type", body.contentType);
64296
64532
  }
64297
64533
  if (body.contentLength !== undefined) {
64298
- headers = set6(headers, "content-length", body.contentLength.toString());
64534
+ headers = set7(headers, "content-length", body.contentLength.toString());
64299
64535
  }
64300
64536
  }
64301
64537
  return makeWith(self.method, self.url, self.urlParams, self.hash, headers, body);
@@ -64607,10 +64843,10 @@ var Proto16 = {
64607
64843
  };
64608
64844
  },
64609
64845
  .../* @__PURE__ */ Object.fromEntries(/* @__PURE__ */ allShort.map(([fullMethod, method]) => [method, function(url2, options3) {
64610
- return this.execute(make41(fullMethod)(url2, options3));
64846
+ return this.execute(make42(fullMethod)(url2, options3));
64611
64847
  }]))
64612
64848
  };
64613
- var make42 = (f) => makeWith2((effect2) => flatMap5(effect2, (request3) => withFiber2((fiber3) => {
64849
+ var make43 = (f) => makeWith2((effect2) => flatMap5(effect2, (request3) => withFiber2((fiber3) => {
64614
64850
  const scopedController = scopedRequests.get(request3);
64615
64851
  const controller = scopedController ?? new AbortController;
64616
64852
  const urlResult = makeUrl(request3.url, request3.urlParams, getOrUndefined(request3.hash));
@@ -65002,7 +65238,7 @@ var Fetch = /* @__PURE__ */ Reference("effect/http/FetchHttpClient/Fetch", {
65002
65238
 
65003
65239
  class RequestInit extends (/* @__PURE__ */ Service()("effect/http/FetchHttpClient/RequestInit")) {
65004
65240
  }
65005
- var fetch2 = /* @__PURE__ */ make42((request3, url2, signal, fiber3) => {
65241
+ var fetch2 = /* @__PURE__ */ make43((request3, url2, signal, fiber3) => {
65006
65242
  const fetch3 = fiber3.getRef(Fetch);
65007
65243
  const options3 = fiber3.services.mapUnsafe.get(RequestInit.key) ?? {};
65008
65244
  const headers = options3.headers ? merge6(fromInput2(options3.headers), request3.headers) : request3.headers;
@@ -66595,7 +66831,7 @@ var extractDiffLineMaps = (diffText) => {
66595
66831
  };
66596
66832
  var buildTargetRefCandidates = (targetBranch) => {
66597
66833
  const normalized = targetBranch.replace(/^refs\/heads\//, "");
66598
- return [targetBranch, `refs/remotes/origin/${normalized}`, `refs/heads/${normalized}`, normalized];
66834
+ return [`refs/remotes/origin/${normalized}`, targetBranch, `refs/heads/${normalized}`, normalized];
66599
66835
  };
66600
66836
  var runGit = (workspace, operation, args2, allowNonZeroExit = false) => exports_Effect.gen(function* () {
66601
66837
  const git = yield* GitExec;
@@ -66606,6 +66842,7 @@ var runGit = (workspace, operation, args2, allowNonZeroExit = false) => exports_
66606
66842
  allowNonZeroExit
66607
66843
  });
66608
66844
  });
66845
+ var resolveCommitRef = (workspace, operation, ref) => runGit(workspace, operation, ["rev-parse", "--verify", `${ref}^{commit}`]).pipe(exports_Effect.map((result4) => result4.stdout.trim()));
66609
66846
  var resolveHeadReviewedSourceCommitCandidate = (workspace) => runGit(workspace, "Git.resolveReviewedSourceCommit.revList", ["rev-list", "--parents", "-n", "1", "HEAD"]).pipe(exports_Effect.map((result4) => {
66610
66847
  const hashes = result4.stdout.trim().split(/\s+/);
66611
66848
  return hashes.length === 3 ? "HEAD^2" : "HEAD";
@@ -66640,6 +66877,36 @@ var isAncestor = ({ workspace, ancestorRef, headRef }) => exports_Effect.gen(fun
66640
66877
  remediation: "Use `checkout: self` with `fetchDepth: 0` so the relevant commit history is available locally."
66641
66878
  });
66642
66879
  });
66880
+ var hasTargetMergeCommitInRange = ({
66881
+ workspace,
66882
+ baseRef,
66883
+ headRef,
66884
+ currentTargetRef
66885
+ }) => exports_Effect.gen(function* () {
66886
+ const history = yield* runGit(workspace, "Git.hasTargetMergeCommitInRange.revList", [
66887
+ "rev-list",
66888
+ "--first-parent",
66889
+ "--parents",
66890
+ `${baseRef}..${headRef}`
66891
+ ]);
66892
+ for (const line of history.stdout.split(`
66893
+ `).map((entry) => entry.trim()).filter(Boolean)) {
66894
+ const [, , ...mergedParents] = line.split(/\s+/);
66895
+ if (mergedParents.length === 0) {
66896
+ continue;
66897
+ }
66898
+ for (const mergedParent of mergedParents) {
66899
+ if (yield* isAncestor({
66900
+ workspace,
66901
+ ancestorRef: mergedParent,
66902
+ headRef: currentTargetRef
66903
+ })) {
66904
+ return true;
66905
+ }
66906
+ }
66907
+ }
66908
+ return false;
66909
+ });
66643
66910
  var resolveDiffRange = ({ workspace, baseRef, headRef }) => exports_Effect.gen(function* () {
66644
66911
  const diff = yield* runGit(workspace, "Git.resolveDiffRange.diff", [
66645
66912
  "diff",
@@ -66688,6 +66955,8 @@ var resolveTargetRef = ({ workspace, targetBranch }) => exports_Effect.gen(funct
66688
66955
  });
66689
66956
  });
66690
66957
  var resolvePullRequestDiff = (input) => exports_Effect.gen(function* () {
66958
+ const targetRef = yield* resolveTargetRef(input);
66959
+ const targetCommit = yield* resolveCommitRef(input.workspace, "Git.resolvePullRequestDiff.targetCommit", targetRef);
66691
66960
  const parents = yield* runGit(input.workspace, "Git.resolvePullRequestDiff.revList", [
66692
66961
  "rev-list",
66693
66962
  "--parents",
@@ -66698,10 +66967,10 @@ var resolvePullRequestDiff = (input) => exports_Effect.gen(function* () {
66698
66967
  const hashes = parents.stdout.trim().split(/\s+/);
66699
66968
  let baseRef = "";
66700
66969
  const headRef = "HEAD";
66701
- if (hashes.length === 3) {
66702
- baseRef = "HEAD^1";
66970
+ const matchingTargetParent = hashes.slice(1).find((hash3) => hash3 === targetCommit);
66971
+ if (matchingTargetParent) {
66972
+ baseRef = matchingTargetParent;
66703
66973
  } else {
66704
- const targetRef = yield* resolveTargetRef(input);
66705
66974
  const mergeBase = yield* runGit(input.workspace, "Git.resolvePullRequestDiff.mergeBase", [
66706
66975
  "merge-base",
66707
66976
  targetRef,
@@ -66801,8 +67070,8 @@ var makeProcessRunner = exports_Effect.gen(function* () {
66801
67070
  const timeout4 = input.timeout ?? DEFAULT_TIMEOUT;
66802
67071
  const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
66803
67072
  const encodedStdin = input.stdin === undefined ? "ignore" : exports_Stream.fromIterable([new TextEncoder().encode(input.stdin)]);
66804
- yield* logInfo2("Starting command.", commandLogFields(input, timeout4, maxOutputBytes));
66805
- const command = make35(input.command, [...input.args], {
67073
+ yield* logDebug2("Starting command.", commandLogFields(input, timeout4, maxOutputBytes));
67074
+ const command = make36(input.command, [...input.args], {
66806
67075
  ...input.cwd ? { cwd: input.cwd } : {},
66807
67076
  ...input.env ? { env: input.env, extendEnv: false } : {},
66808
67077
  stdin: encodedStdin,
@@ -66827,7 +67096,7 @@ var makeProcessRunner = exports_Effect.gen(function* () {
66827
67096
  }).pipe(exports_Effect.scoped, exports_Effect.timeoutOption(timeout4), exports_Effect.flatMap((maybeResult) => exports_Option.match(maybeResult, {
66828
67097
  onNone: () => exports_Effect.fail(toCommandExecutionError(input, `${commandLabel(input)} timed out after ${format2(timeout4)}.`)),
66829
67098
  onSome: exports_Effect.succeed
66830
- })), exports_Effect.tap((result4) => logInfo2("Command completed.", commandResultLogFields(input, timeout4, maxOutputBytes, result4))), exports_Effect.tapError((error2) => logError2("Command failed.", {
67099
+ })), exports_Effect.tap((result4) => logDebug2("Command completed.", commandResultLogFields(input, timeout4, maxOutputBytes, result4))), exports_Effect.tapError((error2) => logError2("Command failed.", {
66831
67100
  ...commandLogFields(input, timeout4, maxOutputBytes),
66832
67101
  detail: error2.detail,
66833
67102
  exitCode: error2.exitCode,
@@ -69906,6 +70175,246 @@ var ignoreFailure = (effect2) => effect2.pipe(exports_Effect.match({
69906
70175
  return;
69907
70176
  }
69908
70177
  }));
70178
+ var initialOpenCodeProgressState = {
70179
+ toolStatesByCallId: {},
70180
+ seenRetryAttempts: [],
70181
+ eventStreamFailed: false
70182
+ };
70183
+ var isAbortError = (error2) => error2 instanceof Error && (error2.name === "AbortError" || error2.message.includes("abort") || error2.message.includes("aborted") || error2.message.includes("The operation was aborted"));
70184
+ var emitProgressLog = (entry) => entry.level === "warning" ? logWarning2(entry.message, entry.fields) : logInfo2(entry.message, entry.fields);
70185
+ var mergeAbortSignals = (signal, lifetime) => signal === undefined || signal === null ? lifetime : AbortSignal.any([signal, lifetime]);
70186
+ var withSubscriptionLifetime = (client2, lifetime) => ({
70187
+ event: Object.assign(Object.create(client2.event), {
70188
+ subscribe: (input, options3) => client2.event.subscribe(input, {
70189
+ ...options3,
70190
+ signal: mergeAbortSignals(options3?.signal, lifetime)
70191
+ })
70192
+ })
70193
+ });
70194
+ var sessionStatusKey = (status) => status.type === "retry" ? `${status.type}:${status.attempt}` : status.type;
70195
+ var TOOL_TITLE_INPUT_KEYS = ["title", "filePath", "command", "query", "pattern", "path", "url"];
70196
+ var TOOL_PROGRESS_ICONS = {
70197
+ bash: "\uD83D\uDD27",
70198
+ read: "\uD83D\uDCD6",
70199
+ glob: "\u2731",
70200
+ edit: "\u270F\uFE0F",
70201
+ grep: "\uD83D\uDD0E",
70202
+ list: "\uD83D\uDCC2",
70203
+ webfetch: "\uD83C\uDF10"
70204
+ };
70205
+ var titleFromToolInput = (input) => {
70206
+ for (const key of TOOL_TITLE_INPUT_KEYS) {
70207
+ const candidate = input[key];
70208
+ if (typeof candidate === "string" && candidate.trim().length > 0) {
70209
+ return candidate.trim();
70210
+ }
70211
+ }
70212
+ return;
70213
+ };
70214
+ var getToolTitle = (part) => {
70215
+ switch (part.state.status) {
70216
+ case "running":
70217
+ case "completed":
70218
+ return titleFromToolInput(part.state.input) || part.state.title;
70219
+ case "pending":
70220
+ case "error":
70221
+ return titleFromToolInput(part.state.input);
70222
+ }
70223
+ };
70224
+ var getToolDurationMs = (part) => {
70225
+ switch (part.state.status) {
70226
+ case "completed":
70227
+ case "error":
70228
+ return Math.max(0, part.state.time.end - part.state.time.start);
70229
+ case "pending":
70230
+ case "running":
70231
+ return;
70232
+ }
70233
+ };
70234
+ var getToolProgressFields = (part) => {
70235
+ const title = getToolTitle(part);
70236
+ const durationMs = getToolDurationMs(part);
70237
+ return {
70238
+ tool: part.tool,
70239
+ callId: part.callID,
70240
+ ...title ? { title } : {},
70241
+ ...durationMs !== undefined ? { durationMs } : {}
70242
+ };
70243
+ };
70244
+ var getToolProgressIcon = (toolName) => TOOL_PROGRESS_ICONS[toolName] ?? "\u2699\uFE0F";
70245
+ var getToolProgressMessage = (phase, part, fields) => {
70246
+ const title = fields.title ? truncateForLog(String(fields.title), 160) : undefined;
70247
+ const icon = getToolProgressIcon(part.tool);
70248
+ switch (phase) {
70249
+ case "started":
70250
+ return title ? `${icon} ${title}` : `${icon} ${part.tool}`;
70251
+ case "failed":
70252
+ return title ? `\u26A0\uFE0F ${part.tool}: ${title}` : `\u26A0\uFE0F ${part.tool}`;
70253
+ }
70254
+ };
70255
+ var getAssistantRunMessage = (request3) => request3.variant ? `Starting OpenCode assistant run with ${request3.model.modelID} (${request3.variant}).` : "Starting OpenCode assistant run.";
70256
+ var summarizeTodoCounts = (todos) => {
70257
+ const counts = {};
70258
+ for (const todo of todos) {
70259
+ counts[todo.status] = (counts[todo.status] ?? 0) + 1;
70260
+ }
70261
+ return counts;
70262
+ };
70263
+ var todoFingerprint = (counts) => Object.entries(counts).sort(([left], [right]) => left.localeCompare(right)).map(([status, count]) => `${status}:${count}`).join("|");
70264
+ var getEventSessionId = (event) => {
70265
+ switch (event.type) {
70266
+ case "message.part.delta":
70267
+ case "message.part.updated":
70268
+ case "session.idle":
70269
+ case "session.status":
70270
+ case "todo.updated":
70271
+ return event.properties.sessionID;
70272
+ case "message.updated":
70273
+ return event.properties.info.sessionID;
70274
+ case "session.error":
70275
+ return event.properties.sessionID;
70276
+ default:
70277
+ return;
70278
+ }
70279
+ };
70280
+ var isOpenCodeProgressEventForSession = (event, sessionId) => getEventSessionId(event) === sessionId;
70281
+ var reduceOpenCodeProgressBatch = (state, events) => {
70282
+ const logs = [];
70283
+ const seenRetryAttempts = new Set(state.seenRetryAttempts);
70284
+ const toolStatesByCallId = {
70285
+ ...state.toolStatesByCallId
70286
+ };
70287
+ let lastStatusKey = state.lastStatusKey;
70288
+ let nextTodoFingerprint = state.todoFingerprint;
70289
+ for (const event of events) {
70290
+ switch (event.type) {
70291
+ case "session.status": {
70292
+ const statusKey = sessionStatusKey(event.properties.status);
70293
+ if (event.properties.status.type === "retry") {
70294
+ if (!seenRetryAttempts.has(event.properties.status.attempt)) {
70295
+ seenRetryAttempts.add(event.properties.status.attempt);
70296
+ logs.push({
70297
+ level: "info",
70298
+ message: "OpenCode is retrying the assistant response.",
70299
+ fields: {
70300
+ attempt: event.properties.status.attempt,
70301
+ nextDelayMs: event.properties.status.next,
70302
+ retryMessage: truncateForLog(event.properties.status.message, 160)
70303
+ }
70304
+ });
70305
+ }
70306
+ } else if (statusKey !== lastStatusKey) {
70307
+ logs.push({
70308
+ level: "info",
70309
+ message: event.properties.status.type === "busy" ? "OpenCode assistant is working." : "OpenCode assistant is idle."
70310
+ });
70311
+ }
70312
+ lastStatusKey = statusKey;
70313
+ break;
70314
+ }
70315
+ case "message.part.updated": {
70316
+ if (event.properties.part.type !== "tool") {
70317
+ break;
70318
+ }
70319
+ const part = event.properties.part;
70320
+ const previous = toolStatesByCallId[part.callID];
70321
+ const baseFields = getToolProgressFields(part);
70322
+ switch (part.state.status) {
70323
+ case "running":
70324
+ if (previous?.status !== "running") {
70325
+ logs.push({
70326
+ level: "info",
70327
+ message: getToolProgressMessage("started", part, baseFields)
70328
+ });
70329
+ }
70330
+ break;
70331
+ case "completed":
70332
+ break;
70333
+ case "error":
70334
+ if (previous?.status !== "error") {
70335
+ logs.push({
70336
+ level: "warning",
70337
+ message: getToolProgressMessage("failed", part, baseFields),
70338
+ fields: {
70339
+ ...baseFields,
70340
+ error: truncateForLog(part.state.error, 200)
70341
+ }
70342
+ });
70343
+ }
70344
+ break;
70345
+ case "pending":
70346
+ break;
70347
+ }
70348
+ toolStatesByCallId[part.callID] = {
70349
+ status: part.state.status
70350
+ };
70351
+ break;
70352
+ }
70353
+ case "todo.updated": {
70354
+ const counts = summarizeTodoCounts(event.properties.todos);
70355
+ const fingerprint = todoFingerprint(counts);
70356
+ if (fingerprint !== nextTodoFingerprint) {
70357
+ logs.push({
70358
+ level: "info",
70359
+ message: "OpenCode updated its task plan.",
70360
+ fields: {
70361
+ total: event.properties.todos.length,
70362
+ counts
70363
+ }
70364
+ });
70365
+ nextTodoFingerprint = fingerprint;
70366
+ }
70367
+ break;
70368
+ }
70369
+ case "session.error": {
70370
+ const error2 = event.properties.error;
70371
+ logs.push({
70372
+ level: "warning",
70373
+ message: "OpenCode reported a session error.",
70374
+ fields: {
70375
+ ...error2?.name ? { name: error2.name } : {},
70376
+ ...error2?.data && typeof error2.data === "object" && "message" in error2.data ? { errorMessage: truncateForLog(String(error2.data.message), 200) } : {}
70377
+ }
70378
+ });
70379
+ break;
70380
+ }
70381
+ }
70382
+ }
70383
+ return {
70384
+ state: {
70385
+ lastStatusKey,
70386
+ toolStatesByCallId,
70387
+ seenRetryAttempts: [...seenRetryAttempts],
70388
+ todoFingerprint: nextTodoFingerprint,
70389
+ eventStreamFailed: state.eventStreamFailed
70390
+ },
70391
+ logs
70392
+ };
70393
+ };
70394
+ var runOpenCodeProgressLogger = ({
70395
+ events,
70396
+ sessionId
70397
+ }) => exports_Effect.gen(function* () {
70398
+ const stateRef = yield* exports_Ref.make(initialOpenCodeProgressState);
70399
+ yield* exports_Stream.fromAsyncIterable(events, (error2) => error2).pipe(exports_Stream.filter((event) => isOpenCodeProgressEventForSession(event, sessionId)), exports_Stream.groupedWithin(32, "16 millis"), exports_Stream.runForEach((batch) => exports_Ref.modify(stateRef, (state) => {
70400
+ const reduced = reduceOpenCodeProgressBatch(state, batch);
70401
+ return [reduced.logs, reduced.state];
70402
+ }).pipe(exports_Effect.flatMap((logs) => exports_Effect.forEach(logs, emitProgressLog, { discard: true })))), exports_Effect.catch((error2) => exports_Ref.modify(stateRef, (state) => {
70403
+ if (state.eventStreamFailed || isAbortError(error2)) {
70404
+ return [false, state];
70405
+ }
70406
+ return [
70407
+ true,
70408
+ {
70409
+ ...state,
70410
+ eventStreamFailed: true
70411
+ }
70412
+ ];
70413
+ }).pipe(exports_Effect.flatMap((shouldLog) => shouldLog ? logWarning2("OpenCode event stream failed. Continuing without live progress updates.", {
70414
+ detail: formatUnknownDetail(error2),
70415
+ sessionId
70416
+ }) : exports_Effect.void))));
70417
+ });
69909
70418
  var findAvailablePort = exports_Effect.tryPromise({
69910
70419
  try: () => new Promise((resolve4, reject) => {
69911
70420
  const server = createServer();
@@ -70040,7 +70549,7 @@ var decodePromptResult = ({
70040
70549
  };
70041
70550
  var spawnServer = (request3, spawner) => exports_Effect.gen(function* () {
70042
70551
  const port2 = yield* findAvailablePort;
70043
- const command = make35("opencode", ["serve", `--hostname=${SERVER_HOST}`, `--port=${port2}`], {
70552
+ const command = make36("opencode", ["serve", `--hostname=${SERVER_HOST}`, `--port=${port2}`], {
70044
70553
  cwd: request3.workspace,
70045
70554
  env: {
70046
70555
  ...request3.inheritedEnv,
@@ -70076,6 +70585,40 @@ var createSession = (client2, timeout4) => exports_Effect.tryPromise({
70076
70585
  }).pipe((effect2) => awaitWithin(effect2, timeout4, () => toInvocationError({
70077
70586
  message: `Timed out creating the OpenCode session after ${exports_Duration.format(timeout4)}.`
70078
70587
  })));
70588
+ var subscribeToOpenCodeEvents = ({ client: client2 }) => exports_Effect.tryPromise({
70589
+ try: (signal) => client2.event.subscribe({}, { signal }),
70590
+ catch: (error2) => toInvocationError({
70591
+ message: "Failed to subscribe to the OpenCode event stream.",
70592
+ detail: formatUnknownDetail(error2)
70593
+ })
70594
+ });
70595
+ var withOpenCodeProgressSubscription = ({
70596
+ client: client2,
70597
+ sessionId
70598
+ }, effect2) => exports_Effect.acquireRelease(exports_Effect.gen(function* () {
70599
+ const streamLifetime = new AbortController;
70600
+ const subscription = yield* subscribeToOpenCodeEvents({
70601
+ client: withSubscriptionLifetime(client2, streamLifetime.signal)
70602
+ }).pipe(exports_Effect.catch((error2) => logWarning2("OpenCode progress streaming is unavailable. Continuing without live milestones.", {
70603
+ detail: error2.message,
70604
+ ...error2.stderr ? { stderr: truncateForLog(error2.stderr, 200) } : {},
70605
+ sessionId
70606
+ }).pipe(exports_Effect.as(undefined))));
70607
+ if (!subscription) {
70608
+ return;
70609
+ }
70610
+ const fiber3 = yield* runOpenCodeProgressLogger({
70611
+ events: subscription.stream,
70612
+ sessionId
70613
+ }).pipe(exports_Effect.forkScoped);
70614
+ return {
70615
+ stop: () => streamLifetime.abort(),
70616
+ fiber: fiber3
70617
+ };
70618
+ }), (resource) => resource ? exports_Effect.gen(function* () {
70619
+ yield* exports_Effect.sync(() => resource.stop()).pipe(ignoreFailure);
70620
+ yield* exports_Fiber.interrupt(resource.fiber).pipe(ignoreFailure);
70621
+ }) : exports_Effect.void).pipe(exports_Effect.flatMap(() => effect2), exports_Effect.scoped);
70079
70622
  var validatePromptModel = ({
70080
70623
  client: client2,
70081
70624
  request: request3
@@ -70117,7 +70660,10 @@ var promptSession = ({
70117
70660
  }) => validatePromptModel({
70118
70661
  client: client2,
70119
70662
  request: request3
70120
- }).pipe(exports_Effect.flatMap(() => exports_Effect.tryPromise({
70663
+ }).pipe(exports_Effect.flatMap(() => withOpenCodeProgressSubscription({
70664
+ client: client2,
70665
+ sessionId
70666
+ }, exports_Effect.tryPromise({
70121
70667
  try: async () => {
70122
70668
  const result4 = await client2.session.prompt({
70123
70669
  sessionID: sessionId,
@@ -70141,7 +70687,7 @@ var promptSession = ({
70141
70687
  message: "Failed while prompting OpenCode.",
70142
70688
  detail: formatUnknownDetail(error2)
70143
70689
  })
70144
- })), (effect2) => awaitWithin(effect2, request3.timeout, () => toInvocationError({
70690
+ }))), (effect2) => awaitWithin(effect2, request3.timeout, () => toInvocationError({
70145
70691
  message: `Timed out waiting for the OpenCode prompt after ${exports_Duration.format(request3.timeout)}.`
70146
70692
  })), exports_Effect.flatMap((response) => resolveAssistantReply({
70147
70693
  client: client2,
@@ -70160,6 +70706,8 @@ var makeOpenCodeSdkRuntime = exports_Effect.gen(function* () {
70160
70706
  directory: request3.workspace
70161
70707
  });
70162
70708
  const session = yield* createSession(client2, request3.timeout);
70709
+ yield* logInfo2("Created OpenCode session.");
70710
+ yield* logInfo2(getAssistantRunMessage(request3));
70163
70711
  return yield* promptSession({
70164
70712
  client: client2,
70165
70713
  sessionId: session.id,
@@ -70237,14 +70785,7 @@ var makeOpenCodeRunner = exports_Effect.gen(function* () {
70237
70785
  const run4 = exports_Effect.fn("OpenCodeRunner.run")(function* (request3) {
70238
70786
  const model = yield* parseModel(request3.model);
70239
70787
  const config = buildOpenCodeConfig(request3.agent);
70240
- yield* logInfo2("Preparing OpenCode execution.", {
70241
- agent: request3.agent,
70242
- model: request3.model,
70243
- workspace: request3.workspace,
70244
- variant: request3.variant,
70245
- promptChars: request3.prompt.length,
70246
- structuredRequested: request3.format?.type === "json_schema"
70247
- });
70788
+ yield* logInfo2(`Preparing OpenCode execution for ${request3.model}.`);
70248
70789
  const result4 = yield* sdkRuntime.prompt({
70249
70790
  workspace: request3.workspace,
70250
70791
  model,
@@ -70256,17 +70797,6 @@ var makeOpenCodeRunner = exports_Effect.gen(function* () {
70256
70797
  format: request3.format,
70257
70798
  config
70258
70799
  });
70259
- yield* logInfo2("Received OpenCode response.", {
70260
- responseChars: result4.response.length,
70261
- responsePreview: truncateForLog(result4.response),
70262
- sessionId: result4.sessionId,
70263
- costUsd: result4.usage?.costUsd,
70264
- inputTokens: result4.usage?.tokens?.input,
70265
- outputTokens: result4.usage?.tokens?.output,
70266
- structuredDelivered: result4.structured !== undefined,
70267
- structuredErrorName: result4.modelError?.name,
70268
- structuredErrorRetries: result4.modelError?.retries
70269
- });
70270
70800
  return {
70271
70801
  response: result4.response,
70272
70802
  ...result4.structured !== undefined ? { structured: result4.structured } : {},
@@ -71216,22 +71746,6 @@ var writeStdout = exports_Effect.fn("ReviewWorkflow.writeStdout")(function* (tex
71216
71746
  const stdio = yield* Stdio2;
71217
71747
  yield* make22(text2).pipe(run(stdio.stdout()));
71218
71748
  });
71219
- var reviewLogFields = (config) => ({
71220
- command: "review",
71221
- model: config.model,
71222
- opencodeVariant: config.opencodeVariant,
71223
- opencodeTimeout: format2(config.opencodeTimeout),
71224
- opencodeTimeoutMs: toMillis(config.opencodeTimeout),
71225
- workspace: config.workspace,
71226
- organization: config.organization,
71227
- project: config.project,
71228
- repositoryId: config.repositoryId,
71229
- pullRequestId: config.pullRequestId,
71230
- collectionUrl: config.collectionUrl,
71231
- agent: config.agent,
71232
- dryRun: config.dryRun,
71233
- json: config.json
71234
- });
71235
71749
  var resolveReviewScope = ({
71236
71750
  config,
71237
71751
  fullPullRequestDiff,
@@ -71288,6 +71802,38 @@ var resolveReviewScope = ({
71288
71802
  return;
71289
71803
  }));
71290
71804
  if (previousCommitIsAncestor === true) {
71805
+ const followUpContainsTargetMerge = yield* hasTargetMergeCommitInRange({
71806
+ workspace: config.workspace,
71807
+ baseRef: previousReviewedCommit,
71808
+ headRef: reviewedSourceCommit,
71809
+ currentTargetRef: fullPullRequestDiff.baseRef
71810
+ }).pipe(exports_Effect.orElseSucceed(() => {
71811
+ return;
71812
+ }));
71813
+ if (followUpContainsTargetMerge === true) {
71814
+ yield* logInfo2("Follow-up range includes a merge from the target branch. Falling back to a full review to avoid reviewing target-only merge changes.", {
71815
+ previousReviewedCommit,
71816
+ reviewedSourceCommit,
71817
+ currentPullRequestBaseRef: fullPullRequestDiff.baseRef
71818
+ });
71819
+ return {
71820
+ reviewMode: "full",
71821
+ scopedDiff: fullPullRequestDiff,
71822
+ previousReviewedCommit
71823
+ };
71824
+ }
71825
+ if (followUpContainsTargetMerge === undefined) {
71826
+ yield* logInfo2("Could not validate whether the follow-up range includes a merge from the target branch. Falling back to a full review.", {
71827
+ previousReviewedCommit,
71828
+ reviewedSourceCommit,
71829
+ currentPullRequestBaseRef: fullPullRequestDiff.baseRef
71830
+ });
71831
+ return {
71832
+ reviewMode: "full",
71833
+ scopedDiff: fullPullRequestDiff,
71834
+ previousReviewedCommit
71835
+ };
71836
+ }
71291
71837
  return {
71292
71838
  reviewMode: "follow-up",
71293
71839
  scopedDiff: yield* resolveDiffRange({
@@ -71356,11 +71902,6 @@ var decodeStructuredReviewResult = ({
71356
71902
  source: "fallback"
71357
71903
  };
71358
71904
  });
71359
- var reviewResultSourceLogFields = (source) => ({
71360
- structuredDelivered: source === "structured",
71361
- structuredRecovered: source === "repaired",
71362
- structuredFallback: source === "fallback"
71363
- });
71364
71905
  var mapUsageTokens = (usage) => usage?.tokens ? {
71365
71906
  input: usage.tokens.input,
71366
71907
  output: usage.tokens.output,
@@ -71435,7 +71976,7 @@ var writeReviewWorkflowOutput = (config, output) => {
71435
71976
  var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen(function* () {
71436
71977
  const azureClient = yield* AzureDevOpsClient;
71437
71978
  const openCodeRunner = yield* OpenCodeRunner;
71438
- yield* logInfo2("Resolved review configuration.");
71979
+ yield* logInfo2(`Resolved review configuration for ${config.model}.`);
71439
71980
  yield* logInfo2("Loading pull request metadata, git diff, source commit, and existing threads.");
71440
71981
  const [metadata, fullPullRequestDiff, reviewedSourceCommit, existingThreads] = yield* exports_Effect.all([
71441
71982
  azureClient.getPullRequestMetadata({
@@ -71455,15 +71996,7 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71455
71996
  token: config.systemAccessToken
71456
71997
  })
71457
71998
  ], { concurrency: "unbounded" });
71458
- yield* logInfo2("Loaded review inputs.", {
71459
- pullRequestTitle: metadata.title,
71460
- changedFiles: fullPullRequestDiff.changedFiles.length,
71461
- diffBytes: fullPullRequestDiff.diffText.length,
71462
- baseRef: fullPullRequestDiff.baseRef,
71463
- headRef: fullPullRequestDiff.headRef,
71464
- existingThreads: existingThreads.length,
71465
- reviewedSourceCommit
71466
- });
71999
+ yield* logInfo2(`Loaded review inputs for ${fullPullRequestDiff.changedFiles.length} changed file(s).`);
71467
72000
  const previousSummaryState = findManagedSummaryThread(existingThreads)?.reviewState;
71468
72001
  const { reviewMode, scopedDiff, previousReviewedCommit } = yield* resolveReviewScope({
71469
72002
  config,
@@ -71488,10 +72021,7 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71488
72021
  scopedChangedLinesByFile: scopedDiff.changedLinesByFile,
71489
72022
  scopedDeletedLinesByFile: scopedDiff.deletedLinesByFile
71490
72023
  });
71491
- yield* logInfo2("Skipped review because no new commits were added since the last managed review.", {
71492
- reviewedSourceCommit,
71493
- actions: actions2.length
71494
- });
72024
+ yield* logInfo2("Skipped review because no new commits were added since the last managed review.");
71495
72025
  return {
71496
72026
  metadata,
71497
72027
  connectedWorkItems: [],
@@ -71527,11 +72057,7 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71527
72057
  context: azureContext,
71528
72058
  token: config.systemAccessToken,
71529
72059
  workItemRefs: metadata.workItemRefs
71530
- }).pipe(exports_Effect.tap((workItems) => logInfo2("Loaded connected work item context.", {
71531
- workItemRefs: metadata.workItemRefs.length,
71532
- connectedWorkItems: workItems.length,
71533
- omittedConnectedWorkItems: Math.max(metadata.workItemRefs.length - workItems.length, 0)
71534
- })), exports_Effect.catchTags({
72060
+ }).pipe(exports_Effect.tap((workItems) => logInfo2(workItems.length > 0 ? `Loaded ${workItems.length} connected work item(s).` : "No connected work items found.")), exports_Effect.catchTags({
71535
72061
  AzureDevOpsHttpError: (error2) => logInfo2("Failed to load connected work item context. Continuing without work item enrichment.", {
71536
72062
  workItemRefs: metadata.workItemRefs.length,
71537
72063
  status: error2.status,
@@ -71551,17 +72077,9 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71551
72077
  existingThreads,
71552
72078
  ...connectedWorkItems ? { connectedWorkItems } : {}
71553
72079
  });
71554
- yield* logInfo2("Built review context.", {
71555
- reviewMode,
71556
- changedFiles: reviewContext.changedFiles.length,
71557
- pullRequestThreads: reviewContext.pullRequestThreads?.items.length ?? 0,
71558
- omittedPullRequestThreads: reviewContext.pullRequestThreads?.omittedCount ?? 0,
71559
- manifestChars: stringifyJson2(reviewContext).length
71560
- });
72080
+ yield* logInfo2(`Built ${reviewMode} review context.`);
71561
72081
  const prompt = yield* buildReviewPrompt(config.promptFile, reviewContext);
71562
- yield* logInfo2("Built review prompt.", {
71563
- promptChars: prompt.length
71564
- });
72082
+ yield* logInfo2("Built review prompt.");
71565
72083
  const openCodeResult = yield* openCodeRunner.run({
71566
72084
  workspace: config.workspace,
71567
72085
  model: config.model,
@@ -71572,30 +72090,12 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71572
72090
  inheritedEnv: config.inheritedEnv,
71573
72091
  format: REVIEW_OUTPUT_FORMAT
71574
72092
  });
71575
- yield* logInfo2("Received OpenCode response.", {
71576
- responseChars: openCodeResult.response.length,
71577
- sessionId: openCodeResult.sessionId,
71578
- costUsd: openCodeResult.usage?.costUsd,
71579
- inputTokens: openCodeResult.usage?.tokens?.input,
71580
- outputTokens: openCodeResult.usage?.tokens?.output,
71581
- structuredRequested: true,
71582
- structuredDelivered: openCodeResult.structured !== undefined,
71583
- structuredErrorName: openCodeResult.modelError?.name,
71584
- structuredErrorRetries: openCodeResult.modelError?.retries
71585
- });
72093
+ yield* logInfo2("Received OpenCode response.");
71586
72094
  const { reviewResult, source } = yield* decodeStructuredReviewResult({
71587
72095
  openCodeResult,
71588
72096
  changedLinesByFile: scopedDiff.changedLinesByFile
71589
72097
  });
71590
- yield* logInfo2("Decoded review result.", {
71591
- reviewMode,
71592
- verdict: reviewResult.verdict,
71593
- findings: reviewResult.findings.length,
71594
- inlineFindings: reviewResult.inlineFindings.length,
71595
- summaryOnlyFindings: reviewResult.summaryOnlyFindings.length,
71596
- unmappedNotes: reviewResult.unmappedNotes.length,
71597
- ...reviewResultSourceLogFields(source)
71598
- });
72098
+ yield* logInfo2(`Decoded review result: ${reviewResult.verdict} with ${reviewResult.findings.length} finding(s).`);
71599
72099
  const outstandingReviewResult = reviewMode === "follow-up" ? mergeFollowUpReviewResult({
71600
72100
  existingThreads,
71601
72101
  scopedChangedLinesByFile: scopedDiff.changedLinesByFile,
@@ -71632,10 +72132,7 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71632
72132
  scopedChangedLinesByFile: scopedDiff.changedLinesByFile,
71633
72133
  scopedDeletedLinesByFile: scopedDiff.deletedLinesByFile
71634
72134
  });
71635
- yield* logInfo2("Published review result.", {
71636
- actions: actions.length,
71637
- reviewMode
71638
- });
72135
+ yield* logInfo2(`Prepared ${actions.length} review action(s).`);
71639
72136
  return {
71640
72137
  metadata,
71641
72138
  connectedWorkItems: connectedWorkItems ?? [],
@@ -71663,7 +72160,7 @@ var planReviewWorkflow = (config, azureContext, buildLink) => exports_Effect.gen
71663
72160
  skipped: false
71664
72161
  }
71665
72162
  };
71666
- }).pipe(withLogAnnotations(reviewLogFields(config)), exports_Effect.withLogSpan("open-azdo.review"));
72163
+ }).pipe(exports_Effect.withLogSpan("open-azdo.review"));
71667
72164
  var runReviewWorkflow = (config) => exports_Effect.gen(function* () {
71668
72165
  const azureContext = createAzureContext(config);
71669
72166
  const buildLink = buildBuildLink(config);
@@ -72546,25 +73043,34 @@ var executeSandboxCapture = exports_Effect.scoped(exports_Effect.gen(function* (
72546
73043
  }));
72547
73044
 
72548
73045
  // src/Runtime.ts
72549
- var makeRuntimeLayer = (cliInput) => {
72550
- const appConfigLayer = makeAppConfigLayer(cliInput);
72551
- const processRunnerLayer = ProcessRunnerLive.pipe(exports_Layer.provide(BaseRuntimeLayer));
72552
- const platformLayer = exports_Layer.mergeAll(BaseRuntimeLayer, processRunnerLayer);
73046
+ var makePlatformRuntimeLayers = (jsonLogs) => {
73047
+ const baseRuntimeLayer = makeBaseRuntimeLayer({
73048
+ jsonLogs
73049
+ });
73050
+ const processRunnerLayer = ProcessRunnerLive.pipe(exports_Layer.provide(baseRuntimeLayer));
73051
+ const platformLayer = exports_Layer.mergeAll(baseRuntimeLayer, processRunnerLayer);
72553
73052
  const gitExecLayer = GitExecLive.pipe(exports_Layer.provide(processRunnerLayer));
72554
73053
  const openCodeRunnerLayer = OpenCodeRunnerLive.pipe(exports_Layer.provide(platformLayer));
72555
- return exports_Layer.mergeAll(platformLayer, appConfigLayer, gitExecLayer, AzureDevOpsClientLive, openCodeRunnerLayer);
73054
+ return {
73055
+ appRuntimeLayer: exports_Layer.mergeAll(platformLayer, gitExecLayer, AzureDevOpsClientLive, openCodeRunnerLayer)
73056
+ };
73057
+ };
73058
+ var makeRuntimeLayer = (cliInput) => {
73059
+ const appConfigLayer = makeAppConfigLayer(cliInput);
73060
+ const { appRuntimeLayer } = makePlatformRuntimeLayers(cliInput.json);
73061
+ return exports_Layer.mergeAll(appRuntimeLayer, appConfigLayer);
72556
73062
  };
72557
73063
  var makeSandboxCaptureRuntimeLayer = (cliInput) => {
72558
73064
  const appConfigLayer = makeSandboxCaptureConfigLayer(cliInput);
72559
- const processRunnerLayer = ProcessRunnerLive.pipe(exports_Layer.provide(BaseRuntimeLayer));
72560
- const platformLayer = exports_Layer.mergeAll(BaseRuntimeLayer, processRunnerLayer);
72561
- const gitExecLayer = GitExecLive.pipe(exports_Layer.provide(processRunnerLayer));
72562
- const openCodeRunnerLayer = OpenCodeRunnerLive.pipe(exports_Layer.provide(platformLayer));
72563
- return exports_Layer.mergeAll(platformLayer, appConfigLayer, gitExecLayer, AzureDevOpsClientLive, openCodeRunnerLayer);
73065
+ const { appRuntimeLayer } = makePlatformRuntimeLayers(cliInput.json);
73066
+ return exports_Layer.mergeAll(appRuntimeLayer, appConfigLayer);
72564
73067
  };
72565
73068
 
72566
73069
  // src/Cli.ts
72567
73070
  var PositiveIntSchema = exports_Schema.Int.check(exports_Schema.isGreaterThan(0));
73071
+ var withCliLogger = (effect2, jsonLogs) => effect2.pipe(exports_Effect.provide(makeBaseRuntimeLayer({
73072
+ jsonLogs
73073
+ })));
72568
73074
  var executeReview = exports_Effect.gen(function* () {
72569
73075
  const config = yield* AppConfig;
72570
73076
  return yield* runReviewWorkflow({
@@ -72578,9 +73084,9 @@ var runReviewCommand = (input) => exports_Effect.gen(function* () {
72578
73084
  const exit3 = yield* exports_Effect.exit(executeReviewWithInput(input));
72579
73085
  if (!exports_Exit.isSuccess(exit3)) {
72580
73086
  const failureReason = exports_Cause.pretty(exit3.cause);
72581
- yield* logError2("open-azdo failed during startup.", {
73087
+ yield* withCliLogger(logError2("open-azdo failed during startup.", {
72582
73088
  cause: failureReason
72583
- }).pipe(exports_Effect.provide(BaseRuntimeLayer));
73089
+ }), input.json);
72584
73090
  return yield* new OperationalError({
72585
73091
  message: "open-azdo failed during startup."
72586
73092
  });
@@ -72596,9 +73102,9 @@ var runSandboxCaptureCommand = (input) => exports_Effect.gen(function* () {
72596
73102
  const exit3 = yield* exports_Effect.exit(executeSandboxCaptureWithInput(input));
72597
73103
  if (!exports_Exit.isSuccess(exit3)) {
72598
73104
  const failureReason = exports_Cause.pretty(exit3.cause);
72599
- yield* logError2("open-azdo failed during sandbox capture.", {
73105
+ yield* withCliLogger(logError2("open-azdo failed during sandbox capture.", {
72600
73106
  cause: failureReason
72601
- }).pipe(exports_Effect.provide(BaseRuntimeLayer));
73107
+ }), input.json);
72602
73108
  return yield* new OperationalError({
72603
73109
  message: "open-azdo failed during sandbox capture."
72604
73110
  });
@@ -72625,7 +73131,7 @@ var reviewCommandConfig = {
72625
73131
  dryRun: boolean6("dry-run").pipe(withDefault4(false), withDescription2("Do not publish comments.")),
72626
73132
  json: boolean6("json").pipe(withDefault4(false), withDescription2("Emit machine-readable JSON."))
72627
73133
  };
72628
- var reviewCommand = make33("review", reviewCommandConfig).pipe(withDescription3("Review an Azure DevOps pull request with OpenCode."), withHandler((input) => runReviewCommand(input)));
73134
+ var reviewCommand = make34("review", reviewCommandConfig).pipe(withDescription3("Review an Azure DevOps pull request with OpenCode."), withHandler((input) => runReviewCommand(input)));
72629
73135
  var sandboxCaptureCommandConfig = {
72630
73136
  model: string7("model").pipe(optional3, withDescription2("Model id, for example openai/gpt-5.4.")),
72631
73137
  opencodeVariant: string7("opencode-variant").pipe(optional3, withDescription2("Provider-specific variant or reasoning level.")),
@@ -72639,11 +73145,11 @@ var sandboxCaptureCommandConfig = {
72639
73145
  output: string7("output").pipe(optional3, withDescription2("Output path for the sandbox capture JSON.")),
72640
73146
  json: boolean6("json").pipe(withDefault4(false), withDescription2("Emit machine-readable JSON."))
72641
73147
  };
72642
- var sandboxCaptureCommand = make33("capture", sandboxCaptureCommandConfig).pipe(withDescription3("Capture a real Azure DevOps PR review run into a local sandbox artifact."), withHandler((input) => runSandboxCaptureCommand(input)));
72643
- var sandboxCommand = make33("sandbox").pipe(withDescription3("Sandbox tooling for live capture and local preview."), withSubcommands([sandboxCaptureCommand]));
72644
- var openAzdoCli = make33("open-azdo").pipe(withDescription3("Secure Azure DevOps pull-request review CLI powered by OpenCode."), withSubcommands([reviewCommand, sandboxCommand]));
73148
+ var sandboxCaptureCommand = make34("capture", sandboxCaptureCommandConfig).pipe(withDescription3("Capture a real Azure DevOps PR review run into a local sandbox artifact."), withHandler((input) => runSandboxCaptureCommand(input)));
73149
+ var sandboxCommand = make34("sandbox").pipe(withDescription3("Sandbox tooling for live capture and local preview."), withSubcommands([sandboxCaptureCommand]));
73150
+ var openAzdoCli = make34("open-azdo").pipe(withDescription3("Secure Azure DevOps pull-request review CLI powered by OpenCode."), withSubcommands([reviewCommand, sandboxCommand]));
72645
73151
  // package.json
72646
- var version2 = "0.3.2";
73152
+ var version2 = "0.3.4";
72647
73153
 
72648
73154
  // src/Main.ts
72649
73155
  var cliProgram = run3(openAzdoCli, { version: version2 }).pipe(exports_Effect.scoped, exports_Effect.provide(BaseRuntimeLayer));
@@ -72652,4 +73158,4 @@ var main = () => runMain2(cliProgram, { disableErrorReporting: true });
72652
73158
  // bin/open-azdo.ts
72653
73159
  main();
72654
73160
 
72655
- //# debugId=3E966D7A63AFA1E264756E2164756E21
73161
+ //# debugId=2B0BDD0B7FAF788564756E2164756E21