@punks/cli 2.1.0 → 2.1.1

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.
Files changed (2) hide show
  1. package/dist/index.js +683 -1457
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5503,8 +5503,8 @@ ${ctx.indent}`;
5503
5503
  const nl0 = valueStr.indexOf(`
5504
5504
  `);
5505
5505
  const hasNewline = nl0 !== -1;
5506
- const flow2 = ctx.inFlow ?? value3.flow ?? value3.items.length === 0;
5507
- if (hasNewline || !flow2) {
5506
+ const flow = ctx.inFlow ?? value3.flow ?? value3.items.length === 0;
5507
+ if (hasNewline || !flow) {
5508
5508
  let hasPropsLine = false;
5509
5509
  if (hasNewline && (vs0 === "&" || vs0 === "!")) {
5510
5510
  let sp0 = valueStr.indexOf(" ");
@@ -5717,8 +5717,8 @@ var require_stringifyCollection = __commonJS((exports) => {
5717
5717
  var stringify = require_stringify();
5718
5718
  var stringifyComment = require_stringifyComment();
5719
5719
  function stringifyCollection(collection, ctx, options) {
5720
- const flow2 = ctx.inFlow ?? collection.flow;
5721
- const stringify2 = flow2 ? stringifyFlowCollection : stringifyBlockCollection;
5720
+ const flow = ctx.inFlow ?? collection.flow;
5721
+ const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
5722
5722
  return stringify2(collection, ctx, options);
5723
5723
  }
5724
5724
  function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
@@ -7227,7 +7227,7 @@ var require_Document = __commonJS((exports) => {
7227
7227
  options = replacer;
7228
7228
  replacer = undefined;
7229
7229
  }
7230
- const { aliasDuplicateObjects, anchorPrefix, flow: flow2, keepUndefined, onTagObj, tag: tag3 } = options ?? {};
7230
+ const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag: tag3 } = options ?? {};
7231
7231
  const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(this, anchorPrefix || "a");
7232
7232
  const ctx = {
7233
7233
  aliasDuplicateObjects: aliasDuplicateObjects ?? true,
@@ -7239,7 +7239,7 @@ var require_Document = __commonJS((exports) => {
7239
7239
  sourceObjects
7240
7240
  };
7241
7241
  const node = createNode.createNode(value3, tag3, ctx);
7242
- if (flow2 && identity3.isCollection(node))
7242
+ if (flow && identity3.isCollection(node))
7243
7243
  node.flow = true;
7244
7244
  setAnchors();
7245
7245
  return node;
@@ -7433,7 +7433,7 @@ ${pointer}
7433
7433
 
7434
7434
  // ../../node_modules/.bun/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-props.js
7435
7435
  var require_resolve_props = __commonJS((exports) => {
7436
- function resolveProps(tokens, { flow: flow2, indicator, next, offset, onError: onError4, parentIndent, startOnNewline }) {
7436
+ function resolveProps(tokens, { flow, indicator, next, offset, onError: onError4, parentIndent, startOnNewline }) {
7437
7437
  let spaceBefore = false;
7438
7438
  let atNewline = startOnNewline;
7439
7439
  let hasSpace = startOnNewline;
@@ -7462,7 +7462,7 @@ var require_resolve_props = __commonJS((exports) => {
7462
7462
  }
7463
7463
  switch (token.type) {
7464
7464
  case "space":
7465
- if (!flow2 && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes("\t")) {
7465
+ if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes("\t")) {
7466
7466
  tab = token;
7467
7467
  }
7468
7468
  hasSpace = true;
@@ -7518,15 +7518,15 @@ var require_resolve_props = __commonJS((exports) => {
7518
7518
  if (anchor || tag3)
7519
7519
  onError4(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
7520
7520
  if (found)
7521
- onError4(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow2 ?? "collection"}`);
7521
+ onError4(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
7522
7522
  found = token;
7523
7523
  atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
7524
7524
  hasSpace = false;
7525
7525
  break;
7526
7526
  case "comma":
7527
- if (flow2) {
7527
+ if (flow) {
7528
7528
  if (comma)
7529
- onError4(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow2}`);
7529
+ onError4(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`);
7530
7530
  comma = token;
7531
7531
  atNewline = false;
7532
7532
  hasSpace = false;
@@ -10891,9 +10891,9 @@ var require_public_api = __commonJS((exports) => {
10891
10891
 
10892
10892
  // src/index.ts
10893
10893
  import { spawn as spawn2 } from "child_process";
10894
- import { existsSync as existsSync8, mkdirSync as mkdirSync7, readFileSync as readFileSync8, writeFileSync as writeFileSync6 } from "fs";
10895
- import { homedir as homedir4 } from "os";
10896
- import path16 from "path";
10894
+ import { existsSync as existsSync7, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
10895
+ import { homedir as homedir3 } from "os";
10896
+ import path15 from "path";
10897
10897
 
10898
10898
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Array.js
10899
10899
  var exports_Array = {};
@@ -11131,45 +11131,6 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
11131
11131
  }
11132
11132
  }
11133
11133
  }
11134
- function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
11135
- switch (arguments.length) {
11136
- case 1:
11137
- return ab;
11138
- case 2:
11139
- return function() {
11140
- return bc(ab.apply(this, arguments));
11141
- };
11142
- case 3:
11143
- return function() {
11144
- return cd(bc(ab.apply(this, arguments)));
11145
- };
11146
- case 4:
11147
- return function() {
11148
- return de(cd(bc(ab.apply(this, arguments))));
11149
- };
11150
- case 5:
11151
- return function() {
11152
- return ef(de(cd(bc(ab.apply(this, arguments)))));
11153
- };
11154
- case 6:
11155
- return function() {
11156
- return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
11157
- };
11158
- case 7:
11159
- return function() {
11160
- return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
11161
- };
11162
- case 8:
11163
- return function() {
11164
- return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
11165
- };
11166
- case 9:
11167
- return function() {
11168
- return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
11169
- };
11170
- }
11171
- return;
11172
- }
11173
11134
 
11174
11135
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Equivalence.js
11175
11136
  var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
@@ -11243,7 +11204,6 @@ var isDate = (input) => input instanceof Date;
11243
11204
  var isIterable = (input) => typeof input === "string" || hasProperty(input, Symbol.iterator);
11244
11205
  var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
11245
11206
  var isPromiseLike = (input) => hasProperty(input, "then") && isFunction2(input.then);
11246
- var or = /* @__PURE__ */ dual(2, (self, that) => (a) => self(a) || that(a));
11247
11207
 
11248
11208
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/errors.js
11249
11209
  var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
@@ -12014,7 +11974,6 @@ var try_ = (evaluate) => {
12014
11974
  var isEither2 = isEither;
12015
11975
  var isLeft2 = isLeft;
12016
11976
  var isRight2 = isRight;
12017
- var getRight2 = getRight;
12018
11977
  var getEquivalence = ({
12019
11978
  left: left3,
12020
11979
  right: right3
@@ -12097,7 +12056,7 @@ var match2 = /* @__PURE__ */ dual(2, (self, {
12097
12056
  onNone,
12098
12057
  onSome
12099
12058
  }) => isNone2(self) ? onNone() : onSome(self.value));
12100
- var getRight3 = getRight;
12059
+ var getRight2 = getRight;
12101
12060
  var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
12102
12061
  var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
12103
12062
  var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some2(onNone()) : self);
@@ -13051,31 +13010,6 @@ var InvalidData2 = InvalidData;
13051
13010
  var isConfigError2 = isConfigError;
13052
13011
  var isMissingDataOnly2 = isMissingDataOnly;
13053
13012
 
13054
- // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Context.js
13055
- var exports_Context = {};
13056
- __export(exports_Context, {
13057
- unsafeMake: () => unsafeMake,
13058
- unsafeGet: () => unsafeGet3,
13059
- pick: () => pick2,
13060
- omit: () => omit2,
13061
- mergeAll: () => mergeAll2,
13062
- merge: () => merge3,
13063
- make: () => make6,
13064
- isTag: () => isTag2,
13065
- isReference: () => isReference2,
13066
- isContext: () => isContext2,
13067
- getOrElse: () => getOrElse3,
13068
- getOption: () => getOption2,
13069
- get: () => get3,
13070
- empty: () => empty6,
13071
- add: () => add2,
13072
- TagTypeId: () => TagTypeId2,
13073
- Tag: () => Tag2,
13074
- ReferenceTypeId: () => ReferenceTypeId2,
13075
- Reference: () => Reference2,
13076
- GenericTag: () => GenericTag
13077
- });
13078
-
13079
13013
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/context.js
13080
13014
  var TagTypeId = /* @__PURE__ */ Symbol.for("effect/Context/Tag");
13081
13015
  var ReferenceTypeId = /* @__PURE__ */ Symbol.for("effect/Context/Reference");
@@ -13281,16 +13215,6 @@ var mergeAll = (...ctxs) => {
13281
13215
  }
13282
13216
  return makeContext(map5);
13283
13217
  };
13284
- var pick = (...tags) => (self) => {
13285
- const tagSet = new Set(tags.map((_) => _.key));
13286
- const newEnv = new Map;
13287
- for (const [tag, s] of self.unsafeMap.entries()) {
13288
- if (tagSet.has(tag)) {
13289
- newEnv.set(tag, s);
13290
- }
13291
- }
13292
- return makeContext(newEnv);
13293
- };
13294
13218
  var omit = (...tags) => (self) => {
13295
13219
  const newEnv = new Map(self.unsafeMap);
13296
13220
  for (const tag of tags) {
@@ -13300,13 +13224,9 @@ var omit = (...tags) => (self) => {
13300
13224
  };
13301
13225
 
13302
13226
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Context.js
13303
- var TagTypeId2 = TagTypeId;
13304
- var ReferenceTypeId2 = ReferenceTypeId;
13305
13227
  var GenericTag = makeGenericTag;
13306
- var unsafeMake = makeContext;
13307
13228
  var isContext2 = isContext;
13308
13229
  var isTag2 = isTag;
13309
- var isReference2 = isReference;
13310
13230
  var empty6 = empty5;
13311
13231
  var make6 = make5;
13312
13232
  var add2 = add;
@@ -13316,7 +13236,6 @@ var unsafeGet3 = unsafeGet2;
13316
13236
  var getOption2 = getOption;
13317
13237
  var merge3 = merge2;
13318
13238
  var mergeAll2 = mergeAll;
13319
- var pick2 = pick;
13320
13239
  var omit2 = omit;
13321
13240
  var Tag2 = Tag;
13322
13241
  var Reference2 = Reference;
@@ -14849,7 +14768,7 @@ var threadName = (self) => {
14849
14768
  const identifiers = Array.from(ids(self)).map((n) => `#${n}`).join(",");
14850
14769
  return identifiers;
14851
14770
  };
14852
- var unsafeMake2 = () => {
14771
+ var unsafeMake = () => {
14853
14772
  const id = get6(_fiberCounter);
14854
14773
  pipe(_fiberCounter, set3(id + 1));
14855
14774
  return new Runtime(id, Date.now());
@@ -14865,7 +14784,7 @@ var combineAll3 = combineAll2;
14865
14784
  var ids2 = ids;
14866
14785
  var make15 = make14;
14867
14786
  var threadName2 = threadName;
14868
- var unsafeMake3 = unsafeMake2;
14787
+ var unsafeMake2 = unsafeMake;
14869
14788
 
14870
14789
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/HashMap.js
14871
14790
  var isHashMap2 = isHashMap;
@@ -18108,11 +18027,11 @@ var parallel3 = parallel2;
18108
18027
  var parallelN2 = parallelN;
18109
18028
 
18110
18029
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/fiberRefs.js
18111
- function unsafeMake4(fiberRefLocals) {
18030
+ function unsafeMake3(fiberRefLocals) {
18112
18031
  return new FiberRefsImpl(fiberRefLocals);
18113
18032
  }
18114
18033
  function empty21() {
18115
- return unsafeMake4(new Map);
18034
+ return unsafeMake3(new Map);
18116
18035
  }
18117
18036
  var FiberRefsSym = /* @__PURE__ */ Symbol.for("effect/FiberRefs");
18118
18037
 
@@ -18965,8 +18884,8 @@ class RefImpl extends Class2 {
18965
18884
  });
18966
18885
  }
18967
18886
  }
18968
- var unsafeMake5 = (value) => new RefImpl(make13(value));
18969
- var make24 = (value) => sync(() => unsafeMake5(value));
18887
+ var unsafeMake4 = (value) => new RefImpl(make13(value));
18888
+ var make24 = (value) => sync(() => unsafeMake4(value));
18970
18889
  var get10 = (self) => self.get;
18971
18890
  var set5 = /* @__PURE__ */ dual(2, (self, value) => self.modify(() => [undefined, value]));
18972
18891
  var getAndSet = /* @__PURE__ */ dual(2, (self, value) => self.modify((a) => [a, value]));
@@ -19907,7 +19826,7 @@ class Local {
19907
19826
  }));
19908
19827
  }
19909
19828
  }
19910
- var unsafeMake6 = (fiber) => {
19829
+ var unsafeMake5 = (fiber) => {
19911
19830
  return new Local(fiber.id(), fiber);
19912
19831
  };
19913
19832
  var globalScope = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/FiberScope/Global"), () => new Global);
@@ -20929,7 +20848,7 @@ var MetricPairTypeId = /* @__PURE__ */ Symbol.for(MetricPairSymbolKey);
20929
20848
  var metricPairVariance = {
20930
20849
  _Type: (_) => _
20931
20850
  };
20932
- var unsafeMake7 = (metricKey, metricState) => {
20851
+ var unsafeMake6 = (metricKey, metricState) => {
20933
20852
  return {
20934
20853
  [MetricPairTypeId]: metricPairVariance,
20935
20854
  metricKey,
@@ -20950,7 +20869,7 @@ class MetricRegistryImpl {
20950
20869
  snapshot() {
20951
20870
  const result = [];
20952
20871
  for (const [key, hook] of this.map) {
20953
- result.push(unsafeMake7(key, hook.get()));
20872
+ result.push(unsafeMake6(key, hook.get()));
20954
20873
  }
20955
20874
  return result;
20956
20875
  }
@@ -22061,7 +21980,7 @@ class FiberRuntime extends Class2 {
22061
21980
  });
22062
21981
  }
22063
21982
  scope() {
22064
- return unsafeMake6(this);
21983
+ return unsafeMake5(this);
22065
21984
  }
22066
21985
  get children() {
22067
21986
  return this.ask((fiber) => Array.from(fiber.getChildren()));
@@ -23121,7 +23040,7 @@ var unsafeForkUnstarted = (effect, parentFiber, parentRuntimeFlags, overrideScop
23121
23040
  return childFiber;
23122
23041
  };
23123
23042
  var unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {
23124
- const childId = unsafeMake3();
23043
+ const childId = unsafeMake2();
23125
23044
  const parentFiberRefs = parentFiber.getFiberRefs();
23126
23045
  const childFiberRefs = forkAs(parentFiberRefs, childId);
23127
23046
  const childFiber = new FiberRuntime(childId, childFiberRefs, parentRuntimeFlags);
@@ -23537,7 +23456,6 @@ var withSpanScoped = function() {
23537
23456
  };
23538
23457
 
23539
23458
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Cause.js
23540
- var TimeoutExceptionTypeId2 = TimeoutExceptionTypeId;
23541
23459
  var empty28 = empty19;
23542
23460
  var fail4 = fail;
23543
23461
  var die4 = die;
@@ -24005,7 +23923,7 @@ class SynchronizedImpl extends Class2 {
24005
23923
  }
24006
23924
  var makeSynchronized = (value) => sync(() => unsafeMakeSynchronized(value));
24007
23925
  var unsafeMakeSynchronized = (value) => {
24008
- const ref = unsafeMake5(value);
23926
+ const ref = unsafeMake4(value);
24009
23927
  const sem = unsafeMakeSemaphore(1);
24010
23928
  return new SynchronizedImpl(ref, sem.withPermits(1));
24011
23929
  };
@@ -24054,7 +23972,7 @@ var makeDual = (f) => function() {
24054
23972
  return f.apply(this, arguments);
24055
23973
  };
24056
23974
  var unsafeFork2 = /* @__PURE__ */ makeDual((runtime3, self, options) => {
24057
- const fiberId2 = unsafeMake3();
23975
+ const fiberId2 = unsafeMake2();
24058
23976
  const fiberRefUpdates = [[currentContext, [[fiberId2, runtime3.context]]]];
24059
23977
  if (options?.scheduler) {
24060
23978
  fiberRefUpdates.push([currentScheduler, [[fiberId2, options.scheduler]]]);
@@ -25237,7 +25155,7 @@ var unsafeFromDate = (date) => {
25237
25155
  }
25238
25156
  return makeUtc(epochMillis);
25239
25157
  };
25240
- var unsafeMake8 = (input) => {
25158
+ var unsafeMake7 = (input) => {
25241
25159
  if (isDateTime(input)) {
25242
25160
  return input;
25243
25161
  } else if (input instanceof Date) {
@@ -25258,7 +25176,7 @@ var unsafeMakeZoned = (input, options) => {
25258
25176
  if (options?.timeZone === undefined && isDateTime(input) && isZoned(input)) {
25259
25177
  return input;
25260
25178
  }
25261
- const self = unsafeMake8(input);
25179
+ const self = unsafeMake7(input);
25262
25180
  if (self.epochMillis < minEpochMillis || self.epochMillis > maxEpochMillis) {
25263
25181
  throw new RangeError(`Epoch millis out of range: ${self.epochMillis}`);
25264
25182
  }
@@ -25589,7 +25507,7 @@ class ScheduleDriverImpl {
25589
25507
  }
25590
25508
  });
25591
25509
  }
25592
- iterationMeta = /* @__PURE__ */ unsafeMake5(defaultIterationMetadata);
25510
+ iterationMeta = /* @__PURE__ */ unsafeMake4(defaultIterationMetadata);
25593
25511
  get reset() {
25594
25512
  return set5(this.ref, [none2(), this.schedule.initial]).pipe(zipLeft(set5(this.iterationMeta, defaultIterationMetadata)));
25595
25513
  }
@@ -25824,7 +25742,7 @@ var failCause6 = deferredFailCause;
25824
25742
  var interrupt5 = deferredInterrupt;
25825
25743
  var isDone5 = deferredIsDone;
25826
25744
  var succeed6 = deferredSucceed;
25827
- var unsafeMake9 = deferredUnsafeMake;
25745
+ var unsafeMake8 = deferredUnsafeMake;
25828
25746
  var unsafeDone = deferredUnsafeDone;
25829
25747
 
25830
25748
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/MutableList.js
@@ -26208,7 +26126,7 @@ class CacheImpl {
26208
26126
  let deferred = undefined;
26209
26127
  let value = getOrUndefined(get12(this.cacheState.map, k));
26210
26128
  if (value === undefined) {
26211
- deferred = unsafeMake9(this.fiberId);
26129
+ deferred = unsafeMake8(this.fiberId);
26212
26130
  mapKey = makeMapKey(k);
26213
26131
  if (has6(this.cacheState.map, k)) {
26214
26132
  value = getOrUndefined(get12(this.cacheState.map, k));
@@ -26253,7 +26171,7 @@ class CacheImpl {
26253
26171
  refresh(key) {
26254
26172
  return clockWith3((clock2) => suspend(() => {
26255
26173
  const k = key;
26256
- const deferred = unsafeMake9(this.fiberId);
26174
+ const deferred = unsafeMake8(this.fiberId);
26257
26175
  let value = getOrUndefined(get12(this.cacheState.map, k));
26258
26176
  if (value === undefined) {
26259
26177
  if (has6(this.cacheState.map, k)) {
@@ -28336,10 +28254,10 @@ var record = (key, value) => {
28336
28254
  indexSignatures
28337
28255
  };
28338
28256
  };
28339
- var pick3 = (ast, keys6) => {
28257
+ var pick2 = (ast, keys6) => {
28340
28258
  const annotation = getSurrogateAnnotation(ast);
28341
28259
  if (isSome2(annotation)) {
28342
- return pick3(annotation.value, keys6);
28260
+ return pick2(annotation.value, keys6);
28343
28261
  }
28344
28262
  switch (ast._tag) {
28345
28263
  case "TypeLiteral": {
@@ -28364,13 +28282,13 @@ var pick3 = (ast, keys6) => {
28364
28282
  case "Union":
28365
28283
  return new TypeLiteral(keys6.map((name) => getPropertyKeyIndexedAccess(ast, name)), []);
28366
28284
  case "Suspend":
28367
- return pick3(ast.f(), keys6);
28285
+ return pick2(ast.f(), keys6);
28368
28286
  case "Refinement":
28369
- return pick3(ast.from, keys6);
28287
+ return pick2(ast.from, keys6);
28370
28288
  case "Transformation": {
28371
28289
  switch (ast.transformation._tag) {
28372
28290
  case "ComposeTransformation":
28373
- return new Transformation(pick3(ast.from, keys6), pick3(ast.to, keys6), composeTransformation);
28291
+ return new Transformation(pick2(ast.from, keys6), pick2(ast.to, keys6), composeTransformation);
28374
28292
  case "TypeLiteralTransformation": {
28375
28293
  const ts = [];
28376
28294
  const fromKeys = [];
@@ -28383,7 +28301,7 @@ var pick3 = (ast, keys6) => {
28383
28301
  fromKeys.push(k);
28384
28302
  }
28385
28303
  }
28386
- return isNonEmptyReadonlyArray(ts) ? new Transformation(pick3(ast.from, fromKeys), pick3(ast.to, keys6), new TypeLiteralTransformation(ts)) : pick3(ast.from, fromKeys);
28304
+ return isNonEmptyReadonlyArray(ts) ? new Transformation(pick2(ast.from, fromKeys), pick2(ast.to, keys6), new TypeLiteralTransformation(ts)) : pick2(ast.from, fromKeys);
28387
28305
  }
28388
28306
  }
28389
28307
  }
@@ -28398,7 +28316,7 @@ var omit3 = (ast, keys6) => {
28398
28316
  }
28399
28317
  return new TypeLiteral([], indexSignatures);
28400
28318
  }
28401
- return pick3(ast, getPropertyKeys(ast).filter((name) => !keys6.includes(name)));
28319
+ return pick2(ast, getPropertyKeys(ast).filter((name) => !keys6.includes(name)));
28402
28320
  };
28403
28321
  var orUndefined = (ast) => Union.make([ast, undefinedKeyword]);
28404
28322
  var partial = (ast, options) => {
@@ -28940,7 +28858,7 @@ var getSync = (ast, isDecoding, options) => {
28940
28858
  };
28941
28859
  var getOption3 = (ast, isDecoding, options) => {
28942
28860
  const parser = getEither(ast, isDecoding, options);
28943
- return (input, overrideOptions) => getRight3(parser(input, overrideOptions));
28861
+ return (input, overrideOptions) => getRight2(parser(input, overrideOptions));
28944
28862
  };
28945
28863
  var getEffect = (ast, isDecoding, options) => {
28946
28864
  const parser = goMemo(ast, isDecoding);
@@ -29921,7 +29839,7 @@ var nominal = () => {
29921
29839
  };
29922
29840
 
29923
29841
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/FiberRef.js
29924
- var unsafeMake10 = fiberRefUnsafeMake;
29842
+ var unsafeMake9 = fiberRefUnsafeMake;
29925
29843
  var currentContext2 = currentContext;
29926
29844
  var currentLoggers2 = currentLoggers;
29927
29845
  var currentTracerEnabled2 = currentTracerEnabled;
@@ -30327,10 +30245,10 @@ var bounded2 = (requestedCapacity) => pipe(sync(() => bounded(requestedCapacity)
30327
30245
  var dropping = (requestedCapacity) => pipe(sync(() => bounded(requestedCapacity)), flatMap7((queue) => make42(backingQueueFromMutableQueue(queue), droppingStrategy())));
30328
30246
  var sliding = (requestedCapacity) => pipe(sync(() => bounded(requestedCapacity)), flatMap7((queue) => make42(backingQueueFromMutableQueue(queue), slidingStrategy())));
30329
30247
  var unbounded2 = () => pipe(sync(() => unbounded()), flatMap7((queue) => make42(backingQueueFromMutableQueue(queue), droppingStrategy())));
30330
- var unsafeMake11 = (queue, takers, shutdownHook, shutdownFlag, strategy) => {
30248
+ var unsafeMake10 = (queue, takers, shutdownHook, shutdownFlag, strategy) => {
30331
30249
  return new QueueImpl(queue, takers, shutdownHook, shutdownFlag, strategy);
30332
30250
  };
30333
- var make42 = (queue, strategy) => pipe(deferredMake(), map11((deferred) => unsafeMake11(queue, unbounded(), deferred, make13(false), strategy)));
30251
+ var make42 = (queue, strategy) => pipe(deferredMake(), map11((deferred) => unsafeMake10(queue, unbounded(), deferred, make13(false), strategy)));
30334
30252
 
30335
30253
  class BackingQueueFromMutableQueue {
30336
30254
  mutable;
@@ -32310,8 +32228,6 @@ var runPromiseExit2 = unsafeRunPromiseExit;
32310
32228
  var updateContext3 = updateContext2;
32311
32229
 
32312
32230
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Schedule.js
32313
- var ScheduleTypeId2 = ScheduleTypeId;
32314
- var passthrough4 = passthrough2;
32315
32231
  var spaced2 = spaced;
32316
32232
 
32317
32233
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/stream/emit.js
@@ -32733,7 +32649,7 @@ __export(exports_Schema, {
32733
32649
  positive: () => positive,
32734
32650
  pluck: () => pluck,
32735
32651
  pickLiteral: () => pickLiteral,
32736
- pick: () => pick5,
32652
+ pick: () => pick4,
32737
32653
  pattern: () => pattern,
32738
32654
  partialWith: () => partialWith,
32739
32655
  partial: () => partial2,
@@ -33353,7 +33269,6 @@ var value = (self) => {
33353
33269
  throw new Error("Unable to get redacted value");
33354
33270
  }
33355
33271
  };
33356
- var unsafeWipe = (self) => redactedRegistry.delete(self);
33357
33272
 
33358
33273
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/secret.js
33359
33274
  var SecretSymbolKey = "effect/Secret";
@@ -33440,7 +33355,7 @@ var isUtc2 = isUtc;
33440
33355
  var isZoned2 = isZoned;
33441
33356
  var Equivalence4 = Equivalence2;
33442
33357
  var unsafeFromDate2 = unsafeFromDate;
33443
- var unsafeMake12 = unsafeMake8;
33358
+ var unsafeMake11 = unsafeMake7;
33444
33359
  var unsafeMakeZoned2 = unsafeMakeZoned;
33445
33360
  var makeZonedFromString2 = makeZonedFromString;
33446
33361
  var zoneUnsafeMakeNamed2 = zoneUnsafeMakeNamed;
@@ -34654,24 +34569,13 @@ var MaxItemsSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/MaxItems");
34654
34569
  var ItemsCountSchemaId = /* @__PURE__ */ Symbol.for("effect/SchemaId/ItemsCount");
34655
34570
 
34656
34571
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Redacted.js
34657
- var exports_Redacted = {};
34658
- __export(exports_Redacted, {
34659
- value: () => value2,
34660
- unsafeWipe: () => unsafeWipe2,
34661
- make: () => make52,
34662
- isRedacted: () => isRedacted2,
34663
- getEquivalence: () => getEquivalence7,
34664
- RedactedTypeId: () => RedactedTypeId2
34665
- });
34666
- var RedactedTypeId2 = RedactedTypeId;
34667
34572
  var isRedacted2 = isRedacted;
34668
34573
  var make52 = make49;
34669
34574
  var value2 = value;
34670
- var unsafeWipe2 = unsafeWipe;
34671
34575
  var getEquivalence7 = (isEquivalent) => make((x, y) => isEquivalent(value2(x), value2(y)));
34672
34576
 
34673
34577
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Struct.js
34674
- var pick4 = /* @__PURE__ */ dual((args2) => isObject(args2[0]), (s, ...keys6) => {
34578
+ var pick3 = /* @__PURE__ */ dual((args2) => isObject(args2[0]), (s, ...keys6) => {
34675
34579
  const out = {};
34676
34580
  for (const k of keys6) {
34677
34581
  if (k in s) {
@@ -35518,7 +35422,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
35518
35422
  return getDisableValidationMakeOption(options) ? propsWithDefaults : validateSync(this)(propsWithDefaults);
35519
35423
  };
35520
35424
  static pick(...keys6) {
35521
- return Struct(pick4(fields, ...keys6));
35425
+ return Struct(pick3(fields, ...keys6));
35522
35426
  }
35523
35427
  static omit(...keys6) {
35524
35428
  return Struct(omit4(fields, ...keys6));
@@ -35546,12 +35450,12 @@ function makeRecordClass(key, value3, ast) {
35546
35450
  };
35547
35451
  }
35548
35452
  var Record = (options) => makeRecordClass(options.key, options.value);
35549
- var pick5 = (...keys6) => (self) => make53(pick3(self.ast, keys6));
35453
+ var pick4 = (...keys6) => (self) => make53(pick2(self.ast, keys6));
35550
35454
  var omit5 = (...keys6) => (self) => make53(omit3(self.ast, keys6));
35551
35455
  var pluck = /* @__PURE__ */ dual(2, (schema, key) => {
35552
35456
  const ps = getPropertyKeyIndexedAccess(typeAST(schema.ast), key);
35553
35457
  const value3 = make53(ps.isOptional ? orUndefined(ps.type) : ps.type);
35554
- const out = transform2(schema.pipe(pick5(key)), value3, {
35458
+ const out = transform2(schema.pipe(pick4(key)), value3, {
35555
35459
  strict: true,
35556
35460
  decode: (i) => i[key],
35557
35461
  encode: (a) => ps.isOptional && a === undefined ? {} : {
@@ -36909,7 +36813,7 @@ class DateTimeUtcFromSelf extends (/* @__PURE__ */ declare((u) => isDateTime2(u)
36909
36813
  })) {
36910
36814
  }
36911
36815
  var decodeDateTimeUtc = (input, ast) => _try({
36912
- try: () => unsafeMake12(input),
36816
+ try: () => unsafeMake11(input),
36913
36817
  catch: () => new Type2(ast, input, `Unable to decode ${formatUnknown(input)} into a DateTime.Utc`)
36914
36818
  });
36915
36819
 
@@ -46760,51 +46664,6 @@ var multiSelect2 = multiSelect;
46760
46664
  var succeed18 = succeed16;
46761
46665
  var text9 = text5;
46762
46666
  var toggle3 = toggle2;
46763
- // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClient.js
46764
- var exports_HttpClient = {};
46765
- __export(exports_HttpClient, {
46766
- withTracerPropagation: () => withTracerPropagation2,
46767
- withTracerDisabledWhen: () => withTracerDisabledWhen2,
46768
- withSpanNameGenerator: () => withSpanNameGenerator2,
46769
- withScope: () => withScope2,
46770
- withCookiesRef: () => withCookiesRef2,
46771
- transformResponse: () => transformResponse2,
46772
- transform: () => transform4,
46773
- tapRequest: () => tapRequest2,
46774
- tapError: () => tapError7,
46775
- tap: () => tap7,
46776
- retryTransient: () => retryTransient2,
46777
- retry: () => retry6,
46778
- put: () => put3,
46779
- post: () => post3,
46780
- patch: () => patch11,
46781
- options: () => options5,
46782
- mapRequestInputEffect: () => mapRequestInputEffect2,
46783
- mapRequestInput: () => mapRequestInput2,
46784
- mapRequestEffect: () => mapRequestEffect2,
46785
- mapRequest: () => mapRequest2,
46786
- makeWith: () => makeWith2,
46787
- make: () => make66,
46788
- layerMergedContext: () => layerMergedContext2,
46789
- head: () => head9,
46790
- get: () => get19,
46791
- followRedirects: () => followRedirects2,
46792
- filterStatusOk: () => filterStatusOk3,
46793
- filterStatus: () => filterStatus3,
46794
- filterOrFail: () => filterOrFail4,
46795
- filterOrElse: () => filterOrElse4,
46796
- execute: () => execute3,
46797
- del: () => del3,
46798
- currentTracerPropagation: () => currentTracerPropagation2,
46799
- currentTracerDisabledWhen: () => currentTracerDisabledWhen2,
46800
- catchTags: () => catchTags5,
46801
- catchTag: () => catchTag5,
46802
- catchAll: () => catchAll8,
46803
- TypeId: () => TypeId35,
46804
- SpanNameGenerator: () => SpanNameGenerator2,
46805
- HttpClient: () => HttpClient
46806
- });
46807
-
46808
46667
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/Cookies.js
46809
46668
  var TypeId27 = /* @__PURE__ */ Symbol.for("@effect/platform/Cookies");
46810
46669
  var CookieTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/Cookies/Cookie");
@@ -46967,7 +46826,6 @@ function parseSetCookie(header) {
46967
46826
  options: Object.keys(options3).length > 0 ? options3 : undefined
46968
46827
  }));
46969
46828
  }
46970
- var isEmpty17 = (self) => isEmptyRecord(self.cookies);
46971
46829
  var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
46972
46830
  var CookieProto = {
46973
46831
  [CookieTypeId]: CookieTypeId,
@@ -46981,11 +46839,6 @@ var CookieProto = {
46981
46839
  };
46982
46840
  }
46983
46841
  };
46984
- var merge11 = /* @__PURE__ */ dual(2, (self, that) => fromReadonlyRecord({
46985
- ...self.cookies,
46986
- ...that.cookies
46987
- }));
46988
- var toCookieHeader = (self) => Object.values(self.cookies).map((cookie) => `${cookie.name}=${cookie.valueEncoded}`).join("; ");
46989
46842
  var tryDecodeURIComponent = (str) => {
46990
46843
  try {
46991
46844
  return decodeURIComponent(str);
@@ -47034,7 +46887,7 @@ var setAll3 = /* @__PURE__ */ dual(2, (self, headers) => make63({
47034
46887
  ...self,
47035
46888
  ...fromInput2(headers)
47036
46889
  }));
47037
- var merge12 = /* @__PURE__ */ dual(2, (self, headers) => {
46890
+ var merge11 = /* @__PURE__ */ dual(2, (self, headers) => {
47038
46891
  const out = make63(self);
47039
46892
  Object.assign(out, headers);
47040
46893
  return out;
@@ -47091,15 +46944,13 @@ var redact2 = /* @__PURE__ */ dual(2, (self, key) => {
47091
46944
  }
47092
46945
  return out;
47093
46946
  });
47094
- var currentRedactedNames = /* @__PURE__ */ globalValue("@effect/platform/Headers/currentRedactedNames", () => unsafeMake10(["authorization", "cookie", "set-cookie", "x-api-key"]));
46947
+ var currentRedactedNames = /* @__PURE__ */ globalValue("@effect/platform/Headers/currentRedactedNames", () => unsafeMake9(["authorization", "cookie", "set-cookie", "x-api-key"]));
47095
46948
 
47096
46949
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClientError.js
47097
46950
  var TypeId28 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientError");
47098
46951
 
47099
46952
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClientError.js
47100
46953
  var TypeId29 = TypeId28;
47101
- var isHttpClientError = (u) => hasProperty(u, TypeId29);
47102
-
47103
46954
  class RequestError extends (/* @__PURE__ */ TypeIdError(TypeId29, "RequestError")) {
47104
46955
  get methodAndUrl() {
47105
46956
  return `${this.request.method} ${this.request.url}`;
@@ -47158,7 +47009,6 @@ var schemaFromSelf = /* @__PURE__ */ Array$(Tuple(String$, String$)).annotations
47158
47009
  identifier: "UrlParams"
47159
47010
  });
47160
47011
  var empty43 = [];
47161
- var set10 = /* @__PURE__ */ dual(3, (self, key, value6) => append(filter2(self, ([k]) => k !== key), [key, String(value6)]));
47162
47012
  var setAll4 = /* @__PURE__ */ dual(2, (self, input) => {
47163
47013
  const out = fromInput3(input);
47164
47014
  const keys6 = new Set;
@@ -47172,7 +47022,6 @@ var setAll4 = /* @__PURE__ */ dual(2, (self, input) => {
47172
47022
  }
47173
47023
  return out;
47174
47024
  });
47175
- var append4 = /* @__PURE__ */ dual(3, (self, key, value6) => append(self, [key, String(value6)]));
47176
47025
  var appendAll4 = /* @__PURE__ */ dual(2, (self, input) => appendAll(self, fromInput3(input)));
47177
47026
  var makeUrl = (url2, params, hash2) => {
47178
47027
  try {
@@ -47265,13 +47114,6 @@ var toHeaders = (span4) => unsafeFromRecord({
47265
47114
 
47266
47115
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpBody.js
47267
47116
  var TypeId31 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpBody");
47268
- var ErrorTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpBody/HttpBodyError");
47269
- var bodyError = /* @__PURE__ */ tagged2("HttpBodyError");
47270
- var HttpBodyError = (reason) => bodyError({
47271
- [ErrorTypeId]: ErrorTypeId,
47272
- reason
47273
- });
47274
-
47275
47117
  class BodyBase {
47276
47118
  [TypeId31];
47277
47119
  constructor() {
@@ -47321,25 +47163,7 @@ class Uint8ArrayImpl extends BodyBase {
47321
47163
  var uint8Array = (body, contentType) => new Uint8ArrayImpl(body, contentType ?? "application/octet-stream");
47322
47164
  var encoder2 = /* @__PURE__ */ new TextEncoder;
47323
47165
  var text10 = (body, contentType) => uint8Array(encoder2.encode(body), contentType ?? "text/plain");
47324
- var unsafeJson = (body, contentType) => text10(JSON.stringify(body), contentType ?? "application/json");
47325
- var json = (body, contentType) => try_3({
47326
- try: () => unsafeJson(body, contentType),
47327
- catch: (error4) => HttpBodyError({
47328
- _tag: "JsonError",
47329
- error: error4
47330
- })
47331
- });
47332
47166
  var urlParams = (urlParams2, contentType) => text10(toString(urlParams2), contentType ?? "application/x-www-form-urlencoded");
47333
- var jsonSchema = (schema, options3) => {
47334
- const encode5 = encode4(schema, options3);
47335
- return (body, contentType) => flatMap10(mapError3(encode5(body), (error4) => HttpBodyError({
47336
- _tag: "SchemaError",
47337
- error: error4
47338
- })), (body2) => json(body2, contentType));
47339
- };
47340
- var file5 = (path2, options3) => flatMap10(FileSystem, (fs) => map17(fs.stat(path2), (info2) => stream3(fs.stream(path2, options3), options3?.contentType, Number(info2.size))));
47341
- var fileWeb = (file6) => stream3(fromReadableStream2(() => file6.stream(), identity), file6.type, file6.size);
47342
-
47343
47167
  class FormDataImpl extends BodyBase {
47344
47168
  formData;
47345
47169
  _tag = "FormData";
@@ -47356,43 +47180,6 @@ class FormDataImpl extends BodyBase {
47356
47180
  }
47357
47181
  }
47358
47182
  var formData = (body) => new FormDataImpl(body);
47359
- var formDataRecord = (entries2) => {
47360
- const formData2 = new FormData;
47361
- for (const [key, value6] of Object.entries(entries2)) {
47362
- if (Array.isArray(value6)) {
47363
- for (const item of value6) {
47364
- if (item == null)
47365
- continue;
47366
- formData2.append(key, typeof value6 === "object" ? item : String(item));
47367
- }
47368
- } else if (value6 != null) {
47369
- formData2.append(key, typeof value6 === "object" ? value6 : String(value6));
47370
- }
47371
- }
47372
- return new FormDataImpl(formData2);
47373
- };
47374
-
47375
- class StreamImpl2 extends BodyBase {
47376
- stream;
47377
- contentType;
47378
- contentLength;
47379
- _tag = "Stream";
47380
- constructor(stream3, contentType, contentLength) {
47381
- super();
47382
- this.stream = stream3;
47383
- this.contentType = contentType;
47384
- this.contentLength = contentLength;
47385
- }
47386
- toJSON() {
47387
- return {
47388
- _id: "@effect/platform/HttpBody",
47389
- _tag: "Stream",
47390
- contentType: this.contentType,
47391
- contentLength: this.contentLength
47392
- };
47393
- }
47394
- }
47395
- var stream3 = (body, contentType, contentLength) => new StreamImpl2(body, contentType ?? "application/octet-stream", contentLength);
47396
47183
 
47397
47184
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClientRequest.js
47398
47185
  var TypeId32 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientRequest");
@@ -47424,7 +47211,6 @@ function makeInternal(method, url2, urlParams2, hash2, headers, body) {
47424
47211
  self.body = body;
47425
47212
  return self;
47426
47213
  }
47427
- var isClientRequest = (u) => typeof u === "object" && u !== null && (TypeId32 in u);
47428
47214
  var empty45 = /* @__PURE__ */ makeInternal("GET", "", empty43, /* @__PURE__ */ none2(), empty42, empty44);
47429
47215
  var make64 = (method) => (url2, options3) => modify6(empty45, {
47430
47216
  method,
@@ -47468,9 +47254,6 @@ var modify6 = /* @__PURE__ */ dual(2, (self, options4) => {
47468
47254
  });
47469
47255
  var setHeader = /* @__PURE__ */ dual(3, (self, key, value6) => makeInternal(self.method, self.url, self.urlParams, self.hash, set9(self.headers, key, value6), self.body));
47470
47256
  var setHeaders = /* @__PURE__ */ dual(2, (self, input) => makeInternal(self.method, self.url, self.urlParams, self.hash, setAll3(self.headers, input), self.body));
47471
- var stringOrRedacted = (value6) => typeof value6 === "string" ? value6 : value2(value6);
47472
- var basicAuth = /* @__PURE__ */ dual(3, (self, username, password3) => setHeader(self, "Authorization", `Basic ${btoa(`${stringOrRedacted(username)}:${stringOrRedacted(password3)}`)}`));
47473
- var bearerToken = /* @__PURE__ */ dual(2, (self, token) => setHeader(self, "Authorization", `Bearer ${stringOrRedacted(token)}`));
47474
47257
  var accept = /* @__PURE__ */ dual(2, (self, mediaType) => setHeader(self, "Accept", mediaType));
47475
47258
  var acceptJson = /* @__PURE__ */ accept("application/json");
47476
47259
  var setMethod = /* @__PURE__ */ dual(2, (self, method) => makeInternal(method, self.url, self.urlParams, self.hash, self.headers, self.body));
@@ -47485,23 +47268,10 @@ var setUrl = /* @__PURE__ */ dual(2, (self, url2) => {
47485
47268
  clone2.hash = "";
47486
47269
  return makeInternal(self.method, clone2.toString(), urlParams2, hash2, self.headers, self.body);
47487
47270
  });
47488
- var appendUrl = /* @__PURE__ */ dual(2, (self, path2) => {
47489
- if (path2 === "") {
47490
- return self;
47491
- }
47492
- const baseUrl2 = self.url.endsWith("/") ? self.url : self.url + "/";
47493
- const pathSegment = path2.startsWith("/") ? path2.slice(1) : path2;
47494
- return makeInternal(self.method, baseUrl2 + pathSegment, self.urlParams, self.hash, self.headers, self.body);
47495
- });
47496
47271
  var prependUrl = /* @__PURE__ */ dual(2, (self, url2) => makeInternal(self.method, url2.endsWith("/") && self.url.startsWith("/") ? url2 + self.url.slice(1) : url2 + self.url, self.urlParams, self.hash, self.headers, self.body));
47497
- var updateUrl = /* @__PURE__ */ dual(2, (self, f) => makeInternal(self.method, f(self.url), self.urlParams, self.hash, self.headers, self.body));
47498
- var appendUrlParam = /* @__PURE__ */ dual(3, (self, key, value6) => makeInternal(self.method, self.url, append4(self.urlParams, key, value6), self.hash, self.headers, self.body));
47499
47272
  var appendUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeInternal(self.method, self.url, appendAll4(self.urlParams, input), self.hash, self.headers, self.body));
47500
- var setUrlParam = /* @__PURE__ */ dual(3, (self, key, value6) => makeInternal(self.method, self.url, set10(self.urlParams, key, value6), self.hash, self.headers, self.body));
47501
47273
  var setUrlParams = /* @__PURE__ */ dual(2, (self, input) => makeInternal(self.method, self.url, setAll4(self.urlParams, input), self.hash, self.headers, self.body));
47502
47274
  var setHash = /* @__PURE__ */ dual(2, (self, hash2) => makeInternal(self.method, self.url, self.urlParams, some2(hash2), self.headers, self.body));
47503
- var removeHash = (self) => makeInternal(self.method, self.url, self.urlParams, none2(), self.headers, self.body);
47504
- var toUrl = (self) => getRight2(makeUrl(self.url, self.urlParams, self.hash));
47505
47275
  var setBody = /* @__PURE__ */ dual(2, (self, body) => {
47506
47276
  let headers = self.headers;
47507
47277
  if (body._tag === "Empty" || body._tag === "FormData") {
@@ -47518,23 +47288,7 @@ var setBody = /* @__PURE__ */ dual(2, (self, body) => {
47518
47288
  }
47519
47289
  return makeInternal(self.method, self.url, self.urlParams, self.hash, headers, body);
47520
47290
  });
47521
- var bodyUint8Array = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, body, contentType = "application/octet-stream") => setBody(self, uint8Array(body, contentType)));
47522
- var bodyText = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, body, contentType = "text/plain") => setBody(self, text10(body, contentType)));
47523
- var bodyJson = /* @__PURE__ */ dual(2, (self, body) => map17(json(body), (body2) => setBody(self, body2)));
47524
- var bodyUnsafeJson = /* @__PURE__ */ dual(2, (self, body) => setBody(self, unsafeJson(body)));
47525
- var bodyFile = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, path2, options4) => map17(file5(path2, options4), (body) => setBody(self, body)));
47526
- var bodyFileWeb = /* @__PURE__ */ dual(2, (self, file6) => setBody(self, fileWeb(file6)));
47527
- var schemaBodyJson = (schema, options4) => {
47528
- const encode5 = jsonSchema(schema, options4);
47529
- return dual(2, (self, body) => map17(encode5(body), (body2) => setBody(self, body2)));
47530
- };
47531
- var bodyUrlParams = /* @__PURE__ */ dual(2, (self, body) => setBody(self, text10(toString(fromInput3(body)), "application/x-www-form-urlencoded")));
47532
47291
  var bodyFormData = /* @__PURE__ */ dual(2, (self, body) => setBody(self, formData(body)));
47533
- var bodyFormDataRecord = /* @__PURE__ */ dual(2, (self, entries2) => setBody(self, formDataRecord(entries2)));
47534
- var bodyStream = /* @__PURE__ */ dual((args2) => isClientRequest(args2[0]), (self, body, {
47535
- contentLength,
47536
- contentType = "application/octet-stream"
47537
- } = {}) => setBody(self, stream3(body, contentType, contentLength)));
47538
47292
 
47539
47293
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClientResponse.js
47540
47294
  var TypeId33 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientResponse");
@@ -47662,18 +47416,6 @@ var matchStatus = /* @__PURE__ */ dual(2, (self, cases) => {
47662
47416
  }
47663
47417
  return cases.orElse(self);
47664
47418
  });
47665
- var filterStatus = /* @__PURE__ */ dual(2, (self, f) => suspend3(() => f(self.status) ? succeed8(self) : fail9(new ResponseError({
47666
- response: self,
47667
- request: self.request,
47668
- reason: "StatusCode",
47669
- description: "invalid status code"
47670
- }))));
47671
- var filterStatusOk = (self) => self.status >= 200 && self.status < 300 ? succeed8(self) : fail9(new ResponseError({
47672
- response: self,
47673
- request: self.request,
47674
- reason: "StatusCode",
47675
- description: "non 2xx status code"
47676
- }));
47677
47419
 
47678
47420
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpClient.js
47679
47421
  var ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`;
@@ -47688,14 +47430,11 @@ var ATTR_URL_SCHEME = "url.scheme";
47688
47430
  var ATTR_URL_QUERY = "url.query";
47689
47431
  var TypeId34 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClient");
47690
47432
  var tag5 = /* @__PURE__ */ GenericTag("@effect/platform/HttpClient");
47691
- var currentTracerDisabledWhen = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"), () => unsafeMake10(constFalse));
47692
- var withTracerDisabledWhen = /* @__PURE__ */ dual(2, (self, pred) => transformResponse(self, locally(currentTracerDisabledWhen, pred)));
47693
- var currentTracerPropagation = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"), () => unsafeMake10(true));
47694
- var withTracerPropagation = /* @__PURE__ */ dual(2, (self, enabled2) => transformResponse(self, locally(currentTracerPropagation, enabled2)));
47433
+ var currentTracerDisabledWhen = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"), () => unsafeMake9(constFalse));
47434
+ var currentTracerPropagation = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"), () => unsafeMake9(true));
47695
47435
  var SpanNameGenerator = /* @__PURE__ */ Reference2()("@effect/platform/HttpClient/SpanNameGenerator", {
47696
47436
  defaultValue: () => (request2) => `http.client ${request2.method}`
47697
47437
  });
47698
- var withSpanNameGenerator = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, provideService2(SpanNameGenerator, f)));
47699
47438
  var ClientProto = {
47700
47439
  [TypeId34]: TypeId34,
47701
47440
  pipe() {
@@ -47729,7 +47468,6 @@ var ClientProto = {
47729
47468
  return this.execute(options3(url2, options4));
47730
47469
  }
47731
47470
  };
47732
- var isClient = (u) => hasProperty(u, TypeId34);
47733
47471
  var makeWith = (postprocess, preprocess) => {
47734
47472
  const self = Object.create(ClientProto);
47735
47473
  self.preprocess = preprocess;
@@ -47905,230 +47643,42 @@ class InterruptibleResponse {
47905
47643
  return this.original[NodeInspectSymbol]();
47906
47644
  }
47907
47645
  }
47908
- var withScope = (self) => transform3(self, (effect3, request2) => {
47909
- const controller = new AbortController;
47910
- scopedRequests.set(request2, controller);
47911
- return zipRight3(scopeWith2((scope5) => addFinalizer2(scope5, sync3(() => controller.abort()))), effect3);
47912
- });
47913
- var {
47914
- del: del2,
47915
- execute: execute2,
47916
- get: get18,
47917
- head: head8,
47918
- options: options4,
47919
- patch: patch10,
47920
- post: post2,
47921
- put: put2
47922
- } = /* @__PURE__ */ serviceFunctions2(tag5);
47923
- var transform3 = /* @__PURE__ */ dual(2, (self, f) => {
47924
- const client = self;
47925
- return makeWith(flatMap10((request2) => f(client.postprocess(succeed8(request2)), request2)), client.preprocess);
47926
- });
47927
- var filterStatus2 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, flatMap10(filterStatus(f))));
47928
- var filterStatusOk2 = (self) => transformResponse(self, flatMap10(filterStatusOk));
47929
47646
  var transformResponse = /* @__PURE__ */ dual(2, (self, f) => {
47930
47647
  const client = self;
47931
47648
  return makeWith((request2) => f(client.postprocess(request2)), client.preprocess);
47932
47649
  });
47933
- var catchTag4 = /* @__PURE__ */ dual(3, (self, tag6, f) => transformResponse(self, catchTag2(tag6, f)));
47934
- var catchTags4 = /* @__PURE__ */ dual(2, (self, cases) => transformResponse(self, catchTags2(cases)));
47935
- var catchAll7 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, catchAll3(f)));
47936
- var filterOrElse3 = /* @__PURE__ */ dual(3, (self, f, orElse17) => transformResponse(self, filterOrElse2(f, orElse17)));
47937
- var filterOrFail3 = /* @__PURE__ */ dual(3, (self, f, orFailWith) => transformResponse(self, filterOrFail2(f, orFailWith)));
47938
47650
  var mapRequest = /* @__PURE__ */ dual(2, (self, f) => {
47939
47651
  const client = self;
47940
47652
  return makeWith(client.postprocess, (request2) => map17(client.preprocess(request2), f));
47941
47653
  });
47942
- var mapRequestEffect = /* @__PURE__ */ dual(2, (self, f) => {
47943
- const client = self;
47944
- return makeWith(client.postprocess, (request2) => flatMap10(client.preprocess(request2), f));
47945
- });
47946
- var mapRequestInput = /* @__PURE__ */ dual(2, (self, f) => {
47947
- const client = self;
47948
- return makeWith(client.postprocess, (request2) => client.preprocess(f(request2)));
47949
- });
47950
- var mapRequestInputEffect = /* @__PURE__ */ dual(2, (self, f) => {
47951
- const client = self;
47952
- return makeWith(client.postprocess, (request2) => flatMap10(f(request2), client.preprocess));
47953
- });
47954
- var retry5 = /* @__PURE__ */ dual(2, (self, policy) => transformResponse(self, retry2(policy)));
47955
- var retryTransient = /* @__PURE__ */ dual(2, (self, options5) => {
47956
- const isOnlySchedule = ScheduleTypeId2 in options5;
47957
- const mode = isOnlySchedule ? "both" : options5.mode ?? "both";
47958
- const schedule3 = isOnlySchedule ? options5 : options5.schedule;
47959
- const passthroughSchedule = schedule3 && passthrough4(schedule3);
47960
- const times2 = isOnlySchedule ? undefined : options5.times;
47961
- return transformResponse(self, flow(mode === "errors-only" ? identity : repeat({
47962
- schedule: passthroughSchedule,
47963
- times: times2,
47964
- while: isTransientResponse
47965
- }), mode === "response-only" ? identity : retry2({
47966
- while: isOnlySchedule || options5.while === undefined ? isTransientError : or(isTransientError, options5.while),
47967
- schedule: schedule3,
47968
- times: times2
47969
- })));
47970
- });
47971
- var isTransientError = (error4) => hasProperty(error4, TimeoutExceptionTypeId2) || isTransientHttpError(error4);
47972
- var isTransientHttpError = (error4) => isHttpClientError(error4) && (error4._tag === "RequestError" && error4.reason === "Transport" || error4._tag === "ResponseError" && isTransientResponse(error4.response));
47973
- var isTransientResponse = (response) => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;
47974
- var tap6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tap3(f)));
47975
- var tapError6 = /* @__PURE__ */ dual(2, (self, f) => transformResponse(self, tapError3(f)));
47976
- var tapRequest = /* @__PURE__ */ dual(2, (self, f) => {
47977
- const client = self;
47978
- return makeWith(client.postprocess, (request2) => tap3(client.preprocess(request2), f));
47979
- });
47980
- var withCookiesRef = /* @__PURE__ */ dual(2, (self, ref) => {
47981
- const client = self;
47982
- return makeWith((request2) => tap3(client.postprocess(request2), (response) => update3(ref, (cookies) => merge11(cookies, response.cookies))), (request2) => flatMap10(client.preprocess(request2), (request3) => map17(get11(ref), (cookies) => isEmpty17(cookies) ? request3 : setHeader(request3, "cookie", toCookieHeader(cookies)))));
47983
- });
47984
- var followRedirects = /* @__PURE__ */ dual((args2) => isClient(args2[0]), (self, maxRedirects) => {
47985
- const client = self;
47986
- return makeWith((request2) => {
47987
- const loop3 = (request3, redirects) => flatMap10(client.postprocess(succeed8(request3)), (response) => response.status >= 300 && response.status < 400 && response.headers.location && redirects < (maxRedirects ?? 10) ? loop3(setUrl(request3, new URL(response.headers.location, response.request.url)), redirects + 1) : succeed8(response));
47988
- return flatMap10(request2, (request3) => loop3(request3, 0));
47989
- }, client.preprocess);
47990
- });
47991
47654
  var layerMergedContext = (effect3) => effect(tag5, flatMap10(context3(), (context8) => map17(effect3, (client) => transformResponse(client, mapInputContext2((input) => merge3(context8, input))))));
47992
47655
 
47993
47656
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClient.js
47994
- var TypeId35 = TypeId34;
47995
47657
  var HttpClient = tag5;
47996
- var execute3 = execute2;
47997
- var get19 = get18;
47998
- var head9 = head8;
47999
- var post3 = post2;
48000
- var patch11 = patch10;
48001
- var put3 = put2;
48002
- var del3 = del2;
48003
- var options5 = options4;
48004
- var catchAll8 = catchAll7;
48005
- var catchTag5 = catchTag4;
48006
- var catchTags5 = catchTags4;
48007
- var filterOrElse4 = filterOrElse3;
48008
- var filterOrFail4 = filterOrFail3;
48009
- var filterStatus3 = filterStatus2;
48010
- var filterStatusOk3 = filterStatusOk2;
48011
- var makeWith2 = makeWith;
48012
- var make66 = make65;
48013
- var transform4 = transform3;
48014
- var transformResponse2 = transformResponse;
48015
47658
  var mapRequest2 = mapRequest;
48016
- var mapRequestEffect2 = mapRequestEffect;
48017
- var mapRequestInput2 = mapRequestInput;
48018
- var mapRequestInputEffect2 = mapRequestInputEffect;
48019
- var retry6 = retry5;
48020
- var retryTransient2 = retryTransient;
48021
- var tap7 = tap6;
48022
- var tapError7 = tapError6;
48023
- var tapRequest2 = tapRequest;
48024
- var withCookiesRef2 = withCookiesRef;
48025
- var followRedirects2 = followRedirects;
48026
- var currentTracerDisabledWhen2 = currentTracerDisabledWhen;
48027
- var withTracerDisabledWhen2 = withTracerDisabledWhen;
48028
- var currentTracerPropagation2 = currentTracerPropagation;
48029
- var withTracerPropagation2 = withTracerPropagation;
48030
- var layerMergedContext2 = layerMergedContext;
48031
- var SpanNameGenerator2 = SpanNameGenerator;
48032
- var withSpanNameGenerator2 = withSpanNameGenerator;
48033
- var withScope2 = withScope;
48034
47659
 
48035
47660
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpClientRequest.js
48036
- var exports_HttpClientRequest = {};
48037
- __export(exports_HttpClientRequest, {
48038
- updateUrl: () => updateUrl2,
48039
- toUrl: () => toUrl2,
48040
- setUrlParams: () => setUrlParams2,
48041
- setUrlParam: () => setUrlParam2,
48042
- setUrl: () => setUrl2,
48043
- setMethod: () => setMethod2,
48044
- setHeaders: () => setHeaders2,
48045
- setHeader: () => setHeader2,
48046
- setHash: () => setHash2,
48047
- setBody: () => setBody2,
48048
- schemaBodyJson: () => schemaBodyJson2,
48049
- removeHash: () => removeHash2,
48050
- put: () => put4,
48051
- prependUrl: () => prependUrl2,
48052
- post: () => post4,
48053
- patch: () => patch12,
48054
- options: () => options6,
48055
- modify: () => modify7,
48056
- make: () => make67,
48057
- head: () => head10,
48058
- get: () => get20,
48059
- del: () => del4,
48060
- bodyUrlParams: () => bodyUrlParams2,
48061
- bodyUnsafeJson: () => bodyUnsafeJson2,
48062
- bodyUint8Array: () => bodyUint8Array2,
48063
- bodyText: () => bodyText2,
48064
- bodyStream: () => bodyStream2,
48065
- bodyJson: () => bodyJson2,
48066
- bodyFormDataRecord: () => bodyFormDataRecord2,
48067
- bodyFormData: () => bodyFormData2,
48068
- bodyFileWeb: () => bodyFileWeb2,
48069
- bodyFile: () => bodyFile2,
48070
- bearerToken: () => bearerToken2,
48071
- basicAuth: () => basicAuth2,
48072
- appendUrlParams: () => appendUrlParams2,
48073
- appendUrlParam: () => appendUrlParam2,
48074
- appendUrl: () => appendUrl2,
48075
- acceptJson: () => acceptJson2,
48076
- accept: () => accept2,
48077
- TypeId: () => TypeId36
48078
- });
48079
- var TypeId36 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientRequest");
48080
- var make67 = make64;
48081
- var get20 = get17;
48082
- var post4 = post;
48083
- var patch12 = patch9;
48084
- var put4 = put;
48085
- var del4 = del;
48086
- var head10 = head7;
48087
- var options6 = options3;
48088
- var modify7 = modify6;
48089
- var setMethod2 = setMethod;
48090
- var setHeader2 = setHeader;
47661
+ var make66 = make64;
48091
47662
  var setHeaders2 = setHeaders;
48092
- var basicAuth2 = basicAuth;
48093
- var bearerToken2 = bearerToken;
48094
- var accept2 = accept;
48095
- var acceptJson2 = acceptJson;
48096
47663
  var setUrl2 = setUrl;
48097
47664
  var prependUrl2 = prependUrl;
48098
- var appendUrl2 = appendUrl;
48099
- var updateUrl2 = updateUrl;
48100
- var setUrlParam2 = setUrlParam;
48101
47665
  var setUrlParams2 = setUrlParams;
48102
- var appendUrlParam2 = appendUrlParam;
48103
47666
  var appendUrlParams2 = appendUrlParams;
48104
- var setHash2 = setHash;
48105
- var removeHash2 = removeHash;
48106
- var toUrl2 = toUrl;
48107
47667
  var setBody2 = setBody;
48108
- var bodyUint8Array2 = bodyUint8Array;
48109
- var bodyText2 = bodyText;
48110
- var bodyJson2 = bodyJson;
48111
- var bodyUnsafeJson2 = bodyUnsafeJson;
48112
- var schemaBodyJson2 = schemaBodyJson;
48113
- var bodyUrlParams2 = bodyUrlParams;
48114
47668
  var bodyFormData2 = bodyFormData;
48115
- var bodyFormDataRecord2 = bodyFormDataRecord;
48116
- var bodyStream2 = bodyStream;
48117
- var bodyFile2 = bodyFile;
48118
- var bodyFileWeb2 = bodyFileWeb;
48119
47669
 
48120
47670
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpMethod.js
48121
47671
  var hasBody = (method) => method !== "GET" && method !== "HEAD" && method !== "OPTIONS";
48122
47672
 
48123
47673
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpBody.js
48124
- var TypeId37 = TypeId31;
48125
- var isHttpBody = (u) => hasProperty(u, TypeId37);
47674
+ var TypeId35 = TypeId31;
47675
+ var isHttpBody = (u) => hasProperty(u, TypeId35);
48126
47676
  var uint8Array2 = uint8Array;
48127
47677
  var text11 = text10;
48128
47678
  var urlParams2 = urlParams;
48129
47679
 
48130
47680
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/internal/mailbox.js
48131
- var TypeId38 = /* @__PURE__ */ Symbol.for("effect/Mailbox");
47681
+ var TypeId36 = /* @__PURE__ */ Symbol.for("effect/Mailbox");
48132
47682
  var ReadonlyTypeId = /* @__PURE__ */ Symbol.for("effect/Mailbox/ReadonlyMailbox");
48133
47683
  var empty46 = /* @__PURE__ */ empty7();
48134
47684
  var exitEmpty = /* @__PURE__ */ exitSucceed(empty46);
@@ -48140,7 +47690,7 @@ class MailboxImpl extends Class2 {
48140
47690
  scheduler;
48141
47691
  capacity;
48142
47692
  strategy;
48143
- [TypeId38] = TypeId38;
47693
+ [TypeId36] = TypeId36;
48144
47694
  [ReadonlyTypeId] = ReadonlyTypeId;
48145
47695
  state = {
48146
47696
  _tag: "Open",
@@ -48536,23 +48086,23 @@ class MailboxImpl extends Class2 {
48536
48086
  openState.awaiters.clear();
48537
48087
  }
48538
48088
  }
48539
- var make68 = (capacity3) => withFiberRuntime((fiber) => succeed(new MailboxImpl(fiber.currentScheduler, typeof capacity3 === "number" ? capacity3 : capacity3?.capacity ?? Number.POSITIVE_INFINITY, typeof capacity3 === "number" ? "suspend" : capacity3?.strategy ?? "suspend")));
48089
+ var make67 = (capacity3) => withFiberRuntime((fiber) => succeed(new MailboxImpl(fiber.currentScheduler, typeof capacity3 === "number" ? capacity3 : capacity3?.capacity ?? Number.POSITIVE_INFINITY, typeof capacity3 === "number" ? "suspend" : capacity3?.strategy ?? "suspend")));
48540
48090
  var toChannel3 = (self) => {
48541
48091
  const loop3 = flatMap13(self.takeAll, ([messages, done9]) => done9 ? messages.length === 0 ? void_5 : write(messages) : zipRight4(write(messages), loop3));
48542
48092
  return loop3;
48543
48093
  };
48544
48094
 
48545
48095
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/Mailbox.js
48546
- var TypeId39 = TypeId38;
48547
- var isMailbox = (u) => hasProperty(u, TypeId39);
48548
- var make69 = make68;
48096
+ var TypeId37 = TypeId36;
48097
+ var isMailbox = (u) => hasProperty(u, TypeId37);
48098
+ var make68 = make67;
48549
48099
  var toChannel4 = toChannel3;
48550
48100
 
48551
48101
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/FiberSet.js
48552
- var TypeId40 = /* @__PURE__ */ Symbol.for("effect/FiberSet");
48553
- var isFiberSet = (u) => hasProperty(u, TypeId40);
48102
+ var TypeId38 = /* @__PURE__ */ Symbol.for("effect/FiberSet");
48103
+ var isFiberSet = (u) => hasProperty(u, TypeId38);
48554
48104
  var Proto6 = {
48555
- [TypeId40]: TypeId40,
48105
+ [TypeId38]: TypeId38,
48556
48106
  [Symbol.iterator]() {
48557
48107
  if (this.state._tag === "Closed") {
48558
48108
  return empty2();
@@ -48575,7 +48125,7 @@ var Proto6 = {
48575
48125
  return pipeArguments(this, arguments);
48576
48126
  }
48577
48127
  };
48578
- var unsafeMake13 = (backing, deferred) => {
48128
+ var unsafeMake12 = (backing, deferred) => {
48579
48129
  const self = Object.create(Proto6);
48580
48130
  self.state = {
48581
48131
  _tag: "Open",
@@ -48584,7 +48134,7 @@ var unsafeMake13 = (backing, deferred) => {
48584
48134
  self.deferred = deferred;
48585
48135
  return self;
48586
48136
  };
48587
- var make70 = () => acquireRelease2(map17(make40(), (deferred) => unsafeMake13(new Set, deferred)), (set11) => withFiberRuntime2((parent) => {
48137
+ var make69 = () => acquireRelease2(map17(make40(), (deferred) => unsafeMake12(new Set, deferred)), (set11) => withFiberRuntime2((parent) => {
48588
48138
  const state = set11.state;
48589
48139
  if (state._tag === "Closed")
48590
48140
  return _void;
@@ -48604,9 +48154,9 @@ var isInternalInterruption = /* @__PURE__ */ reduceWithContext3(undefined, {
48604
48154
  sequentialCase: (_, left3, right3) => left3 || right3,
48605
48155
  parallelCase: (_, left3, right3) => left3 || right3
48606
48156
  });
48607
- var unsafeAdd = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber, options7) => {
48157
+ var unsafeAdd = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber, options5) => {
48608
48158
  if (self.state._tag === "Closed") {
48609
- fiber.unsafeInterruptAsFork(combine3(options7?.interruptAs ?? none4, internalFiberId));
48159
+ fiber.unsafeInterruptAsFork(combine3(options5?.interruptAs ?? none4, internalFiberId));
48610
48160
  return;
48611
48161
  } else if (self.state.backing.has(fiber)) {
48612
48162
  return;
@@ -48617,7 +48167,7 @@ var unsafeAdd = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fib
48617
48167
  return;
48618
48168
  }
48619
48169
  self.state.backing.delete(fiber);
48620
- if (isFailure2(exit3) && (options7?.propagateInterruption === true ? !isInternalInterruption(exit3.cause) : !isInterruptedOnly2(exit3.cause))) {
48170
+ if (isFailure2(exit3) && (options5?.propagateInterruption === true ? !isInternalInterruption(exit3.cause) : !isInterruptedOnly2(exit3.cause))) {
48621
48171
  unsafeDone(self.deferred, exit3);
48622
48172
  }
48623
48173
  });
@@ -48628,9 +48178,9 @@ var join4 = (self) => _await3(self.deferred);
48628
48178
  var exports_HttpApi = {};
48629
48179
  __export(exports_HttpApi, {
48630
48180
  reflect: () => reflect,
48631
- make: () => make71,
48181
+ make: () => make70,
48632
48182
  isHttpApi: () => isHttpApi,
48633
- TypeId: () => TypeId41,
48183
+ TypeId: () => TypeId39,
48634
48184
  Api: () => Api,
48635
48185
  AdditionalSchemas: () => AdditionalSchemas
48636
48186
  });
@@ -48783,23 +48333,23 @@ var param = /* @__PURE__ */ dual(2, (name, schema) => {
48783
48333
  var Empty = (status2) => Void.annotations(annotations3({
48784
48334
  status: status2
48785
48335
  }));
48786
- var asEmpty = /* @__PURE__ */ dual(2, (self, options7) => transform2(Void.annotations(self.ast.annotations), typeSchema(self), {
48787
- decode: options7.decode,
48336
+ var asEmpty = /* @__PURE__ */ dual(2, (self, options5) => transform2(Void.annotations(self.ast.annotations), typeSchema(self), {
48337
+ decode: options5.decode,
48788
48338
  encode: constVoid
48789
48339
  }).annotations(annotations3({
48790
- status: options7.status,
48340
+ status: options5.status,
48791
48341
  [AnnotationEmptyDecodeable]: true
48792
48342
  })));
48793
48343
  var Created = /* @__PURE__ */ Empty(201);
48794
48344
  var Accepted = /* @__PURE__ */ Empty(202);
48795
48345
  var NoContent = /* @__PURE__ */ Empty(204);
48796
48346
  var MultipartTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiSchema/Multipart");
48797
- var Multipart = (self, options7) => self.annotations({
48798
- [AnnotationMultipart]: options7 ?? {}
48347
+ var Multipart = (self, options5) => self.annotations({
48348
+ [AnnotationMultipart]: options5 ?? {}
48799
48349
  });
48800
48350
  var MultipartStreamTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiSchema/MultipartStream");
48801
- var MultipartStream = (self, options7) => self.annotations({
48802
- [AnnotationMultipartStream]: options7 ?? {}
48351
+ var MultipartStream = (self, options5) => self.annotations({
48352
+ [AnnotationMultipartStream]: options5 ?? {}
48803
48353
  });
48804
48354
  var defaultContentType = (encoding) => {
48805
48355
  switch (encoding) {
@@ -48817,25 +48367,25 @@ var defaultContentType = (encoding) => {
48817
48367
  }
48818
48368
  }
48819
48369
  };
48820
- var withEncoding = /* @__PURE__ */ dual(2, (self, options7) => self.annotations({
48370
+ var withEncoding = /* @__PURE__ */ dual(2, (self, options5) => self.annotations({
48821
48371
  [AnnotationEncoding]: {
48822
- kind: options7.kind,
48823
- contentType: options7.contentType ?? defaultContentType(options7.kind)
48372
+ kind: options5.kind,
48373
+ contentType: options5.contentType ?? defaultContentType(options5.kind)
48824
48374
  },
48825
- ...options7.kind === "Uint8Array" ? {
48375
+ ...options5.kind === "Uint8Array" ? {
48826
48376
  jsonSchema: {
48827
48377
  type: "string",
48828
48378
  format: "binary"
48829
48379
  }
48830
48380
  } : undefined
48831
48381
  }));
48832
- var Text = (options7) => withEncoding(String$, {
48382
+ var Text = (options5) => withEncoding(String$, {
48833
48383
  kind: "Text",
48834
- ...options7
48384
+ ...options5
48835
48385
  });
48836
- var Uint8Array2 = (options7) => withEncoding(Uint8ArrayFromSelf, {
48386
+ var Uint8Array2 = (options5) => withEncoding(Uint8ArrayFromSelf, {
48837
48387
  kind: "Uint8Array",
48838
- ...options7
48388
+ ...options5
48839
48389
  });
48840
48390
  var astCache2 = /* @__PURE__ */ globalValue("@effect/platform/HttpApiSchema/astCache", () => new WeakMap);
48841
48391
  var deunionize = (schemas, schema) => {
@@ -48862,11 +48412,11 @@ var deunionize = (schemas, schema) => {
48862
48412
  schemas.add(schema);
48863
48413
  }
48864
48414
  };
48865
- var EmptyError = () => (options7) => {
48866
- const symbol3 = Symbol.for(`@effect/platform/HttpApiSchema/EmptyError/${options7.tag}`);
48415
+ var EmptyError = () => (options5) => {
48416
+ const symbol3 = Symbol.for(`@effect/platform/HttpApiSchema/EmptyError/${options5.tag}`);
48867
48417
 
48868
48418
  class EmptyError2 extends StructuralClass {
48869
- _tag = options7.tag;
48419
+ _tag = options5.tag;
48870
48420
  commit() {
48871
48421
  return fail9(this);
48872
48422
  }
@@ -48879,21 +48429,21 @@ var EmptyError = () => (options7) => {
48879
48429
  return make53(this.ast).annotations(annotations4);
48880
48430
  }
48881
48431
  });
48882
- let transform5;
48432
+ let transform4;
48883
48433
  Object.defineProperty(EmptyError2, "ast", {
48884
48434
  get() {
48885
- if (transform5) {
48886
- return transform5.ast;
48435
+ if (transform4) {
48436
+ return transform4.ast;
48887
48437
  }
48888
48438
  const self = this;
48889
- transform5 = asEmpty(declare((u) => hasProperty(u, symbol3), {
48890
- identifier: options7.tag,
48891
- title: options7.tag
48439
+ transform4 = asEmpty(declare((u) => hasProperty(u, symbol3), {
48440
+ identifier: options5.tag,
48441
+ title: options5.tag
48892
48442
  }), {
48893
- status: options7.status,
48443
+ status: options5.status,
48894
48444
  decode: constant(new self)
48895
48445
  });
48896
- return transform5.ast;
48446
+ return transform4.ast;
48897
48447
  }
48898
48448
  });
48899
48449
  return EmptyError2;
@@ -48925,13 +48475,13 @@ class HttpApiDecodeError extends (/* @__PURE__ */ TaggedError2()("HttpApiDecodeE
48925
48475
  }
48926
48476
 
48927
48477
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApi.js
48928
- var TypeId41 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApi");
48929
- var isHttpApi = (u) => hasProperty(u, TypeId41);
48478
+ var TypeId39 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApi");
48479
+ var isHttpApi = (u) => hasProperty(u, TypeId39);
48930
48480
 
48931
48481
  class Api extends (/* @__PURE__ */ Tag2("@effect/platform/HttpApi/Api")()) {
48932
48482
  }
48933
48483
  var Proto7 = {
48934
- [TypeId41]: TypeId41,
48484
+ [TypeId39]: TypeId39,
48935
48485
  pipe() {
48936
48486
  return pipeArguments(this, arguments);
48937
48487
  },
@@ -49010,41 +48560,41 @@ var Proto7 = {
49010
48560
  });
49011
48561
  }
49012
48562
  };
49013
- var makeProto2 = (options7) => {
48563
+ var makeProto2 = (options5) => {
49014
48564
  function HttpApi() {}
49015
48565
  Object.setPrototypeOf(HttpApi, Proto7);
49016
- HttpApi.groups = options7.groups;
49017
- HttpApi.errorSchema = options7.errorSchema;
49018
- HttpApi.annotations = options7.annotations;
49019
- HttpApi.middlewares = options7.middlewares;
48566
+ HttpApi.groups = options5.groups;
48567
+ HttpApi.errorSchema = options5.errorSchema;
48568
+ HttpApi.annotations = options5.annotations;
48569
+ HttpApi.middlewares = options5.middlewares;
49020
48570
  return HttpApi;
49021
48571
  };
49022
- var make71 = (identifier2) => makeProto2({
48572
+ var make70 = (identifier2) => makeProto2({
49023
48573
  identifier: identifier2,
49024
48574
  groups: new Map,
49025
48575
  errorSchema: HttpApiDecodeError,
49026
48576
  annotations: empty6(),
49027
48577
  middlewares: new Set
49028
48578
  });
49029
- var reflect = (self, options7) => {
48579
+ var reflect = (self, options5) => {
49030
48580
  const apiErrors = extractMembers(self.errorSchema.ast, new Map, getStatusErrorAST);
49031
48581
  const groups = Object.values(self.groups);
49032
48582
  for (const group5 of groups) {
49033
48583
  const groupErrors = extractMembers(group5.errorSchema.ast, apiErrors, getStatusErrorAST);
49034
48584
  const groupAnnotations = merge3(self.annotations, group5.annotations);
49035
- options7.onGroup({
48585
+ options5.onGroup({
49036
48586
  group: group5,
49037
48587
  mergedAnnotations: groupAnnotations
49038
48588
  });
49039
48589
  const endpoints = Object.values(group5.endpoints);
49040
48590
  for (const endpoint of endpoints) {
49041
- if (options7.predicate && !options7.predicate({
48591
+ if (options5.predicate && !options5.predicate({
49042
48592
  endpoint,
49043
48593
  group: group5
49044
48594
  }))
49045
48595
  continue;
49046
48596
  const errors2 = extractMembers(endpoint.errorSchema.ast, groupErrors, getStatusErrorAST);
49047
- options7.onEndpoint({
48597
+ options5.onEndpoint({
49048
48598
  group: group5,
49049
48599
  endpoint,
49050
48600
  middleware: new Set([...group5.middlewares, ...endpoint.middlewares]),
@@ -49124,46 +48674,8 @@ class AdditionalSchemas extends (/* @__PURE__ */ Tag2("@effect/platform/HttpApi/
49124
48674
  }
49125
48675
 
49126
48676
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiMiddleware.js
49127
- var exports_HttpApiMiddleware = {};
49128
- __export(exports_HttpApiMiddleware, {
49129
- isSecurity: () => isSecurity,
49130
- TypeId: () => TypeId42,
49131
- Tag: () => Tag5,
49132
- SecurityTypeId: () => SecurityTypeId
49133
- });
49134
- var TypeId42 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiMiddleware");
49135
48677
  var SecurityTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiMiddleware/Security");
49136
48678
  var isSecurity = (u) => hasProperty(u, SecurityTypeId);
49137
- var Tag5 = () => (id2, options7) => {
49138
- const Err = globalThis.Error;
49139
- const limit = Err.stackTraceLimit;
49140
- Err.stackTraceLimit = 2;
49141
- const creationError = new Err;
49142
- Err.stackTraceLimit = limit;
49143
- function TagClass() {}
49144
- const TagClass_ = TagClass;
49145
- Object.setPrototypeOf(TagClass, Object.getPrototypeOf(GenericTag(id2)));
49146
- TagClass.key = id2;
49147
- Object.defineProperty(TagClass, "stack", {
49148
- get() {
49149
- return creationError.stack;
49150
- }
49151
- });
49152
- TagClass_[TypeId42] = TypeId42;
49153
- TagClass_.failure = options7?.optional === true || options7?.failure === undefined ? Never : options7.failure;
49154
- if (options7?.provides) {
49155
- TagClass_.provides = options7.provides;
49156
- }
49157
- TagClass_.optional = options7?.optional ?? false;
49158
- if (options7?.security) {
49159
- if (Object.keys(options7.security).length === 0) {
49160
- throw new Error("HttpApiMiddleware.Tag: security object must not be empty");
49161
- }
49162
- TagClass_[SecurityTypeId] = SecurityTypeId;
49163
- TagClass_.security = options7.security;
49164
- }
49165
- return TagClass;
49166
- };
49167
48679
 
49168
48680
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/httpRouter.js
49169
48681
  var removeTrailingSlash = (path2) => path2.endsWith("/") ? path2.slice(0, -1) : path2;
@@ -49196,13 +48708,13 @@ __export(exports_OpenApi, {
49196
48708
  });
49197
48709
 
49198
48710
  // ../../node_modules/.bun/effect@3.21.2/node_modules/effect/dist/esm/JSONSchema.js
49199
- var fromAST = (ast, options8) => {
49200
- const definitionPath = options8.definitionPath ?? "#/$defs/";
48711
+ var fromAST = (ast, options6) => {
48712
+ const definitionPath = options6.definitionPath ?? "#/$defs/";
49201
48713
  const getRef = (id2) => definitionPath + id2;
49202
- const target = options8.target ?? "jsonSchema7";
49203
- const topLevelReferenceStrategy = options8.topLevelReferenceStrategy ?? "keep";
49204
- const additionalPropertiesStrategy = options8.additionalPropertiesStrategy ?? "strict";
49205
- return go3(ast, options8.definitions, "handle-identifier", [], {
48714
+ const target = options6.target ?? "jsonSchema7";
48715
+ const topLevelReferenceStrategy = options6.topLevelReferenceStrategy ?? "keep";
48716
+ const additionalPropertiesStrategy = options6.additionalPropertiesStrategy ?? "strict";
48717
+ return go3(ast, options6.definitions, "handle-identifier", [], {
49206
48718
  getRef,
49207
48719
  target,
49208
48720
  topLevelReferenceStrategy,
@@ -49393,8 +48905,8 @@ var mergeRefinements = (from, jsonSchema2, ast) => {
49393
48905
  }
49394
48906
  return out;
49395
48907
  };
49396
- function isContentSchemaSupported(options8) {
49397
- switch (options8.target) {
48908
+ function isContentSchemaSupported(options6) {
48909
+ switch (options6.target) {
49398
48910
  case "jsonSchema7":
49399
48911
  return false;
49400
48912
  case "jsonSchema2019-09":
@@ -49403,8 +48915,8 @@ function isContentSchemaSupported(options8) {
49403
48915
  return true;
49404
48916
  }
49405
48917
  }
49406
- function getAdditionalProperties(options8) {
49407
- switch (options8.additionalPropertiesStrategy) {
48918
+ function getAdditionalProperties(options6) {
48919
+ switch (options6.additionalPropertiesStrategy) {
49408
48920
  case "allow":
49409
48921
  return true;
49410
48922
  case "strict":
@@ -49445,17 +48957,17 @@ function getIdentifierAnnotation2(ast) {
49445
48957
  }
49446
48958
  return identifier2;
49447
48959
  }
49448
- function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49449
- if (identifier2 === "handle-identifier" && (options8.topLevelReferenceStrategy !== "skip" || isSuspend(ast))) {
48960
+ function go3(ast, $defs, identifier2, path2, options6, annotation, errors2) {
48961
+ if (identifier2 === "handle-identifier" && (options6.topLevelReferenceStrategy !== "skip" || isSuspend(ast))) {
49450
48962
  const id2 = getIdentifierAnnotation2(ast);
49451
48963
  if (id2 !== undefined) {
49452
48964
  const escapedId = id2.replace(/~/ig, "~0").replace(/\//ig, "~1");
49453
48965
  const out = {
49454
- $ref: options8.getRef(escapedId)
48966
+ $ref: options6.getRef(escapedId)
49455
48967
  };
49456
48968
  if (!has($defs, id2)) {
49457
48969
  $defs[id2] = out;
49458
- $defs[id2] = go3(ast, $defs, "ignore-identifier", path2, options8, "handle-annotation", errors2);
48970
+ $defs[id2] = go3(ast, $defs, "ignore-identifier", path2, options6, "handle-annotation", errors2);
49459
48971
  }
49460
48972
  return out;
49461
48973
  }
@@ -49476,14 +48988,14 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49476
48988
  case "Refinement": {
49477
48989
  const t = getTransformationFrom(ast);
49478
48990
  if (t === undefined) {
49479
- return mergeRefinements(go3(ast.from, $defs, identifier2, path2, options8, "handle-annotation", errors2), handler, ast);
48991
+ return mergeRefinements(go3(ast.from, $defs, identifier2, path2, options6, "handle-annotation", errors2), handler, ast);
49480
48992
  } else {
49481
- return go3(t, $defs, identifier2, path2, options8, "handle-annotation", errors2);
48993
+ return go3(t, $defs, identifier2, path2, options6, "handle-annotation", errors2);
49482
48994
  }
49483
48995
  }
49484
48996
  default:
49485
48997
  return {
49486
- ...go3(ast, $defs, identifier2, path2, options8, "ignore-annotation", errors2),
48998
+ ...go3(ast, $defs, identifier2, path2, options6, "ignore-annotation", errors2),
49487
48999
  ...handler
49488
49000
  };
49489
49001
  }
@@ -49492,7 +49004,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49492
49004
  }
49493
49005
  const surrogate = getSurrogateAnnotation(ast);
49494
49006
  if (isSome2(surrogate)) {
49495
- return go3(surrogate.value, $defs, identifier2, path2, options8, "handle-annotation", errors2);
49007
+ return go3(surrogate.value, $defs, identifier2, path2, options6, "handle-annotation", errors2);
49496
49008
  }
49497
49009
  switch (ast._tag) {
49498
49010
  case "Declaration":
@@ -49510,7 +49022,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49510
49022
  return addASTAnnotations(constAny, ast);
49511
49023
  throw new Error(getJSONSchemaMissingIdentifierAnnotationErrorMessage(path2, ast));
49512
49024
  }
49513
- return go3(ast.f(), $defs, "ignore-identifier", path2, options8, "handle-annotation", errors2);
49025
+ return go3(ast.f(), $defs, "ignore-identifier", path2, options6, "handle-annotation", errors2);
49514
49026
  }
49515
49027
  case "NeverKeyword":
49516
49028
  return addASTAnnotations(constNever, ast);
@@ -49575,15 +49087,15 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49575
49087
  }, ast) : addASTAnnotations(constNever, ast);
49576
49088
  }
49577
49089
  case "TupleType": {
49578
- const elements = ast.elements.map((e, i) => mergeJsonSchemaAnnotations(go3(e.type, $defs, "handle-identifier", path2.concat(i), options8, "handle-annotation", errors2), getContextJsonSchemaAnnotations(e.type, e)));
49579
- const rest = ast.rest.map((type2) => mergeJsonSchemaAnnotations(go3(type2.type, $defs, "handle-identifier", path2, options8, "handle-annotation", errors2), getContextJsonSchemaAnnotations(type2.type, type2)));
49090
+ const elements = ast.elements.map((e, i) => mergeJsonSchemaAnnotations(go3(e.type, $defs, "handle-identifier", path2.concat(i), options6, "handle-annotation", errors2), getContextJsonSchemaAnnotations(e.type, e)));
49091
+ const rest = ast.rest.map((type2) => mergeJsonSchemaAnnotations(go3(type2.type, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2), getContextJsonSchemaAnnotations(type2.type, type2)));
49580
49092
  const output = {
49581
49093
  type: "array"
49582
49094
  };
49583
49095
  const len = ast.elements.length;
49584
49096
  if (len > 0) {
49585
49097
  output.minItems = len - ast.elements.filter((element2) => element2.isOptional).length;
49586
- if (options8.target === "jsonSchema7") {
49098
+ if (options6.target === "jsonSchema7") {
49587
49099
  output.items = elements;
49588
49100
  } else {
49589
49101
  output.prefixItems = elements;
@@ -49591,20 +49103,20 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49591
49103
  }
49592
49104
  const restLength = rest.length;
49593
49105
  if (restLength > 0) {
49594
- const head12 = rest[0];
49106
+ const head10 = rest[0];
49595
49107
  const isHomogeneous = restLength === 1 && ast.elements.every((e) => e.type === ast.rest[0].type);
49596
49108
  if (isHomogeneous) {
49597
- if (options8.target === "jsonSchema7") {
49598
- output.items = head12;
49109
+ if (options6.target === "jsonSchema7") {
49110
+ output.items = head10;
49599
49111
  } else {
49600
- output.items = head12;
49112
+ output.items = head10;
49601
49113
  delete output.prefixItems;
49602
49114
  }
49603
49115
  } else {
49604
- if (options8.target === "jsonSchema7") {
49605
- output.additionalItems = head12;
49116
+ if (options6.target === "jsonSchema7") {
49117
+ output.additionalItems = head10;
49606
49118
  } else {
49607
- output.items = head12;
49119
+ output.items = head10;
49608
49120
  }
49609
49121
  }
49610
49122
  if (restLength > 1) {
@@ -49614,7 +49126,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49614
49126
  }
49615
49127
  } else {
49616
49128
  if (len > 0) {
49617
- if (options8.target === "jsonSchema7") {
49129
+ if (options6.target === "jsonSchema7") {
49618
49130
  output.additionalItems = false;
49619
49131
  } else {
49620
49132
  output.items = false;
@@ -49633,7 +49145,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49633
49145
  type: "object",
49634
49146
  required: [],
49635
49147
  properties: {},
49636
- additionalProperties: getAdditionalProperties(options8)
49148
+ additionalProperties: getAdditionalProperties(options6)
49637
49149
  };
49638
49150
  let patternProperties = undefined;
49639
49151
  let propertyNames = undefined;
@@ -49642,11 +49154,11 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49642
49154
  const parameter = is3.parameter;
49643
49155
  switch (parameter._tag) {
49644
49156
  case "StringKeyword": {
49645
- output.additionalProperties = go3(pruned, $defs, "handle-identifier", path2, options8, "handle-annotation", errors2);
49157
+ output.additionalProperties = go3(pruned, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
49646
49158
  break;
49647
49159
  }
49648
49160
  case "TemplateLiteral": {
49649
- patternProperties = go3(pruned, $defs, "handle-identifier", path2, options8, "handle-annotation", errors2);
49161
+ patternProperties = go3(pruned, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
49650
49162
  propertyNames = {
49651
49163
  type: "string",
49652
49164
  pattern: getTemplateLiteralRegExp(parameter).source
@@ -49654,14 +49166,14 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49654
49166
  break;
49655
49167
  }
49656
49168
  case "Refinement": {
49657
- patternProperties = go3(pruned, $defs, "handle-identifier", path2, options8, "handle-annotation", errors2);
49658
- propertyNames = go3(parameter, $defs, "handle-identifier", path2, options8, "handle-annotation", errors2);
49169
+ patternProperties = go3(pruned, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
49170
+ propertyNames = go3(parameter, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2);
49659
49171
  break;
49660
49172
  }
49661
49173
  case "SymbolKeyword": {
49662
49174
  const indexSignaturePath = path2.concat("[symbol]");
49663
- output.additionalProperties = go3(pruned, $defs, "handle-identifier", indexSignaturePath, options8, "handle-annotation", errors2);
49664
- propertyNames = go3(parameter, $defs, "handle-identifier", indexSignaturePath, options8, "handle-annotation", errors2);
49175
+ output.additionalProperties = go3(pruned, $defs, "handle-identifier", indexSignaturePath, options6, "handle-annotation", errors2);
49176
+ propertyNames = go3(parameter, $defs, "handle-identifier", indexSignaturePath, options6, "handle-annotation", errors2);
49665
49177
  break;
49666
49178
  }
49667
49179
  }
@@ -49672,7 +49184,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49672
49184
  if (isString(name)) {
49673
49185
  const pruned = pruneUndefined3(ps.type);
49674
49186
  const type2 = pruned ?? ps.type;
49675
- output.properties[name] = mergeJsonSchemaAnnotations(go3(type2, $defs, "handle-identifier", path2.concat(ps.name), options8, "handle-annotation", errors2), getContextJsonSchemaAnnotations(type2, ps));
49187
+ output.properties[name] = mergeJsonSchemaAnnotations(go3(type2, $defs, "handle-identifier", path2.concat(ps.name), options6, "handle-annotation", errors2), getContextJsonSchemaAnnotations(type2, ps));
49676
49188
  if (!ps.isOptional && pruned === undefined) {
49677
49189
  output.required.push(name);
49678
49190
  }
@@ -49694,7 +49206,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49694
49206
  return addASTAnnotations(output, ast);
49695
49207
  }
49696
49208
  case "Union": {
49697
- const members = ast.types.map((t) => go3(t, $defs, "handle-identifier", path2, options8, "handle-annotation", errors2));
49209
+ const members = ast.types.map((t) => go3(t, $defs, "handle-identifier", path2, options6, "handle-annotation", errors2));
49698
49210
  const anyOf = compactUnion(members);
49699
49211
  switch (anyOf.length) {
49700
49212
  case 0:
@@ -49708,7 +49220,7 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49708
49220
  }
49709
49221
  }
49710
49222
  case "Refinement":
49711
- return go3(ast.from, $defs, identifier2, path2, options8, "handle-annotation", errors2);
49223
+ return go3(ast.from, $defs, identifier2, path2, options6, "handle-annotation", errors2);
49712
49224
  case "TemplateLiteral": {
49713
49225
  const regex = getTemplateLiteralRegExp(ast);
49714
49226
  return addASTAnnotations({
@@ -49724,14 +49236,14 @@ function go3(ast, $defs, identifier2, path2, options8, annotation, errors2) {
49724
49236
  type: "string",
49725
49237
  contentMediaType: "application/json"
49726
49238
  };
49727
- if (isContentSchemaSupported(options8)) {
49728
- out["contentSchema"] = go3(ast.to, $defs, identifier2, path2, options8, "handle-annotation", errors2);
49239
+ if (isContentSchemaSupported(options6)) {
49240
+ out["contentSchema"] = go3(ast.to, $defs, identifier2, path2, options6, "handle-annotation", errors2);
49729
49241
  }
49730
49242
  return out;
49731
49243
  }
49732
- const from = go3(ast.from, $defs, identifier2, path2, options8, "handle-annotation", errors2);
49244
+ const from = go3(ast.from, $defs, identifier2, path2, options6, "handle-annotation", errors2);
49733
49245
  if (ast.transformation._tag === "TypeLiteralTransformation" && isJsonSchema7Object(from)) {
49734
- const to = go3(ast.to, {}, "ignore-identifier", path2, options8, "handle-annotation", "ignore-errors");
49246
+ const to = go3(ast.to, {}, "ignore-identifier", path2, options6, "handle-annotation", "ignore-errors");
49735
49247
  if (isJsonSchema7Object(to)) {
49736
49248
  for (const t of ast.transformation.propertySignatureTransformations) {
49737
49249
  const toKey = t.to;
@@ -49803,13 +49315,13 @@ function compactUnion(members) {
49803
49315
  }
49804
49316
 
49805
49317
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/OpenApiJsonSchema.js
49806
- var fromAST2 = (ast, options8) => {
49318
+ var fromAST2 = (ast, options6) => {
49807
49319
  const jsonSchema2 = fromAST(ast, {
49808
- definitions: options8.defs,
49809
- definitionPath: options8.defsPath ?? "#/components/schemas/",
49320
+ definitions: options6.defs,
49321
+ definitionPath: options6.defsPath ?? "#/components/schemas/",
49810
49322
  target: "openApi3.1",
49811
- topLevelReferenceStrategy: options8.topLevelReferenceStrategy,
49812
- additionalPropertiesStrategy: options8.additionalPropertiesStrategy
49323
+ topLevelReferenceStrategy: options6.topLevelReferenceStrategy,
49324
+ additionalPropertiesStrategy: options6.additionalPropertiesStrategy
49813
49325
  });
49814
49326
  return jsonSchema2;
49815
49327
  };
@@ -49857,11 +49369,11 @@ class Transform extends (/* @__PURE__ */ Tag2("@effect/platform/OpenApi/Transfor
49857
49369
  }
49858
49370
  var contextPartial = (tags2) => {
49859
49371
  const entries2 = Object.entries(tags2);
49860
- return (options8) => {
49372
+ return (options6) => {
49861
49373
  let context8 = empty6();
49862
49374
  for (const [key, tag6] of entries2) {
49863
- if (options8[key] !== undefined) {
49864
- context8 = add2(context8, tag6, options8[key]);
49375
+ if (options6[key] !== undefined) {
49376
+ context8 = add2(context8, tag6, options6[key]);
49865
49377
  }
49866
49378
  }
49867
49379
  return context8;
@@ -49889,7 +49401,7 @@ function processAnnotation(ctx, tag6, f) {
49889
49401
  f(o.value);
49890
49402
  }
49891
49403
  }
49892
- var fromApi = (api, options8) => {
49404
+ var fromApi = (api, options6) => {
49893
49405
  const cached4 = apiCache.get(api);
49894
49406
  if (cached4 !== undefined) {
49895
49407
  return cached4;
@@ -49912,7 +49424,7 @@ var fromApi = (api, options8) => {
49912
49424
  function processAST(ast) {
49913
49425
  return fromAST2(ast, {
49914
49426
  defs: jsonSchemaDefs,
49915
- additionalPropertiesStrategy: options8?.additionalPropertiesStrategy
49427
+ additionalPropertiesStrategy: options6?.additionalPropertiesStrategy
49916
49428
  });
49917
49429
  }
49918
49430
  function processHttpApiSecurity(name, security) {
@@ -50265,7 +49777,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
50265
49777
  const release = sync3(() => requestMap.delete(id3));
50266
49778
  return isFailure2(exit3) ? zipRight3(orDie3(backing.send([id3, 1])), release) : release;
50267
49779
  };
50268
- const execute4 = (request2) => fromChannel4(acquireUseRelease4(executeAcquire(request2, make69()), ({
49780
+ const execute3 = (request2) => fromChannel4(acquireUseRelease4(executeAcquire(request2, make68()), ({
50269
49781
  mailbox
50270
49782
  }) => toChannel4(mailbox), executeRelease));
50271
49783
  const executeEffect = (request2) => acquireUseRelease2(executeAcquire(request2, make40()), ({
@@ -50280,7 +49792,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
50280
49792
  }
50281
49793
  return {
50282
49794
  id: id2,
50283
- execute: execute4,
49795
+ execute: execute3,
50284
49796
  executeEffect
50285
49797
  };
50286
49798
  });
@@ -50288,7 +49800,7 @@ var makeManager = /* @__PURE__ */ gen2(function* () {
50288
49800
  });
50289
49801
  });
50290
49802
  var layerManager = /* @__PURE__ */ effect(WorkerManager, makeManager);
50291
- var makePlatform = () => (options8) => PlatformWorker.of({
49803
+ var makePlatform = () => (options6) => PlatformWorker.of({
50292
49804
  [PlatformWorkerTypeId]: PlatformWorkerTypeId,
50293
49805
  spawn(id2) {
50294
49806
  return gen2(function* () {
@@ -50297,7 +49809,7 @@ var makePlatform = () => (options8) => PlatformWorker.of({
50297
49809
  const buffer3 = [];
50298
49810
  const run10 = (handler) => uninterruptibleMask3((restore) => gen2(function* () {
50299
49811
  const scope5 = yield* scope3;
50300
- const port2 = yield* options8.setup({
49812
+ const port2 = yield* options6.setup({
50301
49813
  worker: spawn(id2),
50302
49814
  scope: scope5
50303
49815
  });
@@ -50306,9 +49818,9 @@ var makePlatform = () => (options8) => PlatformWorker.of({
50306
49818
  currentPort = undefined;
50307
49819
  }));
50308
49820
  const runtime5 = (yield* runtime4()).pipe(updateContext3(omit2(Scope)));
50309
- const fiberSet = yield* make70();
49821
+ const fiberSet = yield* make69();
50310
49822
  const runFork4 = runFork3(runtime5);
50311
- yield* options8.listen({
49823
+ yield* options6.listen({
50312
49824
  port: port2,
50313
49825
  scope: scope5,
50314
49826
  emit(data) {
@@ -50367,11 +49879,11 @@ var requestInitTagKey = "@effect/platform/FetchHttpClient/FetchOptions";
50367
49879
  var fetch2 = /* @__PURE__ */ make65((request2, url2, signal, fiber) => {
50368
49880
  const context8 = fiber.getFiberRef(currentContext2);
50369
49881
  const fetch3 = context8.unsafeMap.get(fetchTagKey) ?? globalThis.fetch;
50370
- const options8 = context8.unsafeMap.get(requestInitTagKey) ?? {};
50371
- const headers = options8.headers ? merge12(fromInput2(options8.headers), request2.headers) : request2.headers;
49882
+ const options6 = context8.unsafeMap.get(requestInitTagKey) ?? {};
49883
+ const headers = options6.headers ? merge11(fromInput2(options6.headers), request2.headers) : request2.headers;
50372
49884
  const send = (body) => map17(tryPromise2({
50373
49885
  try: () => fetch3(url2, {
50374
- ...options8,
49886
+ ...options6,
50375
49887
  method: request2.method,
50376
49888
  headers,
50377
49889
  body,
@@ -50412,7 +49924,7 @@ __export(exports_BunContext, {
50412
49924
  });
50413
49925
 
50414
49926
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/internal/commandExecutor.js
50415
- var TypeId44 = /* @__PURE__ */ Symbol.for("@effect/platform/CommandExecutor");
49927
+ var TypeId41 = /* @__PURE__ */ Symbol.for("@effect/platform/CommandExecutor");
50416
49928
  var ProcessTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/Process");
50417
49929
  var ExitCode = /* @__PURE__ */ nominal();
50418
49930
  var ProcessId = /* @__PURE__ */ nominal();
@@ -50424,7 +49936,7 @@ var makeExecutor = (start3) => {
50424
49936
  return splitLines3(mapChunks2(stream5(command), map5((bytes) => decoder2.decode(bytes))));
50425
49937
  };
50426
49938
  return {
50427
- [TypeId44]: TypeId44,
49939
+ [TypeId41]: TypeId41,
50428
49940
  start: start3,
50429
49941
  exitCode: (command) => scoped2(flatMap10(start3(command), (process2) => process2.exitCode)),
50430
49942
  stream: stream5,
@@ -50482,7 +49994,7 @@ var StandardProto = {
50482
49994
  };
50483
49995
  }
50484
49996
  };
50485
- var makeStandard = (options8) => Object.assign(Object.create(StandardProto), options8);
49997
+ var makeStandard = (options6) => Object.assign(Object.create(StandardProto), options6);
50486
49998
  var PipedProto = {
50487
49999
  ...Proto8,
50488
50000
  _tag: "PipedCommand",
@@ -50495,7 +50007,7 @@ var PipedProto = {
50495
50007
  };
50496
50008
  }
50497
50009
  };
50498
- var makePiped = (options8) => Object.assign(Object.create(PipedProto), options8);
50010
+ var makePiped = (options6) => Object.assign(Object.create(PipedProto), options6);
50499
50011
  var stdin = /* @__PURE__ */ dual(2, (self, input) => {
50500
50012
  switch (self._tag) {
50501
50013
  case "StandardCommand": {
@@ -50565,8 +50077,8 @@ var handleErrnoException = (module, method) => (err, [path2]) => {
50565
50077
  };
50566
50078
 
50567
50079
  // ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.js
50568
- var fromReadable = (evaluate2, onError4, options8) => fromChannel4(fromReadableChannel(evaluate2, onError4, options8));
50569
- var fromReadableChannel = (evaluate2, onError4, options8) => suspend8(() => unsafeReadableRead(evaluate2(), onError4, make13(undefined), options8));
50080
+ var fromReadable = (evaluate2, onError4, options6) => fromChannel4(fromReadableChannel(evaluate2, onError4, options6));
50081
+ var fromReadableChannel = (evaluate2, onError4, options6) => suspend8(() => unsafeReadableRead(evaluate2(), onError4, make13(undefined), options6));
50570
50082
  var writeInput = (writable, onFailure, {
50571
50083
  encoding,
50572
50084
  endOnDone = true
@@ -50604,7 +50116,7 @@ var writeEffect = (writable, encoding) => (chunk4) => chunk4.length === 0 ? _voi
50604
50116
  }
50605
50117
  loop3();
50606
50118
  });
50607
- var unsafeReadableRead = (readable, onError4, exit3, options8) => {
50119
+ var unsafeReadableRead = (readable, onError4, exit3, options6) => {
50608
50120
  if (!readable.readable) {
50609
50121
  return void_6;
50610
50122
  }
@@ -50623,7 +50135,7 @@ var unsafeReadableRead = (readable, onError4, exit3, options8) => {
50623
50135
  readable.on("readable", onReadable);
50624
50136
  readable.on("error", onErr);
50625
50137
  readable.on("end", onEnd2);
50626
- const chunkSize = options8?.chunkSize ? Number(options8.chunkSize) : undefined;
50138
+ const chunkSize = options6?.chunkSize ? Number(options6.chunkSize) : undefined;
50627
50139
  const read3 = suspend8(function loop() {
50628
50140
  let item = readable.read(chunkSize);
50629
50141
  if (item === null) {
@@ -50646,15 +50158,15 @@ var unsafeReadableRead = (readable, onError4, exit3, options8) => {
50646
50158
  readable.off("readable", onReadable);
50647
50159
  readable.off("error", onErr);
50648
50160
  readable.off("end", onEnd2);
50649
- if (options8?.closeOnDone !== false && "closed" in readable && !readable.closed) {
50161
+ if (options6?.closeOnDone !== false && "closed" in readable && !readable.closed) {
50650
50162
  readable.destroy();
50651
50163
  }
50652
50164
  }));
50653
50165
  };
50654
50166
 
50655
50167
  // ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js
50656
- var fromWritable = (evaluate2, onError4, options8) => fromChannel3(fromWritableChannel(evaluate2, onError4, options8));
50657
- var fromWritableChannel = (writable, onError4, options8) => flatMap16(zip5(sync3(() => writable()), make40()), ([writable2, deferred]) => embedInput2(writableOutput(writable2, deferred, onError4), writeInput(writable2, (cause3) => failCause6(deferred, cause3), options8, complete2(deferred, _void))));
50168
+ var fromWritable = (evaluate2, onError4, options6) => fromChannel3(fromWritableChannel(evaluate2, onError4, options6));
50169
+ var fromWritableChannel = (writable, onError4, options6) => flatMap16(zip5(sync3(() => writable()), make40()), ([writable2, deferred]) => embedInput2(writableOutput(writable2, deferred, onError4), writeInput(writable2, (cause3) => failCause6(deferred, cause3), options6, complete2(deferred, _void))));
50658
50170
  var writableOutput = (writable, deferred, onError4) => suspend3(() => {
50659
50171
  function handleError(err) {
50660
50172
  unsafeDone(deferred, fail9(onError4(err)));
@@ -50774,11 +50286,11 @@ var runCommand = (fileSystem) => (command) => {
50774
50286
  if (flattened2.length === 1) {
50775
50287
  return pipe(flattened2[0], runCommand(fileSystem));
50776
50288
  }
50777
- const head12 = flattened2[0];
50289
+ const head10 = flattened2[0];
50778
50290
  const tail2 = flattened2.slice(1);
50779
50291
  const initial = tail2.slice(0, tail2.length - 1);
50780
50292
  const last5 = tail2[tail2.length - 1];
50781
- const stream6 = initial.reduce((stdin3, command2) => pipe(stdin2(command2, stdin3), runCommand(fileSystem), map17((process2) => process2.stdout), unwrapScoped7), pipe(runCommand(fileSystem)(head12), map17((process2) => process2.stdout), unwrapScoped7));
50293
+ const stream6 = initial.reduce((stdin3, command2) => pipe(stdin2(command2, stdin3), runCommand(fileSystem), map17((process2) => process2.stdout), unwrapScoped7), pipe(runCommand(fileSystem)(head10), map17((process2) => process2.stdout), unwrapScoped7));
50782
50294
  return pipe(stdin2(last5, stream6), runCommand(fileSystem));
50783
50295
  }
50784
50296
  }
@@ -50821,12 +50333,12 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
50821
50333
  });
50822
50334
  var access2 = /* @__PURE__ */ (() => {
50823
50335
  const nodeAccess = /* @__PURE__ */ effectify2(NFS.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
50824
- return (path2, options8) => {
50336
+ return (path2, options6) => {
50825
50337
  let mode = NFS.constants.F_OK;
50826
- if (options8?.readable) {
50338
+ if (options6?.readable) {
50827
50339
  mode |= NFS.constants.R_OK;
50828
50340
  }
50829
- if (options8?.writable) {
50341
+ if (options6?.writable) {
50830
50342
  mode |= NFS.constants.W_OK;
50831
50343
  }
50832
50344
  return nodeAccess(path2, mode);
@@ -50834,9 +50346,9 @@ var access2 = /* @__PURE__ */ (() => {
50834
50346
  })();
50835
50347
  var copy3 = /* @__PURE__ */ (() => {
50836
50348
  const nodeCp = /* @__PURE__ */ effectify2(NFS.cp, /* @__PURE__ */ handleErrnoException("FileSystem", "copy"), /* @__PURE__ */ handleBadArgument("copy"));
50837
- return (fromPath, toPath, options8) => nodeCp(fromPath, toPath, {
50838
- force: options8?.overwrite ?? false,
50839
- preserveTimestamps: options8?.preserveTimestamps ?? false,
50349
+ return (fromPath, toPath, options6) => nodeCp(fromPath, toPath, {
50350
+ force: options6?.overwrite ?? false,
50351
+ preserveTimestamps: options6?.preserveTimestamps ?? false,
50840
50352
  recursive: true
50841
50353
  });
50842
50354
  })();
@@ -50858,39 +50370,39 @@ var link2 = /* @__PURE__ */ (() => {
50858
50370
  })();
50859
50371
  var makeDirectory = /* @__PURE__ */ (() => {
50860
50372
  const nodeMkdir = /* @__PURE__ */ effectify2(NFS.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
50861
- return (path2, options8) => nodeMkdir(path2, {
50862
- recursive: options8?.recursive ?? false,
50863
- mode: options8?.mode
50373
+ return (path2, options6) => nodeMkdir(path2, {
50374
+ recursive: options6?.recursive ?? false,
50375
+ mode: options6?.mode
50864
50376
  });
50865
50377
  })();
50866
50378
  var makeTempDirectoryFactory = (method) => {
50867
50379
  const nodeMkdtemp = effectify2(NFS.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
50868
- return (options8) => suspend3(() => {
50869
- const prefix = options8?.prefix ?? "";
50870
- const directory3 = typeof options8?.directory === "string" ? Path3.join(options8.directory, ".") : OS.tmpdir();
50380
+ return (options6) => suspend3(() => {
50381
+ const prefix = options6?.prefix ?? "";
50382
+ const directory3 = typeof options6?.directory === "string" ? Path3.join(options6.directory, ".") : OS.tmpdir();
50871
50383
  return nodeMkdtemp(prefix ? Path3.join(directory3, prefix) : directory3 + "/");
50872
50384
  });
50873
50385
  };
50874
50386
  var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
50875
50387
  var removeFactory = (method) => {
50876
50388
  const nodeRm = effectify2(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
50877
- return (path2, options8) => nodeRm(path2, {
50878
- recursive: options8?.recursive ?? false,
50879
- force: options8?.force ?? false
50389
+ return (path2, options6) => nodeRm(path2, {
50390
+ recursive: options6?.recursive ?? false,
50391
+ force: options6?.force ?? false
50880
50392
  });
50881
50393
  };
50882
50394
  var remove9 = /* @__PURE__ */ removeFactory("remove");
50883
50395
  var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
50884
50396
  const makeDirectory2 = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectoryScoped");
50885
50397
  const removeDirectory = /* @__PURE__ */ removeFactory("makeTempDirectoryScoped");
50886
- return (options8) => acquireRelease2(makeDirectory2(options8), (directory3) => orDie3(removeDirectory(directory3, {
50398
+ return (options6) => acquireRelease2(makeDirectory2(options6), (directory3) => orDie3(removeDirectory(directory3, {
50887
50399
  recursive: true
50888
50400
  })));
50889
50401
  })();
50890
50402
  var openFactory = (method) => {
50891
50403
  const nodeOpen = effectify2(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
50892
50404
  const nodeClose = effectify2(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
50893
- return (path2, options8) => pipe(acquireRelease2(nodeOpen(path2, options8?.flag ?? "r", options8?.mode), (fd) => orDie3(nodeClose(fd))), map17((fd) => makeFile(FileDescriptor(fd), options8?.flag?.startsWith("a") ?? false)));
50405
+ return (path2, options6) => pipe(acquireRelease2(nodeOpen(path2, options6?.flag ?? "r", options6?.mode), (fd) => orDie3(nodeClose(fd))), map17((fd) => makeFile(FileDescriptor(fd), options6?.flag?.startsWith("a") ?? false)));
50894
50406
  };
50895
50407
  var open2 = /* @__PURE__ */ openFactory("open");
50896
50408
  var makeFile = /* @__PURE__ */ (() => {
@@ -51006,7 +50518,7 @@ var makeTempFileFactory = (method) => {
51006
50518
  const makeDirectory2 = makeTempDirectoryFactory(method);
51007
50519
  const open3 = openFactory(method);
51008
50520
  const randomHexString2 = (bytes) => sync3(() => Crypto.randomBytes(bytes).toString("hex"));
51009
- return (options8) => pipe(zip5(makeDirectory2(options8), randomHexString2(6)), map17(([directory3, random4]) => Path3.join(directory3, random4 + (options8?.suffix ?? ""))), tap3((path2) => scoped2(open3(path2, {
50521
+ return (options6) => pipe(zip5(makeDirectory2(options6), randomHexString2(6)), map17(([directory3, random4]) => Path3.join(directory3, random4 + (options6?.suffix ?? ""))), tap3((path2) => scoped2(open3(path2, {
51010
50522
  flag: "w+"
51011
50523
  }))));
51012
50524
  };
@@ -51014,12 +50526,12 @@ var makeTempFile = /* @__PURE__ */ makeTempFileFactory("makeTempFile");
51014
50526
  var makeTempFileScoped = /* @__PURE__ */ (() => {
51015
50527
  const makeFile2 = /* @__PURE__ */ makeTempFileFactory("makeTempFileScoped");
51016
50528
  const removeDirectory = /* @__PURE__ */ removeFactory("makeTempFileScoped");
51017
- return (options8) => acquireRelease2(makeFile2(options8), (file6) => orDie3(removeDirectory(Path3.dirname(file6), {
50529
+ return (options6) => acquireRelease2(makeFile2(options6), (file6) => orDie3(removeDirectory(Path3.dirname(file6), {
51018
50530
  recursive: true
51019
50531
  })));
51020
50532
  })();
51021
- var readDirectory = (path2, options8) => tryPromise2({
51022
- try: () => NFS.promises.readdir(path2, options8),
50533
+ var readDirectory = (path2, options6) => tryPromise2({
50534
+ try: () => NFS.promises.readdir(path2, options6),
51023
50535
  catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path2])
51024
50536
  });
51025
50537
  var readFile2 = (path2) => async((resume2, signal) => {
@@ -51081,9 +50593,9 @@ var utimes2 = /* @__PURE__ */ (() => {
51081
50593
  const nodeUtimes = /* @__PURE__ */ effectify2(NFS.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
51082
50594
  return (path2, atime, mtime) => nodeUtimes(path2, atime, mtime);
51083
50595
  })();
51084
- var watchNode = (path2, options8) => asyncScoped2((emit) => acquireRelease2(sync3(() => {
50596
+ var watchNode = (path2, options6) => asyncScoped2((emit) => acquireRelease2(sync3(() => {
51085
50597
  const watcher = NFS.watch(path2, {
51086
- recursive: options8?.recursive
50598
+ recursive: options6?.recursive
51087
50599
  }, (event, path3) => {
51088
50600
  if (!path3)
51089
50601
  return;
@@ -51121,13 +50633,13 @@ var watchNode = (path2, options8) => asyncScoped2((emit) => acquireRelease2(sync
51121
50633
  });
51122
50634
  return watcher;
51123
50635
  }), (watcher) => sync3(() => watcher.close())));
51124
- var watch2 = (backend, path2, options8) => stat2(path2).pipe(map17((stat3) => backend.pipe(flatMap((_) => _.register(path2, stat3, options8)), getOrElse(() => watchNode(path2, options8)))), unwrap4);
51125
- var writeFile2 = (path2, data, options8) => async((resume2, signal) => {
50636
+ var watch2 = (backend, path2, options6) => stat2(path2).pipe(map17((stat3) => backend.pipe(flatMap((_) => _.register(path2, stat3, options6)), getOrElse(() => watchNode(path2, options6)))), unwrap4);
50637
+ var writeFile2 = (path2, data, options6) => async((resume2, signal) => {
51126
50638
  try {
51127
50639
  NFS.writeFile(path2, data, {
51128
50640
  signal,
51129
- flag: options8?.flag,
51130
- mode: options8?.mode
50641
+ flag: options6?.flag,
50642
+ mode: options6?.mode
51131
50643
  }, (err) => {
51132
50644
  if (err) {
51133
50645
  resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [path2])));
@@ -51162,8 +50674,8 @@ var makeFileSystem = /* @__PURE__ */ map17(/* @__PURE__ */ serviceOption2(WatchB
51162
50674
  symlink: symlink2,
51163
50675
  truncate: truncate2,
51164
50676
  utimes: utimes2,
51165
- watch(path2, options8) {
51166
- return watch2(backend, path2, options8);
50677
+ watch(path2, options6) {
50678
+ return watch2(backend, path2, options6);
51167
50679
  },
51168
50680
  writeFile: writeFile2
51169
50681
  }));
@@ -51224,7 +50736,7 @@ var layer12 = layer11;
51224
50736
  // ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.js
51225
50737
  import * as readline from "readline";
51226
50738
  var defaultShouldQuit = (input) => input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
51227
- var make73 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
50739
+ var make72 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
51228
50740
  const stdin3 = process.stdin;
51229
50741
  const stdout2 = process.stdout;
51230
50742
  const rlRef = yield* make45({
@@ -51250,7 +50762,7 @@ var make73 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
51250
50762
  const isTTY = sync3(() => Boolean(stdout2.isTTY));
51251
50763
  const readInput = gen2(function* () {
51252
50764
  yield* get14(rlRef);
51253
- const mailbox = yield* make69();
50765
+ const mailbox = yield* make68();
51254
50766
  const handleKeypress = (s, k) => {
51255
50767
  const userInput = {
51256
50768
  input: fromNullable(s),
@@ -51292,7 +50804,7 @@ var make73 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
51292
50804
  display
51293
50805
  });
51294
50806
  });
51295
- var layer13 = /* @__PURE__ */ scoped3(Terminal, /* @__PURE__ */ make73(defaultShouldQuit));
50807
+ var layer13 = /* @__PURE__ */ scoped3(Terminal, /* @__PURE__ */ make72(defaultShouldQuit));
51296
50808
 
51297
50809
  // ../../node_modules/.bun/@effect+platform-node-shared@0.59.0+15f69c4693c05b6b/node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.js
51298
50810
  var layer14 = layer13;
@@ -51368,18 +50880,18 @@ var addPrettyLogger = (refs, fiberId3) => {
51368
50880
  value: loggers.pipe(remove4(defaultLogger2), add4(prettyLoggerDefault2))
51369
50881
  });
51370
50882
  };
51371
- var makeRunMain = (f) => dual((args2) => isEffect2(args2[0]), (effect3, options8) => {
51372
- const fiber = options8?.disableErrorReporting === true ? runFork2(effect3, {
51373
- updateRefs: options8?.disablePrettyLogger === true ? undefined : addPrettyLogger
50883
+ var makeRunMain = (f) => dual((args2) => isEffect2(args2[0]), (effect3, options6) => {
50884
+ const fiber = options6?.disableErrorReporting === true ? runFork2(effect3, {
50885
+ updateRefs: options6?.disablePrettyLogger === true ? undefined : addPrettyLogger
51374
50886
  }) : runFork2(tapErrorCause3(effect3, (cause3) => {
51375
50887
  if (isInterruptedOnly2(cause3)) {
51376
50888
  return _void;
51377
50889
  }
51378
50890
  return logError2(cause3);
51379
50891
  }), {
51380
- updateRefs: options8?.disablePrettyLogger === true ? undefined : addPrettyLogger
50892
+ updateRefs: options6?.disablePrettyLogger === true ? undefined : addPrettyLogger
51381
50893
  });
51382
- const teardown = options8?.teardown ?? defaultTeardown;
50894
+ const teardown = options6?.teardown ?? defaultTeardown;
51383
50895
  return f({
51384
50896
  fiber,
51385
50897
  teardown
@@ -51420,176 +50932,21 @@ var runMain2 = runMain;
51420
50932
 
51421
50933
  // ../../node_modules/.bun/@effect+platform-bun@0.89.0+15f69c4693c05b6b/node_modules/@effect/platform-bun/dist/esm/BunRuntime.js
51422
50934
  var runMain3 = runMain2;
51423
- // src/auth/device-flow.ts
51424
- import { execFileSync } from "child_process";
51425
- import { setTimeout as sleep5 } from "timers/promises";
51426
-
51427
- // src/auth/store.ts
51428
- import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
51429
- import { homedir } from "os";
51430
- import path2 from "path";
51431
- var authFileName = "auth.json";
51432
-
51433
- class AuthCredential extends Class6("AuthCredential")({
51434
- accessToken: String$,
51435
- authenticatedAt: String$,
51436
- authBaseUrl: optional(String$),
51437
- expiresAt: optional(String$)
51438
- }) {
51439
- }
51440
- var AuthCredentialJson = parseJson(AuthCredential);
51441
- var decodeAuthCredential = decodeUnknownSync(AuthCredentialJson);
51442
- var encodeAuthCredential = encodeSync(AuthCredentialJson);
51443
- var authConfigDirectory = () => process.env.DP_AUTH_CONFIG_HOME ?? path2.join(process.env.XDG_CONFIG_HOME ?? path2.join(homedir(), ".config"), "devpunks");
51444
- var authConfigPath = () => process.env.DP_AUTH_CONFIG_FILE ?? path2.join(authConfigDirectory(), authFileName);
51445
- var readAuthCredential = () => {
51446
- const filePath = authConfigPath();
51447
- if (!existsSync(filePath)) {
51448
- return null;
51449
- }
51450
- try {
51451
- return decodeAuthCredential(readFileSync(filePath, "utf8"));
51452
- } catch {
51453
- return null;
51454
- }
51455
- };
51456
- var writeAuthCredential = (credential) => {
51457
- const filePath = authConfigPath();
51458
- mkdirSync(path2.dirname(filePath), { recursive: true, mode: 448 });
51459
- writeFileSync(filePath, `${encodeAuthCredential(credential)}
51460
- `, {
51461
- encoding: "utf8",
51462
- mode: 384
51463
- });
51464
- };
51465
- var clearAuthCredential = () => {
51466
- const filePath = authConfigPath();
51467
- if (!existsSync(filePath)) {
51468
- return false;
51469
- }
51470
- rmSync(filePath, { force: true });
51471
- return true;
51472
- };
51473
- var controlPlaneBearerToken = () => {
51474
- const envToken = process.env.DP_CONTROL_PLANE_TOKEN;
51475
- if (envToken !== undefined && envToken.length > 0) {
51476
- return envToken;
51477
- }
51478
- return readAuthCredential()?.accessToken;
51479
- };
51480
-
51481
- // src/auth/device-flow.ts
51482
- var deviceGrantType = "urn:ietf:params:oauth:grant-type:device_code";
51483
- var trimTrailingSlash = (value6) => value6.replace(/\/+$/u, "");
51484
- var authEndpoint = (authBaseUrl, path3) => `${trimTrailingSlash(authBaseUrl)}${path3}`;
51485
- var readJson = async (response) => {
51486
- const value6 = await response.json();
51487
- if (!response.ok) {
51488
- throw new Error(`Auth request failed with HTTP ${response.status}.`);
51489
- }
51490
- return value6;
51491
- };
51492
- var readDeviceToken = async (response) => {
51493
- const value6 = await response.json();
51494
- if (!response.ok && value6.error === undefined) {
51495
- throw new Error(`Auth request failed with HTTP ${response.status}.`);
51496
- }
51497
- return value6;
51498
- };
51499
- var openInBrowser = (url2) => {
51500
- const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
51501
- const args2 = process.platform === "win32" ? ["/c", "start", "", url2] : [url2];
51502
- execFileSync(command, args2, { stdio: "ignore" });
51503
- };
51504
- var performDeviceLogin = async ({
51505
- authBaseUrl,
51506
- clientId,
51507
- scope: scope5,
51508
- openBrowser = true,
51509
- timeoutMs = 5 * 60 * 1000,
51510
- fetch: fetchImpl = fetch,
51511
- sleep: sleepImpl = sleep5,
51512
- openUrl = openInBrowser,
51513
- now: now2 = () => new Date,
51514
- onMessage
51515
- }) => {
51516
- const code2 = await readJson(await fetchImpl(authEndpoint(authBaseUrl, "/device/code"), {
51517
- method: "POST",
51518
- headers: { "content-type": "application/json" },
51519
- body: JSON.stringify({
51520
- client_id: clientId,
51521
- ...scope5 === undefined || scope5.length === 0 ? {} : { scope: scope5 }
51522
- })
51523
- }));
51524
- const verificationUrl = code2.verification_uri_complete ?? code2.verification_uri;
51525
- onMessage?.(`Open ${verificationUrl} and enter code ${code2.user_code}.`);
51526
- if (openBrowser) {
51527
- try {
51528
- openUrl(verificationUrl);
51529
- } catch {
51530
- onMessage?.("Could not open the browser automatically. Open the URL above manually.");
51531
- }
51532
- }
51533
- const startedAt = now2().getTime();
51534
- const authorizationTimeoutMs = code2.expires_in === undefined ? timeoutMs : Math.max(code2.expires_in, 0) * 1000;
51535
- const deadline = startedAt + authorizationTimeoutMs;
51536
- let intervalMs = Math.max(code2.interval ?? 5, 1) * 1000;
51537
- while (now2().getTime() < deadline) {
51538
- await sleepImpl(intervalMs);
51539
- const token = await readDeviceToken(await fetchImpl(authEndpoint(authBaseUrl, "/device/token"), {
51540
- method: "POST",
51541
- headers: { "content-type": "application/json" },
51542
- body: JSON.stringify({
51543
- grant_type: deviceGrantType,
51544
- device_code: code2.device_code,
51545
- client_id: clientId
51546
- })
51547
- }));
51548
- if (token.access_token !== undefined && token.access_token.length > 0) {
51549
- const authenticatedAt = now2();
51550
- const expiresAt = token.expires_in === undefined ? undefined : new Date(authenticatedAt.getTime() + token.expires_in * 1000).toISOString();
51551
- return new AuthCredential({
51552
- accessToken: token.access_token,
51553
- authenticatedAt: authenticatedAt.toISOString(),
51554
- authBaseUrl,
51555
- ...expiresAt === undefined ? {} : { expiresAt }
51556
- });
51557
- }
51558
- switch (token.error) {
51559
- case "authorization_pending":
51560
- break;
51561
- case "slow_down":
51562
- intervalMs += 5000;
51563
- break;
51564
- case "access_denied":
51565
- throw new Error("Device authorization was denied.");
51566
- case "expired_token":
51567
- throw new Error("Device authorization expired. Run `punks auth login` again.");
51568
- default:
51569
- throw new Error(token.error_description ?? "Device authorization failed.");
51570
- }
51571
- }
51572
- throw new Error("Device authorization timed out.");
51573
- };
51574
-
51575
- // src/telemetry/product.ts
51576
- import { randomUUID } from "crypto";
51577
- import { execFileSync as execFileSync2 } from "child_process";
51578
50935
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiClient.js
51579
50936
  var exports_HttpApiClient = {};
51580
50937
  __export(exports_HttpApiClient, {
51581
- makeWith: () => makeWith3,
51582
- make: () => make75,
50938
+ makeWith: () => makeWith2,
50939
+ make: () => make74,
51583
50940
  group: () => group5,
51584
50941
  endpoint: () => endpoint
51585
50942
  });
51586
- var makeClient = (api, options8) => gen2(function* () {
50943
+ var makeClient = (api, options6) => gen2(function* () {
51587
50944
  const context8 = yield* context3();
51588
- const httpClient = options8.httpClient.pipe(options8?.baseUrl === undefined ? identity : mapRequest2(prependUrl2(options8.baseUrl.toString())));
50945
+ const httpClient = options6.httpClient.pipe(options6?.baseUrl === undefined ? identity : mapRequest2(prependUrl2(options6.baseUrl.toString())));
51589
50946
  reflect(api, {
51590
- predicate: options8?.predicate,
50947
+ predicate: options6?.predicate,
51591
50948
  onGroup(onGroupOptions) {
51592
- options8.onGroup?.(onGroupOptions);
50949
+ options6.onGroup?.(onGroupOptions);
51593
50950
  },
51594
50951
  onEndpoint(onEndpointOptions) {
51595
50952
  const {
@@ -51627,7 +50984,7 @@ var makeClient = (api, options8) => gen2(function* () {
51627
50984
  const encodeHeaders = endpoint.headersSchema.pipe(map2(encodeUnknown2));
51628
50985
  const encodeUrlParams = endpoint.urlParamsSchema.pipe(map2(encodeUnknown2));
51629
50986
  const endpointFn = fnUntraced2(function* (request2) {
51630
- let httpRequest = make67(endpoint.method)(endpoint.path);
50987
+ let httpRequest = make66(endpoint.method)(endpoint.path);
51631
50988
  if (request2 && request2.path) {
51632
50989
  const encodedPathParams = encodePath._tag === "Some" ? yield* encodePath.value(request2.path) : request2.path;
51633
50990
  httpRequest = setUrl2(httpRequest, makeUrl2(encodedPathParams));
@@ -51650,24 +51007,24 @@ var makeClient = (api, options8) => gen2(function* () {
51650
51007
  httpRequest = appendUrlParams2(httpRequest, yield* encodeUrlParams.value(request2.urlParams));
51651
51008
  }
51652
51009
  const response = yield* httpClient.execute(httpRequest);
51653
- const value6 = yield* options8.transformResponse === undefined ? decodeResponse(response) : options8.transformResponse(decodeResponse(response));
51010
+ const value6 = yield* options6.transformResponse === undefined ? decodeResponse(response) : options6.transformResponse(decodeResponse(response));
51654
51011
  return request2?.withResponse === true ? [value6, response] : value6;
51655
51012
  }, mapInputContext2((input) => merge3(context8, input)));
51656
- options8.onEndpoint({
51013
+ options6.onEndpoint({
51657
51014
  ...onEndpointOptions,
51658
51015
  endpointFn
51659
51016
  });
51660
51017
  }
51661
51018
  });
51662
51019
  });
51663
- var make75 = (api, options8) => flatMap10(HttpClient, (httpClient) => makeWith3(api, {
51664
- ...options8,
51665
- httpClient: options8?.transformClient ? options8.transformClient(httpClient) : httpClient
51020
+ var make74 = (api, options6) => flatMap10(HttpClient, (httpClient) => makeWith2(api, {
51021
+ ...options6,
51022
+ httpClient: options6?.transformClient ? options6.transformClient(httpClient) : httpClient
51666
51023
  }));
51667
- var makeWith3 = (api, options8) => {
51024
+ var makeWith2 = (api, options6) => {
51668
51025
  const client = {};
51669
51026
  return makeClient(api, {
51670
- ...options8,
51027
+ ...options6,
51671
51028
  onGroup({
51672
51029
  group: group5
51673
51030
  }) {
@@ -51684,13 +51041,13 @@ var makeWith3 = (api, options8) => {
51684
51041
  }
51685
51042
  }).pipe(map17(() => client));
51686
51043
  };
51687
- var group5 = (api, options8) => {
51044
+ var group5 = (api, options6) => {
51688
51045
  const client = {};
51689
51046
  return makeClient(api, {
51690
- ...options8,
51047
+ ...options6,
51691
51048
  predicate: ({
51692
51049
  group: group6
51693
- }) => group6.identifier === options8.group,
51050
+ }) => group6.identifier === options6.group,
51694
51051
  onEndpoint({
51695
51052
  endpoint,
51696
51053
  endpointFn
@@ -51699,14 +51056,14 @@ var group5 = (api, options8) => {
51699
51056
  }
51700
51057
  }).pipe(map17(() => client));
51701
51058
  };
51702
- var endpoint = (api, options8) => {
51059
+ var endpoint = (api, options6) => {
51703
51060
  let client = undefined;
51704
51061
  return makeClient(api, {
51705
- ...options8,
51062
+ ...options6,
51706
51063
  predicate: ({
51707
51064
  endpoint: endpoint2,
51708
51065
  group: group6
51709
- }) => group6.identifier === options8.group && endpoint2.name === options8.endpoint,
51066
+ }) => group6.identifier === options6.group && endpoint2.name === options6.endpoint,
51710
51067
  onEndpoint({
51711
51068
  endpointFn
51712
51069
  }) {
@@ -51715,11 +51072,11 @@ var endpoint = (api, options8) => {
51715
51072
  }).pipe(map17(() => client));
51716
51073
  };
51717
51074
  var paramsRegex = /:(\w+)\??/g;
51718
- var compilePath = (path3) => {
51719
- const segments = path3.split(paramsRegex);
51075
+ var compilePath = (path2) => {
51076
+ const segments = path2.split(paramsRegex);
51720
51077
  const len = segments.length;
51721
51078
  if (len === 1) {
51722
- return (_) => path3;
51079
+ return (_) => path2;
51723
51080
  }
51724
51081
  return (params2) => {
51725
51082
  let url2 = segments[0];
@@ -51818,7 +51175,7 @@ var bodyFromPayload = (ast) => {
51818
51175
  }
51819
51176
  const schema = make53(ast);
51820
51177
  const encoding = getEncoding(ast);
51821
- const transform6 = transformOrFail(HttpBodyFromSelf, schema, {
51178
+ const transform5 = transformOrFail(HttpBodyFromSelf, schema, {
51822
51179
  decode(fromA, _, ast2) {
51823
51180
  return fail10(new Forbidden(ast2, fromA, "encode only schema"));
51824
51181
  },
@@ -51849,27 +51206,27 @@ var bodyFromPayload = (ast) => {
51849
51206
  }
51850
51207
  }
51851
51208
  });
51852
- bodyFromPayloadCache.set(ast, transform6);
51853
- return transform6;
51209
+ bodyFromPayloadCache.set(ast, transform5);
51210
+ return transform5;
51854
51211
  };
51855
51212
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiEndpoint.js
51856
51213
  var exports_HttpApiEndpoint = {};
51857
51214
  __export(exports_HttpApiEndpoint, {
51858
- put: () => put6,
51859
- post: () => post6,
51860
- patch: () => patch14,
51861
- options: () => options8,
51862
- make: () => make76,
51215
+ put: () => put4,
51216
+ post: () => post4,
51217
+ patch: () => patch12,
51218
+ options: () => options6,
51219
+ make: () => make75,
51863
51220
  isHttpApiEndpoint: () => isHttpApiEndpoint,
51864
- head: () => head12,
51865
- get: () => get22,
51866
- del: () => del6,
51867
- TypeId: () => TypeId45
51221
+ head: () => head10,
51222
+ get: () => get20,
51223
+ del: () => del4,
51224
+ TypeId: () => TypeId42
51868
51225
  });
51869
- var TypeId45 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiEndpoint");
51870
- var isHttpApiEndpoint = (u) => hasProperty(u, TypeId45);
51226
+ var TypeId42 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiEndpoint");
51227
+ var isHttpApiEndpoint = (u) => hasProperty(u, TypeId42);
51871
51228
  var Proto9 = {
51872
- [TypeId45]: TypeId45,
51229
+ [TypeId42]: TypeId42,
51873
51230
  pipe() {
51874
51231
  return pipeArguments(this, arguments);
51875
51232
  },
@@ -51940,8 +51297,8 @@ var Proto9 = {
51940
51297
  });
51941
51298
  }
51942
51299
  };
51943
- var makeProto3 = (options8) => Object.assign(Object.create(Proto9), options8);
51944
- var make76 = (method) => (name, ...args2) => {
51300
+ var makeProto3 = (options6) => Object.assign(Object.create(Proto9), options6);
51301
+ var make75 = (method) => (name, ...args2) => {
51945
51302
  if (args2.length === 1) {
51946
51303
  return makeProto3({
51947
51304
  name,
@@ -51958,7 +51315,7 @@ var make76 = (method) => (name, ...args2) => {
51958
51315
  });
51959
51316
  }
51960
51317
  return (segments, ...schemas) => {
51961
- let path3 = segments[0].replace(":", "::");
51318
+ let path2 = segments[0].replace(":", "::");
51962
51319
  let pathSchema = none2();
51963
51320
  if (schemas.length > 0) {
51964
51321
  const obj = {};
@@ -51967,13 +51324,13 @@ var make76 = (method) => (name, ...args2) => {
51967
51324
  const key = getParam(schema.ast) ?? String(i);
51968
51325
  const optional5 = schema.ast._tag === "PropertySignatureTransformation" && schema.ast.from.isOptional || schema.ast._tag === "PropertySignatureDeclaration" && schema.ast.isOptional;
51969
51326
  obj[key] = schema;
51970
- path3 += `:${key}${optional5 ? "?" : ""}${segments[i + 1].replace(":", "::")}`;
51327
+ path2 += `:${key}${optional5 ? "?" : ""}${segments[i + 1].replace(":", "::")}`;
51971
51328
  }
51972
51329
  pathSchema = some2(Struct(obj));
51973
51330
  }
51974
51331
  return makeProto3({
51975
51332
  name,
51976
- path: path3,
51333
+ path: path2,
51977
51334
  method,
51978
51335
  pathSchema,
51979
51336
  urlParamsSchema: none2(),
@@ -51986,24 +51343,24 @@ var make76 = (method) => (name, ...args2) => {
51986
51343
  });
51987
51344
  };
51988
51345
  };
51989
- var get22 = /* @__PURE__ */ make76("GET");
51990
- var post6 = /* @__PURE__ */ make76("POST");
51991
- var put6 = /* @__PURE__ */ make76("PUT");
51992
- var patch14 = /* @__PURE__ */ make76("PATCH");
51993
- var del6 = /* @__PURE__ */ make76("DELETE");
51994
- var head12 = /* @__PURE__ */ make76("HEAD");
51995
- var options8 = /* @__PURE__ */ make76("OPTIONS");
51346
+ var get20 = /* @__PURE__ */ make75("GET");
51347
+ var post4 = /* @__PURE__ */ make75("POST");
51348
+ var put4 = /* @__PURE__ */ make75("PUT");
51349
+ var patch12 = /* @__PURE__ */ make75("PATCH");
51350
+ var del4 = /* @__PURE__ */ make75("DELETE");
51351
+ var head10 = /* @__PURE__ */ make75("HEAD");
51352
+ var options6 = /* @__PURE__ */ make75("OPTIONS");
51996
51353
  // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiGroup.js
51997
51354
  var exports_HttpApiGroup = {};
51998
51355
  __export(exports_HttpApiGroup, {
51999
- make: () => make77,
51356
+ make: () => make76,
52000
51357
  isHttpApiGroup: () => isHttpApiGroup,
52001
- TypeId: () => TypeId46
51358
+ TypeId: () => TypeId43
52002
51359
  });
52003
- var TypeId46 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiGroup");
52004
- var isHttpApiGroup = (u) => hasProperty(u, TypeId46);
51360
+ var TypeId43 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiGroup");
51361
+ var isHttpApiGroup = (u) => hasProperty(u, TypeId43);
52005
51362
  var Proto10 = {
52006
- [TypeId46]: TypeId46,
51363
+ [TypeId43]: TypeId43,
52007
51364
  add(endpoint2) {
52008
51365
  return makeProto4({
52009
51366
  identifier: this.identifier,
@@ -52103,62 +51460,23 @@ var Proto10 = {
52103
51460
  return pipeArguments(this, arguments);
52104
51461
  }
52105
51462
  };
52106
- var makeProto4 = (options9) => {
51463
+ var makeProto4 = (options7) => {
52107
51464
  function HttpApiGroup() {}
52108
51465
  Object.setPrototypeOf(HttpApiGroup, Proto10);
52109
- return Object.assign(HttpApiGroup, options9);
51466
+ return Object.assign(HttpApiGroup, options7);
52110
51467
  };
52111
- var make77 = (identifier2, options9) => makeProto4({
51468
+ var make76 = (identifier2, options7) => makeProto4({
52112
51469
  identifier: identifier2,
52113
- topLevel: options9?.topLevel ?? false,
51470
+ topLevel: options7?.topLevel ?? false,
52114
51471
  endpoints: empty3(),
52115
51472
  errorSchema: Never,
52116
51473
  annotations: empty6(),
52117
51474
  middlewares: new Set
52118
51475
  });
52119
- // ../../node_modules/.bun/@effect+platform@0.96.1+941c8e2324531656/node_modules/@effect/platform/dist/esm/HttpApiSecurity.js
52120
- var exports_HttpApiSecurity = {};
52121
- __export(exports_HttpApiSecurity, {
52122
- bearer: () => bearer,
52123
- basic: () => basic,
52124
- apiKey: () => apiKey,
52125
- annotateContext: () => annotateContext,
52126
- annotate: () => annotate3,
52127
- TypeId: () => TypeId47
52128
- });
52129
- var TypeId47 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpApiSecurity");
52130
- var Proto11 = {
52131
- [TypeId47]: TypeId47,
52132
- pipe() {
52133
- return pipeArguments(this, arguments);
52134
- }
52135
- };
52136
- var bearer = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Proto11), {
52137
- _tag: "Bearer",
52138
- annotations: /* @__PURE__ */ empty6()
52139
- });
52140
- var apiKey = (options9) => Object.assign(Object.create(Proto11), {
52141
- _tag: "ApiKey",
52142
- key: options9.key,
52143
- in: options9.in ?? "header",
52144
- annotations: empty6()
52145
- });
52146
- var basic = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Proto11), {
52147
- _tag: "Basic",
52148
- annotations: /* @__PURE__ */ empty6()
52149
- });
52150
- var annotateContext = /* @__PURE__ */ dual(2, (self, context8) => Object.assign(Object.create(Proto11), {
52151
- ...self,
52152
- annotations: merge3(self.annotations, context8)
52153
- }));
52154
- var annotate3 = /* @__PURE__ */ dual(3, (self, tag6, value6) => Object.assign(Object.create(Proto11), {
52155
- ...self,
52156
- annotations: add2(self.annotations, tag6, value6)
52157
- }));
52158
51476
  // ../../packages/contract/src/errors.ts
52159
51477
  class Unauthorized extends exports_Schema.TaggedError()("@punks/contract/errors/Unauthorized", {
52160
51478
  message: exports_Schema.optionalWith(exports_Schema.String, {
52161
- default: () => "Bearer credentials are required."
51479
+ default: () => "Backoffice session is required."
52162
51480
  })
52163
51481
  }, exports_HttpApiSchema.annotations({ status: 401, title: "Unauthorized" })) {
52164
51482
  }
@@ -52280,7 +51598,7 @@ class BackofficeAccessInviteRequest extends exports_Schema.Class("BackofficeAcce
52280
51598
  role: BackofficeAccessRole
52281
51599
  }) {
52282
51600
  }
52283
- var ProductTelemetryEventName = exports_Schema.Literal("cli.auth.login.completed", "cli.artifact.pull.completed", "cli.scaffold.setup.completed", "cli.scaffold.update.applied", "cli.harness.report.submitted");
51601
+ var ProductTelemetryEventName = exports_Schema.Literal("cli.artifact.pull.completed", "cli.scaffold.setup.completed", "cli.scaffold.update.applied", "cli.harness.report.submitted");
52284
51602
  var TelemetrySource = exports_Schema.Literal("normal", "local-dev", "ci", "debug", "test");
52285
51603
  var isoDateTimePattern = /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(?:\.(?<fraction>\d{1,9}))?(?:Z|[+-]\d{2}:\d{2})$/u;
52286
51604
  var isValidIsoDateTime = (value6) => {
@@ -52461,33 +51779,20 @@ class BackofficeReportUpdateRequest extends exports_Schema.Class("BackofficeRepo
52461
51779
  }) {
52462
51780
  }
52463
51781
 
52464
- // ../../packages/contract/src/security.ts
52465
- class CurrentOperator extends exports_Context.Tag("@punks/contract/CurrentOperator")() {
52466
- }
52467
-
52468
- class CliBearerAuth extends exports_HttpApiMiddleware.Tag()("@punks/contract/CliBearerAuth", {
52469
- security: {
52470
- bearer: exports_HttpApiSecurity.bearer
52471
- },
52472
- provides: CurrentOperator,
52473
- failure: Unauthorized
52474
- }) {
52475
- }
52476
-
52477
51782
  // ../../packages/contract/src/api.ts
52478
51783
  class HealthApi extends exports_HttpApiGroup.make("health", { topLevel: true }).add(exports_HttpApiEndpoint.get("healthz")`/healthz`.addSuccess(exports_HttpApiSchema.NoContent.annotations({ description: "Empty health response" }))) {
52479
51784
  }
52480
51785
 
52481
- class BaselineApi extends exports_HttpApiGroup.make("baseline").add(exports_HttpApiEndpoint.get("resolve")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}`.addSuccess(BaselineResolution).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).add(exports_HttpApiEndpoint.get("artifact")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}/artifacts/${exports_HttpApiSchema.param("kind", ArtifactKind)}`.addSuccess(ArtifactMetadata).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).middleware(CliBearerAuth).prefix("/baselines").annotateContext(exports_OpenApi.annotations({ title: "Baseline control plane" })) {
51786
+ class BaselineApi extends exports_HttpApiGroup.make("baseline").add(exports_HttpApiEndpoint.get("resolve")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}`.addSuccess(BaselineResolution).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).add(exports_HttpApiEndpoint.get("artifact")`/${exports_HttpApiSchema.param("channel", BaselineChannel)}/artifacts/${exports_HttpApiSchema.param("kind", ArtifactKind)}`.addSuccess(ArtifactMetadata).addError(BaselineNotFound).addError(ControlPlaneUnavailable)).prefix("/baselines").annotateContext(exports_OpenApi.annotations({ title: "Baseline control plane" })) {
52482
51787
  }
52483
51788
 
52484
- class TelemetryApi extends exports_HttpApiGroup.make("telemetry").add(exports_HttpApiEndpoint.post("record")`/events`.setPayload(ProductTelemetryEventInput).addSuccess(ProductTelemetryEventAccepted).addError(TelemetryEventRejected).addError(TelemetryPersistenceUnavailable)).middleware(CliBearerAuth).prefix("/telemetry").annotateContext(exports_OpenApi.annotations({ title: "Product telemetry" })) {
51789
+ class TelemetryApi extends exports_HttpApiGroup.make("telemetry").add(exports_HttpApiEndpoint.post("record")`/events`.setPayload(ProductTelemetryEventInput).addSuccess(ProductTelemetryEventAccepted).addError(TelemetryEventRejected).addError(TelemetryPersistenceUnavailable)).prefix("/telemetry").annotateContext(exports_OpenApi.annotations({ title: "Product telemetry" })) {
52485
51790
  }
52486
51791
 
52487
- class ReportsApi extends exports_HttpApiGroup.make("reports").add(exports_HttpApiEndpoint.post("submit")`/`.setPayload(HarnessReportInput).addSuccess(HarnessReportCreated).addError(HarnessReportRejected).addError(HarnessReportPersistenceUnavailable)).middleware(CliBearerAuth).prefix("/reports").annotateContext(exports_OpenApi.annotations({ title: "Harness reports" })) {
51792
+ class ReportsApi extends exports_HttpApiGroup.make("reports").add(exports_HttpApiEndpoint.post("submit")`/`.setPayload(HarnessReportInput).addSuccess(HarnessReportCreated).addError(HarnessReportRejected).addError(HarnessReportPersistenceUnavailable)).prefix("/reports").annotateContext(exports_OpenApi.annotations({ title: "Harness reports" })) {
52488
51793
  }
52489
51794
 
52490
- class BackofficeApi extends exports_HttpApiGroup.make("backoffice").add(exports_HttpApiEndpoint.get("currentAccess")`/access/current`.addSuccess(BackofficeAccessSummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("accessList")`/access-users`.addSuccess(BackofficeAccessList).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("inviteAccess")`/access-users`.setPayload(BackofficeAccessInviteRequest).addSuccess(BackofficeAccessSummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("revokeAccess")`/access-users/${exports_HttpApiSchema.param("email", exports_Schema.String)}/revoke`.addSuccess(BackofficeAccessSummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageList")`/project-usages`.addSuccess(ProjectUsageList).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageDetail")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}`.addSuccess(ProjectUsageDetail).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("mapRepository")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}/repositories`.setPayload(BackofficeRepositoryMappingRequest).addSuccess(ObservedRepositorySummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.patch("updateReport")`/reports/${exports_HttpApiSchema.param("reportId", exports_Schema.String)}`.setPayload(BackofficeReportUpdateRequest).addSuccess(HarnessReportSummary).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).middleware(CliBearerAuth).prefix("/backoffice").annotateContext(exports_OpenApi.annotations({ title: "Backoffice project usage" })) {
51795
+ class BackofficeApi extends exports_HttpApiGroup.make("backoffice").add(exports_HttpApiEndpoint.get("currentAccess")`/access/current`.addSuccess(BackofficeAccessSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("accessList")`/access-users`.addSuccess(BackofficeAccessList).addError(Unauthorized).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("inviteAccess")`/access-users`.setPayload(BackofficeAccessInviteRequest).addSuccess(BackofficeAccessSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("revokeAccess")`/access-users/${exports_HttpApiSchema.param("email", exports_Schema.String)}/revoke`.addSuccess(BackofficeAccessSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageList")`/project-usages`.addSuccess(ProjectUsageList).addError(Unauthorized).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.get("projectUsageDetail")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}`.addSuccess(ProjectUsageDetail).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.post("mapRepository")`/project-usages/${exports_HttpApiSchema.param("projectUsageId", exports_Schema.String)}/repositories`.setPayload(BackofficeRepositoryMappingRequest).addSuccess(ObservedRepositorySummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).add(exports_HttpApiEndpoint.patch("updateReport")`/reports/${exports_HttpApiSchema.param("reportId", exports_Schema.String)}`.setPayload(BackofficeReportUpdateRequest).addSuccess(HarnessReportSummary).addError(Unauthorized).addError(BackofficeRequestRejected).addError(BackofficePersistenceUnavailable)).prefix("/backoffice").annotateContext(exports_OpenApi.annotations({ title: "Backoffice project usage" })) {
52491
51796
  }
52492
51797
 
52493
51798
  class HarnessApi extends exports_HttpApi.make("harness").add(HealthApi).add(BaselineApi).add(TelemetryApi).add(ReportsApi).add(BackofficeApi).addError(Forbidden2).prefix("/api").annotateContext(exports_OpenApi.annotations({
@@ -52496,46 +51801,46 @@ class HarnessApi extends exports_HttpApi.make("harness").add(HealthApi).add(Base
52496
51801
  })) {
52497
51802
  }
52498
51803
  // ../../packages/contract/src/client.ts
52499
- var makeHarnessClient = ({ baseUrl: baseUrl2, bearerToken: bearerToken3 }) => exports_HttpApiClient.make(HarnessApi, {
52500
- baseUrl: baseUrl2,
52501
- transformClient: bearerToken3 === undefined || bearerToken3.length === 0 ? undefined : exports_HttpClient.mapRequest(exports_HttpClientRequest.bearerToken(exports_Redacted.make(bearerToken3)))
51804
+ var makeHarnessClient = ({ baseUrl: baseUrl2 }) => exports_HttpApiClient.make(HarnessApi, {
51805
+ baseUrl: baseUrl2
52502
51806
  }).pipe(exports_Effect.provide(exports_FetchHttpClient.layer));
52503
51807
  // src/control-plane/client.ts
52504
- var resolveStableBaselineMetadata = (options9) => exports_Effect.gen(function* () {
51808
+ var resolveStableBaselineMetadata = (options7) => exports_Effect.gen(function* () {
52505
51809
  const client2 = yield* makeHarnessClient({
52506
- baseUrl: options9.baseUrl,
52507
- bearerToken: options9.bearerToken
51810
+ baseUrl: options7.baseUrl
52508
51811
  });
52509
51812
  return yield* client2.baseline.resolve({
52510
51813
  path: { channel: "stable" }
52511
51814
  });
52512
51815
  });
52513
- var recordProductTelemetryEvent = (options9) => exports_Effect.gen(function* () {
51816
+ var recordProductTelemetryEvent = (options7) => exports_Effect.gen(function* () {
52514
51817
  const client2 = yield* makeHarnessClient({
52515
- baseUrl: options9.baseUrl,
52516
- bearerToken: options9.bearerToken
51818
+ baseUrl: options7.baseUrl
52517
51819
  });
52518
51820
  return yield* client2.telemetry.record({
52519
- payload: options9.event
51821
+ payload: options7.event
52520
51822
  });
52521
51823
  });
52522
- var submitHarnessReport = (options9) => exports_Effect.gen(function* () {
51824
+ var submitHarnessReport = (options7) => exports_Effect.gen(function* () {
52523
51825
  const client2 = yield* makeHarnessClient({
52524
- baseUrl: options9.baseUrl,
52525
- bearerToken: options9.bearerToken
51826
+ baseUrl: options7.baseUrl
52526
51827
  });
52527
51828
  return yield* client2.reports.submit({
52528
- payload: options9.report
51829
+ payload: options7.report
52529
51830
  });
52530
51831
  });
52531
51832
 
51833
+ // src/telemetry/product.ts
51834
+ import { randomUUID } from "crypto";
51835
+ import { execFileSync } from "child_process";
51836
+
52532
51837
  // package.json
52533
51838
  var name = "@punks/cli";
52534
- var version = "2.1.0";
51839
+ var version = "2.1.1";
52535
51840
  // src/telemetry/product.ts
52536
51841
  var git = (cwd, args2) => {
52537
51842
  try {
52538
- return execFileSync2("git", args2, {
51843
+ return execFileSync("git", args2, {
52539
51844
  cwd,
52540
51845
  encoding: "utf8",
52541
51846
  stdio: ["ignore", "pipe", "ignore"]
@@ -52630,7 +51935,6 @@ var submitProductTelemetryEffect = (event) => {
52630
51935
  }
52631
51936
  return recordProductTelemetryEvent({
52632
51937
  baseUrl: baseUrl2,
52633
- bearerToken: controlPlaneBearerToken(),
52634
51938
  event
52635
51939
  }).pipe(exports_Effect.asVoid, exports_Effect.catchAll(() => exports_Effect.void));
52636
51940
  };
@@ -52638,14 +51942,14 @@ var telemetryTransportEnabled = () => process.env.DP_CONTROL_PLANE_URL !== undef
52638
51942
  var submitProductTelemetry = (event) => {
52639
51943
  exports_Effect.runPromise(submitProductTelemetryEffect(event));
52640
51944
  };
52641
- var makeCliEvent = (name2, options9 = {}) => makeProductTelemetryEvent({
51945
+ var makeCliEvent = (name2, options7 = {}) => makeProductTelemetryEvent({
52642
51946
  name: name2,
52643
- cwd: options9.cwd ?? process.cwd(),
52644
- baseline: options9.baseline
51947
+ cwd: options7.cwd ?? process.cwd(),
51948
+ baseline: options7.baseline
52645
51949
  });
52646
- var submitCliEvent = (name2, options9 = {}) => {
51950
+ var submitCliEvent = (name2, options7 = {}) => {
52647
51951
  if (telemetryTransportEnabled()) {
52648
- submitProductTelemetry(makeCliEvent(name2, options9));
51952
+ submitProductTelemetry(makeCliEvent(name2, options7));
52649
51953
  }
52650
51954
  };
52651
51955
 
@@ -52788,8 +52092,6 @@ var renderCommandGuide = () => [
52788
52092
  title: "Available commands",
52789
52093
  body: [
52790
52094
  "commands:",
52791
- " \u203A punks auth",
52792
- " \u2514 manage CLI credentials for authenticated internal baseline access",
52793
52095
  " \u203A punks report",
52794
52096
  " \u2514 submit structured Harness friction for maintainer triage",
52795
52097
  " \u203A punks scaffold",
@@ -52805,7 +52107,6 @@ var renderCommandGuide = () => [
52805
52107
  " \u2022 use `punks scaffold setup` for repo-aware pack detection after repo boilerplate is ready",
52806
52108
  " \u2022 use `punks update` after setup to pull newer scaffolded skills/prompts/manifests/hooks",
52807
52109
  " \u2022 use `punks report` when reusable Harness friction should enter the support loop",
52808
- " \u2022 use `punks auth login` before pulling authenticated internal baselines",
52809
52110
  "",
52810
52111
  "operator notes:",
52811
52112
  " \u2022 init copies only requirements/backlog skills and the initial wiki structure",
@@ -52915,79 +52216,6 @@ var renderQuestion = (value6) => [paint(`${brandPalette.bold}${brandPalette.gree
52915
52216
  var renderJsonLabel = () => paint(`${brandPalette.bold}${brandPalette.lilac}`, "Resolved JSON payload");
52916
52217
  var renderDivider = () => paint(`${brandPalette.dim}${brandPalette.border}`, "\u2500".repeat(sectionWidth));
52917
52218
 
52918
- // src/cli/auth-command.ts
52919
- var tokenOption = exports_Options.optional(exports_Options.text("token").pipe(exports_Options.withDescription("Store an existing bearer token instead of starting device login.")));
52920
- var authUrlOption = exports_Options.optional(exports_Options.text("auth-url").pipe(exports_Options.withDescription("Better Auth base URL. Defaults to DP_AUTH_URL.")));
52921
- var clientIdOption = exports_Options.text("client-id").pipe(exports_Options.withDefault("devpunks-cli"), exports_Options.withDescription("OAuth device-flow client id."));
52922
- var scopeOption = exports_Options.optional(exports_Options.text("scope").pipe(exports_Options.withDescription("Optional OAuth scopes for Better Auth device login.")));
52923
- var noOpenOption = exports_Options.boolean("no-open").pipe(exports_Options.withDescription("Print the verification URL without opening a browser."));
52924
- var nonEmptyText = (value6) => {
52925
- const trimmed2 = value6?.trim();
52926
- return trimmed2 === undefined || trimmed2.length === 0 ? null : trimmed2;
52927
- };
52928
- var authBaseUrl = (authUrl) => nonEmptyText(getOrUndefined(authUrl)) ?? nonEmptyText(process.env.DP_AUTH_URL);
52929
- var authToken = (token) => nonEmptyText(getOrUndefined(token));
52930
- var loginCommand = exports_Command.make("login", {
52931
- token: tokenOption,
52932
- authUrl: authUrlOption,
52933
- clientId: clientIdOption,
52934
- scope: scopeOption,
52935
- noOpen: noOpenOption
52936
- }, ({ token, authUrl, clientId, scope: scope5, noOpen }) => exports_Effect.gen(function* () {
52937
- const configuredAuthBaseUrl = authBaseUrl(authUrl);
52938
- const configuredToken = authToken(token);
52939
- if (isSome2(token) && configuredToken === null) {
52940
- return yield* exports_Effect.fail(new Error("Missing token. Pass a non-empty `--token` value or use device login."));
52941
- }
52942
- const credential = configuredToken !== null ? new AuthCredential({
52943
- accessToken: configuredToken,
52944
- authenticatedAt: new Date().toISOString(),
52945
- ...configuredAuthBaseUrl === null ? {} : { authBaseUrl: configuredAuthBaseUrl }
52946
- }) : yield* exports_Effect.tryPromise({
52947
- try: () => {
52948
- if (configuredAuthBaseUrl === null) {
52949
- throw new Error("Missing auth URL. Pass `--auth-url`, set `DP_AUTH_URL`, or use `--token` for local development.");
52950
- }
52951
- return performDeviceLogin({
52952
- authBaseUrl: configuredAuthBaseUrl,
52953
- clientId,
52954
- scope: getOrUndefined(scope5),
52955
- openBrowser: !noOpen,
52956
- onMessage: (message) => console.log(renderHint(message))
52957
- });
52958
- },
52959
- catch: (cause3) => cause3 instanceof Error ? cause3 : new Error("Auth login failed.")
52960
- });
52961
- writeAuthCredential(credential);
52962
- submitCliEvent("cli.auth.login.completed");
52963
- console.log(renderCommandSection("Auth", [
52964
- "Authenticated CLI credential stored.",
52965
- `Credential file: ${authConfigPath()}`,
52966
- credential.authBaseUrl === undefined ? null : `Auth URL: ${credential.authBaseUrl}`
52967
- ].filter((line4) => line4 !== null).join(`
52968
- `)));
52969
- })).pipe(exports_Command.withDescription("Authenticate the CLI for internal baseline access."));
52970
- var statusCommand = exports_Command.make("status", {}, () => exports_Effect.sync(() => {
52971
- const envToken = process.env.DP_CONTROL_PLANE_TOKEN;
52972
- if (envToken !== undefined && envToken.length > 0) {
52973
- console.log(renderCommandSection("Auth", "Authenticated via DP_CONTROL_PLANE_TOKEN."));
52974
- return;
52975
- }
52976
- const credential = readAuthCredential();
52977
- console.log(renderCommandSection("Auth", credential === null ? "Not authenticated." : [
52978
- "Authenticated.",
52979
- `Credential file: ${authConfigPath()}`,
52980
- `Authenticated at: ${credential.authenticatedAt}`,
52981
- credential.expiresAt === undefined ? null : `Expires at: ${credential.expiresAt}`
52982
- ].filter((line4) => line4 !== null).join(`
52983
- `)));
52984
- })).pipe(exports_Command.withDescription("Show CLI authentication status."));
52985
- var logoutCommand = exports_Command.make("logout", {}, () => exports_Effect.sync(() => {
52986
- const cleared = clearAuthCredential();
52987
- console.log(renderCommandSection("Auth", cleared ? "Stored CLI credential cleared." : "No stored CLI credential found."));
52988
- })).pipe(exports_Command.withDescription("Clear stored CLI authentication."));
52989
- var authCommand = exports_Command.make("auth", {}, () => exports_Effect.sync(() => console.log(renderCommandSection("Auth", "Use auth subcommands to manage CLI credentials.")))).pipe(exports_Command.withDescription("Authenticate the CLI for internal Harness Intelligence resources."), exports_Command.withSubcommands([loginCommand, statusCommand, logoutCommand]));
52990
-
52991
52219
  // src/cli/report-command.ts
52992
52220
  var titleOption = exports_Options.text("title").pipe(exports_Options.withDescription("Short harness friction report title."));
52993
52221
  var bodyOption = exports_Options.text("body").pipe(exports_Options.withDescription("Report body with the observed friction and expected behavior."));
@@ -53053,7 +52281,6 @@ var reportCommand = exports_Command.make("report", {
53053
52281
  });
53054
52282
  const response = await exports_Effect.runPromise(submitHarnessReport({
53055
52283
  baseUrl: requiredControlPlaneUrl(),
53056
- bearerToken: controlPlaneBearerToken(),
53057
52284
  report
53058
52285
  }));
53059
52286
  submitCliEvent("cli.harness.report.submitted", { cwd: repoRoot });
@@ -53073,49 +52300,49 @@ var reportCommand = exports_Command.make("report", {
53073
52300
  })).pipe(exports_Command.withDescription("Submit structured Harness friction for maintainer triage. Agents: use after $dp-cli evidence gathering."));
53074
52301
 
53075
52302
  // src/cli/scaffold-command.ts
53076
- import path13 from "path";
52303
+ import path12 from "path";
53077
52304
 
53078
52305
  // src/baseline/resolve.ts
53079
52306
  import { createHash } from "crypto";
53080
- import { execFileSync as execFileSync3 } from "child_process";
53081
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, mkdtempSync, readFileSync as readFileSync4, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "fs";
52307
+ import { execFileSync as execFileSync2 } from "child_process";
52308
+ import { existsSync as existsSync2, mkdirSync, mkdtempSync, readFileSync as readFileSync3, rmSync, writeFileSync } from "fs";
53082
52309
  import { tmpdir as tmpdir2 } from "os";
53083
- import path6 from "path";
52310
+ import path5 from "path";
53084
52311
 
53085
52312
  // src/baseline/bundled.ts
53086
- import path4 from "path";
52313
+ import path3 from "path";
53087
52314
 
53088
52315
  // src/content/data.ts
53089
- import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
53090
- import path3 from "path";
53091
- var findFirst8 = (candidates) => candidates.find((candidate) => existsSync2(candidate));
52316
+ import { existsSync, readFileSync } from "fs";
52317
+ import path2 from "path";
52318
+ var findFirst8 = (candidates) => candidates.find((candidate) => existsSync(candidate));
53092
52319
  var findBundledPackageRoot = () => {
53093
- let currentDirectory = path3.resolve(import.meta.dirname, "../..");
52320
+ let currentDirectory = path2.resolve(import.meta.dirname, "../..");
53094
52321
  while (true) {
53095
- if (existsSync2(path3.join(currentDirectory, "package.json"))) {
52322
+ if (existsSync(path2.join(currentDirectory, "package.json"))) {
53096
52323
  return currentDirectory;
53097
52324
  }
53098
- const parentDirectory = path3.dirname(currentDirectory);
52325
+ const parentDirectory = path2.dirname(currentDirectory);
53099
52326
  if (parentDirectory === currentDirectory) {
53100
52327
  break;
53101
52328
  }
53102
52329
  currentDirectory = parentDirectory;
53103
52330
  }
53104
- return path3.resolve(import.meta.dirname, "../..");
52331
+ return path2.resolve(import.meta.dirname, "../..");
53105
52332
  };
53106
52333
  var packageRoot = findBundledPackageRoot();
53107
52334
  var runtimeRoot = import.meta.dirname;
53108
52335
  var dataCandidates = [
53109
- path3.join(runtimeRoot, "data"),
53110
- path3.resolve(import.meta.dirname, "../data"),
53111
- path3.join(packageRoot, "src/data"),
53112
- path3.resolve(import.meta.dirname, "../../src/data")
52336
+ path2.join(runtimeRoot, "data"),
52337
+ path2.resolve(import.meta.dirname, "../data"),
52338
+ path2.join(packageRoot, "src/data"),
52339
+ path2.resolve(import.meta.dirname, "../../src/data")
53113
52340
  ];
53114
52341
  var skillCandidates = [
53115
- path3.join(runtimeRoot, "skills"),
53116
- path3.join(packageRoot, "skills"),
53117
- path3.resolve(import.meta.dirname, "../../skills"),
53118
- path3.resolve(import.meta.dirname, "../skills")
52342
+ path2.join(runtimeRoot, "skills"),
52343
+ path2.join(packageRoot, "skills"),
52344
+ path2.resolve(import.meta.dirname, "../../skills"),
52345
+ path2.resolve(import.meta.dirname, "../skills")
53119
52346
  ];
53120
52347
  var resolvedDataRoot = findFirst8(dataCandidates);
53121
52348
  var resolvedSkillsRoot = findFirst8(skillCandidates);
@@ -53127,18 +52354,18 @@ if (resolvedSkillsRoot === undefined) {
53127
52354
  }
53128
52355
  var dataRoot = resolvedDataRoot;
53129
52356
  var skillsRoot = resolvedSkillsRoot;
53130
- var dataPath = (...segments) => path3.join(dataRoot, ...segments);
53131
- var readDataFile = (...segments) => readFileSync2(dataPath(...segments), "utf8");
53132
- var readBaselineDataFile = (baselineDataRoot, ...segments) => readFileSync2(path3.join(baselineDataRoot, ...segments), "utf8");
52357
+ var dataPath = (...segments) => path2.join(dataRoot, ...segments);
52358
+ var readDataFile = (...segments) => readFileSync(dataPath(...segments), "utf8");
52359
+ var readBaselineDataFile = (baselineDataRoot, ...segments) => readFileSync(path2.join(baselineDataRoot, ...segments), "utf8");
53133
52360
  var resolveBaselinePath = ({
53134
52361
  baselineRoot,
53135
52362
  baselineSkillsRoot,
53136
52363
  relativePath
53137
52364
  }) => {
53138
52365
  const resolvedPath = relativePath.startsWith("skills/") ? findFirst8([
53139
- path3.join(baselineSkillsRoot, relativePath.slice("skills/".length)),
53140
- path3.join(baselineRoot, relativePath)
53141
- ]) : findFirst8([path3.join(baselineRoot, relativePath)]);
52366
+ path2.join(baselineSkillsRoot, relativePath.slice("skills/".length)),
52367
+ path2.join(baselineRoot, relativePath)
52368
+ ]) : findFirst8([path2.join(baselineRoot, relativePath)]);
53142
52369
  if (resolvedPath !== undefined) {
53143
52370
  return resolvedPath;
53144
52371
  }
@@ -54145,7 +53372,7 @@ var bundledBaseline = {
54145
53372
  commit: null,
54146
53373
  sha256: null
54147
53374
  },
54148
- root: path4.dirname(dataRoot),
53375
+ root: path3.dirname(dataRoot),
54149
53376
  dataRoot,
54150
53377
  skillsRoot,
54151
53378
  packs: packCatalog,
@@ -54156,12 +53383,12 @@ var bundledBaseline = {
54156
53383
  };
54157
53384
 
54158
53385
  // src/baseline/load.ts
54159
- import { readFileSync as readFileSync3 } from "fs";
54160
- import path5 from "path";
54161
- var readJson2 = (filePath) => JSON.parse(readFileSync3(filePath, "utf8"));
53386
+ import { readFileSync as readFileSync2 } from "fs";
53387
+ import path4 from "path";
53388
+ var readJson = (filePath) => JSON.parse(readFileSync2(filePath, "utf8"));
54162
53389
  var loadBaselineFromDirectory = (root, source) => {
54163
- const metadata = readJson2(path5.join(root, "baseline.json"));
54164
- const dataRoot2 = path5.join(root, "data");
53390
+ const metadata = readJson(path4.join(root, "baseline.json"));
53391
+ const dataRoot2 = path4.join(root, "data");
54165
53392
  return {
54166
53393
  summary: {
54167
53394
  source,
@@ -54173,12 +53400,12 @@ var loadBaselineFromDirectory = (root, source) => {
54173
53400
  },
54174
53401
  root,
54175
53402
  dataRoot: dataRoot2,
54176
- skillsRoot: path5.join(root, "skills"),
54177
- packs: readJson2(path5.join(dataRoot2, "catalog", "packs.json")),
54178
- skills: readJson2(path5.join(dataRoot2, "catalog", "skills.json")),
54179
- tools: readJson2(path5.join(dataRoot2, "catalog", "tools.json")),
54180
- hooks: readJson2(path5.join(dataRoot2, "catalog", "hooks.json")),
54181
- lintAssets: validateLintCatalog(readJson2(path5.join(dataRoot2, "catalog", "lint-assets.json")))
53403
+ skillsRoot: path4.join(root, "skills"),
53404
+ packs: readJson(path4.join(dataRoot2, "catalog", "packs.json")),
53405
+ skills: readJson(path4.join(dataRoot2, "catalog", "skills.json")),
53406
+ tools: readJson(path4.join(dataRoot2, "catalog", "tools.json")),
53407
+ hooks: readJson(path4.join(dataRoot2, "catalog", "hooks.json")),
53408
+ lintAssets: validateLintCatalog(readJson(path4.join(dataRoot2, "catalog", "lint-assets.json")))
54182
53409
  };
54183
53410
  };
54184
53411
 
@@ -54186,9 +53413,9 @@ var loadBaselineFromDirectory = (root, source) => {
54186
53413
  var repoReleasesUrl = "https://api.github.com/repos/wearedevpunks/harness-intelligence/releases?per_page=30";
54187
53414
  var assetManifestName = "scaffold-baseline.json";
54188
53415
  var assetArchiveName = "scaffold-baseline.tgz";
54189
- var cacheRoot = () => path6.join(process.env.XDG_CACHE_HOME ?? path6.join(process.env.HOME ?? tmpdir2(), ".cache"), "devpunks", "baselines");
54190
- var sha256File = (filePath) => createHash("sha256").update(readFileSync4(filePath)).digest("hex");
54191
- var isSafeTarPath = (entry) => entry.length > 0 && !path6.isAbsolute(entry) && !entry.split("/").includes("..");
53416
+ var cacheRoot = () => path5.join(process.env.XDG_CACHE_HOME ?? path5.join(process.env.HOME ?? tmpdir2(), ".cache"), "devpunks", "baselines");
53417
+ var sha256File = (filePath) => createHash("sha256").update(readFileSync3(filePath)).digest("hex");
53418
+ var isSafeTarPath = (entry) => entry.length > 0 && !path5.isAbsolute(entry) && !entry.split("/").includes("..");
54192
53419
  var isBaselineReleaseTag = (tag6) => tag6.startsWith("baseline/stable/") && !/^v\d+\.\d+\.\d+(?:$|-)/u.test(tag6);
54193
53420
  var fetchJson = async (url2, timeoutMs) => {
54194
53421
  const controller = new AbortController;
@@ -54215,21 +53442,21 @@ var download = async (url2, targetPath, timeoutMs) => {
54215
53442
  throw new Error(`Failed to download ${url2}: ${response.status}`);
54216
53443
  }
54217
53444
  const bytes = new Uint8Array(await response.arrayBuffer());
54218
- writeFileSync2(targetPath, bytes);
53445
+ writeFileSync(targetPath, bytes);
54219
53446
  } finally {
54220
53447
  clearTimeout(timeout4);
54221
53448
  }
54222
53449
  };
54223
53450
  var extractSafeTgz = (archivePath, targetDirectory) => {
54224
- const listing = execFileSync3("tar", ["-tzf", archivePath], {
53451
+ const listing = execFileSync2("tar", ["-tzf", archivePath], {
54225
53452
  encoding: "utf8"
54226
53453
  }).split(/\r?\n/u).filter((line4) => line4.length > 0);
54227
53454
  const unsafe = listing.find((entry) => !isSafeTarPath(entry));
54228
53455
  if (unsafe !== undefined) {
54229
53456
  throw new Error(`Unsafe baseline archive path: ${unsafe}`);
54230
53457
  }
54231
- mkdirSync2(targetDirectory, { recursive: true });
54232
- execFileSync3("tar", ["-xzf", archivePath, "-C", targetDirectory], {
53458
+ mkdirSync(targetDirectory, { recursive: true });
53459
+ execFileSync2("tar", ["-xzf", archivePath, "-C", targetDirectory], {
54233
53460
  stdio: "ignore"
54234
53461
  });
54235
53462
  };
@@ -54250,25 +53477,25 @@ var submitArtifactPullTelemetry = (baseline, cwd) => {
54250
53477
  });
54251
53478
  };
54252
53479
  var materializeControlPlaneBaseline = async (resolution, refresh, timeoutMs) => {
54253
- const targetDirectory = path6.join(cacheRoot(), "control-plane", resolution.version);
54254
- if (!refresh && existsSync3(path6.join(targetDirectory, "baseline.json"))) {
53480
+ const targetDirectory = path5.join(cacheRoot(), "control-plane", resolution.version);
53481
+ if (!refresh && existsSync2(path5.join(targetDirectory, "baseline.json"))) {
54255
53482
  return {
54256
53483
  baseline: loadBaselineFromDirectory(targetDirectory, "remote"),
54257
53484
  artifactPulled: false
54258
53485
  };
54259
53486
  }
54260
- const tempDirectory = mkdtempSync(path6.join(tmpdir2(), "punks-control-plane-baseline-"));
54261
- const archivePath = path6.join(tempDirectory, assetArchiveName);
53487
+ const tempDirectory = mkdtempSync(path5.join(tmpdir2(), "punks-control-plane-baseline-"));
53488
+ const archivePath = path5.join(tempDirectory, assetArchiveName);
54262
53489
  await download(resolution.archive.url, archivePath, timeoutMs);
54263
53490
  const archiveSha256 = sha256File(archivePath);
54264
53491
  if (archiveSha256 !== resolution.archive.sha256) {
54265
53492
  throw new Error("Downloaded control plane baseline archive checksum mismatch.");
54266
53493
  }
54267
- rmSync2(targetDirectory, { recursive: true, force: true });
53494
+ rmSync(targetDirectory, { recursive: true, force: true });
54268
53495
  extractSafeTgz(archivePath, targetDirectory);
54269
- const extractedMetadataPath = path6.join(targetDirectory, "baseline.json");
54270
- const extractedMetadata = JSON.parse(readFileSync4(extractedMetadataPath, "utf8"));
54271
- writeFileSync2(extractedMetadataPath, JSON.stringify({
53496
+ const extractedMetadataPath = path5.join(targetDirectory, "baseline.json");
53497
+ const extractedMetadata = JSON.parse(readFileSync3(extractedMetadataPath, "utf8"));
53498
+ writeFileSync(extractedMetadataPath, JSON.stringify({
54272
53499
  ...extractedMetadata,
54273
53500
  channel: resolution.channel,
54274
53501
  version: resolution.version,
@@ -54276,7 +53503,7 @@ var materializeControlPlaneBaseline = async (resolution, refresh, timeoutMs) =>
54276
53503
  commit: resolution.commitSha ?? null,
54277
53504
  sha256: archiveSha256
54278
53505
  }, null, 2), "utf8");
54279
- rmSync2(tempDirectory, { recursive: true, force: true });
53506
+ rmSync(tempDirectory, { recursive: true, force: true });
54280
53507
  return {
54281
53508
  baseline: loadBaselineFromDirectory(targetDirectory, "remote"),
54282
53509
  artifactPulled: true
@@ -54295,8 +53522,7 @@ var resolveControlPlaneStableBaseline = async ({
54295
53522
  try {
54296
53523
  const resolution = await Promise.race([
54297
53524
  exports_Effect.runPromise(resolveStableBaselineMetadata({
54298
- baseUrl: baseUrl2,
54299
- bearerToken: controlPlaneBearerToken()
53525
+ baseUrl: baseUrl2
54300
53526
  })),
54301
53527
  new Promise((_, reject) => {
54302
53528
  timeout4 = setTimeout(() => reject(new Error("Control plane baseline resolution timed out.")), timeoutMs);
@@ -54347,38 +53573,38 @@ var resolveRemoteStableBaseline = async ({
54347
53573
  throw new Error(`Baseline release ${release.tag_name} is missing required assets.`);
54348
53574
  }
54349
53575
  const manifest = await fetchJson(manifestAsset.browser_download_url, timeoutMs);
54350
- const targetDirectory = path6.join(cacheRoot(), "stable", manifest.version);
54351
- if (!refresh && existsSync3(path6.join(targetDirectory, "baseline.json"))) {
53576
+ const targetDirectory = path5.join(cacheRoot(), "stable", manifest.version);
53577
+ if (!refresh && existsSync2(path5.join(targetDirectory, "baseline.json"))) {
54352
53578
  return loadBaselineFromDirectory(targetDirectory, "remote");
54353
53579
  }
54354
- const tempDirectory = mkdtempSync(path6.join(tmpdir2(), "punks-baseline-"));
54355
- const archivePath = path6.join(tempDirectory, assetArchiveName);
53580
+ const tempDirectory = mkdtempSync(path5.join(tmpdir2(), "punks-baseline-"));
53581
+ const archivePath = path5.join(tempDirectory, assetArchiveName);
54356
53582
  await download(archiveAsset.browser_download_url, archivePath, timeoutMs);
54357
53583
  const archiveSha256 = sha256File(archivePath);
54358
53584
  if (archiveSha256 !== manifest.archiveSha256) {
54359
53585
  throw new Error("Downloaded baseline archive checksum mismatch.");
54360
53586
  }
54361
- rmSync2(targetDirectory, { recursive: true, force: true });
53587
+ rmSync(targetDirectory, { recursive: true, force: true });
54362
53588
  extractSafeTgz(archivePath, targetDirectory);
54363
- const extractedMetadataPath = path6.join(targetDirectory, "baseline.json");
54364
- const extractedMetadata = JSON.parse(readFileSync4(extractedMetadataPath, "utf8"));
54365
- writeFileSync2(extractedMetadataPath, JSON.stringify({ ...extractedMetadata, sha256: archiveSha256 }, null, 2), "utf8");
54366
- rmSync2(tempDirectory, { recursive: true, force: true });
53589
+ const extractedMetadataPath = path5.join(targetDirectory, "baseline.json");
53590
+ const extractedMetadata = JSON.parse(readFileSync3(extractedMetadataPath, "utf8"));
53591
+ writeFileSync(extractedMetadataPath, JSON.stringify({ ...extractedMetadata, sha256: archiveSha256 }, null, 2), "utf8");
53592
+ rmSync(tempDirectory, { recursive: true, force: true });
54367
53593
  const baseline = loadBaselineFromDirectory(targetDirectory, "remote");
54368
53594
  submitArtifactPullTelemetry(baseline, cwd);
54369
53595
  return baseline;
54370
53596
  };
54371
- var resolveBaseline = async (options9 = {}) => {
54372
- const requested = process.env.DP_BASELINE === "bundled" ? "bundled" : options9.baseline ?? "stable";
53597
+ var resolveBaseline = async (options7 = {}) => {
53598
+ const requested = process.env.DP_BASELINE === "bundled" ? "bundled" : options7.baseline ?? "stable";
54373
53599
  if (requested === "bundled") {
54374
53600
  return bundledBaseline;
54375
53601
  }
54376
53602
  try {
54377
53603
  return await resolveRemoteStableBaseline({
54378
- refresh: options9.refresh ?? process.env.DP_BASELINE_REFRESH === "1",
54379
- timeoutMs: options9.timeoutMs ?? 1500,
54380
- releasesUrl: options9.releasesUrl ?? repoReleasesUrl,
54381
- ...options9.cwd === undefined ? {} : { cwd: options9.cwd }
53604
+ refresh: options7.refresh ?? process.env.DP_BASELINE_REFRESH === "1",
53605
+ timeoutMs: options7.timeoutMs ?? 1500,
53606
+ releasesUrl: options7.releasesUrl ?? repoReleasesUrl,
53607
+ ...options7.cwd === undefined ? {} : { cwd: options7.cwd }
54382
53608
  });
54383
53609
  } catch {
54384
53610
  return bundledBaseline;
@@ -54466,13 +53692,13 @@ var renderError5 = (state) => match2(state.error, {
54466
53692
  var renderChoiceDescription3 = (choice4, isHighlighted) => choice4.description && isHighlighted ? char3("-").pipe(cat2(space2), cat2(text3(choice4.description)), annotate2(blackBright2)) : empty38;
54467
53693
  var metaOptionsCount2 = 1;
54468
53694
  var withStem = (prefix) => prefix.pipe(cat2(space2), cat2(space2));
54469
- var renderChoices3 = (state, options9) => {
54470
- const allSelected = state.selectedIndices.size === options9.choices.length;
53695
+ var renderChoices3 = (state, options7) => {
53696
+ const allSelected = state.selectedIndices.size === options7.choices.length;
54471
53697
  const metaOptions = [
54472
- { title: allSelected ? "Clear all selected packs" : options9.selectAll }
53698
+ { title: allSelected ? "Clear all selected packs" : options7.selectAll }
54473
53699
  ];
54474
- const allChoices = [...metaOptions, ...options9.choices];
54475
- const toDisplay = entriesToDisplay2(state.index, allChoices.length, options9.maxPerPage);
53700
+ const allChoices = [...metaOptions, ...options7.choices];
53701
+ const toDisplay = entriesToDisplay2(state.index, allChoices.length, options7.maxPerPage);
54476
53702
  const documents = [];
54477
53703
  for (let index = toDisplay.startIndex;index < toDisplay.endIndex; index++) {
54478
53704
  const choice4 = allChoices[index];
@@ -54500,34 +53726,34 @@ var renderChoices3 = (state, options9) => {
54500
53726
  }
54501
53727
  return vsep2(documents);
54502
53728
  };
54503
- var renderNextFrame9 = (state, options9) => exports_Effect.gen(function* () {
53729
+ var renderNextFrame9 = (state, options7) => exports_Effect.gen(function* () {
54504
53730
  const terminal = yield* Terminal;
54505
53731
  const columns = yield* terminal.columns;
54506
- const promptMessage = renderOutput8(options9.message);
54507
- const choices = renderChoices3(state, options9);
53732
+ const promptMessage = renderOutput8(options7.message);
53733
+ const choices = renderChoices3(state, options7);
54508
53734
  const error4 = renderError5(state);
54509
53735
  return cursorHide3.pipe(cat2(promptMessage), cat2(hardLine2), cat2(choices), cat2(error4), render3({ style: "pretty", options: { lineWidth: columns } }));
54510
53736
  });
54511
- var renderSubmission9 = (state, options9) => exports_Effect.gen(function* () {
53737
+ var renderSubmission9 = (state, options7) => exports_Effect.gen(function* () {
54512
53738
  const terminal = yield* Terminal;
54513
53739
  const columns = yield* terminal.columns;
54514
- const selectedChoices = Array.from(state.selectedIndices).sort(Order2).map((index) => options9.choices[index].title).join(", ");
54515
- return renderOutput8(options9.message).pipe(cat2(annotate2(figures2.tick, green3)), cat2(space2), cat2(annotate2(text3(selectedChoices), white3)), cat2(hardLine2), render3({ style: "pretty", options: { lineWidth: columns } }));
53740
+ const selectedChoices = Array.from(state.selectedIndices).sort(Order2).map((index) => options7.choices[index].title).join(", ");
53741
+ return renderOutput8(options7.message).pipe(cat2(annotate2(figures2.tick, green3)), cat2(space2), cat2(annotate2(text3(selectedChoices), white3)), cat2(hardLine2), render3({ style: "pretty", options: { lineWidth: columns } }));
54516
53742
  });
54517
- var clearPrompt = (options9) => exports_Effect.gen(function* () {
53743
+ var clearPrompt = (options7) => exports_Effect.gen(function* () {
54518
53744
  const terminal = yield* Terminal;
54519
53745
  const columns = yield* terminal.columns;
54520
53746
  const text12 = `
54521
- `.repeat(Math.min(options9.choices.length + 1, options9.maxPerPage)) + options9.message;
53747
+ `.repeat(Math.min(options7.choices.length + 1, options7.maxPerPage)) + options7.message;
54522
53748
  return eraseText2(text12, columns).pipe(cat2(eraseLine3), cat2(cursorLeft3), optimize3(Deep), render3({ style: "pretty", options: { lineWidth: columns } }));
54523
53749
  });
54524
- var processSpace2 = (state, options9) => {
53750
+ var processSpace2 = (state, options7) => {
54525
53751
  const selectedIndices = new Set(state.selectedIndices);
54526
53752
  if (state.index === 0) {
54527
- if (selectedIndices.size === options9.choices.length) {
53753
+ if (selectedIndices.size === options7.choices.length) {
54528
53754
  selectedIndices.clear();
54529
53755
  } else {
54530
- for (let index = 0;index < options9.choices.length; index++) {
53756
+ for (let index = 0;index < options7.choices.length; index++) {
54531
53757
  selectedIndices.add(index);
54532
53758
  }
54533
53759
  }
@@ -54541,11 +53767,11 @@ var processSpace2 = (state, options9) => {
54541
53767
  }
54542
53768
  return exports_Effect.succeed(Action2.NextFrame({ state: { ...state, selectedIndices, error: none2() } }));
54543
53769
  };
54544
- var localMultiSelect = (options9) => {
53770
+ var localMultiSelect = (options7) => {
54545
53771
  const resolvedOptions = {
54546
53772
  maxPerPage: 10,
54547
53773
  selectAll: "Select all packs on this step",
54548
- ...options9
53774
+ ...options7
54549
53775
  };
54550
53776
  const prompt4 = exports_Prompt.custom({
54551
53777
  index: 0,
@@ -54622,10 +53848,10 @@ var PromptLive = exports_Effect.acquireRelease(exports_Effect.sync(() => createI
54622
53848
  })));
54623
53849
 
54624
53850
  // src/scaffold/run.ts
54625
- import { execFileSync as execFileSync6 } from "child_process";
54626
- import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "fs";
54627
- import { homedir as homedir3 } from "os";
54628
- import path11 from "path";
53851
+ import { execFileSync as execFileSync5 } from "child_process";
53852
+ import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
53853
+ import { homedir as homedir2 } from "os";
53854
+ import path10 from "path";
54629
53855
 
54630
53856
  // src/content/packs.ts
54631
53857
  var packContents = packCatalog;
@@ -54666,8 +53892,8 @@ var requiredToolsForSkills = (skillIds, baseline = bundledBaseline) => [
54666
53892
  ].toSorted();
54667
53893
 
54668
53894
  // src/core/detect.ts
54669
- import { existsSync as existsSync4, readFileSync as readFileSync5, readdirSync } from "fs";
54670
- import path7 from "path";
53895
+ import { existsSync as existsSync3, readFileSync as readFileSync4, readdirSync } from "fs";
53896
+ import path6 from "path";
54671
53897
  var ignoredDirectoryNames = new Set([
54672
53898
  ".git",
54673
53899
  ".agents",
@@ -54746,7 +53972,7 @@ var recursiveFindFiles = (cwd, filename) => {
54746
53972
  if (ignoredDirectoryNames.has(entry.name)) {
54747
53973
  continue;
54748
53974
  }
54749
- const absolutePath = path7.join(directory3, entry.name);
53975
+ const absolutePath = path6.join(directory3, entry.name);
54750
53976
  if (entry.isDirectory()) {
54751
53977
  visit2(absolutePath);
54752
53978
  continue;
@@ -54756,18 +53982,18 @@ var recursiveFindFiles = (cwd, filename) => {
54756
53982
  }
54757
53983
  }
54758
53984
  };
54759
- if (existsSync4(cwd)) {
53985
+ if (existsSync3(cwd)) {
54760
53986
  visit2(cwd);
54761
53987
  }
54762
53988
  return results.toSorted();
54763
53989
  };
54764
53990
  var discoverPackageJsonPaths = (cwd) => {
54765
- const rootPackageJsonPath = path7.join(cwd, "package.json");
53991
+ const rootPackageJsonPath = path6.join(cwd, "package.json");
54766
53992
  const recursivePackageJsonPaths = recursiveFindFiles(cwd, "package.json");
54767
- if (!existsSync4(rootPackageJsonPath)) {
53993
+ if (!existsSync3(rootPackageJsonPath)) {
54768
53994
  return recursivePackageJsonPaths;
54769
53995
  }
54770
- const rootPackageJson = parsePackageJsonRecord(readFileSync5(rootPackageJsonPath, "utf8"));
53996
+ const rootPackageJson = parsePackageJsonRecord(readFileSync4(rootPackageJsonPath, "utf8"));
54771
53997
  const workspacePatterns = new Set([
54772
53998
  ...readPackageJsonWorkspacePatterns(rootPackageJson),
54773
53999
  ...readPnpmWorkspacePatterns(cwd)
@@ -54783,13 +54009,13 @@ var discoverPackageJsonPaths = (cwd) => {
54783
54009
  ].filter((value6, index, values4) => values4.indexOf(value6) === index).toSorted();
54784
54010
  };
54785
54011
  var discoverConventionalWorkspacePackageJsonPaths = (cwd) => conventionalWorkspaceRoots.flatMap((rootDirectoryName) => {
54786
- const rootDirectory = path7.join(cwd, rootDirectoryName);
54787
- if (!existsSync4(rootDirectory)) {
54012
+ const rootDirectory = path6.join(cwd, rootDirectoryName);
54013
+ if (!existsSync3(rootDirectory)) {
54788
54014
  return [];
54789
54015
  }
54790
- return readdirSync(rootDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path7.join(rootDirectory, entry.name, "package.json")).filter((manifestPath) => existsSync4(manifestPath));
54016
+ return readdirSync(rootDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path6.join(rootDirectory, entry.name, "package.json")).filter((manifestPath) => existsSync3(manifestPath));
54791
54017
  });
54792
- var discoverTopLevelPackageJsonPaths = (cwd) => readdirSync(cwd, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path7.join(cwd, entry.name, "package.json")).filter((manifestPath) => existsSync4(manifestPath));
54018
+ var discoverTopLevelPackageJsonPaths = (cwd) => readdirSync(cwd, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path6.join(cwd, entry.name, "package.json")).filter((manifestPath) => existsSync3(manifestPath));
54793
54019
  var readPackageJsonWorkspacePatterns = (pkg) => {
54794
54020
  const { workspaces } = pkg;
54795
54021
  if (exports_Array.isArray(workspaces)) {
@@ -54801,13 +54027,13 @@ var readPackageJsonWorkspacePatterns = (pkg) => {
54801
54027
  return [];
54802
54028
  };
54803
54029
  var readPnpmWorkspacePatterns = (cwd) => {
54804
- const workspacePath = path7.join(cwd, "pnpm-workspace.yaml");
54805
- if (!existsSync4(workspacePath)) {
54030
+ const workspacePath = path6.join(cwd, "pnpm-workspace.yaml");
54031
+ if (!existsSync3(workspacePath)) {
54806
54032
  return [];
54807
54033
  }
54808
54034
  const patterns = [];
54809
54035
  let inPackagesSection = false;
54810
- for (const rawLine of readFileSync5(workspacePath, "utf8").split(/\r?\n/u)) {
54036
+ for (const rawLine of readFileSync4(workspacePath, "utf8").split(/\r?\n/u)) {
54811
54037
  const line4 = rawLine.trim();
54812
54038
  if (line4 === "packages:") {
54813
54039
  inPackagesSection = true;
@@ -54831,17 +54057,17 @@ var readPnpmWorkspacePatterns = (cwd) => {
54831
54057
  };
54832
54058
  var expandWorkspacePattern = (cwd, pattern2) => {
54833
54059
  if (pattern2.endsWith("/*")) {
54834
- const baseDirectory = path7.join(cwd, pattern2.slice(0, -2));
54835
- if (!existsSync4(baseDirectory)) {
54060
+ const baseDirectory = path6.join(cwd, pattern2.slice(0, -2));
54061
+ if (!existsSync3(baseDirectory)) {
54836
54062
  return [];
54837
54063
  }
54838
- return readdirSync(baseDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path7.join(baseDirectory, entry.name, "package.json")).filter((manifestPath2) => existsSync4(manifestPath2)).toSorted();
54064
+ return readdirSync(baseDirectory, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !ignoredDirectoryNames.has(entry.name)).map((entry) => path6.join(baseDirectory, entry.name, "package.json")).filter((manifestPath2) => existsSync3(manifestPath2)).toSorted();
54839
54065
  }
54840
54066
  if (pattern2.includes("*")) {
54841
54067
  return [];
54842
54068
  }
54843
- const manifestPath = path7.join(cwd, pattern2, "package.json");
54844
- return existsSync4(manifestPath) ? [manifestPath] : [];
54069
+ const manifestPath = path6.join(cwd, pattern2, "package.json");
54070
+ return existsSync3(manifestPath) ? [manifestPath] : [];
54845
54071
  };
54846
54072
  var detectTechnologies = (manifests) => {
54847
54073
  const packageNames = new Set(manifests.flatMap((manifest) => manifest.dependencies));
@@ -54879,7 +54105,7 @@ var detectTechnologies = (manifests) => {
54879
54105
  return detectionOrder.filter((technology) => detected.has(technology));
54880
54106
  };
54881
54107
  var hasPackageTrigger = (packageNames, trigger) => trigger.endsWith("/") ? [...packageNames].some((packageName) => packageName.startsWith(trigger)) : packageNames.has(trigger);
54882
- var isSourceDirectoryPath = (cwd, directory3) => path7.relative(cwd, directory3) !== "";
54108
+ var isSourceDirectoryPath = (cwd, directory3) => path6.relative(cwd, directory3) !== "";
54883
54109
  var detectSourceLanguages = (cwd) => {
54884
54110
  const detected = new Set;
54885
54111
  const visit2 = (directory3) => {
@@ -54887,7 +54113,7 @@ var detectSourceLanguages = (cwd) => {
54887
54113
  if (ignoredDirectoryNames.has(entry.name)) {
54888
54114
  continue;
54889
54115
  }
54890
- const absolutePath = path7.join(directory3, entry.name);
54116
+ const absolutePath = path6.join(directory3, entry.name);
54891
54117
  if (entry.isDirectory()) {
54892
54118
  visit2(absolutePath);
54893
54119
  continue;
@@ -54901,7 +54127,7 @@ var detectSourceLanguages = (cwd) => {
54901
54127
  }
54902
54128
  }
54903
54129
  };
54904
- if (existsSync4(cwd)) {
54130
+ if (existsSync3(cwd)) {
54905
54131
  visit2(cwd);
54906
54132
  }
54907
54133
  return languageDetectionOrder.filter((language) => detected.has(language));
@@ -54929,7 +54155,7 @@ var detectMonorepoSignals = (cwd, manifests) => {
54929
54155
  });
54930
54156
  }
54931
54157
  for (const manifest of manifests) {
54932
- const pkg = parsePackageJsonRecord(readFileSync5(manifest.path, "utf8"));
54158
+ const pkg = parsePackageJsonRecord(readFileSync4(manifest.path, "utf8"));
54933
54159
  const workspaces = pkg.workspaces;
54934
54160
  const hasWorkspaces = exports_Array.isArray(workspaces) || isRecord2(workspaces) && exports_Array.isArray(workspaces.packages);
54935
54161
  if (hasWorkspaces) {
@@ -54940,7 +54166,7 @@ var detectMonorepoSignals = (cwd, manifests) => {
54940
54166
  }
54941
54167
  }
54942
54168
  const workspaceManifests = manifests.filter((manifest) => {
54943
- const pkg = parsePackageJsonRecord(readFileSync5(manifest.path, "utf8"));
54169
+ const pkg = parsePackageJsonRecord(readFileSync4(manifest.path, "utf8"));
54944
54170
  const workspaces = pkg.workspaces;
54945
54171
  return !(exports_Array.isArray(workspaces) || isRecord2(workspaces) && exports_Array.isArray(workspaces.packages));
54946
54172
  });
@@ -54956,10 +54182,10 @@ var detectRepository = (cwd) => exports_Effect.try({
54956
54182
  try: () => {
54957
54183
  const manifestPaths = discoverPackageJsonPaths(cwd);
54958
54184
  const manifests = manifestPaths.map((manifestPath) => {
54959
- const pkg = parsePackageJsonRecord(readFileSync5(manifestPath, "utf8"));
54185
+ const pkg = parsePackageJsonRecord(readFileSync4(manifestPath, "utf8"));
54960
54186
  return {
54961
54187
  path: manifestPath,
54962
- relativePath: path7.relative(cwd, manifestPath) || "package.json",
54188
+ relativePath: path6.relative(cwd, manifestPath) || "package.json",
54963
54189
  packageName: pkg.name ?? null,
54964
54190
  dependencies: collectPackageNames(pkg)
54965
54191
  };
@@ -54981,7 +54207,7 @@ var detectRepository = (cwd) => exports_Effect.try({
54981
54207
  message: "Failed to detect repository shape."
54982
54208
  })
54983
54209
  });
54984
- var manifestPaths = (result) => result.manifests.map((manifest) => path7.relative(result.cwd, manifest.path) || "package.json");
54210
+ var manifestPaths = (result) => result.manifests.map((manifest) => path6.relative(result.cwd, manifest.path) || "package.json");
54985
54211
  var applyRepoShapeMode = (result, repoShapeMode) => repoShapeMode === "auto" ? result : {
54986
54212
  ...result,
54987
54213
  monorepo: repoShapeMode === "monorepo"
@@ -54990,7 +54216,7 @@ var hasFrontendSurface = (result) => exports_Array.some(result.detectedTechnolog
54990
54216
  var backendWorkspacePathSegments = new Set(["api", "backend", "server", "services"]);
54991
54217
  var backendPackageNameSegments = new Set(["api", "backend", "server", "service"]);
54992
54218
  var hasBackendWorkspaceName = (manifest) => {
54993
- const pathSegments = manifest.relativePath.split(path7.sep).slice(0, -1);
54219
+ const pathSegments = manifest.relativePath.split(path6.sep).slice(0, -1);
54994
54220
  if (pathSegments.some((segment) => backendWorkspacePathSegments.has(segment))) {
54995
54221
  return true;
54996
54222
  }
@@ -55003,7 +54229,7 @@ var hasBackendWorkspaceName = (manifest) => {
55003
54229
  var hasBackendSurface = (result) => exports_Array.some(result.detectedTechnologies, (technology) => technology === "better-auth" || technology === "drizzle" || technology === "elysia" || technology === "trpc") || result.manifests.some(hasBackendWorkspaceName);
55004
54230
 
55005
54231
  // src/core/format-summary.ts
55006
- import path8 from "path";
54232
+ import path7 from "path";
55007
54233
  var formatList = (values4) => values4.length === 0 ? [" \u2205"] : values4.map((value6) => ` \u2022 ${value6}`);
55008
54234
  var wrapInlineValues = ({
55009
54235
  values: values4,
@@ -55074,8 +54300,8 @@ var formatDetectionSummary = (detection) => [
55074
54300
  `cwd: ${detection.cwd}`,
55075
54301
  ...section("detected languages:", formatList(detection.detectedLanguages)),
55076
54302
  ...section("detected technologies:", formatList(detection.detectedTechnologies)),
55077
- ...section("manifest files:", formatList(detection.manifests.map((manifest) => path8.relative(detection.cwd, manifest.path) || "package.json"))),
55078
- ...section("monorepo signals:", formatList(detection.monorepoSignals.map((signal) => `${signal.type} (${path8.relative(detection.cwd, signal.path) || "."})`)))
54303
+ ...section("manifest files:", formatList(detection.manifests.map((manifest) => path7.relative(detection.cwd, manifest.path) || "package.json"))),
54304
+ ...section("monorepo signals:", formatList(detection.monorepoSignals.map((signal) => `${signal.type} (${path7.relative(detection.cwd, signal.path) || "."})`)))
55079
54305
  ].join(`
55080
54306
  `);
55081
54307
  var formatConfirmationSummary = (result, baseline = bundledBaseline) => [
@@ -55154,29 +54380,29 @@ var formatAgentHandoffSummary = (result) => [
55154
54380
  " 13. Run `opensrc path <package>` or `opensrc path owner/repo` for those core libraries, then inspect the returned checkout paths. Clone the major framework/runtime libraries you will reason about; do not clone every dependency mechanically."
55155
54381
  ].join(`
55156
54382
  `);
55157
- var formatSelectionPreview = (options9) => [
54383
+ var formatSelectionPreview = (options7) => [
55158
54384
  "Review scaffold selection before continuing",
55159
- ...section("prefilled packs:", formatPackList(options9.preselectedPacks, options9.baseline)),
55160
- ...maybeSection("added packs:", formatPackList(options9.addedPacks, options9.baseline)),
55161
- ...maybeSection("removed packs:", formatPackList(options9.removedPacks, options9.baseline)),
55162
- ...section("final packs:", formatCompactPackList(options9.finalPacks)),
55163
- `output directory: ${options9.outputDirectory}`
54385
+ ...section("prefilled packs:", formatPackList(options7.preselectedPacks, options7.baseline)),
54386
+ ...maybeSection("added packs:", formatPackList(options7.addedPacks, options7.baseline)),
54387
+ ...maybeSection("removed packs:", formatPackList(options7.removedPacks, options7.baseline)),
54388
+ ...section("final packs:", formatCompactPackList(options7.finalPacks)),
54389
+ `output directory: ${options7.outputDirectory}`
55164
54390
  ].join(`
55165
54391
  `);
55166
- var formatResolvedPackSummary = (options9) => options9.optionalPacks.length === 0 ? [
55167
- ...section("default packs:", formatPackList(options9.defaultPacks, options9.baseline)),
55168
- ...section("language packs:", formatPackList(options9.languagePacks, options9.baseline)),
55169
- ...section("detected packs:", formatPackList(options9.detectedPacks, options9.baseline)),
55170
- ...section("surface packs:", formatPackList(options9.surfacePacks, options9.baseline)),
54392
+ var formatResolvedPackSummary = (options7) => options7.optionalPacks.length === 0 ? [
54393
+ ...section("default packs:", formatPackList(options7.defaultPacks, options7.baseline)),
54394
+ ...section("language packs:", formatPackList(options7.languagePacks, options7.baseline)),
54395
+ ...section("detected packs:", formatPackList(options7.detectedPacks, options7.baseline)),
54396
+ ...section("surface packs:", formatPackList(options7.surfacePacks, options7.baseline)),
55171
54397
  "additional packs available:",
55172
54398
  " all known packs are already included in the prefilled selection."
55173
54399
  ].join(`
55174
54400
  `) : [
55175
- ...section("default packs:", formatPackList(options9.defaultPacks, options9.baseline)),
55176
- ...section("language packs:", formatPackList(options9.languagePacks, options9.baseline)),
55177
- ...section("detected packs:", formatPackList(options9.detectedPacks, options9.baseline)),
55178
- ...section("surface packs:", formatPackList(options9.surfacePacks, options9.baseline)),
55179
- ...section("additional packs available:", formatPackList(options9.optionalPacks, options9.baseline))
54401
+ ...section("default packs:", formatPackList(options7.defaultPacks, options7.baseline)),
54402
+ ...section("language packs:", formatPackList(options7.languagePacks, options7.baseline)),
54403
+ ...section("detected packs:", formatPackList(options7.detectedPacks, options7.baseline)),
54404
+ ...section("surface packs:", formatPackList(options7.surfacePacks, options7.baseline)),
54405
+ ...section("additional packs available:", formatPackList(options7.optionalPacks, options7.baseline))
55180
54406
  ].join(`
55181
54407
  `);
55182
54408
 
@@ -55262,10 +54488,10 @@ var finalizePackSelection = (resolved, additions, removals) => {
55262
54488
  var canRemovePack = (resolved, packId) => resolved.preselectedPacks.includes(packId) && !resolved.defaultPacks.includes(packId);
55263
54489
 
55264
54490
  // src/core/tools.ts
55265
- import { execFileSync as execFileSync4 } from "child_process";
54491
+ import { execFileSync as execFileSync3 } from "child_process";
55266
54492
  import { accessSync, constants as constants2 } from "fs";
55267
- import { homedir as homedir2 } from "os";
55268
- import path9 from "path";
54493
+ import { homedir } from "os";
54494
+ import path8 from "path";
55269
54495
  var commandExistsOnPath = (command, env2 = process.env, platform = process.platform) => {
55270
54496
  const pathValue = env2.PATH ?? env2.Path;
55271
54497
  if (pathValue === undefined || pathValue.length === 0) {
@@ -55275,9 +54501,9 @@ var commandExistsOnPath = (command, env2 = process.env, platform = process.platf
55275
54501
  const pathSeparator = isWindows ? ";" : ":";
55276
54502
  const pathEntries = pathValue.split(pathSeparator).filter((entry) => entry.length > 0);
55277
54503
  const pathExtensions = isWindows ? (env2.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((extension) => extension.length > 0) : [""];
55278
- const commandExtensions = isWindows && path9.extname(command).length === 0 ? pathExtensions : [""];
54504
+ const commandExtensions = isWindows && path8.extname(command).length === 0 ? pathExtensions : [""];
55279
54505
  const hasPathSegment = command.includes("/") || command.includes("\\");
55280
- const candidates = (hasPathSegment ? [""] : pathEntries).flatMap((entry) => commandExtensions.map((extension) => hasPathSegment ? `${command}${extension}` : path9.join(entry, `${command}${extension}`)));
54506
+ const candidates = (hasPathSegment ? [""] : pathEntries).flatMap((entry) => commandExtensions.map((extension) => hasPathSegment ? `${command}${extension}` : path8.join(entry, `${command}${extension}`)));
55281
54507
  return candidates.some((candidate) => {
55282
54508
  try {
55283
54509
  accessSync(candidate, isWindows ? constants2.F_OK : constants2.X_OK);
@@ -55288,12 +54514,12 @@ var commandExistsOnPath = (command, env2 = process.env, platform = process.platf
55288
54514
  });
55289
54515
  };
55290
54516
  var defaultRuntime3 = {
55291
- cwd: homedir2(),
54517
+ cwd: homedir(),
55292
54518
  commandExists: commandExistsOnPath,
55293
- execFile: (command, args2, options9) => {
55294
- execFileSync4(command, [...args2], {
55295
- cwd: options9?.cwd,
55296
- stdio: options9?.stdio ?? "inherit"
54519
+ execFile: (command, args2, options7) => {
54520
+ execFileSync3(command, [...args2], {
54521
+ cwd: options7?.cwd,
54522
+ stdio: options7?.stdio ?? "inherit"
55297
54523
  });
55298
54524
  }
55299
54525
  };
@@ -55327,7 +54553,7 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
55327
54553
  throw new Error("Cannot install required tools because no supported global package manager was found on PATH. Install Bun, pnpm, or npm first.");
55328
54554
  }
55329
54555
  const globalPackageManager = packageManager;
55330
- const cwd = runtime5.cwd ?? homedir2();
54556
+ const cwd = runtime5.cwd ?? homedir();
55331
54557
  for (const toolId of toolIds) {
55332
54558
  const tool = toolCatalogById[toolId];
55333
54559
  if (tool === undefined) {
@@ -55363,20 +54589,20 @@ var ensureToolsInstalled = (toolIds, baseline = bundledBaseline, runtime5 = defa
55363
54589
  };
55364
54590
 
55365
54591
  // src/scaffold/output.ts
55366
- import { execFileSync as execFileSync5 } from "child_process";
54592
+ import { execFileSync as execFileSync4 } from "child_process";
55367
54593
  import { createHash as createHash2 } from "crypto";
55368
54594
  import {
55369
54595
  cpSync,
55370
- existsSync as existsSync5,
54596
+ existsSync as existsSync4,
55371
54597
  lstatSync,
55372
- mkdirSync as mkdirSync3,
54598
+ mkdirSync as mkdirSync2,
55373
54599
  readdirSync as readdirSync2,
55374
- readFileSync as readFileSync6,
54600
+ readFileSync as readFileSync5,
55375
54601
  readlinkSync,
55376
- rmSync as rmSync3,
55377
- writeFileSync as writeFileSync3
54602
+ rmSync as rmSync2,
54603
+ writeFileSync as writeFileSync2
55378
54604
  } from "fs";
55379
- import path10 from "path";
54605
+ import path9 from "path";
55380
54606
 
55381
54607
  // src/content/prompts.ts
55382
54608
  var phaseSkillIds = [
@@ -55900,9 +55126,9 @@ var sortSubagentSpecialists = (spec) => ({
55900
55126
 
55901
55127
  // src/scaffold/output.ts
55902
55128
  var encodeJson = encodeSync(parseJson(Unknown));
55903
- var toPosixPath = (value6) => value6.split(path10.sep).join("/");
55129
+ var toPosixPath = (value6) => value6.split(path9.sep).join("/");
55904
55130
  var relativePosixPath = (from, to) => {
55905
- const relativePath = path10.relative(from, to);
55131
+ const relativePath = path9.relative(from, to);
55906
55132
  return relativePath === "" ? "." : toPosixPath(relativePath);
55907
55133
  };
55908
55134
  var specPathForPromptTarget = (relativePath) => {
@@ -55916,7 +55142,7 @@ var specPathForPromptTarget = (relativePath) => {
55916
55142
  if (promptTargetPath === "docs/AGENTS.md") {
55917
55143
  return ".devpunks/specs/prompts/docs.md";
55918
55144
  }
55919
- return path10.posix.join(".devpunks/specs/prompts", path10.posix.dirname(promptTargetPath), "prompt.md");
55145
+ return path9.posix.join(".devpunks/specs/prompts", path9.posix.dirname(promptTargetPath), "prompt.md");
55920
55146
  };
55921
55147
  var uniqueSorted = (values4) => [...new Set(values4)].toSorted();
55922
55148
  var collectOpensrcReferences = (promptSpecs) => uniqueSorted(promptSpecs.flatMap((spec) => spec.opensrcReferences));
@@ -55925,7 +55151,7 @@ var detectionHasPackage = (detection, packageName) => detection.manifests.some((
55925
55151
  var selectedSkills = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)));
55926
55152
  var selectedHookIds = (finalPacks, baseline) => uniqueSorted(finalPacks.flatMap((packId) => hooksForPack(packId, baseline)));
55927
55153
  var oxlintConfigCandidates = [".oxlintrc.json", ".oxlintrc.jsonc", "oxlint.config.ts"];
55928
- var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) => existsSync5(path10.join(scanDirectory, candidate)));
55154
+ var existingOxlintConfigFiles = (scanDirectory) => oxlintConfigCandidates.filter((candidate) => existsSync4(path9.join(scanDirectory, candidate)));
55929
55155
  var oxlintStarterConfig = {
55930
55156
  $schema: "./node_modules/oxlint/configuration_schema.json",
55931
55157
  env: {
@@ -55951,7 +55177,7 @@ var oxlintStarterConfig = {
55951
55177
  ],
55952
55178
  overrides: []
55953
55179
  };
55954
- var detectedWorkspaces = (scanDirectory, detection) => detection.manifests.map((manifest) => path10.posix.dirname(relativePosixPath(scanDirectory, manifest.path))).filter((workspace) => workspace !== "" && workspace !== ".").toSorted();
55180
+ var detectedWorkspaces = (scanDirectory, detection) => detection.manifests.map((manifest) => path9.posix.dirname(relativePosixPath(scanDirectory, manifest.path))).filter((workspace) => workspace !== "" && workspace !== ".").toSorted();
55955
55181
  var packsForWorkspace = ({
55956
55182
  relativeWorkspacePath,
55957
55183
  manifest,
@@ -56106,9 +55332,9 @@ var buildPromptSpec = ({
56106
55332
  finalPacks,
56107
55333
  baseline
56108
55334
  }) => {
56109
- const sourcePath = path10.join(scanDirectory, relativePath);
56110
- const source = existsSync5(sourcePath) ? "copied" : "generated";
56111
- const workspacePath = relativePath === ".agents/AGENTS.md" ? ".agents" : relativePath === "AGENTS.md" ? "." : relativePath === "docs/AGENTS.md" ? "docs" : path10.dirname(relativePath);
55335
+ const sourcePath = path9.join(scanDirectory, relativePath);
55336
+ const source = existsSync4(sourcePath) ? "copied" : "generated";
55337
+ const workspacePath = relativePath === ".agents/AGENTS.md" ? ".agents" : relativePath === "AGENTS.md" ? "." : relativePath === "docs/AGENTS.md" ? "docs" : path9.dirname(relativePath);
56112
55338
  const packs = packsForWorkspace({
56113
55339
  relativeWorkspacePath: workspacePath,
56114
55340
  manifest,
@@ -56176,9 +55402,9 @@ var writeArtifact = ({
56176
55402
  relativePath,
56177
55403
  content
56178
55404
  }) => {
56179
- const absolutePath = path10.join(outputDirectory, relativePath);
56180
- mkdirSync3(path10.dirname(absolutePath), { recursive: true });
56181
- writeFileSync3(absolutePath, content, "utf8");
55405
+ const absolutePath = path9.join(outputDirectory, relativePath);
55406
+ mkdirSync2(path9.dirname(absolutePath), { recursive: true });
55407
+ writeFileSync2(absolutePath, content, "utf8");
56182
55408
  return relativePath;
56183
55409
  };
56184
55410
  var resolvePromptContent = ({
@@ -56189,9 +55415,9 @@ var resolvePromptContent = ({
56189
55415
  baseline,
56190
55416
  preserveExistingManagedFiles
56191
55417
  }) => {
56192
- const sourcePath = path10.join(scanDirectory, relativePath);
56193
- if (preserveExistingManagedFiles && existsSync5(sourcePath)) {
56194
- return readFileSync6(sourcePath, "utf8");
55418
+ const sourcePath = path9.join(scanDirectory, relativePath);
55419
+ if (preserveExistingManagedFiles && existsSync4(sourcePath)) {
55420
+ return readFileSync5(sourcePath, "utf8");
56195
55421
  }
56196
55422
  if (relativePath === ".agents/AGENTS.md") {
56197
55423
  return sharedAgentsPromptTemplate;
@@ -56203,7 +55429,7 @@ var resolvePromptContent = ({
56203
55429
  return docsPromptTemplate;
56204
55430
  }
56205
55431
  if (manifest) {
56206
- const relativeWorkspacePath = path10.dirname(relativePath);
55432
+ const relativeWorkspacePath = path9.dirname(relativePath);
56207
55433
  const packs = packsForWorkspace({
56208
55434
  relativeWorkspacePath,
56209
55435
  manifest,
@@ -56224,15 +55450,15 @@ var resolvePromptContent = ({
56224
55450
  return "";
56225
55451
  };
56226
55452
  var collectRelativeFiles = (outputDirectory, relativeDirectory) => {
56227
- const absoluteDirectory = path10.join(outputDirectory, relativeDirectory);
56228
- if (!existsSync5(absoluteDirectory)) {
55453
+ const absoluteDirectory = path9.join(outputDirectory, relativeDirectory);
55454
+ if (!existsSync4(absoluteDirectory)) {
56229
55455
  return [];
56230
55456
  }
56231
55457
  const files = [];
56232
55458
  const visit2 = (currentDirectory) => {
56233
55459
  for (const entry of readdirSync2(currentDirectory, { withFileTypes: true })) {
56234
- const absolutePath = path10.join(currentDirectory, entry.name);
56235
- const relativePath = path10.relative(outputDirectory, absolutePath).split(path10.sep).join("/");
55460
+ const absolutePath = path9.join(currentDirectory, entry.name);
55461
+ const relativePath = path9.relative(outputDirectory, absolutePath).split(path9.sep).join("/");
56236
55462
  const stat3 = lstatSync(absolutePath);
56237
55463
  if (stat3.isSymbolicLink()) {
56238
55464
  files.push(relativePath);
@@ -56287,8 +55513,8 @@ var managedKindForPath = (relativePath) => {
56287
55513
  var expandManagedFiles = (outputDirectory, relativePaths) => {
56288
55514
  const files = new Set;
56289
55515
  for (const relativePath of relativePaths) {
56290
- const absolutePath = path10.join(outputDirectory, relativePath);
56291
- if (!existsSync5(absolutePath)) {
55516
+ const absolutePath = path9.join(outputDirectory, relativePath);
55517
+ if (!existsSync4(absolutePath)) {
56292
55518
  continue;
56293
55519
  }
56294
55520
  const stat3 = lstatSync(absolutePath);
@@ -56303,9 +55529,9 @@ var expandManagedFiles = (outputDirectory, relativePaths) => {
56303
55529
  }
56304
55530
  }
56305
55531
  return [...files].toSorted().map((relativePath) => {
56306
- const absolutePath = path10.join(outputDirectory, relativePath);
55532
+ const absolutePath = path9.join(outputDirectory, relativePath);
56307
55533
  const stat3 = lstatSync(absolutePath);
56308
- const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync(absolutePath)}` : readFileSync6(absolutePath);
55534
+ const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync(absolutePath)}` : readFileSync5(absolutePath);
56309
55535
  return {
56310
55536
  path: relativePath,
56311
55537
  sha256: hashContent(content),
@@ -56318,7 +55544,7 @@ var promptTargetsForDetection = (scanDirectory, detection) => {
56318
55544
  { relativePath: ".agents/AGENTS.md", manifest: null },
56319
55545
  { relativePath: "AGENTS.md", manifest: null }
56320
55546
  ];
56321
- if (existsSync5(path10.join(scanDirectory, "docs"))) {
55547
+ if (existsSync4(path9.join(scanDirectory, "docs"))) {
56322
55548
  targets.push({ relativePath: "docs/AGENTS.md", manifest: null });
56323
55549
  }
56324
55550
  if (!detection.monorepo) {
@@ -56330,7 +55556,7 @@ var promptTargetsForDetection = (scanDirectory, detection) => {
56330
55556
  continue;
56331
55557
  }
56332
55558
  targets.push({
56333
- relativePath: path10.posix.join(path10.posix.dirname(relativeManifestPath), "AGENTS.md"),
55559
+ relativePath: path9.posix.join(path9.posix.dirname(relativeManifestPath), "AGENTS.md"),
56334
55560
  manifest
56335
55561
  });
56336
55562
  }
@@ -56349,7 +55575,7 @@ var writeScaffoldOutput = ({
56349
55575
  }) => exports_Effect.sync(() => {
56350
55576
  const shouldPreserveExistingManagedFiles = preserveExistingManagedFiles ?? true;
56351
55577
  const renderedOutputDirectory = displayOutputDirectory ?? outputDirectory;
56352
- mkdirSync3(outputDirectory, { recursive: true });
55578
+ mkdirSync2(outputDirectory, { recursive: true });
56353
55579
  const generatedFiles = [];
56354
55580
  const promptOutputs = [];
56355
55581
  const promptSpecFiles = [];
@@ -56446,10 +55672,10 @@ var writeScaffoldOutput = ({
56446
55672
  }
56447
55673
  for (const skillId of finalSkills) {
56448
55674
  const sourceDirectory = skillRegistryByIdForBaseline(baseline)[skillId].sourceDirectory;
56449
- const targetDirectory = path10.posix.join(".agents/skills", skillId);
56450
- const absoluteTargetDirectory = path10.join(outputDirectory, targetDirectory);
56451
- mkdirSync3(path10.join(outputDirectory, ".agents/skills"), { recursive: true });
56452
- rmSync3(absoluteTargetDirectory, { recursive: true, force: true });
55675
+ const targetDirectory = path9.posix.join(".agents/skills", skillId);
55676
+ const absoluteTargetDirectory = path9.join(outputDirectory, targetDirectory);
55677
+ mkdirSync2(path9.join(outputDirectory, ".agents/skills"), { recursive: true });
55678
+ rmSync2(absoluteTargetDirectory, { recursive: true, force: true });
56453
55679
  cpSync(resolveBaselinePath({
56454
55680
  baselineRoot: baseline.root,
56455
55681
  baselineSkillsRoot: baseline.skillsRoot,
@@ -56486,11 +55712,11 @@ var writeScaffoldOutput = ({
56486
55712
  content: encodeJson(subagentManifestSpec)
56487
55713
  }));
56488
55714
  subagentFiles.push(subagentManifestSpec.specFile);
56489
- const sourceManifestPath = path10.join(scanDirectory, ".agents/subagents/manifest.mjs");
55715
+ const sourceManifestPath = path9.join(scanDirectory, ".agents/subagents/manifest.mjs");
56490
55716
  generatedFiles.push(writeArtifact({
56491
55717
  outputDirectory,
56492
55718
  relativePath: ".agents/subagents/manifest.mjs",
56493
- content: shouldPreserveExistingManagedFiles && existsSync5(sourceManifestPath) ? readFileSync6(sourceManifestPath, "utf8") : renderSubagentManifestModule({
55719
+ content: shouldPreserveExistingManagedFiles && existsSync4(sourceManifestPath) ? readFileSync5(sourceManifestPath, "utf8") : renderSubagentManifestModule({
56494
55720
  spec: subagentManifestSpec,
56495
55721
  baseline,
56496
55722
  fallback: defaultSubagentManifestTemplate
@@ -56505,7 +55731,7 @@ var writeScaffoldOutput = ({
56505
55731
  }));
56506
55732
  hookFiles.push(hook.outputPath);
56507
55733
  }
56508
- execFileSync5(process.execPath, [path10.join(outputDirectory, syncScriptFile)], {
55734
+ execFileSync4(process.execPath, [path9.join(outputDirectory, syncScriptFile)], {
56509
55735
  cwd: outputDirectory,
56510
55736
  stdio: "ignore"
56511
55737
  });
@@ -56620,14 +55846,14 @@ var yesValues = new Set(["", "y", "yes"]);
56620
55846
  var encodeJson2 = encodeSync(parseJson(Unknown));
56621
55847
  var encodePrettyJson = (value6) => JSON.stringify(JSON.parse(encodeJson2(value6)), null, 2);
56622
55848
  var agentSystemPromptFile = ".devpunks/AGENT-SYSTEM-PROMPT.md";
56623
- var clipboardWorkingDirectory = homedir3();
55849
+ var clipboardWorkingDirectory = homedir2();
56624
55850
  var writeAgentSystemPrompt = ({
56625
55851
  outputDirectory,
56626
55852
  content
56627
55853
  }) => {
56628
- const absolutePath = path11.join(outputDirectory, agentSystemPromptFile);
56629
- mkdirSync4(path11.dirname(absolutePath), { recursive: true });
56630
- writeFileSync4(absolutePath, `${content}
55854
+ const absolutePath = path10.join(outputDirectory, agentSystemPromptFile);
55855
+ mkdirSync3(path10.dirname(absolutePath), { recursive: true });
55856
+ writeFileSync3(absolutePath, `${content}
56631
55857
  `, "utf8");
56632
55858
  return agentSystemPromptFile;
56633
55859
  };
@@ -56640,7 +55866,7 @@ var tryClipboardCommand = ({
56640
55866
  return { ok: false };
56641
55867
  }
56642
55868
  try {
56643
- execFileSync6(command, args2, {
55869
+ execFileSync5(command, args2, {
56644
55870
  cwd: clipboardWorkingDirectory,
56645
55871
  input: text12,
56646
55872
  stdio: ["pipe", "ignore", "ignore"]
@@ -56666,16 +55892,16 @@ var copyToClipboard = (text12) => {
56666
55892
  var selectedSkills2 = (finalPacks, baseline) => [
56667
55893
  ...new Set(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)))
56668
55894
  ].toSorted();
56669
- var promptForPackMultiSelect = (prompt4, options9) => exports_Effect.gen(function* () {
55895
+ var promptForPackMultiSelect = (prompt4, options7) => exports_Effect.gen(function* () {
56670
55896
  yield* prompt4.writeLine("");
56671
- yield* prompt4.writeLine(renderCommandSection(options9.title, [options9.intro, "", `available packs: ${options9.allowed.length}`].join(`
55897
+ yield* prompt4.writeLine(renderCommandSection(options7.title, [options7.intro, "", `available packs: ${options7.allowed.length}`].join(`
56672
55898
  `)));
56673
55899
  return yield* prompt4.multiSelect({
56674
- message: options9.message,
56675
- ...options9.selectAll ? { selectAll: options9.selectAll } : {},
56676
- ...options9.selectNone ? { selectNone: options9.selectNone } : {},
56677
- choices: options9.allowed.map((packId) => {
56678
- const description = options9.descriptions?.[packId];
55900
+ message: options7.message,
55901
+ ...options7.selectAll ? { selectAll: options7.selectAll } : {},
55902
+ ...options7.selectNone ? { selectNone: options7.selectNone } : {},
55903
+ choices: options7.allowed.map((packId) => {
55904
+ const description = options7.descriptions?.[packId];
56679
55905
  return description ? {
56680
55906
  title: packId,
56681
55907
  value: packId,
@@ -56698,7 +55924,7 @@ var runScaffold = ({
56698
55924
  }) => exports_Effect.gen(function* () {
56699
55925
  const baseRequiredTools = requiredToolsForSkills([], baseline);
56700
55926
  let toolBootstrapStatuses = [];
56701
- const resolvedOutputDirectory = path11.resolve(outputDirectory ?? scanDirectory);
55927
+ const resolvedOutputDirectory = path10.resolve(outputDirectory ?? scanDirectory);
56702
55928
  yield* prompt4.writeLine(renderScaffoldTitle());
56703
55929
  yield* prompt4.writeLine("");
56704
55930
  yield* prompt4.writeLine(renderSetupIntro());
@@ -56918,8 +56144,8 @@ var runScaffold = ({
56918
56144
  });
56919
56145
 
56920
56146
  // src/scaffold/stage.ts
56921
- import { cpSync as cpSync2, existsSync as existsSync6, mkdirSync as mkdirSync5, rmSync as rmSync4, symlinkSync, writeFileSync as writeFileSync5 } from "fs";
56922
- import path12 from "path";
56147
+ import { cpSync as cpSync2, existsSync as existsSync5, mkdirSync as mkdirSync4, rmSync as rmSync3, symlinkSync, writeFileSync as writeFileSync4 } from "fs";
56148
+ import path11 from "path";
56923
56149
 
56924
56150
  // src/content/wiki.ts
56925
56151
  var makeWikiScaffoldTemplate = (wikiRoot) => ({
@@ -57712,10 +56938,10 @@ var copySkillDirectory = ({
57712
56938
  baseline
57713
56939
  }) => {
57714
56940
  const sourceDirectory = skillRegistryByIdForBaseline(baseline)[skillId].sourceDirectory;
57715
- const targetDirectory = path12.posix.join(".agents/skills", skillId);
57716
- const absoluteTargetDirectory = path12.join(outputDirectory, targetDirectory);
57717
- mkdirSync5(path12.join(outputDirectory, ".agents/skills"), { recursive: true });
57718
- rmSync4(absoluteTargetDirectory, { recursive: true, force: true });
56941
+ const targetDirectory = path11.posix.join(".agents/skills", skillId);
56942
+ const absoluteTargetDirectory = path11.join(outputDirectory, targetDirectory);
56943
+ mkdirSync4(path11.join(outputDirectory, ".agents/skills"), { recursive: true });
56944
+ rmSync3(absoluteTargetDirectory, { recursive: true, force: true });
57719
56945
  cpSync2(resolveBaselinePath({
57720
56946
  baselineRoot: baseline.root,
57721
56947
  baselineSkillsRoot: baseline.skillsRoot,
@@ -57723,17 +56949,17 @@ var copySkillDirectory = ({
57723
56949
  }), absoluteTargetDirectory, { recursive: true });
57724
56950
  return targetDirectory;
57725
56951
  };
57726
- var relativePosixPath2 = (from, to) => path12.relative(from, to).split(path12.sep).join("/");
56952
+ var relativePosixPath2 = (from, to) => path11.relative(from, to).split(path11.sep).join("/");
57727
56953
  var writeMissingFile = ({
57728
56954
  outputDirectory,
57729
56955
  targetPath,
57730
56956
  content
57731
56957
  }) => {
57732
- if (existsSync6(targetPath)) {
56958
+ if (existsSync5(targetPath)) {
57733
56959
  return null;
57734
56960
  }
57735
- mkdirSync5(path12.dirname(targetPath), { recursive: true });
57736
- writeFileSync5(targetPath, content);
56961
+ mkdirSync4(path11.dirname(targetPath), { recursive: true });
56962
+ writeFileSync4(targetPath, content);
57737
56963
  return relativePosixPath2(outputDirectory, targetPath);
57738
56964
  };
57739
56965
  var scaffoldWiki = ({
@@ -57742,23 +56968,23 @@ var scaffoldWiki = ({
57742
56968
  }) => {
57743
56969
  const template = makeWikiScaffoldTemplate(wikiRoot);
57744
56970
  const createdFiles = [];
57745
- const wikiDirectory = path12.join(outputDirectory, wikiRoot);
56971
+ const wikiDirectory = path11.join(outputDirectory, wikiRoot);
57746
56972
  for (const directory3 of template.topLevelDirectories) {
57747
- mkdirSync5(path12.join(wikiDirectory, directory3), { recursive: true });
56973
+ mkdirSync4(path11.join(wikiDirectory, directory3), { recursive: true });
57748
56974
  }
57749
56975
  for (const rawSubdirectory of template.rawSubdirectories) {
57750
- mkdirSync5(path12.join(wikiDirectory, "raw", rawSubdirectory), {
56976
+ mkdirSync4(path11.join(wikiDirectory, "raw", rawSubdirectory), {
57751
56977
  recursive: true
57752
56978
  });
57753
- const keepFile = path12.join(wikiDirectory, "raw", rawSubdirectory, ".gitkeep");
56979
+ const keepFile = path11.join(wikiDirectory, "raw", rawSubdirectory, ".gitkeep");
57754
56980
  const createdFile = writeMissingFile({ outputDirectory, targetPath: keepFile, content: "" });
57755
56981
  if (createdFile !== null) {
57756
56982
  createdFiles.push(createdFile);
57757
56983
  }
57758
56984
  }
57759
56985
  const directoryKeepFiles = [
57760
- path12.join(wikiDirectory, "content", "docs", "project", ".gitkeep"),
57761
- path12.join(wikiDirectory, "specs", ".gitkeep")
56986
+ path11.join(wikiDirectory, "content", "docs", "project", ".gitkeep"),
56987
+ path11.join(wikiDirectory, "specs", ".gitkeep")
57762
56988
  ];
57763
56989
  for (const keepFile of directoryKeepFiles) {
57764
56990
  const createdFile = writeMissingFile({ outputDirectory, targetPath: keepFile, content: "" });
@@ -57769,14 +56995,14 @@ var scaffoldWiki = ({
57769
56995
  for (const file6 of template.files) {
57770
56996
  const createdFile = writeMissingFile({
57771
56997
  outputDirectory,
57772
- targetPath: path12.join(wikiDirectory, file6.path),
56998
+ targetPath: path11.join(wikiDirectory, file6.path),
57773
56999
  content: file6.content
57774
57000
  });
57775
57001
  if (createdFile !== null) {
57776
57002
  createdFiles.push(createdFile);
57777
57003
  }
57778
57004
  }
57779
- const agentsPath = path12.join(wikiDirectory, "AGENTS.md");
57005
+ const agentsPath = path11.join(wikiDirectory, "AGENTS.md");
57780
57006
  const agentsFile = writeMissingFile({
57781
57007
  outputDirectory,
57782
57008
  targetPath: agentsPath,
@@ -57785,12 +57011,12 @@ var scaffoldWiki = ({
57785
57011
  if (agentsFile !== null) {
57786
57012
  createdFiles.push(agentsFile);
57787
57013
  }
57788
- const claudePath = path12.join(wikiDirectory, "CLAUDE.md");
57789
- if (!existsSync6(claudePath)) {
57014
+ const claudePath = path11.join(wikiDirectory, "CLAUDE.md");
57015
+ if (!existsSync5(claudePath)) {
57790
57016
  symlinkSync("AGENTS.md", claudePath);
57791
57017
  createdFiles.push(relativePosixPath2(outputDirectory, claudePath));
57792
57018
  }
57793
- const indexPath = path12.join(wikiDirectory, "index.md");
57019
+ const indexPath = path11.join(wikiDirectory, "index.md");
57794
57020
  const indexFile = writeMissingFile({
57795
57021
  outputDirectory,
57796
57022
  targetPath: indexPath,
@@ -57799,7 +57025,7 @@ var scaffoldWiki = ({
57799
57025
  if (indexFile !== null) {
57800
57026
  createdFiles.push(indexFile);
57801
57027
  }
57802
- const logPath = path12.join(wikiDirectory, "log.md");
57028
+ const logPath = path11.join(wikiDirectory, "log.md");
57803
57029
  const logFile = writeMissingFile({
57804
57030
  outputDirectory,
57805
57031
  targetPath: logPath,
@@ -57864,7 +57090,7 @@ var baselineOption = exports_Options.optional(exports_Options.choice("baseline",
57864
57090
  var refreshBaselineOption = exports_Options.boolean("refresh-baseline").pipe(exports_Options.withDescription("Refetch the stable baseline instead of reusing the local cache."));
57865
57091
  var stageCommand = (id2, description) => exports_Command.make(id2, { output: outputOption, baseline: baselineOption, refreshBaseline: refreshBaselineOption }, ({ output: output2, baseline, refreshBaseline }) => exports_Effect.scoped(exports_Effect.gen(function* () {
57866
57092
  const prompt4 = yield* PromptLive;
57867
- const outputDirectory = path13.resolve(process.cwd(), getOrElse(output2, () => "."));
57093
+ const outputDirectory = path12.resolve(process.cwd(), getOrElse(output2, () => "."));
57868
57094
  const resolvedBaseline = yield* exports_Effect.promise(() => resolveBaseline(baselineResolveOptions(baseline, refreshBaseline, outputDirectory)));
57869
57095
  yield* runStageScaffold({
57870
57096
  commandId: id2,
@@ -57882,9 +57108,9 @@ var setupCommand = exports_Command.make("setup", {
57882
57108
  refreshBaseline: refreshBaselineOption
57883
57109
  }, ({ input: input2, output: output2, json: json2, repoShape, baseline, refreshBaseline }) => exports_Effect.scoped(exports_Effect.gen(function* () {
57884
57110
  const prompt4 = yield* PromptLive;
57885
- const scanDirectory = path13.resolve(process.cwd(), getOrElse(input2, () => "."));
57111
+ const scanDirectory = path12.resolve(process.cwd(), getOrElse(input2, () => "."));
57886
57112
  const resolvedBaseline = yield* exports_Effect.promise(() => resolveBaseline(baselineResolveOptions(baseline, refreshBaseline, scanDirectory)));
57887
- const outputDirectory = map2(output2, (value6) => path13.resolve(process.cwd(), value6));
57113
+ const outputDirectory = map2(output2, (value6) => path12.resolve(process.cwd(), value6));
57888
57114
  const resolvedRepoShape = getOrElse(repoShape, () => "auto");
57889
57115
  yield* runScaffold(isSome2(outputDirectory) ? {
57890
57116
  scanDirectory,
@@ -57914,44 +57140,44 @@ var scaffoldCommand = exports_Command.make("scaffold", {}, () => exports_Effect.
57914
57140
  ]));
57915
57141
 
57916
57142
  // src/cli/update-command.ts
57917
- import path15 from "path";
57143
+ import path14 from "path";
57918
57144
 
57919
57145
  // src/update/run.ts
57920
57146
  import { createHash as createHash3 } from "crypto";
57921
57147
  import {
57922
57148
  cpSync as cpSync3,
57923
- existsSync as existsSync7,
57149
+ existsSync as existsSync6,
57924
57150
  lstatSync as lstatSync2,
57925
- mkdirSync as mkdirSync6,
57151
+ mkdirSync as mkdirSync5,
57926
57152
  mkdtempSync as mkdtempSync2,
57927
- readFileSync as readFileSync7,
57153
+ readFileSync as readFileSync6,
57928
57154
  readlinkSync as readlinkSync2,
57929
- rmSync as rmSync5,
57155
+ rmSync as rmSync4,
57930
57156
  symlinkSync as symlinkSync2
57931
57157
  } from "fs";
57932
57158
  import { tmpdir as tmpdir3 } from "os";
57933
- import path14 from "path";
57159
+ import path13 from "path";
57934
57160
 
57935
57161
  // ../../node_modules/.bun/diff@9.0.0/node_modules/diff/libesm/diff/base.js
57936
57162
  class Diff {
57937
- diff(oldStr, newStr, options9 = {}) {
57163
+ diff(oldStr, newStr, options7 = {}) {
57938
57164
  let callback;
57939
- if (typeof options9 === "function") {
57940
- callback = options9;
57941
- options9 = {};
57942
- } else if ("callback" in options9) {
57943
- callback = options9.callback;
57944
- }
57945
- const oldString = this.castInput(oldStr, options9);
57946
- const newString = this.castInput(newStr, options9);
57947
- const oldTokens = this.removeEmpty(this.tokenize(oldString, options9));
57948
- const newTokens = this.removeEmpty(this.tokenize(newString, options9));
57949
- return this.diffWithOptionsObj(oldTokens, newTokens, options9, callback);
57950
- }
57951
- diffWithOptionsObj(oldTokens, newTokens, options9, callback) {
57165
+ if (typeof options7 === "function") {
57166
+ callback = options7;
57167
+ options7 = {};
57168
+ } else if ("callback" in options7) {
57169
+ callback = options7.callback;
57170
+ }
57171
+ const oldString = this.castInput(oldStr, options7);
57172
+ const newString = this.castInput(newStr, options7);
57173
+ const oldTokens = this.removeEmpty(this.tokenize(oldString, options7));
57174
+ const newTokens = this.removeEmpty(this.tokenize(newString, options7));
57175
+ return this.diffWithOptionsObj(oldTokens, newTokens, options7, callback);
57176
+ }
57177
+ diffWithOptionsObj(oldTokens, newTokens, options7, callback) {
57952
57178
  var _a;
57953
57179
  const done9 = (value6) => {
57954
- value6 = this.postProcess(value6, options9);
57180
+ value6 = this.postProcess(value6, options7);
57955
57181
  if (callback) {
57956
57182
  setTimeout(function() {
57957
57183
  callback(value6);
@@ -57964,13 +57190,13 @@ class Diff {
57964
57190
  const newLen = newTokens.length, oldLen = oldTokens.length;
57965
57191
  let editLength = 1;
57966
57192
  let maxEditLength = newLen + oldLen;
57967
- if (options9.maxEditLength != null) {
57968
- maxEditLength = Math.min(maxEditLength, options9.maxEditLength);
57193
+ if (options7.maxEditLength != null) {
57194
+ maxEditLength = Math.min(maxEditLength, options7.maxEditLength);
57969
57195
  }
57970
- const maxExecutionTime = (_a = options9.timeout) !== null && _a !== undefined ? _a : Infinity;
57196
+ const maxExecutionTime = (_a = options7.timeout) !== null && _a !== undefined ? _a : Infinity;
57971
57197
  const abortAfterTimestamp = Date.now() + maxExecutionTime;
57972
57198
  const bestPath = [{ oldPos: -1, lastComponent: undefined }];
57973
- let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options9);
57199
+ let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options7);
57974
57200
  if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
57975
57201
  return done9(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
57976
57202
  }
@@ -57993,11 +57219,11 @@ class Diff {
57993
57219
  continue;
57994
57220
  }
57995
57221
  if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
57996
- basePath = this.addToPath(addPath, true, false, 0, options9);
57222
+ basePath = this.addToPath(addPath, true, false, 0, options7);
57997
57223
  } else {
57998
- basePath = this.addToPath(removePath, false, true, 1, options9);
57224
+ basePath = this.addToPath(removePath, false, true, 1, options7);
57999
57225
  }
58000
- newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options9);
57226
+ newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options7);
58001
57227
  if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
58002
57228
  return done9(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
58003
57229
  } else {
@@ -58032,42 +57258,42 @@ class Diff {
58032
57258
  }
58033
57259
  }
58034
57260
  }
58035
- addToPath(path14, added, removed, oldPosInc, options9) {
58036
- const last5 = path14.lastComponent;
58037
- if (last5 && !options9.oneChangePerToken && last5.added === added && last5.removed === removed) {
57261
+ addToPath(path13, added, removed, oldPosInc, options7) {
57262
+ const last5 = path13.lastComponent;
57263
+ if (last5 && !options7.oneChangePerToken && last5.added === added && last5.removed === removed) {
58038
57264
  return {
58039
- oldPos: path14.oldPos + oldPosInc,
57265
+ oldPos: path13.oldPos + oldPosInc,
58040
57266
  lastComponent: { count: last5.count + 1, added, removed, previousComponent: last5.previousComponent }
58041
57267
  };
58042
57268
  } else {
58043
57269
  return {
58044
- oldPos: path14.oldPos + oldPosInc,
57270
+ oldPos: path13.oldPos + oldPosInc,
58045
57271
  lastComponent: { count: 1, added, removed, previousComponent: last5 }
58046
57272
  };
58047
57273
  }
58048
57274
  }
58049
- extractCommon(basePath, newTokens, oldTokens, diagonalPath, options9) {
57275
+ extractCommon(basePath, newTokens, oldTokens, diagonalPath, options7) {
58050
57276
  const newLen = newTokens.length, oldLen = oldTokens.length;
58051
57277
  let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
58052
- while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options9)) {
57278
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options7)) {
58053
57279
  newPos++;
58054
57280
  oldPos++;
58055
57281
  commonCount++;
58056
- if (options9.oneChangePerToken) {
57282
+ if (options7.oneChangePerToken) {
58057
57283
  basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };
58058
57284
  }
58059
57285
  }
58060
- if (commonCount && !options9.oneChangePerToken) {
57286
+ if (commonCount && !options7.oneChangePerToken) {
58061
57287
  basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };
58062
57288
  }
58063
57289
  basePath.oldPos = oldPos;
58064
57290
  return newPos;
58065
57291
  }
58066
- equals(left3, right3, options9) {
58067
- if (options9.comparator) {
58068
- return options9.comparator(left3, right3);
57292
+ equals(left3, right3, options7) {
57293
+ if (options7.comparator) {
57294
+ return options7.comparator(left3, right3);
58069
57295
  } else {
58070
- return left3 === right3 || !!options9.ignoreCase && left3.toLowerCase() === right3.toLowerCase();
57296
+ return left3 === right3 || !!options7.ignoreCase && left3.toLowerCase() === right3.toLowerCase();
58071
57297
  }
58072
57298
  }
58073
57299
  removeEmpty(array9) {
@@ -58079,16 +57305,16 @@ class Diff {
58079
57305
  }
58080
57306
  return ret;
58081
57307
  }
58082
- castInput(value6, options9) {
57308
+ castInput(value6, options7) {
58083
57309
  return value6;
58084
57310
  }
58085
- tokenize(value6, options9) {
57311
+ tokenize(value6, options7) {
58086
57312
  return Array.from(value6);
58087
57313
  }
58088
57314
  join(chars) {
58089
57315
  return chars.join("");
58090
57316
  }
58091
- postProcess(changeObjects, options9) {
57317
+ postProcess(changeObjects, options7) {
58092
57318
  return changeObjects;
58093
57319
  }
58094
57320
  get useLongestToken() {
@@ -58260,9 +57486,9 @@ function leadingAndTrailingWs(string8, segmenter) {
58260
57486
  const segments = segment(string8, segmenter);
58261
57487
  const firstSeg = segments[0];
58262
57488
  const lastSeg = segments[segments.length - 1];
58263
- const head13 = /\s/.test(firstSeg) ? firstSeg : "";
57489
+ const head11 = /\s/.test(firstSeg) ? firstSeg : "";
58264
57490
  const tail2 = /\s/.test(lastSeg) ? lastSeg : "";
58265
- return [head13, tail2];
57491
+ return [head11, tail2];
58266
57492
  }
58267
57493
 
58268
57494
  // ../../node_modules/.bun/diff@9.0.0/node_modules/diff/libesm/diff/word.js
@@ -58270,17 +57496,17 @@ var extendedWordChars = "a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-
58270
57496
  var tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
58271
57497
 
58272
57498
  class WordDiff extends Diff {
58273
- equals(left3, right3, options9) {
58274
- if (options9.ignoreCase) {
57499
+ equals(left3, right3, options7) {
57500
+ if (options7.ignoreCase) {
58275
57501
  left3 = left3.toLowerCase();
58276
57502
  right3 = right3.toLowerCase();
58277
57503
  }
58278
57504
  return left3.trim() === right3.trim();
58279
57505
  }
58280
- tokenize(value6, options9 = {}) {
57506
+ tokenize(value6, options7 = {}) {
58281
57507
  let parts2;
58282
- if (options9.intlSegmenter) {
58283
- const segmenter = options9.intlSegmenter;
57508
+ if (options7.intlSegmenter) {
57509
+ const segmenter = options7.intlSegmenter;
58284
57510
  if (segmenter.resolvedOptions().granularity != "word") {
58285
57511
  throw new Error('The segmenter passed must have a granularity of "word"');
58286
57512
  }
@@ -58319,8 +57545,8 @@ class WordDiff extends Diff {
58319
57545
  }
58320
57546
  }).join("");
58321
57547
  }
58322
- postProcess(changes2, options9) {
58323
- if (!changes2 || options9.oneChangePerToken) {
57548
+ postProcess(changes2, options7) {
57549
+ if (!changes2 || options7.oneChangePerToken) {
58324
57550
  return changes2;
58325
57551
  }
58326
57552
  let lastKeep = null;
@@ -58333,7 +57559,7 @@ class WordDiff extends Diff {
58333
57559
  deletion = change;
58334
57560
  } else {
58335
57561
  if (insertion || deletion) {
58336
- dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options9.intlSegmenter);
57562
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change, options7.intlSegmenter);
58337
57563
  }
58338
57564
  lastKeep = change;
58339
57565
  insertion = null;
@@ -58341,7 +57567,7 @@ class WordDiff extends Diff {
58341
57567
  }
58342
57568
  });
58343
57569
  if (insertion || deletion) {
58344
- dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options9.intlSegmenter);
57570
+ dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null, options7.intlSegmenter);
58345
57571
  }
58346
57572
  return changes2;
58347
57573
  }
@@ -58407,17 +57633,17 @@ class LineDiff extends Diff {
58407
57633
  super(...arguments);
58408
57634
  this.tokenize = tokenize;
58409
57635
  }
58410
- equals(left3, right3, options9) {
58411
- if (options9.ignoreWhitespace) {
58412
- if (!options9.newlineIsToken || !left3.includes(`
57636
+ equals(left3, right3, options7) {
57637
+ if (options7.ignoreWhitespace) {
57638
+ if (!options7.newlineIsToken || !left3.includes(`
58413
57639
  `)) {
58414
57640
  left3 = left3.trim();
58415
57641
  }
58416
- if (!options9.newlineIsToken || !right3.includes(`
57642
+ if (!options7.newlineIsToken || !right3.includes(`
58417
57643
  `)) {
58418
57644
  right3 = right3.trim();
58419
57645
  }
58420
- } else if (options9.ignoreNewlineAtEof && !options9.newlineIsToken) {
57646
+ } else if (options7.ignoreNewlineAtEof && !options7.newlineIsToken) {
58421
57647
  if (left3.endsWith(`
58422
57648
  `)) {
58423
57649
  left3 = left3.slice(0, -1);
@@ -58427,15 +57653,15 @@ class LineDiff extends Diff {
58427
57653
  right3 = right3.slice(0, -1);
58428
57654
  }
58429
57655
  }
58430
- return super.equals(left3, right3, options9);
57656
+ return super.equals(left3, right3, options7);
58431
57657
  }
58432
57658
  }
58433
57659
  var lineDiff = new LineDiff;
58434
- function diffLines(oldStr, newStr, options9) {
58435
- return lineDiff.diff(oldStr, newStr, options9);
57660
+ function diffLines(oldStr, newStr, options7) {
57661
+ return lineDiff.diff(oldStr, newStr, options7);
58436
57662
  }
58437
- function tokenize(value6, options9) {
58438
- if (options9.stripTrailingCr) {
57663
+ function tokenize(value6, options7) {
57664
+ if (options7.stripTrailingCr) {
58439
57665
  value6 = value6.replace(/\r\n/g, `
58440
57666
  `);
58441
57667
  }
@@ -58445,7 +57671,7 @@ function tokenize(value6, options9) {
58445
57671
  }
58446
57672
  for (let i = 0;i < linesAndNewlines.length; i++) {
58447
57673
  const line4 = linesAndNewlines[i];
58448
- if (i % 2 && !options9.newlineIsToken) {
57674
+ if (i % 2 && !options7.newlineIsToken) {
58449
57675
  retLines[retLines.length - 1] += line4;
58450
57676
  } else {
58451
57677
  retLines.push(line4);
@@ -58501,12 +57727,12 @@ class JsonDiff extends Diff {
58501
57727
  get useLongestToken() {
58502
57728
  return true;
58503
57729
  }
58504
- castInput(value6, options9) {
58505
- const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options9;
57730
+ castInput(value6, options7) {
57731
+ const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options7;
58506
57732
  return typeof value6 === "string" ? value6 : JSON.stringify(canonicalize(value6, null, null, stringifyReplacer), null, " ");
58507
57733
  }
58508
- equals(left3, right3, options9) {
58509
- return super.equals(left3.replace(/,([\r\n])/g, "$1"), right3.replace(/,([\r\n])/g, "$1"), options9);
57734
+ equals(left3, right3, options7) {
57735
+ return super.equals(left3.replace(/,([\r\n])/g, "$1"), right3.replace(/,([\r\n])/g, "$1"), options7);
58510
57736
  }
58511
57737
  }
58512
57738
  var jsonDiff = new JsonDiff;
@@ -58626,14 +57852,14 @@ var INCLUDE_HEADERS = {
58626
57852
  includeUnderline: true,
58627
57853
  includeFileHeaders: true
58628
57854
  };
58629
- function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options9) {
57855
+ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options7) {
58630
57856
  let optionsObj;
58631
- if (!options9) {
57857
+ if (!options7) {
58632
57858
  optionsObj = {};
58633
- } else if (typeof options9 === "function") {
58634
- optionsObj = { callback: options9 };
57859
+ } else if (typeof options7 === "function") {
57860
+ optionsObj = { callback: options7 };
58635
57861
  } else {
58636
- optionsObj = options9;
57862
+ optionsObj = options7;
58637
57863
  }
58638
57864
  if (typeof optionsObj.context === "undefined") {
58639
57865
  optionsObj.context = 4;
@@ -58647,8 +57873,8 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
58647
57873
  } else {
58648
57874
  const { callback } = optionsObj;
58649
57875
  diffLines(oldStr, newStr, Object.assign(Object.assign({}, optionsObj), { callback: (diff8) => {
58650
- const patch15 = diffLinesResultToPatch(diff8);
58651
- callback(patch15);
57876
+ const patch13 = diffLinesResultToPatch(diff8);
57877
+ callback(patch13);
58652
57878
  } }));
58653
57879
  }
58654
57880
  function diffLinesResultToPatch(diff8) {
@@ -58733,68 +57959,68 @@ function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, ne
58733
57959
  };
58734
57960
  }
58735
57961
  }
58736
- function formatPatch(patch15, headerOptions) {
57962
+ function formatPatch(patch13, headerOptions) {
58737
57963
  var _a, _b, _c, _d, _e, _f;
58738
57964
  if (!headerOptions) {
58739
57965
  headerOptions = INCLUDE_HEADERS;
58740
57966
  }
58741
- if (Array.isArray(patch15)) {
58742
- if (patch15.length > 1 && !headerOptions.includeFileHeaders && !patch15.every((p3) => p3.isGit)) {
57967
+ if (Array.isArray(patch13)) {
57968
+ if (patch13.length > 1 && !headerOptions.includeFileHeaders && !patch13.every((p3) => p3.isGit)) {
58743
57969
  throw new Error("Cannot omit file headers on a multi-file patch. " + "(The result would be unparseable; how would a tool trying to apply " + "the patch know which changes are to which file?)");
58744
57970
  }
58745
- return patch15.map((p3) => formatPatch(p3, headerOptions)).join(`
57971
+ return patch13.map((p3) => formatPatch(p3, headerOptions)).join(`
58746
57972
  `);
58747
57973
  }
58748
57974
  const ret = [];
58749
- if (patch15.isGit) {
57975
+ if (patch13.isGit) {
58750
57976
  headerOptions = INCLUDE_HEADERS;
58751
- if (!patch15.oldFileName) {
57977
+ if (!patch13.oldFileName) {
58752
57978
  throw new Error("oldFileName must be specified for Git patches");
58753
57979
  }
58754
- if (!patch15.newFileName) {
57980
+ if (!patch13.newFileName) {
58755
57981
  throw new Error("newFileName must be specified for Git patches");
58756
57982
  }
58757
- let gitOldName = patch15.oldFileName;
58758
- let gitNewName = patch15.newFileName;
58759
- if (patch15.isCreate && gitOldName === "/dev/null") {
57983
+ let gitOldName = patch13.oldFileName;
57984
+ let gitNewName = patch13.newFileName;
57985
+ if (patch13.isCreate && gitOldName === "/dev/null") {
58760
57986
  gitOldName = gitNewName.replace(/^b\//, "a/");
58761
- } else if (patch15.isDelete && gitNewName === "/dev/null") {
57987
+ } else if (patch13.isDelete && gitNewName === "/dev/null") {
58762
57988
  gitNewName = gitOldName.replace(/^a\//, "b/");
58763
57989
  }
58764
57990
  ret.push("diff --git " + quoteFileNameIfNeeded(gitOldName) + " " + quoteFileNameIfNeeded(gitNewName));
58765
- if (patch15.isDelete) {
58766
- ret.push("deleted file mode " + ((_a = patch15.oldMode) !== null && _a !== undefined ? _a : "100644"));
57991
+ if (patch13.isDelete) {
57992
+ ret.push("deleted file mode " + ((_a = patch13.oldMode) !== null && _a !== undefined ? _a : "100644"));
58767
57993
  }
58768
- if (patch15.isCreate) {
58769
- ret.push("new file mode " + ((_b = patch15.newMode) !== null && _b !== undefined ? _b : "100644"));
57994
+ if (patch13.isCreate) {
57995
+ ret.push("new file mode " + ((_b = patch13.newMode) !== null && _b !== undefined ? _b : "100644"));
58770
57996
  }
58771
- if (patch15.oldMode && patch15.newMode && !patch15.isDelete && !patch15.isCreate) {
58772
- ret.push("old mode " + patch15.oldMode);
58773
- ret.push("new mode " + patch15.newMode);
57997
+ if (patch13.oldMode && patch13.newMode && !patch13.isDelete && !patch13.isCreate) {
57998
+ ret.push("old mode " + patch13.oldMode);
57999
+ ret.push("new mode " + patch13.newMode);
58774
58000
  }
58775
- if (patch15.isRename) {
58776
- ret.push("rename from " + quoteFileNameIfNeeded(((_c = patch15.oldFileName) !== null && _c !== undefined ? _c : "").replace(/^a\//, "")));
58777
- ret.push("rename to " + quoteFileNameIfNeeded(((_d = patch15.newFileName) !== null && _d !== undefined ? _d : "").replace(/^b\//, "")));
58001
+ if (patch13.isRename) {
58002
+ ret.push("rename from " + quoteFileNameIfNeeded(((_c = patch13.oldFileName) !== null && _c !== undefined ? _c : "").replace(/^a\//, "")));
58003
+ ret.push("rename to " + quoteFileNameIfNeeded(((_d = patch13.newFileName) !== null && _d !== undefined ? _d : "").replace(/^b\//, "")));
58778
58004
  }
58779
- if (patch15.isCopy) {
58780
- ret.push("copy from " + quoteFileNameIfNeeded(((_e = patch15.oldFileName) !== null && _e !== undefined ? _e : "").replace(/^a\//, "")));
58781
- ret.push("copy to " + quoteFileNameIfNeeded(((_f = patch15.newFileName) !== null && _f !== undefined ? _f : "").replace(/^b\//, "")));
58005
+ if (patch13.isCopy) {
58006
+ ret.push("copy from " + quoteFileNameIfNeeded(((_e = patch13.oldFileName) !== null && _e !== undefined ? _e : "").replace(/^a\//, "")));
58007
+ ret.push("copy to " + quoteFileNameIfNeeded(((_f = patch13.newFileName) !== null && _f !== undefined ? _f : "").replace(/^b\//, "")));
58782
58008
  }
58783
58009
  } else {
58784
- if (headerOptions.includeIndex && patch15.oldFileName == patch15.newFileName && patch15.oldFileName !== undefined) {
58785
- ret.push("Index: " + patch15.oldFileName);
58010
+ if (headerOptions.includeIndex && patch13.oldFileName == patch13.newFileName && patch13.oldFileName !== undefined) {
58011
+ ret.push("Index: " + patch13.oldFileName);
58786
58012
  }
58787
58013
  if (headerOptions.includeUnderline) {
58788
58014
  ret.push("===================================================================");
58789
58015
  }
58790
58016
  }
58791
- const hasHunks = patch15.hunks.length > 0;
58792
- if (headerOptions.includeFileHeaders && patch15.oldFileName !== undefined && patch15.newFileName !== undefined && (!patch15.isGit || hasHunks)) {
58793
- ret.push("--- " + quoteFileNameIfNeeded(patch15.oldFileName) + (patch15.oldHeader ? "\t" + patch15.oldHeader : ""));
58794
- ret.push("+++ " + quoteFileNameIfNeeded(patch15.newFileName) + (patch15.newHeader ? "\t" + patch15.newHeader : ""));
58017
+ const hasHunks = patch13.hunks.length > 0;
58018
+ if (headerOptions.includeFileHeaders && patch13.oldFileName !== undefined && patch13.newFileName !== undefined && (!patch13.isGit || hasHunks)) {
58019
+ ret.push("--- " + quoteFileNameIfNeeded(patch13.oldFileName) + (patch13.oldHeader ? "\t" + patch13.oldHeader : ""));
58020
+ ret.push("+++ " + quoteFileNameIfNeeded(patch13.newFileName) + (patch13.newHeader ? "\t" + patch13.newHeader : ""));
58795
58021
  }
58796
- for (let i = 0;i < patch15.hunks.length; i++) {
58797
- const hunk = patch15.hunks[i];
58022
+ for (let i = 0;i < patch13.hunks.length; i++) {
58023
+ const hunk = patch13.hunks[i];
58798
58024
  const oldStart = hunk.oldLines === 0 ? hunk.oldStart - 1 : hunk.oldStart;
58799
58025
  const newStart = hunk.newLines === 0 ? hunk.newStart - 1 : hunk.newStart;
58800
58026
  ret.push("@@ -" + oldStart + "," + hunk.oldLines + " +" + newStart + "," + hunk.newLines + " @@");
@@ -58806,23 +58032,23 @@ function formatPatch(patch15, headerOptions) {
58806
58032
  `) + `
58807
58033
  `;
58808
58034
  }
58809
- function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options9) {
58810
- if (typeof options9 === "function") {
58811
- options9 = { callback: options9 };
58035
+ function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options7) {
58036
+ if (typeof options7 === "function") {
58037
+ options7 = { callback: options7 };
58812
58038
  }
58813
- if (!(options9 === null || options9 === undefined ? undefined : options9.callback)) {
58814
- const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options9);
58039
+ if (!(options7 === null || options7 === undefined ? undefined : options7.callback)) {
58040
+ const patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options7);
58815
58041
  if (!patchObj) {
58816
58042
  return;
58817
58043
  }
58818
- return formatPatch(patchObj, options9 === null || options9 === undefined ? undefined : options9.headerOptions);
58044
+ return formatPatch(patchObj, options7 === null || options7 === undefined ? undefined : options7.headerOptions);
58819
58045
  } else {
58820
- const { callback } = options9;
58821
- structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options9), { callback: (patchObj) => {
58046
+ const { callback } = options7;
58047
+ structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, Object.assign(Object.assign({}, options7), { callback: (patchObj) => {
58822
58048
  if (!patchObj) {
58823
58049
  callback(undefined);
58824
58050
  } else {
58825
- callback(formatPatch(patchObj, options9.headerOptions));
58051
+ callback(formatPatch(patchObj, options7.headerOptions));
58826
58052
  }
58827
58053
  } }));
58828
58054
  }
@@ -58874,15 +58100,15 @@ var selectedSkills3 = (finalPacks, baseline) => [
58874
58100
  ...new Set(finalPacks.flatMap((packId) => skillsForPack(packId, baseline)))
58875
58101
  ].toSorted();
58876
58102
  var readManifest = (rootDirectory) => {
58877
- const manifestPath = path14.join(rootDirectory, scaffoldManifestFile);
58878
- if (!existsSync7(manifestPath)) {
58103
+ const manifestPath = path13.join(rootDirectory, scaffoldManifestFile);
58104
+ if (!existsSync6(manifestPath)) {
58879
58105
  throw new Error(`Missing ${scaffoldManifestFile}. Run \`punks scaffold setup\` first.`);
58880
58106
  }
58881
- return parseManifest(readFileSync7(manifestPath, "utf8"));
58107
+ return parseManifest(readFileSync6(manifestPath, "utf8"));
58882
58108
  };
58883
58109
  var contentForDiff = (rootDirectory, relativePath) => {
58884
- const absolutePath = path14.join(rootDirectory, relativePath);
58885
- if (!existsSync7(absolutePath)) {
58110
+ const absolutePath = path13.join(rootDirectory, relativePath);
58111
+ if (!existsSync6(absolutePath)) {
58886
58112
  return "";
58887
58113
  }
58888
58114
  const stat3 = lstatSync2(absolutePath);
@@ -58890,15 +58116,15 @@ var contentForDiff = (rootDirectory, relativePath) => {
58890
58116
  return `symlink:${readlinkSync2(absolutePath)}
58891
58117
  `;
58892
58118
  }
58893
- return readFileSync7(absolutePath, "utf8");
58119
+ return readFileSync6(absolutePath, "utf8");
58894
58120
  };
58895
58121
  var hashPath = (rootDirectory, relativePath) => {
58896
- const absolutePath = path14.join(rootDirectory, relativePath);
58897
- if (!existsSync7(absolutePath)) {
58122
+ const absolutePath = path13.join(rootDirectory, relativePath);
58123
+ if (!existsSync6(absolutePath)) {
58898
58124
  return null;
58899
58125
  }
58900
58126
  const stat3 = lstatSync2(absolutePath);
58901
- const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync2(absolutePath)}` : readFileSync7(absolutePath);
58127
+ const content = stat3.isSymbolicLink() ? `symlink:${readlinkSync2(absolutePath)}` : readFileSync6(absolutePath);
58902
58128
  return hashContent2(content);
58903
58129
  };
58904
58130
  var copyManagedFile = ({
@@ -58906,12 +58132,12 @@ var copyManagedFile = ({
58906
58132
  toDirectory,
58907
58133
  relativePath
58908
58134
  }) => {
58909
- const sourcePath = path14.join(fromDirectory, relativePath);
58910
- const targetPath = path14.join(toDirectory, relativePath);
58135
+ const sourcePath = path13.join(fromDirectory, relativePath);
58136
+ const targetPath = path13.join(toDirectory, relativePath);
58911
58137
  const stat3 = lstatSync2(sourcePath);
58912
- mkdirSync6(path14.dirname(targetPath), { recursive: true });
58913
- if (existsSync7(targetPath)) {
58914
- rmSync5(targetPath, { recursive: true, force: true });
58138
+ mkdirSync5(path13.dirname(targetPath), { recursive: true });
58139
+ if (existsSync6(targetPath)) {
58140
+ rmSync4(targetPath, { recursive: true, force: true });
58915
58141
  }
58916
58142
  if (stat3.isSymbolicLink()) {
58917
58143
  symlinkSync2(readlinkSync2(sourcePath), targetPath);
@@ -59028,7 +58254,7 @@ var runUpdate = ({
59028
58254
  const baselineDrift = typeof manifestBaseline?.version === "string" && manifestBaseline.version !== baseline.summary.version;
59029
58255
  const resolvedPacks = resolved.preselectedPacks;
59030
58256
  const packDrift = !comparePacks(finalPacks, resolvedPacks);
59031
- const expectedDirectory = mkdtempSync2(path14.join(tmpdir3(), "punks-update-"));
58257
+ const expectedDirectory = mkdtempSync2(path13.join(tmpdir3(), "punks-update-"));
59032
58258
  const expected = yield* writeScaffoldOutput({
59033
58259
  scanDirectory: rootDirectory,
59034
58260
  detection,
@@ -59123,7 +58349,7 @@ var runUpdate = ({
59123
58349
  });
59124
58350
  }
59125
58351
  for (const staleFile of staleFiles) {
59126
- rmSync5(path14.join(rootDirectory, staleFile), { recursive: true, force: true });
58352
+ rmSync4(path13.join(rootDirectory, staleFile), { recursive: true, force: true });
59127
58353
  }
59128
58354
  }
59129
58355
  if (check2 && needsAttention) {
@@ -59158,7 +58384,7 @@ var runUpdate = ({
59158
58384
  yield* prompt4.writeLine(renderJsonLabel());
59159
58385
  yield* prompt4.writeLine(encodePrettyJson2(result));
59160
58386
  }
59161
- rmSync5(expectedDirectory, { recursive: true, force: true });
58387
+ rmSync4(expectedDirectory, { recursive: true, force: true });
59162
58388
  if (result.applied) {
59163
58389
  submitCliEvent("cli.scaffold.update.applied", {
59164
58390
  cwd: rootDirectory,
@@ -59186,7 +58412,7 @@ var updateCommand = exports_Command.make("update", {
59186
58412
  refreshBaseline: refreshBaselineOption2
59187
58413
  }, ({ input: input2, check: check2, write: write4, json: json2, baseline, refreshBaseline }) => exports_Effect.scoped(exports_Effect.gen(function* () {
59188
58414
  const prompt4 = yield* PromptLive;
59189
- const rootDirectory = path15.resolve(process.cwd(), getOrElse(input2, () => "."));
58415
+ const rootDirectory = path14.resolve(process.cwd(), getOrElse(input2, () => "."));
59190
58416
  const resolvedBaseline = yield* exports_Effect.promise(() => resolveBaseline(baselineResolveOptions(baseline, refreshBaseline, rootDirectory)));
59191
58417
  yield* runUpdate({
59192
58418
  rootDirectory,
@@ -59481,8 +58707,8 @@ var startupCheckWorkerEnv = "DP_STARTUP_CHECK_WORKER";
59481
58707
  var startupCheckCliEnv = "DP_STARTUP_CHECK_CLI";
59482
58708
  var startupCheckSkillEnv = "DP_STARTUP_CHECK_SKILL";
59483
58709
  var startupCheckIntervalMs = Number.parseInt(process.env.DP_STARTUP_CHECK_INTERVAL_MS ?? String(12 * 60 * 60 * 1000), 10);
59484
- var startupCheckCacheFile = path16.join(homedir4(), ".cache", "punks", "startup-check.json");
59485
- var app = exports_Command.make("punks", {}, () => exports_Effect.sync(() => console.log(renderCommandGuide()))).pipe(exports_Command.withDescription("Harness Intelligence CLI. Agents: activate $dp-cli before acting on generated .devpunks output."), exports_Command.withSubcommands([authCommand, reportCommand, scaffoldCommand, updateCommand]));
58710
+ var startupCheckCacheFile = path15.join(homedir3(), ".cache", "punks", "startup-check.json");
58711
+ var app = exports_Command.make("punks", {}, () => exports_Effect.sync(() => console.log(renderCommandGuide()))).pipe(exports_Command.withDescription("Harness Intelligence CLI. Agents: activate $dp-cli before acting on generated .devpunks output."), exports_Command.withSubcommands([reportCommand, scaffoldCommand, updateCommand]));
59486
58712
  var cli = exports_Command.run(app, {
59487
58713
  name: "punks",
59488
58714
  version
@@ -59529,15 +58755,15 @@ var hasFreshStartupCheck = () => {
59529
58755
  return false;
59530
58756
  }
59531
58757
  try {
59532
- const parsed = JSON.parse(readFileSync8(startupCheckCacheFile, "utf8"));
58758
+ const parsed = JSON.parse(readFileSync7(startupCheckCacheFile, "utf8"));
59533
58759
  return typeof parsed.checkedAt === "number" && Date.now() - parsed.checkedAt < startupCheckIntervalMs;
59534
58760
  } catch {
59535
58761
  return false;
59536
58762
  }
59537
58763
  };
59538
58764
  var markStartupCheckStarted = () => {
59539
- mkdirSync7(path16.dirname(startupCheckCacheFile), { recursive: true });
59540
- writeFileSync6(startupCheckCacheFile, JSON.stringify({ checkedAt: Date.now() }, null, 2));
58765
+ mkdirSync6(path15.dirname(startupCheckCacheFile), { recursive: true });
58766
+ writeFileSync5(startupCheckCacheFile, JSON.stringify({ checkedAt: Date.now() }, null, 2));
59541
58767
  };
59542
58768
  var startBackgroundStartupChecks = () => {
59543
58769
  const checkCli = shouldCheckSelfUpdate();
@@ -59546,7 +58772,7 @@ var startBackgroundStartupChecks = () => {
59546
58772
  return;
59547
58773
  }
59548
58774
  const entrypoint = process.argv[1];
59549
- if (entrypoint === undefined || !existsSync8(entrypoint)) {
58775
+ if (entrypoint === undefined || !existsSync7(entrypoint)) {
59550
58776
  return;
59551
58777
  }
59552
58778
  markStartupCheckStarted();