@cleocode/adapters 2026.4.143 → 2026.4.145
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/index.js +92 -73
- package/dist/index.js.map +4 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1184,6 +1184,24 @@ var init_task_evidence = __esm({
|
|
|
1184
1184
|
}
|
|
1185
1185
|
});
|
|
1186
1186
|
|
|
1187
|
+
// packages/contracts/src/tasks/archive.ts
|
|
1188
|
+
import { z as z6 } from "zod";
|
|
1189
|
+
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
1190
|
+
var init_archive = __esm({
|
|
1191
|
+
"packages/contracts/src/tasks/archive.ts"() {
|
|
1192
|
+
"use strict";
|
|
1193
|
+
ArchiveReason = z6.enum([
|
|
1194
|
+
"verified",
|
|
1195
|
+
"reconciled",
|
|
1196
|
+
"superseded",
|
|
1197
|
+
"shadowed",
|
|
1198
|
+
"cancelled",
|
|
1199
|
+
"completed-unverified"
|
|
1200
|
+
]);
|
|
1201
|
+
ARCHIVE_REASON_VALUES = ArchiveReason.options;
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1187
1205
|
// packages/contracts/src/index.ts
|
|
1188
1206
|
var init_src = __esm({
|
|
1189
1207
|
"packages/contracts/src/index.ts"() {
|
|
@@ -1202,6 +1220,7 @@ var init_src = __esm({
|
|
|
1202
1220
|
init_session_journal();
|
|
1203
1221
|
init_status_registry();
|
|
1204
1222
|
init_task_evidence();
|
|
1223
|
+
init_archive();
|
|
1205
1224
|
}
|
|
1206
1225
|
});
|
|
1207
1226
|
|
|
@@ -15188,7 +15207,7 @@ function resolveRef(ref, ctx) {
|
|
|
15188
15207
|
function convertBaseSchema(schema, ctx) {
|
|
15189
15208
|
if (schema.not !== void 0) {
|
|
15190
15209
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
15191
|
-
return
|
|
15210
|
+
return z7.never();
|
|
15192
15211
|
}
|
|
15193
15212
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
15194
15213
|
}
|
|
@@ -15210,7 +15229,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15210
15229
|
return ctx.refs.get(refPath);
|
|
15211
15230
|
}
|
|
15212
15231
|
if (ctx.processing.has(refPath)) {
|
|
15213
|
-
return
|
|
15232
|
+
return z7.lazy(() => {
|
|
15214
15233
|
if (!ctx.refs.has(refPath)) {
|
|
15215
15234
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
15216
15235
|
}
|
|
@@ -15227,25 +15246,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15227
15246
|
if (schema.enum !== void 0) {
|
|
15228
15247
|
const enumValues = schema.enum;
|
|
15229
15248
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
15230
|
-
return
|
|
15249
|
+
return z7.null();
|
|
15231
15250
|
}
|
|
15232
15251
|
if (enumValues.length === 0) {
|
|
15233
|
-
return
|
|
15252
|
+
return z7.never();
|
|
15234
15253
|
}
|
|
15235
15254
|
if (enumValues.length === 1) {
|
|
15236
|
-
return
|
|
15255
|
+
return z7.literal(enumValues[0]);
|
|
15237
15256
|
}
|
|
15238
15257
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
15239
|
-
return
|
|
15258
|
+
return z7.enum(enumValues);
|
|
15240
15259
|
}
|
|
15241
|
-
const literalSchemas = enumValues.map((v) =>
|
|
15260
|
+
const literalSchemas = enumValues.map((v) => z7.literal(v));
|
|
15242
15261
|
if (literalSchemas.length < 2) {
|
|
15243
15262
|
return literalSchemas[0];
|
|
15244
15263
|
}
|
|
15245
|
-
return
|
|
15264
|
+
return z7.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
15246
15265
|
}
|
|
15247
15266
|
if (schema.const !== void 0) {
|
|
15248
|
-
return
|
|
15267
|
+
return z7.literal(schema.const);
|
|
15249
15268
|
}
|
|
15250
15269
|
const type = schema.type;
|
|
15251
15270
|
if (Array.isArray(type)) {
|
|
@@ -15254,68 +15273,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15254
15273
|
return convertBaseSchema(typeSchema, ctx);
|
|
15255
15274
|
});
|
|
15256
15275
|
if (typeSchemas.length === 0) {
|
|
15257
|
-
return
|
|
15276
|
+
return z7.never();
|
|
15258
15277
|
}
|
|
15259
15278
|
if (typeSchemas.length === 1) {
|
|
15260
15279
|
return typeSchemas[0];
|
|
15261
15280
|
}
|
|
15262
|
-
return
|
|
15281
|
+
return z7.union(typeSchemas);
|
|
15263
15282
|
}
|
|
15264
15283
|
if (!type) {
|
|
15265
|
-
return
|
|
15284
|
+
return z7.any();
|
|
15266
15285
|
}
|
|
15267
15286
|
let zodSchema2;
|
|
15268
15287
|
switch (type) {
|
|
15269
15288
|
case "string": {
|
|
15270
|
-
let stringSchema =
|
|
15289
|
+
let stringSchema = z7.string();
|
|
15271
15290
|
if (schema.format) {
|
|
15272
15291
|
const format = schema.format;
|
|
15273
15292
|
if (format === "email") {
|
|
15274
|
-
stringSchema = stringSchema.check(
|
|
15293
|
+
stringSchema = stringSchema.check(z7.email());
|
|
15275
15294
|
} else if (format === "uri" || format === "uri-reference") {
|
|
15276
|
-
stringSchema = stringSchema.check(
|
|
15295
|
+
stringSchema = stringSchema.check(z7.url());
|
|
15277
15296
|
} else if (format === "uuid" || format === "guid") {
|
|
15278
|
-
stringSchema = stringSchema.check(
|
|
15297
|
+
stringSchema = stringSchema.check(z7.uuid());
|
|
15279
15298
|
} else if (format === "date-time") {
|
|
15280
|
-
stringSchema = stringSchema.check(
|
|
15299
|
+
stringSchema = stringSchema.check(z7.iso.datetime());
|
|
15281
15300
|
} else if (format === "date") {
|
|
15282
|
-
stringSchema = stringSchema.check(
|
|
15301
|
+
stringSchema = stringSchema.check(z7.iso.date());
|
|
15283
15302
|
} else if (format === "time") {
|
|
15284
|
-
stringSchema = stringSchema.check(
|
|
15303
|
+
stringSchema = stringSchema.check(z7.iso.time());
|
|
15285
15304
|
} else if (format === "duration") {
|
|
15286
|
-
stringSchema = stringSchema.check(
|
|
15305
|
+
stringSchema = stringSchema.check(z7.iso.duration());
|
|
15287
15306
|
} else if (format === "ipv4") {
|
|
15288
|
-
stringSchema = stringSchema.check(
|
|
15307
|
+
stringSchema = stringSchema.check(z7.ipv4());
|
|
15289
15308
|
} else if (format === "ipv6") {
|
|
15290
|
-
stringSchema = stringSchema.check(
|
|
15309
|
+
stringSchema = stringSchema.check(z7.ipv6());
|
|
15291
15310
|
} else if (format === "mac") {
|
|
15292
|
-
stringSchema = stringSchema.check(
|
|
15311
|
+
stringSchema = stringSchema.check(z7.mac());
|
|
15293
15312
|
} else if (format === "cidr") {
|
|
15294
|
-
stringSchema = stringSchema.check(
|
|
15313
|
+
stringSchema = stringSchema.check(z7.cidrv4());
|
|
15295
15314
|
} else if (format === "cidr-v6") {
|
|
15296
|
-
stringSchema = stringSchema.check(
|
|
15315
|
+
stringSchema = stringSchema.check(z7.cidrv6());
|
|
15297
15316
|
} else if (format === "base64") {
|
|
15298
|
-
stringSchema = stringSchema.check(
|
|
15317
|
+
stringSchema = stringSchema.check(z7.base64());
|
|
15299
15318
|
} else if (format === "base64url") {
|
|
15300
|
-
stringSchema = stringSchema.check(
|
|
15319
|
+
stringSchema = stringSchema.check(z7.base64url());
|
|
15301
15320
|
} else if (format === "e164") {
|
|
15302
|
-
stringSchema = stringSchema.check(
|
|
15321
|
+
stringSchema = stringSchema.check(z7.e164());
|
|
15303
15322
|
} else if (format === "jwt") {
|
|
15304
|
-
stringSchema = stringSchema.check(
|
|
15323
|
+
stringSchema = stringSchema.check(z7.jwt());
|
|
15305
15324
|
} else if (format === "emoji") {
|
|
15306
|
-
stringSchema = stringSchema.check(
|
|
15325
|
+
stringSchema = stringSchema.check(z7.emoji());
|
|
15307
15326
|
} else if (format === "nanoid") {
|
|
15308
|
-
stringSchema = stringSchema.check(
|
|
15327
|
+
stringSchema = stringSchema.check(z7.nanoid());
|
|
15309
15328
|
} else if (format === "cuid") {
|
|
15310
|
-
stringSchema = stringSchema.check(
|
|
15329
|
+
stringSchema = stringSchema.check(z7.cuid());
|
|
15311
15330
|
} else if (format === "cuid2") {
|
|
15312
|
-
stringSchema = stringSchema.check(
|
|
15331
|
+
stringSchema = stringSchema.check(z7.cuid2());
|
|
15313
15332
|
} else if (format === "ulid") {
|
|
15314
|
-
stringSchema = stringSchema.check(
|
|
15333
|
+
stringSchema = stringSchema.check(z7.ulid());
|
|
15315
15334
|
} else if (format === "xid") {
|
|
15316
|
-
stringSchema = stringSchema.check(
|
|
15335
|
+
stringSchema = stringSchema.check(z7.xid());
|
|
15317
15336
|
} else if (format === "ksuid") {
|
|
15318
|
-
stringSchema = stringSchema.check(
|
|
15337
|
+
stringSchema = stringSchema.check(z7.ksuid());
|
|
15319
15338
|
}
|
|
15320
15339
|
}
|
|
15321
15340
|
if (typeof schema.minLength === "number") {
|
|
@@ -15332,7 +15351,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15332
15351
|
}
|
|
15333
15352
|
case "number":
|
|
15334
15353
|
case "integer": {
|
|
15335
|
-
let numberSchema = type === "integer" ?
|
|
15354
|
+
let numberSchema = type === "integer" ? z7.number().int() : z7.number();
|
|
15336
15355
|
if (typeof schema.minimum === "number") {
|
|
15337
15356
|
numberSchema = numberSchema.min(schema.minimum);
|
|
15338
15357
|
}
|
|
@@ -15356,11 +15375,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15356
15375
|
break;
|
|
15357
15376
|
}
|
|
15358
15377
|
case "boolean": {
|
|
15359
|
-
zodSchema2 =
|
|
15378
|
+
zodSchema2 = z7.boolean();
|
|
15360
15379
|
break;
|
|
15361
15380
|
}
|
|
15362
15381
|
case "null": {
|
|
15363
|
-
zodSchema2 =
|
|
15382
|
+
zodSchema2 = z7.null();
|
|
15364
15383
|
break;
|
|
15365
15384
|
}
|
|
15366
15385
|
case "object": {
|
|
@@ -15373,14 +15392,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15373
15392
|
}
|
|
15374
15393
|
if (schema.propertyNames) {
|
|
15375
15394
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
15376
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
15395
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z7.any();
|
|
15377
15396
|
if (Object.keys(shape).length === 0) {
|
|
15378
|
-
zodSchema2 =
|
|
15397
|
+
zodSchema2 = z7.record(keySchema, valueSchema);
|
|
15379
15398
|
break;
|
|
15380
15399
|
}
|
|
15381
|
-
const objectSchema2 =
|
|
15382
|
-
const recordSchema =
|
|
15383
|
-
zodSchema2 =
|
|
15400
|
+
const objectSchema2 = z7.object(shape).passthrough();
|
|
15401
|
+
const recordSchema = z7.looseRecord(keySchema, valueSchema);
|
|
15402
|
+
zodSchema2 = z7.intersection(objectSchema2, recordSchema);
|
|
15384
15403
|
break;
|
|
15385
15404
|
}
|
|
15386
15405
|
if (schema.patternProperties) {
|
|
@@ -15389,28 +15408,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15389
15408
|
const looseRecords = [];
|
|
15390
15409
|
for (const pattern of patternKeys) {
|
|
15391
15410
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
15392
|
-
const keySchema =
|
|
15393
|
-
looseRecords.push(
|
|
15411
|
+
const keySchema = z7.string().regex(new RegExp(pattern));
|
|
15412
|
+
looseRecords.push(z7.looseRecord(keySchema, patternValue));
|
|
15394
15413
|
}
|
|
15395
15414
|
const schemasToIntersect = [];
|
|
15396
15415
|
if (Object.keys(shape).length > 0) {
|
|
15397
|
-
schemasToIntersect.push(
|
|
15416
|
+
schemasToIntersect.push(z7.object(shape).passthrough());
|
|
15398
15417
|
}
|
|
15399
15418
|
schemasToIntersect.push(...looseRecords);
|
|
15400
15419
|
if (schemasToIntersect.length === 0) {
|
|
15401
|
-
zodSchema2 =
|
|
15420
|
+
zodSchema2 = z7.object({}).passthrough();
|
|
15402
15421
|
} else if (schemasToIntersect.length === 1) {
|
|
15403
15422
|
zodSchema2 = schemasToIntersect[0];
|
|
15404
15423
|
} else {
|
|
15405
|
-
let result =
|
|
15424
|
+
let result = z7.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
15406
15425
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
15407
|
-
result =
|
|
15426
|
+
result = z7.intersection(result, schemasToIntersect[i]);
|
|
15408
15427
|
}
|
|
15409
15428
|
zodSchema2 = result;
|
|
15410
15429
|
}
|
|
15411
15430
|
break;
|
|
15412
15431
|
}
|
|
15413
|
-
const objectSchema =
|
|
15432
|
+
const objectSchema = z7.object(shape);
|
|
15414
15433
|
if (schema.additionalProperties === false) {
|
|
15415
15434
|
zodSchema2 = objectSchema.strict();
|
|
15416
15435
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -15427,33 +15446,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15427
15446
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
15428
15447
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
15429
15448
|
if (rest) {
|
|
15430
|
-
zodSchema2 =
|
|
15449
|
+
zodSchema2 = z7.tuple(tupleItems).rest(rest);
|
|
15431
15450
|
} else {
|
|
15432
|
-
zodSchema2 =
|
|
15451
|
+
zodSchema2 = z7.tuple(tupleItems);
|
|
15433
15452
|
}
|
|
15434
15453
|
if (typeof schema.minItems === "number") {
|
|
15435
|
-
zodSchema2 = zodSchema2.check(
|
|
15454
|
+
zodSchema2 = zodSchema2.check(z7.minLength(schema.minItems));
|
|
15436
15455
|
}
|
|
15437
15456
|
if (typeof schema.maxItems === "number") {
|
|
15438
|
-
zodSchema2 = zodSchema2.check(
|
|
15457
|
+
zodSchema2 = zodSchema2.check(z7.maxLength(schema.maxItems));
|
|
15439
15458
|
}
|
|
15440
15459
|
} else if (Array.isArray(items)) {
|
|
15441
15460
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
15442
15461
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
15443
15462
|
if (rest) {
|
|
15444
|
-
zodSchema2 =
|
|
15463
|
+
zodSchema2 = z7.tuple(tupleItems).rest(rest);
|
|
15445
15464
|
} else {
|
|
15446
|
-
zodSchema2 =
|
|
15465
|
+
zodSchema2 = z7.tuple(tupleItems);
|
|
15447
15466
|
}
|
|
15448
15467
|
if (typeof schema.minItems === "number") {
|
|
15449
|
-
zodSchema2 = zodSchema2.check(
|
|
15468
|
+
zodSchema2 = zodSchema2.check(z7.minLength(schema.minItems));
|
|
15450
15469
|
}
|
|
15451
15470
|
if (typeof schema.maxItems === "number") {
|
|
15452
|
-
zodSchema2 = zodSchema2.check(
|
|
15471
|
+
zodSchema2 = zodSchema2.check(z7.maxLength(schema.maxItems));
|
|
15453
15472
|
}
|
|
15454
15473
|
} else if (items !== void 0) {
|
|
15455
15474
|
const element = convertSchema(items, ctx);
|
|
15456
|
-
let arraySchema =
|
|
15475
|
+
let arraySchema = z7.array(element);
|
|
15457
15476
|
if (typeof schema.minItems === "number") {
|
|
15458
15477
|
arraySchema = arraySchema.min(schema.minItems);
|
|
15459
15478
|
}
|
|
@@ -15462,7 +15481,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15462
15481
|
}
|
|
15463
15482
|
zodSchema2 = arraySchema;
|
|
15464
15483
|
} else {
|
|
15465
|
-
zodSchema2 =
|
|
15484
|
+
zodSchema2 = z7.array(z7.any());
|
|
15466
15485
|
}
|
|
15467
15486
|
break;
|
|
15468
15487
|
}
|
|
@@ -15479,37 +15498,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15479
15498
|
}
|
|
15480
15499
|
function convertSchema(schema, ctx) {
|
|
15481
15500
|
if (typeof schema === "boolean") {
|
|
15482
|
-
return schema ?
|
|
15501
|
+
return schema ? z7.any() : z7.never();
|
|
15483
15502
|
}
|
|
15484
15503
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
15485
15504
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
15486
15505
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
15487
15506
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
15488
|
-
const anyOfUnion =
|
|
15489
|
-
baseSchema = hasExplicitType ?
|
|
15507
|
+
const anyOfUnion = z7.union(options);
|
|
15508
|
+
baseSchema = hasExplicitType ? z7.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
15490
15509
|
}
|
|
15491
15510
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
15492
15511
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
15493
|
-
const oneOfUnion =
|
|
15494
|
-
baseSchema = hasExplicitType ?
|
|
15512
|
+
const oneOfUnion = z7.xor(options);
|
|
15513
|
+
baseSchema = hasExplicitType ? z7.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
15495
15514
|
}
|
|
15496
15515
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
15497
15516
|
if (schema.allOf.length === 0) {
|
|
15498
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
15517
|
+
baseSchema = hasExplicitType ? baseSchema : z7.any();
|
|
15499
15518
|
} else {
|
|
15500
15519
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
15501
15520
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
15502
15521
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
15503
|
-
result =
|
|
15522
|
+
result = z7.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
15504
15523
|
}
|
|
15505
15524
|
baseSchema = result;
|
|
15506
15525
|
}
|
|
15507
15526
|
}
|
|
15508
15527
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
15509
|
-
baseSchema =
|
|
15528
|
+
baseSchema = z7.nullable(baseSchema);
|
|
15510
15529
|
}
|
|
15511
15530
|
if (schema.readOnly === true) {
|
|
15512
|
-
baseSchema =
|
|
15531
|
+
baseSchema = z7.readonly(baseSchema);
|
|
15513
15532
|
}
|
|
15514
15533
|
const extraMeta = {};
|
|
15515
15534
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -15536,7 +15555,7 @@ function convertSchema(schema, ctx) {
|
|
|
15536
15555
|
}
|
|
15537
15556
|
function fromJSONSchema(schema, params) {
|
|
15538
15557
|
if (typeof schema === "boolean") {
|
|
15539
|
-
return schema ?
|
|
15558
|
+
return schema ? z7.any() : z7.never();
|
|
15540
15559
|
}
|
|
15541
15560
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
15542
15561
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -15550,14 +15569,14 @@ function fromJSONSchema(schema, params) {
|
|
|
15550
15569
|
};
|
|
15551
15570
|
return convertSchema(schema, ctx);
|
|
15552
15571
|
}
|
|
15553
|
-
var
|
|
15572
|
+
var z7, RECOGNIZED_KEYS;
|
|
15554
15573
|
var init_from_json_schema = __esm({
|
|
15555
15574
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
15556
15575
|
init_registries();
|
|
15557
15576
|
init_checks2();
|
|
15558
15577
|
init_iso();
|
|
15559
15578
|
init_schemas2();
|
|
15560
|
-
|
|
15579
|
+
z7 = {
|
|
15561
15580
|
...schemas_exports2,
|
|
15562
15581
|
...checks_exports2,
|
|
15563
15582
|
iso: iso_exports
|