@cleocode/adapters 2026.9.25 → 2026.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +279 -74
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2339,7 +2339,7 @@ var init_output_contracts_data = __esm({
|
|
|
2339
2339
|
// T12503: the optimistic-concurrency version agents pass to --if-match.
|
|
2340
2340
|
updatedAt: {
|
|
2341
2341
|
type: ["string", "null"],
|
|
2342
|
-
description: "Task version for optimistic concurrency: pass it to `cleo update|complete --if-match`."
|
|
2342
|
+
description: "Task version for optimistic concurrency: pass it to `cleo update|complete --if-match`. A stale version fails with E_CONFLICT (23); E_TASK_RENAMED (26) when sync re-numbered the task you read (details.expected is its new id)."
|
|
2343
2343
|
},
|
|
2344
2344
|
// T12502: the human assignee and the agent claim lease are separate.
|
|
2345
2345
|
assignee: {
|
|
@@ -17669,6 +17669,210 @@ var init_nexus_account = __esm({
|
|
|
17669
17669
|
}
|
|
17670
17670
|
});
|
|
17671
17671
|
|
|
17672
|
+
// packages/contracts/src/nexus-cloud.ts
|
|
17673
|
+
import { z as z26 } from "zod";
|
|
17674
|
+
var NEXUS_DEVICE_STATES, NEXUS_CLOUD_PROFILES, NEXUS_DEVICE_STATE_UNKNOWN, isoTime, profile, deviceState, nexusCloudCredentialSchema, nexusCloudDeviceSchema, nexusCloudOrganizationSchema, nexusCloudUserSchema, nexusCloudWhoamiSchema, nexusCloudDevicePageSchema, nexusCloudPresenceSchema, nexusCloudReplicaSchema, nexusCloudDeviceCountsSchema, projectFields, nexusCloudProjectListItemSchema, nexusCloudProjectPageSchema, nexusCloudProjectDetailSchema, nexusCloudReplicaPageSchema, NEXUS_STATUS_CHECK_IDS, NEXUS_STATUS_VERDICTS, CLOUD_STATUS_VERDICTS, knownCheckId, nexusCloudStatusCheckSchema, nexusCloudStatusSchema;
|
|
17675
|
+
var init_nexus_cloud = __esm({
|
|
17676
|
+
"packages/contracts/src/nexus-cloud.ts"() {
|
|
17677
|
+
"use strict";
|
|
17678
|
+
NEXUS_DEVICE_STATES = ["active", "signed-out", "revoked"];
|
|
17679
|
+
NEXUS_CLOUD_PROFILES = ["device", "read-only"];
|
|
17680
|
+
NEXUS_DEVICE_STATE_UNKNOWN = "unknown";
|
|
17681
|
+
isoTime = z26.iso.datetime({ offset: true });
|
|
17682
|
+
profile = z26.enum(NEXUS_CLOUD_PROFILES).nullable().catch(null);
|
|
17683
|
+
deviceState = z26.enum([...NEXUS_DEVICE_STATES, NEXUS_DEVICE_STATE_UNKNOWN]).catch(NEXUS_DEVICE_STATE_UNKNOWN);
|
|
17684
|
+
nexusCloudCredentialSchema = z26.object({
|
|
17685
|
+
kind: z26.enum(["device", "session"]),
|
|
17686
|
+
credentialId: z26.string().nullable().optional(),
|
|
17687
|
+
profile: profile.optional(),
|
|
17688
|
+
scopes: z26.array(z26.string()).default([]),
|
|
17689
|
+
createdAt: isoTime.nullable().optional(),
|
|
17690
|
+
lastUsedAt: isoTime.nullable().optional(),
|
|
17691
|
+
/** When the credential expires if it is not used again; null for sessions. */
|
|
17692
|
+
idleExpiresAt: isoTime.nullable().optional()
|
|
17693
|
+
});
|
|
17694
|
+
nexusCloudDeviceSchema = z26.object({
|
|
17695
|
+
deviceId: z26.string(),
|
|
17696
|
+
name: z26.string(),
|
|
17697
|
+
platform: z26.string().optional(),
|
|
17698
|
+
arch: z26.string().nullable().optional(),
|
|
17699
|
+
cliVersion: z26.string().nullable().optional(),
|
|
17700
|
+
createdAt: isoTime.optional(),
|
|
17701
|
+
lastSeenAt: isoTime.nullable().optional(),
|
|
17702
|
+
state: deviceState,
|
|
17703
|
+
signedOutAt: isoTime.nullable().optional(),
|
|
17704
|
+
/** Base64 device certificate; null until the device holds a key grant. */
|
|
17705
|
+
certificate: z26.string().nullable().optional(),
|
|
17706
|
+
/** The current credential's profile, or null with none (signed out or revoked). */
|
|
17707
|
+
profile: profile.optional(),
|
|
17708
|
+
/** True for the device whose credential made this request. */
|
|
17709
|
+
current: z26.boolean().default(false),
|
|
17710
|
+
projects: z26.number().int().nonnegative().optional(),
|
|
17711
|
+
replicas: z26.number().int().nonnegative().optional(),
|
|
17712
|
+
lastSyncAt: isoTime.nullable().optional(),
|
|
17713
|
+
lastPresenceAt: isoTime.nullable().optional()
|
|
17714
|
+
});
|
|
17715
|
+
nexusCloudOrganizationSchema = z26.object({
|
|
17716
|
+
id: z26.string(),
|
|
17717
|
+
name: z26.string(),
|
|
17718
|
+
slug: z26.string().nullable().optional(),
|
|
17719
|
+
role: z26.string().optional(),
|
|
17720
|
+
personal: z26.boolean().optional()
|
|
17721
|
+
});
|
|
17722
|
+
nexusCloudUserSchema = z26.object({
|
|
17723
|
+
id: z26.string(),
|
|
17724
|
+
email: z26.string(),
|
|
17725
|
+
name: z26.string().nullable().optional()
|
|
17726
|
+
});
|
|
17727
|
+
nexusCloudWhoamiSchema = z26.object({
|
|
17728
|
+
serverTime: isoTime.optional(),
|
|
17729
|
+
user: nexusCloudUserSchema,
|
|
17730
|
+
organizations: z26.array(nexusCloudOrganizationSchema).default([]),
|
|
17731
|
+
credential: nexusCloudCredentialSchema,
|
|
17732
|
+
/** The calling device; null for a session caller. */
|
|
17733
|
+
device: nexusCloudDeviceSchema.nullable()
|
|
17734
|
+
});
|
|
17735
|
+
nexusCloudDevicePageSchema = z26.object({
|
|
17736
|
+
devices: z26.array(nexusCloudDeviceSchema),
|
|
17737
|
+
nextCursor: z26.string().max(512).nullable().default(null),
|
|
17738
|
+
truncated: z26.boolean().default(false)
|
|
17739
|
+
});
|
|
17740
|
+
nexusCloudPresenceSchema = z26.looseObject({
|
|
17741
|
+
observedAt: isoTime.optional(),
|
|
17742
|
+
sync: z26.object({ enabled: z26.boolean() }).optional()
|
|
17743
|
+
});
|
|
17744
|
+
nexusCloudReplicaSchema = z26.object({
|
|
17745
|
+
projectId: z26.string(),
|
|
17746
|
+
replicaId: z26.string(),
|
|
17747
|
+
deviceId: z26.string(),
|
|
17748
|
+
deviceName: z26.string(),
|
|
17749
|
+
deviceState: deviceState.optional(),
|
|
17750
|
+
attachedAt: isoTime.optional(),
|
|
17751
|
+
lastSyncAt: isoTime.nullable(),
|
|
17752
|
+
presence: nexusCloudPresenceSchema.nullable(),
|
|
17753
|
+
presenceAt: isoTime.nullable()
|
|
17754
|
+
});
|
|
17755
|
+
nexusCloudDeviceCountsSchema = z26.object({
|
|
17756
|
+
active: z26.number().int().nonnegative(),
|
|
17757
|
+
total: z26.number().int().nonnegative()
|
|
17758
|
+
});
|
|
17759
|
+
projectFields = {
|
|
17760
|
+
projectId: z26.string(),
|
|
17761
|
+
label: z26.string().nullable(),
|
|
17762
|
+
organizationId: z26.string(),
|
|
17763
|
+
organizationName: z26.string().optional(),
|
|
17764
|
+
remoteUrl: z26.string().nullable().optional(),
|
|
17765
|
+
createdAt: isoTime.optional()
|
|
17766
|
+
};
|
|
17767
|
+
nexusCloudProjectListItemSchema = z26.object({
|
|
17768
|
+
...projectFields,
|
|
17769
|
+
role: z26.string(),
|
|
17770
|
+
streamId: z26.string().optional(),
|
|
17771
|
+
headSeq: z26.number().int().nonnegative().nullable().optional(),
|
|
17772
|
+
openConflicts: z26.number().int().nonnegative().optional(),
|
|
17773
|
+
replicas: z26.array(nexusCloudReplicaSchema).default([]),
|
|
17774
|
+
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
17775
|
+
replicaCount: z26.number().int().nonnegative().optional(),
|
|
17776
|
+
lastSyncAt: isoTime.nullable().optional(),
|
|
17777
|
+
lastPresenceAt: isoTime.nullable().optional(),
|
|
17778
|
+
/** This project's replica list was cut at 50 (T12858). */
|
|
17779
|
+
replicasTruncated: z26.boolean().default(false)
|
|
17780
|
+
});
|
|
17781
|
+
nexusCloudProjectPageSchema = z26.object({
|
|
17782
|
+
projects: z26.array(nexusCloudProjectListItemSchema),
|
|
17783
|
+
nextCursor: z26.string().max(512).nullable().default(null),
|
|
17784
|
+
/** Anything in the page was cut (the project list or a replica list). */
|
|
17785
|
+
truncated: z26.boolean().default(false),
|
|
17786
|
+
/** The project list itself was cut at 1000 (T12858). */
|
|
17787
|
+
projectsTruncated: z26.boolean().default(false)
|
|
17788
|
+
});
|
|
17789
|
+
nexusCloudProjectDetailSchema = z26.object({
|
|
17790
|
+
project: z26.object({ ...projectFields, deletedAt: isoTime.nullable().optional() }),
|
|
17791
|
+
role: z26.string(),
|
|
17792
|
+
canTrash: z26.boolean().optional(),
|
|
17793
|
+
openConflicts: z26.number().int().nonnegative(),
|
|
17794
|
+
/** At most 50, oldest attachment first. */
|
|
17795
|
+
replicas: z26.array(nexusCloudReplicaSchema),
|
|
17796
|
+
devices: nexusCloudDeviceCountsSchema,
|
|
17797
|
+
replicaCount: z26.number().int().nonnegative().optional(),
|
|
17798
|
+
lastSyncAt: isoTime.nullable().optional(),
|
|
17799
|
+
/** `replicas` was cut at 50. */
|
|
17800
|
+
truncated: z26.boolean().default(false),
|
|
17801
|
+
stream: z26.object({
|
|
17802
|
+
streamId: z26.string(),
|
|
17803
|
+
headSeq: z26.number().int().nonnegative(),
|
|
17804
|
+
headCheckpointId: z26.string().nullable()
|
|
17805
|
+
}).nullable()
|
|
17806
|
+
});
|
|
17807
|
+
nexusCloudReplicaPageSchema = z26.object({
|
|
17808
|
+
replicas: z26.array(nexusCloudReplicaSchema),
|
|
17809
|
+
devices: nexusCloudDeviceCountsSchema.optional(),
|
|
17810
|
+
nextCursor: z26.string().max(512).nullable().default(null),
|
|
17811
|
+
truncated: z26.boolean().default(false)
|
|
17812
|
+
});
|
|
17813
|
+
NEXUS_STATUS_CHECK_IDS = [
|
|
17814
|
+
"credential.valid",
|
|
17815
|
+
"device.registered",
|
|
17816
|
+
"device.active",
|
|
17817
|
+
"device.certified",
|
|
17818
|
+
"project.registered",
|
|
17819
|
+
"project.writable",
|
|
17820
|
+
"replica.attached",
|
|
17821
|
+
"presence.fresh",
|
|
17822
|
+
"replica.synced",
|
|
17823
|
+
"conflicts.none"
|
|
17824
|
+
];
|
|
17825
|
+
NEXUS_STATUS_VERDICTS = ["ok", "attention", "not-linked", "not-registered"];
|
|
17826
|
+
CLOUD_STATUS_VERDICTS = [...NEXUS_STATUS_VERDICTS, "not-signed-in"];
|
|
17827
|
+
knownCheckId = z26.enum(NEXUS_STATUS_CHECK_IDS);
|
|
17828
|
+
nexusCloudStatusCheckSchema = z26.object({
|
|
17829
|
+
id: z26.enum(NEXUS_STATUS_CHECK_IDS),
|
|
17830
|
+
ok: z26.boolean(),
|
|
17831
|
+
required: z26.boolean(),
|
|
17832
|
+
detail: z26.string()
|
|
17833
|
+
});
|
|
17834
|
+
nexusCloudStatusSchema = z26.object({
|
|
17835
|
+
serverTime: isoTime.optional(),
|
|
17836
|
+
apiVersion: z26.string().optional(),
|
|
17837
|
+
user: nexusCloudUserSchema,
|
|
17838
|
+
credential: nexusCloudCredentialSchema,
|
|
17839
|
+
device: nexusCloudDeviceSchema.nullable(),
|
|
17840
|
+
project: z26.object({
|
|
17841
|
+
projectId: z26.string(),
|
|
17842
|
+
registered: z26.boolean(),
|
|
17843
|
+
organizationId: z26.string().nullable(),
|
|
17844
|
+
organizationName: z26.string().nullable(),
|
|
17845
|
+
role: z26.string().nullable()
|
|
17846
|
+
}).nullable(),
|
|
17847
|
+
replica: z26.object({
|
|
17848
|
+
replicaId: z26.string(),
|
|
17849
|
+
attached: z26.boolean(),
|
|
17850
|
+
attachedElsewhere: z26.boolean(),
|
|
17851
|
+
attachedAt: isoTime.nullable(),
|
|
17852
|
+
lastSyncAt: isoTime.nullable(),
|
|
17853
|
+
presenceAt: isoTime.nullable(),
|
|
17854
|
+
lastReplicaSeq: z26.number().int().nonnegative().nullable().optional()
|
|
17855
|
+
}).nullable(),
|
|
17856
|
+
stream: z26.object({
|
|
17857
|
+
streamId: z26.string(),
|
|
17858
|
+
headSeq: z26.number().int().nonnegative(),
|
|
17859
|
+
headCheckpointId: z26.string().nullable(),
|
|
17860
|
+
openConflicts: z26.number().int().nonnegative(),
|
|
17861
|
+
devices: nexusCloudDeviceCountsSchema
|
|
17862
|
+
}).nullable(),
|
|
17863
|
+
/** Check ids added by a newer server are dropped, never a parse failure. */
|
|
17864
|
+
checks: z26.array(nexusCloudStatusCheckSchema.extend({ id: z26.string() })).transform(
|
|
17865
|
+
(list) => list.flatMap((c) => {
|
|
17866
|
+
const id = knownCheckId.safeParse(c.id);
|
|
17867
|
+
return id.success ? [{ ...c, id: id.data }] : [];
|
|
17868
|
+
})
|
|
17869
|
+
),
|
|
17870
|
+
/** A verdict added by a newer server reads as `attention`: never `ok` by accident. */
|
|
17871
|
+
verdict: z26.enum(NEXUS_STATUS_VERDICTS).catch("attention")
|
|
17872
|
+
});
|
|
17873
|
+
}
|
|
17874
|
+
});
|
|
17875
|
+
|
|
17672
17876
|
// packages/contracts/src/task-id.ts
|
|
17673
17877
|
var init_task_id = __esm({
|
|
17674
17878
|
"packages/contracts/src/task-id.ts"() {
|
|
@@ -17753,6 +17957,7 @@ var init_src = __esm({
|
|
|
17753
17957
|
init_decide();
|
|
17754
17958
|
init_decide_sites();
|
|
17755
17959
|
init_nexus_account();
|
|
17960
|
+
init_nexus_cloud();
|
|
17756
17961
|
init_task_id();
|
|
17757
17962
|
}
|
|
17758
17963
|
});
|
|
@@ -31773,7 +31978,7 @@ function resolveRef(ref, ctx) {
|
|
|
31773
31978
|
function convertBaseSchema(schema, ctx) {
|
|
31774
31979
|
if (schema.not !== void 0) {
|
|
31775
31980
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
31776
|
-
return
|
|
31981
|
+
return z27.never();
|
|
31777
31982
|
}
|
|
31778
31983
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
31779
31984
|
}
|
|
@@ -31795,7 +32000,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31795
32000
|
return ctx.refs.get(refPath);
|
|
31796
32001
|
}
|
|
31797
32002
|
if (ctx.processing.has(refPath)) {
|
|
31798
|
-
return
|
|
32003
|
+
return z27.lazy(() => {
|
|
31799
32004
|
if (!ctx.refs.has(refPath)) {
|
|
31800
32005
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
31801
32006
|
}
|
|
@@ -31812,25 +32017,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31812
32017
|
if (schema.enum !== void 0) {
|
|
31813
32018
|
const enumValues = schema.enum;
|
|
31814
32019
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
31815
|
-
return
|
|
32020
|
+
return z27.null();
|
|
31816
32021
|
}
|
|
31817
32022
|
if (enumValues.length === 0) {
|
|
31818
|
-
return
|
|
32023
|
+
return z27.never();
|
|
31819
32024
|
}
|
|
31820
32025
|
if (enumValues.length === 1) {
|
|
31821
|
-
return
|
|
32026
|
+
return z27.literal(enumValues[0]);
|
|
31822
32027
|
}
|
|
31823
32028
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
31824
|
-
return
|
|
32029
|
+
return z27.enum(enumValues);
|
|
31825
32030
|
}
|
|
31826
|
-
const literalSchemas = enumValues.map((v) =>
|
|
32031
|
+
const literalSchemas = enumValues.map((v) => z27.literal(v));
|
|
31827
32032
|
if (literalSchemas.length < 2) {
|
|
31828
32033
|
return literalSchemas[0];
|
|
31829
32034
|
}
|
|
31830
|
-
return
|
|
32035
|
+
return z27.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
31831
32036
|
}
|
|
31832
32037
|
if (schema.const !== void 0) {
|
|
31833
|
-
return
|
|
32038
|
+
return z27.literal(schema.const);
|
|
31834
32039
|
}
|
|
31835
32040
|
const type = schema.type;
|
|
31836
32041
|
if (Array.isArray(type)) {
|
|
@@ -31839,68 +32044,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31839
32044
|
return convertBaseSchema(typeSchema, ctx);
|
|
31840
32045
|
});
|
|
31841
32046
|
if (typeSchemas.length === 0) {
|
|
31842
|
-
return
|
|
32047
|
+
return z27.never();
|
|
31843
32048
|
}
|
|
31844
32049
|
if (typeSchemas.length === 1) {
|
|
31845
32050
|
return typeSchemas[0];
|
|
31846
32051
|
}
|
|
31847
|
-
return
|
|
32052
|
+
return z27.union(typeSchemas);
|
|
31848
32053
|
}
|
|
31849
32054
|
if (!type) {
|
|
31850
|
-
return
|
|
32055
|
+
return z27.any();
|
|
31851
32056
|
}
|
|
31852
32057
|
let zodSchema2;
|
|
31853
32058
|
switch (type) {
|
|
31854
32059
|
case "string": {
|
|
31855
|
-
let stringSchema =
|
|
32060
|
+
let stringSchema = z27.string();
|
|
31856
32061
|
if (schema.format) {
|
|
31857
32062
|
const format = schema.format;
|
|
31858
32063
|
if (format === "email") {
|
|
31859
|
-
stringSchema = stringSchema.check(
|
|
32064
|
+
stringSchema = stringSchema.check(z27.email());
|
|
31860
32065
|
} else if (format === "uri" || format === "uri-reference") {
|
|
31861
|
-
stringSchema = stringSchema.check(
|
|
32066
|
+
stringSchema = stringSchema.check(z27.url());
|
|
31862
32067
|
} else if (format === "uuid" || format === "guid") {
|
|
31863
|
-
stringSchema = stringSchema.check(
|
|
32068
|
+
stringSchema = stringSchema.check(z27.uuid());
|
|
31864
32069
|
} else if (format === "date-time") {
|
|
31865
|
-
stringSchema = stringSchema.check(
|
|
32070
|
+
stringSchema = stringSchema.check(z27.iso.datetime());
|
|
31866
32071
|
} else if (format === "date") {
|
|
31867
|
-
stringSchema = stringSchema.check(
|
|
32072
|
+
stringSchema = stringSchema.check(z27.iso.date());
|
|
31868
32073
|
} else if (format === "time") {
|
|
31869
|
-
stringSchema = stringSchema.check(
|
|
32074
|
+
stringSchema = stringSchema.check(z27.iso.time());
|
|
31870
32075
|
} else if (format === "duration") {
|
|
31871
|
-
stringSchema = stringSchema.check(
|
|
32076
|
+
stringSchema = stringSchema.check(z27.iso.duration());
|
|
31872
32077
|
} else if (format === "ipv4") {
|
|
31873
|
-
stringSchema = stringSchema.check(
|
|
32078
|
+
stringSchema = stringSchema.check(z27.ipv4());
|
|
31874
32079
|
} else if (format === "ipv6") {
|
|
31875
|
-
stringSchema = stringSchema.check(
|
|
32080
|
+
stringSchema = stringSchema.check(z27.ipv6());
|
|
31876
32081
|
} else if (format === "mac") {
|
|
31877
|
-
stringSchema = stringSchema.check(
|
|
32082
|
+
stringSchema = stringSchema.check(z27.mac());
|
|
31878
32083
|
} else if (format === "cidr") {
|
|
31879
|
-
stringSchema = stringSchema.check(
|
|
32084
|
+
stringSchema = stringSchema.check(z27.cidrv4());
|
|
31880
32085
|
} else if (format === "cidr-v6") {
|
|
31881
|
-
stringSchema = stringSchema.check(
|
|
32086
|
+
stringSchema = stringSchema.check(z27.cidrv6());
|
|
31882
32087
|
} else if (format === "base64") {
|
|
31883
|
-
stringSchema = stringSchema.check(
|
|
32088
|
+
stringSchema = stringSchema.check(z27.base64());
|
|
31884
32089
|
} else if (format === "base64url") {
|
|
31885
|
-
stringSchema = stringSchema.check(
|
|
32090
|
+
stringSchema = stringSchema.check(z27.base64url());
|
|
31886
32091
|
} else if (format === "e164") {
|
|
31887
|
-
stringSchema = stringSchema.check(
|
|
32092
|
+
stringSchema = stringSchema.check(z27.e164());
|
|
31888
32093
|
} else if (format === "jwt") {
|
|
31889
|
-
stringSchema = stringSchema.check(
|
|
32094
|
+
stringSchema = stringSchema.check(z27.jwt());
|
|
31890
32095
|
} else if (format === "emoji") {
|
|
31891
|
-
stringSchema = stringSchema.check(
|
|
32096
|
+
stringSchema = stringSchema.check(z27.emoji());
|
|
31892
32097
|
} else if (format === "nanoid") {
|
|
31893
|
-
stringSchema = stringSchema.check(
|
|
32098
|
+
stringSchema = stringSchema.check(z27.nanoid());
|
|
31894
32099
|
} else if (format === "cuid") {
|
|
31895
|
-
stringSchema = stringSchema.check(
|
|
32100
|
+
stringSchema = stringSchema.check(z27.cuid());
|
|
31896
32101
|
} else if (format === "cuid2") {
|
|
31897
|
-
stringSchema = stringSchema.check(
|
|
32102
|
+
stringSchema = stringSchema.check(z27.cuid2());
|
|
31898
32103
|
} else if (format === "ulid") {
|
|
31899
|
-
stringSchema = stringSchema.check(
|
|
32104
|
+
stringSchema = stringSchema.check(z27.ulid());
|
|
31900
32105
|
} else if (format === "xid") {
|
|
31901
|
-
stringSchema = stringSchema.check(
|
|
32106
|
+
stringSchema = stringSchema.check(z27.xid());
|
|
31902
32107
|
} else if (format === "ksuid") {
|
|
31903
|
-
stringSchema = stringSchema.check(
|
|
32108
|
+
stringSchema = stringSchema.check(z27.ksuid());
|
|
31904
32109
|
}
|
|
31905
32110
|
}
|
|
31906
32111
|
if (typeof schema.minLength === "number") {
|
|
@@ -31917,7 +32122,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31917
32122
|
}
|
|
31918
32123
|
case "number":
|
|
31919
32124
|
case "integer": {
|
|
31920
|
-
let numberSchema = type === "integer" ?
|
|
32125
|
+
let numberSchema = type === "integer" ? z27.number().int() : z27.number();
|
|
31921
32126
|
if (typeof schema.minimum === "number") {
|
|
31922
32127
|
numberSchema = numberSchema.min(schema.minimum);
|
|
31923
32128
|
}
|
|
@@ -31941,11 +32146,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31941
32146
|
break;
|
|
31942
32147
|
}
|
|
31943
32148
|
case "boolean": {
|
|
31944
|
-
zodSchema2 =
|
|
32149
|
+
zodSchema2 = z27.boolean();
|
|
31945
32150
|
break;
|
|
31946
32151
|
}
|
|
31947
32152
|
case "null": {
|
|
31948
|
-
zodSchema2 =
|
|
32153
|
+
zodSchema2 = z27.null();
|
|
31949
32154
|
break;
|
|
31950
32155
|
}
|
|
31951
32156
|
case "object": {
|
|
@@ -31958,14 +32163,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31958
32163
|
}
|
|
31959
32164
|
if (schema.propertyNames) {
|
|
31960
32165
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
31961
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
32166
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z27.any();
|
|
31962
32167
|
if (Object.keys(shape).length === 0) {
|
|
31963
|
-
zodSchema2 =
|
|
32168
|
+
zodSchema2 = z27.record(keySchema, valueSchema);
|
|
31964
32169
|
break;
|
|
31965
32170
|
}
|
|
31966
|
-
const objectSchema2 =
|
|
31967
|
-
const recordSchema =
|
|
31968
|
-
zodSchema2 =
|
|
32171
|
+
const objectSchema2 = z27.object(shape).passthrough();
|
|
32172
|
+
const recordSchema = z27.looseRecord(keySchema, valueSchema);
|
|
32173
|
+
zodSchema2 = z27.intersection(objectSchema2, recordSchema);
|
|
31969
32174
|
break;
|
|
31970
32175
|
}
|
|
31971
32176
|
if (schema.patternProperties) {
|
|
@@ -31974,28 +32179,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
31974
32179
|
const looseRecords = [];
|
|
31975
32180
|
for (const pattern of patternKeys) {
|
|
31976
32181
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
31977
|
-
const keySchema =
|
|
31978
|
-
looseRecords.push(
|
|
32182
|
+
const keySchema = z27.string().regex(new RegExp(pattern));
|
|
32183
|
+
looseRecords.push(z27.looseRecord(keySchema, patternValue));
|
|
31979
32184
|
}
|
|
31980
32185
|
const schemasToIntersect = [];
|
|
31981
32186
|
if (Object.keys(shape).length > 0) {
|
|
31982
|
-
schemasToIntersect.push(
|
|
32187
|
+
schemasToIntersect.push(z27.object(shape).passthrough());
|
|
31983
32188
|
}
|
|
31984
32189
|
schemasToIntersect.push(...looseRecords);
|
|
31985
32190
|
if (schemasToIntersect.length === 0) {
|
|
31986
|
-
zodSchema2 =
|
|
32191
|
+
zodSchema2 = z27.object({}).passthrough();
|
|
31987
32192
|
} else if (schemasToIntersect.length === 1) {
|
|
31988
32193
|
zodSchema2 = schemasToIntersect[0];
|
|
31989
32194
|
} else {
|
|
31990
|
-
let result =
|
|
32195
|
+
let result = z27.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
31991
32196
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
31992
|
-
result =
|
|
32197
|
+
result = z27.intersection(result, schemasToIntersect[i]);
|
|
31993
32198
|
}
|
|
31994
32199
|
zodSchema2 = result;
|
|
31995
32200
|
}
|
|
31996
32201
|
break;
|
|
31997
32202
|
}
|
|
31998
|
-
const objectSchema =
|
|
32203
|
+
const objectSchema = z27.object(shape);
|
|
31999
32204
|
if (schema.additionalProperties === false) {
|
|
32000
32205
|
zodSchema2 = objectSchema.strict();
|
|
32001
32206
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -32012,33 +32217,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
32012
32217
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
32013
32218
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
32014
32219
|
if (rest) {
|
|
32015
|
-
zodSchema2 =
|
|
32220
|
+
zodSchema2 = z27.tuple(tupleItems).rest(rest);
|
|
32016
32221
|
} else {
|
|
32017
|
-
zodSchema2 =
|
|
32222
|
+
zodSchema2 = z27.tuple(tupleItems);
|
|
32018
32223
|
}
|
|
32019
32224
|
if (typeof schema.minItems === "number") {
|
|
32020
|
-
zodSchema2 = zodSchema2.check(
|
|
32225
|
+
zodSchema2 = zodSchema2.check(z27.minLength(schema.minItems));
|
|
32021
32226
|
}
|
|
32022
32227
|
if (typeof schema.maxItems === "number") {
|
|
32023
|
-
zodSchema2 = zodSchema2.check(
|
|
32228
|
+
zodSchema2 = zodSchema2.check(z27.maxLength(schema.maxItems));
|
|
32024
32229
|
}
|
|
32025
32230
|
} else if (Array.isArray(items)) {
|
|
32026
32231
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
32027
32232
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
32028
32233
|
if (rest) {
|
|
32029
|
-
zodSchema2 =
|
|
32234
|
+
zodSchema2 = z27.tuple(tupleItems).rest(rest);
|
|
32030
32235
|
} else {
|
|
32031
|
-
zodSchema2 =
|
|
32236
|
+
zodSchema2 = z27.tuple(tupleItems);
|
|
32032
32237
|
}
|
|
32033
32238
|
if (typeof schema.minItems === "number") {
|
|
32034
|
-
zodSchema2 = zodSchema2.check(
|
|
32239
|
+
zodSchema2 = zodSchema2.check(z27.minLength(schema.minItems));
|
|
32035
32240
|
}
|
|
32036
32241
|
if (typeof schema.maxItems === "number") {
|
|
32037
|
-
zodSchema2 = zodSchema2.check(
|
|
32242
|
+
zodSchema2 = zodSchema2.check(z27.maxLength(schema.maxItems));
|
|
32038
32243
|
}
|
|
32039
32244
|
} else if (items !== void 0) {
|
|
32040
32245
|
const element = convertSchema(items, ctx);
|
|
32041
|
-
let arraySchema =
|
|
32246
|
+
let arraySchema = z27.array(element);
|
|
32042
32247
|
if (typeof schema.minItems === "number") {
|
|
32043
32248
|
arraySchema = arraySchema.min(schema.minItems);
|
|
32044
32249
|
}
|
|
@@ -32047,7 +32252,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
32047
32252
|
}
|
|
32048
32253
|
zodSchema2 = arraySchema;
|
|
32049
32254
|
} else {
|
|
32050
|
-
zodSchema2 =
|
|
32255
|
+
zodSchema2 = z27.array(z27.any());
|
|
32051
32256
|
}
|
|
32052
32257
|
break;
|
|
32053
32258
|
}
|
|
@@ -32064,37 +32269,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
32064
32269
|
}
|
|
32065
32270
|
function convertSchema(schema, ctx) {
|
|
32066
32271
|
if (typeof schema === "boolean") {
|
|
32067
|
-
return schema ?
|
|
32272
|
+
return schema ? z27.any() : z27.never();
|
|
32068
32273
|
}
|
|
32069
32274
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
32070
32275
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
32071
32276
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
32072
32277
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
32073
|
-
const anyOfUnion =
|
|
32074
|
-
baseSchema = hasExplicitType ?
|
|
32278
|
+
const anyOfUnion = z27.union(options);
|
|
32279
|
+
baseSchema = hasExplicitType ? z27.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
32075
32280
|
}
|
|
32076
32281
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
32077
32282
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
32078
|
-
const oneOfUnion =
|
|
32079
|
-
baseSchema = hasExplicitType ?
|
|
32283
|
+
const oneOfUnion = z27.xor(options);
|
|
32284
|
+
baseSchema = hasExplicitType ? z27.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
32080
32285
|
}
|
|
32081
32286
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
32082
32287
|
if (schema.allOf.length === 0) {
|
|
32083
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
32288
|
+
baseSchema = hasExplicitType ? baseSchema : z27.any();
|
|
32084
32289
|
} else {
|
|
32085
32290
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
32086
32291
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
32087
32292
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
32088
|
-
result =
|
|
32293
|
+
result = z27.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
32089
32294
|
}
|
|
32090
32295
|
baseSchema = result;
|
|
32091
32296
|
}
|
|
32092
32297
|
}
|
|
32093
32298
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
32094
|
-
baseSchema =
|
|
32299
|
+
baseSchema = z27.nullable(baseSchema);
|
|
32095
32300
|
}
|
|
32096
32301
|
if (schema.readOnly === true) {
|
|
32097
|
-
baseSchema =
|
|
32302
|
+
baseSchema = z27.readonly(baseSchema);
|
|
32098
32303
|
}
|
|
32099
32304
|
const extraMeta = {};
|
|
32100
32305
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -32121,7 +32326,7 @@ function convertSchema(schema, ctx) {
|
|
|
32121
32326
|
}
|
|
32122
32327
|
function fromJSONSchema(schema, params) {
|
|
32123
32328
|
if (typeof schema === "boolean") {
|
|
32124
|
-
return schema ?
|
|
32329
|
+
return schema ? z27.any() : z27.never();
|
|
32125
32330
|
}
|
|
32126
32331
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
32127
32332
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -32135,14 +32340,14 @@ function fromJSONSchema(schema, params) {
|
|
|
32135
32340
|
};
|
|
32136
32341
|
return convertSchema(schema, ctx);
|
|
32137
32342
|
}
|
|
32138
|
-
var
|
|
32343
|
+
var z27, RECOGNIZED_KEYS;
|
|
32139
32344
|
var init_from_json_schema = __esm({
|
|
32140
32345
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
32141
32346
|
init_registries();
|
|
32142
32347
|
init_checks2();
|
|
32143
32348
|
init_iso();
|
|
32144
32349
|
init_schemas2();
|
|
32145
|
-
|
|
32350
|
+
z27 = {
|
|
32146
32351
|
...schemas_exports2,
|
|
32147
32352
|
...checks_exports2,
|
|
32148
32353
|
iso: iso_exports
|