lalph 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -4425,7 +4425,7 @@ const isNone$1 = (fa) => fa._tag === "None";
4425
4425
  /** @internal */
4426
4426
  const isSome$1 = (fa) => fa._tag === "Some";
4427
4427
  /** @internal */
4428
- const none$4 = /* @__PURE__ */ Object.create(NoneProto);
4428
+ const none$5 = /* @__PURE__ */ Object.create(NoneProto);
4429
4429
  /** @internal */
4430
4430
  const some$3 = (value) => {
4431
4431
  const a = Object.create(SomeProto);
@@ -4509,9 +4509,9 @@ const succeed$7 = (success) => {
4509
4509
  return a;
4510
4510
  };
4511
4511
  /** @internal */
4512
- const getFailure$2 = (self) => isSuccess$6(self) ? none$4 : some$3(self.failure);
4512
+ const getFailure$2 = (self) => isSuccess$6(self) ? none$5 : some$3(self.failure);
4513
4513
  /** @internal */
4514
- const getSuccess$3 = (self) => isFailure$6(self) ? none$4 : some$3(self.success);
4514
+ const getSuccess$3 = (self) => isFailure$6(self) ? none$5 : some$3(self.success);
4515
4515
  /** @internal */
4516
4516
  const fromOption$4 = /* @__PURE__ */ dual(2, (self, onNone) => isNone$1(self) ? fail$10(onNone()) : succeed$7(self.value));
4517
4517
 
@@ -4543,7 +4543,7 @@ const fromOption$4 = /* @__PURE__ */ dual(2, (self, onNone) => isNone$1(self) ?
4543
4543
  * @category Constructors
4544
4544
  * @since 2.0.0
4545
4545
  */
4546
- const none$3 = () => none$4;
4546
+ const none$4 = () => none$5;
4547
4547
  /**
4548
4548
  * Wraps the given value into an `Option` to represent its presence.
4549
4549
  *
@@ -4797,7 +4797,7 @@ const getOrElse$1 = /* @__PURE__ */ dual(2, (self, onNone) => isNone(self) ? onN
4797
4797
  * @category Conversions
4798
4798
  * @since 2.0.0
4799
4799
  */
4800
- const fromNullishOr$2 = (a) => a == null ? none$3() : some$2(a);
4800
+ const fromNullishOr$2 = (a) => a == null ? none$4() : some$2(a);
4801
4801
  /**
4802
4802
  * Returns the value contained in the `Option` if it is `Some`; otherwise,
4803
4803
  * returns `undefined`.
@@ -4895,7 +4895,7 @@ const getOrThrowWith$1 = /* @__PURE__ */ dual(2, (self, onNone) => {
4895
4895
  * @category Mapping
4896
4896
  * @since 2.0.0
4897
4897
  */
4898
- const map$14 = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$3() : some$2(f(self.value)));
4898
+ const map$14 = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$4() : some$2(f(self.value)));
4899
4899
  /**
4900
4900
  * Replaces the value inside a `Some` with the specified constant value, leaving
4901
4901
  * `None` unchanged.
@@ -4983,7 +4983,7 @@ const as$2 = /* @__PURE__ */ dual(2, (self, b) => map$14(self, () => b));
4983
4983
  * @category Sequencing
4984
4984
  * @since 2.0.0
4985
4985
  */
4986
- const flatMap$5 = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$3() : f(self.value));
4986
+ const flatMap$5 = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$4() : f(self.value));
4987
4987
  /**
4988
4988
  * Combines `flatMap` and `fromNullish`, transforming the value inside a `Some`
4989
4989
  * using a function that may return `null` or `undefined`.
@@ -5046,7 +5046,7 @@ const flatMap$5 = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$3() :
5046
5046
  * @category Sequencing
5047
5047
  * @since 2.0.0
5048
5048
  */
5049
- const flatMapNullishOr = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$3() : fromNullishOr$2(f(self.value)));
5049
+ const flatMapNullishOr = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? none$4() : fromNullishOr$2(f(self.value)));
5050
5050
  /**
5051
5051
  * Flattens an `Option` of `Option` into a single `Option`.
5052
5052
  *
@@ -5170,7 +5170,7 @@ const filterMap$4 = flatMap$5;
5170
5170
  * @category Filtering
5171
5171
  * @since 2.0.0
5172
5172
  */
5173
- const filter$8 = /* @__PURE__ */ dual(2, (self, predicate) => filterMap$4(self, (b) => predicate(b) ? some$3(b) : none$4));
5173
+ const filter$8 = /* @__PURE__ */ dual(2, (self, predicate) => filterMap$4(self, (b) => predicate(b) ? some$3(b) : none$5));
5174
5174
  /**
5175
5175
  * Creates an `Equivalence` instance for comparing `Option` values, using a
5176
5176
  * provided `Equivalence` for the inner type.
@@ -5244,7 +5244,7 @@ const makeEquivalence$5 = (isEquivalent) => make$58((x, y) => isNone(x) ? isNone
5244
5244
  * @category Lifting
5245
5245
  * @since 2.0.0
5246
5246
  */
5247
- const liftPredicate = /* @__PURE__ */ dual(2, (b, predicate) => predicate(b) ? some$2(b) : none$3());
5247
+ const liftPredicate = /* @__PURE__ */ dual(2, (b, predicate) => predicate(b) ? some$2(b) : none$4());
5248
5248
 
5249
5249
  //#endregion
5250
5250
  //#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@e559abd_988f9a6806dc7ec0481ca359e33f6f4a/node_modules/effect/dist/Result.js
@@ -5512,7 +5512,7 @@ const getOrThrow$1 = /* @__PURE__ */ getOrThrowWith(identity);
5512
5512
  * @category Constructors
5513
5513
  * @since 4.0.0
5514
5514
  */
5515
- const succeedNone$2 = /* @__PURE__ */ succeed$6(none$4);
5515
+ const succeedNone$2 = /* @__PURE__ */ succeed$6(none$5);
5516
5516
 
5517
5517
  //#endregion
5518
5518
  //#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@e559abd_988f9a6806dc7ec0481ca359e33f6f4a/node_modules/effect/dist/Filter.js
@@ -5755,7 +5755,7 @@ const composePassthrough = /* @__PURE__ */ dual(2, (left, right) => (input) => {
5755
5755
  */
5756
5756
  const toOption = (self) => (input) => {
5757
5757
  const result = self(input);
5758
- return isFail(result) ? none$3() : some$2(result);
5758
+ return isFail(result) ? none$4() : some$2(result);
5759
5759
  };
5760
5760
 
5761
5761
  //#endregion
@@ -5920,7 +5920,7 @@ const findFirst$4 = /* @__PURE__ */ dual(2, (self, f) => {
5920
5920
  } else if (isSome(o)) return o;
5921
5921
  i++;
5922
5922
  }
5923
- return none$3();
5923
+ return none$4();
5924
5924
  });
5925
5925
  const constEmpty = { [Symbol.iterator]() {
5926
5926
  return constEmptyIterator;
@@ -6409,7 +6409,7 @@ const headNonEmpty = /* @__PURE__ */ getUnsafe$6(0);
6409
6409
  * @category getters
6410
6410
  * @since 2.0.0
6411
6411
  */
6412
- const last = (self) => isReadonlyArrayNonEmpty(self) ? some$2(lastNonEmpty(self)) : none$3();
6412
+ const last = (self) => isReadonlyArrayNonEmpty(self) ? some$2(lastNonEmpty(self)) : none$4();
6413
6413
  /**
6414
6414
  * Get the last element of a non empty array.
6415
6415
  *
@@ -6529,7 +6529,7 @@ const findLast$1 = /* @__PURE__ */ dual(2, (self, f) => {
6529
6529
  if (o) return some$2(a);
6530
6530
  } else if (isSome(o)) return o;
6531
6531
  }
6532
- return none$3();
6532
+ return none$4();
6533
6533
  });
6534
6534
  /**
6535
6535
  * Reverse an `Iterable`, creating a new `Array`.
@@ -7207,7 +7207,7 @@ const serviceNotFoundError = (service) => {
7207
7207
  */
7208
7208
  const getOption = /* @__PURE__ */ dual(2, (self, service) => {
7209
7209
  if (self.mapUnsafe.has(service.key)) return some$2(self.mapUnsafe.get(service.key));
7210
- return isReference(service) ? some$2(getDefaultValue(service)) : none$3();
7210
+ return isReference(service) ? some$2(getDefaultValue(service)) : none$4();
7211
7211
  });
7212
7212
  /**
7213
7213
  * Merges two `ServiceMap`s, returning a new `ServiceMap` containing the services of both.
@@ -8777,7 +8777,7 @@ const yieldNow$1 = /* @__PURE__ */ yieldNowWith$1(0);
8777
8777
  /** @internal */
8778
8778
  const succeedSome$1 = (a) => succeed$5(some$2(a));
8779
8779
  /** @internal */
8780
- const succeedNone$1 = /* @__PURE__ */ succeed$5(/* @__PURE__ */ none$3());
8780
+ const succeedNone$1 = /* @__PURE__ */ succeed$5(/* @__PURE__ */ none$4());
8781
8781
  /** @internal */
8782
8782
  const failCauseSync$1 = (evaluate) => suspend$4(() => failCause$5(internalCall(evaluate)));
8783
8783
  /** @internal */
@@ -9162,13 +9162,13 @@ const exitAsVoidAll = (exits) => {
9162
9162
  return failures.length === 0 ? exitVoid : exitFailCause(causeFromFailures(failures));
9163
9163
  };
9164
9164
  /** @internal */
9165
- const exitGetSuccess = (self) => exitIsSuccess(self) ? some$2(self.value) : none$3();
9165
+ const exitGetSuccess = (self) => exitIsSuccess(self) ? some$2(self.value) : none$4();
9166
9166
  /** @internal */
9167
- const exitGetCause = (self) => exitIsFailure(self) ? some$2(self.cause) : none$3();
9167
+ const exitGetCause = (self) => exitIsFailure(self) ? some$2(self.cause) : none$4();
9168
9168
  /** @internal */
9169
9169
  const exitGetError = (self) => {
9170
9170
  const error = exitFilterError(self);
9171
- return isFail(error) ? none$3() : some$2(error);
9171
+ return isFail(error) ? none$4() : some$2(error);
9172
9172
  };
9173
9173
  /** @internal */
9174
9174
  const service$1 = fromYieldable$1;
@@ -9358,7 +9358,7 @@ const ignoreCause$1 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self,
9358
9358
  });
9359
9359
  /** @internal */
9360
9360
  const option$2 = (self) => match$4(self, {
9361
- onFailure: none$3,
9361
+ onFailure: none$4,
9362
9362
  onSuccess: some$2
9363
9363
  });
9364
9364
  /** @internal */
@@ -9452,7 +9452,7 @@ const timeout$1 = /* @__PURE__ */ dual(2, (self, duration) => timeoutOrElse$1(se
9452
9452
  onTimeout: () => fail$7(new TimeoutError$1())
9453
9453
  }));
9454
9454
  /** @internal */
9455
- const timeoutOption$1 = /* @__PURE__ */ dual(2, (self, duration) => raceFirst$1(asSome$1(self), as$1(sleep$1(duration), none$3())));
9455
+ const timeoutOption$1 = /* @__PURE__ */ dual(2, (self, duration) => raceFirst$1(asSome$1(self), as$1(sleep$1(duration), none$4())));
9456
9456
  /** @internal */
9457
9457
  const timed$1 = (self) => clockWith$2((clock) => {
9458
9458
  const start = clock.currentTimeNanosUnsafe();
@@ -14407,7 +14407,7 @@ const repeatOrElse$1 = /* @__PURE__ */ dual(3, (self, schedule, orElse) => flatM
14407
14407
  let meta = CurrentMetadata.defaultValue();
14408
14408
  return catch_$2(forever$2(tap$1(flatMap$4(suspend$4(() => provideService$1(self, CurrentMetadata, meta)), step), (meta_) => {
14409
14409
  meta = meta_;
14410
- }), { autoYield: false }), (error) => isDone$2(error) ? succeed$5(error.value) : orElse(error, meta.attempt === 0 ? none$3() : some$2(meta)));
14410
+ }), { autoYield: false }), (error) => isDone$2(error) ? succeed$5(error.value) : orElse(error, meta.attempt === 0 ? none$4() : some$2(meta)));
14411
14411
  }));
14412
14412
  /** @internal */
14413
14413
  const retryOrElse$1 = /* @__PURE__ */ dual(3, (self, policy, orElse) => flatMap$4(toStepWithMetadata(policy), (step) => {
@@ -24439,7 +24439,7 @@ var Arrays = class Arrays extends Base {
24439
24439
  let i = 0;
24440
24440
  for (; i < elementLen; i++) {
24441
24441
  const e = elements[i];
24442
- const value = i < input.length ? some$2(input[i]) : none$3();
24442
+ const value = i < input.length ? some$2(input[i]) : none$4();
24443
24443
  const eff = e.parser(value, options);
24444
24444
  const exit$5 = effectIsExit(eff) ? eff : yield* exit(eff);
24445
24445
  if (exit$5._tag === "Failure") {
@@ -24650,7 +24650,7 @@ var Objects = class Objects extends Base {
24650
24650
  }
24651
24651
  for (let i = 0; i < propertyCount; i++) {
24652
24652
  const p = properties[i];
24653
- const value = Object.hasOwn(input, p.name) ? some$2(input[p.name]) : none$3();
24653
+ const value = Object.hasOwn(input, p.name) ? some$2(input[p.name]) : none$4();
24654
24654
  const eff = p.parser(value, options);
24655
24655
  const exit$6 = effectIsExit(eff) ? eff : yield* exit(eff);
24656
24656
  if (exit$6._tag === "Failure") {
@@ -29304,7 +29304,7 @@ const runForEach$1 = /* @__PURE__ */ dual(2, (self, f) => runWith$1(self, (pull)
29304
29304
  * @category execution
29305
29305
  */
29306
29306
  const runHead$1 = (self) => suspend$3(() => {
29307
- let head = none$3();
29307
+ let head = none$4();
29308
29308
  return runWith$1(self, (pull) => pull.pipe(asSome, flatMap$2((head_) => {
29309
29309
  head = head_;
29310
29310
  return done();
@@ -29544,8 +29544,8 @@ const reduceArray = (initial, f) => fromTransform((upstream) => {
29544
29544
  return void_$1;
29545
29545
  }), forever({ autoYield: false }), catchDone(() => succeed$1([state])));
29546
29546
  });
29547
- const head_ = /* @__PURE__ */ reduceWhile(none$3, isNone, (_, in_) => some$2(in_));
29548
- const last_ = /* @__PURE__ */ reduceArray(none$3, (_, arr) => last(arr));
29547
+ const head_ = /* @__PURE__ */ reduceWhile(none$4, isNone, (_, in_) => some$2(in_));
29548
+ const last_ = /* @__PURE__ */ reduceArray(none$4, (_, arr) => last(arr));
29549
29549
  /**
29550
29550
  * A sink that executes the provided effectful function for every item fed
29551
29551
  * to it.
@@ -29751,12 +29751,12 @@ const fromIterable$3 = (entries) => {
29751
29751
  */
29752
29752
  const get$11 = /* @__PURE__ */ dual(2, (self, key) => {
29753
29753
  if (self.backing.has(key)) return some$2(self.backing.get(key));
29754
- else if (isSimpleKey(key)) return none$3();
29754
+ else if (isSimpleKey(key)) return none$4();
29755
29755
  const refKey = referentialKeysCache.get(self);
29756
- if (refKey !== void 0) return self.backing.has(refKey) ? some$2(self.backing.get(refKey)) : none$3();
29756
+ if (refKey !== void 0) return self.backing.has(refKey) ? some$2(self.backing.get(refKey)) : none$4();
29757
29757
  const hash$5 = hash(key);
29758
29758
  const bucket = self.buckets.get(hash$5);
29759
- if (bucket === void 0) return none$3();
29759
+ if (bucket === void 0) return none$4();
29760
29760
  return getFromBucket(self, bucket, key);
29761
29761
  });
29762
29762
  const referentialKeysCache = /* @__PURE__ */ new WeakMap();
@@ -29796,7 +29796,7 @@ const getFromBucket = (self, bucket, key) => {
29796
29796
  referentialKeysCache.set(key, refKey);
29797
29797
  return some$2(self.backing.get(refKey));
29798
29798
  }
29799
- return none$3();
29799
+ return none$4();
29800
29800
  };
29801
29801
  /**
29802
29802
  * Checks if the MutableHashMap contains the specified key.
@@ -34892,7 +34892,7 @@ function Option(value) {
34892
34892
  _tag: Literal("Some"),
34893
34893
  value
34894
34894
  }), Struct({ _tag: Literal("None") })]), transform$2({
34895
- decode: (e) => e._tag === "None" ? none$3() : some$2(e.value),
34895
+ decode: (e) => e._tag === "None" ? none$4() : some$2(e.value),
34896
34896
  encode: (o) => isSome(o) ? {
34897
34897
  _tag: "Some",
34898
34898
  value: o.value
@@ -34902,7 +34902,7 @@ function Option(value) {
34902
34902
  return fc.oneof(ctx?.isSuspend ? {
34903
34903
  maxDepth: 2,
34904
34904
  depthIdentifier: "Option"
34905
- } : {}, fc.constant(none$3()), value.map(some$2));
34905
+ } : {}, fc.constant(none$4()), value.map(some$2));
34906
34906
  },
34907
34907
  toEquivalence: ([value]) => makeEquivalence$5(value),
34908
34908
  toFormatter: ([value]) => match$7({
@@ -35761,7 +35761,7 @@ function isMissingDataOnly(issue) {
35761
35761
  *
35762
35762
  * @since 4.0.0
35763
35763
  */
35764
- const withDefault$2 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
35764
+ const withDefault$3 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
35765
35765
  return orElse(self, (err) => {
35766
35766
  if (isSchemaError(err.cause)) {
35767
35767
  const issue = err.cause.issue;
@@ -35780,7 +35780,7 @@ const withDefault$2 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
35780
35780
  *
35781
35781
  * @since 4.0.0
35782
35782
  */
35783
- const option = (self) => self.pipe(map$5(some$2), withDefault$2(() => none$3()));
35783
+ const option = (self) => self.pipe(map$5(some$2), withDefault$3(() => none$4()));
35784
35784
  const dump = /* @__PURE__ */ fnUntraced(function* (provider, path) {
35785
35785
  const stat = yield* provider.load(path);
35786
35786
  if (stat === void 0) return void 0;
@@ -47152,7 +47152,7 @@ const choice$2 = (choices) => {
47152
47152
  * @since 4.0.0
47153
47153
  * @category constructors
47154
47154
  */
47155
- const path$1 = (pathType, mustExist) => makePrimitive("Path", fnUntraced(function* (value) {
47155
+ const path$2 = (pathType, mustExist) => makePrimitive("Path", fnUntraced(function* (value) {
47156
47156
  const fs = yield* FileSystem;
47157
47157
  const path = yield* Path$1;
47158
47158
  const absolutePath = path.isAbsolute(value) ? value : path.resolve(value);
@@ -47186,7 +47186,7 @@ const path$1 = (pathType, mustExist) => makePrimitive("Path", fnUntraced(functio
47186
47186
  * @since 4.0.0
47187
47187
  * @category constructors
47188
47188
  */
47189
- const none$2 = /* @__PURE__ */ makePrimitive("None", () => fail$4("This option does not accept values"));
47189
+ const none$3 = /* @__PURE__ */ makePrimitive("None", () => fail$4("This option does not accept values"));
47190
47190
  /**
47191
47191
  * Gets a human-readable type name for a primitive.
47192
47192
  *
@@ -48550,10 +48550,10 @@ const choice$1 = (kind, name, choices) => {
48550
48550
  * @since 4.0.0
48551
48551
  * @category constructors
48552
48552
  */
48553
- const path = (kind, name, options) => makeSingle({
48553
+ const path$1 = (kind, name, options) => makeSingle({
48554
48554
  name,
48555
48555
  kind,
48556
- primitiveType: path$1(options?.pathType ?? "either", options?.mustExist),
48556
+ primitiveType: path$2(options?.pathType ?? "either", options?.mustExist),
48557
48557
  typeName: options?.typeName
48558
48558
  });
48559
48559
  /**
@@ -48580,7 +48580,7 @@ const path = (kind, name, options) => makeSingle({
48580
48580
  * @since 4.0.0
48581
48581
  * @category constructors
48582
48582
  */
48583
- const directory$1 = (kind, name, options) => path(kind, name, {
48583
+ const directory$1 = (kind, name, options) => path$1(kind, name, {
48584
48584
  pathType: "directory",
48585
48585
  typeName: "directory",
48586
48586
  mustExist: options?.mustExist
@@ -48608,9 +48608,9 @@ const directory$1 = (kind, name, options) => path(kind, name, {
48608
48608
  * @since 4.0.0
48609
48609
  * @category constructors
48610
48610
  */
48611
- const none$1 = (kind) => makeSingle({
48611
+ const none$2 = (kind) => makeSingle({
48612
48612
  name: "__none__",
48613
- primitiveType: none$2,
48613
+ primitiveType: none$3,
48614
48614
  kind
48615
48615
  });
48616
48616
  const FLAG_DASH_REGEXP = /^-+/;
@@ -48671,7 +48671,7 @@ const withAlias$1 = /* @__PURE__ */ dual(2, (self, alias) => {
48671
48671
  * @since 4.0.0
48672
48672
  * @category combinators
48673
48673
  */
48674
- const withDescription$2 = /* @__PURE__ */ dual(2, (self, description) => {
48674
+ const withDescription$3 = /* @__PURE__ */ dual(2, (self, description) => {
48675
48675
  return transformSingle(self, (single) => makeSingle({
48676
48676
  ...single,
48677
48677
  description
@@ -48764,7 +48764,7 @@ const mapEffect = /* @__PURE__ */ dual(2, (self, f) => transform$1(self, (parse)
48764
48764
  * @category combinators
48765
48765
  */
48766
48766
  const optional$1 = (param) => {
48767
- const parse = (args) => param.parse(args).pipe(map$8(([leftover, value]) => [leftover, some$2(value)]), catchTag("MissingOption", () => succeed$1([args.arguments, none$3()])), catchTag("MissingArgument", () => succeed$1([args.arguments, none$3()])));
48767
+ const parse = (args) => param.parse(args).pipe(map$8(([leftover, value]) => [leftover, some$2(value)]), catchTag("MissingOption", () => succeed$1([args.arguments, none$4()])), catchTag("MissingArgument", () => succeed$1([args.arguments, none$4()])));
48768
48768
  return Object.assign(Object.create(Proto$16), {
48769
48769
  _tag: "Optional",
48770
48770
  kind: param.kind,
@@ -48801,7 +48801,7 @@ const optional$1 = (param) => {
48801
48801
  * @since 4.0.0
48802
48802
  * @category combinators
48803
48803
  */
48804
- const withDefault$1 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
48804
+ const withDefault$2 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
48805
48805
  if (!isEffect(defaultValue)) return map$4(optional$1(self), getOrElse$1(() => defaultValue));
48806
48806
  return mapEffect(optional$1(self), match$7({
48807
48807
  onNone: () => defaultValue,
@@ -49028,6 +49028,68 @@ const getParamMetadata = (param) => {
49028
49028
  });
49029
49029
  };
49030
49030
 
49031
+ //#endregion
49032
+ //#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@e559abd_988f9a6806dc7ec0481ca359e33f6f4a/node_modules/effect/dist/unstable/cli/Argument.js
49033
+ /**
49034
+ * Creates a positional path argument.
49035
+ *
49036
+ * @example
49037
+ * ```ts
49038
+ * import { Argument } from "effect/unstable/cli"
49039
+ *
49040
+ * const configPath = Argument.path("config")
49041
+ * ```
49042
+ *
49043
+ * @since 4.0.0
49044
+ * @category constructors
49045
+ */
49046
+ const path = (name, options) => path$1(argumentKind, name, options);
49047
+ /**
49048
+ * Creates an empty sentinel argument that always fails to parse.
49049
+ *
49050
+ * @example
49051
+ * ```ts
49052
+ * import { Argument } from "effect/unstable/cli"
49053
+ *
49054
+ * // Used as a placeholder or default in combinators
49055
+ * const noArg = Argument.none
49056
+ * ```
49057
+ *
49058
+ * @since 4.0.0
49059
+ * @category constructors
49060
+ */
49061
+ const none$1 = /* @__PURE__ */ none$2(argumentKind);
49062
+ /**
49063
+ * Adds a description to a positional argument.
49064
+ *
49065
+ * @example
49066
+ * ```ts
49067
+ * import { Argument } from "effect/unstable/cli"
49068
+ *
49069
+ * const filename = Argument.string("filename").pipe(
49070
+ * Argument.withDescription("The input file to process")
49071
+ * )
49072
+ * ```
49073
+ *
49074
+ * @since 4.0.0
49075
+ * @category combinators
49076
+ */
49077
+ const withDescription$2 = /* @__PURE__ */ dual(2, (self, description) => withDescription$3(self, description));
49078
+ /**
49079
+ * Provides a default value for a positional argument.
49080
+ *
49081
+ * @example
49082
+ * ```ts
49083
+ * import { Argument } from "effect/unstable/cli"
49084
+ *
49085
+ * const port = Argument.integer("port").pipe(Argument.withDefault(8080))
49086
+ * ```
49087
+ *
49088
+ * @since 4.0.0
49089
+ * @category combinators
49090
+ */
49091
+ const withDefault$1 = withDefault$2;
49092
+
49031
49093
  //#endregion
49032
49094
  //#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@e559abd_988f9a6806dc7ec0481ca359e33f6f4a/node_modules/effect/dist/unstable/cli/CliOutput.js
49033
49095
  /**
@@ -50187,7 +50249,7 @@ const directory = (name, options) => directory$1(flagKind, name, options);
50187
50249
  * @since 4.0.0
50188
50250
  * @category constructors
50189
50251
  */
50190
- const none = /* @__PURE__ */ none$1(flagKind);
50252
+ const none = /* @__PURE__ */ none$2(flagKind);
50191
50253
  /**
50192
50254
  * Adds an alias to a flag, allowing it to be referenced by multiple names.
50193
50255
  *
@@ -50230,7 +50292,7 @@ const withAlias = /* @__PURE__ */ dual(2, (self, alias) => withAlias$1(self, ali
50230
50292
  * @since 4.0.0
50231
50293
  * @category help documentation
50232
50294
  */
50233
- const withDescription$1 = /* @__PURE__ */ dual(2, (self, description) => withDescription$2(self, description));
50295
+ const withDescription$1 = /* @__PURE__ */ dual(2, (self, description) => withDescription$3(self, description));
50234
50296
  /**
50235
50297
  * Makes a flag optional, returning an Option type that can be None if not provided.
50236
50298
  *
@@ -50279,7 +50341,7 @@ const optional = (param) => optional$1(param);
50279
50341
  * @since 4.0.0
50280
50342
  * @category optionality
50281
50343
  */
50282
- const withDefault = withDefault$1;
50344
+ const withDefault = withDefault$2;
50283
50345
  /**
50284
50346
  * Adds a fallback config that is loaded when a required flag is missing.
50285
50347
  *
@@ -52184,7 +52246,7 @@ var EmptyNode = class extends Node {
52184
52246
  return 0;
52185
52247
  }
52186
52248
  get(_shift, _hash, _key) {
52187
- return none$3();
52249
+ return none$4();
52188
52250
  }
52189
52251
  has(_shift, _hash, _key) {
52190
52252
  return false;
@@ -52225,7 +52287,7 @@ var LeafNode = class LeafNode extends Node {
52225
52287
  }
52226
52288
  get(_shift, hash, key) {
52227
52289
  if (this.hash === hash && equals$1(this.key, key)) return some$2(this.value);
52228
- return none$3();
52290
+ return none$4();
52229
52291
  }
52230
52292
  has(_shift, hash, key) {
52231
52293
  return this.hash === hash && equals$1(this.key, key);
@@ -52276,9 +52338,9 @@ var CollisionNode = class CollisionNode extends Node {
52276
52338
  return this.entries.length;
52277
52339
  }
52278
52340
  get(_shift, hash, key) {
52279
- if (this.hash !== hash) return none$3();
52341
+ if (this.hash !== hash) return none$4();
52280
52342
  for (const [k, v] of this.entries) if (equals$1(k, key)) return some$2(v);
52281
- return none$3();
52343
+ return none$4();
52282
52344
  }
52283
52345
  has(_shift, hash, key) {
52284
52346
  if (this.hash !== hash) return false;
@@ -52351,7 +52413,7 @@ var IndexedNode = class IndexedNode extends Node {
52351
52413
  }
52352
52414
  get(shift, hash, key) {
52353
52415
  const bit = bitpos(hash, shift);
52354
- if ((this.bitmap & bit) === 0) return none$3();
52416
+ if ((this.bitmap & bit) === 0) return none$4();
52355
52417
  const idx = index(this.bitmap, bit);
52356
52418
  return this.children[idx].get(shift + SHIFT, hash, key);
52357
52419
  }
@@ -52472,7 +52534,7 @@ var ArrayNode = class ArrayNode extends Node {
52472
52534
  get(shift, hash, key) {
52473
52535
  const idx = mask(hash, shift);
52474
52536
  const child = this.children[idx];
52475
- return child ? child.get(shift + SHIFT, hash, key) : none$3();
52537
+ return child ? child.get(shift + SHIFT, hash, key) : none$4();
52476
52538
  }
52477
52539
  has(shift, hash, key) {
52478
52540
  const idx = mask(hash, shift);
@@ -61207,7 +61269,7 @@ const makeConfig = (headers) => withFiber((fiber) => {
61207
61269
  */
61208
61270
  const makeChannel = (headers) => fromTransform$1((upstream) => map$8(makeConfig(headers), (config) => {
61209
61271
  let partsBuffer = [];
61210
- let exit = none$3();
61272
+ let exit = none$4();
61211
61273
  const parser = make$11({
61212
61274
  ...config,
61213
61275
  onField(info, value) {
@@ -67174,13 +67236,13 @@ const formatBashInput = (input) => pipe(decodeUnknownOption(BashInput)(input), f
67174
67236
  const formatFileInput = (input) => pipe(decodeUnknownOption(FileInput)(input), flatMap$5((data) => fromNullishOr$2(data.file_path)), filter$8((path) => path.length > 0), map$14((path) => dim(path) + "\n"));
67175
67237
  const formatPatternInput = (input) => pipe(decodeUnknownOption(PatternInput)(input), flatMap$5((data) => fromNullishOr$2(data.pattern)), filter$8((pattern) => pattern.length > 0), map$14((pattern) => dim(pattern) + "\n"));
67176
67238
  const formatMcpInput = (input) => {
67177
- if (typeof input !== "object" || input === null) return none$3();
67239
+ if (typeof input !== "object" || input === null) return none$4();
67178
67240
  const data = input;
67179
67241
  const parts = McpInputFields.flatMap((field) => match$7(fromNullishOr$2(data[field]), {
67180
67242
  onNone: () => [],
67181
67243
  onSome: (value) => [`${field}=${truncate(String(value), 50)}`]
67182
67244
  }));
67183
- return parts.length > 0 ? some$2(dim(parts.join(" ")) + "\n") : none$3();
67245
+ return parts.length > 0 ? some$2(dim(parts.join(" ")) + "\n") : none$4();
67184
67246
  };
67185
67247
  const formatGenericInput = (input) => pipe(fromNullishOr$2(input), map$14((v) => dim(truncate(JSON.stringify(v), 100)) + "\n"));
67186
67248
  const formatUserQuestion = (input) => pipe(decodeUnknownOption(AskUserQuestionInput)(input), flatMap$5((data) => fromNullishOr$2(data.questions)), map$14((questions) => questions.map((q) => {
@@ -67415,7 +67477,7 @@ const failure = (cause, options) => {
67415
67477
  const result = Object.create(ResultProto);
67416
67478
  result._tag = "Failure";
67417
67479
  result.cause = cause;
67418
- result.previousSuccess = options?.previousSuccess ?? none$3();
67480
+ result.previousSuccess = options?.previousSuccess ?? none$4();
67419
67481
  result.waiting = options?.waiting ?? false;
67420
67482
  return result;
67421
67483
  };
@@ -67424,7 +67486,7 @@ const failure = (cause, options) => {
67424
67486
  * @category constructors
67425
67487
  */
67426
67488
  const failureWithPrevious = (cause, options) => failure(cause, {
67427
- previousSuccess: flatMap$5(options.previous, (result) => isSuccess(result) ? some$2(result) : isFailure(result) ? result.previousSuccess : none$3()),
67489
+ previousSuccess: flatMap$5(options.previous, (result) => isSuccess(result) ? some$2(result) : isFailure(result) ? result.previousSuccess : none$4()),
67428
67490
  waiting: options.waiting
67429
67491
  });
67430
67492
  /**
@@ -67469,7 +67531,7 @@ const replacePrevious = (self, previous) => {
67469
67531
  const value = (self) => {
67470
67532
  if (self._tag === "Success") return some$2(self.value);
67471
67533
  else if (self._tag === "Failure") return map$14(self.previousSuccess, (s) => s.value);
67472
- return none$3();
67534
+ return none$4();
67473
67535
  };
67474
67536
  /**
67475
67537
  * @since 4.0.0
@@ -67783,7 +67845,7 @@ var NodeImpl = class {
67783
67845
  return this._value;
67784
67846
  }
67785
67847
  valueOption() {
67786
- if ((this.state & NodeFlags.initialized) === 0) return none$3();
67848
+ if ((this.state & NodeFlags.initialized) === 0) return none$4();
67787
67849
  return some$2(this._value);
67788
67850
  }
67789
67851
  setValue(value) {
@@ -143667,7 +143729,7 @@ var TokenManager$1 = class extends Service$1()("lalph/Linear/TokenManager", { ma
143667
143729
  let currentToken = yield* orDie$2(tokenStore.get(""));
143668
143730
  const set = (token) => match$7(token, {
143669
143731
  onNone: () => orDie$2(tokenStore.remove("")).pipe(map$8(() => {
143670
- currentToken = none$3();
143732
+ currentToken = none$4();
143671
143733
  })),
143672
143734
  onSome: (token) => orDie$2(tokenStore.set("", token)).pipe(map$8(() => {
143673
143735
  currentToken = some$2(token);
@@ -143959,10 +144021,10 @@ const LinearIssueSource = effect$1(IssueSource, gen(function* () {
143959
144021
  return yield* issues(yield* get$7(projectSettings, projectId));
143960
144022
  }),
143961
144023
  createIssue: fnUntraced(function* (projectId, issue) {
143962
- const { teamId, labelId, autoMergeLabelId } = yield* get$7(projectSettings, projectId);
144024
+ const { teamId, labelId, autoMergeLabelId, project } = yield* get$7(projectSettings, projectId);
143963
144025
  const created = yield* linear.use((c) => c.createIssue({
143964
144026
  teamId,
143965
- projectId,
144027
+ projectId: project.id,
143966
144028
  assigneeId: linear.viewer.id,
143967
144029
  labelIds: [...toArray(labelId), ...issue.autoMerge ? toArray(autoMergeLabelId) : []],
143968
144030
  title: issue.title,
@@ -144027,10 +144089,10 @@ const LinearIssueSource = effect$1(IssueSource, gen(function* () {
144027
144089
  }, mapError$2((cause) => new IssueSourceError({ cause }))),
144028
144090
  reset: gen(function* () {
144029
144091
  const projectId = yield* CurrentProjectId;
144030
- yield* Settings.setProject(selectedProjectId, none$3());
144031
- yield* Settings.setProject(selectedTeamId, none$3());
144032
- yield* Settings.setProject(selectedLabelId, none$3());
144033
- yield* Settings.setProject(selectedAutoMergeLabelId, none$3());
144092
+ yield* Settings.setProject(selectedProjectId, none$4());
144093
+ yield* Settings.setProject(selectedTeamId, none$4());
144094
+ yield* Settings.setProject(selectedLabelId, none$4());
144095
+ yield* Settings.setProject(selectedAutoMergeLabelId, none$4());
144034
144096
  yield* invalidate$1(projectSettings, projectId);
144035
144097
  }),
144036
144098
  settings: (projectId) => asVoid(get$7(projectSettings, projectId)),
@@ -144106,7 +144168,7 @@ const labelIdSelect = gen(function* () {
144106
144168
  message: "Select a label to filter issues by",
144107
144169
  choices: [{
144108
144170
  title: "No Label",
144109
- value: none$3()
144171
+ value: none$4()
144110
144172
  }].concat(labels.map((label) => ({
144111
144173
  title: label.name,
144112
144174
  value: some$2(label.id)
@@ -144128,7 +144190,7 @@ const autoMergeLabelIdSelect = gen(function* () {
144128
144190
  message: "Select a label to mark issues for auto merge",
144129
144191
  choices: [{
144130
144192
  title: "Disabled",
144131
- value: none$3()
144193
+ value: none$4()
144132
144194
  }].concat(labels.map((label) => ({
144133
144195
  title: label.name,
144134
144196
  value: some$2(label.id)
@@ -150215,7 +150277,7 @@ var TokenManager = class extends Service$1()("lalph/Github/TokenManager", { make
150215
150277
  let currentToken = yield* orDie$2(tokenStore.get(""));
150216
150278
  const set = (token) => match$7(token, {
150217
150279
  onNone: () => orDie$2(tokenStore.remove("")).pipe(map$8(() => {
150218
- currentToken = none$3();
150280
+ currentToken = none$4();
150219
150281
  })),
150220
150282
  onSome: (t) => orDie$2(tokenStore.set("", t)).pipe(map$8(() => {
150221
150283
  currentToken = token;
@@ -150605,8 +150667,8 @@ const GithubIssueSource = effect$1(IssueSource, gen(function* () {
150605
150667
  }, mapError$2((cause) => new IssueSourceError({ cause }))),
150606
150668
  reset: gen(function* () {
150607
150669
  const projectId = yield* CurrentProjectId;
150608
- yield* Settings.setProject(labelFilter, none$3());
150609
- yield* Settings.setProject(autoMergeLabel, none$3());
150670
+ yield* Settings.setProject(labelFilter, none$4());
150671
+ yield* Settings.setProject(autoMergeLabel, none$4());
150610
150672
  yield* invalidate$1(projectSettings, projectId);
150611
150673
  }),
150612
150674
  settings: (projectId) => asVoid(get$7(projectSettings, projectId)),
@@ -150755,6 +150817,8 @@ var PromptGen = class extends Service$1()("lalph/PromptGen", { make: gen(functio
150755
150817
  const prdNotes = (options) => `## prd.yml file
150756
150818
 
150757
150819
  **Important:** Wait 5 seconds between edits to allow the system to update the prd.yml file.
150820
+ If adding more than 10 tasks, wait 10 seconds.
150821
+ You only need to wait if working with the prd.yml file directly, not any other files.
150758
150822
 
150759
150823
  Each item in the prd.yml file represents a task for the current project.
150760
150824
 
@@ -150789,9 +150853,10 @@ Instead of creating tasks like "Refactor the authentication system", create
150789
150853
  smaller tasks like "Implement OAuth2 login endpoint", "Add JWT token refresh mechanism", etc.${options?.specsDirectory ? `
150790
150854
 
150791
150855
  If you need to add a research task, mention in the description that it needs to:
150792
- - add a specification file in the \`${options.specsDirectory}\` directory.
150793
- - add follow up tasks in the prd.yml file based on the new specification. The tasks
150794
- should reference the specification file in their description.
150856
+ - add a specification file in the \`${options.specsDirectory}\` directory with
150857
+ an implementation plan based on the research findings.
150858
+ - once the specification file is added, turn the implementation plan into tasks
150859
+ in the prd.yml file.
150795
150860
  - make sure the follow up tasks include a dependency on the research task.` : ""}
150796
150861
 
150797
150862
  ### Removing tasks
@@ -150887,15 +150952,23 @@ ${options.task.description}
150887
150952
  githubPrNumber: options.githubPrNumber,
150888
150953
  targetBranch: options.targetBranch
150889
150954
  })}
150890
- 6. Update the prd.yml file to reflect any changes in task states.
150891
- - Update the prd.yml file **after** ${options.gitFlow.requiresGithubPr ? "pushing" : "committing"} your changes.
150955
+ 6. **After ${options.gitFlow.requiresGithubPr ? "pushing" : "committing"}**
150956
+ your changes, update the prd.yml to reflect any changes in the task state.
150892
150957
  - Rewrite the notes in the description to include only the key discoveries and information that could speed up future work on other tasks. Make sure to preserve important information such as specification file references.
150893
150958
  - If you believe the task is complete, update the \`state\` to "in-review".
150894
150959
 
150895
150960
  ${keyInformation(options)}`;
150896
- const promptReview = (options) => `A previous AI agent has completed a task from the instructions below.
150961
+ const promptReview = (options) => `A previous engineer has completed a task from the instructions below.
150897
150962
 
150898
- You job is to review their work, and make any necessary improvements or corrections if needed.
150963
+ You job is to meticulously review their work to ensure it meets the task requirements,
150964
+ follows best practices, and maintains high code quality. You should be extremely thorough
150965
+ in your review, looking for any potential issues or improvements.
150966
+
150967
+ Once you have completed your review, you should:
150968
+
150969
+ - Make any code changes needed to fix issues you find.
150970
+ - Add follow-up tasks to the prd.yml file for any work that could not be done,
150971
+ or for remaining issues that need addressing.
150899
150972
 
150900
150973
  ${options.gitFlow.reviewInstructions}
150901
150974
 
@@ -150929,14 +151002,18 @@ ${prdNotes(options)}`;
150929
151002
  - If the user asks you to update an existing specification, find the relevant
150930
151003
  specification file in the \`${options.specsDirectory}\` directory and update it
150931
151004
  accordingly.
150932
- 2. Once you have saved the specification, your next job is to create or update an
150933
- implementation plan by breaking down the specification into smaller, manageable tasks and add
150934
- them to the prd.yml file.
150935
- For each task include in the description where to find the plan specification.
150936
- Read the "### Adding tasks" section below **extremely carefully** for guidelines on creating tasks.
150937
- - **Important**: If updating an existing plan, make sure not to duplicate any existing tasks.
150938
- 3. Wait until the tasks are saved, then setup task dependencies using the \`blockedBy\` field.
150939
- 4. Start a subagent with a copy of this prompt, to review the plan and provide feedback or improvements.
151005
+ 2. Add a detailed implementation plan to the specification, breaking down the work into
151006
+ smaller, manageable tasks.
151007
+ 3. Start two subagents with a copy of this prompt.
151008
+ - The first subagent will review the plan and provide feedback or improvements.
151009
+ - The second subagent will look over the implementation plan, and ensure each task is
151010
+ small, atomic and independently shippable without failing validation checks (typechecks, linting, tests).
151011
+ 4. Write the specification details to a \`.lalph/plan.json\` file using the following format:
151012
+ \`\`\`json
151013
+ {
151014
+ "specification": "path/to/specification/file.md"
151015
+ }
151016
+ \`\`\`
150940
151017
  5. Present the saved specification for review (include the full text in your response).
150941
151018
  If any corrections are needed, update the specification and adjust the plan tasks accordingly.
150942
151019
 
@@ -150948,7 +151025,22 @@ ${prdNotes(options)}`;
150948
151025
  project name.
150949
151026
  - When adding a new specification, add a link to it in the README.md file in the
150950
151027
  \`${options.specsDirectory}\` directory, along with a brief overview of the specification.
150951
- If the README.md file does not exist, create it.
151028
+ If the README.md file does not exist, create it.`;
151029
+ const promptPlanTasks = (options) => `Your job is to convert the implementation plan in the specification file at
151030
+ \`${options.specificationPath}\` into tasks in the prd.yml file. Read the "### Adding tasks"
151031
+ section below extremely carefully for guidelines on creating tasks.
151032
+
151033
+ Before starting, read the entire prd.yml file to understand the context of existing tasks
151034
+ and to ensure you do not create duplicate tasks.
151035
+
151036
+ Make sure each task is small, atomic and independently shippable without failing
151037
+ validation checks (typechecks, linting, tests).
151038
+ Each task should include a reference to the specification file in its description.
151039
+
151040
+ Once you have added all the tasks from the implementation plan into the prd.yml file,
151041
+ setup dependencies between the tasks using the \`blockedBy\` field.
151042
+
151043
+ **Important:** You are only creating or updating a plan, not implementing any tasks yet.
150952
151044
 
150953
151045
  ${prdNotes(options)}`;
150954
151046
  return {
@@ -150957,7 +151049,8 @@ ${prdNotes(options)}`;
150957
151049
  promptReview,
150958
151050
  promptReviewCustom,
150959
151051
  promptTimeout,
150960
- planPrompt
151052
+ planPrompt,
151053
+ promptPlanTasks
150961
151054
  };
150962
151055
  }) }) {
150963
151056
  static layer = effect$1(this, this.make).pipe(provide$3(CurrentIssueSource.layer));
@@ -151116,6 +151209,14 @@ const makeExecHelpers = fnUntraced(function* (options) {
151116
151209
  })(template, ...args).pipe(exitCode, provide);
151117
151210
  const execString = (template, ...args) => make$23({ cwd: options.directory })(template, ...args).pipe(string, provide);
151118
151211
  const viewPrState = (prNumber) => execString`gh pr view ${prNumber ? prNumber : ""} --json number,state`.pipe(flatMap$2(decodeEffect(PrState)), option$1, provide);
151212
+ const execWithOutput = (options) => fnUntraced(function* (command) {
151213
+ const handle = yield* provide(command.asEffect());
151214
+ yield* handle.all.pipe(decodeText(), options.cliAgent.outputTransformer ? options.cliAgent.outputTransformer : identity, runForEachArray((output) => {
151215
+ for (const chunk of output) process.stdout.write(chunk);
151216
+ return void_$1;
151217
+ }));
151218
+ return yield* handle.exitCode;
151219
+ }, scoped$1);
151119
151220
  const execWithWorkerOutput = (options) => fnUntraced(function* (command) {
151120
151221
  const registry = yield* AtomRegistry;
151121
151222
  const worker = yield* CurrentWorkerState;
@@ -151152,6 +151253,7 @@ const makeExecHelpers = fnUntraced(function* (options) {
151152
151253
  exec,
151153
151254
  execString,
151154
151255
  viewPrState,
151256
+ execWithOutput,
151155
151257
  execWithStallTimeout,
151156
151258
  execWithWorkerOutput,
151157
151259
  currentBranch
@@ -151243,15 +151345,15 @@ var Prd = class extends Service$1()("lalph/Prd", { make: gen(function* () {
151243
151345
  const updated = yield* readPrd;
151244
151346
  if (!(updated.length !== current.length || updated.some((u, i) => u.isChangedComparedTo(current[i])))) return;
151245
151347
  const toRemove = new Set(current.filter((i) => i.id !== null).map((i) => i.id));
151246
- for (const issue of updated) {
151348
+ yield* forEach$3(updated, fnUntraced(function* (issue) {
151247
151349
  toRemove.delete(issue.id);
151248
151350
  if (issue.id === null) {
151249
151351
  yield* source.createIssue(projectId, shouldAddAutoMerge ? issue.withAutoMerge(true) : issue);
151250
- continue;
151352
+ return;
151251
151353
  }
151252
151354
  const existing = current.find((i) => i.id === issue.id);
151253
- if (!existing || !existing.isChangedComparedTo(issue)) continue;
151254
- if (chosenIssueId && existing.id !== chosenIssueId) continue;
151355
+ if (!existing || !existing.isChangedComparedTo(issue)) return;
151356
+ if (chosenIssueId && existing.id !== chosenIssueId) return;
151255
151357
  yield* source.updateIssue({
151256
151358
  projectId,
151257
151359
  issueId: issue.id,
@@ -151262,7 +151364,10 @@ var Prd = class extends Service$1()("lalph/Prd", { make: gen(function* () {
151262
151364
  autoMerge: issue.autoMerge
151263
151365
  });
151264
151366
  updatedIssues.set(issue.id, issue);
151265
- }
151367
+ }), {
151368
+ concurrency: "unbounded",
151369
+ discard: true
151370
+ });
151266
151371
  yield* forEach$3(toRemove, (issueId) => source.cancelIssue(projectId, issueId), { concurrency: "unbounded" });
151267
151372
  }).pipe(reactivity.withBatch, uninterruptible, syncSemaphore.withPermit, withSpan("Prd.sync"), catchTag("IssueSourceError", (e) => logWarning(fail$5(e))), annotateLogs({
151268
151373
  module: "Prd",
@@ -151875,6 +151980,65 @@ const commandRoot = make$35("lalph", {
151875
151980
  layer$17
151876
151981
  ]))));
151877
151982
 
151983
+ //#endregion
151984
+ //#region src/Agents/planner.ts
151985
+ const agentPlanner = fnUntraced(function* (options) {
151986
+ const pathService = yield* Path$1;
151987
+ const worktree = yield* Worktree;
151988
+ const promptGen = yield* PromptGen;
151989
+ yield* pipe(options.cliAgent.commandPlan({
151990
+ prompt: promptGen.planPrompt(options),
151991
+ prdFilePath: pathService.join(".lalph", "prd.yml"),
151992
+ dangerous: options.dangerous
151993
+ }), setCwd(worktree.directory), options.commandPrefix, exitCode);
151994
+ });
151995
+
151996
+ //#endregion
151997
+ //#region src/Agents/tasker.ts
151998
+ const agentTasker = fnUntraced(function* (options) {
151999
+ const pathService = yield* Path$1;
152000
+ const worktree = yield* Worktree;
152001
+ const promptGen = yield* PromptGen;
152002
+ return yield* pipe(options.cliAgent.command({
152003
+ prompt: promptGen.promptPlanTasks({
152004
+ specsDirectory: options.specsDirectory,
152005
+ specificationPath: options.specificationPath
152006
+ }),
152007
+ prdFilePath: pathService.join(".lalph", "prd.yml")
152008
+ }), setCwd(worktree.directory), options.commandPrefix, worktree.execWithOutput(options));
152009
+ });
152010
+
152011
+ //#endregion
152012
+ //#region src/commands/plan/tasks.ts
152013
+ const specificationPath = path("spec", {
152014
+ pathType: "file",
152015
+ mustExist: true
152016
+ }).pipe(withDescription$2("Path to the specification file to convert into tasks"));
152017
+ const commandPlanTasks = make$35("tasks", { specificationPath }).pipe(withDescription("Convert a specification into tasks"), withHandler(fnUntraced(function* ({ specificationPath }) {
152018
+ const { specsDirectory } = yield* commandRoot;
152019
+ const fs = yield* FileSystem;
152020
+ const pathService = yield* Path$1;
152021
+ const worktree = yield* Worktree;
152022
+ const cliAgent = yield* getOrSelectCliAgent;
152023
+ const commandPrefix = yield* getCommandPrefix;
152024
+ const content = yield* fs.readFileString(specificationPath);
152025
+ const relative = pathService.relative(pathService.resolve("."), specificationPath);
152026
+ const worktreeSpecPath = pathService.join(worktree.directory, relative);
152027
+ yield* fs.makeDirectory(pathService.dirname(worktreeSpecPath), { recursive: true });
152028
+ yield* fs.writeFileString(worktreeSpecPath, content);
152029
+ yield* agentTasker({
152030
+ specsDirectory,
152031
+ specificationPath: relative,
152032
+ commandPrefix,
152033
+ cliAgent
152034
+ });
152035
+ }, provide$1([
152036
+ Settings.layer,
152037
+ PromptGen.layer,
152038
+ Prd.layerProvided.pipe(provide$3(layerProjectIdPrompt)),
152039
+ Worktree.layer
152040
+ ]))));
152041
+
151878
152042
  //#endregion
151879
152043
  //#region src/commands/plan.ts
151880
152044
  const dangerous = boolean("dangerous").pipe(withAlias("d"), withDescription$1("Enable dangerous mode (skip permission prompts) during plan generation"));
@@ -151892,24 +152056,30 @@ const commandPlan = make$35("plan", {
151892
152056
  commandPrefix,
151893
152057
  dangerous
151894
152058
  }).pipe(provideService(CurrentProjectId, project.id));
151895
- }, provide$1([Settings.layer, CurrentIssueSource.layer]))));
152059
+ }, provide$1([Settings.layer, CurrentIssueSource.layer]))), withSubcommands([commandPlanTasks]));
151896
152060
  const plan = fnUntraced(function* (options) {
151897
152061
  const fs = yield* FileSystem;
151898
152062
  const pathService = yield* Path$1;
151899
152063
  const worktree = yield* Worktree;
151900
- const promptGen = yield* PromptGen;
151901
152064
  const cliAgent = yield* getOrSelectCliAgent;
151902
152065
  const exec = (template, ...args) => exitCode(make$23({
151903
152066
  cwd: worktree.directory,
151904
152067
  extendEnv: true
151905
152068
  })(template, ...args));
151906
152069
  if (isSome(options.targetBranch)) yield* exec`git checkout ${options.targetBranch.value.includes("/") ? options.targetBranch.value : `origin/${options.targetBranch.value}`}`;
151907
- const exitCode$1 = yield* pipe(cliAgent.commandPlan({
151908
- prompt: promptGen.planPrompt(options),
151909
- prdFilePath: pathService.join(worktree.directory, ".lalph", "prd.yml"),
151910
- dangerous: options.dangerous
151911
- }), setCwd(worktree.directory), options.commandPrefix, exitCode);
151912
- yield* log$1(`Agent exited with code: ${exitCode$1}`);
152070
+ yield* agentPlanner({
152071
+ specsDirectory: options.specsDirectory,
152072
+ commandPrefix: options.commandPrefix,
152073
+ dangerous: options.dangerous,
152074
+ cliAgent
152075
+ });
152076
+ yield* log$1("Converting specification into tasks");
152077
+ yield* agentTasker({
152078
+ specificationPath: (yield* pipe(fs.readFileString(pathService.join(worktree.directory, ".lalph", "plan.json")), flatMap$2(decodeEffect(PlanDetails)))).specification,
152079
+ specsDirectory: options.specsDirectory,
152080
+ commandPrefix: options.commandPrefix,
152081
+ cliAgent
152082
+ });
151913
152083
  if (!worktree.inExisting) yield* pipe(fs.copy(pathService.join(worktree.directory, options.specsDirectory), options.specsDirectory, { overwrite: true }), ignore);
151914
152084
  }, scoped$1, provide$1([
151915
152085
  PromptGen.layer,
@@ -151918,10 +152088,11 @@ const plan = fnUntraced(function* (options) {
151918
152088
  Settings.layer,
151919
152089
  CurrentIssueSource.layer
151920
152090
  ]));
152091
+ const PlanDetails = fromJsonString(Struct({ specification: String$1 }));
151921
152092
 
151922
152093
  //#endregion
151923
152094
  //#region src/shared/config.ts
151924
- const configEditor = string$1("LALPH_EDITOR").pipe(orElse(() => string$1("EDITOR")), map$5(parseCommand), withDefault$2(() => ["nano"]));
152095
+ const configEditor = string$1("LALPH_EDITOR").pipe(orElse(() => string$1("EDITOR")), map$5(parseCommand), withDefault$3(() => ["nano"]));
151925
152096
 
151926
152097
  //#endregion
151927
152098
  //#region src/commands/issue.ts
@@ -152003,7 +152174,7 @@ const commandSource = make$35("source").pipe(withDescription("Select the issue s
152003
152174
 
152004
152175
  //#endregion
152005
152176
  //#region package.json
152006
- var version = "0.2.5";
152177
+ var version = "0.2.7";
152007
152178
 
152008
152179
  //#endregion
152009
152180
  //#region src/commands/projects/ls.ts