@purpleschool/gptbot-tools 0.2.88 → 0.3.88-stage-2

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.
Files changed (79) hide show
  1. package/build/html-page-builder/commands/get-html-page-builder-price-calculation-data.command.d.ts +31 -7
  2. package/build/html-page-builder/commands/get-html-page-builder-price-calculation-data.command.js +30 -3
  3. package/build/html-page-builder/commands/html-page-builder-answer-questions.command.d.ts +244 -0
  4. package/build/html-page-builder/commands/html-page-builder-answer-questions.command.js +23 -0
  5. package/build/html-page-builder/commands/html-page-builder-execute.command.d.ts +138 -8
  6. package/build/html-page-builder/commands/html-page-builder-execute.command.js +18 -0
  7. package/build/html-page-builder/commands/index.d.ts +2 -1
  8. package/build/html-page-builder/commands/index.js +2 -1
  9. package/build/html-page-builder/commands/update-html-page-builder-session-favorite.command.d.ts +128 -8
  10. package/build/html-page-builder/commands/update-html-page-builder-session-reaction.command.d.ts +242 -0
  11. package/build/html-page-builder/commands/update-html-page-builder-session-reaction.command.js +22 -0
  12. package/build/html-page-builder/commands/update-html-page-builder-session-title.command.d.ts +128 -8
  13. package/build/html-page-builder/enums/html-page-builder-catalog-sort.enum.d.ts +4 -0
  14. package/build/html-page-builder/enums/html-page-builder-catalog-sort.enum.js +9 -0
  15. package/build/html-page-builder/enums/html-page-builder-font-tag.enum.d.ts +5 -0
  16. package/build/html-page-builder/enums/html-page-builder-font-tag.enum.js +10 -0
  17. package/build/html-page-builder/enums/html-page-builder-generation-step.enum.d.ts +15 -0
  18. package/build/html-page-builder/enums/html-page-builder-generation-step.enum.js +17 -0
  19. package/build/html-page-builder/enums/html-page-builder-question-type.enum.d.ts +12 -0
  20. package/build/html-page-builder/enums/html-page-builder-question-type.enum.js +16 -0
  21. package/build/html-page-builder/enums/html-page-builder-session-status.enum.d.ts +19 -0
  22. package/build/html-page-builder/enums/html-page-builder-session-status.enum.js +23 -0
  23. package/build/html-page-builder/enums/html-page-builder-style-tag.enum.d.ts +8 -0
  24. package/build/html-page-builder/enums/html-page-builder-style-tag.enum.js +12 -0
  25. package/build/html-page-builder/enums/index.d.ts +6 -1
  26. package/build/html-page-builder/enums/index.js +6 -1
  27. package/build/html-page-builder/models/html-page-builder-clarification.schema.d.ts +40 -0
  28. package/build/html-page-builder/models/html-page-builder-clarification.schema.js +32 -0
  29. package/build/html-page-builder/models/html-page-builder-config.schema.d.ts +109 -0
  30. package/build/html-page-builder/models/html-page-builder-config.schema.js +19 -1
  31. package/build/html-page-builder/models/html-page-builder-font.schema.d.ts +24 -0
  32. package/build/html-page-builder/models/html-page-builder-font.schema.js +19 -0
  33. package/build/html-page-builder/models/html-page-builder-job.schema.d.ts +78 -3
  34. package/build/html-page-builder/models/html-page-builder-job.schema.js +50 -3
  35. package/build/html-page-builder/models/html-page-builder-page.schema.d.ts +25 -0
  36. package/build/html-page-builder/models/html-page-builder-page.schema.js +13 -0
  37. package/build/html-page-builder/models/html-page-builder-preset.schema.d.ts +58 -0
  38. package/build/html-page-builder/models/html-page-builder-preset.schema.js +23 -0
  39. package/build/html-page-builder/models/html-page-builder-session.schema.d.ts +67 -7
  40. package/build/html-page-builder/models/html-page-builder-session.schema.js +15 -3
  41. package/build/html-page-builder/models/html-page-builder-shared-site.schema.d.ts +12 -0
  42. package/build/html-page-builder/models/html-page-builder-shared-site.schema.js +16 -0
  43. package/build/html-page-builder/models/html-page-builder-sitemap.schema.d.ts +31 -0
  44. package/build/html-page-builder/models/html-page-builder-sitemap.schema.js +17 -0
  45. package/build/html-page-builder/models/html-page-builder-style.schema.d.ts +16 -0
  46. package/build/html-page-builder/models/html-page-builder-style.schema.js +19 -0
  47. package/build/html-page-builder/models/html-page-builder-token-usage.schema.d.ts +35 -0
  48. package/build/html-page-builder/models/html-page-builder-token-usage.schema.js +21 -0
  49. package/build/html-page-builder/models/index.d.ts +8 -0
  50. package/build/html-page-builder/models/index.js +8 -0
  51. package/build/html-page-builder/queries/find-html-page-builder-font-by-id.query.d.ts +55 -0
  52. package/build/html-page-builder/queries/find-html-page-builder-font-by-id.query.js +15 -0
  53. package/build/html-page-builder/queries/find-html-page-builder-fonts.query.d.ts +69 -0
  54. package/build/html-page-builder/queries/find-html-page-builder-fonts.query.js +28 -0
  55. package/build/html-page-builder/queries/find-html-page-builder-presets.query.d.ts +136 -0
  56. package/build/html-page-builder/queries/find-html-page-builder-presets.query.js +21 -0
  57. package/build/html-page-builder/queries/find-html-page-builder-session-by-id.query.d.ts +128 -8
  58. package/build/html-page-builder/queries/find-html-page-builder-sessions.query.d.ts +133 -12
  59. package/build/html-page-builder/queries/find-html-page-builder-sessions.query.js +2 -1
  60. package/build/html-page-builder/queries/find-html-page-builder-style-by-id.query.d.ts +39 -0
  61. package/build/html-page-builder/queries/find-html-page-builder-style-by-id.query.js +15 -0
  62. package/build/html-page-builder/queries/find-html-page-builder-styles.query.d.ts +53 -0
  63. package/build/html-page-builder/queries/find-html-page-builder-styles.query.js +28 -0
  64. package/build/html-page-builder/queries/get-html-page-builder-config.query.d.ts +196 -0
  65. package/build/html-page-builder/queries/get-shared-html-page-builder-site.query.d.ts +20 -0
  66. package/build/html-page-builder/queries/get-shared-html-page-builder-site.query.js +15 -0
  67. package/build/html-page-builder/queries/index.d.ts +6 -0
  68. package/build/html-page-builder/queries/index.js +6 -0
  69. package/build/html-page-builder/routes/html-page-builder.amqp.routes.d.ts +8 -1
  70. package/build/html-page-builder/routes/html-page-builder.amqp.routes.js +11 -1
  71. package/build/tools/models/global-tools-config.schema.d.ts +98 -0
  72. package/build/tools/models/tools-with-configs.schema.d.ts +196 -0
  73. package/build/tools/queries/get-global-tools-config.query.d.ts +196 -0
  74. package/build/tools/queries/get-tools-with-configs.query.d.ts +196 -0
  75. package/package.json +1 -1
  76. package/build/html-page-builder/commands/create-html-page-builder-session.command.d.ts +0 -118
  77. package/build/html-page-builder/commands/create-html-page-builder-session.command.js +0 -28
  78. package/build/html-page-builder/enums/html-page-builder-session-stage.enum.d.ts +0 -4
  79. package/build/html-page-builder/enums/html-page-builder-session-stage.enum.js +0 -8
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderFontSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../common");
6
+ const enums_1 = require("../enums");
7
+ // `fontPrompt` stays internal, same as the style's stylePrompt
8
+ exports.HtmlPageBuilderFontSchema = zod_1.z.object({
9
+ uuid: zod_1.z.uuid(),
10
+ code: zod_1.z.string(),
11
+ title: zod_1.z.string(),
12
+ description: zod_1.z.string().nullable().optional(),
13
+ icons: common_1.IconVariantsSchema,
14
+ tags: zod_1.z.array(zod_1.z.enum(enums_1.HTML_PAGE_BUILDER_FONT_TAG)),
15
+ popularity: zod_1.z.number(),
16
+ order: zod_1.z.number(),
17
+ createdAt: zod_1.z.coerce.date(),
18
+ updatedAt: zod_1.z.coerce.date(),
19
+ });
@@ -1,6 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  import { JOB_STATUS } from '../../tools';
3
- import { USER_REACTION } from '../../common';
4
3
  export declare const HtmlPageBuilderJobParamsSchema: z.ZodObject<{
5
4
  attachedFiles: z.ZodArray<z.ZodObject<{
6
5
  uuid: z.ZodString;
@@ -13,8 +12,28 @@ export declare const HtmlPageBuilderJobParamsSchema: z.ZodObject<{
13
12
  content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
14
13
  contentLength: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
15
14
  }, z.core.$strip>>;
15
+ pagesCount: z.ZodOptional<z.ZodNumber>;
16
+ clarifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
17
+ question: z.ZodString;
18
+ answer: z.ZodString;
19
+ }, z.core.$strip>>>;
20
+ mock: z.ZodOptional<z.ZodBoolean>;
16
21
  }, z.core.$strip>;
17
22
  export type HtmlPageBuilderJobParams = z.infer<typeof HtmlPageBuilderJobParamsSchema>;
23
+ /**
24
+ * Addresses of the published files of this generation, for reading the source as files rather
25
+ * than as one inlined document. Empty when the upload did not happen — the site itself is
26
+ * unaffected, there is simply nothing to open.
27
+ */
28
+ export declare const HtmlPageBuilderJobFilesSchema: z.ZodObject<{
29
+ stylesheet: z.ZodString;
30
+ script: z.ZodString;
31
+ pages: z.ZodArray<z.ZodObject<{
32
+ slug: z.ZodString;
33
+ url: z.ZodString;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip>;
36
+ export type HtmlPageBuilderJobFiles = z.infer<typeof HtmlPageBuilderJobFilesSchema>;
18
37
  export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
19
38
  uuid: z.ZodString;
20
39
  sessionId: z.ZodString;
@@ -22,16 +41,45 @@ export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
22
41
  userPrompt: z.ZodString;
23
42
  title: z.ZodString;
24
43
  generatedHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ generatedPages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
45
+ slug: z.ZodString;
46
+ title: z.ZodString;
47
+ html: z.ZodString;
48
+ order: z.ZodNumber;
49
+ isHome: z.ZodBoolean;
50
+ }, z.core.$strip>>>>;
51
+ previewUrl: z.ZodOptional<z.ZodString>;
52
+ files: z.ZodOptional<z.ZodObject<{
53
+ stylesheet: z.ZodString;
54
+ script: z.ZodString;
55
+ pages: z.ZodArray<z.ZodObject<{
56
+ slug: z.ZodString;
57
+ url: z.ZodString;
58
+ }, z.core.$strip>>;
59
+ }, z.core.$strip>>;
25
60
  status: z.ZodEnum<typeof JOB_STATUS>;
26
61
  error: z.ZodNullable<z.ZodString>;
27
62
  internalError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
63
  price: z.ZodNumber;
29
- reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
30
- dislikeReason: z.ZodNullable<z.ZodString>;
31
64
  inputTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
32
65
  outputTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
33
66
  totalTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
34
67
  tokenReservationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
69
+ id: z.ZodString;
70
+ question: z.ZodString;
71
+ type: z.ZodEnum<typeof import("..").HTML_PAGE_BUILDER_QUESTION_TYPE>;
72
+ options: z.ZodArray<z.ZodString>;
73
+ recommendedAnswer: z.ZodString;
74
+ allowCustomAnswer: z.ZodBoolean;
75
+ }, z.core.$strip>>>;
76
+ answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
77
+ questionId: z.ZodString;
78
+ answers: z.ZodArray<z.ZodString>;
79
+ }, z.core.$strip>>>;
80
+ styleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ fontId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
+ accentColor: z.ZodDefault<z.ZodString>;
35
83
  userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
84
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
85
  params: z.ZodObject<{
@@ -46,6 +94,12 @@ export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
46
94
  content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
47
95
  contentLength: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
48
96
  }, z.core.$strip>>;
97
+ pagesCount: z.ZodOptional<z.ZodNumber>;
98
+ clarifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
99
+ question: z.ZodString;
100
+ answer: z.ZodString;
101
+ }, z.core.$strip>>>;
102
+ mock: z.ZodOptional<z.ZodBoolean>;
49
103
  }, z.core.$strip>;
50
104
  isDeleted: z.ZodBoolean;
51
105
  createdAt: z.ZodDate;
@@ -53,3 +107,24 @@ export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
53
107
  updatedAt: z.ZodDate;
54
108
  }, z.core.$strip>;
55
109
  export type HtmlPageBuilderJob = z.infer<typeof HtmlPageBuilderJobSchema>;
110
+ /**
111
+ * The generation a session points at, as the list of sites needs it: the address and the state,
112
+ * without the site itself. A list of twenty sessions must not carry twenty sites.
113
+ */
114
+ export declare const HtmlPageBuilderCurrentJobSchema: z.ZodObject<{
115
+ uuid: z.ZodString;
116
+ status: z.ZodEnum<typeof JOB_STATUS>;
117
+ previewUrl: z.ZodOptional<z.ZodString>;
118
+ files: z.ZodOptional<z.ZodObject<{
119
+ stylesheet: z.ZodString;
120
+ script: z.ZodString;
121
+ pages: z.ZodArray<z.ZodObject<{
122
+ slug: z.ZodString;
123
+ url: z.ZodString;
124
+ }, z.core.$strip>>;
125
+ }, z.core.$strip>>;
126
+ error: z.ZodNullable<z.ZodString>;
127
+ createdAt: z.ZodDate;
128
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
129
+ }, z.core.$strip>;
130
+ export type HtmlPageBuilderCurrentJob = z.infer<typeof HtmlPageBuilderCurrentJobSchema>;
@@ -1,11 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HtmlPageBuilderJobSchema = exports.HtmlPageBuilderJobParamsSchema = void 0;
3
+ exports.HtmlPageBuilderCurrentJobSchema = exports.HtmlPageBuilderJobSchema = exports.HtmlPageBuilderJobFilesSchema = exports.HtmlPageBuilderJobParamsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const tools_1 = require("../../tools");
6
6
  const common_1 = require("../../common");
7
+ const html_page_builder_page_schema_1 = require("./html-page-builder-page.schema");
8
+ const html_page_builder_clarification_schema_1 = require("./html-page-builder-clarification.schema");
7
9
  exports.HtmlPageBuilderJobParamsSchema = zod_1.z.object({
8
10
  attachedFiles: zod_1.z.array(common_1.AttachedFileSchema),
11
+ pagesCount: zod_1.z.number().int().positive().optional(),
12
+ clarifications: html_page_builder_clarification_schema_1.HtmlPageBuilderClarificationBriefSchema.default([]),
13
+ /**
14
+ * Server-side: generation starts from a second RPC, after the answers, so the flag of the
15
+ * original request has to survive somewhere. Whatever a caller puts here is overwritten by
16
+ * `execute`, and `shouldUseMock` still refuses it outside dev.
17
+ */
18
+ mock: zod_1.z.boolean().optional(),
19
+ });
20
+ /**
21
+ * Addresses of the published files of this generation, for reading the source as files rather
22
+ * than as one inlined document. Empty when the upload did not happen — the site itself is
23
+ * unaffected, there is simply nothing to open.
24
+ */
25
+ exports.HtmlPageBuilderJobFilesSchema = zod_1.z.object({
26
+ // Shared stylesheet of the site; empty for a single-page result that keeps its CSS inline
27
+ stylesheet: zod_1.z.string(),
28
+ // Shared script of the site; empty when the site has no JS
29
+ script: zod_1.z.string(),
30
+ pages: zod_1.z.array(zod_1.z.object({ slug: zod_1.z.string(), url: zod_1.z.string() })),
9
31
  });
10
32
  exports.HtmlPageBuilderJobSchema = zod_1.z.object({
11
33
  uuid: zod_1.z.string(),
@@ -14,16 +36,28 @@ exports.HtmlPageBuilderJobSchema = zod_1.z.object({
14
36
  userPrompt: zod_1.z.string(),
15
37
  title: zod_1.z.string(),
16
38
  generatedHtml: zod_1.z.string().nullable().optional(),
39
+ generatedPages: html_page_builder_page_schema_1.HtmlPageBuilderGeneratedPagesSchema.nullable().optional(),
40
+ /** Public URL of the home page of this generation, ready to be opened in an iframe. Empty
41
+ * when the upload did not happen — the site itself is unaffected. */
42
+ previewUrl: zod_1.z.string().optional(),
43
+ /** The same publication read as separate files */
44
+ files: exports.HtmlPageBuilderJobFilesSchema.optional(),
17
45
  status: zod_1.z.enum(tools_1.JOB_STATUS),
18
46
  error: zod_1.z.string().nullable(),
19
47
  internalError: zod_1.z.string().nullable().optional(),
20
48
  price: zod_1.z.number(),
21
- reaction: zod_1.z.enum(common_1.USER_REACTION).nullable(),
22
- dislikeReason: zod_1.z.string().nullable(),
23
49
  inputTokens: zod_1.z.number().nullable().optional(),
24
50
  outputTokens: zod_1.z.number().nullable().optional(),
25
51
  totalTokens: zod_1.z.number().nullable().optional(),
26
52
  tokenReservationId: zod_1.z.string().nullable().optional(),
53
+ /** Questions the model asked before this generation */
54
+ questions: html_page_builder_clarification_schema_1.HtmlPageBuilderClarificationQuestionsSchema.default([]),
55
+ /** What the user answered. Empty is legal — skipped questions fall back to the recommendation */
56
+ answers: html_page_builder_clarification_schema_1.HtmlPageBuilderClarificationAnswersSchema.default([]),
57
+ /** Design this generation was made with; the prompts behind style and font never leave the service */
58
+ styleId: zod_1.z.string().nullable().optional(),
59
+ fontId: zod_1.z.string().nullable().optional(),
60
+ accentColor: zod_1.z.string().default(''),
27
61
  userId: zod_1.z.string().nullable().optional(),
28
62
  unregisteredUserId: zod_1.z.string().nullable().optional(),
29
63
  params: exports.HtmlPageBuilderJobParamsSchema,
@@ -32,3 +66,16 @@ exports.HtmlPageBuilderJobSchema = zod_1.z.object({
32
66
  completedAt: zod_1.z.date().nullable().optional(),
33
67
  updatedAt: zod_1.z.date(),
34
68
  });
69
+ /**
70
+ * The generation a session points at, as the list of sites needs it: the address and the state,
71
+ * without the site itself. A list of twenty sessions must not carry twenty sites.
72
+ */
73
+ exports.HtmlPageBuilderCurrentJobSchema = zod_1.z.object({
74
+ uuid: zod_1.z.string(),
75
+ status: zod_1.z.enum(tools_1.JOB_STATUS),
76
+ previewUrl: zod_1.z.string().optional(),
77
+ files: exports.HtmlPageBuilderJobFilesSchema.optional(),
78
+ error: zod_1.z.string().nullable(),
79
+ createdAt: zod_1.z.date(),
80
+ completedAt: zod_1.z.date().nullable().optional(),
81
+ });
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare const HtmlPageBuilderPageSchema: z.ZodObject<{
3
+ slug: z.ZodString;
4
+ title: z.ZodString;
5
+ html: z.ZodString;
6
+ order: z.ZodNumber;
7
+ isHome: z.ZodBoolean;
8
+ }, z.core.$strip>;
9
+ export type HtmlPageBuilderPage = z.infer<typeof HtmlPageBuilderPageSchema>;
10
+ export declare const HtmlPageBuilderGeneratedPageSchema: z.ZodObject<{
11
+ slug: z.ZodString;
12
+ title: z.ZodString;
13
+ html: z.ZodString;
14
+ order: z.ZodNumber;
15
+ isHome: z.ZodBoolean;
16
+ }, z.core.$strip>;
17
+ export type HtmlPageBuilderGeneratedPage = z.infer<typeof HtmlPageBuilderGeneratedPageSchema>;
18
+ export declare const HtmlPageBuilderGeneratedPagesSchema: z.ZodArray<z.ZodObject<{
19
+ slug: z.ZodString;
20
+ title: z.ZodString;
21
+ html: z.ZodString;
22
+ order: z.ZodNumber;
23
+ isHome: z.ZodBoolean;
24
+ }, z.core.$strip>>;
25
+ export type HtmlPageBuilderGeneratedPages = z.infer<typeof HtmlPageBuilderGeneratedPagesSchema>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderGeneratedPagesSchema = exports.HtmlPageBuilderGeneratedPageSchema = exports.HtmlPageBuilderPageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.HtmlPageBuilderPageSchema = zod_1.z.object({
6
+ slug: zod_1.z.string(),
7
+ title: zod_1.z.string(),
8
+ html: zod_1.z.string(),
9
+ order: zod_1.z.number(),
10
+ isHome: zod_1.z.boolean(),
11
+ });
12
+ exports.HtmlPageBuilderGeneratedPageSchema = exports.HtmlPageBuilderPageSchema;
13
+ exports.HtmlPageBuilderGeneratedPagesSchema = zod_1.z.array(exports.HtmlPageBuilderGeneratedPageSchema);
@@ -0,0 +1,58 @@
1
+ import { z } from 'zod';
2
+ export declare const HtmlPageBuilderPresetSchema: z.ZodObject<{
3
+ uuid: z.ZodUUID;
4
+ code: z.ZodString;
5
+ title: z.ZodString;
6
+ prompt: z.ZodString;
7
+ icons: z.ZodObject<{
8
+ light: z.ZodObject<{
9
+ svg: z.ZodString;
10
+ png: z.ZodString;
11
+ }, z.core.$strip>;
12
+ dark: z.ZodObject<{
13
+ svg: z.ZodString;
14
+ png: z.ZodString;
15
+ }, z.core.$strip>;
16
+ }, z.core.$strip>;
17
+ styleId: z.ZodUUID;
18
+ fontId: z.ZodUUID;
19
+ style: z.ZodOptional<z.ZodObject<{
20
+ uuid: z.ZodUUID;
21
+ code: z.ZodString;
22
+ title: z.ZodString;
23
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ previewUrl: z.ZodString;
25
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ tags: z.ZodArray<z.ZodEnum<typeof import("..").HTML_PAGE_BUILDER_STYLE_TAG>>;
27
+ popularity: z.ZodNumber;
28
+ order: z.ZodNumber;
29
+ createdAt: z.ZodCoercedDate<unknown>;
30
+ updatedAt: z.ZodCoercedDate<unknown>;
31
+ }, z.core.$strip>>;
32
+ font: z.ZodOptional<z.ZodObject<{
33
+ uuid: z.ZodUUID;
34
+ code: z.ZodString;
35
+ title: z.ZodString;
36
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ icons: z.ZodObject<{
38
+ light: z.ZodObject<{
39
+ svg: z.ZodString;
40
+ png: z.ZodString;
41
+ }, z.core.$strip>;
42
+ dark: z.ZodObject<{
43
+ svg: z.ZodString;
44
+ png: z.ZodString;
45
+ }, z.core.$strip>;
46
+ }, z.core.$strip>;
47
+ tags: z.ZodArray<z.ZodEnum<typeof import("..").HTML_PAGE_BUILDER_FONT_TAG>>;
48
+ popularity: z.ZodNumber;
49
+ order: z.ZodNumber;
50
+ createdAt: z.ZodCoercedDate<unknown>;
51
+ updatedAt: z.ZodCoercedDate<unknown>;
52
+ }, z.core.$strip>>;
53
+ pagesCount: z.ZodNumber;
54
+ order: z.ZodNumber;
55
+ createdAt: z.ZodCoercedDate<unknown>;
56
+ updatedAt: z.ZodCoercedDate<unknown>;
57
+ }, z.core.$strip>;
58
+ export type HtmlPageBuilderPreset = z.infer<typeof HtmlPageBuilderPresetSchema>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderPresetSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../common");
6
+ const html_page_builder_font_schema_1 = require("./html-page-builder-font.schema");
7
+ const html_page_builder_style_schema_1 = require("./html-page-builder-style.schema");
8
+ // A quick-start card: it only fills the description field, the style/font/pagesCount it carries are suggestions
9
+ exports.HtmlPageBuilderPresetSchema = zod_1.z.object({
10
+ uuid: zod_1.z.uuid(),
11
+ code: zod_1.z.string(),
12
+ title: zod_1.z.string(),
13
+ prompt: zod_1.z.string(),
14
+ icons: common_1.IconVariantsSchema,
15
+ styleId: zod_1.z.uuid(),
16
+ fontId: zod_1.z.uuid(),
17
+ style: html_page_builder_style_schema_1.HtmlPageBuilderStyleSchema.optional(),
18
+ font: html_page_builder_font_schema_1.HtmlPageBuilderFontSchema.optional(),
19
+ pagesCount: zod_1.z.number(),
20
+ order: zod_1.z.number(),
21
+ createdAt: zod_1.z.coerce.date(),
22
+ updatedAt: zod_1.z.coerce.date(),
23
+ });
@@ -1,13 +1,31 @@
1
1
  import { z } from 'zod';
2
- import { JOB_STATUS } from '../../tools';
3
- import { HTML_PAGE_BUILDER_SESSION_STAGE } from '../enums';
2
+ import { USER_REACTION } from '../../common';
3
+ import { HTML_PAGE_BUILDER_SESSION_STATUS } from '../enums';
4
4
  export declare const HtmlPageBuilderSessionSchema: z.ZodObject<{
5
5
  uuid: z.ZodString;
6
6
  title: z.ZodString;
7
- status: z.ZodEnum<typeof JOB_STATUS>;
8
- stage: z.ZodEnum<typeof HTML_PAGE_BUILDER_SESSION_STAGE>;
7
+ status: z.ZodEnum<typeof HTML_PAGE_BUILDER_SESSION_STATUS>;
9
8
  currentHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ currentJobId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ currentJob: z.ZodOptional<z.ZodNullable<z.ZodObject<{
11
+ uuid: z.ZodString;
12
+ status: z.ZodEnum<typeof import("../..").JOB_STATUS>;
13
+ previewUrl: z.ZodOptional<z.ZodString>;
14
+ files: z.ZodOptional<z.ZodObject<{
15
+ stylesheet: z.ZodString;
16
+ script: z.ZodString;
17
+ pages: z.ZodArray<z.ZodObject<{
18
+ slug: z.ZodString;
19
+ url: z.ZodString;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>>;
22
+ error: z.ZodNullable<z.ZodString>;
23
+ createdAt: z.ZodDate;
24
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
25
+ }, z.core.$strip>>>;
10
26
  lastUsedModelId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
27
+ reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
28
+ dislikeReason: z.ZodNullable<z.ZodString>;
11
29
  userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
30
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
31
  isDeleted: z.ZodBoolean;
@@ -19,16 +37,45 @@ export declare const HtmlPageBuilderSessionSchema: z.ZodObject<{
19
37
  userPrompt: z.ZodString;
20
38
  title: z.ZodString;
21
39
  generatedHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
- status: z.ZodEnum<typeof JOB_STATUS>;
40
+ generatedPages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
41
+ slug: z.ZodString;
42
+ title: z.ZodString;
43
+ html: z.ZodString;
44
+ order: z.ZodNumber;
45
+ isHome: z.ZodBoolean;
46
+ }, z.core.$strip>>>>;
47
+ previewUrl: z.ZodOptional<z.ZodString>;
48
+ files: z.ZodOptional<z.ZodObject<{
49
+ stylesheet: z.ZodString;
50
+ script: z.ZodString;
51
+ pages: z.ZodArray<z.ZodObject<{
52
+ slug: z.ZodString;
53
+ url: z.ZodString;
54
+ }, z.core.$strip>>;
55
+ }, z.core.$strip>>;
56
+ status: z.ZodEnum<typeof import("../..").JOB_STATUS>;
23
57
  error: z.ZodNullable<z.ZodString>;
24
58
  internalError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
59
  price: z.ZodNumber;
26
- reaction: z.ZodNullable<z.ZodEnum<typeof import("../..").USER_REACTION>>;
27
- dislikeReason: z.ZodNullable<z.ZodString>;
28
60
  inputTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
29
61
  outputTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
30
62
  totalTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
31
63
  tokenReservationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
64
+ questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
65
+ id: z.ZodString;
66
+ question: z.ZodString;
67
+ type: z.ZodEnum<typeof import("..").HTML_PAGE_BUILDER_QUESTION_TYPE>;
68
+ options: z.ZodArray<z.ZodString>;
69
+ recommendedAnswer: z.ZodString;
70
+ allowCustomAnswer: z.ZodBoolean;
71
+ }, z.core.$strip>>>;
72
+ answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
73
+ questionId: z.ZodString;
74
+ answers: z.ZodArray<z.ZodString>;
75
+ }, z.core.$strip>>>;
76
+ styleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
77
+ fontId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
+ accentColor: z.ZodDefault<z.ZodString>;
32
79
  userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
80
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
81
  params: z.ZodObject<{
@@ -43,12 +90,25 @@ export declare const HtmlPageBuilderSessionSchema: z.ZodObject<{
43
90
  content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
44
91
  contentLength: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
45
92
  }, z.core.$strip>>;
93
+ pagesCount: z.ZodOptional<z.ZodNumber>;
94
+ clarifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
95
+ question: z.ZodString;
96
+ answer: z.ZodString;
97
+ }, z.core.$strip>>>;
98
+ mock: z.ZodOptional<z.ZodBoolean>;
46
99
  }, z.core.$strip>;
47
100
  isDeleted: z.ZodBoolean;
48
101
  createdAt: z.ZodDate;
49
102
  completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
50
103
  updatedAt: z.ZodDate;
51
104
  }, z.core.$strip>>>;
105
+ pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
+ slug: z.ZodString;
107
+ title: z.ZodString;
108
+ html: z.ZodString;
109
+ order: z.ZodNumber;
110
+ isHome: z.ZodBoolean;
111
+ }, z.core.$strip>>>;
52
112
  createdAt: z.ZodDate;
53
113
  updatedAt: z.ZodDate;
54
114
  }, z.core.$strip>;
@@ -2,21 +2,33 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HtmlPageBuilderSessionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const tools_1 = require("../../tools");
5
+ const common_1 = require("../../common");
6
6
  const enums_1 = require("../enums");
7
7
  const html_page_builder_job_schema_1 = require("./html-page-builder-job.schema");
8
+ const html_page_builder_page_schema_1 = require("./html-page-builder-page.schema");
8
9
  exports.HtmlPageBuilderSessionSchema = zod_1.z.object({
9
10
  uuid: zod_1.z.string(),
10
11
  title: zod_1.z.string(),
11
- status: zod_1.z.enum(tools_1.JOB_STATUS),
12
- stage: zod_1.z.enum(enums_1.HTML_PAGE_BUILDER_SESSION_STAGE),
12
+ /** The only progress signal the client has: the client polls this and renders the phase */
13
+ status: zod_1.z.enum(enums_1.HTML_PAGE_BUILDER_SESSION_STATUS),
14
+ /** @deprecated use `pages` — kept as the HTML of the home page for canvas consumers */
13
15
  currentHtml: zod_1.z.string().nullable().optional(),
16
+ /**
17
+ * The generation on screen. Everything about the site — its address, its files, its design —
18
+ * lives in that job's snapshot; the session only points at it.
19
+ */
20
+ currentJobId: zod_1.z.string().nullable().optional(),
21
+ currentJob: html_page_builder_job_schema_1.HtmlPageBuilderCurrentJobSchema.nullable().optional(),
14
22
  lastUsedModelId: zod_1.z.uuid().nullable().optional(),
23
+ /** How the user rates this site. On the session, next to `isFavorite` */
24
+ reaction: zod_1.z.enum(common_1.USER_REACTION).nullable(),
25
+ dislikeReason: zod_1.z.string().nullable(),
15
26
  userId: zod_1.z.string().nullable().optional(),
16
27
  unregisteredUserId: zod_1.z.string().nullable().optional(),
17
28
  isDeleted: zod_1.z.boolean(),
18
29
  isFavorite: zod_1.z.boolean(),
19
30
  jobs: zod_1.z.array(html_page_builder_job_schema_1.HtmlPageBuilderJobSchema).optional(),
31
+ pages: zod_1.z.array(html_page_builder_page_schema_1.HtmlPageBuilderPageSchema).optional(),
20
32
  createdAt: zod_1.z.date(),
21
33
  updatedAt: zod_1.z.date(),
22
34
  });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What a visitor's page is allowed to know about a shared site.
4
+ *
5
+ * The route behind it is anonymous, so the shape is the boundary: it carries the address to
6
+ * frame and the name to show, and nothing about the owner, the prompt, or what it cost.
7
+ */
8
+ export declare const HtmlPageBuilderSharedSiteSchema: z.ZodObject<{
9
+ contentUrl: z.ZodString;
10
+ title: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export type HtmlPageBuilderSharedSite = z.infer<typeof HtmlPageBuilderSharedSiteSchema>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderSharedSiteSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * What a visitor's page is allowed to know about a shared site.
7
+ *
8
+ * The route behind it is anonymous, so the shape is the boundary: it carries the address to
9
+ * frame and the name to show, and nothing about the owner, the prompt, or what it cost.
10
+ */
11
+ exports.HtmlPageBuilderSharedSiteSchema = zod_1.z.object({
12
+ // Address of the published site in the bucket, used as the iframe source
13
+ contentUrl: zod_1.z.string(),
14
+ // Session title, shown on the wrapper page and in the link preview card
15
+ title: zod_1.z.string(),
16
+ });
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ export declare const HtmlPageBuilderSitemapSectionSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ purpose: z.ZodString;
5
+ contentOutline: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type HtmlPageBuilderSitemapSection = z.infer<typeof HtmlPageBuilderSitemapSectionSchema>;
8
+ export declare const HtmlPageBuilderSitemapPageSchema: z.ZodObject<{
9
+ slug: z.ZodString;
10
+ title: z.ZodString;
11
+ purpose: z.ZodString;
12
+ isHome: z.ZodBoolean;
13
+ sections: z.ZodArray<z.ZodObject<{
14
+ id: z.ZodString;
15
+ purpose: z.ZodString;
16
+ contentOutline: z.ZodString;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>;
19
+ export type HtmlPageBuilderSitemapPage = z.infer<typeof HtmlPageBuilderSitemapPageSchema>;
20
+ export declare const HtmlPageBuilderSitemapSchema: z.ZodArray<z.ZodObject<{
21
+ slug: z.ZodString;
22
+ title: z.ZodString;
23
+ purpose: z.ZodString;
24
+ isHome: z.ZodBoolean;
25
+ sections: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodString;
27
+ purpose: z.ZodString;
28
+ contentOutline: z.ZodString;
29
+ }, z.core.$strip>>;
30
+ }, z.core.$strip>>;
31
+ export type HtmlPageBuilderSitemap = z.infer<typeof HtmlPageBuilderSitemapSchema>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderSitemapSchema = exports.HtmlPageBuilderSitemapPageSchema = exports.HtmlPageBuilderSitemapSectionSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.HtmlPageBuilderSitemapSectionSchema = zod_1.z.object({
6
+ id: zod_1.z.string(),
7
+ purpose: zod_1.z.string(),
8
+ contentOutline: zod_1.z.string(),
9
+ });
10
+ exports.HtmlPageBuilderSitemapPageSchema = zod_1.z.object({
11
+ slug: zod_1.z.string(),
12
+ title: zod_1.z.string(),
13
+ purpose: zod_1.z.string(),
14
+ isHome: zod_1.z.boolean(),
15
+ sections: zod_1.z.array(exports.HtmlPageBuilderSitemapSectionSchema),
16
+ });
17
+ exports.HtmlPageBuilderSitemapSchema = zod_1.z.array(exports.HtmlPageBuilderSitemapPageSchema);
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { HTML_PAGE_BUILDER_STYLE_TAG } from '../enums';
3
+ export declare const HtmlPageBuilderStyleSchema: z.ZodObject<{
4
+ uuid: z.ZodUUID;
5
+ code: z.ZodString;
6
+ title: z.ZodString;
7
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ previewUrl: z.ZodString;
9
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ tags: z.ZodArray<z.ZodEnum<typeof HTML_PAGE_BUILDER_STYLE_TAG>>;
11
+ popularity: z.ZodNumber;
12
+ order: z.ZodNumber;
13
+ createdAt: z.ZodCoercedDate<unknown>;
14
+ updatedAt: z.ZodCoercedDate<unknown>;
15
+ }, z.core.$strip>;
16
+ export type HtmlPageBuilderStyle = z.infer<typeof HtmlPageBuilderStyleSchema>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderStyleSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const enums_1 = require("../enums");
6
+ // `stylePrompt` is deliberately absent: it is an internal generation parameter, like the model's reasoningEffort
7
+ exports.HtmlPageBuilderStyleSchema = zod_1.z.object({
8
+ uuid: zod_1.z.uuid(),
9
+ code: zod_1.z.string(),
10
+ title: zod_1.z.string(),
11
+ description: zod_1.z.string().nullable().optional(),
12
+ previewUrl: zod_1.z.string(),
13
+ thumbnailUrl: zod_1.z.string().nullable().optional(),
14
+ tags: zod_1.z.array(zod_1.z.enum(enums_1.HTML_PAGE_BUILDER_STYLE_TAG)),
15
+ popularity: zod_1.z.number(),
16
+ order: zod_1.z.number(),
17
+ createdAt: zod_1.z.coerce.date(),
18
+ updatedAt: zod_1.z.coerce.date(),
19
+ });
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What one provider call of a run cost, in tokens.
4
+ *
5
+ * Kept per call rather than as a running total: the steps of a run go to different models, so a
6
+ * single sum answers neither "which phase burns the tokens" nor "what did this run cost".
7
+ */
8
+ export declare const HtmlPageBuilderTokenUsageItemSchema: z.ZodObject<{
9
+ step: z.ZodEnum<{
10
+ readonly CLARIFICATIONS: 'clarifications';
11
+ readonly SITEMAP: 'sitemap';
12
+ readonly HOME_PAGE: 'home-page';
13
+ readonly SUB_PAGE: 'sub-page';
14
+ readonly SINGLE_PAGE: 'single-page';
15
+ }>;
16
+ model: z.ZodString;
17
+ slug: z.ZodOptional<z.ZodString>;
18
+ inputTokens: z.ZodNumber;
19
+ outputTokens: z.ZodNumber;
20
+ }, z.core.$strip>;
21
+ export type HtmlPageBuilderTokenUsageItem = z.infer<typeof HtmlPageBuilderTokenUsageItemSchema>;
22
+ export declare const HtmlPageBuilderTokenUsageSchema: z.ZodArray<z.ZodObject<{
23
+ step: z.ZodEnum<{
24
+ readonly CLARIFICATIONS: 'clarifications';
25
+ readonly SITEMAP: 'sitemap';
26
+ readonly HOME_PAGE: 'home-page';
27
+ readonly SUB_PAGE: 'sub-page';
28
+ readonly SINGLE_PAGE: 'single-page';
29
+ }>;
30
+ model: z.ZodString;
31
+ slug: z.ZodOptional<z.ZodString>;
32
+ inputTokens: z.ZodNumber;
33
+ outputTokens: z.ZodNumber;
34
+ }, z.core.$strip>>;
35
+ export type HtmlPageBuilderTokenUsage = z.infer<typeof HtmlPageBuilderTokenUsageSchema>;