@aglyn/plugins-ai 1.0.0-beta.230 → 1.0.0-beta.232
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/package.json +17 -17
- package/src/lib/activity/ai-activity-actions.js +8 -4
- package/src/lib/activity/ai-activity-actions.js.map +1 -1
- package/src/lib/components/ai-assist-provider-on-host.component.d.ts +66 -0
- package/src/lib/components/ai-assist-provider-on-host.component.js +78 -0
- package/src/lib/components/ai-assist-provider-on-host.component.js.map +1 -0
- package/src/lib/components/ai-assist-provider.component.js +9 -10
- package/src/lib/components/ai-assist-provider.component.js.map +1 -1
- package/src/lib/components/ai-job-follow.component.js +1 -0
- package/src/lib/components/ai-job-follow.component.js.map +1 -1
- package/src/lib/components/ai-job-links.js +13 -0
- package/src/lib/components/ai-job-links.js.map +1 -1
- package/src/lib/components/ai-job-plan.component.js +3 -1
- package/src/lib/components/ai-job-plan.component.js.map +1 -1
- package/src/lib/components/ai-jobs-list-page.component.js +1 -0
- package/src/lib/components/ai-jobs-list-page.component.js.map +1 -1
- package/src/lib/components/ai-media-create.component.d.ts +20 -7
- package/src/lib/components/ai-media-create.component.js +107 -55
- package/src/lib/components/ai-media-create.component.js.map +1 -1
- package/src/lib/components/ai-permissions-on-host.component.d.ts +3 -46
- package/src/lib/components/ai-permissions-on-host.component.js +5 -53
- package/src/lib/components/ai-permissions-on-host.component.js.map +1 -1
- package/src/lib/components/ai-seo-fields-card.component.js +1 -0
- package/src/lib/components/ai-seo-fields-card.component.js.map +1 -1
- package/src/lib/components/ai-site-build-page.component.js +20 -8
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-memory-card.component.d.ts +32 -0
- package/src/lib/components/ai-site-memory-card.component.js +187 -0
- package/src/lib/components/ai-site-memory-card.component.js.map +1 -0
- package/src/lib/components/ai-site-start-card.component.js +80 -77
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-theme-proposal-card.component.js +4 -0
- package/src/lib/components/ai-theme-proposal-card.component.js.map +1 -1
- package/src/lib/components/ai-usage-strip.component.js +1 -0
- package/src/lib/components/ai-usage-strip.component.js.map +1 -1
- package/src/lib/components/assist-panel.component.d.ts +10 -0
- package/src/lib/components/assist-panel.component.js +119 -9
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/components/assist-signals-page.component.js +2 -0
- package/src/lib/components/assist-signals-page.component.js.map +1 -1
- package/src/lib/components/billing-ai-allotments.component.js +3 -0
- package/src/lib/components/billing-ai-allotments.component.js.map +1 -1
- package/src/lib/components/billing-ai-top-users.component.js +1 -0
- package/src/lib/components/billing-ai-top-users.component.js.map +1 -1
- package/src/lib/components/billing-assist-overage-card.component.js +2 -0
- package/src/lib/components/billing-assist-overage-card.component.js.map +1 -1
- package/src/lib/components/member-ai-usage-card.component.js +10 -0
- package/src/lib/components/member-ai-usage-card.component.js.map +1 -1
- package/src/lib/components/staff-org-ai-card.component.js +1 -0
- package/src/lib/components/staff-org-ai-card.component.js.map +1 -1
- package/src/lib/components/staff-org-ai-conversations.component.d.ts +23 -0
- package/src/lib/components/staff-org-ai-conversations.component.js +346 -0
- package/src/lib/components/staff-org-ai-conversations.component.js.map +1 -0
- package/src/lib/jobs/ai-build-capabilities.d.ts +13 -1
- package/src/lib/jobs/ai-build-capabilities.js +101 -7
- package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
- package/src/lib/jobs/ai-build-unit-outcome.js +4 -2
- package/src/lib/jobs/ai-build-unit-outcome.js.map +1 -1
- package/src/lib/jobs/ai-business-profile-prefill.d.ts +29 -0
- package/src/lib/jobs/ai-business-profile-prefill.js +85 -0
- package/src/lib/jobs/ai-business-profile-prefill.js.map +1 -0
- package/src/lib/jobs/ai-job-auto-confirm.d.ts +8 -0
- package/src/lib/jobs/ai-job-auto-confirm.js +30 -6
- package/src/lib/jobs/ai-job-auto-confirm.js.map +1 -1
- package/src/lib/jobs/ai-job-build-step.js +14 -1
- package/src/lib/jobs/ai-job-build-step.js.map +1 -1
- package/src/lib/jobs/ai-job-edit-step.d.ts +225 -0
- package/src/lib/jobs/ai-job-edit-step.js +631 -0
- package/src/lib/jobs/ai-job-edit-step.js.map +1 -0
- package/src/lib/jobs/ai-job-generation.d.ts +8 -0
- package/src/lib/jobs/ai-job-generation.js +13 -2
- package/src/lib/jobs/ai-job-generation.js.map +1 -1
- package/src/lib/jobs/ai-job-insight-step.js +29 -5
- package/src/lib/jobs/ai-job-insight-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.d.ts +78 -0
- package/src/lib/jobs/ai-job-layout-language.js +200 -0
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -0
- package/src/lib/jobs/ai-job-layout-site-pages.d.ts +13 -2
- package/src/lib/jobs/ai-job-layout-site-pages.js +18 -2
- package/src/lib/jobs/ai-job-layout-site-pages.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-step.d.ts +5 -0
- package/src/lib/jobs/ai-job-layout-step.js +107 -6
- package/src/lib/jobs/ai-job-layout-step.js.map +1 -1
- package/src/lib/jobs/ai-job-logic-step.d.ts +20 -0
- package/src/lib/jobs/ai-job-logic-step.js +87 -6
- package/src/lib/jobs/ai-job-logic-step.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +194 -0
- package/src/lib/jobs/ai-job-page-language.js +418 -0
- package/src/lib/jobs/ai-job-page-language.js.map +1 -0
- package/src/lib/jobs/ai-job-page-sections.d.ts +37 -1
- package/src/lib/jobs/ai-job-page-sections.js +93 -11
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +4 -4
- package/src/lib/jobs/ai-job-page-step.js +115 -14
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +20 -6
- package/src/lib/jobs/ai-job-plan-step.js +62 -22
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-content.d.ts +163 -0
- package/src/lib/jobs/ai-job-site-content.js +443 -0
- package/src/lib/jobs/ai-job-site-content.js.map +1 -0
- package/src/lib/jobs/ai-job-site-look.d.ts +112 -0
- package/src/lib/jobs/ai-job-site-look.js +322 -0
- package/src/lib/jobs/ai-job-site-look.js.map +1 -0
- package/src/lib/jobs/ai-job-site-step.d.ts +30 -5
- package/src/lib/jobs/ai-job-site-step.js +183 -27
- package/src/lib/jobs/ai-job-site-step.js.map +1 -1
- package/src/lib/jobs/ai-job-workflow-step.js +2 -2
- package/src/lib/jobs/ai-job-workflow-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs-notify.d.ts +6 -1
- package/src/lib/jobs/ai-jobs-notify.js +15 -3
- package/src/lib/jobs/ai-jobs-notify.js.map +1 -1
- package/src/lib/jobs/ai-jobs.d.ts +1 -1
- package/src/lib/jobs/ai-jobs.js +17 -8
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-layout-full-height.d.ts +40 -0
- package/src/lib/jobs/ai-layout-full-height.js +82 -0
- package/src/lib/jobs/ai-layout-full-height.js.map +1 -0
- package/src/lib/jobs/ai-layout-site-facts.d.ts +54 -0
- package/src/lib/jobs/ai-layout-site-facts.js +153 -0
- package/src/lib/jobs/ai-layout-site-facts.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +154 -0
- package/src/lib/layout-language/ai-layout-compiler.js +1235 -0
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -0
- package/src/lib/layout-language/ai-layout-copy.d.ts +73 -0
- package/src/lib/layout-language/ai-layout-copy.js +137 -0
- package/src/lib/layout-language/ai-layout-copy.js.map +1 -0
- package/src/lib/layout-language/ai-layout-frame.d.ts +52 -0
- package/src/lib/layout-language/ai-layout-frame.js +458 -0
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -0
- package/src/lib/layout-language/ai-layout-gaps.d.ts +63 -0
- package/src/lib/layout-language/ai-layout-gaps.js +345 -0
- package/src/lib/layout-language/ai-layout-gaps.js.map +1 -0
- package/src/lib/layout-language/ai-layout-language.d.ts +168 -0
- package/src/lib/layout-language/ai-layout-language.js +529 -0
- package/src/lib/layout-language/ai-layout-language.js.map +1 -0
- package/src/lib/layout-language/ai-layout-links.d.ts +80 -0
- package/src/lib/layout-language/ai-layout-links.js +109 -0
- package/src/lib/layout-language/ai-layout-links.js.map +1 -0
- package/src/lib/layout-language/ai-layout-pictures.d.ts +144 -0
- package/src/lib/layout-language/ai-layout-pictures.js +214 -0
- package/src/lib/layout-language/ai-layout-pictures.js.map +1 -0
- package/src/lib/layout-language/ai-layout-store.d.ts +41 -0
- package/src/lib/layout-language/ai-layout-store.js +75 -0
- package/src/lib/layout-language/ai-layout-store.js.map +1 -0
- package/src/lib/layout-language/ai-layout-tree.d.ts +59 -0
- package/src/lib/layout-language/ai-layout-tree.js +84 -0
- package/src/lib/layout-language/ai-layout-tree.js.map +1 -0
- package/src/lib/lazy-widget.d.ts +45 -0
- package/src/lib/lazy-widget.js +53 -0
- package/src/lib/lazy-widget.js.map +1 -0
- package/src/lib/model/ai-build-job.js +2 -1
- package/src/lib/model/ai-build-job.js.map +1 -1
- package/src/lib/model/ai-build-progress.d.ts +20 -3
- package/src/lib/model/ai-build-progress.js +52 -7
- package/src/lib/model/ai-build-progress.js.map +1 -1
- package/src/lib/model/ai-edit-job.d.ts +109 -0
- package/src/lib/model/ai-edit-job.js +157 -0
- package/src/lib/model/ai-edit-job.js.map +1 -0
- package/src/lib/model/ai-host-publish-context.d.ts +51 -0
- package/src/lib/model/ai-host-publish-context.js +104 -0
- package/src/lib/model/ai-host-publish-context.js.map +1 -0
- package/src/lib/model/ai-job-activity.d.ts +22 -0
- package/src/lib/model/ai-job-activity.js +23 -1
- package/src/lib/model/ai-job-activity.js.map +1 -1
- package/src/lib/model/ai-job-failure-copy.d.ts +38 -1
- package/src/lib/model/ai-job-failure-copy.js +56 -1
- package/src/lib/model/ai-job-failure-copy.js.map +1 -1
- package/src/lib/model/ai-job-notice.d.ts +3 -1
- package/src/lib/model/ai-job-notice.js +31 -9
- package/src/lib/model/ai-job-notice.js.map +1 -1
- package/src/lib/model/ai-jobs.types.d.ts +22 -1
- package/src/lib/model/ai-jobs.types.js.map +1 -1
- package/src/lib/model/ai-logic-job.d.ts +18 -1
- package/src/lib/model/ai-logic-job.js +24 -3
- package/src/lib/model/ai-logic-job.js.map +1 -1
- package/src/lib/model/ai-media-credits.d.ts +8 -4
- package/src/lib/model/ai-media-credits.js +11 -4
- package/src/lib/model/ai-media-credits.js.map +1 -1
- package/src/lib/model/ai-media-kinds.d.ts +68 -0
- package/src/lib/model/ai-media-kinds.js +98 -0
- package/src/lib/model/ai-media-kinds.js.map +1 -0
- package/src/lib/model/ai-site-build-progress.d.ts +9 -1
- package/src/lib/model/ai-site-build-progress.js +54 -14
- package/src/lib/model/ai-site-build-progress.js.map +1 -1
- package/src/lib/model/ai-site-context.d.ts +111 -0
- package/src/lib/model/ai-site-context.js +222 -0
- package/src/lib/model/ai-site-context.js.map +1 -0
- package/src/lib/model/ai-site-job.d.ts +18 -2
- package/src/lib/model/ai-site-job.js +21 -5
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.d.ts +164 -0
- package/src/lib/model/ai-site-kinds.js +1942 -0
- package/src/lib/model/ai-site-kinds.js.map +1 -0
- package/src/lib/model/ai-site-look.d.ts +150 -0
- package/src/lib/model/ai-site-look.js +1236 -0
- package/src/lib/model/ai-site-look.js.map +1 -0
- package/src/lib/model/ai-site-memory.d.ts +80 -0
- package/src/lib/model/ai-site-memory.js +171 -0
- package/src/lib/model/ai-site-memory.js.map +1 -0
- package/src/lib/model/ai-site-start-seo.d.ts +1 -1
- package/src/lib/model/ai-site-start.d.ts +15 -3
- package/src/lib/model/ai-site-start.js +21 -4
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/assist-follow-up.d.ts +92 -0
- package/src/lib/model/assist-follow-up.js +128 -0
- package/src/lib/model/assist-follow-up.js.map +1 -0
- package/src/lib/plugin-config.js +2 -0
- package/src/lib/plugin-config.js.map +1 -1
- package/src/lib/plugin.js +99 -48
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/providers/anthropic.d.ts +9 -1
- package/src/lib/providers/anthropic.js +143 -9
- package/src/lib/providers/anthropic.js.map +1 -1
- package/src/lib/providers/catalog.d.ts +38 -8
- package/src/lib/providers/catalog.js +106 -14
- package/src/lib/providers/catalog.js.map +1 -1
- package/src/lib/providers/contract.d.ts +29 -0
- package/src/lib/providers/contract.js.map +1 -1
- package/src/lib/providers/image-contract.d.ts +22 -1
- package/src/lib/providers/image-contract.js +40 -1
- package/src/lib/providers/image-contract.js.map +1 -1
- package/src/lib/providers/image-endpoints.d.ts +24 -0
- package/src/lib/providers/image-endpoints.js +28 -0
- package/src/lib/providers/image-endpoints.js.map +1 -0
- package/src/lib/providers/model-choice.js +23 -2
- package/src/lib/providers/model-choice.js.map +1 -1
- package/src/lib/providers/routing.js +18 -0
- package/src/lib/providers/routing.js.map +1 -1
- package/src/lib/providers/vertex-image-endpoint.d.ts +48 -0
- package/src/lib/providers/vertex-image-endpoint.js +80 -0
- package/src/lib/providers/vertex-image-endpoint.js.map +1 -0
- package/src/lib/providers/vertex-image.d.ts +13 -27
- package/src/lib/providers/vertex-image.js +15 -42
- package/src/lib/providers/vertex-image.js.map +1 -1
- package/src/lib/runtime/ai-blog-post-generation.d.ts +62 -0
- package/src/lib/runtime/ai-blog-post-generation.js +89 -0
- package/src/lib/runtime/ai-blog-post-generation.js.map +1 -0
- package/src/lib/runtime/ai-dev-env.d.ts +53 -0
- package/src/lib/runtime/ai-dev-env.js +72 -0
- package/src/lib/runtime/ai-dev-env.js.map +1 -0
- package/src/lib/runtime/ai-dev-replay.d.ts +116 -0
- package/src/lib/runtime/ai-dev-replay.js +313 -0
- package/src/lib/runtime/ai-dev-replay.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +82 -0
- package/src/lib/runtime/ai-doctrine-validators.js +436 -4
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +16 -3
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-eval-live.js +4 -0
- package/src/lib/runtime/ai-eval-live.js.map +1 -1
- package/src/lib/runtime/ai-eval.d.ts +13 -1
- package/src/lib/runtime/ai-eval.js +84 -1
- package/src/lib/runtime/ai-eval.js.map +1 -1
- package/src/lib/runtime/ai-icon-library.d.ts +257 -0
- package/src/lib/runtime/ai-icon-library.js +254 -0
- package/src/lib/runtime/ai-icon-library.js.map +1 -0
- package/src/lib/runtime/ai-live-batch.d.ts +45 -0
- package/src/lib/runtime/ai-live-batch.js +89 -0
- package/src/lib/runtime/ai-live-batch.js.map +1 -0
- package/src/lib/runtime/ai-node-tree.d.ts +9 -0
- package/src/lib/runtime/ai-node-tree.js +30 -4
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/runtime/ai-palette.d.ts +6 -0
- package/src/lib/runtime/ai-palette.generated.js +70 -0
- package/src/lib/runtime/ai-palette.generated.js.map +1 -1
- package/src/lib/runtime/ai-palette.js.map +1 -1
- package/src/lib/runtime/ai-runtime.js +46 -2
- package/src/lib/runtime/ai-runtime.js.map +1 -1
- package/src/lib/runtime/site-context.d.ts +58 -0
- package/src/lib/runtime/site-context.js +127 -0
- package/src/lib/runtime/site-context.js.map +1 -0
- package/src/lib/server/ai-admin-conversations.d.ts +22 -0
- package/src/lib/server/ai-admin-conversations.js +197 -0
- package/src/lib/server/ai-admin-conversations.js.map +1 -0
- package/src/lib/server/ai-media-image.d.ts +5 -5
- package/src/lib/server/ai-media-image.js +25 -11
- package/src/lib/server/ai-media-image.js.map +1 -1
- package/src/lib/server/ai-media-raster-prompt.d.ts +34 -0
- package/src/lib/server/ai-media-raster-prompt.js +53 -0
- package/src/lib/server/ai-media-raster-prompt.js.map +1 -0
- package/src/lib/server/assist-chat.d.ts +11 -0
- package/src/lib/server/assist-chat.js +57 -18
- package/src/lib/server/assist-chat.js.map +1 -1
- package/src/lib/server/assist-edit-applied.js +16 -3
- package/src/lib/server/assist-edit-applied.js.map +1 -1
- package/src/lib/server/assist-view-context.d.ts +19 -1
- package/src/lib/server/assist-view-context.js +38 -1
- package/src/lib/server/assist-view-context.js.map +1 -1
- package/src/lib/server.js +10 -0
- package/src/lib/server.js.map +1 -1
- package/src/lib/subprocessors.js +17 -1
- package/src/lib/subprocessors.js.map +1 -1
- package/src/lib/tools/ai-blog-post-tool.d.ts +60 -0
- package/src/lib/tools/ai-blog-post-tool.js +175 -0
- package/src/lib/tools/ai-blog-post-tool.js.map +1 -0
- package/src/lib/tools/ai-workflow-tool.d.ts +6 -2
- package/src/lib/tools/ai-workflow-tool.js +16 -14
- package/src/lib/tools/ai-workflow-tool.js.map +1 -1
- package/src/lib/usage/assist-usage.d.ts +3 -0
- package/src/lib/usage/assist-usage.js +4 -2
- package/src/lib/usage/assist-usage.js.map +1 -1
- package/src/lib/usage/staff-org-ai-conversations.d.ts +103 -0
- package/src/lib/usage/staff-org-ai-conversations.js +152 -0
- package/src/lib/usage/staff-org-ai-conversations.js.map +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { type AiImageAspectRatio, type AiImageMode, type AiRasterStyle, type AiSvgStyle } from '../providers/image-contract';
|
|
18
|
+
/**
|
|
19
|
+
* The kinds of picture Media's Create with AI offers (AGL-3602), as the Kind
|
|
20
|
+
* menu lists them: four drawn as SVG by the text provider, and seventeen made
|
|
21
|
+
* by the image provider — a photo whose description decides its style, six
|
|
22
|
+
* photographic genres, six art styles and four design assets.
|
|
23
|
+
*
|
|
24
|
+
* Browser-safe: the dialog reads this to draw the menu, pick a shape and
|
|
25
|
+
* decide which controls to show, with no request until Create. The style
|
|
26
|
+
* wording a raster kind adds to the description is the server's
|
|
27
|
+
* (`server/ai-media-raster-prompt.ts`), so the browser bundle does not carry
|
|
28
|
+
* it.
|
|
29
|
+
*/
|
|
30
|
+
/** The Kind menu's sections, in order. */
|
|
31
|
+
export declare const AI_MEDIA_KIND_GROUPS: readonly ["vector", "photo", "art", "design"];
|
|
32
|
+
export type AiMediaKindGroup = (typeof AI_MEDIA_KIND_GROUPS)[number];
|
|
33
|
+
/** Each section's heading in the Kind menu. */
|
|
34
|
+
export declare const AI_MEDIA_KIND_GROUP_LABELS: Readonly<Record<AiMediaKindGroup, string>>;
|
|
35
|
+
/** A kind's id: an SVG style, or an image-provider style. */
|
|
36
|
+
export type AiMediaKindId = AiSvgStyle | AiRasterStyle;
|
|
37
|
+
/**
|
|
38
|
+
* Which colors a kind takes. `palette` offers the site theme's colors or the
|
|
39
|
+
* person's own, sent with the request; `describe` sends none and suggests
|
|
40
|
+
* naming colors in the description; `none` is a photograph, whose colors
|
|
41
|
+
* are the scene's.
|
|
42
|
+
*/
|
|
43
|
+
export type AiMediaKindColors = 'palette' | 'describe' | 'none';
|
|
44
|
+
export interface AiMediaKind {
|
|
45
|
+
id: AiMediaKindId;
|
|
46
|
+
group: AiMediaKindGroup;
|
|
47
|
+
/** The provider mode the door runs it in. */
|
|
48
|
+
mode: AiImageMode;
|
|
49
|
+
label: string;
|
|
50
|
+
/** The line under the Kind menu once it is chosen. */
|
|
51
|
+
hint: string;
|
|
52
|
+
/** The shape the dialog switches to when the kind is chosen. */
|
|
53
|
+
aspectRatio: AiImageAspectRatio;
|
|
54
|
+
colors: AiMediaKindColors;
|
|
55
|
+
/** The description field's example. */
|
|
56
|
+
placeholder: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const AI_MEDIA_KINDS: readonly AiMediaKind[];
|
|
59
|
+
/** A kind by id; `undefined` for an id no kind has. */
|
|
60
|
+
export declare function aiMediaKind(id: string): AiMediaKind | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The kinds this deployment offers: every kind where the image provider is
|
|
63
|
+
* on, and only the SVG kinds where it is not, so nothing the door would
|
|
64
|
+
* refuse is ever listed.
|
|
65
|
+
*/
|
|
66
|
+
export declare function aiMediaKindsOffered(photos: boolean): readonly AiMediaKind[];
|
|
67
|
+
/** Every SVG and raster style has exactly one kind; the spec holds the list to it. */
|
|
68
|
+
export declare const AI_MEDIA_KIND_IDS: readonly AiMediaKindId[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { AI_RASTER_STYLES, AI_SVG_STYLES } from "../providers/image-contract.js";
|
|
17
|
+
/**
|
|
18
|
+
* The kinds of picture Media's Create with AI offers (AGL-3602), as the Kind
|
|
19
|
+
* menu lists them: four drawn as SVG by the text provider, and seventeen made
|
|
20
|
+
* by the image provider — a photo whose description decides its style, six
|
|
21
|
+
* photographic genres, six art styles and four design assets.
|
|
22
|
+
*
|
|
23
|
+
* Browser-safe: the dialog reads this to draw the menu, pick a shape and
|
|
24
|
+
* decide which controls to show, with no request until Create. The style
|
|
25
|
+
* wording a raster kind adds to the description is the server's
|
|
26
|
+
* (`server/ai-media-raster-prompt.ts`), so the browser bundle does not carry
|
|
27
|
+
* it.
|
|
28
|
+
*/ /** The Kind menu's sections, in order. */ export const AI_MEDIA_KIND_GROUPS = [
|
|
29
|
+
'vector',
|
|
30
|
+
'photo',
|
|
31
|
+
'art',
|
|
32
|
+
'design'
|
|
33
|
+
];
|
|
34
|
+
/** Each section's heading in the Kind menu. */ export const AI_MEDIA_KIND_GROUP_LABELS = {
|
|
35
|
+
vector: 'Vector',
|
|
36
|
+
photo: 'Photo',
|
|
37
|
+
art: 'Art',
|
|
38
|
+
design: 'Design'
|
|
39
|
+
};
|
|
40
|
+
const vector = (id, label, hint, placeholder)=>({
|
|
41
|
+
id,
|
|
42
|
+
group: 'vector',
|
|
43
|
+
mode: 'illustration',
|
|
44
|
+
label,
|
|
45
|
+
hint,
|
|
46
|
+
aspectRatio: '1:1',
|
|
47
|
+
colors: 'palette',
|
|
48
|
+
placeholder
|
|
49
|
+
});
|
|
50
|
+
const raster = (id, group, label, hint, aspectRatio, placeholder)=>({
|
|
51
|
+
id,
|
|
52
|
+
group,
|
|
53
|
+
mode: 'photo',
|
|
54
|
+
label,
|
|
55
|
+
hint,
|
|
56
|
+
aspectRatio,
|
|
57
|
+
colors: group === 'photo' ? 'none' : 'describe',
|
|
58
|
+
placeholder
|
|
59
|
+
});
|
|
60
|
+
export const AI_MEDIA_KINDS = [
|
|
61
|
+
vector('illustration', 'Illustration', 'A spot illustration or small scene, drawn as an SVG and sharp at any size.', 'A friendly delivery van with a parcel, simple and flat'),
|
|
62
|
+
vector('icon', 'Icon', 'A single icon in one color, or two tones, readable at small sizes.', 'A shopping bag with a heart'),
|
|
63
|
+
vector('pattern', 'Pattern', 'A seamless background that tiles.', 'Scattered coffee beans and leaves'),
|
|
64
|
+
vector('logo', 'Logo mark', 'A simple symbol, without lettering. Not a real brand’s logo.', 'A mountain peak inside a circle'),
|
|
65
|
+
raster('photo', 'photo', 'Photo', 'A realistic photo; your description decides the style.', '1:1', 'A sunlit bakery counter with fresh sourdough loaves, warm morning light'),
|
|
66
|
+
raster('natural', 'photo', 'Natural photo', 'Candid and true to life, in soft available light.', '4:3', 'A florist arranging tulips in a small shop'),
|
|
67
|
+
raster('product', 'photo', 'Studio product shot', 'The product alone on a clean backdrop, in soft studio light.', '1:1', 'A matte ceramic coffee mug in sage green'),
|
|
68
|
+
raster('lifestyle', 'photo', 'Lifestyle with people', 'People using or enjoying the subject in a real setting. The people are made up, not anyone real.', '4:3', 'Friends sharing pastries at an outdoor café table'),
|
|
69
|
+
raster('architecture', 'photo', 'Architecture & interiors', 'Buildings and rooms with straight lines and natural daylight.', '4:3', 'A bright Scandinavian living room with oak floors'),
|
|
70
|
+
raster('food', 'photo', 'Food', 'Styled dishes in soft window light.', '3:4', 'A bowl of ramen with a soft-boiled egg and scallions'),
|
|
71
|
+
raster('aerial', 'photo', 'Aerial & landscape', 'A sweeping view from above or across the land.', '16:9', 'A winding coastal road at sunset'),
|
|
72
|
+
raster('render-3d', 'art', '3D render', 'Smooth, stylized 3D shapes in soft studio light.', '1:1', 'A stack of colorful gift boxes'),
|
|
73
|
+
raster('watercolor', 'art', 'Watercolor', 'Soft washes of color on textured paper.', '4:3', 'A harbor town with fishing boats'),
|
|
74
|
+
raster('oil-painting', 'art', 'Oil painting', 'Rich color and visible brushstrokes on canvas.', '4:3', 'A vase of sunflowers on a wooden table'),
|
|
75
|
+
raster('flat-art', 'art', 'Flat vector art', 'Clean flat shapes and solid colors, made as an image rather than an SVG.', '4:3', 'A team working together around a laptop'),
|
|
76
|
+
raster('line-drawing', 'art', 'Line drawing', 'Clean ink lines on a plain background.', '1:1', 'A bicycle leaning against a lamppost'),
|
|
77
|
+
raster('cartoon', 'art', 'Cartoon or anime', 'Bold outlines and bright colors, with original characters only.', '1:1', 'A cheerful robot watering plants'),
|
|
78
|
+
raster('background', 'design', 'Background or texture', 'Low contrast with no focal point, so text can sit on top.', '16:9', 'Soft gradient waves in calm blues'),
|
|
79
|
+
raster('banner', 'design', 'Banner or hero image', 'Wide, with calm space on one side for a headline. No lettering.', '16:9', 'A yoga mat and plants by a sunny window'),
|
|
80
|
+
raster('social', 'design', 'Social post graphic', 'A bold, centered picture for a social post.', '1:1', 'A summer sale feel with citrus fruit and bright colors'),
|
|
81
|
+
raster('mockup', 'design', 'Mockup', 'Your design shown on a device screen or on packaging.', '4:3', 'A phone on a desk showing a bakery’s online menu')
|
|
82
|
+
];
|
|
83
|
+
/** A kind by id; `undefined` for an id no kind has. */ export function aiMediaKind(id) {
|
|
84
|
+
return AI_MEDIA_KINDS.find((kind)=>kind.id === id);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The kinds this deployment offers: every kind where the image provider is
|
|
88
|
+
* on, and only the SVG kinds where it is not, so nothing the door would
|
|
89
|
+
* refuse is ever listed.
|
|
90
|
+
*/ export function aiMediaKindsOffered(photos) {
|
|
91
|
+
return photos ? AI_MEDIA_KINDS : AI_MEDIA_KINDS.filter((kind)=>kind.mode === 'illustration');
|
|
92
|
+
}
|
|
93
|
+
/** Every SVG and raster style has exactly one kind; the spec holds the list to it. */ export const AI_MEDIA_KIND_IDS = [
|
|
94
|
+
...AI_SVG_STYLES,
|
|
95
|
+
...AI_RASTER_STYLES
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=ai-media-kinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-media-kinds.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AI_RASTER_STYLES,\n AI_SVG_STYLES,\n type AiImageAspectRatio,\n type AiImageMode,\n type AiRasterStyle,\n type AiSvgStyle,\n} from '../providers/image-contract'\n\n/**\n * The kinds of picture Media's Create with AI offers (AGL-3602), as the Kind\n * menu lists them: four drawn as SVG by the text provider, and seventeen made\n * by the image provider — a photo whose description decides its style, six\n * photographic genres, six art styles and four design assets.\n *\n * Browser-safe: the dialog reads this to draw the menu, pick a shape and\n * decide which controls to show, with no request until Create. The style\n * wording a raster kind adds to the description is the server's\n * (`server/ai-media-raster-prompt.ts`), so the browser bundle does not carry\n * it.\n */\n\n/** The Kind menu's sections, in order. */\nexport const AI_MEDIA_KIND_GROUPS = ['vector', 'photo', 'art', 'design'] as const\nexport type AiMediaKindGroup = (typeof AI_MEDIA_KIND_GROUPS)[number]\n\n/** Each section's heading in the Kind menu. */\nexport const AI_MEDIA_KIND_GROUP_LABELS: Readonly<Record<AiMediaKindGroup, string>> = {\n vector: 'Vector',\n photo: 'Photo',\n art: 'Art',\n design: 'Design',\n}\n\n/** A kind's id: an SVG style, or an image-provider style. */\nexport type AiMediaKindId = AiSvgStyle | AiRasterStyle\n\n/**\n * Which colors a kind takes. `palette` offers the site theme's colors or the\n * person's own, sent with the request; `describe` sends none and suggests\n * naming colors in the description; `none` is a photograph, whose colors\n * are the scene's.\n */\nexport type AiMediaKindColors = 'palette' | 'describe' | 'none'\n\nexport interface AiMediaKind {\n id: AiMediaKindId\n group: AiMediaKindGroup\n /** The provider mode the door runs it in. */\n mode: AiImageMode\n label: string\n /** The line under the Kind menu once it is chosen. */\n hint: string\n /** The shape the dialog switches to when the kind is chosen. */\n aspectRatio: AiImageAspectRatio\n colors: AiMediaKindColors\n /** The description field's example. */\n placeholder: string\n}\n\nconst vector = (\n id: AiSvgStyle,\n label: string,\n hint: string,\n placeholder: string,\n): AiMediaKind => ({\n id,\n group: 'vector',\n mode: 'illustration',\n label,\n hint,\n aspectRatio: '1:1',\n colors: 'palette',\n placeholder,\n})\n\nconst raster = (\n id: AiRasterStyle,\n group: Exclude<AiMediaKindGroup, 'vector'>,\n label: string,\n hint: string,\n aspectRatio: AiImageAspectRatio,\n placeholder: string,\n): AiMediaKind => ({\n id,\n group,\n mode: 'photo',\n label,\n hint,\n aspectRatio,\n colors: group === 'photo' ? 'none' : 'describe',\n placeholder,\n})\n\nexport const AI_MEDIA_KINDS: readonly AiMediaKind[] = [\n vector(\n 'illustration',\n 'Illustration',\n 'A spot illustration or small scene, drawn as an SVG and sharp at any size.',\n 'A friendly delivery van with a parcel, simple and flat',\n ),\n vector(\n 'icon',\n 'Icon',\n 'A single icon in one color, or two tones, readable at small sizes.',\n 'A shopping bag with a heart',\n ),\n vector(\n 'pattern',\n 'Pattern',\n 'A seamless background that tiles.',\n 'Scattered coffee beans and leaves',\n ),\n vector(\n 'logo',\n 'Logo mark',\n 'A simple symbol, without lettering. Not a real brand’s logo.',\n 'A mountain peak inside a circle',\n ),\n raster(\n 'photo',\n 'photo',\n 'Photo',\n 'A realistic photo; your description decides the style.',\n '1:1',\n 'A sunlit bakery counter with fresh sourdough loaves, warm morning light',\n ),\n raster(\n 'natural',\n 'photo',\n 'Natural photo',\n 'Candid and true to life, in soft available light.',\n '4:3',\n 'A florist arranging tulips in a small shop',\n ),\n raster(\n 'product',\n 'photo',\n 'Studio product shot',\n 'The product alone on a clean backdrop, in soft studio light.',\n '1:1',\n 'A matte ceramic coffee mug in sage green',\n ),\n raster(\n 'lifestyle',\n 'photo',\n 'Lifestyle with people',\n 'People using or enjoying the subject in a real setting. The people are made up, not anyone real.',\n '4:3',\n 'Friends sharing pastries at an outdoor café table',\n ),\n raster(\n 'architecture',\n 'photo',\n 'Architecture & interiors',\n 'Buildings and rooms with straight lines and natural daylight.',\n '4:3',\n 'A bright Scandinavian living room with oak floors',\n ),\n raster(\n 'food',\n 'photo',\n 'Food',\n 'Styled dishes in soft window light.',\n '3:4',\n 'A bowl of ramen with a soft-boiled egg and scallions',\n ),\n raster(\n 'aerial',\n 'photo',\n 'Aerial & landscape',\n 'A sweeping view from above or across the land.',\n '16:9',\n 'A winding coastal road at sunset',\n ),\n raster(\n 'render-3d',\n 'art',\n '3D render',\n 'Smooth, stylized 3D shapes in soft studio light.',\n '1:1',\n 'A stack of colorful gift boxes',\n ),\n raster(\n 'watercolor',\n 'art',\n 'Watercolor',\n 'Soft washes of color on textured paper.',\n '4:3',\n 'A harbor town with fishing boats',\n ),\n raster(\n 'oil-painting',\n 'art',\n 'Oil painting',\n 'Rich color and visible brushstrokes on canvas.',\n '4:3',\n 'A vase of sunflowers on a wooden table',\n ),\n raster(\n 'flat-art',\n 'art',\n 'Flat vector art',\n 'Clean flat shapes and solid colors, made as an image rather than an SVG.',\n '4:3',\n 'A team working together around a laptop',\n ),\n raster(\n 'line-drawing',\n 'art',\n 'Line drawing',\n 'Clean ink lines on a plain background.',\n '1:1',\n 'A bicycle leaning against a lamppost',\n ),\n raster(\n 'cartoon',\n 'art',\n 'Cartoon or anime',\n 'Bold outlines and bright colors, with original characters only.',\n '1:1',\n 'A cheerful robot watering plants',\n ),\n raster(\n 'background',\n 'design',\n 'Background or texture',\n 'Low contrast with no focal point, so text can sit on top.',\n '16:9',\n 'Soft gradient waves in calm blues',\n ),\n raster(\n 'banner',\n 'design',\n 'Banner or hero image',\n 'Wide, with calm space on one side for a headline. No lettering.',\n '16:9',\n 'A yoga mat and plants by a sunny window',\n ),\n raster(\n 'social',\n 'design',\n 'Social post graphic',\n 'A bold, centered picture for a social post.',\n '1:1',\n 'A summer sale feel with citrus fruit and bright colors',\n ),\n raster(\n 'mockup',\n 'design',\n 'Mockup',\n 'Your design shown on a device screen or on packaging.',\n '4:3',\n 'A phone on a desk showing a bakery’s online menu',\n ),\n]\n\n/** A kind by id; `undefined` for an id no kind has. */\nexport function aiMediaKind(id: string): AiMediaKind | undefined {\n return AI_MEDIA_KINDS.find((kind) => kind.id === id)\n}\n\n/**\n * The kinds this deployment offers: every kind where the image provider is\n * on, and only the SVG kinds where it is not, so nothing the door would\n * refuse is ever listed.\n */\nexport function aiMediaKindsOffered(photos: boolean): readonly AiMediaKind[] {\n return photos ? AI_MEDIA_KINDS : AI_MEDIA_KINDS.filter((kind) => kind.mode === 'illustration')\n}\n\n/** Every SVG and raster style has exactly one kind; the spec holds the list to it. */\nexport const AI_MEDIA_KIND_IDS: readonly AiMediaKindId[] = [...AI_SVG_STYLES, ...AI_RASTER_STYLES]\n"],"names":["AI_RASTER_STYLES","AI_SVG_STYLES","AI_MEDIA_KIND_GROUPS","AI_MEDIA_KIND_GROUP_LABELS","vector","photo","art","design","id","label","hint","placeholder","group","mode","aspectRatio","colors","raster","AI_MEDIA_KINDS","aiMediaKind","find","kind","aiMediaKindsOffered","photos","filter","AI_MEDIA_KIND_IDS"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,gBAAgB,EAChBC,aAAa,QAKR,iCAA6B;AAEpC;;;;;;;;;;;CAWC,GAED,wCAAwC,GACxC,OAAO,MAAMC,uBAAuB;IAAC;IAAU;IAAS;IAAO;CAAS,CAAS;AAGjF,6CAA6C,GAC7C,OAAO,MAAMC,6BAAyE;IACpFC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLC,QAAQ;AACV,EAAC;AA4BD,MAAMH,SAAS,CACbI,IACAC,OACAC,MACAC,cACiB,CAAA;QACjBH;QACAI,OAAO;QACPC,MAAM;QACNJ;QACAC;QACAI,aAAa;QACbC,QAAQ;QACRJ;IACF,CAAA;AAEA,MAAMK,SAAS,CACbR,IACAI,OACAH,OACAC,MACAI,aACAH,cACiB,CAAA;QACjBH;QACAI;QACAC,MAAM;QACNJ;QACAC;QACAI;QACAC,QAAQH,UAAU,UAAU,SAAS;QACrCD;IACF,CAAA;AAEA,OAAO,MAAMM,iBAAyC;IACpDb,OACE,gBACA,gBACA,8EACA;IAEFA,OACE,QACA,QACA,sEACA;IAEFA,OACE,WACA,WACA,qCACA;IAEFA,OACE,QACA,aACA,gEACA;IAEFY,OACE,SACA,SACA,SACA,0DACA,OACA;IAEFA,OACE,WACA,SACA,iBACA,qDACA,OACA;IAEFA,OACE,WACA,SACA,uBACA,gEACA,OACA;IAEFA,OACE,aACA,SACA,yBACA,oGACA,OACA;IAEFA,OACE,gBACA,SACA,4BACA,iEACA,OACA;IAEFA,OACE,QACA,SACA,QACA,uCACA,OACA;IAEFA,OACE,UACA,SACA,sBACA,kDACA,QACA;IAEFA,OACE,aACA,OACA,aACA,oDACA,OACA;IAEFA,OACE,cACA,OACA,cACA,2CACA,OACA;IAEFA,OACE,gBACA,OACA,gBACA,kDACA,OACA;IAEFA,OACE,YACA,OACA,mBACA,4EACA,OACA;IAEFA,OACE,gBACA,OACA,gBACA,0CACA,OACA;IAEFA,OACE,WACA,OACA,oBACA,mEACA,OACA;IAEFA,OACE,cACA,UACA,yBACA,6DACA,QACA;IAEFA,OACE,UACA,UACA,wBACA,mEACA,QACA;IAEFA,OACE,UACA,UACA,uBACA,+CACA,OACA;IAEFA,OACE,UACA,UACA,UACA,yDACA,OACA;CAEH,CAAA;AAED,qDAAqD,GACrD,OAAO,SAASE,YAAYV,EAAU;IACpC,OAAOS,eAAeE,IAAI,CAAC,CAACC,OAASA,KAAKZ,EAAE,KAAKA;AACnD;AAEA;;;;CAIC,GACD,OAAO,SAASa,oBAAoBC,MAAe;IACjD,OAAOA,SAASL,iBAAiBA,eAAeM,MAAM,CAAC,CAACH,OAASA,KAAKP,IAAI,KAAK;AACjF;AAEA,oFAAoF,GACpF,OAAO,MAAMW,oBAA8C;OAAIvB;OAAkBD;CAAiB,CAAA"}
|
|
@@ -45,7 +45,7 @@ export interface AiSiteBuildRow {
|
|
|
45
45
|
}
|
|
46
46
|
/** Where the whole job stands, as the page's header and actions read it. */
|
|
47
47
|
export type AiSiteBuildPhase = 'working' | 'done' | 'stopped' | 'failed' | 'canceled';
|
|
48
|
-
export declare function aiSiteBuildPhase(job: Pick<AiJobSummary, 'status'>): AiSiteBuildPhase;
|
|
48
|
+
export declare function aiSiteBuildPhase(job: Pick<AiJobSummary, 'status'> & Partial<Pick<AiJobSummary, 'review' | 'autoConfirm' | 'updatedAt'>>): AiSiteBuildPhase;
|
|
49
49
|
/**
|
|
50
50
|
* One row a stage: planning, then each creation the plan builds before its
|
|
51
51
|
* pages — the colors, the layout, the form — then each page (AGL-3596). A
|
|
@@ -55,8 +55,16 @@ export declare function aiSiteBuildPhase(job: Pick<AiJobSummary, 'status'>): AiS
|
|
|
55
55
|
* the first page's.
|
|
56
56
|
*/
|
|
57
57
|
export declare function aiSiteBuildRows(job: Pick<AiJobSummary, 'status' | 'steps' | 'plan' | 'outputs' | 'review'> & Partial<Pick<AiJobSummary, 'items' | 'kind' | 'siteInputs' | 'sitePublish'>>): AiSiteBuildRow[];
|
|
58
|
+
/** The row the site's look is designed on (AGL-3660). */
|
|
59
|
+
export declare const AI_SITE_LOOK_ROW_LABEL = "Designing your look";
|
|
60
|
+
/** What the look's row says while it runs. */
|
|
61
|
+
export declare const AI_SITE_LOOK_HINT = "Choosing a base theme, colors, fonts and the style of your buttons, cards and forms for your kind of site. This takes a few seconds.";
|
|
58
62
|
/** What the planning row says while it runs. */
|
|
59
63
|
export declare const AI_SITE_PLAN_HINT = "Reading your answers and choosing your pages, what each one says, and the forms and layout they need. This usually takes under a minute.";
|
|
64
|
+
/** What the page being written says while it is the active row (AGL-3596). */
|
|
65
|
+
export declare const AI_SITE_PAGE_HINT = "Writing this page\u2019s sections from your plan. It is done once every section is in.";
|
|
66
|
+
/** What any other part being built says while it is the active row. */
|
|
67
|
+
export declare const AI_SITE_ITEM_HINT = "Building this now. The next step starts when it is done.";
|
|
60
68
|
/**
|
|
61
69
|
* How far the job is, from 0 to 1, by its rows: a finished row counts whole
|
|
62
70
|
* and the active one half. `null` before there is more than one row to count.
|
|
@@ -14,10 +14,13 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/ import { aiJobKindNoun } from "./ai-job-activity.js";
|
|
17
|
+
*/ import { aiJobConfirmingOwnPlan, aiJobKindNoun } from "./ai-job-activity.js";
|
|
18
18
|
import { aiJobRefundCopy } from "./ai-job-failure-copy.js";
|
|
19
19
|
import { aiBuildItemRows, aiBuildOutcomeLine, aiSitePartialCopy } from "./ai-build-progress.js";
|
|
20
20
|
export function aiSiteBuildPhase(job) {
|
|
21
|
+
// A guided start's plan parked for the instant its confirmation takes is
|
|
22
|
+
// the build going on (AGL-3596), never a stop.
|
|
23
|
+
if (aiJobConfirmingOwnPlan(job)) return 'working';
|
|
21
24
|
switch(job.status){
|
|
22
25
|
case 'done':
|
|
23
26
|
return 'done';
|
|
@@ -36,7 +39,7 @@ export function aiSiteBuildPhase(job) {
|
|
|
36
39
|
{
|
|
37
40
|
kind: 'theme-change',
|
|
38
41
|
resource: 'theme',
|
|
39
|
-
label: ()=>
|
|
42
|
+
label: ()=>AI_SITE_LOOK_ROW_LABEL
|
|
40
43
|
},
|
|
41
44
|
{
|
|
42
45
|
kind: 'layout',
|
|
@@ -63,20 +66,24 @@ export function aiSiteBuildPhase(job) {
|
|
|
63
66
|
// A build is read off its item ledger (AGL-3616): one row an item, each with
|
|
64
67
|
// its own state and what became of its credits.
|
|
65
68
|
if ((_job_items = job.items) == null ? void 0 : _job_items.length) {
|
|
66
|
-
var _job_items1;
|
|
69
|
+
var _job_items1, _planStep_creditsSpent1;
|
|
67
70
|
const site = job.kind !== 'build';
|
|
68
71
|
const pages = ((_job_items1 = job.items) != null ? _job_items1 : []).filter((row)=>row.op === 'page');
|
|
72
|
+
// The plan keeps the credits it used once the items take over the page.
|
|
73
|
+
const planStep = job.steps.find((step)=>step.name === 'plan');
|
|
69
74
|
return [
|
|
70
|
-
{
|
|
75
|
+
_extends({
|
|
71
76
|
id: 'plan',
|
|
72
77
|
label: site ? 'Planning your pages' : 'Planning what to build',
|
|
73
78
|
state: 'done'
|
|
74
|
-
},
|
|
79
|
+
}, planStep ? {
|
|
80
|
+
credits: Math.max(0, Math.floor((_planStep_creditsSpent1 = planStep.creditsSpent) != null ? _planStep_creditsSpent1 : 0))
|
|
81
|
+
} : {}),
|
|
75
82
|
...aiBuildItemRows(job).map((row, index)=>{
|
|
76
|
-
var _job_items, _ledger_creditsSpent, _ledger_creditsRefunded;
|
|
83
|
+
var _job_items, _ledger_creditsSpent, _ledger_creditsRefunded, _row_startedAt;
|
|
77
84
|
const ledger = ((_job_items = job.items) != null ? _job_items : [])[index];
|
|
78
85
|
// A site keeps the scaffold's own words for each stage (AGL-3596).
|
|
79
|
-
const label = !site || !ledger ? row.label : ledger.op === 'theme' ?
|
|
86
|
+
const label = !site || !ledger ? row.label : ledger.op === 'theme' ? AI_SITE_LOOK_ROW_LABEL : ledger.op === 'layout' ? `Building the header and footer: ${ledger.label}` : ledger.op === 'form' ? `Building the form: ${ledger.label}` : ledger.op === 'page' ? `Writing page ${pages.indexOf(ledger) + 1} of ${pages.length}: ${ledger.label}` : ledger.op === 'email' ? 'Writing your welcome email' : row.label;
|
|
80
87
|
const screen = (ledger == null ? void 0 : ledger.op) === 'page' ? aiPlanScreenFor(job.plan, ledger.label, pages.indexOf(ledger)) : null;
|
|
81
88
|
const finished = row.state === 'done' || row.state === 'failed';
|
|
82
89
|
const net = ledger ? Math.max(0, Math.floor(((_ledger_creditsSpent = ledger.creditsSpent) != null ? _ledger_creditsSpent : 0) - ((_ledger_creditsRefunded = ledger.creditsRefunded) != null ? _ledger_creditsRefunded : 0))) : 0;
|
|
@@ -84,8 +91,16 @@ export function aiSiteBuildPhase(job) {
|
|
|
84
91
|
id: row.slot,
|
|
85
92
|
label,
|
|
86
93
|
state: row.state,
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
// A part that failed while the rest is still being built says the
|
|
95
|
+
// build goes on (AGL-3596): read alone, it looked like the site had.
|
|
96
|
+
detail: row.state === 'failed' && phase === 'working' ? [
|
|
97
|
+
row.detail,
|
|
98
|
+
site ? 'The rest of your site keeps building.' : 'The rest keeps building.'
|
|
99
|
+
].filter(Boolean).join(' ') : row.detail
|
|
100
|
+
}, row.state === 'active' ? {
|
|
101
|
+
startedAt: (_row_startedAt = row.startedAt) != null ? _row_startedAt : null,
|
|
102
|
+
hint: (ledger == null ? void 0 : ledger.op) === 'page' ? AI_SITE_PAGE_HINT : site && (ledger == null ? void 0 : ledger.op) === 'theme' ? AI_SITE_LOOK_HINT : AI_SITE_ITEM_HINT
|
|
103
|
+
} : {}, (screen == null ? void 0 : screen.sections.length) ? {
|
|
89
104
|
sections: screen.sections.map((section)=>section.name)
|
|
90
105
|
} : {}, finished && ledger ? {
|
|
91
106
|
credits: net
|
|
@@ -116,11 +131,27 @@ export function aiSiteBuildPhase(job) {
|
|
|
116
131
|
var _job_siteInputs;
|
|
117
132
|
const pagesAsked = typeof ((_job_siteInputs = job.siteInputs) == null ? void 0 : _job_siteInputs['pages']) === 'number' ? Math.round(job.siteInputs['pages']) : 0;
|
|
118
133
|
if (job.siteInputs) {
|
|
134
|
+
// The look is designed first, before the header and footer (AGL-3660).
|
|
135
|
+
rows.push({
|
|
136
|
+
id: 'look',
|
|
137
|
+
label: AI_SITE_LOOK_ROW_LABEL,
|
|
138
|
+
state: 'waiting'
|
|
139
|
+
});
|
|
119
140
|
rows.push({
|
|
120
141
|
id: 'layout',
|
|
121
142
|
label: 'Building the header and footer',
|
|
122
143
|
state: 'waiting'
|
|
123
144
|
});
|
|
145
|
+
// A guided start that says where its contact form's submissions go
|
|
146
|
+
// plans that form, built after the layout and before the pages (AGL-3596).
|
|
147
|
+
const submissions = job.siteInputs['submissions'];
|
|
148
|
+
if (submissions === 'inbox' || submissions === 'lead') {
|
|
149
|
+
rows.push({
|
|
150
|
+
id: 'form',
|
|
151
|
+
label: 'Building your contact form',
|
|
152
|
+
state: 'waiting'
|
|
153
|
+
});
|
|
154
|
+
}
|
|
124
155
|
rows.push({
|
|
125
156
|
id: 'pages',
|
|
126
157
|
label: pagesAsked > 1 ? `Writing your ${pagesAsked} pages` : 'Writing your pages',
|
|
@@ -143,11 +174,16 @@ export function aiSiteBuildPhase(job) {
|
|
|
143
174
|
for (const row of CREATION_ROWS){
|
|
144
175
|
var _job_plan1;
|
|
145
176
|
const creation = (_job_plan1 = job.plan) == null ? void 0 : _job_plan1.create.find((entry)=>entry.kind === row.kind);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
177
|
+
// A job read without its item ledger is one from before the look had a
|
|
178
|
+
// unit of its own (AGL-3660): its look is a stage only where it built one.
|
|
179
|
+
if (creation || row.resource === 'theme' && job.outputs.some((output)=>output.resource === 'theme')) {
|
|
180
|
+
var _ref2;
|
|
181
|
+
stages.push({
|
|
182
|
+
id: row.resource,
|
|
183
|
+
label: row.label((_ref2 = creation == null ? void 0 : creation.name) != null ? _ref2 : ''),
|
|
184
|
+
resource: row.resource
|
|
185
|
+
});
|
|
186
|
+
}
|
|
151
187
|
}
|
|
152
188
|
const pages = (_ref1 = (_job_plan = job.plan) == null ? void 0 : _job_plan.screens) != null ? _ref1 : [];
|
|
153
189
|
pages.forEach((page, index)=>{
|
|
@@ -175,7 +211,11 @@ export function aiSiteBuildPhase(job) {
|
|
|
175
211
|
rows.push(...aiSitePublishRow(job, phase));
|
|
176
212
|
return rows;
|
|
177
213
|
}
|
|
214
|
+
/** The row the site's look is designed on (AGL-3660). */ export const AI_SITE_LOOK_ROW_LABEL = 'Designing your look';
|
|
215
|
+
/** What the look's row says while it runs. */ export const AI_SITE_LOOK_HINT = 'Choosing a base theme, colors, fonts and the style of your buttons, cards and forms for your kind of site. This takes a few seconds.';
|
|
178
216
|
/** What the planning row says while it runs. */ export const AI_SITE_PLAN_HINT = 'Reading your answers and choosing your pages, what each one says, and the forms and layout they need. This usually takes under a minute.';
|
|
217
|
+
/** What the page being written says while it is the active row (AGL-3596). */ export const AI_SITE_PAGE_HINT = 'Writing this page’s sections from your plan. It is done once every section is in.';
|
|
218
|
+
/** What any other part being built says while it is the active row. */ export const AI_SITE_ITEM_HINT = 'Building this now. The next step starts when it is done.';
|
|
179
219
|
/** The plan's page an item builds: by its title, else by its place among the pages. */ function aiPlanScreenFor(plan, title, index) {
|
|
180
220
|
var _ref, _screens_find, _screens_index;
|
|
181
221
|
const screens = (_ref = plan == null ? void 0 : plan.screens) != null ? _ref : [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-site-build-progress.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { aiJobKindNoun } from './ai-job-activity'\nimport { aiJobRefundCopy } from './ai-job-failure-copy'\nimport { aiBuildItemRows, aiBuildOutcomeLine, aiSitePartialCopy } from './ai-build-progress'\nimport type { AiJobSummary } from './ai-jobs.types'\n\n/**\n * What the \"Building your site\" page shows of a site job (AGL-3594): one row\n * a stage — planning the pages, then each page — with its state, the state\n * the whole job is in, and the job's one price.\n *\n * Read off the job summary every surface already follows: the plan step's\n * status, the plan's pages, and the pages the build has reported as outputs.\n * A scaffold builds its units in plan order and reports each page when it is\n * written, so the pages written so far are the first pages of the plan.\n *\n * Pure: no React, no request. The page and its spec read the same rows.\n */\n\nexport type AiSiteBuildRowState = 'done' | 'active' | 'waiting' | 'failed' | 'skipped'\n\nexport interface AiSiteBuildRow {\n id: string\n label: string\n state: AiSiteBuildRowState\n /** What the person should know about this row (AGL-3616): a build item's failure, note or refund. */\n detail?: string | null\n /** What the row is doing while it is the active one, in a sentence. */\n hint?: string | null\n /** A page's planned sections, in order, so the person sees what is being written. */\n sections?: string[]\n /** The credits this row's work used, once it has finished; absent while it runs. */\n credits?: number\n /** When this row's work started, for the elapsed time beside the active row. */\n startedAt?: string | null\n}\n\n/** Where the whole job stands, as the page's header and actions read it. */\nexport type AiSiteBuildPhase = 'working' | 'done' | 'stopped' | 'failed' | 'canceled'\n\nexport function aiSiteBuildPhase(job: Pick<AiJobSummary, 'status'>): AiSiteBuildPhase {\n switch (job.status) {\n case 'done':\n return 'done'\n case 'failed':\n return 'failed'\n case 'canceled':\n return 'canceled'\n case 'needs_review':\n case 'needs_input':\n return 'stopped'\n default:\n return 'working'\n }\n}\n\n/** The creations a scaffold builds before its pages, in its build order, and what each row says. */\nconst CREATION_ROWS: ReadonlyArray<{ kind: string; resource: string; label: (name: string) => string }> = [\n { kind: 'theme-change', resource: 'theme', label: () => 'Choosing your colors' },\n { kind: 'layout', resource: 'layout', label: (name) => `Building the header and footer: ${name}` },\n { kind: 'form', resource: 'form', label: (name) => `Building the form: ${name}` },\n]\n\n/**\n * One row a stage: planning, then each creation the plan builds before its\n * pages — the colors, the layout, the form — then each page (AGL-3596). A\n * scaffold builds them in that order and reports each as an output when it\n * is written, so the first row without its output is where the build is, and\n * where a failure stopped it: a layout that broke is the layout's row, never\n * the first page's.\n */\nexport function aiSiteBuildRows(\n job: Pick<AiJobSummary, 'status' | 'steps' | 'plan' | 'outputs' | 'review'> &\n Partial<Pick<AiJobSummary, 'items' | 'kind' | 'siteInputs' | 'sitePublish'>>,\n): AiSiteBuildRow[] {\n const phase = aiSiteBuildPhase(job)\n // A build is read off its item ledger (AGL-3616): one row an item, each with\n // its own state and what became of its credits.\n if (job.items?.length) {\n const site = job.kind !== 'build'\n const pages = (job.items ?? []).filter((row) => row.op === 'page')\n return [\n { id: 'plan', label: site ? 'Planning your pages' : 'Planning what to build', state: 'done' },\n ...aiBuildItemRows(job).map((row, index) => {\n const ledger = (job.items ?? [])[index]\n // A site keeps the scaffold's own words for each stage (AGL-3596).\n const label =\n !site || !ledger\n ? row.label\n : ledger.op === 'theme'\n ? 'Choosing your colors'\n : ledger.op === 'layout'\n ? `Building the header and footer: ${ledger.label}`\n : ledger.op === 'form'\n ? `Building the form: ${ledger.label}`\n : ledger.op === 'page'\n ? `Writing page ${pages.indexOf(ledger) + 1} of ${pages.length}: ${ledger.label}`\n : ledger.op === 'email'\n ? 'Writing your welcome email'\n : row.label\n const screen = ledger?.op === 'page' ? aiPlanScreenFor(job.plan, ledger.label, pages.indexOf(ledger)) : null\n const finished = row.state === 'done' || row.state === 'failed'\n const net = ledger ? Math.max(0, Math.floor((ledger.creditsSpent ?? 0) - (ledger.creditsRefunded ?? 0))) : 0\n return {\n id: row.slot,\n label,\n state: row.state,\n detail: row.detail,\n ...(screen?.sections.length ? { sections: screen.sections.map((section) => section.name) } : {}),\n ...(finished && ledger ? { credits: net } : {}),\n }\n }),\n ...aiSitePublishRow(job, phase),\n ]\n }\n const planStep = job.steps.find((step) => step.name === 'plan')\n const planDone = planStep?.status === 'done' || Boolean(job.plan)\n const stopped = phase === 'failed' || phase === 'stopped'\n const planState: AiSiteBuildRowState = planDone ? 'done' : stopped ? 'failed' : phase === 'working' ? 'active' : 'waiting'\n const rows: AiSiteBuildRow[] = [\n {\n id: 'plan',\n label: 'Planning your pages',\n state: planState,\n startedAt: planStep?.startedAt ?? null,\n hint: planState === 'active' ? AI_SITE_PLAN_HINT : null,\n ...(planDone && planStep ? { credits: Math.max(0, Math.floor(planStep.creditsSpent ?? 0)) } : {}),\n },\n ]\n // Before there is a plan, the stages a guided start always goes through\n // are named from its answers, so the page shows the whole way from the\n // start rather than one row.\n if (!job.plan && job.kind !== 'build') {\n const pagesAsked = typeof job.siteInputs?.['pages'] === 'number' ? Math.round(job.siteInputs['pages'] as number) : 0\n if (job.siteInputs) {\n rows.push({ id: 'layout', label: 'Building the header and footer', state: 'waiting' })\n rows.push({\n id: 'pages',\n label: pagesAsked > 1 ? `Writing your ${pagesAsked} pages` : 'Writing your pages',\n state: 'waiting',\n })\n rows.push(...aiSitePublishRow(job, phase))\n }\n return rows\n }\n const built = new Map<string, number>()\n for (const output of job.outputs) built.set(output.resource, (built.get(output.resource) ?? 0) + 1)\n const take = (resource: string): boolean => {\n const left = built.get(resource) ?? 0\n if (left <= 0) return false\n built.set(resource, left - 1)\n return true\n }\n const stages: Array<{ id: string; label: string; resource: string; sections?: string[] }> = []\n for (const row of CREATION_ROWS) {\n const creation = job.plan?.create.find((entry) => entry.kind === row.kind)\n if (creation) stages.push({ id: row.resource, label: row.label(creation.name), resource: row.resource })\n }\n const pages = job.plan?.screens ?? []\n pages.forEach((page, index) => {\n stages.push({\n id: `page-${index}`,\n label: `Writing page ${index + 1} of ${pages.length}: ${page.title}`,\n resource: 'screen',\n sections: page.sections.map((section) => section.name),\n })\n })\n let reached = false\n for (const stage of stages) {\n const done = phase === 'done' || take(stage.resource)\n const current = !done && !reached && planDone\n if (current) reached = true\n rows.push({\n id: stage.id,\n label: stage.label,\n state: done ? 'done' : current && stopped ? 'failed' : current && phase === 'working' ? 'active' : 'waiting',\n ...(stage.sections?.length ? { sections: stage.sections } : {}),\n })\n }\n rows.push(...aiSitePublishRow(job, phase))\n return rows\n}\n\n/** What the planning row says while it runs. */\nexport const AI_SITE_PLAN_HINT =\n 'Reading your answers and choosing your pages, what each one says, and the forms and layout they need. This usually takes under a minute.'\n\n/** The plan's page an item builds: by its title, else by its place among the pages. */\nfunction aiPlanScreenFor(\n plan: AiJobSummary['plan'],\n title: string,\n index: number,\n): NonNullable<AiJobSummary['plan']>['screens'][number] | null {\n const screens = plan?.screens ?? []\n return screens.find((screen) => screen.title === title) ?? (index >= 0 ? (screens[index] ?? null) : null)\n}\n\n/**\n * A guided start ends by putting its pages live (AGL-3596): the last row, so\n * the person sees that step coming and when it is done. Only a site job\n * publishes on its own; a build publishes when asked, and says so in its plan.\n */\nfunction aiSitePublishRow(\n job: Pick<AiJobSummary, 'status'> & Partial<Pick<AiJobSummary, 'kind' | 'sitePublish'>>,\n phase: AiSiteBuildPhase,\n): AiSiteBuildRow[] {\n if (job.kind !== 'site') return []\n const published = (job.sitePublish?.published.length ?? 0) > 0\n return [\n {\n id: 'publish',\n label: 'Publishing your site',\n // A job that stopped or failed publishes nothing, so the row is passed over.\n state: phase === 'done' ? (published ? 'done' : 'skipped') : phase === 'working' ? 'waiting' : 'skipped',\n },\n ]\n}\n\n/**\n * How far the job is, from 0 to 1, by its rows: a finished row counts whole\n * and the active one half. `null` before there is more than one row to count.\n */\nexport function aiSiteBuildFraction(rows: readonly AiSiteBuildRow[]): number | null {\n if (rows.length < 2) return null\n const counted = rows.reduce(\n (sum, row) => sum + (row.state === 'active' ? 0.5 : row.state === 'waiting' ? 0 : 1),\n 0,\n )\n return Math.min(1, counted / rows.length)\n}\n\n/**\n * The job's one price (AGL-3594), never a plan's on its own: what it has used\n * so far while it works, what it used once done, and, on a failure we gave\n * back, that nothing was charged.\n */\nexport function aiSiteBuildCreditsLine(\n job: Pick<AiJobSummary, 'status' | 'creditsSpent' | 'refundedCredits'> & Partial<Pick<AiJobSummary, 'kind'>>,\n): string | null {\n const spent = Math.max(0, job.creditsSpent ?? 0)\n const refunded = Math.max(0, job.refundedCredits ?? 0)\n const net = Math.max(0, spent - refunded)\n const phase = aiSiteBuildPhase(job)\n // What the job made, by its kind; a job that names none is a site's.\n const subject = !job.kind || job.kind === 'site' ? 'This site' : aiJobKindNoun(job.kind) === 'AI job' ? 'This AI job' : `This ${aiJobKindNoun(job.kind)}`\n // A failure on our side says so in the words every surface uses (AGL-3596),\n // from the job's recorded give-back.\n const refund = phase === 'working' || phase === 'done' ? null : aiJobRefundCopy(job)\n if (refund && refunded > 0) return refund\n if (phase === 'done') return `${subject} used ${net} credits.`\n if (phase === 'working') return `Credits used so far: ${net}`\n if (refund) return `${subject} used ${net} credits. ${refund}`\n return net > 0 ? `${subject} used ${net} credits.` : null\n}\n\n/** The heading and the sentence under it, for one job's page in its current phase. */\nexport interface AiJobPageCopy {\n heading: string\n lede: string\n}\n\n/**\n * What one job's page says at the top (AGL-3594, AGL-3596). A site job reads\n * as \"Building your site\"; any other kind names what it makes — \"Building\n * your page\" — or, for a kind with no noun, the job itself.\n *\n * A guided site start publishes its pages when it finishes, and says so\n * (`sitePublish`): with a page live the heading is \"Your site is live\". A\n * done site job without that record — an older job, or one that was not a\n * guided start — built drafts, and says that instead.\n */\nexport function aiJobPageCopy(\n job: Pick<AiJobSummary, 'kind' | 'status' | 'review' | 'error'> & Partial<Pick<AiJobSummary, 'sitePublish' | 'items'>>,\n brand: string,\n): AiJobPageCopy {\n const phase = aiSiteBuildPhase(job)\n // A build is what the person asked for, item by item (AGL-3616).\n if (job.kind === 'build') return aiBuildPageCopy(job, brand)\n const noun = job.kind === 'site' ? 'site' : aiJobKindNoun(job.kind)\n const generic = noun === 'AI job'\n // `products` is the one plural noun.\n const isAre = noun.endsWith('s') ? 'are' : 'is'\n const why = job.review?.message ?? job.error ?? null\n if (phase === 'working') {\n return {\n heading: generic ? 'Your AI job is running' : `Building your ${noun}`,\n lede:\n job.kind === 'site'\n ? `${brand} AI is planning your pages and writing each one. You can leave this page; it keeps going.`\n : `${brand} AI is working on it. You can leave this page; it keeps going.`,\n }\n }\n if (phase === 'done') {\n const published = job.sitePublish?.published.length ?? 0\n // Part of the site was built (AGL-3616): what was, what was not, and its credits.\n const partial = job.kind === 'site' ? aiSitePartialCopy({ items: job.items, status: job.status }) : null\n if (job.kind === 'site' && published > 0) {\n return {\n heading: 'Your site is live',\n lede: [\n partial,\n job.sitePublish?.drafts.length\n ? 'Your pages are published, except the ones listed below, which stayed drafts.'\n : 'Your pages are published, and anyone can visit your site now.',\n ]\n .filter(Boolean)\n .join(' '),\n }\n }\n if (partial) return { heading: 'Your site is ready', lede: `${partial} Your new pages are drafts. Publish them when you’re happy.` }\n if (job.kind === 'site' && job.sitePublish) {\n return {\n heading: 'Your site is ready',\n lede: 'None of your new pages could be published, so they are drafts. The reasons are below.',\n }\n }\n return {\n heading: generic ? 'Your AI job finished' : `Your ${noun} ${isAre} ready`,\n lede:\n job.kind === 'site'\n ? 'Your new pages are drafts. Publish them when you’re happy.'\n : 'Everything it built is an unpublished draft until you publish it.',\n }\n }\n if (phase === 'canceled') {\n return { heading: generic ? 'Your AI job was canceled' : `Your ${noun} was not built`, lede: 'The job was canceled.' }\n }\n return {\n heading: generic ? 'Your AI job stopped' : `Your ${noun} ${noun.endsWith('s') ? 'were' : 'was'} not built`,\n lede: why ?? (generic ? 'Something went wrong running this job.' : `Something went wrong building your ${noun}.`),\n }\n}\n\n/** A build's page heading and sentence (AGL-3616). */\nfunction aiBuildPageCopy(\n job: Pick<AiJobSummary, 'status' | 'review' | 'error'> & Partial<Pick<AiJobSummary, 'items' | 'sitePublish'>>,\n brand: string,\n): AiJobPageCopy {\n const phase = aiSiteBuildPhase(job)\n const outcome = aiBuildOutcomeLine({ items: job.items ?? [], status: job.status })\n if (phase === 'working') {\n return {\n heading: 'Building what you asked for',\n lede: `${brand} AI is building each part in turn. You can leave this page; it keeps going.`,\n }\n }\n if (phase === 'stopped') {\n return {\n heading: job.review?.reason === 'plan' ? 'Your plan is ready' : 'Your build needs you',\n lede: job.review?.message ?? job.error ?? 'It waits for your decision.',\n }\n }\n if (phase === 'done') {\n const failed = (job.items ?? []).some((row) => row.status === 'failed' || row.status === 'skipped')\n const live = job.sitePublish?.published.length ?? 0\n return {\n heading: failed ? 'Most of it is ready' : 'Everything you asked for is ready',\n lede: [\n outcome,\n live ? 'Your new pages are published.' : 'Everything it built is an unpublished draft until you publish it.',\n failed ? 'Try again builds only what failed.' : '',\n ]\n .filter(Boolean)\n .join(' '),\n }\n }\n if (phase === 'canceled') return { heading: 'Your build was canceled', lede: 'The job was canceled.' }\n return {\n heading: 'Nothing could be built',\n lede: [job.error ?? 'Something went wrong building what you asked for.', outcome].filter(Boolean).join(' '),\n }\n}\n"],"names":["aiJobKindNoun","aiJobRefundCopy","aiBuildItemRows","aiBuildOutcomeLine","aiSitePartialCopy","aiSiteBuildPhase","job","status","CREATION_ROWS","kind","resource","label","name","aiSiteBuildRows","planStep","built","phase","items","length","site","pages","filter","row","op","id","state","map","index","ledger","indexOf","screen","aiPlanScreenFor","plan","finished","net","Math","max","floor","creditsSpent","creditsRefunded","slot","detail","sections","section","credits","aiSitePublishRow","steps","find","step","planDone","Boolean","stopped","planState","rows","startedAt","hint","AI_SITE_PLAN_HINT","pagesAsked","siteInputs","round","push","Map","output","outputs","set","get","take","left","stages","creation","create","entry","screens","forEach","page","title","reached","stage","done","current","published","sitePublish","aiSiteBuildFraction","counted","reduce","sum","min","aiSiteBuildCreditsLine","spent","refunded","refundedCredits","subject","refund","aiJobPageCopy","brand","aiBuildPageCopy","noun","generic","isAre","endsWith","why","review","message","error","heading","lede","partial","drafts","join","outcome","reason","failed","some","live"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,aAAa,QAAQ,uBAAmB;AACjD,SAASC,eAAe,QAAQ,2BAAuB;AACvD,SAASC,eAAe,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,yBAAqB;AAqC5F,OAAO,SAASC,iBAAiBC,GAAiC;IAChE,OAAQA,IAAIC,MAAM;QAChB,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,kGAAkG,GAClG,MAAMC,gBAAoG;IACxG;QAAEC,MAAM;QAAgBC,UAAU;QAASC,OAAO,IAAM;IAAuB;IAC/E;QAAEF,MAA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AAC6B,SACP0D,IAAI,CAAC;QACV;IACF;IACA,IAAI5F,UAAU,YAAY,OAAO;QAAEwF,SAAS;QAA2BC,MAAM;IAAwB;IACrG,OAAO;QACLD,SAAS;QACTC,MAAM;aAACnG,aAAAA,IAAIiG,KAAK,YAATjG,aAAa;YAAqDuG;SAAQ,CAACxF,MAAM,CAAC6B,SAAS0D,IAAI,CAAC;IACzG;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-site-build-progress.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { aiJobConfirmingOwnPlan, aiJobKindNoun } from './ai-job-activity'\nimport { aiJobRefundCopy } from './ai-job-failure-copy'\nimport { aiBuildItemRows, aiBuildOutcomeLine, aiSitePartialCopy } from './ai-build-progress'\nimport type { AiJobSummary } from './ai-jobs.types'\n\n/**\n * What the \"Building your site\" page shows of a site job (AGL-3594): one row\n * a stage — planning the pages, then each page — with its state, the state\n * the whole job is in, and the job's one price.\n *\n * Read off the job summary every surface already follows: the plan step's\n * status, the plan's pages, and the pages the build has reported as outputs.\n * A scaffold builds its units in plan order and reports each page when it is\n * written, so the pages written so far are the first pages of the plan.\n *\n * Pure: no React, no request. The page and its spec read the same rows.\n */\n\nexport type AiSiteBuildRowState = 'done' | 'active' | 'waiting' | 'failed' | 'skipped'\n\nexport interface AiSiteBuildRow {\n id: string\n label: string\n state: AiSiteBuildRowState\n /** What the person should know about this row (AGL-3616): a build item's failure, note or refund. */\n detail?: string | null\n /** What the row is doing while it is the active one, in a sentence. */\n hint?: string | null\n /** A page's planned sections, in order, so the person sees what is being written. */\n sections?: string[]\n /** The credits this row's work used, once it has finished; absent while it runs. */\n credits?: number\n /** When this row's work started, for the elapsed time beside the active row. */\n startedAt?: string | null\n}\n\n/** Where the whole job stands, as the page's header and actions read it. */\nexport type AiSiteBuildPhase = 'working' | 'done' | 'stopped' | 'failed' | 'canceled'\n\nexport function aiSiteBuildPhase(\n job: Pick<AiJobSummary, 'status'> & Partial<Pick<AiJobSummary, 'review' | 'autoConfirm' | 'updatedAt'>>,\n): AiSiteBuildPhase {\n // A guided start's plan parked for the instant its confirmation takes is\n // the build going on (AGL-3596), never a stop.\n if (aiJobConfirmingOwnPlan(job)) return 'working'\n switch (job.status) {\n case 'done':\n return 'done'\n case 'failed':\n return 'failed'\n case 'canceled':\n return 'canceled'\n case 'needs_review':\n case 'needs_input':\n return 'stopped'\n default:\n return 'working'\n }\n}\n\n/** The creations a scaffold builds before its pages, in its build order, and what each row says. */\nconst CREATION_ROWS: ReadonlyArray<{ kind: string; resource: string; label: (name: string) => string }> = [\n { kind: 'theme-change', resource: 'theme', label: () => AI_SITE_LOOK_ROW_LABEL },\n { kind: 'layout', resource: 'layout', label: (name) => `Building the header and footer: ${name}` },\n { kind: 'form', resource: 'form', label: (name) => `Building the form: ${name}` },\n]\n\n/**\n * One row a stage: planning, then each creation the plan builds before its\n * pages — the colors, the layout, the form — then each page (AGL-3596). A\n * scaffold builds them in that order and reports each as an output when it\n * is written, so the first row without its output is where the build is, and\n * where a failure stopped it: a layout that broke is the layout's row, never\n * the first page's.\n */\nexport function aiSiteBuildRows(\n job: Pick<AiJobSummary, 'status' | 'steps' | 'plan' | 'outputs' | 'review'> &\n Partial<Pick<AiJobSummary, 'items' | 'kind' | 'siteInputs' | 'sitePublish'>>,\n): AiSiteBuildRow[] {\n const phase = aiSiteBuildPhase(job)\n // A build is read off its item ledger (AGL-3616): one row an item, each with\n // its own state and what became of its credits.\n if (job.items?.length) {\n const site = job.kind !== 'build'\n const pages = (job.items ?? []).filter((row) => row.op === 'page')\n // The plan keeps the credits it used once the items take over the page.\n const planStep = job.steps.find((step) => step.name === 'plan')\n return [\n {\n id: 'plan',\n label: site ? 'Planning your pages' : 'Planning what to build',\n state: 'done',\n ...(planStep ? { credits: Math.max(0, Math.floor(planStep.creditsSpent ?? 0)) } : {}),\n },\n ...aiBuildItemRows(job).map((row, index) => {\n const ledger = (job.items ?? [])[index]\n // A site keeps the scaffold's own words for each stage (AGL-3596).\n const label =\n !site || !ledger\n ? row.label\n : ledger.op === 'theme'\n ? AI_SITE_LOOK_ROW_LABEL\n : ledger.op === 'layout'\n ? `Building the header and footer: ${ledger.label}`\n : ledger.op === 'form'\n ? `Building the form: ${ledger.label}`\n : ledger.op === 'page'\n ? `Writing page ${pages.indexOf(ledger) + 1} of ${pages.length}: ${ledger.label}`\n : ledger.op === 'email'\n ? 'Writing your welcome email'\n : row.label\n const screen = ledger?.op === 'page' ? aiPlanScreenFor(job.plan, ledger.label, pages.indexOf(ledger)) : null\n const finished = row.state === 'done' || row.state === 'failed'\n const net = ledger ? Math.max(0, Math.floor((ledger.creditsSpent ?? 0) - (ledger.creditsRefunded ?? 0))) : 0\n return {\n id: row.slot,\n label,\n state: row.state,\n // A part that failed while the rest is still being built says the\n // build goes on (AGL-3596): read alone, it looked like the site had.\n detail:\n row.state === 'failed' && phase === 'working'\n ? [row.detail, site ? 'The rest of your site keeps building.' : 'The rest keeps building.'].filter(Boolean).join(' ')\n : row.detail,\n ...(row.state === 'active'\n ? {\n startedAt: row.startedAt ?? null,\n hint:\n ledger?.op === 'page'\n ? AI_SITE_PAGE_HINT\n : site && ledger?.op === 'theme'\n ? AI_SITE_LOOK_HINT\n : AI_SITE_ITEM_HINT,\n }\n : {}),\n ...(screen?.sections.length ? { sections: screen.sections.map((section) => section.name) } : {}),\n ...(finished && ledger ? { credits: net } : {}),\n }\n }),\n ...aiSitePublishRow(job, phase),\n ]\n }\n const planStep = job.steps.find((step) => step.name === 'plan')\n const planDone = planStep?.status === 'done' || Boolean(job.plan)\n const stopped = phase === 'failed' || phase === 'stopped'\n const planState: AiSiteBuildRowState = planDone ? 'done' : stopped ? 'failed' : phase === 'working' ? 'active' : 'waiting'\n const rows: AiSiteBuildRow[] = [\n {\n id: 'plan',\n label: 'Planning your pages',\n state: planState,\n startedAt: planStep?.startedAt ?? null,\n hint: planState === 'active' ? AI_SITE_PLAN_HINT : null,\n ...(planDone && planStep ? { credits: Math.max(0, Math.floor(planStep.creditsSpent ?? 0)) } : {}),\n },\n ]\n // Before there is a plan, the stages a guided start always goes through\n // are named from its answers, so the page shows the whole way from the\n // start rather than one row.\n if (!job.plan && job.kind !== 'build') {\n const pagesAsked = typeof job.siteInputs?.['pages'] === 'number' ? Math.round(job.siteInputs['pages'] as number) : 0\n if (job.siteInputs) {\n // The look is designed first, before the header and footer (AGL-3660).\n rows.push({ id: 'look', label: AI_SITE_LOOK_ROW_LABEL, state: 'waiting' })\n rows.push({ id: 'layout', label: 'Building the header and footer', state: 'waiting' })\n // A guided start that says where its contact form's submissions go\n // plans that form, built after the layout and before the pages (AGL-3596).\n const submissions = job.siteInputs['submissions']\n if (submissions === 'inbox' || submissions === 'lead') {\n rows.push({ id: 'form', label: 'Building your contact form', state: 'waiting' })\n }\n rows.push({\n id: 'pages',\n label: pagesAsked > 1 ? `Writing your ${pagesAsked} pages` : 'Writing your pages',\n state: 'waiting',\n })\n rows.push(...aiSitePublishRow(job, phase))\n }\n return rows\n }\n const built = new Map<string, number>()\n for (const output of job.outputs) built.set(output.resource, (built.get(output.resource) ?? 0) + 1)\n const take = (resource: string): boolean => {\n const left = built.get(resource) ?? 0\n if (left <= 0) return false\n built.set(resource, left - 1)\n return true\n }\n const stages: Array<{ id: string; label: string; resource: string; sections?: string[] }> = []\n for (const row of CREATION_ROWS) {\n const creation = job.plan?.create.find((entry) => entry.kind === row.kind)\n // A job read without its item ledger is one from before the look had a\n // unit of its own (AGL-3660): its look is a stage only where it built one.\n if (creation || (row.resource === 'theme' && job.outputs.some((output) => output.resource === 'theme'))) {\n stages.push({ id: row.resource, label: row.label(creation?.name ?? ''), resource: row.resource })\n }\n }\n const pages = job.plan?.screens ?? []\n pages.forEach((page, index) => {\n stages.push({\n id: `page-${index}`,\n label: `Writing page ${index + 1} of ${pages.length}: ${page.title}`,\n resource: 'screen',\n sections: page.sections.map((section) => section.name),\n })\n })\n let reached = false\n for (const stage of stages) {\n const done = phase === 'done' || take(stage.resource)\n const current = !done && !reached && planDone\n if (current) reached = true\n rows.push({\n id: stage.id,\n label: stage.label,\n state: done ? 'done' : current && stopped ? 'failed' : current && phase === 'working' ? 'active' : 'waiting',\n ...(stage.sections?.length ? { sections: stage.sections } : {}),\n })\n }\n rows.push(...aiSitePublishRow(job, phase))\n return rows\n}\n\n/** The row the site's look is designed on (AGL-3660). */\nexport const AI_SITE_LOOK_ROW_LABEL = 'Designing your look'\n\n/** What the look's row says while it runs. */\nexport const AI_SITE_LOOK_HINT =\n 'Choosing a base theme, colors, fonts and the style of your buttons, cards and forms for your kind of site. This takes a few seconds.'\n\n/** What the planning row says while it runs. */\nexport const AI_SITE_PLAN_HINT =\n 'Reading your answers and choosing your pages, what each one says, and the forms and layout they need. This usually takes under a minute.'\n\n/** What the page being written says while it is the active row (AGL-3596). */\nexport const AI_SITE_PAGE_HINT =\n 'Writing this page’s sections from your plan. It is done once every section is in.'\n\n/** What any other part being built says while it is the active row. */\nexport const AI_SITE_ITEM_HINT = 'Building this now. The next step starts when it is done.'\n\n/** The plan's page an item builds: by its title, else by its place among the pages. */\nfunction aiPlanScreenFor(\n plan: AiJobSummary['plan'],\n title: string,\n index: number,\n): NonNullable<AiJobSummary['plan']>['screens'][number] | null {\n const screens = plan?.screens ?? []\n return screens.find((screen) => screen.title === title) ?? (index >= 0 ? (screens[index] ?? null) : null)\n}\n\n/**\n * A guided start ends by putting its pages live (AGL-3596): the last row, so\n * the person sees that step coming and when it is done. Only a site job\n * publishes on its own; a build publishes when asked, and says so in its plan.\n */\nfunction aiSitePublishRow(\n job: Pick<AiJobSummary, 'status'> & Partial<Pick<AiJobSummary, 'kind' | 'sitePublish'>>,\n phase: AiSiteBuildPhase,\n): AiSiteBuildRow[] {\n if (job.kind !== 'site') return []\n const published = (job.sitePublish?.published.length ?? 0) > 0\n return [\n {\n id: 'publish',\n label: 'Publishing your site',\n // A job that stopped or failed publishes nothing, so the row is passed over.\n state: phase === 'done' ? (published ? 'done' : 'skipped') : phase === 'working' ? 'waiting' : 'skipped',\n },\n ]\n}\n\n/**\n * How far the job is, from 0 to 1, by its rows: a finished row counts whole\n * and the active one half. `null` before there is more than one row to count.\n */\nexport function aiSiteBuildFraction(rows: readonly AiSiteBuildRow[]): number | null {\n if (rows.length < 2) return null\n const counted = rows.reduce(\n (sum, row) => sum + (row.state === 'active' ? 0.5 : row.state === 'waiting' ? 0 : 1),\n 0,\n )\n return Math.min(1, counted / rows.length)\n}\n\n/**\n * The job's one price (AGL-3594), never a plan's on its own: what it has used\n * so far while it works, what it used once done, and, on a failure we gave\n * back, that nothing was charged.\n */\nexport function aiSiteBuildCreditsLine(\n job: Pick<AiJobSummary, 'status' | 'creditsSpent' | 'refundedCredits'> & Partial<Pick<AiJobSummary, 'kind'>>,\n): string | null {\n const spent = Math.max(0, job.creditsSpent ?? 0)\n const refunded = Math.max(0, job.refundedCredits ?? 0)\n const net = Math.max(0, spent - refunded)\n const phase = aiSiteBuildPhase(job)\n // What the job made, by its kind; a job that names none is a site's.\n const subject = !job.kind || job.kind === 'site' ? 'This site' : aiJobKindNoun(job.kind) === 'AI job' ? 'This AI job' : `This ${aiJobKindNoun(job.kind)}`\n // A failure on our side says so in the words every surface uses (AGL-3596),\n // from the job's recorded give-back.\n const refund = phase === 'working' || phase === 'done' ? null : aiJobRefundCopy(job)\n if (refund && refunded > 0) return refund\n if (phase === 'done') return `${subject} used ${net} credits.`\n if (phase === 'working') return `Credits used so far: ${net}`\n if (refund) return `${subject} used ${net} credits. ${refund}`\n return net > 0 ? `${subject} used ${net} credits.` : null\n}\n\n/** The heading and the sentence under it, for one job's page in its current phase. */\nexport interface AiJobPageCopy {\n heading: string\n lede: string\n}\n\n/**\n * What one job's page says at the top (AGL-3594, AGL-3596). A site job reads\n * as \"Building your site\"; any other kind names what it makes — \"Building\n * your page\" — or, for a kind with no noun, the job itself.\n *\n * A guided site start publishes its pages when it finishes, and says so\n * (`sitePublish`): with a page live the heading is \"Your site is live\". A\n * done site job without that record — an older job, or one that was not a\n * guided start — built drafts, and says that instead.\n */\nexport function aiJobPageCopy(\n job: Pick<AiJobSummary, 'kind' | 'status' | 'review' | 'error'> & Partial<Pick<AiJobSummary, 'sitePublish' | 'items'>>,\n brand: string,\n): AiJobPageCopy {\n const phase = aiSiteBuildPhase(job)\n // A build is what the person asked for, item by item (AGL-3616).\n if (job.kind === 'build') return aiBuildPageCopy(job, brand)\n const noun = job.kind === 'site' ? 'site' : aiJobKindNoun(job.kind)\n const generic = noun === 'AI job'\n // `products` is the one plural noun.\n const isAre = noun.endsWith('s') ? 'are' : 'is'\n const why = job.review?.message ?? job.error ?? null\n if (phase === 'working') {\n return {\n heading: generic ? 'Your AI job is running' : `Building your ${noun}`,\n lede:\n job.kind === 'site'\n ? `${brand} AI is planning your pages and writing each one. You can leave this page; it keeps going.`\n : `${brand} AI is working on it. You can leave this page; it keeps going.`,\n }\n }\n if (phase === 'done') {\n const published = job.sitePublish?.published.length ?? 0\n // Part of the site was built (AGL-3616): what was, what was not, and its credits.\n const partial = job.kind === 'site' ? aiSitePartialCopy({ items: job.items, status: job.status }) : null\n if (job.kind === 'site' && published > 0) {\n return {\n heading: 'Your site is live',\n lede: [\n partial,\n job.sitePublish?.drafts.length\n ? 'Your pages are published, except the ones listed below, which stayed drafts.'\n : 'Your pages are published, and anyone can visit your site now.',\n ]\n .filter(Boolean)\n .join(' '),\n }\n }\n if (partial) return { heading: 'Your site is ready', lede: `${partial} Your new pages are drafts. Publish them when you’re happy.` }\n if (job.kind === 'site' && job.sitePublish) {\n return {\n heading: 'Your site is ready',\n lede: 'None of your new pages could be published, so they are drafts. The reasons are below.',\n }\n }\n return {\n heading: generic ? 'Your AI job finished' : `Your ${noun} ${isAre} ready`,\n lede:\n job.kind === 'site'\n ? 'Your new pages are drafts. Publish them when you’re happy.'\n : 'Everything it built is an unpublished draft until you publish it.',\n }\n }\n if (phase === 'canceled') {\n return { heading: generic ? 'Your AI job was canceled' : `Your ${noun} was not built`, lede: 'The job was canceled.' }\n }\n return {\n heading: generic ? 'Your AI job stopped' : `Your ${noun} ${noun.endsWith('s') ? 'were' : 'was'} not built`,\n lede: why ?? (generic ? 'Something went wrong running this job.' : `Something went wrong building your ${noun}.`),\n }\n}\n\n/** A build's page heading and sentence (AGL-3616). */\nfunction aiBuildPageCopy(\n job: Pick<AiJobSummary, 'status' | 'review' | 'error'> & Partial<Pick<AiJobSummary, 'items' | 'sitePublish'>>,\n brand: string,\n): AiJobPageCopy {\n const phase = aiSiteBuildPhase(job)\n const outcome = aiBuildOutcomeLine({ items: job.items ?? [], status: job.status })\n if (phase === 'working') {\n return {\n heading: 'Building what you asked for',\n lede: `${brand} AI is building each part in turn. You can leave this page; it keeps going.`,\n }\n }\n if (phase === 'stopped') {\n return {\n heading: job.review?.reason === 'plan' ? 'Your plan is ready' : 'Your build needs you',\n lede: job.review?.message ?? job.error ?? 'It waits for your decision.',\n }\n }\n if (phase === 'done') {\n const failed = (job.items ?? []).some((row) => row.status === 'failed' || row.status === 'skipped')\n const live = job.sitePublish?.published.length ?? 0\n return {\n heading: failed ? 'Most of it is ready' : 'Everything you asked for is ready',\n lede: [\n outcome,\n live ? 'Your new pages are published.' : 'Everything it built is an unpublished draft until you publish it.',\n failed ? 'Try again builds only what failed.' : '',\n ]\n .filter(Boolean)\n .join(' '),\n }\n }\n if (phase === 'canceled') return { heading: 'Your build was canceled', lede: 'The job was canceled.' }\n return {\n heading: 'Nothing could be built',\n lede: [job.error ?? 'Something went wrong building what you asked for.', outcome].filter(Boolean).join(' '),\n }\n}\n"],"names":["aiJobConfirmingOwnPlan","aiJobKindNoun","aiJobRefundCopy","aiBuildItemRows","aiBuildOutcomeLine","aiSitePartialCopy","aiSiteBuildPhase","job","status","CREATION_ROWS","kind","resource","label","AI_SITE_LOOK_ROW_LABEL","name","aiSiteBuildRows","planStep","built","phase","items","length","site","pages","filter","row","op","steps","find","step","id","state","credits","Math","max","floor","creditsSpent","map","index","ledger","indexOf","screen","aiPlanScreenFor","plan","finished","net","creditsRefunded","slot","detail","Boolean","join","startedAt","hint","AI_SITE_PAGE_HINT","AI_SITE_LOOK_HINT","AI_SITE_ITEM_HINT","sections","section","aiSitePublishRow","planDone","stopped","planState","rows","AI_SITE_PLAN_HINT","pagesAsked","siteInputs","round","push","submissions","Map","output","outputs","set","get","take","left","stages","creation","create","entry","some","screens","forEach","page","title","reached","stage","done","current","published","sitePublish","aiSiteBuildFraction","counted","reduce","sum","min","aiSiteBuildCreditsLine","spent","refunded","refundedCredits","subject","refund","aiJobPageCopy","brand","aiBuildPageCopy","noun","generic","isAre","endsWith","why","review","message","error","heading","lede","partial","drafts","outcome","reason","failed","live"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,sBAAsB,EAAEC,aAAa,QAAQ,uBAAmB;AACzE,SAASC,eAAe,QAAQ,2BAAuB;AACvD,SAASC,eAAe,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,yBAAqB;AAqC5F,OAAO,SAASC,iBACdC,GAAuG;IAEvG,yEAAyE;IACzE,+CAA+C;IAC/C,IAAIP,uBAAuBO,MAAM,OAAO;IACxC,OAAQA,IAAIC,MAAM;QAChB,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,kGAAkG,GAClG,MAAMC,gBAAoG;IACxG;QAAEC,MAAM;QAAgBC,UAAU;QAASC,OAAO,IAAMC;IAAuB;IAC/E;QAAE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