@zebeqo/vendy 0.6.2 → 0.6.3

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/main.mjs +569 -83
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -3863,7 +3863,7 @@ const ServiceProto = {
3863
3863
  .../*#__PURE__*/ Prototype({
3864
3864
  label: "Service",
3865
3865
  evaluate(fiber) {
3866
- return exitSucceed(get$4(fiber.context, this));
3866
+ return exitSucceed(get$5(fiber.context, this));
3867
3867
  }
3868
3868
  }),
3869
3869
  toJSON() {
@@ -3879,10 +3879,10 @@ const ServiceProto = {
3879
3879
  return make$34(this, self);
3880
3880
  },
3881
3881
  use(f) {
3882
- return withFiber$1((fiber) => f(get$4(fiber.context, this)));
3882
+ return withFiber$1((fiber) => f(get$5(fiber.context, this)));
3883
3883
  },
3884
3884
  useSync(f) {
3885
- return withFiber$1((fiber) => exitSucceed(f(get$4(fiber.context, this))));
3885
+ return withFiber$1((fiber) => exitSucceed(f(get$5(fiber.context, this))));
3886
3886
  }
3887
3887
  };
3888
3888
  const cacheKeys = /*#__PURE__*/ new Set();
@@ -4261,7 +4261,7 @@ const getUnsafe = /*#__PURE__*/ dual(2, (self, service) => {
4261
4261
  * @category getters
4262
4262
  * @since 2.0.0
4263
4263
  */
4264
- const get$4 = getUnsafe;
4264
+ const get$5 = getUnsafe;
4265
4265
  const defaultValueCacheKey = "~effect/Context/defaultValue";
4266
4266
  const getDefaultValue = (ref) => {
4267
4267
  if (defaultValueCacheKey in ref) return ref[defaultValueCacheKey];
@@ -6317,6 +6317,66 @@ const Error$2 = Error$3;
6317
6317
  * @since 2.0.0
6318
6318
  */
6319
6319
  const TaggedError$1 = TaggedError$2;
6320
+ // ../../node_modules/.pnpm/effect@4.1.0/node_modules/effect/dist/encoding/EncodingError.js
6321
+ /**
6322
+ * Shared error type for encoding and decoding operations.
6323
+ *
6324
+ * @stability stable
6325
+ * @since 4.0.0
6326
+ */
6327
+ /**
6328
+ * Type identifier stored on `EncodingError` values and used by
6329
+ * `isEncodingError`.
6330
+ *
6331
+ * **When to use**
6332
+ *
6333
+ * Use when implementing low-level `EncodingError`-compatible values that need
6334
+ * to carry the runtime marker.
6335
+ *
6336
+ * **Details**
6337
+ *
6338
+ * This marker is part of the runtime representation of `EncodingError`. Prefer
6339
+ * `isEncodingError` when narrowing unknown values.
6340
+ *
6341
+ * @see {@link isEncodingError} for the public guard that checks this marker
6342
+ *
6343
+ * @stability stable
6344
+ * @category type IDs
6345
+ * @since 4.0.0
6346
+ */
6347
+ const EncodingErrorTypeId = "~effect/encoding/EncodingError";
6348
+ /**
6349
+ * Error returned when an encoding or decoding operation cannot process its input.
6350
+ *
6351
+ * **When to use**
6352
+ *
6353
+ * Use when you need to handle or inspect failures from encoding or decoding
6354
+ * operations.
6355
+ *
6356
+ * **Details**
6357
+ *
6358
+ * The error records whether the failure happened during encoding or decoding,
6359
+ * which encoding module reported it, the original input, and a human-readable
6360
+ * message.
6361
+ *
6362
+ * @see {@link isEncodingError} for checking whether a value is an EncodingError
6363
+ *
6364
+ * @stability stable
6365
+ * @category errors
6366
+ * @since 4.0.0
6367
+ */
6368
+ var EncodingError = class extends (/*#__PURE__*/ TaggedError$1("EncodingError")) {
6369
+ /**
6370
+ * Marks this value as an encoding or decoding error for runtime guards.
6371
+ *
6372
+ * **When to use**
6373
+ *
6374
+ * Use to identify `EncodingError` instances through `isEncodingError`.
6375
+ *
6376
+ * @since 4.0.0
6377
+ */
6378
+ [EncodingErrorTypeId] = EncodingErrorTypeId;
6379
+ };
6320
6380
  /**
6321
6381
  * Generates a random lowercase hexadecimal string, optimized for lengths that
6322
6382
  * are multiples of 8.
@@ -6955,7 +7015,7 @@ var FiberImpl = class {
6955
7015
  return this._dispatcher ??= this.cache.scheduler.makeDispatcher();
6956
7016
  }
6957
7017
  getRef(ref) {
6958
- return get$4(this.context, ref);
7018
+ return get$5(this.context, ref);
6959
7019
  }
6960
7020
  addObserver(cb) {
6961
7021
  if (this._exit) {
@@ -7117,17 +7177,17 @@ var FiberImpl = class {
7117
7177
  const makeFiberContextCache = (context) => {
7118
7178
  const currentTracer = getOrUndefinedUnsafe(context, TracerKey);
7119
7179
  return {
7120
- scheduler: get$4(context, Scheduler),
7180
+ scheduler: get$5(context, Scheduler),
7121
7181
  tracer: currentTracer,
7122
7182
  tracerContext: currentTracer ? currentTracer["context"] : void 0,
7123
- tracerEnabled: get$4(context, TracerEnabled),
7183
+ tracerEnabled: get$5(context, TracerEnabled),
7124
7184
  span: getOrUndefinedUnsafe(context, ParentSpanKey),
7125
- logLevel: get$4(context, CurrentLogLevel),
7126
- minimumLogLevel: get$4(context, MinimumLogLevel$1),
7127
- stackFrame: get$4(context, CurrentStackFrame),
7185
+ logLevel: get$5(context, CurrentLogLevel),
7186
+ minimumLogLevel: get$5(context, MinimumLogLevel$1),
7187
+ stackFrame: get$5(context, CurrentStackFrame),
7128
7188
  runtimeMetrics: getOrUndefinedUnsafe(context, FiberRuntimeMetricsKey),
7129
- maxOpsBeforeYield: get$4(context, MaxOpsBeforeYield),
7130
- preventYield: get$4(context, PreventSchedulerYield)
7189
+ maxOpsBeforeYield: get$5(context, MaxOpsBeforeYield),
7190
+ preventYield: get$5(context, PreventSchedulerYield)
7131
7191
  };
7132
7192
  };
7133
7193
  const deferredInterruptCont = {
@@ -8519,11 +8579,11 @@ const NoopSpanProto = {
8519
8579
  const noopSpan = (options) => Object.assign(Object.create(NoopSpanProto), options);
8520
8580
  const filterDisablePropagation = (span) => {
8521
8581
  if (!span) return none();
8522
- return get$4(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some(span);
8582
+ return get$5(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some(span);
8523
8583
  };
8524
8584
  /** @internal */
8525
8585
  const makeSpanUnsafe = (fiber, name, options) => {
8526
- const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$4(options.annotations, DisablePropagation);
8586
+ const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$5(options.annotations, DisablePropagation);
8527
8587
  const parent = options?.parent !== void 0 ? some(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.cache.span);
8528
8588
  let span;
8529
8589
  if (disablePropagation) span = noopSpan({
@@ -18846,7 +18906,7 @@ var RcRefImpl = class {
18846
18906
  /** @internal */
18847
18907
  const make$25 = (options) => withFiber((fiber) => {
18848
18908
  const context = fiber.context;
18849
- const scope = get$4(context, Scope$1);
18909
+ const scope = get$5(context, Scope$1);
18850
18910
  const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
18851
18911
  return as(addFinalizerExit(scope, () => {
18852
18912
  const state = ref.state;
@@ -18909,7 +18969,7 @@ const awaitAcquiring = (self, acquiring, restore) => onExit$1(restore(join$1(acq
18909
18969
  return interrupt(acquiring.fiber);
18910
18970
  });
18911
18971
  /** @internal */
18912
- const get$3 = (self_) => {
18972
+ const get$4 = (self_) => {
18913
18973
  const self = self_;
18914
18974
  return uninterruptibleMask((restore) => flatMap$1(scope, (scope) => flatMap$1(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release$1(self, state)), state.value))));
18915
18975
  };
@@ -19029,7 +19089,7 @@ const make$24 = make$25;
19029
19089
  * @category combinators
19030
19090
  * @since 3.5.0
19031
19091
  */
19032
- const get$2 = get$3;
19092
+ const get$3 = get$4;
19033
19093
  // ../../node_modules/.pnpm/effect@4.1.0/node_modules/effect/dist/Stream.js
19034
19094
  /**
19035
19095
  * Describes effectful sources that emit values over time.
@@ -20988,10 +21048,201 @@ function getSchemaIssueOrThrow(cause, message) {
20988
21048
  if (issue === void 0) throw new Error(message, { cause });
20989
21049
  return issue;
20990
21050
  }
21051
+ // ../../node_modules/.pnpm/effect@4.1.0/node_modules/effect/dist/encoding/Base64.js
21052
+ /**
21053
+ * Base64 encoding and decoding helpers.
21054
+ *
21055
+ * @stability stable
21056
+ * @since 4.0.0
21057
+ */
21058
+ /**
21059
+ * Encodes the given value into a Base64 (RFC 4648) string.
21060
+ *
21061
+ * **When to use**
21062
+ *
21063
+ * Use to encode text or bytes as a standard padded Base64 string for storage or
21064
+ * transport.
21065
+ *
21066
+ * **Details**
21067
+ *
21068
+ * String inputs are encoded as UTF-8 bytes before Base64 encoding.
21069
+ * `Uint8Array` inputs are encoded directly. The output uses the standard
21070
+ * RFC 4648 alphabet with `=` padding.
21071
+ *
21072
+ * **Example** (Encoding Base64 strings and bytes)
21073
+ *
21074
+ * ```ts import.meta.vitest
21075
+ * import { Base64 } from "effect/encoding"
21076
+ *
21077
+ * Base64.encode("hello") // => "aGVsbG8="
21078
+ *
21079
+ * const bytes = new Uint8Array([72, 101, 108, 108, 111])
21080
+ * Base64.encode(bytes) // => "SGVsbG8="
21081
+ * ```
21082
+ *
21083
+ * @see {@link decode} for decoding standard Base64 to bytes
21084
+ * @see {@link decodeString} for decoding standard Base64 to UTF-8 text
21085
+ *
21086
+ * @stability stable
21087
+ * @category encoding
21088
+ * @since 4.0.0
21089
+ */
21090
+ const encode = (input) => encodeBytes(typeof input === "string" ? encoder$1.encode(input) : input);
21091
+ /**
21092
+ * Decodes a Base64 (RFC 4648) string into bytes safely.
21093
+ *
21094
+ * **When to use**
21095
+ *
21096
+ * Use to decode a standard padded Base64 string into bytes without throwing on
21097
+ * invalid input.
21098
+ *
21099
+ * **Details**
21100
+ *
21101
+ * Returns `Result.succeed` with a `Uint8Array` when decoding succeeds, or
21102
+ * `Result.fail` with an `EncodingError` when the input is not valid Base64.
21103
+ *
21104
+ * **Example** (Decoding Base64 bytes)
21105
+ *
21106
+ * ```ts import.meta.vitest
21107
+ * import { Result } from "effect"
21108
+ * import { Base64 } from "effect/encoding"
21109
+ *
21110
+ * Base64.decode("SGVsbG8=") // => Result.succeed(new Uint8Array([72, 101, 108, 108, 111]))
21111
+ * ```
21112
+ *
21113
+ * @stability stable
21114
+ * @category decoding
21115
+ * @since 4.0.0
21116
+ */
21117
+ const decode$1 = (str) => {
21118
+ const stripped = stripCrlf(str);
21119
+ const length = stripped.length;
21120
+ if (length % 4 !== 0) return fail$8(new EncodingError({
21121
+ kind: "Decode",
21122
+ module: "Base64",
21123
+ input: stripped,
21124
+ message: `Length must be a multiple of 4, but is ${length}`
21125
+ }));
21126
+ const index = stripped.indexOf("=");
21127
+ if (index !== -1 && (index < length - 2 || index === length - 2 && stripped[length - 1] !== "=")) return fail$8(new EncodingError({
21128
+ kind: "Decode",
21129
+ module: "Base64",
21130
+ input: stripped,
21131
+ message: "Found a '=' character, but it is not at the end"
21132
+ }));
21133
+ try {
21134
+ const missingOctets = stripped.endsWith("==") ? 2 : stripped.endsWith("=") ? 1 : 0;
21135
+ const result = new Uint8Array(3 * (length / 4) - missingOctets);
21136
+ for (let i = 0, j = 0; i < length; i += 4, j += 3) {
21137
+ const buffer = getCode(stripped.charCodeAt(i)) << 18 | getCode(stripped.charCodeAt(i + 1)) << 12 | getCode(stripped.charCodeAt(i + 2)) << 6 | getCode(stripped.charCodeAt(i + 3));
21138
+ result[j] = buffer >> 16;
21139
+ result[j + 1] = buffer >> 8 & 255;
21140
+ result[j + 2] = buffer & 255;
21141
+ }
21142
+ return succeed$7(result);
21143
+ } catch (cause) {
21144
+ return fail$8(new EncodingError({
21145
+ kind: "Decode",
21146
+ module: "Base64",
21147
+ input: stripped,
21148
+ message: cause instanceof Error ? cause.message : "Invalid input"
21149
+ }));
21150
+ }
21151
+ };
21152
+ /**
21153
+ * Decodes a Base64 (RFC 4648) string into UTF-8 text safely.
21154
+ *
21155
+ * **When to use**
21156
+ *
21157
+ * Use to decode a standard padded Base64 string into UTF-8 text without
21158
+ * throwing on invalid input.
21159
+ *
21160
+ * **Details**
21161
+ *
21162
+ * Returns `Result.succeed` with the decoded text when decoding succeeds, or
21163
+ * `Result.fail` with an `EncodingError` when the input is not valid Base64.
21164
+ *
21165
+ * **Example** (Decoding Base64 strings)
21166
+ *
21167
+ * ```ts import.meta.vitest
21168
+ * import { Result } from "effect"
21169
+ * import { Base64 } from "effect/encoding"
21170
+ *
21171
+ * Base64.decodeString("aGVsbG8=") // => Result.succeed("hello")
21172
+ * ```
21173
+ *
21174
+ * @stability stable
21175
+ * @category decoding
21176
+ * @since 4.0.0
21177
+ */
21178
+ const decodeString = (str) => map$10(decode$1(str), (_) => decoder.decode(_));
21179
+ const encodeBytes = (bytes) => {
21180
+ const length = bytes.length;
21181
+ const toBase64 = Uint8Array.prototype.toBase64;
21182
+ if (length >= 32 && typeof toBase64 === "function") return toBase64.call(bytes);
21183
+ return length < 128 ? encodeShort(bytes) : encodeLong(bytes);
21184
+ };
21185
+ const encodeShort = (bytes) => {
21186
+ const length = bytes.length;
21187
+ let result = "";
21188
+ let i = 2;
21189
+ for (; i < length; i += 3) {
21190
+ result += alphabet[bytes[i - 2] >> 2];
21191
+ result += alphabet[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
21192
+ result += alphabet[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
21193
+ result += alphabet[bytes[i] & 63];
21194
+ }
21195
+ if (i === length + 1) {
21196
+ result += alphabet[bytes[i - 2] >> 2];
21197
+ result += alphabet[(bytes[i - 2] & 3) << 4];
21198
+ result += "==";
21199
+ }
21200
+ if (i === length) {
21201
+ result += alphabet[bytes[i - 2] >> 2];
21202
+ result += alphabet[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
21203
+ result += alphabet[(bytes[i - 1] & 15) << 2];
21204
+ result += "=";
21205
+ }
21206
+ return result;
21207
+ };
21208
+ const encodeLong = (bytes) => {
21209
+ const length = bytes.length;
21210
+ const result = new Uint8Array(Math.ceil(length / 3) * 4);
21211
+ let i;
21212
+ let j = 0;
21213
+ for (i = 2; i < length; i += 3, j += 4) {
21214
+ result[j] = alphabetCodes[bytes[i - 2] >> 2];
21215
+ result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
21216
+ result[j + 2] = alphabetCodes[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
21217
+ result[j + 3] = alphabetCodes[bytes[i] & 63];
21218
+ }
21219
+ if (i === length + 1) {
21220
+ result[j] = alphabetCodes[bytes[i - 2] >> 2];
21221
+ result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4];
21222
+ result[j + 2] = paddingCode;
21223
+ result[j + 3] = paddingCode;
21224
+ }
21225
+ if (i === length) {
21226
+ result[j] = alphabetCodes[bytes[i - 2] >> 2];
21227
+ result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
21228
+ result[j + 2] = alphabetCodes[(bytes[i - 1] & 15) << 2];
21229
+ result[j + 3] = paddingCode;
21230
+ }
21231
+ return decoder.decode(result);
21232
+ };
21233
+ const encoder$1 = /*#__PURE__*/ new TextEncoder();
21234
+ const decoder = /*#__PURE__*/ new TextDecoder();
21235
+ const stripCrlf = (str) => str.replace(/[\n\r]/g, "");
20991
21236
  const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
21237
+ const alphabetCodes = /*#__PURE__*/ encoder$1.encode(alphabet);
21238
+ const paddingCode = /*#__PURE__*/ "=".charCodeAt(0);
20992
21239
  const codes = /*#__PURE__*/ (/* @__PURE__ */ new Uint8Array(123)).fill(255);
20993
21240
  for (let i = 0; i < 64; i++) codes[/*#__PURE__*/ alphabet.charCodeAt(i)] = i;
20994
21241
  codes[/*#__PURE__*/ "=".charCodeAt(0)] = 0;
21242
+ const getCode = (charCode) => {
21243
+ if (charCode >= codes.length || codes[charCode] === 255) throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
21244
+ return codes[charCode];
21245
+ };
20995
21246
  // ../../node_modules/.pnpm/effect@4.1.0/node_modules/effect/dist/SchemaGetter.js
20996
21247
  const makeGetter = (fields) => Object.assign(Object.create(Prototype$1), fields);
20997
21248
  const passthrough_$1 = /*#__PURE__*/ makeGetter({ _tag: "Passthrough" });
@@ -21194,6 +21445,64 @@ function stringifyJson(options) {
21194
21445
  catch: () => new InvalidValue$1({ expected: "a JSON-serializable value" }, input, parseOptions)
21195
21446
  }));
21196
21447
  }
21448
+ /**
21449
+ * Encodes a `Uint8Array` or string to a Base64 string.
21450
+ *
21451
+ * **Details**
21452
+ *
21453
+ * The getter is pure and never fails.
21454
+ *
21455
+ * **Example** (Encoding to Base64)
21456
+ *
21457
+ * ```ts import.meta.vitest
21458
+ * import { Effect, Option, SchemaGetter } from "effect"
21459
+ *
21460
+ * const encode = SchemaGetter.encodeBase64<Uint8Array>()
21461
+ * const result = Effect.runSync(SchemaGetter.run(encode, Option.some(new Uint8Array([1, 2, 3])), {}))
21462
+ * result // => Option.some("AQID")
21463
+ * ```
21464
+ *
21465
+ * @see {@link decodeBase64} for the inverse operation to `Uint8Array`
21466
+ * @see {@link decodeBase64String} for the inverse operation to `string`
21467
+ * @see {@link encodeBase64Url} for the URL-safe variant
21468
+ *
21469
+ * @stability stable
21470
+ * @category encoding
21471
+ * @since 4.0.0
21472
+ */
21473
+ function encodeBase64() {
21474
+ return transform$2(encode);
21475
+ }
21476
+ /**
21477
+ * Decodes a Base64 string to a UTF-8 `string`.
21478
+ *
21479
+ * **Details**
21480
+ *
21481
+ * - Fails with `SchemaIssue.InvalidValue` if the input is not valid Base64.
21482
+ *
21483
+ * **Example** (Decoding Base64 to string)
21484
+ *
21485
+ * ```ts import.meta.vitest
21486
+ * import { Effect, Option, SchemaGetter } from "effect"
21487
+ *
21488
+ * const decode = SchemaGetter.decodeBase64String<string>()
21489
+ * const result = await Effect.runPromise(SchemaGetter.run(decode, Option.some("aGVsbG8="), {}))
21490
+ * result // => Option.some("hello")
21491
+ * ```
21492
+ *
21493
+ * @see {@link decodeBase64} to decode to `Uint8Array` instead
21494
+ * @see {@link encodeBase64} for the inverse operation
21495
+ *
21496
+ * @stability stable
21497
+ * @category decoding
21498
+ * @since 4.0.0
21499
+ */
21500
+ function decodeBase64String() {
21501
+ return transformEffect$1((input, options) => match$3(decodeString(input), {
21502
+ onFailure: () => fail$3(new InvalidValue$1({ expected: "a valid Base64 string" }, input, options)),
21503
+ onSuccess: succeed$3
21504
+ }));
21505
+ }
21197
21506
  // ../../node_modules/.pnpm/effect@4.1.0/node_modules/effect/dist/BigDecimal.js
21198
21507
  /**
21199
21508
  * Decimal numbers and arithmetic for cases where JavaScript `number` rounding
@@ -21725,6 +22034,39 @@ const defectFromJson = (options) => transform$1({
21725
22034
  encode: makeEncodeDefect(options)
21726
22035
  });
21727
22036
  /**
22037
+ * Decodes a Base64-encoded `string` into a UTF-8 `string` and encodes a
22038
+ * UTF-8 `string` back to a Base64 string.
22039
+ *
22040
+ * **When to use**
22041
+ *
22042
+ * Use when you need a schema transformation for text data transmitted as Base64
22043
+ * strings.
22044
+ *
22045
+ * **Details**
22046
+ *
22047
+ * Decoding parses the Base64 string into a UTF-8 string. Encoding writes the
22048
+ * string as a Base64 string.
22049
+ *
22050
+ * **Example** (Converting Base64 to a string)
22051
+ *
22052
+ * ```ts import.meta.vitest
22053
+ * import { Schema, SchemaTransformation } from "effect"
22054
+ *
22055
+ * const schema = Schema.String.pipe(
22056
+ * Schema.decodeTo(Schema.String, SchemaTransformation.stringFromBase64String)
22057
+ * )
22058
+ * Schema.decodeSync(schema)("aGVsbG8=") // => "hello"
22059
+ * ```
22060
+ *
22061
+ * @see {@link uint8ArrayFromBase64String}
22062
+ * @see `Schema.StringFromBase64` - a ready-made schema wrapping this transformation.
22063
+ *
22064
+ * @stability stable
22065
+ * @category encoding
22066
+ * @since 4.0.0
22067
+ */
22068
+ const stringFromBase64String = /*#__PURE__*/ new Transformation(/*#__PURE__*/ decodeBase64String(), /*#__PURE__*/ encodeBase64());
22069
+ /**
21728
22070
  * Decodes a JSON string with `JSON.parse` and encodes a value with
21729
22071
  * `JSON.stringify`.
21730
22072
  *
@@ -25394,7 +25736,7 @@ const TypeId$16 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
25394
25736
  const Proto$9 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
25395
25737
  [TypeId$16]: { value: TypeId$16 },
25396
25738
  [symbolRedactable]: { value(context) {
25397
- return redact$1(this, get$4(context, CurrentRedactedNames$1));
25739
+ return redact$1(this, get$5(context, CurrentRedactedNames$1));
25398
25740
  } },
25399
25741
  toJSON: { value() {
25400
25742
  return redact$2(this);
@@ -25979,7 +26321,7 @@ const Proto$8 = {
25979
26321
  [symbolRedactable](context) {
25980
26322
  return {
25981
26323
  _id: "UrlParams",
25982
- params: Object.fromEntries(redact(this, get$4(context, CurrentRedactedNames)))
26324
+ params: Object.fromEntries(redact(this, get$5(context, CurrentRedactedNames)))
25983
26325
  };
25984
26326
  },
25985
26327
  toJSON() {
@@ -26180,7 +26522,7 @@ const decodeQueryKey = (key) => {
26180
26522
  return key;
26181
26523
  }
26182
26524
  };
26183
- const currentRedactedNames = () => get$4(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$9(), CurrentRedactedNames);
26525
+ const currentRedactedNames = () => get$5(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$9(), CurrentRedactedNames);
26184
26526
  /**
26185
26527
  * Query parameter names or patterns to redact in inspection, spans and errors.
26186
26528
  *
@@ -28101,6 +28443,22 @@ function fromJsonString(schema, options) {
28101
28443
  }
28102
28444
  globalThis.File;
28103
28445
  globalThis.URLSearchParams;
28446
+ /**
28447
+ * Decodes a base64 (RFC4648) encoded string into a UTF-8 string.
28448
+ *
28449
+ * **Details**
28450
+ *
28451
+ * Decoding:
28452
+ * - A **valid** base64 encoded string is decoded as a UTF-8 `string`.
28453
+ *
28454
+ * Encoding:
28455
+ * - A `string` is encoded as a base64-encoded string.
28456
+ *
28457
+ * @stability stable
28458
+ * @category schemas
28459
+ * @since 3.10.0
28460
+ */
28461
+ const StringFromBase64 = /*#__PURE__*/ String$7.annotate({ expected: "a base64 encoded string that will be decoded as a UTF-8 string" }).pipe(/*#__PURE__*/ decodeTo(String$7, stringFromBase64String));
28104
28462
  globalThis.Uint8Array;
28105
28463
  const immerable = /*#__PURE__*/ globalThis.Symbol.for("immer-draftable");
28106
28464
  const payloadToken = {};
@@ -29148,6 +29506,14 @@ const TypeId$7 = "~effect/http/HttpClient";
29148
29506
  const HttpClient = /*#__PURE__*/ Service("effect/HttpClient");
29149
29507
  const accessor = (method) => (...args) => flatMap$1(HttpClient, (client) => client[method](...args));
29150
29508
  /**
29509
+ * Executes a `GET` request using the `HttpClient` service from the environment.
29510
+ *
29511
+ * @stability unstable
29512
+ * @category accessors
29513
+ * @since 4.0.0
29514
+ */
29515
+ const get$2 = /*#__PURE__*/ accessor("get");
29516
+ /**
29151
29517
  * Executes a `HEAD` request using the `HttpClient` service from the environment.
29152
29518
  *
29153
29519
  * @stability unstable
@@ -31220,14 +31586,14 @@ const layer$3 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
31220
31586
  stdin.on("keypress", handleKeypress);
31221
31587
  if (inputEnded) handleEnd();
31222
31588
  else {
31223
- yield* get$2(rlRef);
31224
- yield* get$2(rawModeRef);
31589
+ yield* get$3(rlRef);
31590
+ yield* get$3(rawModeRef);
31225
31591
  stdin.once("end", handleEnd);
31226
31592
  }
31227
31593
  return queue;
31228
31594
  });
31229
31595
  const readLine = suspend$2(() => poll(lines).pipe(flatMap$1(match$5({
31230
- onNone: () => scoped(andThen(get$2(rlRef), take(lines))),
31596
+ onNone: () => scoped(andThen(get$3(rlRef), take(lines))),
31231
31597
  onSome: succeed$3
31232
31598
  })), mapError(() => new QuitError({}))));
31233
31599
  const display = (prompt) => uninterruptible(callback$1((resume) => {
@@ -35430,7 +35796,7 @@ const Formatter = /*#__PURE__*/ Reference("effect/cli/CliOutput", { defaultValue
35430
35796
  */
35431
35797
  const defaultPresenter = { present: /*#__PURE__*/ fnUntraced(function* (event) {
35432
35798
  const context$2 = yield* context();
35433
- const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$4(context$2, TerminalCapabilities).canColor });
35799
+ const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$5(context$2, TerminalCapabilities).canColor });
35434
35800
  switch (event._tag) {
35435
35801
  case "Help": return yield* log(formatter.formatHelpDoc(event.helpDoc));
35436
35802
  case "InvalidInvocation":
@@ -37883,7 +38249,7 @@ const make$1 = (options) => ({
37883
38249
  *
37884
38250
  * @internal
37885
38251
  */
37886
- const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$3(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$4(context, TerminalCapabilities).canColor })));
38252
+ const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$3(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$5(context, TerminalCapabilities).canColor })));
37887
38253
  // ../../node_modules/.pnpm/effect@4.1.0/node_modules/effect/dist/cli/internal/lexer.js
37888
38254
  /**
37889
38255
  * @internal
@@ -49285,7 +49651,7 @@ const shallowest = (manifests) => manifests.filter((candidate) => !manifests.som
49285
49651
  * or without one, its `package.json` `workspaces`, or, with neither, the shallowest manifest of
49286
49652
  * each name, so fixtures and templates deeper in the tree never count.
49287
49653
  */
49288
- const published$1 = (files) => {
49654
+ const published = (files) => {
49289
49655
  const globs = pnpmPackages(files.get("pnpm-workspace.yaml")) ?? npmWorkspaces(files.get("package.json"));
49290
49656
  const member = globs === void 0 ? () => true : workspaceMember(globs);
49291
49657
  const manifests = [...files].flatMap(([path, contents]) => {
@@ -51073,6 +51439,11 @@ const prepareBinding = fn("StoreView.prepareBinding")(function* (location, stagi
51073
51439
  });
51074
51440
  // ../core/src/Store.ts
51075
51441
  const historyDepth = 50;
51442
+ const deeperHistoryDepths = [
51443
+ 200,
51444
+ 800,
51445
+ 3200
51446
+ ];
51076
51447
  const licensePrefixes = [
51077
51448
  "LICENSE",
51078
51449
  "COPYING",
@@ -51860,18 +52231,33 @@ const readPinned = fn("Store.readPinned")(function* (options) {
51860
52231
  };
51861
52232
  })).pipe(catchTag("CorruptStore", () => succeed$3(unavailable)));
51862
52233
  });
51863
- const countCommits = fn("Store.countCommits")(function* (location, url, revision) {
51864
- const output = yield* runStore(location.store, [
51865
- "rev-list",
51866
- "--count",
51867
- revision
51868
- ]);
51869
- const count = Number(output);
51870
- if (!Number.isSafeInteger(count) || count < 0) return yield* InvalidRemoteOutput.make({
51871
- url,
51872
- detail: `expected a non-negative commit count, got "${output}"`
52234
+ /** Whether `ancestor` is in `tip`'s history, deepening a shallow store until it can tell. `Unknown` when history still stops short at the deepest fetch. */
52235
+ const linkHistory = fn("Store.linkHistory")(function* (location, url, ancestor, tip) {
52236
+ const isConnected = gen(function* () {
52237
+ return (yield* hasCommit(location, ancestor)) && (yield* answers(runStore(location.store, [
52238
+ "merge-base",
52239
+ "--is-ancestor",
52240
+ ancestor,
52241
+ tip
52242
+ ]), [1]));
51873
52243
  });
51874
- return count;
52244
+ const isShallow = runStore(location.store, ["rev-parse", "--is-shallow-repository"]).pipe(map$5((output) => output === "true"));
52245
+ if (yield* isConnected) return "Connected";
52246
+ for (const depth of deeperHistoryDepths) {
52247
+ if (!(yield* isShallow)) return "Unrelated";
52248
+ yield* runStore(location.store, [
52249
+ "fetch",
52250
+ "--quiet",
52251
+ "--depth",
52252
+ String(depth),
52253
+ "--filter=blob:none",
52254
+ "--no-tags",
52255
+ "origin",
52256
+ tip
52257
+ ]).pipe(orRemoteUnavailable(url, "fetch"));
52258
+ if (yield* isConnected) return "Connected";
52259
+ }
52260
+ return (yield* isShallow) ? "Unknown" : "Unrelated";
51875
52261
  });
51876
52262
  const commitDate = /^\d{4}-\d{2}-\d{2}$/;
51877
52263
  const parseHistory = fn("Store.parseHistory")(function* (url, output) {
@@ -51911,15 +52297,9 @@ const fetchHistory = fn("Store.fetchHistory")(function* (root, name, options) {
51911
52297
  commit: options.tip,
51912
52298
  depth: historyDepth
51913
52299
  });
52300
+ const link = yield* linkHistory(location, options.url, options.pinned, options.tip);
51914
52301
  const pinPresent = yield* hasCommit(location, options.pinned);
51915
- const diverged = !pinPresent || !(yield* answers(runStore(location.store, [
51916
- "merge-base",
51917
- "--is-ancestor",
51918
- options.pinned,
51919
- options.tip
51920
- ]), [1]));
51921
- const mayHaveMore = diverged && (yield* countCommits(location, options.url, options.tip)) >= historyDepth;
51922
- const revision = diverged ? options.tip : `${options.pinned}..${options.tip}`;
52302
+ const revision = link === "Connected" ? `${options.pinned}..${options.tip}` : options.tip;
51923
52303
  const commits = yield* runStore(location.store, [
51924
52304
  "log",
51925
52305
  "-z",
@@ -51944,8 +52324,8 @@ const fetchHistory = fn("Store.fetchHistory")(function* (root, name, options) {
51944
52324
  yield* mark(location.storeRoot, location.key.fileName);
51945
52325
  return {
51946
52326
  commits,
51947
- diverged,
51948
- mayHaveMore,
52327
+ diverged: link === "Unrelated",
52328
+ mayHaveMore: link === "Unknown",
51949
52329
  ...readChanges !== void 0 && { readChanges }
51950
52330
  };
51951
52331
  }));
@@ -52016,6 +52396,25 @@ const preparedView = fn("Store.preparedView")(function* (options) {
52016
52396
  return location;
52017
52397
  })));
52018
52398
  }, scoped);
52399
+ const resolveCommit = (location, revision) => runStore(location.store, [
52400
+ "rev-parse",
52401
+ "--verify",
52402
+ "--quiet",
52403
+ `${revision}^{commit}`
52404
+ ]).pipe(map$5((output) => isCommitSha(output) ? CommitSha.make(output) : void 0), catchIf(isMissingNotCorrupt, () => undefined_$1));
52405
+ /** The revision a `from..to` range starts at, when the log of the range cannot reach it. */
52406
+ const unreachedStart = fn("Store.unreachedStart")(function* (location, url, range) {
52407
+ const [start, end] = range.split(/\.{2,3}/);
52408
+ if (start === void 0 || end === void 0) return void 0;
52409
+ const [from, to] = [yield* resolveCommit(location, start), yield* resolveCommit(location, end)];
52410
+ if (from === void 0 || to === void 0) return void 0;
52411
+ return !(yield* answers(runStore(location.store, [
52412
+ "merge-base",
52413
+ "--is-ancestor",
52414
+ to,
52415
+ from
52416
+ ]), [1])) && (yield* linkHistory(location, url, from, to)) === "Unknown" ? start : void 0;
52417
+ });
52019
52418
  const diff$1 = fn("Store.diff")(function* (options) {
52020
52419
  if (options.range !== void 0 && (!options.range.includes("..") || options.range.startsWith("-"))) return yield* InvalidRevisionRange.make({ range: options.range });
52021
52420
  const format = options.format ?? "patch";
@@ -52038,12 +52437,15 @@ const diff$1 = fn("Store.diff")(function* (options) {
52038
52437
  ...options,
52039
52438
  temporaryRoot
52040
52439
  });
52041
- return yield* withLifetime(location, "shared", withRepoLock(options.root, options.repo.name, gen(function* () {
52440
+ const range = options.range;
52441
+ const unreached = format === "log" && range !== void 0 ? yield* withLock(options.root, options.repo.name, options.repo.url, (locked) => unreachedStart(locked, options.repo.url, range)) : void 0;
52442
+ const output = yield* withLifetime(location, "shared", withRepoLock(options.root, options.repo.name, gen(function* () {
52042
52443
  yield* assertCurrentRepo(options.root, options.repo);
52043
52444
  const output = yield* options.range === void 0 ? runAt(location, args) : runStore(location.store, args);
52044
52445
  yield* mark(location.storeRoot, location.key.fileName);
52045
52446
  return output;
52046
52447
  })), infinity);
52448
+ return unreached === void 0 ? output : `${output}\n… and more: the store's history stops before reaching ${unreached}`;
52047
52449
  }, scoped);
52048
52450
  const run$15 = fn("Store.run")(function* (options) {
52049
52451
  const stderr = (yield* Stdio).stderr();
@@ -54155,7 +54557,7 @@ const newestPublished = fnUntraced(function* (releases, current, published) {
54155
54557
  for (const release of followed(releases, current)) if (release.tag === current?.tag || published === void 0 || (yield* published(release))) return release;
54156
54558
  });
54157
54559
  const latestAmong = fnUntraced(function* (url, tags, options) {
54158
- const commits = new Map(tags.map((tag) => [tag.name, tag.commit]));
54560
+ const commits = new Map([...options.current !== void 0 && options.currentCommit !== void 0 ? [[options.current, options.currentCommit]] : [], ...tags.map((tag) => [tag.name, tag.commit])]);
54159
54561
  const releases = tags.flatMap((tag) => parse(tag.name) ?? []);
54160
54562
  const prefixes = [...new Set(releases.map((release) => release.prefix))].sort();
54161
54563
  const current = options.current === void 0 ? void 0 : parse(options.current);
@@ -54174,7 +54576,13 @@ const latestAmong = fnUntraced(function* (url, tags, options) {
54174
54576
  })
54175
54577
  });
54176
54578
  }
54177
- const found = yield* newestPublished(releases.filter((release) => release.prefix === prefix), current?.prefix === prefix ? current : void 0, options.published);
54579
+ const found = yield* newestPublished(releases.filter((release) => release.prefix === prefix), current?.prefix === prefix ? current : void 0, options.registry?.published);
54580
+ const untagged = found === void 0 || options.registry === void 0 ? void 0 : yield* options.registry.untagged(found);
54581
+ if (untagged !== void 0) return ResolvedRef.make({
54582
+ name: `${prefix}${untagged.version}`,
54583
+ kind: "tag",
54584
+ commit: untagged.commit
54585
+ });
54178
54586
  const commit = found === void 0 ? void 0 : commits.get(found.tag);
54179
54587
  if (found === void 0 || commit === void 0) return yield* NoReleases.make({
54180
54588
  url,
@@ -54190,25 +54598,28 @@ const latestAmong = fnUntraced(function* (url, tags, options) {
54190
54598
  const latest = fn("Release.latest")(function* (url, options = {}) {
54191
54599
  return yield* latestAmong(url, yield* listTags(url), options);
54192
54600
  });
54193
- /** What `ref` follows upstream: the newest release on its line, a branch's tip, or nothing (a commit or a non-release tag). */
54194
- const track$1 = fn("Release.track")(function* (url, ref, published) {
54195
- if (parse(ref) !== void 0) {
54196
- const tags = yield* listTags(url);
54197
- if (tags.some((tag) => tag.name === ref)) return {
54601
+ /** What `ref` follows upstream: the newest release on its line, a branch's tip, or nothing (a commit or a non-release tag). A release the registry vouches for needs no tag. */
54602
+ const track$1 = fn("Release.track")(function* (url, ref, options = {}) {
54603
+ const followRelease = fnUntraced(function* (tags) {
54604
+ return {
54198
54605
  _tag: "Release",
54199
54606
  latest: yield* latestAmong(url, tags, {
54200
54607
  current: ref,
54201
- published
54608
+ currentCommit: options.commit,
54609
+ registry: options.registry
54202
54610
  })
54203
54611
  };
54204
- }
54205
- const resolved = yield* resolveRepoRef(url, ref);
54206
- return resolved.kind === "branch" ? {
54612
+ });
54613
+ const tags = parse(ref) === void 0 ? [] : yield* listTags(url);
54614
+ if (tags.some((tag) => tag.name === ref)) return yield* followRelease(tags);
54615
+ const resolved = yield* result(resolveRepoRef(url, ref));
54616
+ if (isFailure$1(resolved)) return resolved.failure._tag === "RefNotFound" && parse(ref) !== void 0 && options.registry !== void 0 ? yield* followRelease(tags) : yield* resolved.failure;
54617
+ return resolved.success.kind === "branch" ? {
54207
54618
  _tag: "Branch",
54208
- tip: resolved
54619
+ tip: resolved.success
54209
54620
  } : {
54210
54621
  _tag: "Fixed",
54211
- resolved
54622
+ resolved: resolved.success
54212
54623
  };
54213
54624
  });
54214
54625
  // ../core/src/Add.ts
@@ -56680,7 +57091,7 @@ const loadLibraries = fnUntraced(function* (root, inventory) {
56680
57091
  const snapshot = pinned.get(repo.name);
56681
57092
  return snapshot?._tag === "Available" ? [{
56682
57093
  repo,
56683
- published: releasedPackages(repo, published$1(snapshot.files)),
57094
+ published: releasedPackages(repo, published(snapshot.files)),
56684
57095
  scope: repoScope(repo)
56685
57096
  }] : [];
56686
57097
  })
@@ -57465,6 +57876,18 @@ var RegistryUnavailable = class extends TaggedError()("RegistryUnavailable", {
57465
57876
  return this.message;
57466
57877
  }
57467
57878
  };
57879
+ var ReleaseWithoutCommit = class extends TaggedError()("ReleaseWithoutCommit", {
57880
+ repoName: String$7,
57881
+ package: String$7,
57882
+ version: String$7
57883
+ }) {
57884
+ get message() {
57885
+ return `${this.package}@${this.version} is on npm, but upstream has no tag for it and npm names no commit. Find its commit and run \`vendy track ${this.repoName} <sha>\`.`;
57886
+ }
57887
+ get [userMessage]() {
57888
+ return this.message;
57889
+ }
57890
+ };
57468
57891
  const isPublished = fn("NpmRegistry.isPublished")(function* (name, version) {
57469
57892
  const unavailable = (cause) => RegistryUnavailable.make({
57470
57893
  package: name,
@@ -57476,21 +57899,76 @@ const isPublished = fn("NpmRegistry.isPublished")(function* (name, version) {
57476
57899
  if (response.status >= 200 && response.status < 300) return true;
57477
57900
  return yield* unavailable(`HTTP ${response.status}`);
57478
57901
  });
57479
- /** Whether a release of `repo` is out: the registry serves every package of `dependencies` that the release's tag versions. Undefined for a reference repo, which installs nothing. */
57480
- const published = dual(2, (repo, dependencies) => {
57902
+ const DistTags = Record(String$7, String$7);
57903
+ const PublishedVersion = Struct({
57904
+ version: String$7,
57905
+ gitHead: optionalKey(String$7),
57906
+ dist: Struct({ attestations: optionalKey(Struct({ url: String$7 })) })
57907
+ });
57908
+ const Attestations = Struct({ attestations: ArraySchema(Struct({
57909
+ predicateType: String$7,
57910
+ bundle: Struct({ dsseEnvelope: Struct({ payload: StringFromBase64 }) })
57911
+ })) });
57912
+ const Provenance = fromJsonString(Struct({ predicate: Struct({ buildDefinition: Struct({ resolvedDependencies: ArraySchema(Struct({ digest: Struct({ gitCommit: optionalKey(String$7) }) })) }) }) }));
57913
+ const getJson = fnUntraced(function* (address, schema, unavailable) {
57914
+ const response = yield* get$2(address).pipe(mapError(unavailable));
57915
+ if (response.status === 404) return void 0;
57916
+ if (response.status < 200 || response.status >= 300) return yield* unavailable(`HTTP ${response.status}`);
57917
+ const body = yield* response.json.pipe(mapError(unavailable));
57918
+ return yield* decodeEffect(schema)(body).pipe(mapError(unavailable));
57919
+ });
57920
+ const provenanceCommit = fnUntraced(function* (address, unavailable) {
57921
+ const slsa = (yield* getJson(address, Attestations, unavailable))?.attestations.find(({ predicateType }) => predicateType.startsWith("https://slsa.dev/provenance/"));
57922
+ if (slsa === void 0) return void 0;
57923
+ return (yield* decodeEffect(Provenance)(slsa.bundle.dsseEnvelope.payload).pipe(mapError(unavailable))).predicate.buildDefinition.resolvedDependencies[0]?.digest.gitCommit;
57924
+ });
57925
+ const newestStable = (versions) => versions.filter((version) => import_semver.default.valid(version) !== null && import_semver.default.prerelease(version) === null).toSorted(import_semver.default.rcompare)[0];
57926
+ const untaggedRelease = (repo, packages) => fnUntraced(function* (newest) {
57927
+ for (const { package: name } of packages) {
57928
+ if (!(followingVersion(newest, newest, {
57929
+ name,
57930
+ version: newest.version
57931
+ }) !== void 0) || !(yield* isPublished(name, newest.version))) continue;
57932
+ const unavailable = (cause) => RegistryUnavailable.make({
57933
+ package: name,
57934
+ version: newest.version,
57935
+ cause
57936
+ });
57937
+ const distTags = yield* getJson(`${url}/-/package/${name}/dist-tags`, DistTags, unavailable);
57938
+ const version = newestStable(Object.values(distTags ?? {}));
57939
+ if (version === void 0 || !import_semver.default.gt(version, newest.version)) return void 0;
57940
+ const release = yield* getJson(`${url}/${name}/${version}`, PublishedVersion, unavailable);
57941
+ if (release === void 0) return void 0;
57942
+ const commit = (release.dist.attestations === void 0 ? void 0 : yield* provenanceCommit(release.dist.attestations.url, unavailable)) ?? release.gitHead;
57943
+ if (commit === void 0 || !isCommitSha(commit)) return yield* ReleaseWithoutCommit.make({
57944
+ repoName: repo.name,
57945
+ package: name,
57946
+ version
57947
+ });
57948
+ return {
57949
+ version,
57950
+ commit: CommitSha.make(commit)
57951
+ };
57952
+ }
57953
+ });
57954
+ /** What npm says about `repo`'s releases. Undefined for a reference repo, which installs nothing. */
57955
+ const registry = dual(2, (repo, dependencies) => {
57481
57956
  const packages = dependencies.filter((dependency) => dependency.name === repo.name);
57482
57957
  if (packages.length === 0) return void 0;
57483
57958
  const pinned = parse(repo.ref);
57484
- return fnUntraced(function* (release) {
57485
- for (const dependency of packages) {
57486
- const version = followingVersion(release, pinned, {
57487
- name: dependency.package,
57488
- version: dependency.snapshot
57489
- });
57490
- if (version !== void 0 && !(yield* isPublished(dependency.package, version))) return false;
57491
- }
57492
- return true;
57493
- });
57959
+ return {
57960
+ published: fnUntraced(function* (release) {
57961
+ for (const dependency of packages) {
57962
+ const version = followingVersion(release, pinned, {
57963
+ name: dependency.package,
57964
+ version: dependency.snapshot
57965
+ });
57966
+ if (version !== void 0 && !(yield* isPublished(dependency.package, version))) return false;
57967
+ }
57968
+ return true;
57969
+ }),
57970
+ untagged: untaggedRelease(repo, packages)
57971
+ };
57494
57972
  });
57495
57973
  // ../core/src/Status.ts
57496
57974
  const distance = (upstream) => {
@@ -57535,6 +58013,7 @@ const shortCause = (error) => {
57535
58013
  case "NoReleases":
57536
58014
  case "AmbiguousReleases": return "release tags not found upstream";
57537
58015
  case "RegistryUnavailable": return "npm registry unreachable";
58016
+ case "ReleaseWithoutCommit": return `${error.package}@${error.version} on npm has no tag or commit`;
57538
58017
  case "InvalidRemoteOutput": return "invalid remote ref data";
57539
58018
  case "GitNotFound": return "git not found on PATH";
57540
58019
  case "RemoteUnavailable": return "remote unreachable";
@@ -57569,7 +58048,10 @@ const checkLog = (root, repo, tip) => fetchHistory(root, repo.name, {
57569
58048
  })
57570
58049
  }));
57571
58050
  const checkUpstream = fn("Status.checkUpstream")(function* (root, repo, dependencies, log) {
57572
- const tracked = yield* result(track$1(repo.url, repo.ref, published(repo, dependencies)));
58051
+ const tracked = yield* result(track$1(repo.url, repo.ref, {
58052
+ commit: repo.commit,
58053
+ registry: registry(repo, dependencies)
58054
+ }));
57573
58055
  if (isFailure$1(tracked)) return {
57574
58056
  _tag: "Unknown",
57575
58057
  cause: shortCause(tracked.failure)
@@ -58505,7 +58987,7 @@ const frozen = (context) => ({
58505
58987
  });
58506
58988
  const resolveDestination = fn("Update.resolveDestination")(function* (context) {
58507
58989
  const { repo, target } = context;
58508
- const published$2 = published(repo, context.dependencies);
58990
+ const registry$1 = registry(repo, context.dependencies);
58509
58991
  const onProgress = context.onProgress;
58510
58992
  const announce = (ref) => onProgress === void 0 ? void_ : onProgress({
58511
58993
  _tag: "Resolving",
@@ -58525,7 +59007,8 @@ const resolveDestination = fn("Update.resolveDestination")(function* (context) {
58525
59007
  const latest$1 = yield* result(latest(repo.url, {
58526
59008
  package: packageName,
58527
59009
  current: repo.ref,
58528
- published: published$2
59010
+ currentCommit: repo.commit,
59011
+ registry: registry$1
58529
59012
  }));
58530
59013
  return isFailure$1(latest$1) ? {
58531
59014
  _tag: "Done",
@@ -58536,7 +59019,7 @@ const resolveDestination = fn("Update.resolveDestination")(function* (context) {
58536
59019
  const pin = target.sha;
58537
59020
  if (isCommitSha(pin)) return apply(repo.ref, CommitSha.make(pin));
58538
59021
  yield* announce(pin);
58539
- const tracking = yield* result(resolveRepoRef(repo.url, repo.ref));
59022
+ const tracking = yield* result(resolveRepoRef(repo.url, repo.ref).pipe(map$5(({ commit }) => commit), catchTag("RefNotFound", () => succeed$3(repo.commit))));
58540
59023
  if (isFailure$1(tracking)) return {
58541
59024
  _tag: "Done",
58542
59025
  outcome: failed(context, tracking.failure)
@@ -58546,7 +59029,7 @@ const resolveDestination = fn("Update.resolveDestination")(function* (context) {
58546
59029
  name: repo.name,
58547
59030
  url: repo.url,
58548
59031
  prefix: pin,
58549
- hint: tracking.success.commit
59032
+ hint: tracking.success
58550
59033
  }));
58551
59034
  if (isFailure$1(expanded)) {
58552
59035
  if (expanded.failure._tag === "UnresolvedCommit") return yield* expanded.failure;
@@ -58564,7 +59047,10 @@ const resolveDestination = fn("Update.resolveDestination")(function* (context) {
58564
59047
  const requestedRef = target?._tag === "Ref" ? target.ref : repo.ref;
58565
59048
  if (!isCommitSha(requestedRef)) yield* announce(requestedRef);
58566
59049
  if (target === void 0) {
58567
- const tracked = yield* result(track$1(repo.url, repo.ref, published$2));
59050
+ const tracked = yield* result(track$1(repo.url, repo.ref, {
59051
+ commit: repo.commit,
59052
+ registry: registry$1
59053
+ }));
58568
59054
  if (isFailure$1(tracked)) return {
58569
59055
  _tag: "Done",
58570
59056
  outcome: failed(context, tracked.failure)
@@ -58985,7 +59471,7 @@ const skills$1 = {
58985
59471
  },
58986
59472
  "core": {
58987
59473
  description: "The vendy model — repos, snapshots, modes, library and reference repos and how a dependency matches its snapshot, the `uses` schema that makes up the map, what `vendy check` verifies, and how to size an upstream before vendoring it.",
58988
- content: "---\nname: core\ndescription: The vendy model — repos, snapshots, modes, library and reference repos and how a dependency matches its snapshot, the `uses` schema that makes up the map, what `vendy check` verifies, and how to size an upstream before vendoring it.\n---\n\n# vendy core\n\nvendy keeps pinned snapshots of external repositories at `.vendy/<name>`, and a map of what this project uses each one for.\n\n## Repos and modes\n\n| Mode | Pin | Snapshot bytes | A fresh clone gets |\n| -------- | ------------------------- | -------------- | ----------------------------------- |\n| `shared` | committed in `vendy.json` | git-ignored | the pin; run `vendy sync` for bytes |\n| `local` | `vendy.local.json` | git-excluded | nothing |\n\nA repo is a **library repo** when a package its snapshot publishes is a dependency of a project package its scope covers, and a **reference repo** otherwise. The difference decides what it tracks:\n\n- **Library repos track release tags.** The project runs the published package, so the snapshot must be the same release: reading unreleased code on a branch produces calls the installed version does not have. \"Newest\" means the newest published release, and the dependency moves with the tag.\n- **Reference repos track branches** — projects imitated, documentation read. Nothing installed has to match them, except the version of a tool the project pins when the snapshot is that tool's documentation.\n\nNot every dependency is a repo: the vendor workflow's \"Is it worth a repo?\" says which ones are.\n\n### Matching a dependency to its snapshot\n\n- **Snapshot ahead:** set the dependency to the snapshot's own version, keeping the range operator already there (`^1.4.0` → `^1.5.0`). Never `latest`: it drifts out of step with the pin the moment upstream publishes again. A pnpm dependency written as `catalog:` takes its version from `pnpm-workspace.yaml`; change it there, not in `package.json`.\n- **Dependency ahead:** move the snapshot instead — `vendy track <name> <tag-of-that-release>`.\n- **No `package.json`, or no dependency on it:** a reference repo; nothing to align — unless it documents a tool the project pins, such as a package manager's docs and `packageManager` in `package.json`. Set that pin to the tool's newest stable release whenever the snapshot moves, and treat what the docs mark as added in a later version as not yet available.\n\n### Two releases of one library\n\nWhen part of the project has to run another release — a plugin pinned to the version its host was built with — one snapshot cannot describe both. Take that part out of the use's scope with a `!` glob (`\"scope\": [\"**/*.ts\", \"!packages/plugin/**\"]`): the snapshot then answers for the rest, and `vendy check` compares it only with the dependencies of the packages its scope covers. When that part's code needs evidence of its own, also vendor the same upstream under a second name at the release it runs (`vendy add <url> --name <name>-plugin --ref <tag>`), with a use scoped to it.\n\n## The map\n\nEach shared repo carries `uses`: one per role the snapshot plays in this project.\n\n```json\n{\n \"name\": \"opencode\",\n \"url\": \"https://github.com/anomalyco/opencode.git\",\n \"ref\": \"v2.0.22\",\n \"commit\": \"…\",\n \"uses\": [\n {\n \"for\": \"Writing vendy's OpenCode plugin\",\n \"scope\": [\"packages/opencode/**\"],\n \"read\": [\"services/www/src/docs/content/build/plugins/\"]\n },\n {\n \"for\": \"Self-update and distribution, modeled on opencode's\",\n \"scope\": [\"packages/vendy/src/upgrade/**\", \"install.sh\"],\n \"read\": [\"packages/cli/src/services/updater.ts\", \"install\"],\n \"guide\": \"docs/guides/self-update.md\"\n }\n ]\n}\n```\n\n| Field | Relative to | Meaning | Absent means |\n| ------- | ----------------- | ----------------------------------------------------------------------------------------------- | ---------------------- |\n| `for` | — | The role, in the user's words. One clause, at most 120 characters, without `[`, `]`, `→` or `·` | (required) |\n| `scope` | the project root | Globs for the project files this use governs; `!` globs exclude | the use is provisional |\n| `read` | the snapshot root | Files or directories where the evidence lives: docs, examples, tests, source | the use is provisional |\n| `guide` | the project root | This use's guide, one file | no guide |\n\n`scope` globs are [picomatch](https://github.com/micromatch/picomatch) patterns that also match dot paths, so `**/*.ts` covers `.github/`. As in tinyglobby and fast-glob, a `!` glob subtracts from what every other glob matches, whatever their order, and no later glob adds a file back. `read` and `guide` are plain paths, never globs: a `read` directory covers everything under it.\n\nA use scoped to all the code a snapshot shapes is **project-wide**: a framework like Effect governs every TypeScript file, so it has one use, scoped to `**/*.ts` (`**` only when every file is, docs and config included), `\"for\": \"Effect 4 APIs and Node platform behavior\"`, and never one per module it touches. A use with no `scope` or no `read` is **provisional**: written at vendoring time, before where it applies and its evidence are located, and completed by align.\n\nA local repo's uses live in `vendy.local.json` the same way, and its guides stay out of Git with it: that is how a project draws on a repository without its history naming it. `vendy check` reports a local guide that is committed or not excluded.\n\nThe catalog renders every use as one line, into every session. Keep `for` to the role and let `read` and the guide carry the detail. A role says what reading the snapshot settles: \"Effect is the application framework\" only restates the project's imports, while the use above names what it settles.\n\n`scope` shares that line until the catalog passes the hook's limit, when the session gets each `for` alone and agents look up the uses governing each file they change; write it in as few globs as name the feature exactly: `dir/**` for a directory the feature owns, one brace glob for sibling files (`scripts/{release.mts,distribution.ts}`, `.github/workflows/{publish,release-*}.yml`), never one glob per file. Shorter must not mean wider: every file a scope matches costs a read of its evidence before any change there.\n\n## Check\n\n```bash\nvendy check # every finding across the map; exits non-zero on any\nvendy check <name> # one repo's uses\n```\n\nIt reports only what is decidable without judgment: the shape and budget of `uses`, globs that match or exclude nothing, `read` paths and guides that do not exist, provisional uses, a session catalog over the hook's 10,000-character limit, a library repo's dependency out of step with its snapshot, and imports of a vendored package that no scope covers or excludes. Whether the code inside a scope follows its evidence takes judgment, and belongs to the health workflow.\n\n## Sizing an upstream\n\n```bash\ngh api 'repos/<owner>/<repo>/git/trees/HEAD?recursive=1' \\\n --jq '[.tree[] | select(.type == \"blob\")] as $b | {truncated, files: ($b | length), bytes: ($b | map(.size) | add)}'\n```\n\nThis counts the files at the default branch's tip, which is what vendoring puts on disk. Never size by `diskUsage` from `gh repo view`: it counts the whole history and overstates a large repository several times over. `truncated: true` means the tree is too large for one response.\n\nAn upstream over 100 MB, or truncated, is vendored as a subset (vendor workflow, step 1); every other upstream is vendored whole.\n"
59474
+ content: "---\nname: core\ndescription: The vendy model — repos, snapshots, modes, library and reference repos and how a dependency matches its snapshot, the `uses` schema that makes up the map, what `vendy check` verifies, and how to size an upstream before vendoring it.\n---\n\n# vendy core\n\nvendy keeps pinned snapshots of external repositories at `.vendy/<name>`, and a map of what this project uses each one for.\n\n## Repos and modes\n\n| Mode | Pin | Snapshot bytes | A fresh clone gets |\n| -------- | ------------------------- | -------------- | ----------------------------------- |\n| `shared` | committed in `vendy.json` | git-ignored | the pin; run `vendy sync` for bytes |\n| `local` | `vendy.local.json` | git-excluded | nothing |\n\nA repo is a **library repo** when a package its snapshot publishes is a dependency of a project package its scope covers, and a **reference repo** otherwise. The difference decides what it tracks:\n\n- **Library repos track release tags.** The project runs the published package, so the snapshot must be the same release: reading unreleased code on a branch produces calls the installed version does not have. \"Newest\" means the newest published release, and the dependency moves with the tag.\n- **Reference repos track branches** — projects imitated, documentation read. Nothing installed has to match them, except the version of a tool the project pins when the snapshot is that tool's documentation.\n\nNot every dependency is a repo: the vendor workflow's \"Is it worth a repo?\" says which ones are.\n\n### Matching a dependency to its snapshot\n\n- **Snapshot ahead:** set the dependency to the snapshot's own version, keeping the range operator already there (`^1.4.0` → `^1.5.0`). Never `latest`: it drifts out of step with the pin the moment upstream publishes again. A pnpm dependency written as `catalog:` takes its version from `pnpm-workspace.yaml`; change it there, not in `package.json`.\n- **Dependency ahead:** move the snapshot instead — `vendy track <name> <tag-of-that-release>`, or `vendy track <name> --release` when upstream did not tag it.\n- **No `package.json`, or no dependency on it:** a reference repo; nothing to align — unless it documents a tool the project pins, such as a package manager's docs and `packageManager` in `package.json`. Set that pin to the tool's newest stable release whenever the update takes this repo: the highest version its registry serves without a prerelease suffix, whichever dist-tag carries it, so a `latest` that lags behind `next` holds nothing back. Treat what the docs mark as added in a later version as not yet available.\n\n### Two releases of one library\n\nWhen part of the project has to run another release — a plugin pinned to the version its host was built with — one snapshot cannot describe both. Take that part out of the use's scope with a `!` glob (`\"scope\": [\"**/*.ts\", \"!packages/plugin/**\"]`): the snapshot then answers for the rest, and `vendy check` compares it only with the dependencies of the packages its scope covers. When that part's code needs evidence of its own, also vendor the same upstream under a second name at the release it runs (`vendy add <url> --name <name>-plugin --ref <tag>`), with a use scoped to it.\n\n## The map\n\nEach shared repo carries `uses`: one per role the snapshot plays in this project.\n\n```json\n{\n \"name\": \"opencode\",\n \"url\": \"https://github.com/anomalyco/opencode.git\",\n \"ref\": \"v2.0.22\",\n \"commit\": \"…\",\n \"uses\": [\n {\n \"for\": \"Writing vendy's OpenCode plugin\",\n \"scope\": [\"packages/opencode/**\"],\n \"read\": [\"services/www/src/docs/content/build/plugins/\"]\n },\n {\n \"for\": \"Self-update and distribution, modeled on opencode's\",\n \"scope\": [\"packages/vendy/src/upgrade/**\", \"install.sh\"],\n \"read\": [\"packages/cli/src/services/updater.ts\", \"install\"],\n \"guide\": \"docs/guides/self-update.md\"\n }\n ]\n}\n```\n\n| Field | Relative to | Meaning | Absent means |\n| ------- | ----------------- | ----------------------------------------------------------------------------------------------- | ---------------------- |\n| `for` | — | The role, in the user's words. One clause, at most 120 characters, without `[`, `]`, `→` or `·` | (required) |\n| `scope` | the project root | Globs for the project files this use governs; `!` globs exclude | the use is provisional |\n| `read` | the snapshot root | Files or directories where the evidence lives: docs, examples, tests, source | the use is provisional |\n| `guide` | the project root | This use's guide, one file | no guide |\n\n`scope` globs are [picomatch](https://github.com/micromatch/picomatch) patterns that also match dot paths, so `**/*.ts` covers `.github/`. As in tinyglobby and fast-glob, a `!` glob subtracts from what every other glob matches, whatever their order, and no later glob adds a file back. `read` and `guide` are plain paths, never globs: a `read` directory covers everything under it.\n\nA use scoped to all the code a snapshot shapes is **project-wide**: a framework like Effect governs every TypeScript file, so it has one use, scoped to `**/*.ts` (`**` only when every file is, docs and config included), `\"for\": \"Effect 4 APIs and Node platform behavior\"`, and never one per module it touches. A use with no `scope` or no `read` is **provisional**: written at vendoring time, before where it applies and its evidence are located, and completed by align.\n\nA local repo's uses live in `vendy.local.json` the same way, and its guides stay out of Git with it: that is how a project draws on a repository without its history naming it. `vendy check` reports a local guide that is committed or not excluded.\n\nThe catalog renders every use as one line, into every session. Keep `for` to the role and let `read` and the guide carry the detail. A role says what reading the snapshot settles: \"Effect is the application framework\" only restates the project's imports, while the use above names what it settles.\n\n`scope` shares that line until the catalog passes the hook's limit, when the session gets each `for` alone and agents look up the uses governing each file they change; write it in as few globs as name the feature exactly: `dir/**` for a directory the feature owns, one brace glob for sibling files (`scripts/{release.mts,distribution.ts}`, `.github/workflows/{publish,release-*}.yml`), never one glob per file. Shorter must not mean wider: every file a scope matches costs a read of its evidence before any change there.\n\n## Check\n\n```bash\nvendy check # every finding across the map; exits non-zero on any\nvendy check <name> # one repo's uses\n```\n\nIt reports only what is decidable without judgment: the shape and budget of `uses`, globs that match or exclude nothing, `read` paths and guides that do not exist, provisional uses, a session catalog over the hook's 10,000-character limit, a library repo's dependency out of step with its snapshot, and imports of a vendored package that no scope covers or excludes. Whether the code inside a scope follows its evidence takes judgment, and belongs to the health workflow.\n\n## Sizing an upstream\n\n```bash\ngh api 'repos/<owner>/<repo>/git/trees/HEAD?recursive=1' \\\n --jq '[.tree[] | select(.type == \"blob\")] as $b | {truncated, files: ($b | length), bytes: ($b | map(.size) | add)}'\n```\n\nThis counts the files at the default branch's tip, which is what vendoring puts on disk. Never size by `diskUsage` from `gh repo view`: it counts the whole history and overstates a large repository several times over. `truncated: true` means the tree is too large for one response.\n\nAn upstream over 100 MB, or truncated, is vendored as a subset (vendor workflow, step 1); every other upstream is vendored whole.\n"
58989
59475
  },
58990
59476
  "health": {
58991
59477
  description: "Audit the whole map, or only the repos named — run vendy status and vendy check, let the user choose whether to bring any repo that is behind up to date first through the update workflow, then judge use by use whether the code in each scope follows its evidence, whether the map still describes the project, and whether each guide still holds. Fixes every finding, each citing both sides, commits the fixes, and reports what changed.",
@@ -59009,7 +59495,7 @@ const skills$1 = {
59009
59495
  },
59010
59496
  "update": {
59011
59497
  description: "Asks first whether to update the project's dependencies, its repos, both, or ones the user names. Moves snapshots to their newest upstream — libraries to their newest release with the dependency alongside, references to their branch tip. Reads what changed and traces it to the uses it affects before moving the pin, then carries the project's code and guides forward, takes up new upstream features the map has a use for, commits each repo, and reports what changed. Also covers updating a dependency that is not a repo, through a temporary local repo or its changelog alone.",
59012
- content: "---\nname: update\ndescription: Asks first whether to update the project's dependencies, its repos, both, or ones the user names. Moves snapshots to their newest upstream — libraries to their newest release with the dependency alongside, references to their branch tip. Reads what changed and traces it to the uses it affects before moving the pin, then carries the project's code and guides forward, takes up new upstream features the map has a use for, commits each repo, and reports what changed. Also covers updating a dependency that is not a repo, through a temporary local repo or its changelog alone.\n---\n\n# update snapshots\n\nThe project always runs on the newest upstream. The steps below take one repo, or one group of repos whose dependencies move together, from its pin to a commit.\n\nUnless the request, or the workflow that loaded this one, says what to update, ask the user to choose before anything else:\n\n1. **Every dependency** of the project.\n2. **Every repo** in `vendy catalog`.\n3. **Both.**\n4. **Names they type**: repos, dependencies, or both.\n\nEvery dependency is what the package manager's outdated report lists (`pnpm outdated`), each target confirmed with `npm view <pkg> dist-tags time --json`: the report hides releases younger than the release-age window, and compares with the `latest` dist-tag, so it misreports a dependency on another channel such as `next`. A dependency a library repo's snapshot publishes moves with that repo; one that is no repo follows \"Updating a dependency that is not a repo\".\n\nOf the repos taken, the ones with work are what `vendy status --log` shows behind, what `vendy check` reports as a dependency and snapshot that disagree, and any library repo still on a branch.\n\nWhen two or more repos have work, give each repo or group its own subagent; a group is repos whose dependencies move together, such as packages released from one monorepo. Under each behind repo, `vendy status --log` counts the files under its uses' read paths that the update changes. Repos where none changed have nothing the project's code must follow: put them together in one group under one subagent, committed together, rather than a subagent each. Dependencies that are no repo form one more group. The subagents share the project's checkout:\n\n- **A subagent never splits further.** It runs the steps its brief names, for the repos it names.\n- **Steps 1 and 2 run at once.** They only read: no edits, installs, checks, or tests.\n- **Steps 3 and 4 run one at a time.** Installs, tests, and commit hooks side by side can exhaust the machine's memory. Take the subagents in the order they report, continue the same one so it keeps what it read, and start the next only once its commit is in.\n\nBrief each with exactly this, filling in its names:\n\n```text\nRun steps 1 and 2 of vendy's update workflow (`vendy skills get update`) for <names>, reading only. Report the range and what step 2 found, then stop.\n```\n\nWhen its turn comes, continue it with:\n\n```text\nYour turn: run steps 3 and 4 for <names> in the checkout as it is now. Commit; do not push.\n```\n\nWith every commit in, run `vendy check` and the project's full checks and tests, once. Then report once, as step 4 says, for all of them.\n\n## 1. Find what changed\n\nThe pin stays put until step 3.\n\n```bash\nvendy status <name> --log # fetches what upstream added; the newest commit it lists is <to>\n```\n\n`<from>..<to>`, the pin to `<to>`, is the range every command below takes. Name revisions by SHA: the store fetches no upstream tags.\n\n`vendy status --log` already picks `<to>`: a reference repo's branch tip, or a library repo's newest release on its tag pattern and prerelease line that npm's registry serves, never backward. A release younger than the package manager's release-age window is still the target; step 3 exempts it. A library repo still on a branch has no release to read toward until step 3 moves it onto one, so it reads on its turn, after that move.\n\nTwo questions, read at different breadths.\n\n### What the project must follow\n\nNarrow: only the uses' evidence decides what the project's code depends on. Stop at the first layer that answers it:\n\n1. **The changelog.** `gh release view <tag> --repo <owner>/<repo>` for each release crossed, or the `CHANGELOG.md`, `.changeset/`, or release notes inside the snapshot. Breaking changes and deprecations, at the highest signal per line.\n2. **The diff in the `read` paths.**\n\n ```bash\n vendy diff <name> <from>..<to> --read --stat # which evidence changed\n vendy diff <name> <from>..<to> --read # how\n ```\n\n3. **Fresh read.** When the update crosses a major version, or a `read` path was moved or deleted, read the affected use's evidence again from scratch, as if vendoring it, and decide what the best practice is now.\n\n### What is new\n\nWide: never narrowed to the `read` paths, because a feature a use could take up often lands where the map does not read yet. Weigh each new thing against what each use is `for`, not where it reads.\n\n1. **The changelog** for every release crossed. When it names each feature and what it is for, it is enough: open a feature's code only once you are about to recommend it, to cite its evidence.\n2. **Where upstream changed**, when there is no changelog or it is too thin to judge from — a reference repo usually has none. Start from `vendy diff <name> <from>..<to> --log` and `--stat`; for a large update, `--dirstat` shows it by directory, and `vendy diff <name> <from>..<to> <path>...` shows how the files a feature touches changed.\n\n## 2. Trace it to the map\n\nFor every use of the repo, decide:\n\n- **Unaffected** — nothing in its evidence changed in a way its code depends on.\n- **Code must follow** — a breaking change, a deprecation, or a new recommended way of doing what this use's code does. List the files in its scope and what changes, citing the upstream evidence for each.\n- **Map must follow** — a `read` path moved, the evidence now lives elsewhere, or a recommended feature's evidence lies outside the use's `read` paths.\n- **Guide must follow** — a runbook step or an explained mechanism no longer matches.\n\nThen **recommend new features** from \"What is new\": anything one of the repo's uses could take up — a simpler API for what the code does by hand, a capability the scope's feature is missing. Only what the map has a use for; new features the project has no use for are noise.\n\n## 3. Move the pin and carry the project forward\n\n```bash\nvendy update <name> # prints: updated <name> <from>..<to>, then a diffstat of the whole snapshot\nvendy update <name> --patch # the full patch instead\n```\n\nIf it lands past the `<to>` step 1 read, read the difference first.\n\nA library repo still on a branch gets onto releases instead:\n\n```bash\nvendy track <name> --release # the repository's own releases: v<version>, or <repo>@<version>\nvendy track <name> --release --package <pkg> # a monorepo's <pkg>@<version> tags\n```\n\nIf the project installs a newer release than the newest tag vendy finds — a prerelease line the snapshot is not on — track that release's tag by name instead: `vendy track <name> <tag>`.\n\nThen bring the dependency along — for a reference repo, the tool pin its documentation describes: `vendy skills get core`, \"Matching a dependency to its snapshot\".\n\nWhen the package manager holds back young releases — pnpm's `minimumReleaseAge`, one day by default since pnpm 11 — exempt exactly what the install needs: add `<package>@<version>` to `minimumReleaseAgeExclude` in `pnpm-workspace.yaml` for each package the install refuses at its new release, replace that package's entry for the release left behind, and drop entries whose release has aged past the window. Never lower `minimumReleaseAge` itself.\n\nEverything unaffected → commit the pin alone, or the pin and its dependency.\n\nAnything affected → carry it forward without asking, the recommended features as well as the required changes: change the code, update the `read` paths and guides, and commit — one commit per repo or group, holding its pins, its dependencies, and the code and guides that followed it. A feature that changes how the project works — a command its instructions should name, a stricter check — is carried forward the same way, together with the instructions or configuration that stated the old way. Hold a feature back only when it cannot land cleanly, and say why in the report.\n\nEither way, in the project's commit style, the subject names each repo and the range `vendy update` printed, as in `Update effect to 4.0.5 (e17ecdb..7f524e2)` for a release or `Update cargo to 0892e1e (3960fa6..0892e1e)` for a branch, and the body says what changed and which upstream change each part follows.\n\nBefore committing, verify what the commit changes, and no more:\n\n- **Pins only**, no dependency or code: `vendy check` alone. The project's tests run nothing a pin moves.\n- **A dependency or code**: `vendy check`, then the project's checks and the tests that cover what changed. A subagent stops there; the orchestrator, or an update run without subagents, runs the full checks and tests once, after every commit is in.\n\nWhen the project's commit hook already runs its checks or tests, let the commit run them rather than running them first.\n\nWhen a repo or group cannot be carried forward cleanly — a migration too large for this pass, tests that will not go green — put it back where it was: `vendy pin <name> <from>` for a reference repo, `vendy track <name> <old-tag>` and the old dependency for a library, so the snapshot never describes code the project does not run.\n\n## 4. Report what changed\n\nFor each repo: from and to, its commit, what changed in the code, the map, and the guides, and the upstream features it took up. Then every feature a use could have taken up but did not, and why, citing the upstream evidence or the check you ran that shows it. Then each repo put back, and why.\n\n## Updating a dependency that is not a repo\n\nThe same read, trace, and carry forward, with nothing added to the map: the target is the newest release by step 1's rule, and the evidence comes from the changelog or a temporary local repo.\n\n1. **Changelog first**, for every release crossed (step 1, \"What the project must follow\"). When it names each breaking change and deprecation precisely enough to find the calls they affect, skip to 3 without a snapshot.\n2. **Otherwise, a temporary local repo** at the installed release, moved forward. A subagent running steps 1 and 2 writes nothing, so it compares the published packages instead — `npm pack <pkg>@<from>` and `npm pack <pkg>@<to>` into a scratch directory, then diff them — and leaves the temporary repo to its turn when the packages lack the source:\n\n ```bash\n vendy add <url> --ref <tag-of-installed-version> --mode local\n vendy update <name>\n ```\n\n The repo has no uses, so `--read` narrows to nothing: read the diff in the paths behind the APIs the project calls.\n\n3. **Trace it to the importing files** in place of uses: for each file that imports the package, unaffected or code must follow, citing the evidence. Recommend new features only where that code could take them up.\n4. **Carry the project forward** as step 3 says, with two differences: run the project's own checks and tests but not `vendy check`, which reports the temporary repo's importers as unmapped; and the commit holds the dependency and the code, no pin. When it cannot be carried forward cleanly, put the dependency back at its old version.\n5. **Remove the temporary repo**, unasked: `vendy remove <name>`. When it passed \"Is it worth a repo?\" in the vendor workflow, say so in the report and offer to vendor it at the release now installed, by that workflow's \"Vendoring an installed dependency\"; a kept repo costs every session a catalog line, so the user decides.\n"
59498
+ content: "---\nname: update\ndescription: Asks first whether to update the project's dependencies, its repos, both, or ones the user names. Moves snapshots to their newest upstream — libraries to their newest release with the dependency alongside, references to their branch tip. Reads what changed and traces it to the uses it affects before moving the pin, then carries the project's code and guides forward, takes up new upstream features the map has a use for, commits each repo, and reports what changed. Also covers updating a dependency that is not a repo, through a temporary local repo or its changelog alone.\n---\n\n# update snapshots\n\nThe project always runs on the newest upstream. The steps below take one repo, or one group of repos whose dependencies move together, from its pin to a commit.\n\nUnless the request, or the workflow that loaded this one, says what to update, ask the user to choose before anything else:\n\n1. **Every dependency** of the project.\n2. **Every repo** in `vendy catalog`.\n3. **Both.**\n4. **Names they type**: repos, dependencies, or both.\n\nEvery dependency is what the package manager's outdated report lists (`pnpm outdated`), each target confirmed with `npm view <pkg> dist-tags time --json`: the report hides releases younger than the release-age window, and compares with the `latest` dist-tag, so it misreports a dependency on another channel such as `next`. A dependency a library repo's snapshot publishes moves with that repo; one that is no repo follows \"Updating a dependency that is not a repo\".\n\nOf the repos taken, the ones with work are what `vendy status --log` shows behind, what `vendy check` reports as a dependency and snapshot that disagree, and any library repo still on a branch. So is a reference repo documenting a tool the project pins (core: \"Matching a dependency to its snapshot\") when the tool has a newer stable release, even with the snapshot up to date.\n\nWhen two or more repos have work, give each repo or group its own subagent; a group is repos whose dependencies move together, such as packages released from one monorepo. Under each behind repo, `vendy status --log` counts the files under its uses' read paths that the update changes. Repos where none changed have no evidence to trace: put them together in one group under one subagent, committed together, rather than a subagent each. A library among them still moves its dependency, and whatever the project generates from it. Dependencies that are no repo form one more group. The subagents share the project's checkout:\n\n- **A subagent never splits further.** It runs the steps its brief names, for the repos it names.\n- **Steps 1 and 2 run at once.** They only read: no edits, installs, checks, or tests.\n- **Steps 3 and 4 run one at a time, once every subagent has reported.** Nothing changes the checkout while another subagent reads it, and every report is in hand to order them and settle what they leave open. Installs, tests, and commit hooks side by side can exhaust the machine's memory, so continue one subagent, the same one so it keeps what it read, and start the next only once its commit is in. Take smaller changes first.\n\nBrief each with exactly this, filling in its names:\n\n```text\nRun steps 1 and 2 of vendy's update workflow (`vendy skills get update`) for <names>, reading only: no edits, installs, checks, or tests. Report the range and what step 2 found, then stop.\n```\n\nWhen its turn comes, continue it with:\n\n```text\nYour turn: run steps 3 and 4 for <names> in the checkout as it is now. Commit; do not push.\n```\n\nA report can leave a decision open, or recommend a feature that is the user's call (step 3). Settle them all before the first turn, asking the user about theirs together, and add each answer to that subagent's message; a subagent left to decide alone decides without them.\n\nWith every commit in, run `vendy check` and the project's full checks and tests, once. Then report once, as step 4 says, for all of them.\n\n## 1. Find what changed\n\nThe pin stays put until step 3.\n\n```bash\nvendy status <name> --log # fetches what upstream added; the newest commit it lists is <to>\n```\n\n`<from>..<to>`, the pin to `<to>`, is the range every command below takes. Name revisions by SHA: the store fetches no upstream tags.\n\n`vendy status --log` already picks `<to>`: a reference repo's branch tip, or a library repo's newest release on its tag pattern and prerelease line that npm's registry serves, never backward. A release younger than the package manager's release-age window is still the target; step 3 exempts it. A release npm serves and upstream never tagged counts too: vendy takes its commit from npm's provenance or `gitHead`, and records `v<version>`, or the tag pattern the repo follows, as the ref. When npm names no commit, `vendy status` says so as `unknown`, and `vendy update` fails for that repo: find the commit and `vendy track <name> <sha>`. A library repo still on a branch has no release to read toward until step 3 moves it onto one, so it reads on its turn, after that move.\n\nTwo questions, read at different breadths.\n\n### What the project must follow\n\nNarrow: only the uses' evidence decides what the project's code depends on. Stop at the first layer that answers it:\n\n1. **The changelog.** `gh release view <tag> --repo <owner>/<repo>` for each release crossed, or the `CHANGELOG.md`, `.changeset/`, or release notes inside the snapshot. Breaking changes and deprecations, at the highest signal per line.\n2. **The diff in the `read` paths.**\n\n ```bash\n vendy diff <name> <from>..<to> --read --stat # which evidence changed\n vendy diff <name> <from>..<to> --read # how\n ```\n\n3. **Fresh read.** When the update crosses a major version, or a `read` path was moved or deleted, read the affected use's evidence again from scratch, as if vendoring it, and decide what the best practice is now.\n\n### What is new\n\nWide: never narrowed to the `read` paths, because a feature a use could take up often lands where the map does not read yet. Weigh each new thing against what each use is `for`, not where it reads.\n\n1. **The changelog** for every release crossed. When it names each feature and what it is for, it is enough: open a feature's code only once you are about to recommend it, to cite its evidence.\n2. **Where upstream changed**, when there is no changelog or it is too thin to judge from — a reference repo usually has none. Start from `vendy diff <name> <from>..<to> --log` and `--stat`; for a large update, `--dirstat` shows it by directory, and `vendy diff <name> <from>..<to> <path>...` shows how the files a feature touches changed.\n\n## 2. Trace it to the map\n\nFor every use of the repo (`vendy catalog <name>` lists them), decide:\n\n- **Unaffected** — nothing in its evidence changed in a way its code depends on.\n- **Code must follow** — a breaking change, a deprecation, or a new recommended way of doing what this use's code does. List the files in its scope and what changes, citing the upstream evidence for each.\n- **Map must follow** — a `read` path moved, the evidence now lives elsewhere, or a recommended feature's evidence lies outside the use's `read` paths.\n- **Guide must follow** — a runbook step or an explained mechanism no longer matches.\n\nThen **recommend new features** from \"What is new\": anything one of the repo's uses could take up — a simpler API for what the code does by hand, a capability the scope's feature is missing. Only what the map has a use for; new features the project has no use for are noise.\n\n## 3. Move the pin and carry the project forward\n\n```bash\nvendy update <name> # prints: updated <name> <from>..<to>, then a diffstat of the whole snapshot\nvendy update <name> --patch # the full patch instead\n```\n\nIf it lands past the `<to>` step 1 read, read the difference first.\n\nA library repo still on a branch, or `frozen` at a commit while its dependency moves on, gets onto releases instead:\n\n```bash\nvendy track <name> --release # the repository's own releases: v<version>, or <repo>@<version>\nvendy track <name> --release --package <pkg> # a monorepo's <pkg>@<version> tags\n```\n\nIf the project installs a newer release than the newest tag vendy finds — a prerelease line the snapshot is not on — track that release's tag by name instead: `vendy track <name> <tag>`.\n\nThen bring the dependency along — for a reference repo, the tool pin its documentation describes: `vendy skills get core`, \"Matching a dependency to its snapshot\". When that tool pin moves, read the tool's own changelog or release notes for every release from the old pin to the new one, and trace them as step 2 does: the snapshot's range may not cover them, because its docs can have arrived in an earlier update.\n\nWhen the package manager holds back young releases — pnpm's `minimumReleaseAge`, one day by default since pnpm 11 — exempt exactly what the install needs: add `<package>@<version>` to `minimumReleaseAgeExclude` in `pnpm-workspace.yaml` for each package the install refuses at its new release, replace that package's entry for the release left behind, and drop entries whose release has aged past the window. Never lower `minimumReleaseAge` itself.\n\nEverything unaffected → commit the pin alone, or the pin and its dependency.\n\nAnything affected → carry it forward without asking, the recommended features as well as the required changes, except a feature that is the user's call. That is what a reference repo's product does and this project's users would see: another client's interface or behaviour, as opposed to a library's API. Move the pin without it and report it as a recommendation with its trade-offs, unless the orchestrator's message says the user took it. For the rest, change the code, update the `read` paths and guides, and commit — one commit per repo or group, holding its pins, its dependencies, and the code and guides that followed it. A feature that changes how the project works — a command its instructions should name, a stricter check — is carried forward the same way, together with the instructions or configuration that stated the old way. Hold a feature back only when it cannot land cleanly, and say why in the report.\n\nEither way, in the project's commit style, the subject names each repo and the range `vendy update` printed, as in `Update effect to 4.0.5 (e17ecdb..7f524e2)` for a release or `Update cargo to 0892e1e (3960fa6..0892e1e)` for a branch, and the body says what changed and which upstream change each part follows.\n\nBefore committing, verify what the commit changes, and no more:\n\n- **Pins only**, no dependency or code: `vendy check` alone. The project's tests run nothing a pin moves.\n- **A dependency or code**: `vendy check`, then the project's checks and the tests that cover what changed. A subagent stops there; the orchestrator, or an update run without subagents, runs the full checks and tests once, after every commit is in.\n\nWhen the project's commit hook already runs its checks or tests, let the commit run them rather than running them first.\n\nWhen a repo or group cannot be carried forward cleanly — a migration too large for this pass, tests that will not go green — put it back where it was: `vendy pin <name> <from>` for a reference repo, `vendy track <name> <old-tag>` and the old dependency for a library, so the snapshot never describes code the project does not run.\n\n## 4. Report what changed\n\nFor each repo: from and to, its commit, what changed in the code, the map, and the guides, and the upstream features it took up. Then every feature a use could have taken up but did not, and why, citing the upstream evidence or the check you ran that shows it. Then each repo put back, and why.\n\n## Updating a dependency that is not a repo\n\nThe same read, trace, and carry forward, with nothing added to the map: the target is the newest release by step 1's rule, and the evidence comes from the changelog or a temporary local repo.\n\n1. **Changelog first**, for every release crossed (step 1, \"What the project must follow\"). When it names each breaking change and deprecation precisely enough to find the calls they affect, skip to 3 without a snapshot.\n2. **Otherwise, a temporary local repo** at the installed release, moved forward. A subagent running steps 1 and 2 writes nothing, so it compares the published packages instead — `npm pack <pkg>@<from>` and `npm pack <pkg>@<to>` into a scratch directory, then diff them — and leaves the temporary repo to its turn when the packages lack the source:\n\n ```bash\n vendy add <url> --ref <tag-of-installed-version> --mode local\n vendy update <name>\n ```\n\n The repo has no uses, so `--read` narrows to nothing: read the diff in the paths behind the APIs the project calls.\n\n3. **Trace it to the importing files** in place of uses: for each file that imports the package, unaffected or code must follow, citing the evidence. Recommend new features only where that code could take them up.\n4. **Carry the project forward** as step 3 says, with two differences: run the project's own checks and tests but not `vendy check`, which reports the temporary repo's importers as unmapped; and the commit holds the dependency and the code, no pin. When it cannot be carried forward cleanly, put the dependency back at its old version.\n5. **Remove the temporary repo**, unasked: `vendy remove <name>`. When it passed \"Is it worth a repo?\" in the vendor workflow, say so in the report and offer to vendor it at the release now installed, by that workflow's \"Vendoring an installed dependency\"; a kept repo costs every session a catalog line, so the user decides.\n"
59013
59499
  },
59014
59500
  "vendor": {
59015
59501
  description: "Vendor an external repository and build with it — resolving the URL, pinning a library to its newest release and moving the dependency alongside, recording a provisional use for what the user wants from it, building the feature from its evidence, and finishing with align. Also covers vendoring a dependency the project already installs, at its installed release, and vendoring a package on your own instead of reading node_modules.",
@@ -59672,7 +60158,7 @@ const withGitSeparator = (args) => {
59672
60158
  const runVendy = (args, config) => runWith(vendy, config)(withGitSeparator(args)).pipe(provideService(Blocking, (description) => error(`waiting for file lock on ${description}`)), provideService(runner, invocation(process.cwd())), provideService(CliConfig, cliConfig), provide(layer));
59673
60159
  const run = dual(2, runVendy);
59674
60160
  // src/main.ts
59675
- const version = "0.6.2";
60161
+ const version = "0.6.3";
59676
60162
  const isSqliteExperimentalWarning = (warning) => warning.name === "ExperimentalWarning" && warning.message.startsWith("SQLite ");
59677
60163
  for (const printWarning of process.listeners("warning")) {
59678
60164
  process.off("warning", printWarning);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zebeqo/vendy",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Let your coding agent choose, build with, and maintain vendored repos, and keep your code in step as upstream moves",
5
5
  "license": "MIT",
6
6
  "repository": {