iteration-cli 0.14.2 → 0.14.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.
- package/dist/cli.js +981 -765
- package/dist/cursor-hook-entry.js +66 -29
- package/dist/launcher.js +93 -38
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ import { promises as fs2 } from "node:fs";
|
|
|
11
11
|
import path3 from "node:path";
|
|
12
12
|
import { StringDecoder } from "node:string_decoder";
|
|
13
13
|
|
|
14
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
14
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
|
|
15
15
|
var util_exports = {};
|
|
16
16
|
__export(util_exports, {
|
|
17
17
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -82,6 +82,7 @@ __export(util_exports, {
|
|
|
82
82
|
required: () => required,
|
|
83
83
|
safeExtend: () => safeExtend,
|
|
84
84
|
shallowClone: () => shallowClone,
|
|
85
|
+
sizeCaps: () => sizeCaps,
|
|
85
86
|
slugify: () => slugify,
|
|
86
87
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
87
88
|
toZod: () => toZod,
|
|
@@ -601,6 +602,18 @@ function prefixIssues(path4, issues) {
|
|
|
601
602
|
function unwrapMessage(message) {
|
|
602
603
|
return typeof message === "string" ? message : message?.message;
|
|
603
604
|
}
|
|
605
|
+
function sizeCaps(defChecks) {
|
|
606
|
+
const caps = [];
|
|
607
|
+
for (const ch of defChecks ?? []) {
|
|
608
|
+
const d = ch._zod.def;
|
|
609
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
610
|
+
break;
|
|
611
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
612
|
+
if (max >= 0)
|
|
613
|
+
caps.push([max, ch]);
|
|
614
|
+
}
|
|
615
|
+
return caps;
|
|
616
|
+
}
|
|
604
617
|
function attachSchema(issues, start, inst) {
|
|
605
618
|
var _a3;
|
|
606
619
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -854,7 +867,7 @@ function constantCatch(value) {
|
|
|
854
867
|
return fn;
|
|
855
868
|
}
|
|
856
869
|
|
|
857
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
870
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.js
|
|
858
871
|
var _a;
|
|
859
872
|
var _zodDesc = { value: void 0, enumerable: false };
|
|
860
873
|
var _E = "captureStackTrace" in Error ? Error : null;
|
|
@@ -972,7 +985,7 @@ function config(newConfig) {
|
|
|
972
985
|
return globalConfig;
|
|
973
986
|
}
|
|
974
987
|
|
|
975
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
988
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.js
|
|
976
989
|
function _getMessage() {
|
|
977
990
|
const internals = this._zod;
|
|
978
991
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1087,7 +1100,7 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
|
|
|
1087
1100
|
return fieldErrors;
|
|
1088
1101
|
}
|
|
1089
1102
|
|
|
1090
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1103
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/parse.js
|
|
1091
1104
|
function finalizeParams(callee, params) {
|
|
1092
1105
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
1093
1106
|
}
|
|
@@ -1235,7 +1248,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1235
1248
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1236
1249
|
};
|
|
1237
1250
|
|
|
1238
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1251
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/regexes.js
|
|
1239
1252
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
1240
1253
|
var cuid2 = /^[0-9a-z]+$/;
|
|
1241
1254
|
var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
@@ -1294,7 +1307,7 @@ var _null = /^null$/i;
|
|
|
1294
1307
|
var lowercase = /^[^A-Z]*$/;
|
|
1295
1308
|
var uppercase = /^[^a-z]*$/;
|
|
1296
1309
|
|
|
1297
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1310
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.js
|
|
1298
1311
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1299
1312
|
var _a3;
|
|
1300
1313
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1614,7 +1627,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1614
1627
|
};
|
|
1615
1628
|
});
|
|
1616
1629
|
|
|
1617
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1630
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/doc.js
|
|
1618
1631
|
var Doc = class {
|
|
1619
1632
|
constructor(args = [], closed = {}) {
|
|
1620
1633
|
this.content = [];
|
|
@@ -1655,14 +1668,14 @@ ${content.join("\n")}
|
|
|
1655
1668
|
}
|
|
1656
1669
|
};
|
|
1657
1670
|
|
|
1658
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1671
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.js
|
|
1659
1672
|
var version = {
|
|
1660
1673
|
major: 4,
|
|
1661
1674
|
minor: 6,
|
|
1662
|
-
patch:
|
|
1675
|
+
patch: 6
|
|
1663
1676
|
};
|
|
1664
1677
|
|
|
1665
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1678
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.js
|
|
1666
1679
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1667
1680
|
var _a3;
|
|
1668
1681
|
inst ?? (inst = {});
|
|
@@ -2233,6 +2246,29 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
2233
2246
|
return payload;
|
|
2234
2247
|
};
|
|
2235
2248
|
});
|
|
2249
|
+
function capSize(inst, size) {
|
|
2250
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2251
|
+
if (!caps.length)
|
|
2252
|
+
return;
|
|
2253
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2254
|
+
const parse2 = inst._zod.parse;
|
|
2255
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2256
|
+
const n = size(payload.value);
|
|
2257
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2258
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
2259
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
2260
|
+
const start = payload.issues.length;
|
|
2261
|
+
ch._zod.check(payload);
|
|
2262
|
+
payload.issues[start].continue = false;
|
|
2263
|
+
attachSchema(payload.issues, start, inst);
|
|
2264
|
+
return payload;
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
return parse2(payload, ctx);
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
2271
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2236
2272
|
function handleArrayResult(result, final, index) {
|
|
2237
2273
|
if (result.issues.length) {
|
|
2238
2274
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -2276,6 +2312,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2276
2312
|
}
|
|
2277
2313
|
return payload;
|
|
2278
2314
|
};
|
|
2315
|
+
capSize(inst, arraySize);
|
|
2279
2316
|
});
|
|
2280
2317
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2281
2318
|
const isPresent = key in input;
|
|
@@ -3319,7 +3356,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3319
3356
|
}
|
|
3320
3357
|
}
|
|
3321
3358
|
|
|
3322
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3359
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/memoizer.js
|
|
3323
3360
|
var $ZodCyclicError = class extends Error {
|
|
3324
3361
|
constructor() {
|
|
3325
3362
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3593,7 +3630,7 @@ function isBackEdge(ctx, value) {
|
|
|
3593
3630
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3594
3631
|
}
|
|
3595
3632
|
|
|
3596
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3633
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/en.js
|
|
3597
3634
|
var error = () => {
|
|
3598
3635
|
const Sizable = {
|
|
3599
3636
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -3718,7 +3755,7 @@ function en_default() {
|
|
|
3718
3755
|
};
|
|
3719
3756
|
}
|
|
3720
3757
|
|
|
3721
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3758
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.js
|
|
3722
3759
|
var _a2;
|
|
3723
3760
|
var $ZodRegistry = class {
|
|
3724
3761
|
constructor() {
|
|
@@ -3766,7 +3803,7 @@ function registry() {
|
|
|
3766
3803
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
3767
3804
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3768
3805
|
|
|
3769
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3806
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.js
|
|
3770
3807
|
function snapshotChecks(def) {
|
|
3771
3808
|
if (def.checks)
|
|
3772
3809
|
def.checks = [...def.checks];
|
|
@@ -4281,7 +4318,7 @@ function _check(fn, params) {
|
|
|
4281
4318
|
return ch;
|
|
4282
4319
|
}
|
|
4283
4320
|
|
|
4284
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
4321
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.js
|
|
4285
4322
|
function assignProps(target, ...sources) {
|
|
4286
4323
|
for (const source of sources) {
|
|
4287
4324
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -4811,7 +4848,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4811
4848
|
return finalize(ctx, schema);
|
|
4812
4849
|
};
|
|
4813
4850
|
|
|
4814
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
4851
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema-processors.js
|
|
4815
4852
|
var narrowMin = (agg, key, value) => {
|
|
4816
4853
|
if (agg[key] === void 0 || value > agg[key])
|
|
4817
4854
|
agg[key] = value;
|
|
@@ -5355,7 +5392,7 @@ var lazyProcessor = (schema, ctx, _json, params) => {
|
|
|
5355
5392
|
seen.ref = innerType;
|
|
5356
5393
|
};
|
|
5357
5394
|
|
|
5358
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
5395
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.js
|
|
5359
5396
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5360
5397
|
function _lazyMethod(proto, key, make) {
|
|
5361
5398
|
Object.defineProperty(proto, key, {
|
|
@@ -5400,7 +5437,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
|
|
|
5400
5437
|
Parent: Error
|
|
5401
5438
|
});
|
|
5402
5439
|
|
|
5403
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
5440
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.js
|
|
5404
5441
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
5405
5442
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5406
5443
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5414,7 +5451,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
5414
5451
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5415
5452
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5416
5453
|
|
|
5417
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
5454
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
|
|
5418
5455
|
function _ensureDefaultLocale() {
|
|
5419
5456
|
if (!globalConfig.localeError)
|
|
5420
5457
|
config(en_default());
|
|
@@ -6360,7 +6397,7 @@ function superRefine(fn, params) {
|
|
|
6360
6397
|
return _superRefine(fn, params);
|
|
6361
6398
|
}
|
|
6362
6399
|
|
|
6363
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
6400
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/iso.js
|
|
6364
6401
|
var iso_exports = {};
|
|
6365
6402
|
__export(iso_exports, {
|
|
6366
6403
|
ZodISODate: () => ZodISODate,
|
|
@@ -6393,7 +6430,7 @@ var execFile = promisify(execFileCallback);
|
|
|
6393
6430
|
// src/cursor-hooks.ts
|
|
6394
6431
|
import path from "node:path";
|
|
6395
6432
|
|
|
6396
|
-
// ../trace-contracts/dist/
|
|
6433
|
+
// ../trace-contracts/dist/contracts.js
|
|
6397
6434
|
var TRACE_EVENT_TYPES = [
|
|
6398
6435
|
"user_message",
|
|
6399
6436
|
"assistant_message",
|
|
@@ -6467,10 +6504,10 @@ var codexBillingRequestSchema = object({
|
|
|
6467
6504
|
mode: _enum(["chatgpt", "api_key", "conflicting"])
|
|
6468
6505
|
}).strict()).max(5e3)
|
|
6469
6506
|
}).strict();
|
|
6470
|
-
var UUID_PATTERN = /^[0-9a-
|
|
6507
|
+
var UUID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;
|
|
6471
6508
|
var TIMESTAMP_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
6472
6509
|
var unpairedSurrogate = /[\uD800-\uDFFF]/u;
|
|
6473
|
-
var traceIdentitySchema = string2().min(1).max(200).refine((value) => !value.includes("\0") && !unpairedSurrogate.test(value), "Trace identifiers cannot contain NUL or unpaired Unicode surrogates.");
|
|
6510
|
+
var traceIdentitySchema = string2().min(1).max(200).refine((value) => !value.includes("\0") && !unpairedSurrogate.test(value), "Trace identifiers cannot contain NUL or unpaired Unicode surrogates.").describe("Must not contain NUL or unpaired Unicode surrogates.");
|
|
6474
6511
|
var jsonValueSchema = lazy(() => union([
|
|
6475
6512
|
string2(),
|
|
6476
6513
|
number2().finite(),
|
|
@@ -6501,28 +6538,28 @@ var traceEventSchema = object({
|
|
|
6501
6538
|
sequence: number2().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
6502
6539
|
callId: string2().max(255).nullable(),
|
|
6503
6540
|
projectId: string2().regex(UUID_PATTERN).nullable(),
|
|
6504
|
-
occurredAt: string2().regex(TIMESTAMP_PATTERN).refine((value) => !Number.isNaN(Date.parse(value))).nullable(),
|
|
6541
|
+
occurredAt: string2().regex(TIMESTAMP_PATTERN).refine((value) => !Number.isNaN(Date.parse(value))).describe("Must also be a timestamp accepted by Date.parse.").nullable(),
|
|
6505
6542
|
eventType: _enum(TRACE_EVENT_TYPES),
|
|
6506
6543
|
payload: jsonPayloadSchema,
|
|
6507
6544
|
run: runMarkerSchema.optional()
|
|
6508
6545
|
}).strict();
|
|
6509
6546
|
var traceEventBatchSchema = object({
|
|
6510
6547
|
events: array(traceEventSchema).min(1).max(MAX_TRACE_EVENTS_PER_BATCH)
|
|
6511
|
-
}).strict();
|
|
6548
|
+
}).strict().describe("Event IDs must be unique within the batch.");
|
|
6512
6549
|
var acknowledgementSchema = object({
|
|
6513
6550
|
deviceId: string2().regex(UUID_PATTERN),
|
|
6514
6551
|
acceptedEventIds: array(string2())
|
|
6515
|
-
}).strict();
|
|
6552
|
+
}).strict().describe("Accepted event IDs must match the submitted batch exactly, without duplicates.");
|
|
6516
6553
|
var episodeCountSchema = number2().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
6517
|
-
var collectorFrictionSummarySchema = object({ weekEpisodes: episodeCountSchema, dayEpisodes: episodeCountSchema }).strict().refine((summary) => summary.dayEpisodes <= summary.weekEpisodes, "The last day cannot have more friction episodes than the last week.");
|
|
6554
|
+
var collectorFrictionSummarySchema = object({ weekEpisodes: episodeCountSchema, dayEpisodes: episodeCountSchema }).strict().refine((summary) => summary.dayEpisodes <= summary.weekEpisodes, "The last day cannot have more friction episodes than the last week.").describe("dayEpisodes must not exceed weekEpisodes.");
|
|
6518
6555
|
var sessionCountSchema = number2().int().min(0).max(1e6);
|
|
6519
6556
|
var collectorHistoryProgressSchema = object({
|
|
6520
6557
|
sessions: sessionCountSchema,
|
|
6521
6558
|
readSessions: sessionCountSchema,
|
|
6522
6559
|
complete: boolean2()
|
|
6523
|
-
}).strict().refine((progress) => progress.readSessions <= progress.sessions, "Read sessions cannot exceed listed sessions.").refine((progress) => !progress.complete || progress.readSessions === progress.sessions, "A complete import has read every listed session.");
|
|
6560
|
+
}).strict().refine((progress) => progress.readSessions <= progress.sessions, "Read sessions cannot exceed listed sessions.").refine((progress) => !progress.complete || progress.readSessions === progress.sessions, "A complete import has read every listed session.").describe("readSessions must not exceed sessions; complete requires equal counts.");
|
|
6524
6561
|
var collectorEnrollmentRequestSchema = object({
|
|
6525
|
-
deviceName: string2().trim().min(1).max(160),
|
|
6562
|
+
deviceName: string2().trim().min(1).max(160).describe("Trimmed before length validation."),
|
|
6526
6563
|
organizationId: string2().regex(UUID_PATTERN).optional(),
|
|
6527
6564
|
source: _enum(COLLECTOR_SOURCES).optional()
|
|
6528
6565
|
}).strict();
|
package/dist/launcher.js
CHANGED
|
@@ -5,6 +5,27 @@ var __export = (target, all) => {
|
|
|
5
5
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
+
// src/logger.ts
|
|
9
|
+
function writeLog(line, level) {
|
|
10
|
+
if (level === "info") console.info(line);
|
|
11
|
+
else console.error(line);
|
|
12
|
+
}
|
|
13
|
+
function createLogger(context, write = writeLog) {
|
|
14
|
+
return (entry) => {
|
|
15
|
+
write(
|
|
16
|
+
JSON.stringify({
|
|
17
|
+
...entry,
|
|
18
|
+
...context,
|
|
19
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
20
|
+
pid: process.pid,
|
|
21
|
+
runtimeVersion: process.env.ITERATION_RUNTIME_VERSION ?? null
|
|
22
|
+
}),
|
|
23
|
+
entry.level
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
var collectorLogger = createLogger({ component: "collector" });
|
|
28
|
+
|
|
8
29
|
// src/launcher.ts
|
|
9
30
|
import { promises as fs3 } from "node:fs";
|
|
10
31
|
import { pathToFileURL } from "node:url";
|
|
@@ -15,7 +36,7 @@ import os from "node:os";
|
|
|
15
36
|
import path2 from "node:path";
|
|
16
37
|
import { setTimeout as delay } from "node:timers/promises";
|
|
17
38
|
|
|
18
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
39
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
|
|
19
40
|
var util_exports = {};
|
|
20
41
|
__export(util_exports, {
|
|
21
42
|
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
@@ -86,6 +107,7 @@ __export(util_exports, {
|
|
|
86
107
|
required: () => required,
|
|
87
108
|
safeExtend: () => safeExtend,
|
|
88
109
|
shallowClone: () => shallowClone,
|
|
110
|
+
sizeCaps: () => sizeCaps,
|
|
89
111
|
slugify: () => slugify,
|
|
90
112
|
stringifyPrimitive: () => stringifyPrimitive,
|
|
91
113
|
toZod: () => toZod,
|
|
@@ -605,6 +627,18 @@ function prefixIssues(path3, issues) {
|
|
|
605
627
|
function unwrapMessage(message) {
|
|
606
628
|
return typeof message === "string" ? message : message?.message;
|
|
607
629
|
}
|
|
630
|
+
function sizeCaps(defChecks) {
|
|
631
|
+
const caps = [];
|
|
632
|
+
for (const ch of defChecks ?? []) {
|
|
633
|
+
const d = ch._zod.def;
|
|
634
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
635
|
+
break;
|
|
636
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
637
|
+
if (max >= 0)
|
|
638
|
+
caps.push([max, ch]);
|
|
639
|
+
}
|
|
640
|
+
return caps;
|
|
641
|
+
}
|
|
608
642
|
function attachSchema(issues, start, inst) {
|
|
609
643
|
var _a3;
|
|
610
644
|
for (let i = start; i < issues.length; i++) {
|
|
@@ -858,7 +892,7 @@ function constantCatch(value) {
|
|
|
858
892
|
return fn;
|
|
859
893
|
}
|
|
860
894
|
|
|
861
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
895
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.js
|
|
862
896
|
var _a;
|
|
863
897
|
var _zodDesc = { value: void 0, enumerable: false };
|
|
864
898
|
var _E = "captureStackTrace" in Error ? Error : null;
|
|
@@ -976,7 +1010,7 @@ function config(newConfig) {
|
|
|
976
1010
|
return globalConfig;
|
|
977
1011
|
}
|
|
978
1012
|
|
|
979
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1013
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.js
|
|
980
1014
|
function _getMessage() {
|
|
981
1015
|
const internals = this._zod;
|
|
982
1016
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1091,7 +1125,7 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
|
|
|
1091
1125
|
return fieldErrors;
|
|
1092
1126
|
}
|
|
1093
1127
|
|
|
1094
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1128
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/parse.js
|
|
1095
1129
|
function finalizeParams(callee, params) {
|
|
1096
1130
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
1097
1131
|
}
|
|
@@ -1239,7 +1273,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1239
1273
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1240
1274
|
};
|
|
1241
1275
|
|
|
1242
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1276
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/regexes.js
|
|
1243
1277
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
1244
1278
|
var cuid2 = /^[0-9a-z]+$/;
|
|
1245
1279
|
var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
@@ -1298,7 +1332,7 @@ var _null = /^null$/i;
|
|
|
1298
1332
|
var lowercase = /^[^A-Z]*$/;
|
|
1299
1333
|
var uppercase = /^[^a-z]*$/;
|
|
1300
1334
|
|
|
1301
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1335
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.js
|
|
1302
1336
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1303
1337
|
var _a3;
|
|
1304
1338
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1618,7 +1652,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1618
1652
|
};
|
|
1619
1653
|
});
|
|
1620
1654
|
|
|
1621
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1655
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/doc.js
|
|
1622
1656
|
var Doc = class {
|
|
1623
1657
|
constructor(args = [], closed = {}) {
|
|
1624
1658
|
this.content = [];
|
|
@@ -1659,14 +1693,14 @@ ${content.join("\n")}
|
|
|
1659
1693
|
}
|
|
1660
1694
|
};
|
|
1661
1695
|
|
|
1662
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1696
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.js
|
|
1663
1697
|
var version = {
|
|
1664
1698
|
major: 4,
|
|
1665
1699
|
minor: 6,
|
|
1666
|
-
patch:
|
|
1700
|
+
patch: 6
|
|
1667
1701
|
};
|
|
1668
1702
|
|
|
1669
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
1703
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.js
|
|
1670
1704
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1671
1705
|
var _a3;
|
|
1672
1706
|
inst ?? (inst = {});
|
|
@@ -2237,6 +2271,29 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
2237
2271
|
return payload;
|
|
2238
2272
|
};
|
|
2239
2273
|
});
|
|
2274
|
+
function capSize(inst, size) {
|
|
2275
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2276
|
+
if (!caps.length)
|
|
2277
|
+
return;
|
|
2278
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2279
|
+
const parse2 = inst._zod.parse;
|
|
2280
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2281
|
+
const n = size(payload.value);
|
|
2282
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2283
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
2284
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
2285
|
+
const start = payload.issues.length;
|
|
2286
|
+
ch._zod.check(payload);
|
|
2287
|
+
payload.issues[start].continue = false;
|
|
2288
|
+
attachSchema(payload.issues, start, inst);
|
|
2289
|
+
return payload;
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
return parse2(payload, ctx);
|
|
2294
|
+
};
|
|
2295
|
+
}
|
|
2296
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2240
2297
|
function handleArrayResult(result, final, index) {
|
|
2241
2298
|
if (result.issues.length) {
|
|
2242
2299
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -2280,6 +2337,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2280
2337
|
}
|
|
2281
2338
|
return payload;
|
|
2282
2339
|
};
|
|
2340
|
+
capSize(inst, arraySize);
|
|
2283
2341
|
});
|
|
2284
2342
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2285
2343
|
const isPresent = key in input;
|
|
@@ -3323,7 +3381,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3323
3381
|
}
|
|
3324
3382
|
}
|
|
3325
3383
|
|
|
3326
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3384
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/memoizer.js
|
|
3327
3385
|
var $ZodCyclicError = class extends Error {
|
|
3328
3386
|
constructor() {
|
|
3329
3387
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3597,7 +3655,7 @@ function isBackEdge(ctx, value) {
|
|
|
3597
3655
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3598
3656
|
}
|
|
3599
3657
|
|
|
3600
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3658
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/en.js
|
|
3601
3659
|
var error = () => {
|
|
3602
3660
|
const Sizable = {
|
|
3603
3661
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -3722,7 +3780,7 @@ function en_default() {
|
|
|
3722
3780
|
};
|
|
3723
3781
|
}
|
|
3724
3782
|
|
|
3725
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3783
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.js
|
|
3726
3784
|
var _a2;
|
|
3727
3785
|
var $ZodRegistry = class {
|
|
3728
3786
|
constructor() {
|
|
@@ -3770,7 +3828,7 @@ function registry() {
|
|
|
3770
3828
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
3771
3829
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3772
3830
|
|
|
3773
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
3831
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.js
|
|
3774
3832
|
function snapshotChecks(def) {
|
|
3775
3833
|
if (def.checks)
|
|
3776
3834
|
def.checks = [...def.checks];
|
|
@@ -4285,7 +4343,7 @@ function _check(fn, params) {
|
|
|
4285
4343
|
return ch;
|
|
4286
4344
|
}
|
|
4287
4345
|
|
|
4288
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
4346
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.js
|
|
4289
4347
|
function assignProps(target, ...sources) {
|
|
4290
4348
|
for (const source of sources) {
|
|
4291
4349
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -4815,7 +4873,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4815
4873
|
return finalize(ctx, schema);
|
|
4816
4874
|
};
|
|
4817
4875
|
|
|
4818
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
4876
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema-processors.js
|
|
4819
4877
|
var narrowMin = (agg, key, value) => {
|
|
4820
4878
|
if (agg[key] === void 0 || value > agg[key])
|
|
4821
4879
|
agg[key] = value;
|
|
@@ -5359,7 +5417,7 @@ var lazyProcessor = (schema, ctx, _json, params) => {
|
|
|
5359
5417
|
seen.ref = innerType;
|
|
5360
5418
|
};
|
|
5361
5419
|
|
|
5362
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
5420
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.js
|
|
5363
5421
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5364
5422
|
function _lazyMethod(proto, key, make) {
|
|
5365
5423
|
Object.defineProperty(proto, key, {
|
|
@@ -5404,7 +5462,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
|
|
|
5404
5462
|
Parent: Error
|
|
5405
5463
|
});
|
|
5406
5464
|
|
|
5407
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
5465
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.js
|
|
5408
5466
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
5409
5467
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5410
5468
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5418,7 +5476,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
5418
5476
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5419
5477
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5420
5478
|
|
|
5421
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
5479
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
|
|
5422
5480
|
function _ensureDefaultLocale() {
|
|
5423
5481
|
if (!globalConfig.localeError)
|
|
5424
5482
|
config(en_default());
|
|
@@ -6364,7 +6422,7 @@ function superRefine(fn, params) {
|
|
|
6364
6422
|
return _superRefine(fn, params);
|
|
6365
6423
|
}
|
|
6366
6424
|
|
|
6367
|
-
// ../../node_modules/.pnpm/zod@4.6.
|
|
6425
|
+
// ../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/iso.js
|
|
6368
6426
|
var iso_exports = {};
|
|
6369
6427
|
__export(iso_exports, {
|
|
6370
6428
|
ZodISODate: () => ZodISODate,
|
|
@@ -6389,7 +6447,7 @@ function duration2(params) {
|
|
|
6389
6447
|
return _isoDuration(ZodISODuration, params);
|
|
6390
6448
|
}
|
|
6391
6449
|
|
|
6392
|
-
// ../trace-contracts/dist/
|
|
6450
|
+
// ../trace-contracts/dist/contracts.js
|
|
6393
6451
|
var TRACE_EVENT_TYPES = [
|
|
6394
6452
|
"user_message",
|
|
6395
6453
|
"assistant_message",
|
|
@@ -6463,10 +6521,10 @@ var codexBillingRequestSchema = object({
|
|
|
6463
6521
|
mode: _enum(["chatgpt", "api_key", "conflicting"])
|
|
6464
6522
|
}).strict()).max(5e3)
|
|
6465
6523
|
}).strict();
|
|
6466
|
-
var UUID_PATTERN = /^[0-9a-
|
|
6524
|
+
var UUID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;
|
|
6467
6525
|
var TIMESTAMP_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
|
|
6468
6526
|
var unpairedSurrogate = /[\uD800-\uDFFF]/u;
|
|
6469
|
-
var traceIdentitySchema = string2().min(1).max(200).refine((value) => !value.includes("\0") && !unpairedSurrogate.test(value), "Trace identifiers cannot contain NUL or unpaired Unicode surrogates.");
|
|
6527
|
+
var traceIdentitySchema = string2().min(1).max(200).refine((value) => !value.includes("\0") && !unpairedSurrogate.test(value), "Trace identifiers cannot contain NUL or unpaired Unicode surrogates.").describe("Must not contain NUL or unpaired Unicode surrogates.");
|
|
6470
6528
|
var jsonValueSchema = lazy(() => union([
|
|
6471
6529
|
string2(),
|
|
6472
6530
|
number2().finite(),
|
|
@@ -6497,28 +6555,28 @@ var traceEventSchema = object({
|
|
|
6497
6555
|
sequence: number2().int().min(0).max(Number.MAX_SAFE_INTEGER),
|
|
6498
6556
|
callId: string2().max(255).nullable(),
|
|
6499
6557
|
projectId: string2().regex(UUID_PATTERN).nullable(),
|
|
6500
|
-
occurredAt: string2().regex(TIMESTAMP_PATTERN).refine((value) => !Number.isNaN(Date.parse(value))).nullable(),
|
|
6558
|
+
occurredAt: string2().regex(TIMESTAMP_PATTERN).refine((value) => !Number.isNaN(Date.parse(value))).describe("Must also be a timestamp accepted by Date.parse.").nullable(),
|
|
6501
6559
|
eventType: _enum(TRACE_EVENT_TYPES),
|
|
6502
6560
|
payload: jsonPayloadSchema,
|
|
6503
6561
|
run: runMarkerSchema.optional()
|
|
6504
6562
|
}).strict();
|
|
6505
6563
|
var traceEventBatchSchema = object({
|
|
6506
6564
|
events: array(traceEventSchema).min(1).max(MAX_TRACE_EVENTS_PER_BATCH)
|
|
6507
|
-
}).strict();
|
|
6565
|
+
}).strict().describe("Event IDs must be unique within the batch.");
|
|
6508
6566
|
var acknowledgementSchema = object({
|
|
6509
6567
|
deviceId: string2().regex(UUID_PATTERN),
|
|
6510
6568
|
acceptedEventIds: array(string2())
|
|
6511
|
-
}).strict();
|
|
6569
|
+
}).strict().describe("Accepted event IDs must match the submitted batch exactly, without duplicates.");
|
|
6512
6570
|
var episodeCountSchema = number2().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
6513
|
-
var collectorFrictionSummarySchema = object({ weekEpisodes: episodeCountSchema, dayEpisodes: episodeCountSchema }).strict().refine((summary) => summary.dayEpisodes <= summary.weekEpisodes, "The last day cannot have more friction episodes than the last week.");
|
|
6571
|
+
var collectorFrictionSummarySchema = object({ weekEpisodes: episodeCountSchema, dayEpisodes: episodeCountSchema }).strict().refine((summary) => summary.dayEpisodes <= summary.weekEpisodes, "The last day cannot have more friction episodes than the last week.").describe("dayEpisodes must not exceed weekEpisodes.");
|
|
6514
6572
|
var sessionCountSchema = number2().int().min(0).max(1e6);
|
|
6515
6573
|
var collectorHistoryProgressSchema = object({
|
|
6516
6574
|
sessions: sessionCountSchema,
|
|
6517
6575
|
readSessions: sessionCountSchema,
|
|
6518
6576
|
complete: boolean2()
|
|
6519
|
-
}).strict().refine((progress) => progress.readSessions <= progress.sessions, "Read sessions cannot exceed listed sessions.").refine((progress) => !progress.complete || progress.readSessions === progress.sessions, "A complete import has read every listed session.");
|
|
6577
|
+
}).strict().refine((progress) => progress.readSessions <= progress.sessions, "Read sessions cannot exceed listed sessions.").refine((progress) => !progress.complete || progress.readSessions === progress.sessions, "A complete import has read every listed session.").describe("readSessions must not exceed sessions; complete requires equal counts.");
|
|
6520
6578
|
var collectorEnrollmentRequestSchema = object({
|
|
6521
|
-
deviceName: string2().trim().min(1).max(160),
|
|
6579
|
+
deviceName: string2().trim().min(1).max(160).describe("Trimmed before length validation."),
|
|
6522
6580
|
organizationId: string2().regex(UUID_PATTERN).optional(),
|
|
6523
6581
|
source: _enum(COLLECTOR_SOURCES).optional()
|
|
6524
6582
|
}).strict();
|
|
@@ -6895,15 +6953,12 @@ async function launch() {
|
|
|
6895
6953
|
if (decision.state !== null)
|
|
6896
6954
|
await writeRuntimeState(paths, decision.state);
|
|
6897
6955
|
if (decision.rolledBack !== null) {
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
to: decision.rolledBack.to
|
|
6905
|
-
})
|
|
6906
|
-
);
|
|
6956
|
+
collectorLogger({
|
|
6957
|
+
level: "error",
|
|
6958
|
+
operation: "runtime_rollback",
|
|
6959
|
+
from: decision.rolledBack.from,
|
|
6960
|
+
to: decision.rolledBack.to
|
|
6961
|
+
});
|
|
6907
6962
|
}
|
|
6908
6963
|
return decision.version;
|
|
6909
6964
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iteration-cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@secretlint/profiler": "13.0.6",
|
|
22
22
|
"@secretlint/secretlint-rule-preset-recommend": "13.0.6",
|
|
23
23
|
"esbuild": "0.28.2",
|
|
24
|
-
"zod": "4.6.
|
|
24
|
+
"zod": "4.6.6",
|
|
25
25
|
"iteration-trace-contracts": "0.11.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|