@deployxai/dxc 0.1.7 → 0.1.12

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.
@@ -596,6 +596,17 @@ var publishingPreviewLinkSchema = z4.object({
596
596
  snapshotHash: sha256Schema,
597
597
  url: z4.url()
598
598
  }).strict();
599
+ var publishingPreviewSelectionStateSchema = z4.object({
600
+ rootSnapshotHash: sha256Schema,
601
+ rootSnapshotId: z4.uuid(),
602
+ selectedSnapshotHash: sha256Schema,
603
+ selectedSnapshotId: z4.uuid(),
604
+ selectionRevision: z4.number().int().nonnegative(),
605
+ templateId: wechatTemplateIdSchema,
606
+ updatedAt: z4.iso.datetime(),
607
+ viewed: z4.boolean(),
608
+ viewedAt: z4.iso.datetime().nullable()
609
+ }).strict();
599
610
  var createPublishingApprovalRequestSchema = z4.object({
600
611
  accountId: z4.uuid(),
601
612
  confirmed: z4.literal(true),
@@ -621,7 +632,8 @@ var publishingApprovalSchema = z4.object({
621
632
  }
622
633
  });
623
634
  var createPublishingDraftIntentRequestSchema = z4.object({
624
- approvalId: z4.uuid()
635
+ approvalId: z4.uuid(),
636
+ previousIntentId: z4.uuid().optional()
625
637
  }).strict();
626
638
  var publishingDraftStatusSchema = z4.enum([
627
639
  "QUEUED",
@@ -1040,7 +1052,7 @@ var visualStageInlineAssetSchema = z5.object({
1040
1052
  sha256: z5.string().regex(/^[a-f0-9]{64}$/u),
1041
1053
  source: z5.enum(["agent-generated", "local-material"])
1042
1054
  }).strict();
1043
- var visualPlanStageArtifactFrontmatterSchema = z5.object({
1055
+ var visualPlanMaterializedArtifactFrontmatterSchema = z5.object({
1044
1056
  assetsDirectory: portableRelativePathSchema,
1045
1057
  coverAsset: portableRelativePathSchema,
1046
1058
  coverSha256: z5.string().regex(/^[a-f0-9]{64}$/u),
@@ -1052,6 +1064,65 @@ var visualPlanStageArtifactFrontmatterSchema = z5.object({
1052
1064
  inlineAssets: z5.array(visualStageInlineAssetSchema).max(20),
1053
1065
  inlineImagesSupported: z5.literal(true)
1054
1066
  }).strict();
1067
+ var visualGenerationPlannedAssetSchema = z5.object({
1068
+ placementAnchor: z5.string().regex(/^after-heading:[^\r\n]{1,160}$/u).optional(),
1069
+ purpose: z5.string().trim().min(1).max(300),
1070
+ role: z5.enum(["cover", "inline"]),
1071
+ source: z5.literal("agent-generated")
1072
+ }).strict().superRefine((asset, context) => {
1073
+ if (asset.role === "inline" && asset.placementAnchor === void 0) {
1074
+ context.addIssue({
1075
+ code: "custom",
1076
+ message: "inline proposal requires placementAnchor",
1077
+ path: ["placementAnchor"]
1078
+ });
1079
+ }
1080
+ if (asset.role === "cover" && asset.placementAnchor !== void 0) {
1081
+ context.addIssue({
1082
+ code: "custom",
1083
+ message: "cover proposal must not have placementAnchor",
1084
+ path: ["placementAnchor"]
1085
+ });
1086
+ }
1087
+ });
1088
+ var visualGenerationPlanSchema = z5.object({
1089
+ chargesQuota: z5.boolean(),
1090
+ dataTransit: z5.enum(["local-only", "agent-provider", "dxc-cloud"]),
1091
+ executionLocation: z5.enum(["local-device", "agent-hosted"]),
1092
+ maxAttempts: z5.number().int().min(1).max(2),
1093
+ plannedAssets: z5.array(visualGenerationPlannedAssetSchema).min(1).max(20),
1094
+ retryPolicy: z5.enum(["never", "verified-no-asset-no-charge-once"])
1095
+ }).strict().superRefine((value, context) => {
1096
+ if (value.plannedAssets.filter((asset) => asset.role === "cover").length > 1) {
1097
+ context.addIssue({
1098
+ code: "custom",
1099
+ message: "generation proposal allows at most one generated cover",
1100
+ path: ["plannedAssets"]
1101
+ });
1102
+ }
1103
+ if (value.maxAttempts === 1 && value.retryPolicy !== "never" || value.maxAttempts === 2 && value.retryPolicy !== "verified-no-asset-no-charge-once") {
1104
+ context.addIssue({
1105
+ code: "custom",
1106
+ message: "maxAttempts=1 requires retryPolicy=never; maxAttempts=2 requires verified-no-asset-no-charge-once",
1107
+ path: ["retryPolicy"]
1108
+ });
1109
+ }
1110
+ });
1111
+ var visualPlanGenerationProposalFrontmatterSchema = z5.object({
1112
+ assetsDirectory: portableRelativePathSchema,
1113
+ dxc: z5.object({
1114
+ ...contentStageMetadataBaseShape,
1115
+ artifactStatus: z5.literal("awaiting-user"),
1116
+ stage: z5.literal("visual-plan")
1117
+ }).strict(),
1118
+ generation: visualGenerationPlanSchema,
1119
+ inlineImagesSupported: z5.literal(true),
1120
+ planned: z5.literal(true)
1121
+ }).strict();
1122
+ var visualPlanStageArtifactFrontmatterSchema = z5.union([
1123
+ visualPlanMaterializedArtifactFrontmatterSchema,
1124
+ visualPlanGenerationProposalFrontmatterSchema
1125
+ ]);
1055
1126
  var qualityReviewStageArtifactFrontmatterSchema = z5.object({
1056
1127
  blockerCount: z5.number().int().nonnegative(),
1057
1128
  dxc: z5.object({
@@ -1094,6 +1165,9 @@ var deliveryStageArtifactFrontmatterSchema = z5.object({
1094
1165
  intentId: z5.uuid().nullable(),
1095
1166
  mediaId: z5.string().trim().min(1).max(256).nullable().optional(),
1096
1167
  previewExpiresAt: z5.iso.datetime(),
1168
+ previewSelectionRevision: z5.number().int().nonnegative(),
1169
+ retryAttempt: z5.number().int().nonnegative().default(0),
1170
+ retryOfIntentId: z5.uuid().nullable().optional(),
1097
1171
  rootSnapshotHash: z5.string().regex(/^[a-f0-9]{64}$/u),
1098
1172
  rootSnapshotId: z5.uuid(),
1099
1173
  selectedSnapshotHash: z5.string().regex(/^[a-f0-9]{64}$/u),
@@ -1108,6 +1182,13 @@ var deliveryStageArtifactFrontmatterSchema = z5.object({
1108
1182
  path: ["state"]
1109
1183
  });
1110
1184
  }
1185
+ if (value.retryAttempt === 0 && value.retryOfIntentId !== void 0 && value.retryOfIntentId !== null || value.retryAttempt > 0 && (value.retryOfIntentId === void 0 || value.retryOfIntentId === null)) {
1186
+ context.addIssue({
1187
+ code: "custom",
1188
+ message: "retryAttempt and retryOfIntentId must describe the same retry generation",
1189
+ path: ["retryOfIntentId"]
1190
+ });
1191
+ }
1111
1192
  });
1112
1193
  function contentStageArtifactFrontmatterSchema(stage) {
1113
1194
  switch (stage) {
@@ -1175,6 +1256,14 @@ var stepConfirmationBindingSchema = z5.object({
1175
1256
  });
1176
1257
  }
1177
1258
  });
1259
+ var externalActionAuthorizationSchema = z5.object({
1260
+ action: z5.literal("image-generation"),
1261
+ confirmedAt: z5.iso.datetime(),
1262
+ confirmedBy: z5.string().trim().min(1).max(160),
1263
+ planSnapshotHash: z5.string().regex(/^[a-f0-9]{64}$/u),
1264
+ plan: visualGenerationPlanSchema,
1265
+ requestedAt: z5.iso.datetime()
1266
+ }).strict();
1178
1267
  var stepCheckpointBaseShape = {
1179
1268
  artifact: checkpointArtifactSchema.optional(),
1180
1269
  completedAt: z5.iso.datetime().optional(),
@@ -1217,6 +1306,17 @@ var stepCheckpointSchema = z5.discriminatedUnion("checkpointVersion", [
1217
1306
  metadata: stepCheckpointMetadataSchema,
1218
1307
  outputs: z5.array(stageArtifactReferenceSchema).min(1).max(CONTENT_ARTIFACT_KINDS.length),
1219
1308
  waitingFor: z5.string().trim().min(1).max(500).nullable()
1309
+ }).strict(),
1310
+ z5.object({
1311
+ ...stepCheckpointBaseShape,
1312
+ authorizations: z5.array(externalActionAuthorizationSchema).max(20),
1313
+ checkpointVersion: z5.literal("4"),
1314
+ confirmationBinding: stepConfirmationBindingSchema.nullable(),
1315
+ confirmationPurpose: z5.enum(["external-action", "stage-completion"]).nullable(),
1316
+ inputs: z5.array(stageArtifactReferenceSchema).max(CONTENT_ARTIFACT_KINDS.length),
1317
+ metadata: stepCheckpointMetadataSchema,
1318
+ outputs: z5.array(stageArtifactReferenceSchema).min(1).max(CONTENT_ARTIFACT_KINDS.length),
1319
+ waitingFor: z5.string().trim().min(1).max(500).nullable()
1220
1320
  }).strict()
1221
1321
  ]).superRefine((checkpoint, context) => {
1222
1322
  if (checkpoint.artifact !== void 0 && checkpoint.artifact.kind !== checkpoint.stage) {
@@ -1231,7 +1331,7 @@ var stepCheckpointSchema = z5.discriminatedUnion("checkpointVersion", [
1231
1331
  message: "awaiting-user and completed checkpoints require an artifact"
1232
1332
  });
1233
1333
  }
1234
- if (checkpoint.artifact !== void 0 && checkpoint.status !== "awaiting-user" && checkpoint.status !== "completed") {
1334
+ if (checkpoint.artifact !== void 0 && checkpoint.status !== "awaiting-user" && checkpoint.status !== "completed" && !(checkpoint.checkpointVersion === "4" && checkpoint.status === "running" && checkpoint.stage === "visual-plan" && checkpoint.authorizations.length > 0)) {
1235
1335
  context.addIssue({
1236
1336
  code: "custom",
1237
1337
  message: "only awaiting-user and completed checkpoints may bind an artifact"
@@ -1285,7 +1385,7 @@ var stepCheckpointSchema = z5.discriminatedUnion("checkpointVersion", [
1285
1385
  message: "confirmed checkpoints must be completed"
1286
1386
  });
1287
1387
  }
1288
- if (checkpoint.checkpointVersion === "3") {
1388
+ if (checkpoint.checkpointVersion === "3" || checkpoint.checkpointVersion === "4") {
1289
1389
  if (checkpoint.confirmation === "pending" && checkpoint.confirmationBinding?.status !== "pending") {
1290
1390
  context.addIssue({
1291
1391
  code: "custom",
@@ -1305,6 +1405,38 @@ var stepCheckpointSchema = z5.discriminatedUnion("checkpointVersion", [
1305
1405
  });
1306
1406
  }
1307
1407
  }
1408
+ if (checkpoint.checkpointVersion === "4") {
1409
+ if (checkpoint.authorizations.length > 0 && checkpoint.stage !== "visual-plan") {
1410
+ context.addIssue({
1411
+ code: "custom",
1412
+ message: "image generation authorizations are only valid for visual-plan"
1413
+ });
1414
+ }
1415
+ if (checkpoint.stage === "visual-plan" && checkpoint.status === "running" && checkpoint.authorizations.length > 0 && checkpoint.artifact === void 0) {
1416
+ context.addIssue({
1417
+ code: "custom",
1418
+ message: "authorized visual-plan running checkpoint must bind its proposal artifact"
1419
+ });
1420
+ }
1421
+ if (checkpoint.confirmationBinding === null && checkpoint.confirmationPurpose !== null) {
1422
+ context.addIssue({
1423
+ code: "custom",
1424
+ message: "confirmation purpose requires a confirmation binding"
1425
+ });
1426
+ }
1427
+ if (checkpoint.confirmationBinding !== null && checkpoint.confirmationPurpose === null) {
1428
+ context.addIssue({
1429
+ code: "custom",
1430
+ message: "confirmation binding requires a confirmation purpose"
1431
+ });
1432
+ }
1433
+ if (checkpoint.confirmationPurpose === "external-action" && (checkpoint.stage !== "visual-plan" || checkpoint.status !== "awaiting-user" || checkpoint.confirmation !== "pending")) {
1434
+ context.addIssue({
1435
+ code: "custom",
1436
+ message: "external-action confirmation is only valid for a pending visual plan"
1437
+ });
1438
+ }
1439
+ }
1308
1440
  });
1309
1441
  var stepCheckpointInspectionSchema = z5.discriminatedUnion("state", [
1310
1442
  z5.object({
@@ -1359,6 +1491,20 @@ var contentProjectStatusResultSchema = z5.object({
1359
1491
  manifest: contentProjectManifestSchema,
1360
1492
  manifestPath: z5.literal("dxc.project.json"),
1361
1493
  nextStage: contentArtifactKindSchema.nullable(),
1494
+ recoveryPlan: z5.array(
1495
+ z5.object({
1496
+ action: z5.literal("rerun-stage"),
1497
+ reason: z5.enum([
1498
+ "artifact-changed",
1499
+ "artifact-empty",
1500
+ "artifact-missing",
1501
+ "input-artifact-changed",
1502
+ "input-artifact-empty",
1503
+ "input-artifact-missing"
1504
+ ]),
1505
+ stage: contentArtifactKindSchema
1506
+ }).strict()
1507
+ ),
1362
1508
  workflowStatus: z5.enum([
1363
1509
  "not-started",
1364
1510
  "in-progress",
@@ -1395,10 +1541,17 @@ var contentProjectResolveResultSchema = z5.object({
1395
1541
  var contentProjectCheckpointResultSchema = z5.object({
1396
1542
  command: z5.literal("project.checkpoint"),
1397
1543
  data: z5.object({
1544
+ artifactMutations: z5.array(
1545
+ z5.object({
1546
+ afterSha256: z5.string().regex(/^[a-f0-9]{64}$/u),
1547
+ beforeSha256: z5.string().regex(/^[a-f0-9]{64}$/u).nullable(),
1548
+ path: portableRelativePathSchema
1549
+ }).strict()
1550
+ ),
1398
1551
  checkpoint: stepCheckpointSchema,
1399
1552
  checkpointPath: portableRelativePathSchema,
1400
1553
  guidance: z5.object({
1401
- action: z5.literal("confirm-stage"),
1554
+ action: z5.enum(["authorize-external-action", "confirm-stage"]),
1402
1555
  message: z5.string().trim().min(1).max(500),
1403
1556
  suggestedFlag: z5.literal("--confirm")
1404
1557
  }).strict().nullable()
@@ -1421,7 +1574,11 @@ var contentProjectErrorResultSchema = z5.object({
1421
1574
  "DXC_PROJECT_NOT_FOUND",
1422
1575
  "DXC_PROJECT_STAGE_INVALID"
1423
1576
  ]),
1424
- message: z5.string().trim().min(1)
1577
+ fields: z5.array(z5.string().trim().min(1).max(200)).max(20).optional(),
1578
+ message: z5.string().trim().min(1),
1579
+ reason: z5.string().regex(/^[A-Z][A-Z0-9_]{2,63}$/u).optional(),
1580
+ recovery: z5.string().trim().min(1).max(500).optional(),
1581
+ stage: contentArtifactKindSchema.optional()
1425
1582
  }).strict(),
1426
1583
  ok: z5.literal(false)
1427
1584
  }).strict();
@@ -2123,8 +2280,10 @@ export {
2123
2280
  publishingArticleSchema,
2124
2281
  publishingRenderSnapshotSchema,
2125
2282
  publishingPreviewLinkSchema,
2283
+ publishingPreviewSelectionStateSchema,
2126
2284
  createPublishingApprovalRequestSchema,
2127
2285
  publishingApprovalSchema,
2286
+ createPublishingDraftIntentRequestSchema,
2128
2287
  publishingDraftIntentResponseSchema,
2129
2288
  CONTENT_WORKFLOW_ID,
2130
2289
  CONTENT_ARTIFACT_KINDS,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __dxcCreateRequire } from "node:module"; const require = __dxcCreateRequire(import.meta.url);
2
2
  import {
3
3
  sourceFetchResultSchema
4
- } from "./chunk-N4CMLINP.js";
4
+ } from "./chunk-BWOC5S2C.js";
5
5
 
6
6
  // apps/cli/src/source.ts
7
7
  import { createHash } from "node:crypto";
@@ -27,7 +27,7 @@ import {
27
27
  readPrivateFile,
28
28
  writePrivateBuffer,
29
29
  writePrivateJson
30
- } from "./chunk-N4CMLINP.js";
30
+ } from "./chunk-BWOC5S2C.js";
31
31
 
32
32
  // apps/cli/src/knowledge.ts
33
33
  import { createHash as createHash2, randomUUID } from "node:crypto";
@@ -2,7 +2,7 @@ import { createRequire as __dxcCreateRequire } from "node:module"; const require
2
2
  import {
3
3
  SourceCli,
4
4
  SourceCliError
5
- } from "./chunk-NAL5UOUZ.js";
5
+ } from "./chunk-PX25ABJR.js";
6
6
  import {
7
7
  CONTENT_MONITOR_SCHEMA_VERSION,
8
8
  LocalStateError,
@@ -14,7 +14,7 @@ import {
14
14
  contentMonitorStatusResultSchema,
15
15
  ensurePrivateRegularFile,
16
16
  sourceFetchKindSchema
17
- } from "./chunk-N4CMLINP.js";
17
+ } from "./chunk-BWOC5S2C.js";
18
18
 
19
19
  // apps/cli/src/monitor.ts
20
20
  import { createHash, randomUUID as systemRandomUUID } from "node:crypto";