@aglyn/plugins-ai 1.0.0-beta.269 → 1.0.0-beta.271

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 (237) hide show
  1. package/package.json +17 -17
  2. package/src/lib/activity/ai-activity-actions.d.ts +1 -1
  3. package/src/lib/activity/ai-activity-actions.js +1 -0
  4. package/src/lib/activity/ai-activity-actions.js.map +1 -1
  5. package/src/lib/assets/site-styles/beauty.webp +0 -0
  6. package/src/lib/assets/site-styles/blog.webp +0 -0
  7. package/src/lib/assets/site-styles/business.webp +0 -0
  8. package/src/lib/assets/site-styles/coming-soon.webp +0 -0
  9. package/src/lib/assets/site-styles/education.webp +0 -0
  10. package/src/lib/assets/site-styles/events.webp +0 -0
  11. package/src/lib/assets/site-styles/fitness.webp +0 -0
  12. package/src/lib/assets/site-styles/landing.webp +0 -0
  13. package/src/lib/assets/site-styles/music.webp +0 -0
  14. package/src/lib/assets/site-styles/nonprofit.webp +0 -0
  15. package/src/lib/assets/site-styles/personal.webp +0 -0
  16. package/src/lib/assets/site-styles/photography.webp +0 -0
  17. package/src/lib/assets/site-styles/portfolio.webp +0 -0
  18. package/src/lib/assets/site-styles/professional.webp +0 -0
  19. package/src/lib/assets/site-styles/realestate.webp +0 -0
  20. package/src/lib/assets/site-styles/restaurant.webp +0 -0
  21. package/src/lib/assets/site-styles/store.webp +0 -0
  22. package/src/lib/assets/site-styles/studio.webp +0 -0
  23. package/src/lib/assets/site-styles/trades.webp +0 -0
  24. package/src/lib/assets/site-styles/wellness.webp +0 -0
  25. package/src/lib/assets/site-styles/yoga.webp +0 -0
  26. package/src/lib/components/ai-credits-card.component.d.ts +8 -6
  27. package/src/lib/components/ai-credits-card.component.js +39 -22
  28. package/src/lib/components/ai-credits-card.component.js.map +1 -1
  29. package/src/lib/components/ai-job-input-form.component.d.ts +36 -0
  30. package/src/lib/components/ai-job-input-form.component.js +100 -0
  31. package/src/lib/components/ai-job-input-form.component.js.map +1 -0
  32. package/src/lib/components/ai-job-links.d.ts +6 -0
  33. package/src/lib/components/ai-job-links.js +9 -0
  34. package/src/lib/components/ai-job-links.js.map +1 -1
  35. package/src/lib/components/ai-job-requests.d.ts +4 -0
  36. package/src/lib/components/ai-job-requests.js +4 -0
  37. package/src/lib/components/ai-job-requests.js.map +1 -1
  38. package/src/lib/components/ai-products-hub-card.component.d.ts +6 -0
  39. package/src/lib/components/ai-products-hub-card.component.js +21 -6
  40. package/src/lib/components/ai-products-hub-card.component.js.map +1 -1
  41. package/src/lib/components/ai-site-build-page.component.js +3 -2
  42. package/src/lib/components/ai-site-build-page.component.js.map +1 -1
  43. package/src/lib/components/ai-site-start-card.component.d.ts +1 -1
  44. package/src/lib/components/ai-site-start-card.component.js +99 -31
  45. package/src/lib/components/ai-site-start-card.component.js.map +1 -1
  46. package/src/lib/components/ai-site-start-steps.component.d.ts +43 -2
  47. package/src/lib/components/ai-site-start-steps.component.js +651 -15
  48. package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
  49. package/src/lib/components/ai-site-start-tracking.d.ts +10 -0
  50. package/src/lib/components/ai-site-start-tracking.js +14 -0
  51. package/src/lib/components/ai-site-start-tracking.js.map +1 -1
  52. package/src/lib/components/ai-site-style-previews.js +26 -22
  53. package/src/lib/components/ai-site-style-previews.js.map +1 -1
  54. package/src/lib/components/ai-store-finish-card.component.d.ts +14 -3
  55. package/src/lib/components/ai-store-finish-card.component.js +67 -9
  56. package/src/lib/components/ai-store-finish-card.component.js.map +1 -1
  57. package/src/lib/components/ai-upsell-dialog.component.d.ts +7 -5
  58. package/src/lib/components/ai-upsell-dialog.component.js +8 -6
  59. package/src/lib/components/ai-upsell-dialog.component.js.map +1 -1
  60. package/src/lib/components/assist-build-card.component.js +14 -3
  61. package/src/lib/components/assist-build-card.component.js.map +1 -1
  62. package/src/lib/components/assist-jobs-drawer.component.js +9 -1
  63. package/src/lib/components/assist-jobs-drawer.component.js.map +1 -1
  64. package/src/lib/components/assist-panel.component.js +8 -4
  65. package/src/lib/components/assist-panel.component.js.map +1 -1
  66. package/src/lib/components/staff-org-ai-card.component.js +4 -7
  67. package/src/lib/components/staff-org-ai-card.component.js.map +1 -1
  68. package/src/lib/declarations.d.ts +2 -2
  69. package/src/lib/declarations.js +9 -5
  70. package/src/lib/declarations.js.map +1 -1
  71. package/src/lib/jobs/ai-build-capabilities.js +3 -1
  72. package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
  73. package/src/lib/jobs/ai-business-profile-prefill.d.ts +1 -1
  74. package/src/lib/jobs/ai-business-profile-prefill.js +14 -3
  75. package/src/lib/jobs/ai-business-profile-prefill.js.map +1 -1
  76. package/src/lib/jobs/ai-job-build-step.d.ts +3 -0
  77. package/src/lib/jobs/ai-job-build-step.js +13 -5
  78. package/src/lib/jobs/ai-job-build-step.js.map +1 -1
  79. package/src/lib/jobs/ai-job-form-step.d.ts +24 -1
  80. package/src/lib/jobs/ai-job-form-step.js +93 -7
  81. package/src/lib/jobs/ai-job-form-step.js.map +1 -1
  82. package/src/lib/jobs/ai-job-page-language.d.ts +35 -11
  83. package/src/lib/jobs/ai-job-page-language.js +68 -2
  84. package/src/lib/jobs/ai-job-page-language.js.map +1 -1
  85. package/src/lib/jobs/ai-job-page-step.d.ts +17 -0
  86. package/src/lib/jobs/ai-job-page-step.js +40 -17
  87. package/src/lib/jobs/ai-job-page-step.js.map +1 -1
  88. package/src/lib/jobs/ai-job-plan-step.d.ts +25 -2
  89. package/src/lib/jobs/ai-job-plan-step.js +103 -29
  90. package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
  91. package/src/lib/jobs/ai-job-settings-step.js +4 -3
  92. package/src/lib/jobs/ai-job-settings-step.js.map +1 -1
  93. package/src/lib/jobs/ai-job-site-datasets.d.ts +27 -0
  94. package/src/lib/jobs/ai-job-site-datasets.js +140 -14
  95. package/src/lib/jobs/ai-job-site-datasets.js.map +1 -1
  96. package/src/lib/jobs/ai-job-site-look.js +18 -5
  97. package/src/lib/jobs/ai-job-site-look.js.map +1 -1
  98. package/src/lib/jobs/ai-job-site-step.d.ts +16 -1
  99. package/src/lib/jobs/ai-job-site-step.js +95 -22
  100. package/src/lib/jobs/ai-job-site-step.js.map +1 -1
  101. package/src/lib/jobs/ai-job-text-step.d.ts +8 -1
  102. package/src/lib/jobs/ai-job-text-step.js.map +1 -1
  103. package/src/lib/jobs/ai-job-tracking-step.d.ts +14 -3
  104. package/src/lib/jobs/ai-job-tracking-step.js +28 -5
  105. package/src/lib/jobs/ai-job-tracking-step.js.map +1 -1
  106. package/src/lib/jobs/ai-jobs.d.ts +8 -1
  107. package/src/lib/jobs/ai-jobs.js +63 -8
  108. package/src/lib/jobs/ai-jobs.js.map +1 -1
  109. package/src/lib/jobs/ai-layout-owner-photos.d.ts +57 -0
  110. package/src/lib/jobs/ai-layout-owner-photos.js +110 -0
  111. package/src/lib/jobs/ai-layout-owner-photos.js.map +1 -0
  112. package/src/lib/jobs/ai-layout-stock-photos.d.ts +62 -4
  113. package/src/lib/jobs/ai-layout-stock-photos.js +523 -72
  114. package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
  115. package/src/lib/jobs/ai-site-inspiration-signals.d.ts +98 -0
  116. package/src/lib/jobs/ai-site-inspiration-signals.js +585 -0
  117. package/src/lib/jobs/ai-site-inspiration-signals.js.map +1 -0
  118. package/src/lib/jobs/ai-site-inspiration.d.ts +157 -0
  119. package/src/lib/jobs/ai-site-inspiration.js +346 -0
  120. package/src/lib/jobs/ai-site-inspiration.js.map +1 -0
  121. package/src/lib/jobs/ai-site-publish.d.ts +26 -1
  122. package/src/lib/jobs/ai-site-publish.js +162 -13
  123. package/src/lib/jobs/ai-site-publish.js.map +1 -1
  124. package/src/lib/jobs/ai-theme-brand-inputs.d.ts +16 -0
  125. package/src/lib/jobs/ai-theme-brand-inputs.js +18 -4
  126. package/src/lib/jobs/ai-theme-brand-inputs.js.map +1 -1
  127. package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.d.ts +97 -0
  128. package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.js +137 -0
  129. package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.js.map +1 -0
  130. package/src/lib/jobs/fixtures/ai-site-inspiration-pages.d.ts +38 -0
  131. package/src/lib/jobs/fixtures/ai-site-inspiration-pages.js +103 -0
  132. package/src/lib/jobs/fixtures/ai-site-inspiration-pages.js.map +1 -0
  133. package/src/lib/jobs/fixtures/ai-stock-photo-agl3942-recordings.d.ts +29 -0
  134. package/src/lib/jobs/fixtures/ai-stock-photo-agl3942-recordings.js +291 -0
  135. package/src/lib/jobs/fixtures/ai-stock-photo-agl3942-recordings.js.map +1 -0
  136. package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.d.ts +25 -0
  137. package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.js +174 -0
  138. package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.js.map +1 -0
  139. package/src/lib/layout-language/ai-layout-compiler.d.ts +1 -1
  140. package/src/lib/layout-language/ai-layout-compiler.js +438 -25
  141. package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
  142. package/src/lib/layout-language/ai-layout-contact.d.ts +57 -0
  143. package/src/lib/layout-language/ai-layout-contact.js +137 -0
  144. package/src/lib/layout-language/ai-layout-contact.js.map +1 -0
  145. package/src/lib/layout-language/ai-layout-copy.d.ts +12 -0
  146. package/src/lib/layout-language/ai-layout-copy.js +34 -2
  147. package/src/lib/layout-language/ai-layout-copy.js.map +1 -1
  148. package/src/lib/layout-language/ai-layout-design.d.ts +65 -8
  149. package/src/lib/layout-language/ai-layout-design.js +411 -97
  150. package/src/lib/layout-language/ai-layout-design.js.map +1 -1
  151. package/src/lib/layout-language/ai-layout-frame.js +23 -0
  152. package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
  153. package/src/lib/layout-language/ai-layout-labels.d.ts +2 -0
  154. package/src/lib/layout-language/ai-layout-labels.js +12 -6
  155. package/src/lib/layout-language/ai-layout-labels.js.map +1 -1
  156. package/src/lib/layout-language/ai-layout-language.d.ts +3 -2
  157. package/src/lib/layout-language/ai-layout-language.js +4 -3
  158. package/src/lib/layout-language/ai-layout-language.js.map +1 -1
  159. package/src/lib/layout-language/ai-layout-links.d.ts +13 -0
  160. package/src/lib/layout-language/ai-layout-links.js +30 -0
  161. package/src/lib/layout-language/ai-layout-links.js.map +1 -1
  162. package/src/lib/layout-language/ai-layout-pictures.d.ts +49 -6
  163. package/src/lib/layout-language/ai-layout-pictures.js +145 -22
  164. package/src/lib/layout-language/ai-layout-pictures.js.map +1 -1
  165. package/src/lib/model/ai-build-job.d.ts +16 -1
  166. package/src/lib/model/ai-build-job.js +40 -0
  167. package/src/lib/model/ai-build-job.js.map +1 -1
  168. package/src/lib/model/ai-job-input.d.ts +33 -0
  169. package/src/lib/model/ai-job-input.js +59 -0
  170. package/src/lib/model/ai-job-input.js.map +1 -0
  171. package/src/lib/model/ai-job-notice.d.ts +4 -0
  172. package/src/lib/model/ai-job-notice.js +11 -1
  173. package/src/lib/model/ai-job-notice.js.map +1 -1
  174. package/src/lib/model/ai-jobs.types.d.ts +40 -1
  175. package/src/lib/model/ai-jobs.types.js.map +1 -1
  176. package/src/lib/model/ai-site-details.d.ts +122 -0
  177. package/src/lib/model/ai-site-details.js +300 -0
  178. package/src/lib/model/ai-site-details.js.map +1 -0
  179. package/src/lib/model/ai-site-entity.d.ts +181 -0
  180. package/src/lib/model/ai-site-entity.js +390 -0
  181. package/src/lib/model/ai-site-entity.js.map +1 -0
  182. package/src/lib/model/ai-site-inspiration.d.ts +72 -0
  183. package/src/lib/model/ai-site-inspiration.js +109 -0
  184. package/src/lib/model/ai-site-inspiration.js.map +1 -0
  185. package/src/lib/model/ai-site-job.d.ts +13 -1
  186. package/src/lib/model/ai-site-job.js +15 -2
  187. package/src/lib/model/ai-site-job.js.map +1 -1
  188. package/src/lib/model/ai-site-kinds.js +109 -21
  189. package/src/lib/model/ai-site-kinds.js.map +1 -1
  190. package/src/lib/model/ai-site-look.d.ts +10 -0
  191. package/src/lib/model/ai-site-look.js +24 -0
  192. package/src/lib/model/ai-site-look.js.map +1 -1
  193. package/src/lib/model/ai-site-start-seo.d.ts +19 -5
  194. package/src/lib/model/ai-site-start-seo.js +25 -7
  195. package/src/lib/model/ai-site-start-seo.js.map +1 -1
  196. package/src/lib/model/ai-site-start-steps.d.ts +9 -3
  197. package/src/lib/model/ai-site-start-steps.js +67 -5
  198. package/src/lib/model/ai-site-start-steps.js.map +1 -1
  199. package/src/lib/model/ai-site-start.d.ts +68 -4
  200. package/src/lib/model/ai-site-start.js +166 -13
  201. package/src/lib/model/ai-site-start.js.map +1 -1
  202. package/src/lib/model/ai-upsell-copy.js +4 -1
  203. package/src/lib/model/ai-upsell-copy.js.map +1 -1
  204. package/src/lib/native-nav.d.ts +26 -0
  205. package/src/lib/native-nav.js +58 -0
  206. package/src/lib/native-nav.js.map +1 -0
  207. package/src/lib/plan-entitlements.d.ts +4 -3
  208. package/src/lib/plan-entitlements.js +3 -8
  209. package/src/lib/plan-entitlements.js.map +1 -1
  210. package/src/lib/runtime/ai-dataset-generation.d.ts +8 -1
  211. package/src/lib/runtime/ai-dataset-generation.js +12 -2
  212. package/src/lib/runtime/ai-dataset-generation.js.map +1 -1
  213. package/src/lib/runtime/ai-doctrine-validators.d.ts +26 -33
  214. package/src/lib/runtime/ai-doctrine-validators.js +54 -44
  215. package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
  216. package/src/lib/runtime/ai-doctrine.js +1 -1
  217. package/src/lib/runtime/ai-doctrine.js.map +1 -1
  218. package/src/lib/runtime/ai-node-tree.d.ts +7 -0
  219. package/src/lib/runtime/ai-node-tree.js +9 -1
  220. package/src/lib/runtime/ai-node-tree.js.map +1 -1
  221. package/src/lib/server/ai-create-route.d.ts +1 -1
  222. package/src/lib/server/ai-create-route.js +3 -4
  223. package/src/lib/server/ai-create-route.js.map +1 -1
  224. package/src/lib/server/ai-jobs-resume.js +27 -3
  225. package/src/lib/server/ai-jobs-resume.js.map +1 -1
  226. package/src/lib/server/ai-jobs-route.js +7 -0
  227. package/src/lib/server/ai-jobs-route.js.map +1 -1
  228. package/src/lib/usage/assist-credits.d.ts +4 -4
  229. package/src/lib/usage/assist-credits.js +4 -4
  230. package/src/lib/usage/assist-credits.js.map +1 -1
  231. package/src/lib/usage/staff-org-ai-view.js +6 -3
  232. package/src/lib/usage/staff-org-ai-view.js.map +1 -1
  233. package/src/lib/usage/staff-org-ai.d.ts +4 -2
  234. package/src/lib/usage/staff-org-ai.js +7 -7
  235. package/src/lib/usage/staff-org-ai.js.map +1 -1
  236. package/src/lib/usage/staff-org-usage-ai.js +2 -2
  237. package/src/lib/usage/staff-org-usage-ai.js.map +1 -1
@@ -17,6 +17,8 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
17
17
  */ import { aiSiteKindOfInputs } from "../model/ai-site-kinds.js";
18
18
  import { aiSiteHomeArc, aiSiteHomeArcSentence } from "../model/ai-site-home-arcs.js";
19
19
  import { aiSiteSeed } from "../model/ai-site-look.js";
20
+ import { AI_SITE_INSPIRATION_INPUT } from "../model/ai-site-inspiration.js";
21
+ import { aiSiteInspirationHomeOrder, aiSiteInspirationPlanLines, readAiJobSiteInspiration } from "./ai-site-inspiration.js";
20
22
  import { createHash } from "node:crypto";
21
23
  import { AI_BUILD_PLAN_TOOL, aiBuildPlanToolFor, aiPlanSlugKey, isAiPlanNewRef } from "../model/ai-build-plan.js";
22
24
  import { AI_BUILD_PRODUCT_OP, aiBuildStorePagesFor } from "../model/ai-build-store-pages.js";
@@ -45,7 +47,7 @@ import { AI_ROUTING_TABLE, aiModelForStep } from "../providers/routing.js";
45
47
  import { readSiteInventory } from "../runtime/site-inventory.js";
46
48
  import { readAiSiteContext } from "../runtime/site-context.js";
47
49
  import { aiInstructionsWithSiteContext } from "../model/ai-site-context.js";
48
- import { AI_BUILD_CREATE_KINDS, AI_BUILD_STRUCTURAL_OPS, aiBuildPageLimit, aiBuildPlanShapeRefusal } from "../model/ai-build-job.js";
50
+ import { AI_BUILD_CREATE_KINDS, AI_BUILD_NEEDS_INPUT_CODE, AI_BUILD_STRUCTURAL_OPS, aiBuildPageLimit, aiBuildPlanInputFields, aiBuildPlanShapeRefusal } from "../model/ai-build-job.js";
49
51
  import { aiBuildOpLines, aiBuildOps } from "./ai-build-capabilities.js";
50
52
  import { aiBuildUnlistedEventsCheck, aiSettleBuildEventPage } from "../model/ai-build-event-page.js";
51
53
  import { aiSiteEventItemsCheck, aiSiteEventPlanLines, readAiSiteEventPlanning } from "./ai-job-site-events.js";
@@ -119,13 +121,15 @@ import { AI_JOBS_COLLECTION, registerAiJobPlanStep } from "./ai-jobs.js";
119
121
  * inputs and, where the job read them, what it may create on its site
120
122
  * (AGL-3030). Per workspace and per site, which is why they ride here and
121
123
  * never in a system block the platform's cache entry is keyed on.
122
- */ export function aiJobPlanPrompt(job, capabilities = null, inventory = null, ops = null, now = null) {
124
+ */ export function aiJobPlanPrompt(job, capabilities = null, inventory = null, ops = null, now = null, options = {}) {
123
125
  var _job_inputs;
124
126
  const lines = [
125
127
  `Job kind: ${job.kind}`,
126
128
  `Brief: ${job.brief.slice(0, AI_JOB_BRIEF_MAX_CHARS)}`
127
129
  ];
128
130
  for (const [key, value] of Object.entries((_job_inputs = job.inputs) != null ? _job_inputs : {})){
131
+ // The sites a person likes are read by code, never shown (AGL-3975).
132
+ if (key === AI_SITE_INSPIRATION_INPUT) continue;
129
133
  if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
130
134
  lines.push(`${key}: ${String(value)}`);
131
135
  }
@@ -137,7 +141,7 @@ import { AI_JOBS_COLLECTION, registerAiJobPlanStep } from "./ai-jobs.js";
137
141
  lines.push(AI_PLAN_NO_FORM_SENTENCE);
138
142
  }
139
143
  lines.push(...aiPlanTemplateTokenLines(job));
140
- lines.push(...aiPlanSiteLines(job, inventory, capabilities));
144
+ lines.push(...aiPlanSiteLines(job, inventory, capabilities, options));
141
145
  lines.push(...aiPlanBuildLines(job, capabilities, ops, now));
142
146
  return lines.join('\n');
143
147
  }
@@ -177,7 +181,7 @@ import { AI_JOBS_COLLECTION, registerAiJobPlanStep } from "./ai-jobs.js";
177
181
  * (AGL-3497), and a plan that did not know it could replace it planned its own
178
182
  * home there and was refused for the clash on every new site. Kept off a page
179
183
  * job's turn, whose length the Free page's wall is proven at.
180
- */ export function aiPlanSiteLines(job, inventory, capabilities) {
184
+ */ export function aiPlanSiteLines(job, inventory, capabilities, options = {}) {
181
185
  var _ref, _job_inputs, _job_inputs1;
182
186
  var _job_inputs2, _aiSiteKindOfInputs;
183
187
  if (job.kind !== 'site') return [];
@@ -215,8 +219,9 @@ import { AI_JOBS_COLLECTION, registerAiJobPlanStep } from "./ai-jobs.js";
215
219
  const bands = ((_aiSiteKindOfInputs1 = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs1.id) === 'store' ? AI_SITE_STORE_HOME_BANDS : AI_SITE_HOME_BANDS;
216
220
  lines.push(`The home page at / reads as a full website: at least ${home.min} sections — ${bands}.`);
217
221
  // And its own arc, chosen by the job's seed (AGL-3899): two identical
218
- // briefs are two different homes.
219
- const arc = aiSitePlanHomeArc(job);
222
+ // briefs are two different homes. A start whose person named sites they
223
+ // like takes its order from them instead (AGL-3975).
224
+ const arc = options.ownOrder ? null : aiSitePlanHomeArc(job);
220
225
  if (arc) lines.push(aiSiteHomeArcSentence(arc));
221
226
  }
222
227
  // The sections are a budget to use (AGL-3660): a prod start of 2026-10-08
@@ -858,6 +863,17 @@ function planMillis(plan) {
858
863
  })
859
864
  });
860
865
  }
866
+ /**
867
+ * A plan with THIS job's inspiration signals (AGL-3975), or with none: a
868
+ * reused plan's were the other job's, and a plan the model answered holds
869
+ * none of its own. The look unit pins them; the plan was told the structure.
870
+ */ export function aiPlanWithInspiration(plan, inspiration) {
871
+ const rest = _extends({}, plan);
872
+ delete rest.inspiration;
873
+ return inspiration ? _extends({}, rest, {
874
+ inspiration
875
+ }) : rest;
876
+ }
861
877
  export function createAiJobPlanStep(deps = {}) {
862
878
  var _deps_readInventory, _deps_readCapabilities, _deps_admissionRefusal, _deps_readOps;
863
879
  const readInventory = (_deps_readInventory = deps.readInventory) != null ? _deps_readInventory : readSiteInventory;
@@ -868,9 +884,10 @@ export function createAiJobPlanStep(deps = {}) {
868
884
  const readContext = deps.readSiteContext === undefined ? readAiJobSiteContext : deps.readSiteContext;
869
885
  const readFreeCredits = deps.readFreeCredits === undefined ? readFreeAiCreditsLeft : deps.readFreeCredits;
870
886
  const readSiteEvents = deps.readSiteEvents === undefined ? readAiSiteEventPlanning : deps.readSiteEvents;
887
+ const readInspiration = deps.readInspiration === undefined ? readAiJobSiteInspiration : deps.readInspiration;
871
888
  return async ({ job, now, signal, firestore, modelFor, org: orgDocument })=>{
872
- var _AI_JOB_PLAN_SCOPES_job_kind, _ref, _job_inputs, _ref1;
873
- var _aiSiteKindOfInputs, _aiSiteKindOfInputs1;
889
+ var _AI_JOB_PLAN_SCOPES_job_kind, _ref, _ref1, _job_inputs, _job_inputs1, _job_inputs2, _ref2;
890
+ var _aiSiteKindOfInputs, _aiSiteKindOfInputs1, _aiSiteKindOfInputs2, _aiSiteKindOfInputs3;
874
891
  const org = orgDocument != null ? orgDocument : null;
875
892
  // A site start counts each dataset's records (AGL-3912): it reuses only
876
893
  // one whose records are its own to show.
@@ -910,18 +927,36 @@ export function createAiJobPlanStep(deps = {}) {
910
927
  const site = job.kind === 'site';
911
928
  // An event-led start's first events (AGL-3755), only where the build's
912
929
  // gate admits the events plugin's operation here and its writer this member.
913
- const siteEvents = site && readSiteEvents ? await readSiteEvents({
914
- job,
915
- org,
916
- firestore,
917
- now,
918
- readOps: ()=>readOps({
919
- job,
920
- org,
921
- firestore,
922
- freeTaste
923
- })
924
- }) : null;
930
+ // And the sites the person likes, as signals (AGL-3975): read only on a
931
+ // site start that names some, while the release flag is on.
932
+ const [siteEvents, inspiration] = await Promise.all([
933
+ site && readSiteEvents ? readSiteEvents({
934
+ job,
935
+ org,
936
+ firestore,
937
+ now,
938
+ readOps: ()=>readOps({
939
+ job,
940
+ org,
941
+ firestore,
942
+ freeTaste
943
+ })
944
+ }) : Promise.resolve(null),
945
+ site && readInspiration ? readInspiration(_extends({
946
+ job,
947
+ org,
948
+ freeTaste
949
+ }, signal ? {
950
+ signal
951
+ } : {})).catch((error)=>{
952
+ console.warn('ai plan: the sites the person likes could not be read', {
953
+ orgId: job.orgId,
954
+ jobId: job.$id,
955
+ error
956
+ });
957
+ return null;
958
+ }) : Promise.resolve(null)
959
+ ]);
925
960
  const itemOps = (_ref = ops != null ? ops : siteEvents == null ? void 0 : siteEvents.ops) != null ? _ref : null;
926
961
  // A kept plan waits for its confirmation; a Free build's card is told what
927
962
  // is left, so it says before Confirm whether the build fits (AGL-3722).
@@ -953,9 +988,31 @@ export function createAiJobPlanStep(deps = {}) {
953
988
  // provider's fast tier (AGL-3594), unless the creator picked a model.
954
989
  const model = aiSitePlanModel(job, modelFor == null ? void 0 : modelFor('job.plan'), freeTaste);
955
990
  const route = AI_ROUTING_TABLE['job.plan'];
991
+ // What this start can build of what the person's sites offer (AGL-3975):
992
+ // a restaurant is never offered the events list an event-led start
993
+ // drafts, or a store's sign-up; and their first site's order, where it
994
+ // gives one, is the home's in place of the seeded arc.
995
+ const inspirationStart = {
996
+ siteKind: (_ref1 = (_aiSiteKindOfInputs = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs.id) != null ? _ref1 : null,
997
+ posts: aiSiteContentPart((_job_inputs = job.inputs) != null ? _job_inputs : null, freeTaste) === 'posts',
998
+ sells: aiSiteContentPart((_job_inputs1 = job.inputs) != null ? _job_inputs1 : null, freeTaste) === 'products',
999
+ events: Boolean(siteEvents),
1000
+ customerWords: aiPlanHasCustomerWords({
1001
+ brief: job.brief,
1002
+ inventory,
1003
+ siteKind: (_aiSiteKindOfInputs1 = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs1.id
1004
+ })
1005
+ };
1006
+ const ownOrder = Boolean(aiSiteInspirationHomeOrder(inspiration, inspirationStart));
956
1007
  const prompt = [
957
- aiJobPlanPrompt(job, capabilities, inventory, ops, now),
958
- ...siteEvents ? aiSiteEventPlanLines(siteEvents, now) : []
1008
+ aiJobPlanPrompt(job, capabilities, inventory, ops, now, {
1009
+ ownOrder
1010
+ }),
1011
+ ...siteEvents ? aiSiteEventPlanLines(siteEvents, now) : [],
1012
+ ...aiSiteInspirationPlanLines(inspiration, {
1013
+ paid: !freeTaste,
1014
+ start: inspirationStart
1015
+ })
959
1016
  ].join('\n');
960
1017
  /**
961
1018
  * The confirm door's answer for this plan, asked before the plan is kept
@@ -973,6 +1030,12 @@ export function createAiJobPlanStep(deps = {}) {
973
1030
  * 2026-10-09 16:38Z (600 credits estimated, 164 left).
974
1031
  * - the 429 "nothing left" still fails the job with its sentence, but as
975
1032
  * the customer's limit, which raises no staff alert.
1033
+ *
1034
+ * A plan only the person can complete — a tracking change with no pixel
1035
+ * ID (AGL-3978) — is KEPT too, and waits in `needs_input` with a field per
1036
+ * id, its review beside it: nothing about it failed, and the answer
1037
+ * returns it to the plan card. Only an item that names no tag at all,
1038
+ * so has no field to fill, still ends with the question.
976
1039
  */ const refusalOnKeep = async (plan, outcome)=>{
977
1040
  let refusal = null;
978
1041
  try {
@@ -994,6 +1057,17 @@ export function createAiJobPlanStep(deps = {}) {
994
1057
  });
995
1058
  }
996
1059
  if (!refusal || refusal.code === AI_CREDITS_CONFIRM_CODE) return null;
1060
+ const fields = refusal.code === AI_BUILD_NEEDS_INPUT_CODE ? aiBuildPlanInputFields(plan, itemOps) : [];
1061
+ if (fields.length) {
1062
+ return _extends({}, outcome, {
1063
+ plan,
1064
+ review: await planReview(outcome.estCostUsd),
1065
+ input: {
1066
+ message: refusal.error,
1067
+ fields
1068
+ }
1069
+ });
1070
+ }
997
1071
  return _extends({}, outcome, {
998
1072
  failure: refusal.error
999
1073
  }, refusal.status === 429 ? {
@@ -1031,11 +1105,11 @@ export function createAiJobPlanStep(deps = {}) {
1031
1105
  now
1032
1106
  }) : null;
1033
1107
  if (reused) {
1034
- var _ref2;
1108
+ var _ref3;
1035
1109
  // The reused plan's draft ids name the other job's drafts; this job's are its own.
1036
1110
  // Settled again against what the datasets hold now (AGL-3912).
1037
1111
  const kept = site ? aiSettlePlanDatasets(aiSettleSiteForeignDatasets(reused.plan, inventory, capabilities), capabilities) : reused.plan;
1038
- const plan = aiPlanWithStorePages(job.kind, ops, inventory, aiPlanWithItemCredits(itemOps, aiPlanWithDraftIds(job.kind, _extends({}, kept, {
1112
+ const plan = aiPlanWithStorePages(job.kind, ops, inventory, aiPlanWithItemCredits(itemOps, aiPlanWithDraftIds(job.kind, _extends({}, aiPlanWithInspiration(kept, inspiration), {
1039
1113
  status: 'proposed',
1040
1114
  labels: aiPlanLabels(kept, inventory),
1041
1115
  proposedAt: now,
@@ -1045,7 +1119,7 @@ export function createAiJobPlanStep(deps = {}) {
1045
1119
  reusedFrom: reused.jobId
1046
1120
  }))));
1047
1121
  const unspent = aiUnspentOutcome(resolved);
1048
- return (_ref2 = await refusalOnKeep(plan, unspent)) != null ? _ref2 : _extends({}, unspent, {
1122
+ return (_ref3 = await refusalOnKeep(plan, unspent)) != null ? _ref3 : _extends({}, unspent, {
1049
1123
  plan,
1050
1124
  review: await planReview()
1051
1125
  });
@@ -1103,7 +1177,7 @@ export function createAiJobPlanStep(deps = {}) {
1103
1177
  keep: aiSiteFormStaysHome(job, capabilities == null ? void 0 : capabilities.freeSitePages)
1104
1178
  })
1105
1179
  } : {}, {
1106
- extend: aiSiteWithEventItemsCheck(planViolations(scope, job.brief, freeTaste, ops, site ? aiSitePlanHomeRule(inventory, capabilities) : null, site && aiSiteContentPart((_job_inputs = job.inputs) != null ? _job_inputs : null, freeTaste) === 'posts', site, site && ((_aiSiteKindOfInputs = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs.id) === 'store'), site ? siteEvents : undefined, ops)
1180
+ extend: aiSiteWithEventItemsCheck(planViolations(scope, job.brief, freeTaste, ops, site ? aiSitePlanHomeRule(inventory, capabilities) : null, site && aiSiteContentPart((_job_inputs2 = job.inputs) != null ? _job_inputs2 : null, freeTaste) === 'posts', site, site && ((_aiSiteKindOfInputs2 = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs2.id) === 'store'), site ? siteEvents : undefined, ops)
1107
1181
  }));
1108
1182
  const spent = _extends({
1109
1183
  outputs: [],
@@ -1147,11 +1221,11 @@ export function createAiJobPlanStep(deps = {}) {
1147
1221
  });
1148
1222
  }
1149
1223
  // A store's plan is a storefront's (AGL-3676): settled before it is kept and priced.
1150
- const answered = site && ((_aiSiteKindOfInputs1 = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs1.id) === 'store' ? aiSiteStorefrontPlan(result.value, {
1224
+ const answered = site && ((_aiSiteKindOfInputs3 = aiSiteKindOfInputs(job.inputs)) == null ? void 0 : _aiSiteKindOfInputs3.id) === 'store' ? aiSiteStorefrontPlan(result.value, {
1151
1225
  paid: !freeTaste
1152
1226
  }) : result.value;
1153
1227
  // Each draft the plan decides is named as the plan is kept, before anything is built (AGL-3079).
1154
- const plan = aiPlanWithStorePages(job.kind, ops, inventory, aiPlanWithItemCredits(itemOps, aiPlanWithDraftIds(job.kind, _extends({}, answered, {
1228
+ const plan = aiPlanWithStorePages(job.kind, ops, inventory, aiPlanWithItemCredits(itemOps, aiPlanWithDraftIds(job.kind, _extends({}, aiPlanWithInspiration(answered, inspiration), {
1155
1229
  status: 'proposed',
1156
1230
  labels: aiPlanLabels(answered, inventory),
1157
1231
  // A Date the Admin SDK stores as a timestamp, like every instant the machine writes.
@@ -1160,7 +1234,7 @@ export function createAiJobPlanStep(deps = {}) {
1160
1234
  confirmedBy: null,
1161
1235
  key
1162
1236
  }))));
1163
- return (_ref1 = await refusalOnKeep(plan, spent)) != null ? _ref1 : _extends({}, spent, {
1237
+ return (_ref2 = await refusalOnKeep(plan, spent)) != null ? _ref2 : _extends({}, spent, {
1164
1238
  plan,
1165
1239
  review: await planReview(result.estCostUsd)
1166
1240
  });