@cleocode/adapters 2026.5.78 → 2026.5.79
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 +325 -138
- package/dist/index.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1169,6 +1169,192 @@ var init_peer = __esm({
|
|
|
1169
1169
|
}
|
|
1170
1170
|
});
|
|
1171
1171
|
|
|
1172
|
+
// packages/contracts/src/release/plan.ts
|
|
1173
|
+
import { z as z4 } from "zod";
|
|
1174
|
+
var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
|
|
1175
|
+
var init_plan = __esm({
|
|
1176
|
+
"packages/contracts/src/release/plan.ts"() {
|
|
1177
|
+
"use strict";
|
|
1178
|
+
RELEASE_CHANNEL = ["latest", "beta", "alpha", "rc"];
|
|
1179
|
+
RELEASE_SCHEME = ["calver", "semver", "calver-suffix"];
|
|
1180
|
+
RELEASE_KIND = ["regular", "hotfix", "prerelease"];
|
|
1181
|
+
RELEASE_STATUS = [
|
|
1182
|
+
"planned",
|
|
1183
|
+
"pr-opened",
|
|
1184
|
+
"pr-merged",
|
|
1185
|
+
"published",
|
|
1186
|
+
"reconciled",
|
|
1187
|
+
"rolled_back",
|
|
1188
|
+
"failed",
|
|
1189
|
+
"cancelled"
|
|
1190
|
+
];
|
|
1191
|
+
GATE_STATUS = ["passed", "failed", "skipped", "unresolved"];
|
|
1192
|
+
GATE_NAME = ["test", "build", "lint", "typecheck", "audit", "security-scan"];
|
|
1193
|
+
PLATFORM_TUPLE = [
|
|
1194
|
+
"linux-x64",
|
|
1195
|
+
"linux-arm64",
|
|
1196
|
+
"macos-x64",
|
|
1197
|
+
"macos-arm64",
|
|
1198
|
+
"windows-x64",
|
|
1199
|
+
"any"
|
|
1200
|
+
];
|
|
1201
|
+
PUBLISHER = ["npm", "cargo", "docker", "pypi", "github-release", "binary"];
|
|
1202
|
+
TASK_KIND = [
|
|
1203
|
+
"feat",
|
|
1204
|
+
"fix",
|
|
1205
|
+
"chore",
|
|
1206
|
+
"docs",
|
|
1207
|
+
"refactor",
|
|
1208
|
+
"test",
|
|
1209
|
+
"perf",
|
|
1210
|
+
"revert",
|
|
1211
|
+
"breaking",
|
|
1212
|
+
"hotfix"
|
|
1213
|
+
];
|
|
1214
|
+
IMPACT = ["major", "minor", "patch"];
|
|
1215
|
+
RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
|
|
1216
|
+
ReleaseChannelSchema = z4.enum(RELEASE_CHANNEL);
|
|
1217
|
+
ReleaseSchemeSchema = z4.enum(RELEASE_SCHEME);
|
|
1218
|
+
ReleaseKindSchema = z4.enum(RELEASE_KIND);
|
|
1219
|
+
ReleaseStatusSchema = z4.enum(RELEASE_STATUS);
|
|
1220
|
+
GateStatusSchema = z4.enum(GATE_STATUS);
|
|
1221
|
+
GateNameSchema = z4.enum(GATE_NAME);
|
|
1222
|
+
PlatformTupleSchema = z4.enum(PLATFORM_TUPLE);
|
|
1223
|
+
PublisherSchema = z4.enum(PUBLISHER);
|
|
1224
|
+
TaskKindSchema = z4.enum(TASK_KIND);
|
|
1225
|
+
ImpactSchema = z4.enum(IMPACT);
|
|
1226
|
+
ResolvedSourceSchema = z4.enum(RESOLVED_SOURCE);
|
|
1227
|
+
Iso8601 = z4.iso.datetime({ offset: true });
|
|
1228
|
+
NonEmptyString = z4.string().min(1);
|
|
1229
|
+
ReleasePlanTaskSchema = z4.object({
|
|
1230
|
+
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
1231
|
+
id: NonEmptyString,
|
|
1232
|
+
/** Conventional-commit-aligned task classification. */
|
|
1233
|
+
kind: TaskKindSchema,
|
|
1234
|
+
/** SemVer impact classification. */
|
|
1235
|
+
impact: ImpactSchema,
|
|
1236
|
+
/** Human-readable changelog line for this task. */
|
|
1237
|
+
userFacingSummary: z4.string(),
|
|
1238
|
+
/**
|
|
1239
|
+
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
1240
|
+
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
1241
|
+
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
1242
|
+
* enforces non-empty via R-301.
|
|
1243
|
+
*/
|
|
1244
|
+
evidenceAtoms: z4.array(NonEmptyString),
|
|
1245
|
+
/** IVTR phase at plan time — informational only per R-316. */
|
|
1246
|
+
ivtrPhaseAtPlan: z4.string().optional(),
|
|
1247
|
+
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
1248
|
+
epicAncestor: NonEmptyString
|
|
1249
|
+
});
|
|
1250
|
+
ReleaseGateSchema = z4.object({
|
|
1251
|
+
/** Canonical gate name. */
|
|
1252
|
+
name: GateNameSchema,
|
|
1253
|
+
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
1254
|
+
atom: NonEmptyString,
|
|
1255
|
+
/** Gate execution status at plan time. */
|
|
1256
|
+
status: GateStatusSchema,
|
|
1257
|
+
/** ISO-8601 timestamp the gate was last verified. */
|
|
1258
|
+
lastVerifiedAt: Iso8601,
|
|
1259
|
+
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
1260
|
+
resolvedCommand: z4.string().optional(),
|
|
1261
|
+
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
1262
|
+
resolvedSource: ResolvedSourceSchema.optional()
|
|
1263
|
+
});
|
|
1264
|
+
ReleasePlatformMatrixEntrySchema = z4.object({
|
|
1265
|
+
/** Target platform tuple. */
|
|
1266
|
+
platform: PlatformTupleSchema,
|
|
1267
|
+
/** Distribution backend. */
|
|
1268
|
+
publisher: PublisherSchema,
|
|
1269
|
+
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
1270
|
+
package: NonEmptyString,
|
|
1271
|
+
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
1272
|
+
smoke: z4.boolean().default(true).optional()
|
|
1273
|
+
});
|
|
1274
|
+
ReleasePreflightSummarySchema = z4.object({
|
|
1275
|
+
/** True if esbuild externals are out of sync with package.json. */
|
|
1276
|
+
esbuildExternalsDrift: z4.boolean(),
|
|
1277
|
+
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
1278
|
+
lockfileDrift: z4.boolean(),
|
|
1279
|
+
/** True if all epic children are in terminal lifecycle states. */
|
|
1280
|
+
epicCompletenessClean: z4.boolean(),
|
|
1281
|
+
/** True if no task appears in multiple in-flight release plans. */
|
|
1282
|
+
doubleListingClean: z4.boolean(),
|
|
1283
|
+
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
1284
|
+
preflightWarnings: z4.array(z4.string()).default([]).optional()
|
|
1285
|
+
});
|
|
1286
|
+
ReleasePlanChangelogSchema = z4.object({
|
|
1287
|
+
/** `kind=feat` tasks. */
|
|
1288
|
+
features: z4.array(NonEmptyString).default([]),
|
|
1289
|
+
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
1290
|
+
fixes: z4.array(NonEmptyString).default([]),
|
|
1291
|
+
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
1292
|
+
chores: z4.array(NonEmptyString).default([]),
|
|
1293
|
+
/** `kind=breaking` or `kind=revert` tasks. */
|
|
1294
|
+
breaking: z4.array(NonEmptyString).default([])
|
|
1295
|
+
});
|
|
1296
|
+
ReleasePlanMetaSchema = z4.object({
|
|
1297
|
+
/** True if this is the project's first ever release. */
|
|
1298
|
+
firstEverRelease: z4.boolean().optional(),
|
|
1299
|
+
/** Canonical tool names that could not be resolved at plan time. */
|
|
1300
|
+
unresolvedTools: z4.array(z4.string()).optional(),
|
|
1301
|
+
/** Project archetype detected at plan time. */
|
|
1302
|
+
archetype: z4.string().optional()
|
|
1303
|
+
}).catchall(z4.unknown());
|
|
1304
|
+
ReleasePlanSchema = z4.object({
|
|
1305
|
+
/** Schema URL for this plan version. */
|
|
1306
|
+
$schema: z4.string().optional(),
|
|
1307
|
+
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
1308
|
+
version: NonEmptyString,
|
|
1309
|
+
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
1310
|
+
resolvedVersion: NonEmptyString,
|
|
1311
|
+
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
1312
|
+
suffixApplied: z4.boolean(),
|
|
1313
|
+
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
1314
|
+
scheme: ReleaseSchemeSchema,
|
|
1315
|
+
/** npm dist-tag channel for this release. */
|
|
1316
|
+
channel: ReleaseChannelSchema,
|
|
1317
|
+
/** Epic ID this release ships. */
|
|
1318
|
+
epicId: NonEmptyString,
|
|
1319
|
+
/** Release-kind classification. */
|
|
1320
|
+
releaseKind: ReleaseKindSchema,
|
|
1321
|
+
/** ISO-8601 timestamp the plan was written. */
|
|
1322
|
+
createdAt: Iso8601,
|
|
1323
|
+
/** Identifier of the actor that wrote the plan (agent name or operator). */
|
|
1324
|
+
createdBy: NonEmptyString,
|
|
1325
|
+
/**
|
|
1326
|
+
* Version of the previous release on the same channel. MUST be `null` only
|
|
1327
|
+
* for first-ever releases (R-300, enforced at the verb layer).
|
|
1328
|
+
*/
|
|
1329
|
+
previousVersion: z4.string().nullable(),
|
|
1330
|
+
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
1331
|
+
previousTag: z4.string().nullable(),
|
|
1332
|
+
/** ISO-8601 timestamp the previous release was published. */
|
|
1333
|
+
previousShippedAt: Iso8601.nullable(),
|
|
1334
|
+
/** Tasks rolled into this release. */
|
|
1335
|
+
tasks: z4.array(ReleasePlanTaskSchema),
|
|
1336
|
+
/** Bucketed changelog. */
|
|
1337
|
+
changelog: ReleasePlanChangelogSchema,
|
|
1338
|
+
/** Per-gate verification status. */
|
|
1339
|
+
gates: z4.array(ReleaseGateSchema),
|
|
1340
|
+
/** Platform / publisher matrix. */
|
|
1341
|
+
platformMatrix: z4.array(ReleasePlatformMatrixEntrySchema),
|
|
1342
|
+
/** Preflight summary from `cleo release plan`. */
|
|
1343
|
+
preflightSummary: ReleasePreflightSummarySchema,
|
|
1344
|
+
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
1345
|
+
workflowRunUrl: z4.string().nullable(),
|
|
1346
|
+
/** URL of the bump PR (populated by `cleo release open`). */
|
|
1347
|
+
prUrl: z4.string().nullable(),
|
|
1348
|
+
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
1349
|
+
mergeCommitSha: z4.string().nullable(),
|
|
1350
|
+
/** Current FSM state per R-302. */
|
|
1351
|
+
status: ReleaseStatusSchema,
|
|
1352
|
+
/** Informational / forward-compat metadata. */
|
|
1353
|
+
meta: ReleasePlanMetaSchema.optional()
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
|
|
1172
1358
|
// packages/contracts/src/session.ts
|
|
1173
1359
|
var init_session2 = __esm({
|
|
1174
1360
|
"packages/contracts/src/session.ts"() {
|
|
@@ -1177,52 +1363,52 @@ var init_session2 = __esm({
|
|
|
1177
1363
|
});
|
|
1178
1364
|
|
|
1179
1365
|
// packages/contracts/src/session-journal.ts
|
|
1180
|
-
import { z as
|
|
1366
|
+
import { z as z5 } from "zod";
|
|
1181
1367
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
1182
1368
|
var init_session_journal = __esm({
|
|
1183
1369
|
"packages/contracts/src/session-journal.ts"() {
|
|
1184
1370
|
"use strict";
|
|
1185
1371
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
1186
|
-
sessionJournalDoctorSummarySchema =
|
|
1372
|
+
sessionJournalDoctorSummarySchema = z5.object({
|
|
1187
1373
|
/** `true` when zero noise patterns were detected. */
|
|
1188
|
-
isClean:
|
|
1374
|
+
isClean: z5.boolean(),
|
|
1189
1375
|
/** Total number of noise findings across all patterns. */
|
|
1190
|
-
findingsCount:
|
|
1376
|
+
findingsCount: z5.number().int().nonnegative(),
|
|
1191
1377
|
/** Pattern names that were detected (empty when isClean). */
|
|
1192
|
-
patterns:
|
|
1378
|
+
patterns: z5.array(z5.string()),
|
|
1193
1379
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
1194
|
-
totalScanned:
|
|
1380
|
+
totalScanned: z5.number().int().nonnegative()
|
|
1195
1381
|
});
|
|
1196
|
-
sessionJournalDebriefSummarySchema =
|
|
1382
|
+
sessionJournalDebriefSummarySchema = z5.object({
|
|
1197
1383
|
/** First 200 characters of the session end note (if provided). */
|
|
1198
|
-
noteExcerpt:
|
|
1384
|
+
noteExcerpt: z5.string().max(200).optional(),
|
|
1199
1385
|
/** Number of tasks completed during the session. */
|
|
1200
|
-
tasksCompletedCount:
|
|
1386
|
+
tasksCompletedCount: z5.number().int().nonnegative(),
|
|
1201
1387
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
1202
|
-
tasksFocused:
|
|
1388
|
+
tasksFocused: z5.array(z5.string()).max(5).optional()
|
|
1203
1389
|
});
|
|
1204
|
-
sessionJournalEntrySchema =
|
|
1390
|
+
sessionJournalEntrySchema = z5.object({
|
|
1205
1391
|
// Identity
|
|
1206
1392
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
1207
|
-
schemaVersion:
|
|
1393
|
+
schemaVersion: z5.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
1208
1394
|
/** ISO 8601 timestamp when the entry was written. */
|
|
1209
|
-
timestamp:
|
|
1395
|
+
timestamp: z5.string(),
|
|
1210
1396
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
1211
|
-
sessionId:
|
|
1397
|
+
sessionId: z5.string(),
|
|
1212
1398
|
/** Event type that triggered this journal entry. */
|
|
1213
|
-
eventType:
|
|
1399
|
+
eventType: z5.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
1214
1400
|
// Session metadata (set on session_start / session_end)
|
|
1215
1401
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
1216
|
-
agentIdentifier:
|
|
1402
|
+
agentIdentifier: z5.string().optional(),
|
|
1217
1403
|
/** Provider adapter ID active for this session. */
|
|
1218
|
-
providerId:
|
|
1404
|
+
providerId: z5.string().optional(),
|
|
1219
1405
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
1220
|
-
scope:
|
|
1406
|
+
scope: z5.string().optional(),
|
|
1221
1407
|
// Session-end fields
|
|
1222
1408
|
/** Duration of the session in seconds (session_end only). */
|
|
1223
|
-
duration:
|
|
1409
|
+
duration: z5.number().int().nonnegative().optional(),
|
|
1224
1410
|
/** Task IDs (not titles) completed during the session. */
|
|
1225
|
-
tasksCompleted:
|
|
1411
|
+
tasksCompleted: z5.array(z5.string()).optional(),
|
|
1226
1412
|
// Doctor summary (T1262 absorbed)
|
|
1227
1413
|
/** Compact result of `scanBrainNoise` run at session-end. */
|
|
1228
1414
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
@@ -1231,7 +1417,7 @@ var init_session_journal = __esm({
|
|
|
1231
1417
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
1232
1418
|
// Optional hash chain
|
|
1233
1419
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
1234
|
-
prevEntryHash:
|
|
1420
|
+
prevEntryHash: z5.string().optional()
|
|
1235
1421
|
});
|
|
1236
1422
|
}
|
|
1237
1423
|
});
|
|
@@ -1251,52 +1437,52 @@ var init_task = __esm({
|
|
|
1251
1437
|
});
|
|
1252
1438
|
|
|
1253
1439
|
// packages/contracts/src/task-evidence.ts
|
|
1254
|
-
import { z as
|
|
1440
|
+
import { z as z6 } from "zod";
|
|
1255
1441
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
1256
1442
|
var init_task_evidence = __esm({
|
|
1257
1443
|
"packages/contracts/src/task-evidence.ts"() {
|
|
1258
1444
|
"use strict";
|
|
1259
|
-
fileEvidenceSchema =
|
|
1260
|
-
kind:
|
|
1261
|
-
sha256:
|
|
1262
|
-
timestamp:
|
|
1263
|
-
path:
|
|
1264
|
-
mime:
|
|
1265
|
-
description:
|
|
1266
|
-
});
|
|
1267
|
-
logEvidenceSchema =
|
|
1268
|
-
kind:
|
|
1269
|
-
sha256:
|
|
1270
|
-
timestamp:
|
|
1271
|
-
source:
|
|
1272
|
-
description:
|
|
1273
|
-
});
|
|
1274
|
-
screenshotEvidenceSchema =
|
|
1275
|
-
kind:
|
|
1276
|
-
sha256:
|
|
1277
|
-
timestamp:
|
|
1278
|
-
mime:
|
|
1279
|
-
description:
|
|
1280
|
-
});
|
|
1281
|
-
testOutputEvidenceSchema =
|
|
1282
|
-
kind:
|
|
1283
|
-
sha256:
|
|
1284
|
-
timestamp:
|
|
1285
|
-
passed:
|
|
1286
|
-
failed:
|
|
1287
|
-
skipped:
|
|
1288
|
-
exitCode:
|
|
1289
|
-
description:
|
|
1290
|
-
});
|
|
1291
|
-
commandOutputEvidenceSchema =
|
|
1292
|
-
kind:
|
|
1293
|
-
sha256:
|
|
1294
|
-
timestamp:
|
|
1295
|
-
cmd:
|
|
1296
|
-
exitCode:
|
|
1297
|
-
description:
|
|
1298
|
-
});
|
|
1299
|
-
taskEvidenceSchema =
|
|
1445
|
+
fileEvidenceSchema = z6.object({
|
|
1446
|
+
kind: z6.literal("file"),
|
|
1447
|
+
sha256: z6.string().length(64),
|
|
1448
|
+
timestamp: z6.string().datetime(),
|
|
1449
|
+
path: z6.string().min(1),
|
|
1450
|
+
mime: z6.string().optional(),
|
|
1451
|
+
description: z6.string().optional()
|
|
1452
|
+
});
|
|
1453
|
+
logEvidenceSchema = z6.object({
|
|
1454
|
+
kind: z6.literal("log"),
|
|
1455
|
+
sha256: z6.string().length(64),
|
|
1456
|
+
timestamp: z6.string().datetime(),
|
|
1457
|
+
source: z6.string().min(1),
|
|
1458
|
+
description: z6.string().optional()
|
|
1459
|
+
});
|
|
1460
|
+
screenshotEvidenceSchema = z6.object({
|
|
1461
|
+
kind: z6.literal("screenshot"),
|
|
1462
|
+
sha256: z6.string().length(64),
|
|
1463
|
+
timestamp: z6.string().datetime(),
|
|
1464
|
+
mime: z6.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
1465
|
+
description: z6.string().optional()
|
|
1466
|
+
});
|
|
1467
|
+
testOutputEvidenceSchema = z6.object({
|
|
1468
|
+
kind: z6.literal("test-output"),
|
|
1469
|
+
sha256: z6.string().length(64),
|
|
1470
|
+
timestamp: z6.string().datetime(),
|
|
1471
|
+
passed: z6.number().int().nonnegative(),
|
|
1472
|
+
failed: z6.number().int().nonnegative(),
|
|
1473
|
+
skipped: z6.number().int().nonnegative(),
|
|
1474
|
+
exitCode: z6.number().int(),
|
|
1475
|
+
description: z6.string().optional()
|
|
1476
|
+
});
|
|
1477
|
+
commandOutputEvidenceSchema = z6.object({
|
|
1478
|
+
kind: z6.literal("command-output"),
|
|
1479
|
+
sha256: z6.string().length(64),
|
|
1480
|
+
timestamp: z6.string().datetime(),
|
|
1481
|
+
cmd: z6.string().min(1),
|
|
1482
|
+
exitCode: z6.number().int(),
|
|
1483
|
+
description: z6.string().optional()
|
|
1484
|
+
});
|
|
1485
|
+
taskEvidenceSchema = z6.discriminatedUnion("kind", [
|
|
1300
1486
|
fileEvidenceSchema,
|
|
1301
1487
|
logEvidenceSchema,
|
|
1302
1488
|
screenshotEvidenceSchema,
|
|
@@ -1307,12 +1493,12 @@ var init_task_evidence = __esm({
|
|
|
1307
1493
|
});
|
|
1308
1494
|
|
|
1309
1495
|
// packages/contracts/src/tasks/archive.ts
|
|
1310
|
-
import { z as
|
|
1496
|
+
import { z as z7 } from "zod";
|
|
1311
1497
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
1312
1498
|
var init_archive = __esm({
|
|
1313
1499
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
1314
1500
|
"use strict";
|
|
1315
|
-
ArchiveReason =
|
|
1501
|
+
ArchiveReason = z7.enum([
|
|
1316
1502
|
"verified",
|
|
1317
1503
|
"reconciled",
|
|
1318
1504
|
"superseded",
|
|
@@ -1343,6 +1529,7 @@ var init_src = __esm({
|
|
|
1343
1529
|
init_nexus_scope_map();
|
|
1344
1530
|
init_params();
|
|
1345
1531
|
init_peer();
|
|
1532
|
+
init_plan();
|
|
1346
1533
|
init_session2();
|
|
1347
1534
|
init_session_journal();
|
|
1348
1535
|
init_status_registry();
|
|
@@ -15368,7 +15555,7 @@ function resolveRef(ref, ctx) {
|
|
|
15368
15555
|
function convertBaseSchema(schema, ctx) {
|
|
15369
15556
|
if (schema.not !== void 0) {
|
|
15370
15557
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
15371
|
-
return
|
|
15558
|
+
return z8.never();
|
|
15372
15559
|
}
|
|
15373
15560
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
15374
15561
|
}
|
|
@@ -15390,7 +15577,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15390
15577
|
return ctx.refs.get(refPath);
|
|
15391
15578
|
}
|
|
15392
15579
|
if (ctx.processing.has(refPath)) {
|
|
15393
|
-
return
|
|
15580
|
+
return z8.lazy(() => {
|
|
15394
15581
|
if (!ctx.refs.has(refPath)) {
|
|
15395
15582
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
15396
15583
|
}
|
|
@@ -15407,25 +15594,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15407
15594
|
if (schema.enum !== void 0) {
|
|
15408
15595
|
const enumValues = schema.enum;
|
|
15409
15596
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
15410
|
-
return
|
|
15597
|
+
return z8.null();
|
|
15411
15598
|
}
|
|
15412
15599
|
if (enumValues.length === 0) {
|
|
15413
|
-
return
|
|
15600
|
+
return z8.never();
|
|
15414
15601
|
}
|
|
15415
15602
|
if (enumValues.length === 1) {
|
|
15416
|
-
return
|
|
15603
|
+
return z8.literal(enumValues[0]);
|
|
15417
15604
|
}
|
|
15418
15605
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
15419
|
-
return
|
|
15606
|
+
return z8.enum(enumValues);
|
|
15420
15607
|
}
|
|
15421
|
-
const literalSchemas = enumValues.map((v) =>
|
|
15608
|
+
const literalSchemas = enumValues.map((v) => z8.literal(v));
|
|
15422
15609
|
if (literalSchemas.length < 2) {
|
|
15423
15610
|
return literalSchemas[0];
|
|
15424
15611
|
}
|
|
15425
|
-
return
|
|
15612
|
+
return z8.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
15426
15613
|
}
|
|
15427
15614
|
if (schema.const !== void 0) {
|
|
15428
|
-
return
|
|
15615
|
+
return z8.literal(schema.const);
|
|
15429
15616
|
}
|
|
15430
15617
|
const type = schema.type;
|
|
15431
15618
|
if (Array.isArray(type)) {
|
|
@@ -15434,68 +15621,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15434
15621
|
return convertBaseSchema(typeSchema, ctx);
|
|
15435
15622
|
});
|
|
15436
15623
|
if (typeSchemas.length === 0) {
|
|
15437
|
-
return
|
|
15624
|
+
return z8.never();
|
|
15438
15625
|
}
|
|
15439
15626
|
if (typeSchemas.length === 1) {
|
|
15440
15627
|
return typeSchemas[0];
|
|
15441
15628
|
}
|
|
15442
|
-
return
|
|
15629
|
+
return z8.union(typeSchemas);
|
|
15443
15630
|
}
|
|
15444
15631
|
if (!type) {
|
|
15445
|
-
return
|
|
15632
|
+
return z8.any();
|
|
15446
15633
|
}
|
|
15447
15634
|
let zodSchema2;
|
|
15448
15635
|
switch (type) {
|
|
15449
15636
|
case "string": {
|
|
15450
|
-
let stringSchema =
|
|
15637
|
+
let stringSchema = z8.string();
|
|
15451
15638
|
if (schema.format) {
|
|
15452
15639
|
const format = schema.format;
|
|
15453
15640
|
if (format === "email") {
|
|
15454
|
-
stringSchema = stringSchema.check(
|
|
15641
|
+
stringSchema = stringSchema.check(z8.email());
|
|
15455
15642
|
} else if (format === "uri" || format === "uri-reference") {
|
|
15456
|
-
stringSchema = stringSchema.check(
|
|
15643
|
+
stringSchema = stringSchema.check(z8.url());
|
|
15457
15644
|
} else if (format === "uuid" || format === "guid") {
|
|
15458
|
-
stringSchema = stringSchema.check(
|
|
15645
|
+
stringSchema = stringSchema.check(z8.uuid());
|
|
15459
15646
|
} else if (format === "date-time") {
|
|
15460
|
-
stringSchema = stringSchema.check(
|
|
15647
|
+
stringSchema = stringSchema.check(z8.iso.datetime());
|
|
15461
15648
|
} else if (format === "date") {
|
|
15462
|
-
stringSchema = stringSchema.check(
|
|
15649
|
+
stringSchema = stringSchema.check(z8.iso.date());
|
|
15463
15650
|
} else if (format === "time") {
|
|
15464
|
-
stringSchema = stringSchema.check(
|
|
15651
|
+
stringSchema = stringSchema.check(z8.iso.time());
|
|
15465
15652
|
} else if (format === "duration") {
|
|
15466
|
-
stringSchema = stringSchema.check(
|
|
15653
|
+
stringSchema = stringSchema.check(z8.iso.duration());
|
|
15467
15654
|
} else if (format === "ipv4") {
|
|
15468
|
-
stringSchema = stringSchema.check(
|
|
15655
|
+
stringSchema = stringSchema.check(z8.ipv4());
|
|
15469
15656
|
} else if (format === "ipv6") {
|
|
15470
|
-
stringSchema = stringSchema.check(
|
|
15657
|
+
stringSchema = stringSchema.check(z8.ipv6());
|
|
15471
15658
|
} else if (format === "mac") {
|
|
15472
|
-
stringSchema = stringSchema.check(
|
|
15659
|
+
stringSchema = stringSchema.check(z8.mac());
|
|
15473
15660
|
} else if (format === "cidr") {
|
|
15474
|
-
stringSchema = stringSchema.check(
|
|
15661
|
+
stringSchema = stringSchema.check(z8.cidrv4());
|
|
15475
15662
|
} else if (format === "cidr-v6") {
|
|
15476
|
-
stringSchema = stringSchema.check(
|
|
15663
|
+
stringSchema = stringSchema.check(z8.cidrv6());
|
|
15477
15664
|
} else if (format === "base64") {
|
|
15478
|
-
stringSchema = stringSchema.check(
|
|
15665
|
+
stringSchema = stringSchema.check(z8.base64());
|
|
15479
15666
|
} else if (format === "base64url") {
|
|
15480
|
-
stringSchema = stringSchema.check(
|
|
15667
|
+
stringSchema = stringSchema.check(z8.base64url());
|
|
15481
15668
|
} else if (format === "e164") {
|
|
15482
|
-
stringSchema = stringSchema.check(
|
|
15669
|
+
stringSchema = stringSchema.check(z8.e164());
|
|
15483
15670
|
} else if (format === "jwt") {
|
|
15484
|
-
stringSchema = stringSchema.check(
|
|
15671
|
+
stringSchema = stringSchema.check(z8.jwt());
|
|
15485
15672
|
} else if (format === "emoji") {
|
|
15486
|
-
stringSchema = stringSchema.check(
|
|
15673
|
+
stringSchema = stringSchema.check(z8.emoji());
|
|
15487
15674
|
} else if (format === "nanoid") {
|
|
15488
|
-
stringSchema = stringSchema.check(
|
|
15675
|
+
stringSchema = stringSchema.check(z8.nanoid());
|
|
15489
15676
|
} else if (format === "cuid") {
|
|
15490
|
-
stringSchema = stringSchema.check(
|
|
15677
|
+
stringSchema = stringSchema.check(z8.cuid());
|
|
15491
15678
|
} else if (format === "cuid2") {
|
|
15492
|
-
stringSchema = stringSchema.check(
|
|
15679
|
+
stringSchema = stringSchema.check(z8.cuid2());
|
|
15493
15680
|
} else if (format === "ulid") {
|
|
15494
|
-
stringSchema = stringSchema.check(
|
|
15681
|
+
stringSchema = stringSchema.check(z8.ulid());
|
|
15495
15682
|
} else if (format === "xid") {
|
|
15496
|
-
stringSchema = stringSchema.check(
|
|
15683
|
+
stringSchema = stringSchema.check(z8.xid());
|
|
15497
15684
|
} else if (format === "ksuid") {
|
|
15498
|
-
stringSchema = stringSchema.check(
|
|
15685
|
+
stringSchema = stringSchema.check(z8.ksuid());
|
|
15499
15686
|
}
|
|
15500
15687
|
}
|
|
15501
15688
|
if (typeof schema.minLength === "number") {
|
|
@@ -15512,7 +15699,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15512
15699
|
}
|
|
15513
15700
|
case "number":
|
|
15514
15701
|
case "integer": {
|
|
15515
|
-
let numberSchema = type === "integer" ?
|
|
15702
|
+
let numberSchema = type === "integer" ? z8.number().int() : z8.number();
|
|
15516
15703
|
if (typeof schema.minimum === "number") {
|
|
15517
15704
|
numberSchema = numberSchema.min(schema.minimum);
|
|
15518
15705
|
}
|
|
@@ -15536,11 +15723,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15536
15723
|
break;
|
|
15537
15724
|
}
|
|
15538
15725
|
case "boolean": {
|
|
15539
|
-
zodSchema2 =
|
|
15726
|
+
zodSchema2 = z8.boolean();
|
|
15540
15727
|
break;
|
|
15541
15728
|
}
|
|
15542
15729
|
case "null": {
|
|
15543
|
-
zodSchema2 =
|
|
15730
|
+
zodSchema2 = z8.null();
|
|
15544
15731
|
break;
|
|
15545
15732
|
}
|
|
15546
15733
|
case "object": {
|
|
@@ -15553,14 +15740,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15553
15740
|
}
|
|
15554
15741
|
if (schema.propertyNames) {
|
|
15555
15742
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
15556
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) :
|
|
15743
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z8.any();
|
|
15557
15744
|
if (Object.keys(shape).length === 0) {
|
|
15558
|
-
zodSchema2 =
|
|
15745
|
+
zodSchema2 = z8.record(keySchema, valueSchema);
|
|
15559
15746
|
break;
|
|
15560
15747
|
}
|
|
15561
|
-
const objectSchema2 =
|
|
15562
|
-
const recordSchema =
|
|
15563
|
-
zodSchema2 =
|
|
15748
|
+
const objectSchema2 = z8.object(shape).passthrough();
|
|
15749
|
+
const recordSchema = z8.looseRecord(keySchema, valueSchema);
|
|
15750
|
+
zodSchema2 = z8.intersection(objectSchema2, recordSchema);
|
|
15564
15751
|
break;
|
|
15565
15752
|
}
|
|
15566
15753
|
if (schema.patternProperties) {
|
|
@@ -15569,28 +15756,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15569
15756
|
const looseRecords = [];
|
|
15570
15757
|
for (const pattern of patternKeys) {
|
|
15571
15758
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
15572
|
-
const keySchema =
|
|
15573
|
-
looseRecords.push(
|
|
15759
|
+
const keySchema = z8.string().regex(new RegExp(pattern));
|
|
15760
|
+
looseRecords.push(z8.looseRecord(keySchema, patternValue));
|
|
15574
15761
|
}
|
|
15575
15762
|
const schemasToIntersect = [];
|
|
15576
15763
|
if (Object.keys(shape).length > 0) {
|
|
15577
|
-
schemasToIntersect.push(
|
|
15764
|
+
schemasToIntersect.push(z8.object(shape).passthrough());
|
|
15578
15765
|
}
|
|
15579
15766
|
schemasToIntersect.push(...looseRecords);
|
|
15580
15767
|
if (schemasToIntersect.length === 0) {
|
|
15581
|
-
zodSchema2 =
|
|
15768
|
+
zodSchema2 = z8.object({}).passthrough();
|
|
15582
15769
|
} else if (schemasToIntersect.length === 1) {
|
|
15583
15770
|
zodSchema2 = schemasToIntersect[0];
|
|
15584
15771
|
} else {
|
|
15585
|
-
let result =
|
|
15772
|
+
let result = z8.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
15586
15773
|
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
15587
|
-
result =
|
|
15774
|
+
result = z8.intersection(result, schemasToIntersect[i]);
|
|
15588
15775
|
}
|
|
15589
15776
|
zodSchema2 = result;
|
|
15590
15777
|
}
|
|
15591
15778
|
break;
|
|
15592
15779
|
}
|
|
15593
|
-
const objectSchema =
|
|
15780
|
+
const objectSchema = z8.object(shape);
|
|
15594
15781
|
if (schema.additionalProperties === false) {
|
|
15595
15782
|
zodSchema2 = objectSchema.strict();
|
|
15596
15783
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -15607,33 +15794,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15607
15794
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
15608
15795
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
15609
15796
|
if (rest) {
|
|
15610
|
-
zodSchema2 =
|
|
15797
|
+
zodSchema2 = z8.tuple(tupleItems).rest(rest);
|
|
15611
15798
|
} else {
|
|
15612
|
-
zodSchema2 =
|
|
15799
|
+
zodSchema2 = z8.tuple(tupleItems);
|
|
15613
15800
|
}
|
|
15614
15801
|
if (typeof schema.minItems === "number") {
|
|
15615
|
-
zodSchema2 = zodSchema2.check(
|
|
15802
|
+
zodSchema2 = zodSchema2.check(z8.minLength(schema.minItems));
|
|
15616
15803
|
}
|
|
15617
15804
|
if (typeof schema.maxItems === "number") {
|
|
15618
|
-
zodSchema2 = zodSchema2.check(
|
|
15805
|
+
zodSchema2 = zodSchema2.check(z8.maxLength(schema.maxItems));
|
|
15619
15806
|
}
|
|
15620
15807
|
} else if (Array.isArray(items)) {
|
|
15621
15808
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
15622
15809
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
|
|
15623
15810
|
if (rest) {
|
|
15624
|
-
zodSchema2 =
|
|
15811
|
+
zodSchema2 = z8.tuple(tupleItems).rest(rest);
|
|
15625
15812
|
} else {
|
|
15626
|
-
zodSchema2 =
|
|
15813
|
+
zodSchema2 = z8.tuple(tupleItems);
|
|
15627
15814
|
}
|
|
15628
15815
|
if (typeof schema.minItems === "number") {
|
|
15629
|
-
zodSchema2 = zodSchema2.check(
|
|
15816
|
+
zodSchema2 = zodSchema2.check(z8.minLength(schema.minItems));
|
|
15630
15817
|
}
|
|
15631
15818
|
if (typeof schema.maxItems === "number") {
|
|
15632
|
-
zodSchema2 = zodSchema2.check(
|
|
15819
|
+
zodSchema2 = zodSchema2.check(z8.maxLength(schema.maxItems));
|
|
15633
15820
|
}
|
|
15634
15821
|
} else if (items !== void 0) {
|
|
15635
15822
|
const element = convertSchema(items, ctx);
|
|
15636
|
-
let arraySchema =
|
|
15823
|
+
let arraySchema = z8.array(element);
|
|
15637
15824
|
if (typeof schema.minItems === "number") {
|
|
15638
15825
|
arraySchema = arraySchema.min(schema.minItems);
|
|
15639
15826
|
}
|
|
@@ -15642,7 +15829,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15642
15829
|
}
|
|
15643
15830
|
zodSchema2 = arraySchema;
|
|
15644
15831
|
} else {
|
|
15645
|
-
zodSchema2 =
|
|
15832
|
+
zodSchema2 = z8.array(z8.any());
|
|
15646
15833
|
}
|
|
15647
15834
|
break;
|
|
15648
15835
|
}
|
|
@@ -15659,37 +15846,37 @@ function convertBaseSchema(schema, ctx) {
|
|
|
15659
15846
|
}
|
|
15660
15847
|
function convertSchema(schema, ctx) {
|
|
15661
15848
|
if (typeof schema === "boolean") {
|
|
15662
|
-
return schema ?
|
|
15849
|
+
return schema ? z8.any() : z8.never();
|
|
15663
15850
|
}
|
|
15664
15851
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
15665
15852
|
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
15666
15853
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
15667
15854
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
15668
|
-
const anyOfUnion =
|
|
15669
|
-
baseSchema = hasExplicitType ?
|
|
15855
|
+
const anyOfUnion = z8.union(options);
|
|
15856
|
+
baseSchema = hasExplicitType ? z8.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
15670
15857
|
}
|
|
15671
15858
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
15672
15859
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
15673
|
-
const oneOfUnion =
|
|
15674
|
-
baseSchema = hasExplicitType ?
|
|
15860
|
+
const oneOfUnion = z8.xor(options);
|
|
15861
|
+
baseSchema = hasExplicitType ? z8.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
15675
15862
|
}
|
|
15676
15863
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
15677
15864
|
if (schema.allOf.length === 0) {
|
|
15678
|
-
baseSchema = hasExplicitType ? baseSchema :
|
|
15865
|
+
baseSchema = hasExplicitType ? baseSchema : z8.any();
|
|
15679
15866
|
} else {
|
|
15680
15867
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
15681
15868
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
15682
15869
|
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
15683
|
-
result =
|
|
15870
|
+
result = z8.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
15684
15871
|
}
|
|
15685
15872
|
baseSchema = result;
|
|
15686
15873
|
}
|
|
15687
15874
|
}
|
|
15688
15875
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
15689
|
-
baseSchema =
|
|
15876
|
+
baseSchema = z8.nullable(baseSchema);
|
|
15690
15877
|
}
|
|
15691
15878
|
if (schema.readOnly === true) {
|
|
15692
|
-
baseSchema =
|
|
15879
|
+
baseSchema = z8.readonly(baseSchema);
|
|
15693
15880
|
}
|
|
15694
15881
|
const extraMeta = {};
|
|
15695
15882
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
@@ -15716,7 +15903,7 @@ function convertSchema(schema, ctx) {
|
|
|
15716
15903
|
}
|
|
15717
15904
|
function fromJSONSchema(schema, params) {
|
|
15718
15905
|
if (typeof schema === "boolean") {
|
|
15719
|
-
return schema ?
|
|
15906
|
+
return schema ? z8.any() : z8.never();
|
|
15720
15907
|
}
|
|
15721
15908
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
15722
15909
|
const defs = schema.$defs || schema.definitions || {};
|
|
@@ -15730,14 +15917,14 @@ function fromJSONSchema(schema, params) {
|
|
|
15730
15917
|
};
|
|
15731
15918
|
return convertSchema(schema, ctx);
|
|
15732
15919
|
}
|
|
15733
|
-
var
|
|
15920
|
+
var z8, RECOGNIZED_KEYS;
|
|
15734
15921
|
var init_from_json_schema = __esm({
|
|
15735
15922
|
"node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
|
|
15736
15923
|
init_registries();
|
|
15737
15924
|
init_checks2();
|
|
15738
15925
|
init_iso();
|
|
15739
15926
|
init_schemas2();
|
|
15740
|
-
|
|
15927
|
+
z8 = {
|
|
15741
15928
|
...schemas_exports2,
|
|
15742
15929
|
...checks_exports2,
|
|
15743
15930
|
iso: iso_exports
|