@deployxai/dxc 0.2.6 → 0.3.0

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/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # DeployX 内容工作台(DxC)
2
2
 
3
- 这是 DxC 的官方 CLI 与 14 个领域 Skill。
4
-
5
- 安装、权限范围、Windows/WorkBuddy 使用方式与源码核验,请阅读:
6
- https://deployxai.com/dxc/
3
+ 这是 DxC 0.3.0 的官方 CLI 与 14 个领域 Skill。MVP 只支持微信公众号草稿,不正式发布或群发。
7
4
 
8
5
  ## 包含内容
9
6
 
@@ -13,5 +10,17 @@ https://deployxai.com/dxc/
13
10
  - `dxc-project-overview`:本机已登记项目总览;
14
11
  - `dxc-profile`、`dxc-memory`、`dxc-knowledge`、`dxc-quote-curator`:四个长期资产入口。
15
12
 
13
+ 文章总控通过 `projectId` 选择长期项目,阶段之间只转交当前不透明 `workItemId`。内容阶段只调用
14
+ `workflow next/complete --work-item`;交付阶段只调用 `workflow preview/deliver --work-item`。
15
+ 确认工作项绑定当前产物或最终不可变预览,变化后旧 ID 自动过期。
16
+
17
+ 安装 14 个 Skill:
18
+
19
+ ```text
20
+ dxc skills install --target workbuddy --json
21
+ ```
22
+
23
+ 完整命令与安全边界:https://deployxai.com/dxc/
24
+
16
25
  安装本包不会自动登录微信、绑定公众号、读取历史文章、上传内容或创建草稿。每项敏感操作
17
26
  均需要用户在后续流程中明确确认。
@@ -158,12 +158,7 @@ var contentKnowledgeQuoteMutationResultSchema = z.object({
158
158
  "knowledge.quotes.update",
159
159
  "knowledge.quotes.archive"
160
160
  ]),
161
- data: z.object({ pendingSync: z.literal(true), quote: contentKnowledgeQuoteRecordSchema }).strict(),
162
- ok: z.literal(true)
163
- }).strict();
164
- var contentKnowledgeQuoteInitResultSchema = z.object({
165
- command: z.literal("knowledge.quotes.init"),
166
- data: contentKnowledgeQuoteSummarySchema.extend({ created: z.boolean() }).strict(),
161
+ data: z.object({ quote: contentKnowledgeQuoteRecordSchema, synced: z.literal(true) }).strict(),
167
162
  ok: z.literal(true)
168
163
  }).strict();
169
164
  var contentKnowledgeQuoteStatusResultSchema = z.object({
@@ -171,14 +166,6 @@ var contentKnowledgeQuoteStatusResultSchema = z.object({
171
166
  data: contentKnowledgeQuoteSummarySchema,
172
167
  ok: z.literal(true)
173
168
  }).strict();
174
- var contentKnowledgeQuoteSyncResultSchema = z.object({
175
- command: z.literal("knowledge.quotes.sync"),
176
- data: contentKnowledgeQuoteSummarySchema.extend({
177
- model: contentKnowledgeModelSchema.nullable(),
178
- status: z.enum(["created", "updated", "unchanged"])
179
- }).strict(),
180
- ok: z.literal(true)
181
- }).strict();
182
169
  var contentKnowledgeSearchItemLegacySchema = z.object({
183
170
  articleId: z.uuid(),
184
171
  chunkId: z.uuid(),
@@ -227,12 +214,10 @@ var contentKnowledgeCommandSchema = z.enum([
227
214
  "knowledge.remove",
228
215
  "knowledge.search",
229
216
  "knowledge.status",
230
- "knowledge.quotes.init",
231
217
  "knowledge.quotes.add",
232
218
  "knowledge.quotes.archive",
233
219
  "knowledge.quotes.list",
234
220
  "knowledge.quotes.status",
235
- "knowledge.quotes.sync",
236
221
  "knowledge.quotes.update"
237
222
  ]);
238
223
  var contentKnowledgeErrorResultSchema = z.object({
@@ -253,6 +238,18 @@ var contentKnowledgeErrorResultSchema = z.object({
253
238
  "DXC_KNOWLEDGE_SEMANTIC_NOT_READY",
254
239
  "DXC_KNOWLEDGE_STATE_INVALID"
255
240
  ]),
241
+ details: z.object({
242
+ nextAction: z.object({
243
+ choices: z.array(
244
+ z.object({
245
+ choiceId: z.string().regex(/^knowledge-choice1_[A-Za-z0-9_-]+\.[a-f0-9]{32}$/u),
246
+ label: z.string().trim().min(1).max(120)
247
+ }).strict()
248
+ ).length(2),
249
+ purpose: z.literal("knowledge-model-unavailable"),
250
+ type: z.literal("select-choice")
251
+ }).strict()
252
+ }).strict().optional(),
256
253
  message: z.string().trim().min(1)
257
254
  }).strict(),
258
255
  ok: z.literal(false)
@@ -544,16 +541,154 @@ var CONTENT_ARTIFACT_KINDS = [
544
541
  "delivery"
545
542
  ];
546
543
  var contentArtifactKindSchema = z3.enum(CONTENT_ARTIFACT_KINDS);
547
- var CONTENT_STAGE_INPUTS = {
548
- article: { optional: [], required: ["research", "brief", "outline"] },
549
- brief: { optional: [], required: ["research"] },
550
- delivery: { optional: [], required: ["article", "titles", "visual-plan", "quality-review"] },
551
- outline: { optional: [], required: ["research", "brief"] },
552
- "quality-review": { optional: ["visual-plan"], required: ["research", "article", "titles"] },
553
- research: { optional: [], required: [] },
554
- titles: { optional: ["brief"], required: ["article"] },
555
- "visual-plan": { optional: ["outline"], required: ["article", "titles"] }
544
+ var DXC_STAGE_SKILL_NAMES = [
545
+ "dxc-research",
546
+ "dxc-content-brief",
547
+ "dxc-article-outline",
548
+ "dxc-article-write",
549
+ "dxc-title-write",
550
+ "dxc-visual-plan",
551
+ "dxc-content-review",
552
+ "dxc-wechat-publisher"
553
+ ];
554
+ var dxcStageSkillNameSchema = z3.enum(DXC_STAGE_SKILL_NAMES);
555
+ var CONTENT_STAGE_DEFINITIONS = {
556
+ article: {
557
+ inputs: { optional: [], required: ["research", "brief", "outline"] },
558
+ output: "article",
559
+ skill: "dxc-article-write",
560
+ stage: "article"
561
+ },
562
+ brief: {
563
+ inputs: { optional: [], required: ["research"] },
564
+ output: "brief",
565
+ skill: "dxc-content-brief",
566
+ stage: "brief"
567
+ },
568
+ delivery: {
569
+ inputs: { optional: [], required: ["article", "titles", "visual-plan", "quality-review"] },
570
+ output: "delivery",
571
+ skill: "dxc-wechat-publisher",
572
+ stage: "delivery"
573
+ },
574
+ outline: {
575
+ inputs: { optional: [], required: ["research", "brief"] },
576
+ output: "outline",
577
+ skill: "dxc-article-outline",
578
+ stage: "outline"
579
+ },
580
+ "quality-review": {
581
+ inputs: { optional: ["visual-plan"], required: ["research", "article", "titles"] },
582
+ output: "quality-review",
583
+ skill: "dxc-content-review",
584
+ stage: "quality-review"
585
+ },
586
+ research: {
587
+ inputs: { optional: [], required: [] },
588
+ output: "research",
589
+ skill: "dxc-research",
590
+ stage: "research"
591
+ },
592
+ titles: {
593
+ inputs: { optional: ["brief"], required: ["article"] },
594
+ output: "titles",
595
+ skill: "dxc-title-write",
596
+ stage: "titles"
597
+ },
598
+ "visual-plan": {
599
+ inputs: { optional: ["outline"], required: ["article", "titles"] },
600
+ output: "visual-plan",
601
+ skill: "dxc-visual-plan",
602
+ stage: "visual-plan"
603
+ }
556
604
  };
605
+ var contentWorkflowWorkItemIdSchema = z3.string().regex(/^wi1_[A-Za-z0-9_-]+\.[a-f0-9]{32}$/u);
606
+ var contentWorkflowChoiceIdSchema = z3.string().regex(/^choice1_[A-Za-z0-9_-]+\.[a-f0-9]{32}$/u);
607
+ var contentWorkflowSectionIdSchema = z3.string().regex(/^sec_[0-9]{2}_[a-f0-9]{8}$/u);
608
+ var contentWorkflowAssetIdSchema = z3.enum([
609
+ "cover",
610
+ ...Array.from({ length: 20 }, (_, index) => `inline-${String(index + 1).padStart(2, "0")}`)
611
+ ]);
612
+ var contentWorkflowChoiceSchema = z3.object({
613
+ choiceId: contentWorkflowChoiceIdSchema,
614
+ label: z3.string().trim().min(1).max(120)
615
+ }).strict();
616
+ var contentWorkflowAssetAssignmentSchema = z3.object({
617
+ assetId: contentWorkflowAssetIdSchema,
618
+ path: z3.string().trim().min(1).max(4096),
619
+ role: z3.enum(["cover", "inline"]),
620
+ sectionId: contentWorkflowSectionIdSchema.optional()
621
+ }).strict();
622
+ var contentWorkflowNextActionSchema = z3.discriminatedUnion("type", [
623
+ z3.object({ type: z3.literal("run-stage") }).strict(),
624
+ z3.object({
625
+ assets: z3.array(contentWorkflowAssetAssignmentSchema).min(1).max(21),
626
+ type: z3.literal("generate-assets")
627
+ }).strict(),
628
+ z3.object({
629
+ presentation: z3.object({ path: z3.string().trim().min(1).max(4096), type: z3.literal("artifact") }).strict(),
630
+ type: z3.literal("confirm-stage")
631
+ }).strict(),
632
+ z3.object({
633
+ choices: z3.array(contentWorkflowChoiceSchema).min(2).max(100),
634
+ purpose: z3.literal("wechat-account"),
635
+ type: z3.literal("select-choice")
636
+ }).strict(),
637
+ z3.object({ type: z3.literal("preview") }).strict(),
638
+ z3.object({
639
+ expiresAt: z3.iso.datetime(),
640
+ type: z3.literal("confirm-delivery")
641
+ }).strict(),
642
+ z3.object({ type: z3.literal("completed") }).strict()
643
+ ]);
644
+ var contentWorkflowInputResourceSchema = z3.discriminatedUnion("availability", [
645
+ z3.object({ availability: z3.literal("missing") }).strict(),
646
+ z3.object({
647
+ availability: z3.literal("present"),
648
+ path: z3.string().trim().min(1).max(4096)
649
+ }).strict()
650
+ ]);
651
+ var contentWorkflowResourcesSchema = z3.object({
652
+ inputs: z3.record(z3.string(), contentWorkflowInputResourceSchema),
653
+ output: z3.object({
654
+ path: z3.string().trim().min(1).max(4096),
655
+ scaffold: z3.enum(["created", "existing", "not-applicable"])
656
+ }).strict()
657
+ }).strict();
658
+ var contentWorkflowConstraintsSchema = z3.object({
659
+ authorMaxCharacters: z3.number().int().positive().optional(),
660
+ coverMaxBytes: z3.number().int().positive().optional(),
661
+ digestMaxCharacters: z3.number().int().positive().optional(),
662
+ inlineImageMaxBytes: z3.number().int().positive().optional(),
663
+ inlineImageMaxCount: z3.number().int().positive().optional(),
664
+ supportedImageTypes: z3.array(z3.enum(["image/jpeg", "image/png"])).optional(),
665
+ titleMaxCharacters: z3.number().int().positive().optional()
666
+ }).strict();
667
+ var contentWorkflowSectionSchema = z3.object({
668
+ heading: z3.string().trim().min(1).max(300),
669
+ sectionId: contentWorkflowSectionIdSchema
670
+ }).strict();
671
+ var contentWorkflowProjectSummarySchema = z3.object({
672
+ projectId: z3.uuid(),
673
+ title: z3.string().trim().min(1).max(160)
674
+ }).strict();
675
+ var contentWorkflowWorkItemSchema = z3.object({
676
+ constraints: contentWorkflowConstraintsSchema.optional(),
677
+ nextAction: contentWorkflowNextActionSchema,
678
+ resources: contentWorkflowResourcesSchema.optional(),
679
+ sections: z3.array(contentWorkflowSectionSchema).max(100).optional(),
680
+ skill: dxcStageSkillNameSchema,
681
+ stage: contentArtifactKindSchema,
682
+ workItemId: contentWorkflowWorkItemIdSchema
683
+ }).strict();
684
+ var contentWorkflowNextResultSchema = z3.object({
685
+ command: z3.literal("workflow.next"),
686
+ data: z3.object({
687
+ project: contentWorkflowProjectSummarySchema,
688
+ workItem: contentWorkflowWorkItemSchema
689
+ }).strict(),
690
+ ok: z3.literal(true)
691
+ }).strict();
557
692
  function isPortableRelativePath(value) {
558
693
  if (value.startsWith("/") || value.includes("\\") || /[:*?"<>|\0]/u.test(value)) {
559
694
  return false;
@@ -631,17 +766,6 @@ var contentProfileInputSchema = z3.object({
631
766
  questionnaireVersion: z3.literal(CONTENT_PROFILE_QUESTIONNAIRE_VERSION),
632
767
  user: currentProfileUserSchema
633
768
  }).strict();
634
- var {
635
- confirmationPolicy: ignoredConfirmationPolicy,
636
- primaryPlatform: ignoredPrimaryPlatform,
637
- ...profileUpdateUserShape
638
- } = currentProfileUserSchema.shape;
639
- var contentProfileUpdateInputSchema = z3.object({
640
- answers: z3.array(contentProfileAnswerSchema).min(1).max(32).optional(),
641
- user: z3.object({ confirmationPolicy: contentConfirmationPolicySchema, ...profileUpdateUserShape }).partial().optional()
642
- }).strict().refine((input) => input.answers !== void 0 || input.user !== void 0, {
643
- message: "profile update must include answers or user fields"
644
- });
645
769
  var contentProfileSchema = z3.object({
646
770
  answers: z3.array(contentProfileAnswerSchema).max(32),
647
771
  createdAt: z3.iso.datetime(),
@@ -656,16 +780,6 @@ var contentProfileResultDataSchema = z3.object({
656
780
  profilePath: z3.literal("~/.dxc/content-profile.json"),
657
781
  userMemoryPath: z3.literal("~/.dxc/USER.md")
658
782
  }).strict();
659
- var contentProfileSaveResultSchema = z3.object({
660
- command: z3.literal("profile.save"),
661
- data: contentProfileResultDataSchema,
662
- ok: z3.literal(true)
663
- }).strict();
664
- var contentProfileUpdateResultSchema = z3.object({
665
- command: z3.literal("profile.update"),
666
- data: contentProfileResultDataSchema,
667
- ok: z3.literal(true)
668
- }).strict();
669
783
  var contentProfileStatusResultSchema = z3.object({
670
784
  command: z3.literal("profile.status"),
671
785
  data: z3.discriminatedUnion("configured", [
@@ -678,10 +792,39 @@ var contentProfileStatusResultSchema = z3.object({
678
792
  ]),
679
793
  ok: z3.literal(true)
680
794
  }).strict();
795
+ var contentProfileSessionIdSchema = z3.uuid();
796
+ var contentProfileQuestionSchema = z3.object({
797
+ choices: z3.array(
798
+ z3.object({
799
+ choiceId: z3.string().regex(/^profile_[a-z0-9.-]+$/u),
800
+ label: z3.string().trim().min(1).max(120)
801
+ }).strict()
802
+ ).max(12),
803
+ inputType: z3.enum(["multi-choice", "single-choice", "text"]),
804
+ prompt: z3.string().trim().min(1).max(500),
805
+ questionId: z3.string().regex(/^[a-z][a-z0-9.-]{1,63}$/u)
806
+ }).strict();
807
+ var contentProfileSessionResultSchema = z3.object({
808
+ command: z3.enum(["profile.answer", "profile.begin"]),
809
+ data: z3.discriminatedUnion("status", [
810
+ z3.object({
811
+ profileSessionId: contentProfileSessionIdSchema,
812
+ question: contentProfileQuestionSchema,
813
+ status: z3.literal("question")
814
+ }).strict(),
815
+ z3.object({
816
+ profile: contentProfileSchema,
817
+ profilePath: z3.literal("~/.dxc/content-profile.json"),
818
+ status: z3.literal("completed"),
819
+ userMemoryPath: z3.literal("~/.dxc/USER.md")
820
+ }).strict()
821
+ ]),
822
+ ok: z3.literal(true)
823
+ }).strict();
681
824
  var contentProfileCommandSchema = z3.enum([
682
- "profile.save",
683
- "profile.status",
684
- "profile.update"
825
+ "profile.answer",
826
+ "profile.begin",
827
+ "profile.status"
685
828
  ]);
686
829
  var contentProfileErrorResultSchema = z3.object({
687
830
  command: contentProfileCommandSchema,
@@ -734,12 +877,25 @@ var contentMemoryArchiveResultSchema = z3.object({
734
877
  data: contentMemoryResultDataSchema.extend({ memory: contentMemoryRecordSchema }),
735
878
  ok: z3.literal(true)
736
879
  }).strict();
880
+ var contentMemoryCorrectResultSchema = z3.object({
881
+ command: z3.literal("memory.correct"),
882
+ data: contentMemoryResultDataSchema.extend({
883
+ archivedMemory: contentMemoryRecordSchema,
884
+ memory: contentMemoryRecordSchema
885
+ }),
886
+ ok: z3.literal(true)
887
+ }).strict();
737
888
  var contentMemoryListResultSchema = z3.object({
738
889
  command: z3.literal("memory.list"),
739
890
  data: contentMemoryResultDataSchema,
740
891
  ok: z3.literal(true)
741
892
  }).strict();
742
- var contentMemoryCommandSchema = z3.enum(["memory.add", "memory.archive", "memory.list"]);
893
+ var contentMemoryCommandSchema = z3.enum([
894
+ "memory.add",
895
+ "memory.archive",
896
+ "memory.correct",
897
+ "memory.list"
898
+ ]);
743
899
  var contentMemoryErrorResultSchema = z3.object({
744
900
  command: contentMemoryCommandSchema,
745
901
  error: z3.object({
@@ -1313,20 +1469,19 @@ export {
1313
1469
  publishingDraftAttentionDiagnosticsSchema,
1314
1470
  CONTENT_WORKFLOW_ID,
1315
1471
  CONTENT_ARTIFACT_KINDS,
1316
- CONTENT_STAGE_INPUTS,
1472
+ CONTENT_STAGE_DEFINITIONS,
1317
1473
  portableRelativePathSchema,
1318
1474
  contentProjectManifestSchema,
1319
1475
  contentProjectIndexSchema,
1320
1476
  contentProfileInputSchema,
1321
- contentProfileUpdateInputSchema,
1322
1477
  contentProfileSchema,
1323
- contentProfileSaveResultSchema,
1324
- contentProfileUpdateResultSchema,
1325
1478
  contentProfileStatusResultSchema,
1479
+ contentProfileSessionResultSchema,
1326
1480
  contentMemoryInputSchema,
1327
1481
  contentMemoryStoreSchema,
1328
1482
  contentMemoryAddResultSchema,
1329
1483
  contentMemoryArchiveResultSchema,
1484
+ contentMemoryCorrectResultSchema,
1330
1485
  contentMemoryListResultSchema,
1331
1486
  CONTENT_KNOWLEDGE_SCHEMA_VERSION,
1332
1487
  CONTENT_KNOWLEDGE_EMBEDDING_MODEL,
@@ -1339,9 +1494,7 @@ export {
1339
1494
  contentKnowledgeImportResultSchema,
1340
1495
  contentKnowledgeQuoteListResultSchema,
1341
1496
  contentKnowledgeQuoteMutationResultSchema,
1342
- contentKnowledgeQuoteInitResultSchema,
1343
1497
  contentKnowledgeQuoteStatusResultSchema,
1344
- contentKnowledgeQuoteSyncResultSchema,
1345
1498
  contentKnowledgeSearchResultSchema,
1346
1499
  contentKnowledgeStatusResultSchema,
1347
1500
  contentKnowledgeRemoveResultSchema,