@aglyn/plugins-ai 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +25 -0
- package/package.json +60 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +22 -0
- package/src/index.js.map +1 -0
- package/src/lib/activity/ai-activity-actions.d.ts +106 -0
- package/src/lib/activity/ai-activity-actions.js +209 -0
- package/src/lib/activity/ai-activity-actions.js.map +1 -0
- package/src/lib/activity/ai-activity.d.ts +219 -0
- package/src/lib/activity/ai-activity.js +251 -0
- package/src/lib/activity/ai-activity.js.map +1 -0
- package/src/lib/billing/ai-overage-charge.d.ts +102 -0
- package/src/lib/billing/ai-overage-charge.js +258 -0
- package/src/lib/billing/ai-overage-charge.js.map +1 -0
- package/src/lib/billing/ai-overage-close.d.ts +62 -0
- package/src/lib/billing/ai-overage-close.js +129 -0
- package/src/lib/billing/ai-overage-close.js.map +1 -0
- package/src/lib/billing/ai-overage-cutover.d.ts +63 -0
- package/src/lib/billing/ai-overage-cutover.js +114 -0
- package/src/lib/billing/ai-overage-cutover.js.map +1 -0
- package/src/lib/billing/ai-overage-events.d.ts +77 -0
- package/src/lib/billing/ai-overage-events.js +174 -0
- package/src/lib/billing/ai-overage-events.js.map +1 -0
- package/src/lib/billing/ai-overage-gate.d.ts +147 -0
- package/src/lib/billing/ai-overage-gate.js +177 -0
- package/src/lib/billing/ai-overage-gate.js.map +1 -0
- package/src/lib/billing/ai-overage-ledger.d.ts +135 -0
- package/src/lib/billing/ai-overage-ledger.js +278 -0
- package/src/lib/billing/ai-overage-ledger.js.map +1 -0
- package/src/lib/billing/ai-overage-standing-writes.d.ts +110 -0
- package/src/lib/billing/ai-overage-standing-writes.js +205 -0
- package/src/lib/billing/ai-overage-standing-writes.js.map +1 -0
- package/src/lib/billing/ai-overage-standing.d.ts +168 -0
- package/src/lib/billing/ai-overage-standing.js +215 -0
- package/src/lib/billing/ai-overage-standing.js.map +1 -0
- package/src/lib/billing/ai-overage-trigger.d.ts +30 -0
- package/src/lib/billing/ai-overage-trigger.js +76 -0
- package/src/lib/billing/ai-overage-trigger.js.map +1 -0
- package/src/lib/components/ai-allotment-editor.component.d.ts +40 -0
- package/src/lib/components/ai-allotment-editor.component.js +213 -0
- package/src/lib/components/ai-allotment-editor.component.js.map +1 -0
- package/src/lib/components/ai-assist-actions-context.d.ts +13 -0
- package/src/lib/components/ai-assist-actions-context.js +21 -0
- package/src/lib/components/ai-assist-actions-context.js.map +1 -0
- package/src/lib/components/ai-assist-provider.component.d.ts +51 -0
- package/src/lib/components/ai-assist-provider.component.js +519 -0
- package/src/lib/components/ai-assist-provider.component.js.map +1 -0
- package/src/lib/components/ai-brief-dialog.component.d.ts +56 -0
- package/src/lib/components/ai-brief-dialog.component.js +319 -0
- package/src/lib/components/ai-brief-dialog.component.js.map +1 -0
- package/src/lib/components/ai-collaborator-permissions-column.component.d.ts +32 -0
- package/src/lib/components/ai-collaborator-permissions-column.component.js +132 -0
- package/src/lib/components/ai-collaborator-permissions-column.component.js.map +1 -0
- package/src/lib/components/ai-credits-card.component.d.ts +34 -0
- package/src/lib/components/ai-credits-card.component.js +131 -0
- package/src/lib/components/ai-credits-card.component.js.map +1 -0
- package/src/lib/components/ai-credits-columns.component.d.ts +56 -0
- package/src/lib/components/ai-credits-columns.component.js +118 -0
- package/src/lib/components/ai-credits-columns.component.js.map +1 -0
- package/src/lib/components/ai-crm-email-draft.component.d.ts +17 -0
- package/src/lib/components/ai-crm-email-draft.component.js +159 -0
- package/src/lib/components/ai-crm-email-draft.component.js.map +1 -0
- package/src/lib/components/ai-crm-import-mapping.component.d.ts +20 -0
- package/src/lib/components/ai-crm-import-mapping.component.js +167 -0
- package/src/lib/components/ai-crm-import-mapping.component.js.map +1 -0
- package/src/lib/components/ai-crm-record-card.component.d.ts +27 -0
- package/src/lib/components/ai-crm-record-card.component.js +263 -0
- package/src/lib/components/ai-crm-record-card.component.js.map +1 -0
- package/src/lib/components/ai-describe-automation.component.d.ts +31 -0
- package/src/lib/components/ai-describe-automation.component.js +226 -0
- package/src/lib/components/ai-describe-automation.component.js.map +1 -0
- package/src/lib/components/ai-describe-button.component.d.ts +39 -0
- package/src/lib/components/ai-describe-button.component.js +87 -0
- package/src/lib/components/ai-describe-button.component.js.map +1 -0
- package/src/lib/components/ai-describe-page.component.d.ts +26 -0
- package/src/lib/components/ai-describe-page.component.js +18 -0
- package/src/lib/components/ai-describe-page.component.js.map +1 -0
- package/src/lib/components/ai-experiment-cards.component.d.ts +75 -0
- package/src/lib/components/ai-experiment-cards.component.js +573 -0
- package/src/lib/components/ai-experiment-cards.component.js.map +1 -0
- package/src/lib/components/ai-explain-automation.component.d.ts +31 -0
- package/src/lib/components/ai-explain-automation.component.js +265 -0
- package/src/lib/components/ai-explain-automation.component.js.map +1 -0
- package/src/lib/components/ai-insight-dialog.component.d.ts +37 -0
- package/src/lib/components/ai-insight-dialog.component.js +441 -0
- package/src/lib/components/ai-insight-dialog.component.js.map +1 -0
- package/src/lib/components/ai-job-plan.component.d.ts +46 -0
- package/src/lib/components/ai-job-plan.component.js +192 -0
- package/src/lib/components/ai-job-plan.component.js.map +1 -0
- package/src/lib/components/ai-model-selector.component.d.ts +21 -0
- package/src/lib/components/ai-model-selector.component.js +109 -0
- package/src/lib/components/ai-model-selector.component.js.map +1 -0
- package/src/lib/components/ai-page-brief-dialog.component.d.ts +29 -0
- package/src/lib/components/ai-page-brief-dialog.component.js +27 -0
- package/src/lib/components/ai-page-brief-dialog.component.js.map +1 -0
- package/src/lib/components/ai-permissions-on-host.component.d.ts +55 -0
- package/src/lib/components/ai-permissions-on-host.component.js +91 -0
- package/src/lib/components/ai-permissions-on-host.component.js.map +1 -0
- package/src/lib/components/ai-product-copy-card.component.d.ts +25 -0
- package/src/lib/components/ai-product-copy-card.component.js +328 -0
- package/src/lib/components/ai-product-copy-card.component.js.map +1 -0
- package/src/lib/components/ai-product-import-option.component.d.ts +14 -0
- package/src/lib/components/ai-product-import-option.component.js +58 -0
- package/src/lib/components/ai-product-import-option.component.js.map +1 -0
- package/src/lib/components/ai-products-hub-card.component.d.ts +15 -0
- package/src/lib/components/ai-products-hub-card.component.js +418 -0
- package/src/lib/components/ai-products-hub-card.component.js.map +1 -0
- package/src/lib/components/ai-products-proposals.component.d.ts +19 -0
- package/src/lib/components/ai-products-proposals.component.js +547 -0
- package/src/lib/components/ai-products-proposals.component.js.map +1 -0
- package/src/lib/components/ai-save-as-component.component.d.ts +38 -0
- package/src/lib/components/ai-save-as-component.component.js +231 -0
- package/src/lib/components/ai-save-as-component.component.js.map +1 -0
- package/src/lib/components/ai-seo-audit-card.component.d.ts +9 -0
- package/src/lib/components/ai-seo-audit-card.component.js +620 -0
- package/src/lib/components/ai-seo-audit-card.component.js.map +1 -0
- package/src/lib/components/ai-seo-fields-card.component.d.ts +10 -0
- package/src/lib/components/ai-seo-fields-card.component.js +453 -0
- package/src/lib/components/ai-seo-fields-card.component.js.map +1 -0
- package/src/lib/components/ai-site-batch-card.component.d.ts +32 -0
- package/src/lib/components/ai-site-batch-card.component.js +531 -0
- package/src/lib/components/ai-site-batch-card.component.js.map +1 -0
- package/src/lib/components/ai-site-seo-start-card.component.d.ts +26 -0
- package/src/lib/components/ai-site-seo-start-card.component.js +178 -0
- package/src/lib/components/ai-site-seo-start-card.component.js.map +1 -0
- package/src/lib/components/ai-site-start-card.component.d.ts +19 -0
- package/src/lib/components/ai-site-start-card.component.js +348 -0
- package/src/lib/components/ai-site-start-card.component.js.map +1 -0
- package/src/lib/components/ai-template-collection-field.component.d.ts +32 -0
- package/src/lib/components/ai-template-collection-field.component.js +63 -0
- package/src/lib/components/ai-template-collection-field.component.js.map +1 -0
- package/src/lib/components/ai-theme-proposal-card.component.d.ts +6 -0
- package/src/lib/components/ai-theme-proposal-card.component.js +619 -0
- package/src/lib/components/ai-theme-proposal-card.component.js.map +1 -0
- package/src/lib/components/ai-usage-strip.component.d.ts +27 -0
- package/src/lib/components/ai-usage-strip.component.js +145 -0
- package/src/lib/components/ai-usage-strip.component.js.map +1 -0
- package/src/lib/components/assist-edit-canvas.d.ts +169 -0
- package/src/lib/components/assist-edit-canvas.js +636 -0
- package/src/lib/components/assist-edit-canvas.js.map +1 -0
- package/src/lib/components/assist-edit-card.component.d.ts +16 -0
- package/src/lib/components/assist-edit-card.component.js +181 -0
- package/src/lib/components/assist-edit-card.component.js.map +1 -0
- package/src/lib/components/assist-jobs-drawer.component.d.ts +72 -0
- package/src/lib/components/assist-jobs-drawer.component.js +626 -0
- package/src/lib/components/assist-jobs-drawer.component.js.map +1 -0
- package/src/lib/components/assist-panel.component.d.ts +136 -0
- package/src/lib/components/assist-panel.component.js +1099 -0
- package/src/lib/components/assist-panel.component.js.map +1 -0
- package/src/lib/components/assist-signals-page.component.d.ts +3 -0
- package/src/lib/components/assist-signals-page.component.js +1017 -0
- package/src/lib/components/assist-signals-page.component.js.map +1 -0
- package/src/lib/components/besigner-ai-controls.component.d.ts +29 -0
- package/src/lib/components/besigner-ai-controls.component.js +81 -0
- package/src/lib/components/besigner-ai-controls.component.js.map +1 -0
- package/src/lib/components/billing-ai-allotments.component.d.ts +36 -0
- package/src/lib/components/billing-ai-allotments.component.js +486 -0
- package/src/lib/components/billing-ai-allotments.component.js.map +1 -0
- package/src/lib/components/billing-ai-top-users.component.d.ts +44 -0
- package/src/lib/components/billing-ai-top-users.component.js +304 -0
- package/src/lib/components/billing-ai-top-users.component.js.map +1 -0
- package/src/lib/components/billing-assist-overage-card.component.d.ts +69 -0
- package/src/lib/components/billing-assist-overage-card.component.js +437 -0
- package/src/lib/components/billing-assist-overage-card.component.js.map +1 -0
- package/src/lib/components/host-ai-allotments.component.d.ts +40 -0
- package/src/lib/components/host-ai-allotments.component.js +239 -0
- package/src/lib/components/host-ai-allotments.component.js.map +1 -0
- package/src/lib/components/member-ai-allotment-card.component.d.ts +28 -0
- package/src/lib/components/member-ai-allotment-card.component.js +172 -0
- package/src/lib/components/member-ai-allotment-card.component.js.map +1 -0
- package/src/lib/components/member-ai-usage-card.component.d.ts +28 -0
- package/src/lib/components/member-ai-usage-card.component.js +240 -0
- package/src/lib/components/member-ai-usage-card.component.js.map +1 -0
- package/src/lib/components/staff-org-ai-card.component.d.ts +17 -0
- package/src/lib/components/staff-org-ai-card.component.js +739 -0
- package/src/lib/components/staff-org-ai-card.component.js.map +1 -0
- package/src/lib/components/staff-org-usage-ai-columns.component.d.ts +41 -0
- package/src/lib/components/staff-org-usage-ai-columns.component.js +65 -0
- package/src/lib/components/staff-org-usage-ai-columns.component.js.map +1 -0
- package/src/lib/components/staff-orgs-ai-spend-column.component.d.ts +28 -0
- package/src/lib/components/staff-orgs-ai-spend-column.component.js +89 -0
- package/src/lib/components/staff-orgs-ai-spend-column.component.js.map +1 -0
- package/src/lib/components/staff-user-ai-usage-card.component.d.ts +27 -0
- package/src/lib/components/staff-user-ai-usage-card.component.js +183 -0
- package/src/lib/components/staff-user-ai-usage-card.component.js.map +1 -0
- package/src/lib/components/use-ai-allotments.d.ts +49 -0
- package/src/lib/components/use-ai-allotments.js +171 -0
- package/src/lib/components/use-ai-allotments.js.map +1 -0
- package/src/lib/components/use-ai-crm-answer.d.ts +50 -0
- package/src/lib/components/use-ai-crm-answer.js +220 -0
- package/src/lib/components/use-ai-crm-answer.js.map +1 -0
- package/src/lib/components/use-ai-job-run.d.ts +51 -0
- package/src/lib/components/use-ai-job-run.js +176 -0
- package/src/lib/components/use-ai-job-run.js.map +1 -0
- package/src/lib/components/use-ai-model-choice.d.ts +47 -0
- package/src/lib/components/use-ai-model-choice.js +150 -0
- package/src/lib/components/use-ai-model-choice.js.map +1 -0
- package/src/lib/components/use-ai-products-jobs.d.ts +36 -0
- package/src/lib/components/use-ai-products-jobs.js +190 -0
- package/src/lib/components/use-ai-products-jobs.js.map +1 -0
- package/src/lib/components/use-ai-usage-meter.d.ts +11 -0
- package/src/lib/components/use-ai-usage-meter.js +96 -0
- package/src/lib/components/use-ai-usage-meter.js.map +1 -0
- package/src/lib/components/use-org-ai-usage.d.ts +42 -0
- package/src/lib/components/use-org-ai-usage.js +181 -0
- package/src/lib/components/use-org-ai-usage.js.map +1 -0
- package/src/lib/components/use-staff-orgs-ai-spend.d.ts +18 -0
- package/src/lib/components/use-staff-orgs-ai-spend.js +127 -0
- package/src/lib/components/use-staff-orgs-ai-spend.js.map +1 -0
- package/src/lib/constants.d.ts +24 -0
- package/src/lib/constants.js +23 -0
- package/src/lib/constants.js.map +1 -0
- package/src/lib/declarations.d.ts +48 -0
- package/src/lib/declarations.js +129 -0
- package/src/lib/declarations.js.map +1 -0
- package/src/lib/declarations.server.d.ts +35 -0
- package/src/lib/declarations.server.js +138 -0
- package/src/lib/declarations.server.js.map +1 -0
- package/src/lib/insights/ai-figure-readers.d.ts +90 -0
- package/src/lib/insights/ai-figure-readers.js +863 -0
- package/src/lib/insights/ai-figure-readers.js.map +1 -0
- package/src/lib/insights/ai-insight-digest.d.ts +165 -0
- package/src/lib/insights/ai-insight-digest.js +363 -0
- package/src/lib/insights/ai-insight-digest.js.map +1 -0
- package/src/lib/insights/ai-insight-readers.d.ts +71 -0
- package/src/lib/insights/ai-insight-readers.js +141 -0
- package/src/lib/insights/ai-insight-readers.js.map +1 -0
- package/src/lib/jobs/ai-crm-access.d.ts +61 -0
- package/src/lib/jobs/ai-crm-access.js +94 -0
- package/src/lib/jobs/ai-crm-access.js.map +1 -0
- package/src/lib/jobs/ai-email-bindings.d.ts +97 -0
- package/src/lib/jobs/ai-email-bindings.js +147 -0
- package/src/lib/jobs/ai-email-bindings.js.map +1 -0
- package/src/lib/jobs/ai-job-admission.d.ts +82 -0
- package/src/lib/jobs/ai-job-admission.js +45 -0
- package/src/lib/jobs/ai-job-admission.js.map +1 -0
- package/src/lib/jobs/ai-job-budget.d.ts +167 -0
- package/src/lib/jobs/ai-job-budget.js +161 -0
- package/src/lib/jobs/ai-job-budget.js.map +1 -0
- package/src/lib/jobs/ai-job-campaign-step.d.ts +108 -0
- package/src/lib/jobs/ai-job-campaign-step.js +340 -0
- package/src/lib/jobs/ai-job-campaign-step.js.map +1 -0
- package/src/lib/jobs/ai-job-component-checks.d.ts +74 -0
- package/src/lib/jobs/ai-job-component-checks.js +442 -0
- package/src/lib/jobs/ai-job-component-checks.js.map +1 -0
- package/src/lib/jobs/ai-job-component-step.d.ts +75 -0
- package/src/lib/jobs/ai-job-component-step.js +262 -0
- package/src/lib/jobs/ai-job-component-step.js.map +1 -0
- package/src/lib/jobs/ai-job-crm-step.d.ts +192 -0
- package/src/lib/jobs/ai-job-crm-step.js +734 -0
- package/src/lib/jobs/ai-job-crm-step.js.map +1 -0
- package/src/lib/jobs/ai-job-draft-ids.d.ts +62 -0
- package/src/lib/jobs/ai-job-draft-ids.js +132 -0
- package/src/lib/jobs/ai-job-draft-ids.js.map +1 -0
- package/src/lib/jobs/ai-job-drafts.d.ts +304 -0
- package/src/lib/jobs/ai-job-drafts.js +557 -0
- package/src/lib/jobs/ai-job-drafts.js.map +1 -0
- package/src/lib/jobs/ai-job-email-step.d.ts +195 -0
- package/src/lib/jobs/ai-job-email-step.js +547 -0
- package/src/lib/jobs/ai-job-email-step.js.map +1 -0
- package/src/lib/jobs/ai-job-experiment-step.d.ts +105 -0
- package/src/lib/jobs/ai-job-experiment-step.js +445 -0
- package/src/lib/jobs/ai-job-experiment-step.js.map +1 -0
- package/src/lib/jobs/ai-job-form-step.d.ts +250 -0
- package/src/lib/jobs/ai-job-form-step.js +634 -0
- package/src/lib/jobs/ai-job-form-step.js.map +1 -0
- package/src/lib/jobs/ai-job-generation.d.ts +114 -0
- package/src/lib/jobs/ai-job-generation.js +384 -0
- package/src/lib/jobs/ai-job-generation.js.map +1 -0
- package/src/lib/jobs/ai-job-insight-budget.d.ts +41 -0
- package/src/lib/jobs/ai-job-insight-budget.js +46 -0
- package/src/lib/jobs/ai-job-insight-budget.js.map +1 -0
- package/src/lib/jobs/ai-job-insight-step.d.ts +58 -0
- package/src/lib/jobs/ai-job-insight-step.js +350 -0
- package/src/lib/jobs/ai-job-insight-step.js.map +1 -0
- package/src/lib/jobs/ai-job-layout-step.d.ts +103 -0
- package/src/lib/jobs/ai-job-layout-step.js +340 -0
- package/src/lib/jobs/ai-job-layout-step.js.map +1 -0
- package/src/lib/jobs/ai-job-page-budget.d.ts +57 -0
- package/src/lib/jobs/ai-job-page-budget.js +60 -0
- package/src/lib/jobs/ai-job-page-budget.js.map +1 -0
- package/src/lib/jobs/ai-job-page-sections.d.ts +150 -0
- package/src/lib/jobs/ai-job-page-sections.js +450 -0
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -0
- package/src/lib/jobs/ai-job-page-step.d.ts +198 -0
- package/src/lib/jobs/ai-job-page-step.js +667 -0
- package/src/lib/jobs/ai-job-page-step.js.map +1 -0
- package/src/lib/jobs/ai-job-plan-conformance.d.ts +107 -0
- package/src/lib/jobs/ai-job-plan-conformance.js +164 -0
- package/src/lib/jobs/ai-job-plan-conformance.js.map +1 -0
- package/src/lib/jobs/ai-job-plan-step.d.ts +196 -0
- package/src/lib/jobs/ai-job-plan-step.js +458 -0
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -0
- package/src/lib/jobs/ai-job-plugin-drafts.d.ts +76 -0
- package/src/lib/jobs/ai-job-plugin-drafts.js +91 -0
- package/src/lib/jobs/ai-job-plugin-drafts.js.map +1 -0
- package/src/lib/jobs/ai-job-products-step.d.ts +106 -0
- package/src/lib/jobs/ai-job-products-step.js +436 -0
- package/src/lib/jobs/ai-job-products-step.js.map +1 -0
- package/src/lib/jobs/ai-job-seo-budget.d.ts +52 -0
- package/src/lib/jobs/ai-job-seo-budget.js +63 -0
- package/src/lib/jobs/ai-job-seo-budget.js.map +1 -0
- package/src/lib/jobs/ai-job-seo-step.d.ts +145 -0
- package/src/lib/jobs/ai-job-seo-step.js +809 -0
- package/src/lib/jobs/ai-job-seo-step.js.map +1 -0
- package/src/lib/jobs/ai-job-site-step.d.ts +252 -0
- package/src/lib/jobs/ai-job-site-step.js +538 -0
- package/src/lib/jobs/ai-job-site-step.js.map +1 -0
- package/src/lib/jobs/ai-job-template-step.d.ts +105 -0
- package/src/lib/jobs/ai-job-template-step.js +391 -0
- package/src/lib/jobs/ai-job-template-step.js.map +1 -0
- package/src/lib/jobs/ai-job-text-step.d.ts +125 -0
- package/src/lib/jobs/ai-job-text-step.js +128 -0
- package/src/lib/jobs/ai-job-text-step.js.map +1 -0
- package/src/lib/jobs/ai-job-theme-budget.d.ts +38 -0
- package/src/lib/jobs/ai-job-theme-budget.js +43 -0
- package/src/lib/jobs/ai-job-theme-budget.js.map +1 -0
- package/src/lib/jobs/ai-job-theme-step.d.ts +115 -0
- package/src/lib/jobs/ai-job-theme-step.js +337 -0
- package/src/lib/jobs/ai-job-theme-step.js.map +1 -0
- package/src/lib/jobs/ai-job-workflow-step.d.ts +139 -0
- package/src/lib/jobs/ai-job-workflow-step.js +530 -0
- package/src/lib/jobs/ai-job-workflow-step.js.map +1 -0
- package/src/lib/jobs/ai-jobs-beat.d.ts +78 -0
- package/src/lib/jobs/ai-jobs-beat.js +93 -0
- package/src/lib/jobs/ai-jobs-beat.js.map +1 -0
- package/src/lib/jobs/ai-jobs-pause.d.ts +38 -0
- package/src/lib/jobs/ai-jobs-pause.js +45 -0
- package/src/lib/jobs/ai-jobs-pause.js.map +1 -0
- package/src/lib/jobs/ai-jobs.d.ts +558 -0
- package/src/lib/jobs/ai-jobs.js +1410 -0
- package/src/lib/jobs/ai-jobs.js.map +1 -0
- package/src/lib/jobs/ai-media-asset-server.d.ts +34 -0
- package/src/lib/jobs/ai-media-asset-server.js +34 -0
- package/src/lib/jobs/ai-media-asset-server.js.map +1 -0
- package/src/lib/jobs/ai-media-asset.d.ts +59 -0
- package/src/lib/jobs/ai-media-asset.js +86 -0
- package/src/lib/jobs/ai-media-asset.js.map +1 -0
- package/src/lib/jobs/ai-product-image.d.ts +78 -0
- package/src/lib/jobs/ai-product-image.js +113 -0
- package/src/lib/jobs/ai-product-image.js.map +1 -0
- package/src/lib/jobs/ai-theme-brand-inputs.d.ts +125 -0
- package/src/lib/jobs/ai-theme-brand-inputs.js +378 -0
- package/src/lib/jobs/ai-theme-brand-inputs.js.map +1 -0
- package/src/lib/jobs/ai-theme-brand-server.d.ts +33 -0
- package/src/lib/jobs/ai-theme-brand-server.js +33 -0
- package/src/lib/jobs/ai-theme-brand-server.js.map +1 -0
- package/src/lib/jobs/ai-workflow-records.d.ts +84 -0
- package/src/lib/jobs/ai-workflow-records.js +158 -0
- package/src/lib/jobs/ai-workflow-records.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-free-page-built-recording.d.ts +31 -0
- package/src/lib/jobs/fixtures/ai-free-page-built-recording.js +367 -0
- package/src/lib/jobs/fixtures/ai-free-page-built-recording.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-free-page-recording.d.ts +69 -0
- package/src/lib/jobs/fixtures/ai-free-page-recording.js +442 -0
- package/src/lib/jobs/fixtures/ai-free-page-recording.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-page-briefs.d.ts +146 -0
- package/src/lib/jobs/fixtures/ai-page-briefs.js +1850 -0
- package/src/lib/jobs/fixtures/ai-page-briefs.js.map +1 -0
- package/src/lib/model/ai-allotments.d.ts +208 -0
- package/src/lib/model/ai-allotments.js +269 -0
- package/src/lib/model/ai-allotments.js.map +1 -0
- package/src/lib/model/ai-automation-draft.d.ts +74 -0
- package/src/lib/model/ai-automation-draft.js +310 -0
- package/src/lib/model/ai-automation-draft.js.map +1 -0
- package/src/lib/model/ai-automation-outline.d.ts +50 -0
- package/src/lib/model/ai-automation-outline.js +262 -0
- package/src/lib/model/ai-automation-outline.js.map +1 -0
- package/src/lib/model/ai-build-plan.d.ts +197 -0
- package/src/lib/model/ai-build-plan.js +438 -0
- package/src/lib/model/ai-build-plan.js.map +1 -0
- package/src/lib/model/ai-crm.d.ts +237 -0
- package/src/lib/model/ai-crm.js +225 -0
- package/src/lib/model/ai-crm.js.map +1 -0
- package/src/lib/model/ai-experiment-proposal.d.ts +68 -0
- package/src/lib/model/ai-experiment-proposal.js +146 -0
- package/src/lib/model/ai-experiment-proposal.js.map +1 -0
- package/src/lib/model/ai-experiment.d.ts +309 -0
- package/src/lib/model/ai-experiment.js +395 -0
- package/src/lib/model/ai-experiment.js.map +1 -0
- package/src/lib/model/ai-insight.d.ts +178 -0
- package/src/lib/model/ai-insight.js +201 -0
- package/src/lib/model/ai-insight.js.map +1 -0
- package/src/lib/model/ai-jobs.types.d.ts +412 -0
- package/src/lib/model/ai-jobs.types.js +42 -0
- package/src/lib/model/ai-jobs.types.js.map +1 -0
- package/src/lib/model/ai-page-job.d.ts +92 -0
- package/src/lib/model/ai-page-job.js +159 -0
- package/src/lib/model/ai-page-job.js.map +1 -0
- package/src/lib/model/ai-permissions.d.ts +49 -0
- package/src/lib/model/ai-permissions.js +97 -0
- package/src/lib/model/ai-permissions.js.map +1 -0
- package/src/lib/model/ai-plan-capabilities.d.ts +139 -0
- package/src/lib/model/ai-plan-capabilities.js +149 -0
- package/src/lib/model/ai-plan-capabilities.js.map +1 -0
- package/src/lib/model/ai-products.d.ts +251 -0
- package/src/lib/model/ai-products.js +253 -0
- package/src/lib/model/ai-products.js.map +1 -0
- package/src/lib/model/ai-seo.d.ts +208 -0
- package/src/lib/model/ai-seo.js +150 -0
- package/src/lib/model/ai-seo.js.map +1 -0
- package/src/lib/model/ai-site-inventory.d.ts +164 -0
- package/src/lib/model/ai-site-inventory.js +145 -0
- package/src/lib/model/ai-site-inventory.js.map +1 -0
- package/src/lib/model/ai-site-job.d.ts +247 -0
- package/src/lib/model/ai-site-job.js +314 -0
- package/src/lib/model/ai-site-job.js.map +1 -0
- package/src/lib/model/ai-site-start-seo.d.ts +103 -0
- package/src/lib/model/ai-site-start-seo.js +154 -0
- package/src/lib/model/ai-site-start-seo.js.map +1 -0
- package/src/lib/model/ai-site-start.d.ts +122 -0
- package/src/lib/model/ai-site-start.js +159 -0
- package/src/lib/model/ai-site-start.js.map +1 -0
- package/src/lib/model/ai-site-switch.d.ts +56 -0
- package/src/lib/model/ai-site-switch.js +73 -0
- package/src/lib/model/ai-site-switch.js.map +1 -0
- package/src/lib/model/ai-storefront-claims.d.ts +70 -0
- package/src/lib/model/ai-storefront-claims.js +130 -0
- package/src/lib/model/ai-storefront-claims.js.map +1 -0
- package/src/lib/model/ai-template-subjects.d.ts +82 -0
- package/src/lib/model/ai-template-subjects.js +136 -0
- package/src/lib/model/ai-template-subjects.js.map +1 -0
- package/src/lib/model/ai-theme-proposal.d.ts +210 -0
- package/src/lib/model/ai-theme-proposal.js +506 -0
- package/src/lib/model/ai-theme-proposal.js.map +1 -0
- package/src/lib/model/ai-tokens.d.ts +96 -0
- package/src/lib/model/ai-tokens.js +117 -0
- package/src/lib/model/ai-tokens.js.map +1 -0
- package/src/lib/model/ai-usage-by-user.d.ts +120 -0
- package/src/lib/model/ai-usage-by-user.js +139 -0
- package/src/lib/model/ai-usage-by-user.js.map +1 -0
- package/src/lib/model/ai-workflow-job.d.ts +111 -0
- package/src/lib/model/ai-workflow-job.js +183 -0
- package/src/lib/model/ai-workflow-job.js.map +1 -0
- package/src/lib/model/assist-edit.d.ts +261 -0
- package/src/lib/model/assist-edit.js +175 -0
- package/src/lib/model/assist-edit.js.map +1 -0
- package/src/lib/plugin-config.d.ts +33 -0
- package/src/lib/plugin-config.js +118 -0
- package/src/lib/plugin-config.js.map +1 -0
- package/src/lib/plugin.d.ts +30 -0
- package/src/lib/plugin.js +525 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/providers/anthropic.d.ts +84 -0
- package/src/lib/providers/anthropic.js +432 -0
- package/src/lib/providers/anthropic.js.map +1 -0
- package/src/lib/providers/catalog.d.ts +197 -0
- package/src/lib/providers/catalog.js +312 -0
- package/src/lib/providers/catalog.js.map +1 -0
- package/src/lib/providers/contract.d.ts +464 -0
- package/src/lib/providers/contract.js +274 -0
- package/src/lib/providers/contract.js.map +1 -0
- package/src/lib/providers/model-choice.d.ts +119 -0
- package/src/lib/providers/model-choice.js +416 -0
- package/src/lib/providers/model-choice.js.map +1 -0
- package/src/lib/providers/openai-compatible.d.ts +58 -0
- package/src/lib/providers/openai-compatible.js +361 -0
- package/src/lib/providers/openai-compatible.js.map +1 -0
- package/src/lib/providers/registry.d.ts +49 -0
- package/src/lib/providers/registry.js +71 -0
- package/src/lib/providers/registry.js.map +1 -0
- package/src/lib/providers/routing.d.ts +98 -0
- package/src/lib/providers/routing.js +450 -0
- package/src/lib/providers/routing.js.map +1 -0
- package/src/lib/runtime/ai-abuse-guards.d.ts +113 -0
- package/src/lib/runtime/ai-abuse-guards.js +148 -0
- package/src/lib/runtime/ai-abuse-guards.js.map +1 -0
- package/src/lib/runtime/ai-component-bindings.d.ts +67 -0
- package/src/lib/runtime/ai-component-bindings.js +106 -0
- package/src/lib/runtime/ai-component-bindings.js.map +1 -0
- package/src/lib/runtime/ai-device-audit.d.ts +109 -0
- package/src/lib/runtime/ai-device-audit.js +97 -0
- package/src/lib/runtime/ai-device-audit.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +720 -0
- package/src/lib/runtime/ai-doctrine-validators.js +3133 -0
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -0
- package/src/lib/runtime/ai-doctrine.d.ts +372 -0
- package/src/lib/runtime/ai-doctrine.js +944 -0
- package/src/lib/runtime/ai-doctrine.js.map +1 -0
- package/src/lib/runtime/ai-eval-live.d.ts +321 -0
- package/src/lib/runtime/ai-eval-live.js +1257 -0
- package/src/lib/runtime/ai-eval-live.js.map +1 -0
- package/src/lib/runtime/ai-eval-memory-firestore.d.ts +51 -0
- package/src/lib/runtime/ai-eval-memory-firestore.js +183 -0
- package/src/lib/runtime/ai-eval-memory-firestore.js.map +1 -0
- package/src/lib/runtime/ai-eval.d.ts +441 -0
- package/src/lib/runtime/ai-eval.js +1151 -0
- package/src/lib/runtime/ai-eval.js.map +1 -0
- package/src/lib/runtime/ai-gate.d.ts +130 -0
- package/src/lib/runtime/ai-gate.js +272 -0
- package/src/lib/runtime/ai-gate.js.map +1 -0
- package/src/lib/runtime/ai-generation-bounds.d.ts +24 -0
- package/src/lib/runtime/ai-generation-bounds.js +23 -0
- package/src/lib/runtime/ai-generation-bounds.js.map +1 -0
- package/src/lib/runtime/ai-insight-check.d.ts +76 -0
- package/src/lib/runtime/ai-insight-check.js +281 -0
- package/src/lib/runtime/ai-insight-check.js.map +1 -0
- package/src/lib/runtime/ai-node-tree.d.ts +181 -0
- package/src/lib/runtime/ai-node-tree.js +931 -0
- package/src/lib/runtime/ai-node-tree.js.map +1 -0
- package/src/lib/runtime/ai-page-links.d.ts +79 -0
- package/src/lib/runtime/ai-page-links.js +135 -0
- package/src/lib/runtime/ai-page-links.js.map +1 -0
- package/src/lib/runtime/ai-palette.d.ts +252 -0
- package/src/lib/runtime/ai-palette.generated.d.ts +34 -0
- package/src/lib/runtime/ai-palette.generated.js +5263 -0
- package/src/lib/runtime/ai-palette.generated.js.map +1 -0
- package/src/lib/runtime/ai-palette.js +187 -0
- package/src/lib/runtime/ai-palette.js.map +1 -0
- package/src/lib/runtime/ai-products-generation.d.ts +107 -0
- package/src/lib/runtime/ai-products-generation.js +250 -0
- package/src/lib/runtime/ai-products-generation.js.map +1 -0
- package/src/lib/runtime/ai-repeated-items.d.ts +95 -0
- package/src/lib/runtime/ai-repeated-items.js +397 -0
- package/src/lib/runtime/ai-repeated-items.js.map +1 -0
- package/src/lib/runtime/ai-runtime.d.ts +148 -0
- package/src/lib/runtime/ai-runtime.js +237 -0
- package/src/lib/runtime/ai-runtime.js.map +1 -0
- package/src/lib/runtime/ai-template-examples.d.ts +71 -0
- package/src/lib/runtime/ai-template-examples.js +135 -0
- package/src/lib/runtime/ai-template-examples.js.map +1 -0
- package/src/lib/runtime/assist-answer-cache.d.ts +80 -0
- package/src/lib/runtime/assist-answer-cache.js +184 -0
- package/src/lib/runtime/assist-answer-cache.js.map +1 -0
- package/src/lib/runtime/seo-audit.d.ts +93 -0
- package/src/lib/runtime/seo-audit.js +260 -0
- package/src/lib/runtime/seo-audit.js.map +1 -0
- package/src/lib/runtime/seo-content-fixes.d.ts +41 -0
- package/src/lib/runtime/seo-content-fixes.js +168 -0
- package/src/lib/runtime/seo-content-fixes.js.map +1 -0
- package/src/lib/runtime/seo-fields.d.ts +152 -0
- package/src/lib/runtime/seo-fields.js +215 -0
- package/src/lib/runtime/seo-fields.js.map +1 -0
- package/src/lib/runtime/seo-page-facts.d.ts +61 -0
- package/src/lib/runtime/seo-page-facts.js +150 -0
- package/src/lib/runtime/seo-page-facts.js.map +1 -0
- package/src/lib/runtime/site-inventory.d.ts +63 -0
- package/src/lib/runtime/site-inventory.js +230 -0
- package/src/lib/runtime/site-inventory.js.map +1 -0
- package/src/lib/server/ai-admin-org.d.ts +33 -0
- package/src/lib/server/ai-admin-org.js +381 -0
- package/src/lib/server/ai-admin-org.js.map +1 -0
- package/src/lib/server/ai-admin-orgs-spend.d.ts +40 -0
- package/src/lib/server/ai-admin-orgs-spend.js +129 -0
- package/src/lib/server/ai-admin-orgs-spend.js.map +1 -0
- package/src/lib/server/ai-admin-overage.d.ts +19 -0
- package/src/lib/server/ai-admin-overage.js +246 -0
- package/src/lib/server/ai-admin-overage.js.map +1 -0
- package/src/lib/server/ai-admin-signals.d.ts +34 -0
- package/src/lib/server/ai-admin-signals.js +330 -0
- package/src/lib/server/ai-admin-signals.js.map +1 -0
- package/src/lib/server/ai-admin-user.d.ts +27 -0
- package/src/lib/server/ai-admin-user.js +128 -0
- package/src/lib/server/ai-admin-user.js.map +1 -0
- package/src/lib/server/ai-allotments.d.ts +27 -0
- package/src/lib/server/ai-allotments.js +544 -0
- package/src/lib/server/ai-allotments.js.map +1 -0
- package/src/lib/server/ai-assist-prompts.d.ts +102 -0
- package/src/lib/server/ai-assist-prompts.js +207 -0
- package/src/lib/server/ai-assist-prompts.js.map +1 -0
- package/src/lib/server/ai-assist.d.ts +119 -0
- package/src/lib/server/ai-assist.js +517 -0
- package/src/lib/server/ai-assist.js.map +1 -0
- package/src/lib/server/ai-crm-answer.d.ts +30 -0
- package/src/lib/server/ai-crm-answer.js +98 -0
- package/src/lib/server/ai-crm-answer.js.map +1 -0
- package/src/lib/server/ai-generate-component.d.ts +111 -0
- package/src/lib/server/ai-generate-component.js +643 -0
- package/src/lib/server/ai-generate-component.js.map +1 -0
- package/src/lib/server/ai-host-permissions.d.ts +46 -0
- package/src/lib/server/ai-host-permissions.js +204 -0
- package/src/lib/server/ai-host-permissions.js.map +1 -0
- package/src/lib/server/ai-insight-answer.d.ts +30 -0
- package/src/lib/server/ai-insight-answer.js +83 -0
- package/src/lib/server/ai-insight-answer.js.map +1 -0
- package/src/lib/server/ai-insight-digest-route.d.ts +30 -0
- package/src/lib/server/ai-insight-digest-route.js +156 -0
- package/src/lib/server/ai-insight-digest-route.js.map +1 -0
- package/src/lib/server/ai-jobs-batch.d.ts +48 -0
- package/src/lib/server/ai-jobs-batch.js +306 -0
- package/src/lib/server/ai-jobs-batch.js.map +1 -0
- package/src/lib/server/ai-jobs-beat-route.d.ts +36 -0
- package/src/lib/server/ai-jobs-beat-route.js +86 -0
- package/src/lib/server/ai-jobs-beat-route.js.map +1 -0
- package/src/lib/server/ai-jobs-cancel.d.ts +30 -0
- package/src/lib/server/ai-jobs-cancel.js +74 -0
- package/src/lib/server/ai-jobs-cancel.js.map +1 -0
- package/src/lib/server/ai-jobs-events-route.d.ts +31 -0
- package/src/lib/server/ai-jobs-events-route.js +51 -0
- package/src/lib/server/ai-jobs-events-route.js.map +1 -0
- package/src/lib/server/ai-jobs-events.d.ts +55 -0
- package/src/lib/server/ai-jobs-events.js +144 -0
- package/src/lib/server/ai-jobs-events.js.map +1 -0
- package/src/lib/server/ai-jobs-gate.d.ts +47 -0
- package/src/lib/server/ai-jobs-gate.js +106 -0
- package/src/lib/server/ai-jobs-gate.js.map +1 -0
- package/src/lib/server/ai-jobs-resume.d.ts +23 -0
- package/src/lib/server/ai-jobs-resume.js +209 -0
- package/src/lib/server/ai-jobs-resume.js.map +1 -0
- package/src/lib/server/ai-jobs-route.d.ts +32 -0
- package/src/lib/server/ai-jobs-route.js +307 -0
- package/src/lib/server/ai-jobs-route.js.map +1 -0
- package/src/lib/server/ai-models.d.ts +18 -0
- package/src/lib/server/ai-models.js +134 -0
- package/src/lib/server/ai-models.js.map +1 -0
- package/src/lib/server/ai-seo-apply.d.ts +53 -0
- package/src/lib/server/ai-seo-apply.js +294 -0
- package/src/lib/server/ai-seo-apply.js.map +1 -0
- package/src/lib/server/ai-usage.d.ts +18 -0
- package/src/lib/server/ai-usage.js +220 -0
- package/src/lib/server/ai-usage.js.map +1 -0
- package/src/lib/server/assist-chat.d.ts +234 -0
- package/src/lib/server/assist-chat.js +1446 -0
- package/src/lib/server/assist-chat.js.map +1 -0
- package/src/lib/server/assist-edit-applied.d.ts +22 -0
- package/src/lib/server/assist-edit-applied.js +239 -0
- package/src/lib/server/assist-edit-applied.js.map +1 -0
- package/src/lib/server/assist-edit.d.ts +124 -0
- package/src/lib/server/assist-edit.js +1000 -0
- package/src/lib/server/assist-edit.js.map +1 -0
- package/src/lib/server/assist-feedback.d.ts +31 -0
- package/src/lib/server/assist-feedback.js +115 -0
- package/src/lib/server/assist-feedback.js.map +1 -0
- package/src/lib/server/assist-view-context.d.ts +343 -0
- package/src/lib/server/assist-view-context.js +690 -0
- package/src/lib/server/assist-view-context.js.map +1 -0
- package/src/lib/server/billing-credits.d.ts +59 -0
- package/src/lib/server/billing-credits.js +146 -0
- package/src/lib/server/billing-credits.js.map +1 -0
- package/src/lib/server/billing-overage.d.ts +19 -0
- package/src/lib/server/billing-overage.js +337 -0
- package/src/lib/server/billing-overage.js.map +1 -0
- package/src/lib/server.d.ts +32 -0
- package/src/lib/server.js +265 -0
- package/src/lib/server.js.map +1 -0
- package/src/lib/subprocessors.d.ts +18 -0
- package/src/lib/subprocessors.js +52 -0
- package/src/lib/subprocessors.js.map +1 -0
- package/src/lib/tools/ai-component-tool.d.ts +99 -0
- package/src/lib/tools/ai-component-tool.js +369 -0
- package/src/lib/tools/ai-component-tool.js.map +1 -0
- package/src/lib/tools/ai-crm-tool.d.ts +106 -0
- package/src/lib/tools/ai-crm-tool.js +488 -0
- package/src/lib/tools/ai-crm-tool.js.map +1 -0
- package/src/lib/tools/ai-duplicate-resource-tool.d.ts +71 -0
- package/src/lib/tools/ai-duplicate-resource-tool.js +164 -0
- package/src/lib/tools/ai-duplicate-resource-tool.js.map +1 -0
- package/src/lib/tools/ai-experiment-tool.d.ts +40 -0
- package/src/lib/tools/ai-experiment-tool.js +155 -0
- package/src/lib/tools/ai-experiment-tool.js.map +1 -0
- package/src/lib/tools/ai-insight-tool.d.ts +46 -0
- package/src/lib/tools/ai-insight-tool.js +200 -0
- package/src/lib/tools/ai-insight-tool.js.map +1 -0
- package/src/lib/tools/ai-inventory-lookup-tool.d.ts +86 -0
- package/src/lib/tools/ai-inventory-lookup-tool.js +164 -0
- package/src/lib/tools/ai-inventory-lookup-tool.js.map +1 -0
- package/src/lib/tools/ai-products-tool.d.ts +65 -0
- package/src/lib/tools/ai-products-tool.js +644 -0
- package/src/lib/tools/ai-products-tool.js.map +1 -0
- package/src/lib/tools/ai-seo-tool.d.ts +162 -0
- package/src/lib/tools/ai-seo-tool.js +546 -0
- package/src/lib/tools/ai-seo-tool.js.map +1 -0
- package/src/lib/tools/ai-theme-tool.d.ts +101 -0
- package/src/lib/tools/ai-theme-tool.js +562 -0
- package/src/lib/tools/ai-theme-tool.js.map +1 -0
- package/src/lib/tools/ai-workflow-tool.d.ts +166 -0
- package/src/lib/tools/ai-workflow-tool.js +860 -0
- package/src/lib/tools/ai-workflow-tool.js.map +1 -0
- package/src/lib/usage/ai-allotment-alerts.d.ts +72 -0
- package/src/lib/usage/ai-allotment-alerts.js +157 -0
- package/src/lib/usage/ai-allotment-alerts.js.map +1 -0
- package/src/lib/usage/ai-allotments.d.ts +125 -0
- package/src/lib/usage/ai-allotments.js +239 -0
- package/src/lib/usage/ai-allotments.js.map +1 -0
- package/src/lib/usage/ai-model-sample.d.ts +36 -0
- package/src/lib/usage/ai-model-sample.js +68 -0
- package/src/lib/usage/ai-model-sample.js.map +1 -0
- package/src/lib/usage/ai-usage-alerts.d.ts +55 -0
- package/src/lib/usage/ai-usage-alerts.js +114 -0
- package/src/lib/usage/ai-usage-alerts.js.map +1 -0
- package/src/lib/usage/ai-usage-by-user.d.ts +161 -0
- package/src/lib/usage/ai-usage-by-user.js +211 -0
- package/src/lib/usage/ai-usage-by-user.js.map +1 -0
- package/src/lib/usage/ai-usage-eraser.d.ts +29 -0
- package/src/lib/usage/ai-usage-eraser.js +40 -0
- package/src/lib/usage/ai-usage-eraser.js.map +1 -0
- package/src/lib/usage/ai-usage-meter.d.ts +39 -0
- package/src/lib/usage/ai-usage-meter.js +85 -0
- package/src/lib/usage/ai-usage-meter.js.map +1 -0
- package/src/lib/usage/ai-usage-wire.d.ts +184 -0
- package/src/lib/usage/ai-usage-wire.js +98 -0
- package/src/lib/usage/ai-usage-wire.js.map +1 -0
- package/src/lib/usage/assist-ceiling.d.ts +87 -0
- package/src/lib/usage/assist-ceiling.js +110 -0
- package/src/lib/usage/assist-ceiling.js.map +1 -0
- package/src/lib/usage/assist-free-taste.d.ts +225 -0
- package/src/lib/usage/assist-free-taste.js +308 -0
- package/src/lib/usage/assist-free-taste.js.map +1 -0
- package/src/lib/usage/assist-refusals.d.ts +69 -0
- package/src/lib/usage/assist-refusals.js +79 -0
- package/src/lib/usage/assist-refusals.js.map +1 -0
- package/src/lib/usage/assist-signal-mining.d.ts +375 -0
- package/src/lib/usage/assist-signal-mining.js +344 -0
- package/src/lib/usage/assist-signal-mining.js.map +1 -0
- package/src/lib/usage/assist-usage.d.ts +571 -0
- package/src/lib/usage/assist-usage.js +978 -0
- package/src/lib/usage/assist-usage.js.map +1 -0
- package/src/lib/usage/staff-org-ai.d.ts +242 -0
- package/src/lib/usage/staff-org-ai.js +173 -0
- package/src/lib/usage/staff-org-ai.js.map +1 -0
- package/src/lib/usage/staff-org-usage-ai.d.ts +83 -0
- package/src/lib/usage/staff-org-usage-ai.js +59 -0
- package/src/lib/usage/staff-org-usage-ai.js.map +1 -0
- package/src/lib/usage/staff-orgs-ai-spend.d.ts +83 -0
- package/src/lib/usage/staff-orgs-ai-spend.js +114 -0
- package/src/lib/usage/staff-orgs-ai-spend.js.map +1 -0
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
*/ export const AI_SURFACE_NAMES = [
|
|
17
|
+
'screen',
|
|
18
|
+
'email',
|
|
19
|
+
'form',
|
|
20
|
+
'layout',
|
|
21
|
+
'component'
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* The capability props a node with this child contract may carry, merged into
|
|
25
|
+
* one map the prop sanitizer can read beside the element's own declarations.
|
|
26
|
+
*/ export function nodeCapabilityProps(capabilities, acceptsChildren) {
|
|
27
|
+
const properties = {};
|
|
28
|
+
const propRoles = {};
|
|
29
|
+
const textLimits = {};
|
|
30
|
+
for (const capability of Object.values(capabilities)){
|
|
31
|
+
for (const [name, schema] of Object.entries(capability.propsSchema.properties)){
|
|
32
|
+
if (!acceptsChildren && capability.childrenOnlyProps.includes(name)) continue;
|
|
33
|
+
properties[name] = schema;
|
|
34
|
+
const role = capability.propRoles[name];
|
|
35
|
+
if (role) propRoles[name] = role;
|
|
36
|
+
const limit = capability.textLimits[name];
|
|
37
|
+
if (limit !== undefined) textLimits[name] = limit;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
properties,
|
|
42
|
+
propRoles,
|
|
43
|
+
textLimits
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* What a node capability declared in core and one carried by the palette
|
|
48
|
+
* disagree about (AGL-3156).
|
|
49
|
+
*
|
|
50
|
+
* `check:ai-palette` pins the generated file to the generator's output for its
|
|
51
|
+
* inputs, which cannot notice a capability leaving those inputs: when repeat
|
|
52
|
+
* stopped being a component's attribute, the generator regenerated cleanly and
|
|
53
|
+
* the palette simply stopped mentioning it. This reads the core declarations
|
|
54
|
+
* instead and asks whether the palette still accounts for each one, so the
|
|
55
|
+
* next generic capability cannot vanish the same way.
|
|
56
|
+
*
|
|
57
|
+
* `offeredFieldKinds` is every field kind the palette DOES carry somewhere,
|
|
58
|
+
* derived from the generated entries rather than restated here: a capability
|
|
59
|
+
* attribute drawn with one of those kinds has no excuse for being omitted.
|
|
60
|
+
*/ export function auditNodeCapabilities(declared, carried, offeredFieldKinds) {
|
|
61
|
+
const problems = [];
|
|
62
|
+
for (const capability of declared){
|
|
63
|
+
const entry = carried[capability.id];
|
|
64
|
+
if (!entry) {
|
|
65
|
+
problems.push(`the palette carries no node capability "${capability.id}": a model cannot use it at all`);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (!Object.keys(entry.propsSchema.properties).length) {
|
|
69
|
+
problems.push(`node capability "${capability.id}" is carried with no prop a model can write`);
|
|
70
|
+
}
|
|
71
|
+
for (const attribute of capability.attributes){
|
|
72
|
+
if (entry.propsSchema.properties[attribute.name]) continue;
|
|
73
|
+
if (!entry.omittedProps.includes(attribute.name)) {
|
|
74
|
+
problems.push(`node capability "${capability.id}" declares "${attribute.name}", which the palette neither offers nor records as omitted`);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (offeredFieldKinds.has(attribute.component)) {
|
|
78
|
+
problems.push(`node capability "${capability.id}" omits "${attribute.name}", whose "${attribute.component}" field the palette offers elsewhere`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const id of Object.keys(carried)){
|
|
83
|
+
if (!declared.some((capability)=>capability.id === id)) {
|
|
84
|
+
problems.push(`the palette carries node capability "${id}", which core no longer declares`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return problems;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Text ceilings per role of copy (AGL-2905). A headline is one line of a
|
|
91
|
+
* hero, body copy is a paragraph or two, and a button label has to fit a
|
|
92
|
+
* button.
|
|
93
|
+
*/ export const AI_TEXT_LIMITS = {
|
|
94
|
+
headline: 120,
|
|
95
|
+
body: 2000,
|
|
96
|
+
button: 40,
|
|
97
|
+
/** A short label, title or caption. */ label: 200
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Prompt budget per surface catalog, in characters at four per token.
|
|
101
|
+
* Asserted by a spec so a component that grows its description cannot
|
|
102
|
+
* silently push a system prompt past what the route pays for.
|
|
103
|
+
*/ export const AI_PALETTE_CATALOG_MAX_TOKENS = 2500;
|
|
104
|
+
export const AI_PALETTE_CATALOG_MAX_CHARS = AI_PALETTE_CATALOG_MAX_TOKENS * 4;
|
|
105
|
+
/** The model's own token estimate: characters over four. */ export function estimateCatalogTokens(catalog) {
|
|
106
|
+
return Math.ceil(catalog.length / 4);
|
|
107
|
+
}
|
|
108
|
+
export const AI_OUTPUT_KINDS = [
|
|
109
|
+
'page',
|
|
110
|
+
'template',
|
|
111
|
+
'component',
|
|
112
|
+
'layout',
|
|
113
|
+
'form',
|
|
114
|
+
'email'
|
|
115
|
+
];
|
|
116
|
+
/** The surface each output kind is composed on. */ export const AI_OUTPUT_SURFACE = {
|
|
117
|
+
page: 'screen',
|
|
118
|
+
template: 'screen',
|
|
119
|
+
component: 'component',
|
|
120
|
+
layout: 'layout',
|
|
121
|
+
form: 'form',
|
|
122
|
+
email: 'email'
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* The size past which Gmail clips a message and hides the rest behind a
|
|
126
|
+
* "View entire message" link — the unsubscribe footer included.
|
|
127
|
+
*/ export const AI_EMAIL_CLIP_BYTES = 102000;
|
|
128
|
+
/**
|
|
129
|
+
* The budget per output kind (AGL-2935, rule 17), beside the catalog budget
|
|
130
|
+
* above for the same reason: a generator that grows its output past what
|
|
131
|
+
* its kind is for is caught by a number, not noticed by a reader.
|
|
132
|
+
*
|
|
133
|
+
* A page is a few hundred elements and tens of kilobytes of stored map; a
|
|
134
|
+
* reusable component is one repeated block; a layout is the chrome every
|
|
135
|
+
* page loads, so it carries the least imagery; a form is fields and a
|
|
136
|
+
* button; an email is held to the clipping threshold on its rendered HTML.
|
|
137
|
+
* No kind names a font beyond the theme's.
|
|
138
|
+
*/ export const AI_OUTPUT_BUDGETS = {
|
|
139
|
+
page: {
|
|
140
|
+
nodes: 400,
|
|
141
|
+
bytes: 60000,
|
|
142
|
+
imageBytes: 1500000,
|
|
143
|
+
embeds: 1,
|
|
144
|
+
fontFamilies: 0
|
|
145
|
+
},
|
|
146
|
+
template: {
|
|
147
|
+
nodes: 400,
|
|
148
|
+
bytes: 60000,
|
|
149
|
+
imageBytes: 1500000,
|
|
150
|
+
embeds: 1,
|
|
151
|
+
fontFamilies: 0
|
|
152
|
+
},
|
|
153
|
+
component: {
|
|
154
|
+
nodes: 80,
|
|
155
|
+
bytes: 12000,
|
|
156
|
+
imageBytes: 500000,
|
|
157
|
+
embeds: 1,
|
|
158
|
+
fontFamilies: 0
|
|
159
|
+
},
|
|
160
|
+
layout: {
|
|
161
|
+
nodes: 160,
|
|
162
|
+
bytes: 24000,
|
|
163
|
+
imageBytes: 200000,
|
|
164
|
+
embeds: 0,
|
|
165
|
+
fontFamilies: 0
|
|
166
|
+
},
|
|
167
|
+
form: {
|
|
168
|
+
nodes: 60,
|
|
169
|
+
bytes: 8000,
|
|
170
|
+
imageBytes: 0,
|
|
171
|
+
embeds: 0,
|
|
172
|
+
fontFamilies: 0
|
|
173
|
+
},
|
|
174
|
+
email: {
|
|
175
|
+
nodes: 150,
|
|
176
|
+
bytes: 24000,
|
|
177
|
+
imageBytes: 1000000,
|
|
178
|
+
embeds: 0,
|
|
179
|
+
fontFamilies: 0,
|
|
180
|
+
emailHtmlBytes: AI_EMAIL_CLIP_BYTES
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/** Typography variants that read as headlines, for the `children` ceiling. */ export function isHeadlineVariant(variant) {
|
|
184
|
+
return typeof variant === 'string' && /^(display\w*|h[1-6]|heading)$/.test(variant);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//# sourceMappingURL=ai-palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/runtime/ai-palette.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 type { JsonLinealOrder } from '@aglyn/aglyn/app-utils/lineal-order'\n\n/**\n * The element palette as a model sees it (AGL-2905).\n *\n * `ai-palette.generated.ts` is produced from the registered plugin bundles by\n * `tools/scripts/generate-ai-palette.mts` and holds the data; this module\n * holds the shapes that data is typed against and the small readers over it,\n * so a regeneration never rewrites a type.\n */\n\n/** The document kinds a model is asked to compose. */\nexport type AiSurface = 'screen' | 'email' | 'form' | 'layout' | 'component'\n\nexport const AI_SURFACE_NAMES: readonly AiSurface[] = [\n 'screen',\n 'email',\n 'form',\n 'layout',\n 'component',\n]\n\n/**\n * The subset of JSON Schema a prop declaration is expressed in. Enough to\n * validate what an attribute field can persist; nothing the field editor\n * cannot itself model.\n */\nexport interface AiPropSchema {\n type?: 'string' | 'number' | 'integer' | 'boolean'\n enum?: readonly string[]\n minLength?: number\n maxLength?: number\n minimum?: number\n maximum?: number\n pattern?: string\n description?: string\n}\n\nexport interface AiPropsSchema {\n type: 'object'\n properties: Record<string, AiPropSchema>\n required: readonly string[]\n additionalProperties: false\n}\n\n/**\n * What a string prop MEANS, which decides how the validator checks it.\n *\n * - `text` — copy the visitor reads; held to a length ceiling.\n * - `url` — a navigable address: an `https:` URL or a root-relative path.\n * - `screen` — a screen id, checked against the screens the host has.\n * - `media` — an image or video source: a DAM reference or an `https:` URL.\n */\nexport type AiPropRole = 'text' | 'url' | 'screen' | 'media'\n\n/**\n * A `restrictChildren` / `restrictParent` directive as generated data: the\n * same tuple the schema declares, with the flag spelled as the string the\n * enum holds so a JSON emitter can write it.\n */\nexport type AiLinealOrder = JsonLinealOrder\n\nexport interface AiPaletteEntry {\n pluginId: string\n kind: 'element' | 'plaintext' | 'markdown'\n category: string\n displayName: string\n /** One sentence, from the schema's own description. */\n summary: string\n /** Whether the editor lets anything be dropped inside this element. */\n acceptsChildren: boolean\n restrictChildren?: AiLinealOrder\n restrictParent?: AiLinealOrder\n propsSchema: AiPropsSchema\n /** Roles of the string props the validator treats specially. */\n propRoles: Record<string, AiPropRole>\n /**\n * The attribute field kind each declared prop is edited with, as its\n * `FieldComponentType` value (`switch`, `select`, `screen-select`, …): what\n * the editor reads to decide which component properties a field can be\n * bound to (AGL-2908).\n */\n propFields: Record<string, string>\n /** Length ceilings for `text` props, in characters. */\n textLimits: Record<string, number>\n /** Names of the presets that place this component. */\n presets: readonly string[]\n}\n\n/**\n * What every NODE can do, as against what one component declares (AGL-3156).\n *\n * Generated from the node capabilities core declares, beside the per-component\n * schemas rather than out of them: repeating is not a Stack's feature, so no\n * component schema names it and a palette built from schemas alone advertises\n * it on nothing. Declared ONCE for the whole palette — a model may write these\n * props on any element the surface allows.\n */\nexport interface AiNodeCapability {\n /** Stable id, as core declares it. */\n id: string\n displayName: string\n /** One sentence, for the prompt catalog. */\n summary: string\n propsSchema: AiPropsSchema\n propRoles: Record<string, AiPropRole>\n propFields: Record<string, string>\n textLimits: Record<string, number>\n /** Props offered only on a node that holds a child list. */\n childrenOnlyProps: readonly string[]\n /**\n * Declared attributes the palette deliberately does not offer: a picker\n * that chooses a record the site holds, which a model cannot name from a\n * description. Recorded so a field left off on purpose reads differently\n * from one that went missing.\n */\n omittedProps: readonly string[]\n}\n\n/**\n * The capability props a node with this child contract may carry, merged into\n * one map the prop sanitizer can read beside the element's own declarations.\n */\nexport function nodeCapabilityProps(\n capabilities: Readonly<Record<string, AiNodeCapability>>,\n acceptsChildren: boolean,\n): {\n properties: Record<string, AiPropSchema>\n propRoles: Record<string, AiPropRole>\n textLimits: Record<string, number>\n} {\n const properties: Record<string, AiPropSchema> = {}\n const propRoles: Record<string, AiPropRole> = {}\n const textLimits: Record<string, number> = {}\n for (const capability of Object.values(capabilities)) {\n for (const [name, schema] of Object.entries(\n capability.propsSchema.properties,\n )) {\n if (!acceptsChildren && capability.childrenOnlyProps.includes(name))\n continue\n properties[name] = schema\n const role = capability.propRoles[name]\n if (role) propRoles[name] = role\n const limit = capability.textLimits[name]\n if (limit !== undefined) textLimits[name] = limit\n }\n }\n return { properties, propRoles, textLimits }\n}\n\n/**\n * What a node capability declared in core and one carried by the palette\n * disagree about (AGL-3156).\n *\n * `check:ai-palette` pins the generated file to the generator's output for its\n * inputs, which cannot notice a capability leaving those inputs: when repeat\n * stopped being a component's attribute, the generator regenerated cleanly and\n * the palette simply stopped mentioning it. This reads the core declarations\n * instead and asks whether the palette still accounts for each one, so the\n * next generic capability cannot vanish the same way.\n *\n * `offeredFieldKinds` is every field kind the palette DOES carry somewhere,\n * derived from the generated entries rather than restated here: a capability\n * attribute drawn with one of those kinds has no excuse for being omitted.\n */\nexport function auditNodeCapabilities(\n declared: ReadonlyArray<{\n id: string\n label: string\n attributes: ReadonlyArray<{ name: string; component: string }>\n }>,\n carried: Readonly<Record<string, AiNodeCapability>>,\n offeredFieldKinds: ReadonlySet<string>,\n): string[] {\n const problems: string[] = []\n for (const capability of declared) {\n const entry = carried[capability.id]\n if (!entry) {\n problems.push(\n `the palette carries no node capability \"${capability.id}\": a model cannot use it at all`,\n )\n continue\n }\n if (!Object.keys(entry.propsSchema.properties).length) {\n problems.push(\n `node capability \"${capability.id}\" is carried with no prop a model can write`,\n )\n }\n for (const attribute of capability.attributes) {\n if (entry.propsSchema.properties[attribute.name]) continue\n if (!entry.omittedProps.includes(attribute.name)) {\n problems.push(\n `node capability \"${capability.id}\" declares \"${attribute.name}\", which the palette neither offers nor records as omitted`,\n )\n continue\n }\n if (offeredFieldKinds.has(attribute.component)) {\n problems.push(\n `node capability \"${capability.id}\" omits \"${attribute.name}\", whose \"${attribute.component}\" field the palette offers elsewhere`,\n )\n }\n }\n }\n for (const id of Object.keys(carried)) {\n if (!declared.some((capability) => capability.id === id)) {\n problems.push(\n `the palette carries node capability \"${id}\", which core no longer declares`,\n )\n }\n }\n return problems\n}\n\nexport interface AiSurfaceDefinition {\n /** The component id at the top of a tree for this surface. */\n root: string\n /** Every component id a node in this surface may carry. */\n allow: readonly string[]\n}\n\n/**\n * Theme vocabulary an `sx` value may name, read off the theme sources so the\n * validator's allowlist is derived rather than typed by hand.\n */\nexport interface AiSxTokens {\n /** Dotted palette paths such as `primary.main`. */\n palette: readonly string[]\n /** Responsive object keys. */\n breakpoints: readonly string[]\n /** Values `typography` may take. */\n typographyVariants: readonly string[]\n}\n\n/**\n * Text ceilings per role of copy (AGL-2905). A headline is one line of a\n * hero, body copy is a paragraph or two, and a button label has to fit a\n * button.\n */\nexport const AI_TEXT_LIMITS = {\n headline: 120,\n body: 2_000,\n button: 40,\n /** A short label, title or caption. */\n label: 200,\n} as const\n\n/**\n * Prompt budget per surface catalog, in characters at four per token.\n * Asserted by a spec so a component that grows its description cannot\n * silently push a system prompt past what the route pays for.\n */\nexport const AI_PALETTE_CATALOG_MAX_TOKENS = 2_500\nexport const AI_PALETTE_CATALOG_MAX_CHARS = AI_PALETTE_CATALOG_MAX_TOKENS * 4\n\n/** The model's own token estimate: characters over four. */\nexport function estimateCatalogTokens(catalog: string): number {\n return Math.ceil(catalog.length / 4)\n}\n\n/**\n * The documents a generator emits (AGL-2935). Each is composed on one\n * surface of the palette and held to its own budget below.\n */\nexport type AiOutputKind =\n | 'page'\n | 'template'\n | 'component'\n | 'layout'\n | 'form'\n | 'email'\n\nexport const AI_OUTPUT_KINDS: readonly AiOutputKind[] = [\n 'page',\n 'template',\n 'component',\n 'layout',\n 'form',\n 'email',\n]\n\n/** The surface each output kind is composed on. */\nexport const AI_OUTPUT_SURFACE: Record<AiOutputKind, AiSurface> = {\n page: 'screen',\n template: 'screen',\n component: 'component',\n layout: 'layout',\n form: 'form',\n email: 'email',\n}\n\n/**\n * What the rule-17 scorer measures on an emitted tree:\n *\n * - `nodes` — how many elements the tree carries;\n * - `bytes` — the stored node map, in the unit the save ceiling uses\n * (`nodeMapBytes`, msgpack);\n * - `imageBytes` — what the placed library images request at the slot's\n * variant, from each asset's recorded size;\n * - `embeds` — third-party players and frames the output loads;\n * - `fontFamilies` — families named beyond the theme's own;\n * - `emailHtmlBytes` — an email's rendered HTML, which is what a mail\n * client clips.\n */\nexport type AiBudgetMetric =\n | 'nodes'\n | 'bytes'\n | 'imageBytes'\n | 'embeds'\n | 'fontFamilies'\n | 'emailHtmlBytes'\n\nexport type AiOutputBudget = Record<Exclude<AiBudgetMetric, 'emailHtmlBytes'>, number> & {\n emailHtmlBytes?: number\n}\n\n/**\n * The size past which Gmail clips a message and hides the rest behind a\n * \"View entire message\" link — the unsubscribe footer included.\n */\nexport const AI_EMAIL_CLIP_BYTES = 102_000\n\n/**\n * The budget per output kind (AGL-2935, rule 17), beside the catalog budget\n * above for the same reason: a generator that grows its output past what\n * its kind is for is caught by a number, not noticed by a reader.\n *\n * A page is a few hundred elements and tens of kilobytes of stored map; a\n * reusable component is one repeated block; a layout is the chrome every\n * page loads, so it carries the least imagery; a form is fields and a\n * button; an email is held to the clipping threshold on its rendered HTML.\n * No kind names a font beyond the theme's.\n */\nexport const AI_OUTPUT_BUDGETS: Record<AiOutputKind, AiOutputBudget> = {\n page: {\n nodes: 400,\n bytes: 60_000,\n imageBytes: 1_500_000,\n embeds: 1,\n fontFamilies: 0,\n },\n template: {\n nodes: 400,\n bytes: 60_000,\n imageBytes: 1_500_000,\n embeds: 1,\n fontFamilies: 0,\n },\n component: {\n nodes: 80,\n bytes: 12_000,\n imageBytes: 500_000,\n embeds: 1,\n fontFamilies: 0,\n },\n layout: {\n nodes: 160,\n bytes: 24_000,\n imageBytes: 200_000,\n embeds: 0,\n fontFamilies: 0,\n },\n form: {\n nodes: 60,\n bytes: 8_000,\n imageBytes: 0,\n embeds: 0,\n fontFamilies: 0,\n },\n email: {\n nodes: 150,\n bytes: 24_000,\n imageBytes: 1_000_000,\n embeds: 0,\n fontFamilies: 0,\n emailHtmlBytes: AI_EMAIL_CLIP_BYTES,\n },\n}\n\n/**\n * What a first visit to a generated output is estimated to transfer — the\n * weight the proposal shows before anything is applied (rule 17). A page\n * starts from the platform's measured page weight; a component or a layout\n * reports only what it adds to a page; an email is not a page load.\n */\nexport interface AiLoadEstimate {\n /** The measured weight of a published page before this output's own bytes; 0 for a fragment. */\n pageBytes: number\n /** The stored node map, in the save's own bytes. */\n documentBytes: number\n /** What the placed library images request at their slots. */\n imageBytes: number\n /** Images the estimate could not size: no recorded size, or not from the library. */\n imagesUnmeasured: number\n embeds: number\n totalBytes: number\n}\n\n/** Typography variants that read as headlines, for the `children` ceiling. */\nexport function isHeadlineVariant(variant: unknown): boolean {\n return typeof variant === 'string' && /^(display\\w*|h[1-6]|heading)$/.test(variant)\n}\n"],"names":["AI_SURFACE_NAMES","nodeCapabilityProps","capabilities","acceptsChildren","properties","propRoles","textLimits","capability","Object","values","name","schema","entries","propsSchema","childrenOnlyProps","includes","role","limit","undefined","auditNodeCapabilities","declared","carried","offeredFieldKinds","problems","entry","id","push","keys","length","attribute","attributes","omittedProps","has","component","some","AI_TEXT_LIMITS","headline","body","button","label","AI_PALETTE_CATALOG_MAX_TOKENS","AI_PALETTE_CATALOG_MAX_CHARS","estimateCatalogTokens","catalog","Math","ceil","AI_OUTPUT_KINDS","AI_OUTPUT_SURFACE","page","template","layout","form","email","AI_EMAIL_CLIP_BYTES","AI_OUTPUT_BUDGETS","nodes","bytes","imageBytes","embeds","fontFamilies","emailHtmlBytes","isHeadlineVariant","variant","test"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAgBD,OAAO,MAAMA,mBAAyC;IACpD;IACA;IACA;IACA;IACA;CACD,CAAA;AAmGD;;;CAGC,GACD,OAAO,SAASC,oBACdC,YAAwD,EACxDC,eAAwB;IAMxB,MAAMC,aAA2C,CAAC;IAClD,MAAMC,YAAwC,CAAC;IAC/C,MAAMC,aAAqC,CAAC;IAC5C,KAAK,MAAMC,cAAcC,OAAOC,MAAM,CAACP,cAAe;QACpD,KAAK,MAAM,CAACQ,MAAMC,OAAO,IAAIH,OAAOI,OAAO,CACzCL,WAAWM,WAAW,CAACT,UAAU,EAChC;YACD,IAAI,CAACD,mBAAmBI,WAAWO,iBAAiB,CAACC,QAAQ,CAACL,OAC5D;YACFN,UAAU,CAACM,KAAK,GAAGC;YACnB,MAAMK,OAAOT,WAAWF,SAAS,CAACK,KAAK;YACvC,IAAIM,MAAMX,SAAS,CAACK,KAAK,GAAGM;YAC5B,MAAMC,QAAQV,WAAWD,UAAU,CAACI,KAAK;YACzC,IAAIO,UAAUC,WAAWZ,UAAU,CAACI,KAAK,GAAGO;QAC9C;IACF;IACA,OAAO;QAAEb;QAAYC;QAAWC;IAAW;AAC7C;AAEA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASa,sB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 +1,107 @@
|
|
|
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 AiCatalogProduct, type AiCategoriesProposal, type AiProductCategory, type AiProductCopy, type AiProductFacts } from '../model/ai-products';
|
|
18
|
+
import type { AiStepKind } from '../providers/catalog';
|
|
19
|
+
import type { AiImagePart, AiProvider } from '../providers/contract';
|
|
20
|
+
import { type AiPluginSettings } from '../providers/routing';
|
|
21
|
+
import { type AiValidatedGeneration } from './ai-doctrine';
|
|
22
|
+
import type { AiSystemBlock } from './ai-runtime';
|
|
23
|
+
/**
|
|
24
|
+
* COMMERCE BY AI (AGL-2916): the three generations a `products` job makes, each
|
|
25
|
+
* through the building doctrine's generation call (`runValidatedGeneration`):
|
|
26
|
+
* the doctrine's cached block, which carries the acceptable-use rules, then the
|
|
27
|
+
* generation's own rules, cached after it, and one strict tool. The store's
|
|
28
|
+
* name, a product's facts, its categories, its photo and the brief ride in the
|
|
29
|
+
* user turn, so no byte of a store sits inside the cached prefix, and no site
|
|
30
|
+
* inventory is sent: product copy is written from the product.
|
|
31
|
+
*
|
|
32
|
+
* Every answer is held by a check in `tools/ai-products-tool.ts`, which is
|
|
33
|
+
* where storefront copy safety is enforced — no health, financial or legal
|
|
34
|
+
* claim, no certification or endorsement the merchant did not state, and no
|
|
35
|
+
* price. The rules below say the same, so the model is never refused for a
|
|
36
|
+
* rule it was not told.
|
|
37
|
+
*/
|
|
38
|
+
/** The step kind every generation of a `products` job is routed as. */
|
|
39
|
+
export declare const AI_PRODUCTS_STEP: AiStepKind;
|
|
40
|
+
/**
|
|
41
|
+
* Each generation's answer ceiling. A catalog is the largest answer the step
|
|
42
|
+
* asks for, so it takes the routing table's; one product's copy and a set of
|
|
43
|
+
* categories with discounts are far smaller, and asking them for less keeps a
|
|
44
|
+
* pass's least time short enough for a bulk job to run several a beat.
|
|
45
|
+
* `ai-job-products-step.spec.ts` measures the largest answer each tool accepts
|
|
46
|
+
* against its ceiling.
|
|
47
|
+
*/
|
|
48
|
+
export declare const AI_CATALOG_MAX_TOKENS: number;
|
|
49
|
+
export declare const AI_PRODUCT_COPY_MAX_TOKENS = 1500;
|
|
50
|
+
export declare const AI_PRODUCT_CATEGORIES_MAX_TOKENS = 2000;
|
|
51
|
+
/** The rules for one product's copy. Byte-identical on every request. */
|
|
52
|
+
export declare const AI_PRODUCT_COPY_INSTRUCTIONS: AiSystemBlock[];
|
|
53
|
+
/** The rules for a store's first products. Byte-identical on every request. */
|
|
54
|
+
export declare const AI_CATALOG_INSTRUCTIONS: AiSystemBlock[];
|
|
55
|
+
/** The rules for categories and discounts. Byte-identical on every request. */
|
|
56
|
+
export declare const AI_CATEGORIES_INSTRUCTIONS: AiSystemBlock[];
|
|
57
|
+
export interface AiProductCopyPromptInput {
|
|
58
|
+
/** The store's name, as its visitors see it. */
|
|
59
|
+
store: string;
|
|
60
|
+
product: AiProductFacts;
|
|
61
|
+
categories: readonly AiProductCategory[];
|
|
62
|
+
/** Whether a photo rides with the request. */
|
|
63
|
+
photo: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** The user turn's text: the store, the product as it stands, and the categories to choose from. */
|
|
66
|
+
export declare function aiProductCopyPrompt(input: AiProductCopyPromptInput): string;
|
|
67
|
+
interface AiProductsGenerationBase {
|
|
68
|
+
settings?: AiPluginSettings;
|
|
69
|
+
model?: string;
|
|
70
|
+
maxTokens?: number;
|
|
71
|
+
signal?: AbortSignal;
|
|
72
|
+
provider?: AiProvider;
|
|
73
|
+
}
|
|
74
|
+
export interface GenerateAiProductCopyInput extends AiProductsGenerationBase, AiProductCopyPromptInput {
|
|
75
|
+
/** The product's photo, when the model reads pictures and the photo was read. */
|
|
76
|
+
image?: AiImagePart | null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Propose one product's copy. It asks the routing table's `job.products` model
|
|
80
|
+
* through the doctrine's generation call and resolves to `ok` with the copy,
|
|
81
|
+
* `needs_input` when the answer could not be held to the rules after one
|
|
82
|
+
* re-ask, or `refused`. It writes nothing.
|
|
83
|
+
*/
|
|
84
|
+
export declare function generateAiProductCopy(input: GenerateAiProductCopyInput): Promise<AiValidatedGeneration<AiProductCopy>>;
|
|
85
|
+
export interface GenerateAiCatalogInput extends AiProductsGenerationBase {
|
|
86
|
+
store: string;
|
|
87
|
+
brief: string;
|
|
88
|
+
}
|
|
89
|
+
/** The user turn for a catalog: the store and the brief. */
|
|
90
|
+
export declare function aiCatalogPrompt(input: Pick<GenerateAiCatalogInput, 'store' | 'brief'>): string;
|
|
91
|
+
/** Propose a store's first products from a brief. It writes nothing. */
|
|
92
|
+
export declare function generateAiCatalog(input: GenerateAiCatalogInput & {
|
|
93
|
+
maxTokens: number;
|
|
94
|
+
}): Promise<AiValidatedGeneration<AiCatalogProduct[]>>;
|
|
95
|
+
export interface GenerateAiCategoriesInput extends AiProductsGenerationBase {
|
|
96
|
+
store: string;
|
|
97
|
+
brief: string;
|
|
98
|
+
/** The names of the categories the store already has. */
|
|
99
|
+
existingCategoryNames: readonly string[];
|
|
100
|
+
}
|
|
101
|
+
/** The user turn for categories and discounts: the store, what it has, and the brief. */
|
|
102
|
+
export declare function aiCategoriesPrompt(input: Pick<GenerateAiCategoriesInput, 'store' | 'brief' | 'existingCategoryNames'>): string;
|
|
103
|
+
/** Propose categories and discounts from a brief. It writes nothing. */
|
|
104
|
+
export declare function generateAiCategories(input: GenerateAiCategoriesInput & {
|
|
105
|
+
maxTokens: number;
|
|
106
|
+
}): Promise<AiValidatedGeneration<Pick<AiCategoriesProposal, 'categories' | 'discounts'>>>;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ import { AI_CATALOG_OPTION_VALUES_MAX, AI_PRODUCT_CATEGORY_LIST_MAX, aiProductMerchantWords } from "../model/ai-products.js";
|
|
18
|
+
import { AI_ROUTING_TABLE } from "../providers/routing.js";
|
|
19
|
+
import { AI_CATALOG_TOOL, AI_CATALOG_TOOL_NAME, AI_CATEGORIES_TOOL, AI_CATEGORIES_TOOL_NAME, AI_PRODUCT_COPY_TOOL, AI_PRODUCT_COPY_TOOL_NAME, checkAiCatalog, checkAiCategories, checkAiProductCopy } from "../tools/ai-products-tool.js";
|
|
20
|
+
import { runValidatedGeneration } from "./ai-doctrine.js";
|
|
21
|
+
/**
|
|
22
|
+
* COMMERCE BY AI (AGL-2916): the three generations a `products` job makes, each
|
|
23
|
+
* through the building doctrine's generation call (`runValidatedGeneration`):
|
|
24
|
+
* the doctrine's cached block, which carries the acceptable-use rules, then the
|
|
25
|
+
* generation's own rules, cached after it, and one strict tool. The store's
|
|
26
|
+
* name, a product's facts, its categories, its photo and the brief ride in the
|
|
27
|
+
* user turn, so no byte of a store sits inside the cached prefix, and no site
|
|
28
|
+
* inventory is sent: product copy is written from the product.
|
|
29
|
+
*
|
|
30
|
+
* Every answer is held by a check in `tools/ai-products-tool.ts`, which is
|
|
31
|
+
* where storefront copy safety is enforced — no health, financial or legal
|
|
32
|
+
* claim, no certification or endorsement the merchant did not state, and no
|
|
33
|
+
* price. The rules below say the same, so the model is never refused for a
|
|
34
|
+
* rule it was not told.
|
|
35
|
+
*/ /** The step kind every generation of a `products` job is routed as. */ export const AI_PRODUCTS_STEP = 'job.products';
|
|
36
|
+
/**
|
|
37
|
+
* Each generation's answer ceiling. A catalog is the largest answer the step
|
|
38
|
+
* asks for, so it takes the routing table's; one product's copy and a set of
|
|
39
|
+
* categories with discounts are far smaller, and asking them for less keeps a
|
|
40
|
+
* pass's least time short enough for a bulk job to run several a beat.
|
|
41
|
+
* `ai-job-products-step.spec.ts` measures the largest answer each tool accepts
|
|
42
|
+
* against its ceiling.
|
|
43
|
+
*/ export const AI_CATALOG_MAX_TOKENS = AI_ROUTING_TABLE[AI_PRODUCTS_STEP].maxTokens;
|
|
44
|
+
export const AI_PRODUCT_COPY_MAX_TOKENS = 1500;
|
|
45
|
+
export const AI_PRODUCT_CATEGORIES_MAX_TOKENS = 2000;
|
|
46
|
+
/**
|
|
47
|
+
* Rules every storefront generation states, because its check refuses an
|
|
48
|
+
* answer for each of them.
|
|
49
|
+
*/ const STOREFRONT_RULES = [
|
|
50
|
+
'Never write a price, a discount, a shipping promise or a stock level: the store owner sets those.',
|
|
51
|
+
'Never say a product cures, treats, heals or prevents anything, and never promise a health, financial or legal result.',
|
|
52
|
+
'Never claim a certification, an award, a license, an endorsement or a best seller that the owner’s own words do not state.',
|
|
53
|
+
'Write plain text: no markup, no formatting marks, no emoji, no links.'
|
|
54
|
+
];
|
|
55
|
+
/** The rules for one product's copy. Byte-identical on every request. */ export const AI_PRODUCT_COPY_INSTRUCTIONS = [
|
|
56
|
+
{
|
|
57
|
+
text: 'You write the storefront copy for one product of an online store: its description, its search listing, its tags, the store categories it belongs in and clear names for its options.\n\n' + `Answer by calling ${AI_PRODUCT_COPY_TOOL_NAME} exactly once. A reply in prose cannot be used.\n\n` + 'Rules:\n' + [
|
|
58
|
+
'Write only from what you are given: the product’s name, its current text, its tags, its options and its photo. Never invent a material, a size, a quantity, an origin or a feature. Where a shopper would need a fact you do not have, mark it in square brackets, like [material], in the description only.',
|
|
59
|
+
'Keep every fact the current text states, in your own words.',
|
|
60
|
+
...STOREFRONT_RULES,
|
|
61
|
+
'The description is short paragraphs a shopper reads. The search title names the product plainly; the search description is one or two sentences; neither marks a missing fact.',
|
|
62
|
+
'Tags are words or short phrases a shopper filters by.',
|
|
63
|
+
'Choose categories only from the list you are given, by id, and none when none fits.',
|
|
64
|
+
'Give one name per option the product has, in order, keeping a name that is already clear.',
|
|
65
|
+
'When a photo is attached, use only what it plainly shows, and prefer the product’s own text where the two differ.',
|
|
66
|
+
'Write in the language of the product’s name and text.'
|
|
67
|
+
].map((rule)=>`- ${rule}`).join('\n'),
|
|
68
|
+
cacheBreakpoint: true
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
/** The rules for a store's first products. Byte-identical on every request. */ export const AI_CATALOG_INSTRUCTIONS = [
|
|
72
|
+
{
|
|
73
|
+
text: 'You propose the first products of an online store from its owner’s brief. Each is a draft the owner completes: a name, a type, a description, tags, options, a search listing and what its photo should show.\n\n' + `Answer by calling ${AI_CATALOG_TOOL_NAME} exactly once. A reply in prose cannot be used.\n\n` + 'Rules:\n' + [
|
|
74
|
+
'Propose 6 to 12 products that fit the brief, unless the brief says how many.',
|
|
75
|
+
'Write only from the brief. Never invent a material, a size, an origin or a feature it does not give; where a shopper would need a fact the brief does not give, mark it in square brackets, like [material], in the description only.',
|
|
76
|
+
...STOREFRONT_RULES,
|
|
77
|
+
`Options are only the choices a shopper makes, such as a size or a color, with at most ${AI_CATALOG_OPTION_VALUES_MAX} values each; a product with no choice has none.`,
|
|
78
|
+
'The photo says in one sentence what a photo of the product should show, so the owner can take or pick it. Never a link.',
|
|
79
|
+
'The search title names the product plainly, and neither it nor the search description marks a missing fact.',
|
|
80
|
+
'Write in the language of the brief.'
|
|
81
|
+
].map((rule)=>`- ${rule}`).join('\n'),
|
|
82
|
+
cacheBreakpoint: true
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
/** The rules for categories and discounts. Byte-identical on every request. */ export const AI_CATEGORIES_INSTRUCTIONS = [
|
|
86
|
+
{
|
|
87
|
+
text: 'You propose store categories and a first set of discounts from an online store owner’s brief. The owner creates the ones they accept, and every discount starts switched off.\n\n' + `Answer by calling ${AI_CATEGORIES_TOOL_NAME} exactly once. A reply in prose cannot be used.\n\n` + 'Rules:\n' + [
|
|
88
|
+
'Categories group the store’s products the way a shopper browses them. Never repeat a category the store already has.',
|
|
89
|
+
'A discount is a percentage off, an amount off in dollars, or free shipping, with an optional minimum order, and a code a shopper types or no code when it applies on its own. Keep them few and modest, and in line with the brief.',
|
|
90
|
+
'Each category and each discount says in one sentence why it helps this store.',
|
|
91
|
+
'Never promise savings, earnings or results beyond the discount itself, and never make a health, financial or legal claim.',
|
|
92
|
+
'Write plain text: no markup, no emoji, no links.',
|
|
93
|
+
'Propose nothing the brief gives no reason for; an empty list is an answer.',
|
|
94
|
+
'Write in the language of the brief.'
|
|
95
|
+
].map((rule)=>`- ${rule}`).join('\n'),
|
|
96
|
+
cacheBreakpoint: true
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
/** The user turn's text: the store, the product as it stands, and the categories to choose from. */ export function aiProductCopyPrompt(input) {
|
|
100
|
+
const { product } = input;
|
|
101
|
+
const lines = [
|
|
102
|
+
`Store: ${input.store || 'untitled store'}`,
|
|
103
|
+
`Product: ${product.name}`,
|
|
104
|
+
`Type: ${product.type}`,
|
|
105
|
+
'Current text:',
|
|
106
|
+
product.text.trim() || '(none)',
|
|
107
|
+
`Current tags: ${product.tags.length ? product.tags.join(', ') : '(none)'}`
|
|
108
|
+
];
|
|
109
|
+
if (product.options.length) {
|
|
110
|
+
lines.push('Options:', ...product.options.map((option)=>`- ${option.name}: ${option.values.join(', ')}`));
|
|
111
|
+
} else {
|
|
112
|
+
lines.push('Options: (none)');
|
|
113
|
+
}
|
|
114
|
+
if (product.seoTitle || product.seoDescription) {
|
|
115
|
+
lines.push(`Current search title: ${product.seoTitle || '(none)'}`, `Current search description: ${product.seoDescription || '(none)'}`);
|
|
116
|
+
}
|
|
117
|
+
const categories = input.categories.slice(0, AI_PRODUCT_CATEGORY_LIST_MAX);
|
|
118
|
+
lines.push(categories.length ? 'Categories to choose from:' : 'Categories to choose from: (none)', ...categories.map((category)=>`- ${category.id}: ${category.name}`), `Photo: ${input.photo ? 'attached' : 'none'}`);
|
|
119
|
+
return lines.join('\n');
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Propose one product's copy. It asks the routing table's `job.products` model
|
|
123
|
+
* through the doctrine's generation call and resolves to `ok` with the copy,
|
|
124
|
+
* `needs_input` when the answer could not be held to the rules after one
|
|
125
|
+
* re-ask, or `refused`. It writes nothing.
|
|
126
|
+
*/ export function generateAiProductCopy(input) {
|
|
127
|
+
var _input_image, _input_maxTokens;
|
|
128
|
+
const image = input.photo ? (_input_image = input.image) != null ? _input_image : null : null;
|
|
129
|
+
const content = [
|
|
130
|
+
...image ? [
|
|
131
|
+
image
|
|
132
|
+
] : [],
|
|
133
|
+
{
|
|
134
|
+
type: 'text',
|
|
135
|
+
text: aiProductCopyPrompt(_extends({}, input, {
|
|
136
|
+
photo: Boolean(image)
|
|
137
|
+
}))
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
return runValidatedGeneration('product copy', _extends({
|
|
141
|
+
step: AI_PRODUCTS_STEP
|
|
142
|
+
}, input.settings ? {
|
|
143
|
+
settings: input.settings
|
|
144
|
+
} : {}, input.model ? {
|
|
145
|
+
model: input.model
|
|
146
|
+
} : {}, {
|
|
147
|
+
instructions: AI_PRODUCT_COPY_INSTRUCTIONS,
|
|
148
|
+
messages: [
|
|
149
|
+
{
|
|
150
|
+
role: 'user',
|
|
151
|
+
content: image ? content : aiProductCopyPrompt(_extends({}, input, {
|
|
152
|
+
photo: false
|
|
153
|
+
}))
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
tool: AI_PRODUCT_COPY_TOOL,
|
|
157
|
+
maxTokens: (_input_maxTokens = input.maxTokens) != null ? _input_maxTokens : AI_PRODUCT_COPY_MAX_TOKENS
|
|
158
|
+
}, thinkingOf(), input.signal ? {
|
|
159
|
+
signal: input.signal
|
|
160
|
+
} : {}, input.provider ? {
|
|
161
|
+
provider: input.provider
|
|
162
|
+
} : {}, {
|
|
163
|
+
check: (answer)=>checkAiProductCopy(answer, {
|
|
164
|
+
categoryIds: input.categories.slice(0, AI_PRODUCT_CATEGORY_LIST_MAX).map((category)=>category.id),
|
|
165
|
+
optionCount: input.product.options.length,
|
|
166
|
+
merchantWords: aiProductMerchantWords(input.product)
|
|
167
|
+
})
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
/** The user turn for a catalog: the store and the brief. */ export function aiCatalogPrompt(input) {
|
|
171
|
+
return [
|
|
172
|
+
`Store: ${input.store || 'untitled store'}`,
|
|
173
|
+
'Brief:',
|
|
174
|
+
input.brief.trim()
|
|
175
|
+
].join('\n');
|
|
176
|
+
}
|
|
177
|
+
/** Propose a store's first products from a brief. It writes nothing. */ export function generateAiCatalog(input) {
|
|
178
|
+
return runValidatedGeneration('catalog', _extends({
|
|
179
|
+
step: AI_PRODUCTS_STEP
|
|
180
|
+
}, input.settings ? {
|
|
181
|
+
settings: input.settings
|
|
182
|
+
} : {}, input.model ? {
|
|
183
|
+
model: input.model
|
|
184
|
+
} : {}, {
|
|
185
|
+
instructions: AI_CATALOG_INSTRUCTIONS,
|
|
186
|
+
messages: [
|
|
187
|
+
{
|
|
188
|
+
role: 'user',
|
|
189
|
+
content: aiCatalogPrompt(input)
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
tool: AI_CATALOG_TOOL,
|
|
193
|
+
maxTokens: input.maxTokens
|
|
194
|
+
}, thinkingOf(), input.signal ? {
|
|
195
|
+
signal: input.signal
|
|
196
|
+
} : {}, input.provider ? {
|
|
197
|
+
provider: input.provider
|
|
198
|
+
} : {}, {
|
|
199
|
+
check: (answer)=>checkAiCatalog(answer, {
|
|
200
|
+
merchantWords: input.brief
|
|
201
|
+
})
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
/** The user turn for categories and discounts: the store, what it has, and the brief. */ export function aiCategoriesPrompt(input) {
|
|
205
|
+
const existing = input.existingCategoryNames.slice(0, AI_PRODUCT_CATEGORY_LIST_MAX);
|
|
206
|
+
return [
|
|
207
|
+
`Store: ${input.store || 'untitled store'}`,
|
|
208
|
+
`Categories the store already has: ${existing.length ? existing.join(', ') : '(none)'}`,
|
|
209
|
+
'Brief:',
|
|
210
|
+
input.brief.trim()
|
|
211
|
+
].join('\n');
|
|
212
|
+
}
|
|
213
|
+
/** Propose categories and discounts from a brief. It writes nothing. */ export function generateAiCategories(input) {
|
|
214
|
+
return runValidatedGeneration('store categories and discounts', _extends({
|
|
215
|
+
step: AI_PRODUCTS_STEP
|
|
216
|
+
}, input.settings ? {
|
|
217
|
+
settings: input.settings
|
|
218
|
+
} : {}, input.model ? {
|
|
219
|
+
model: input.model
|
|
220
|
+
} : {}, {
|
|
221
|
+
instructions: AI_CATEGORIES_INSTRUCTIONS,
|
|
222
|
+
messages: [
|
|
223
|
+
{
|
|
224
|
+
role: 'user',
|
|
225
|
+
content: aiCategoriesPrompt(input)
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
tool: AI_CATEGORIES_TOOL,
|
|
229
|
+
maxTokens: input.maxTokens
|
|
230
|
+
}, thinkingOf(), input.signal ? {
|
|
231
|
+
signal: input.signal
|
|
232
|
+
} : {}, input.provider ? {
|
|
233
|
+
provider: input.provider
|
|
234
|
+
} : {}, {
|
|
235
|
+
check: (answer)=>checkAiCategories(answer, {
|
|
236
|
+
existingCategoryNames: input.existingCategoryNames,
|
|
237
|
+
merchantWords: input.brief
|
|
238
|
+
})
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
/** The routing row's thinking and effort, sent only where the row names one. */ function thinkingOf() {
|
|
242
|
+
const row = AI_ROUTING_TABLE[AI_PRODUCTS_STEP];
|
|
243
|
+
return _extends({}, row.thinking ? {
|
|
244
|
+
thinking: row.thinking
|
|
245
|
+
} : {}, row.effort ? {
|
|
246
|
+
effort: row.effort
|
|
247
|
+
} : {});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
//# sourceMappingURL=ai-products-generation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/runtime/ai-products-generation.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_CATALOG_OPTION_VALUES_MAX,\n AI_PRODUCT_CATEGORY_LIST_MAX,\n aiProductMerchantWords,\n type AiCatalogProduct,\n type AiCategoriesProposal,\n type AiProductCategory,\n type AiProductCopy,\n type AiProductFacts,\n} from '../model/ai-products'\nimport type { AiStepKind } from '../providers/catalog'\nimport type { AiImagePart, AiMessagePart, AiProvider } from '../providers/contract'\nimport { AI_ROUTING_TABLE, type AiPluginSettings } from '../providers/routing'\nimport {\n AI_CATALOG_TOOL,\n AI_CATALOG_TOOL_NAME,\n AI_CATEGORIES_TOOL,\n AI_CATEGORIES_TOOL_NAME,\n AI_PRODUCT_COPY_TOOL,\n AI_PRODUCT_COPY_TOOL_NAME,\n checkAiCatalog,\n checkAiCategories,\n checkAiProductCopy,\n} from '../tools/ai-products-tool'\nimport { runValidatedGeneration, type AiValidatedGeneration } from './ai-doctrine'\nimport type { AiSystemBlock } from './ai-runtime'\n\n/**\n * COMMERCE BY AI (AGL-2916): the three generations a `products` job makes, each\n * through the building doctrine's generation call (`runValidatedGeneration`):\n * the doctrine's cached block, which carries the acceptable-use rules, then the\n * generation's own rules, cached after it, and one strict tool. The store's\n * name, a product's facts, its categories, its photo and the brief ride in the\n * user turn, so no byte of a store sits inside the cached prefix, and no site\n * inventory is sent: product copy is written from the product.\n *\n * Every answer is held by a check in `tools/ai-products-tool.ts`, which is\n * where storefront copy safety is enforced — no health, financial or legal\n * claim, no certification or endorsement the merchant did not state, and no\n * price. The rules below say the same, so the model is never refused for a\n * rule it was not told.\n */\n\n/** The step kind every generation of a `products` job is routed as. */\nexport const AI_PRODUCTS_STEP: AiStepKind = 'job.products'\n\n/**\n * Each generation's answer ceiling. A catalog is the largest answer the step\n * asks for, so it takes the routing table's; one product's copy and a set of\n * categories with discounts are far smaller, and asking them for less keeps a\n * pass's least time short enough for a bulk job to run several a beat.\n * `ai-job-products-step.spec.ts` measures the largest answer each tool accepts\n * against its ceiling.\n */\nexport const AI_CATALOG_MAX_TOKENS = AI_ROUTING_TABLE[AI_PRODUCTS_STEP].maxTokens\nexport const AI_PRODUCT_COPY_MAX_TOKENS = 1_500\nexport const AI_PRODUCT_CATEGORIES_MAX_TOKENS = 2_000\n\n/**\n * Rules every storefront generation states, because its check refuses an\n * answer for each of them.\n */\nconst STOREFRONT_RULES = [\n 'Never write a price, a discount, a shipping promise or a stock level: the store owner sets those.',\n 'Never say a product cures, treats, heals or prevents anything, and never promise a health, financial or legal result.',\n 'Never claim a certification, an award, a license, an endorsement or a best seller that the owner’s own words do not state.',\n 'Write plain text: no markup, no formatting marks, no emoji, no links.',\n]\n\n/** The rules for one product's copy. Byte-identical on every request. */\nexport const AI_PRODUCT_COPY_INSTRUCTIONS: AiSystemBlock[] = [\n {\n text:\n 'You write the storefront copy for one product of an online store: its description, its search listing, its tags, the store categories it belongs in and clear names for its options.\\n\\n' +\n `Answer by calling ${AI_PRODUCT_COPY_TOOL_NAME} exactly once. A reply in prose cannot be used.\\n\\n` +\n 'Rules:\\n' +\n [\n 'Write only from what you are given: the product’s name, its current text, its tags, its options and its photo. Never invent a material, a size, a quantity, an origin or a feature. Where a shopper would need a fact you do not have, mark it in square brackets, like [material], in the description only.',\n 'Keep every fact the current text states, in your own words.',\n ...STOREFRONT_RULES,\n 'The description is short paragraphs a shopper reads. The search title names the product plainly; the search description is one or two sentences; neither marks a missing fact.',\n 'Tags are words or short phrases a shopper filters by.',\n 'Choose categories only from the list you are given, by id, and none when none fits.',\n 'Give one name per option the product has, in order, keeping a name that is already clear.',\n 'When a photo is attached, use only what it plainly shows, and prefer the product’s own text where the two differ.',\n 'Write in the language of the product’s name and text.',\n ]\n .map((rule) => `- ${rule}`)\n .join('\\n'),\n cacheBreakpoint: true,\n },\n]\n\n/** The rules for a store's first products. Byte-identical on every request. */\nexport const AI_CATALOG_INSTRUCTIONS: AiSystemBlock[] = [\n {\n text:\n 'You propose the first products of an online store from its owner’s brief. Each is a draft the owner completes: a name, a type, a description, tags, options, a search listing and what its photo should show.\\n\\n' +\n `Answer by calling ${AI_CATALOG_TOOL_NAME} exactly once. A reply in prose cannot be used.\\n\\n` +\n 'Rules:\\n' +\n [\n 'Propose 6 to 12 products that fit the brief, unless the brief says how many.',\n 'Write only from the brief. Never invent a material, a size, an origin or a feature it does not give; where a shopper would need a fact the brief does not give, mark it in square brackets, like [material], in the description only.',\n ...STOREFRONT_RULES,\n `Options are only the choices a shopper makes, such as a size or a color, with at most ${AI_CATALOG_OPTION_VALUES_MAX} values each; a product with no choice has none.`,\n 'The photo says in one sentence what a photo of the product should show, so the owner can take or pick it. Never a link.',\n 'The search title names the product plainly, and neither it nor the search description marks a missing fact.',\n 'Write in the language of the brief.',\n ]\n .map((rule) => `- ${rule}`)\n .join('\\n'),\n cacheBreakpoint: true,\n },\n]\n\n/** The rules for categories and discounts. Byte-identical on every request. */\nexport const AI_CATEGORIES_INSTRUCTIONS: AiSystemBlock[] = [\n {\n text:\n 'You propose store categories and a first set of discounts from an online store owner’s brief. The owner creates the ones they accept, and every discount starts switched off.\\n\\n' +\n `Answer by calling ${AI_CATEGORIES_TOOL_NAME} exactly once. A reply in prose cannot be used.\\n\\n` +\n 'Rules:\\n' +\n [\n 'Categories group the store’s products the way a shopper browses them. Never repeat a category the store already has.',\n 'A discount is a percentage off, an amount off in dollars, or free shipping, with an optional minimum order, and a code a shopper types or no code when it applies on its own. Keep them few and modest, and in line with the brief.',\n 'Each category and each discount says in one sentence why it helps this store.',\n 'Never promise savings, earnings or results beyond the discount itself, and never make a health, financial or legal claim.',\n 'Write plain text: no markup, no emoji, no links.',\n 'Propose nothing the brief gives no reason for; an empty list is an answer.',\n 'Write in the language of the brief.',\n ]\n .map((rule) => `- ${rule}`)\n .join('\\n'),\n cacheBreakpoint: true,\n },\n]\n\nexport interface AiProductCopyPromptInput {\n /** The store's name, as its visitors see it. */\n store: string\n product: AiProductFacts\n categories: readonly AiProductCategory[]\n /** Whether a photo rides with the request. */\n photo: boolean\n}\n\n/** The user turn's text: the store, the product as it stands, and the categories to choose from. */\nexport function aiProductCopyPrompt(input: AiProductCopyPromptInput): string {\n const { product } = input\n const lines = [\n `Store: ${input.store || 'untitled store'}`,\n `Product: ${product.name}`,\n `Type: ${product.type}`,\n 'Current text:',\n product.text.trim() || '(none)',\n `Current tags: ${product.tags.length ? product.tags.join(', ') : '(none)'}`,\n ]\n if (product.options.length) {\n lines.push('Options:', ...product.options.map((option) => `- ${option.name}: ${option.values.join(', ')}`))\n } else {\n lines.push('Options: (none)')\n }\n if (product.seoTitle || product.seoDescription) {\n lines.push(\n `Current search title: ${product.seoTitle || '(none)'}`,\n `Current search description: ${product.seoDescription || '(none)'}`,\n )\n }\n const categories = input.categories.slice(0, AI_PRODUCT_CATEGORY_LIST_MAX)\n lines.push(\n categories.length ? 'Categories to choose from:' : 'Categories to choose from: (none)',\n ...categories.map((category) => `- ${category.id}: ${category.name}`),\n `Photo: ${input.photo ? 'attached' : 'none'}`,\n )\n return lines.join('\\n')\n}\n\ninterface AiProductsGenerationBase {\n settings?: AiPluginSettings\n model?: string\n maxTokens?: number\n signal?: AbortSignal\n provider?: AiProvider\n}\n\nexport interface GenerateAiProductCopyInput extends AiProductsGenerationBase, AiProductCopyPromptInput {\n /** The product's photo, when the model reads pictures and the photo was read. */\n image?: AiImagePart | null\n}\n\n/**\n * Propose one product's copy. It asks the routing table's `job.products` model\n * through the doctrine's generation call and resolves to `ok` with the copy,\n * `needs_input` when the answer could not be held to the rules after one\n * re-ask, or `refused`. It writes nothing.\n */\nexport function generateAiProductCopy(input: GenerateAiProductCopyInput): Promise<AiValidatedGeneration<AiProductCopy>> {\n const image = input.photo ? (input.image ?? null) : null\n const content: AiMessagePart[] = [\n ...(image ? [image] : []),\n { type: 'text', text: aiProductCopyPrompt({ ...input, photo: Boolean(image) }) },\n ]\n return runValidatedGeneration('product copy', {\n step: AI_PRODUCTS_STEP,\n ...(input.settings ? { settings: input.settings } : {}),\n ...(input.model ? { model: input.model } : {}),\n instructions: AI_PRODUCT_COPY_INSTRUCTIONS,\n messages: [{ role: 'user', content: image ? content : aiProductCopyPrompt({ ...input, photo: false }) }],\n tool: AI_PRODUCT_COPY_TOOL,\n maxTokens: input.maxTokens ?? AI_PRODUCT_COPY_MAX_TOKENS,\n ...thinkingOf(),\n ...(input.signal ? { signal: input.signal } : {}),\n ...(input.provider ? { provider: input.provider } : {}),\n check: (answer) =>\n checkAiProductCopy(answer, {\n categoryIds: input.categories.slice(0, AI_PRODUCT_CATEGORY_LIST_MAX).map((category) => category.id),\n optionCount: input.product.options.length,\n merchantWords: aiProductMerchantWords(input.product),\n }),\n })\n}\n\nexport interface GenerateAiCatalogInput extends AiProductsGenerationBase {\n store: string\n brief: string\n}\n\n/** The user turn for a catalog: the store and the brief. */\nexport function aiCatalogPrompt(input: Pick<GenerateAiCatalogInput, 'store' | 'brief'>): string {\n return [`Store: ${input.store || 'untitled store'}`, 'Brief:', input.brief.trim()].join('\\n')\n}\n\n/** Propose a store's first products from a brief. It writes nothing. */\nexport function generateAiCatalog(input: GenerateAiCatalogInput & { maxTokens: number }): Promise<AiValidatedGeneration<AiCatalogProduct[]>> {\n return runValidatedGeneration('catalog', {\n step: AI_PRODUCTS_STEP,\n ...(input.settings ? { settings: input.settings } : {}),\n ...(input.model ? { model: input.model } : {}),\n instructions: AI_CATALOG_INSTRUCTIONS,\n messages: [{ role: 'user', content: aiCatalogPrompt(input) }],\n tool: AI_CATALOG_TOOL,\n maxTokens: input.maxTokens,\n ...thinkingOf(),\n ...(input.signal ? { signal: input.signal } : {}),\n ...(input.provider ? { provider: input.provider } : {}),\n check: (answer) => checkAiCatalog(answer, { merchantWords: input.brief }),\n })\n}\n\nexport interface GenerateAiCategoriesInput extends AiProductsGenerationBase {\n store: string\n brief: string\n /** The names of the categories the store already has. */\n existingCategoryNames: readonly string[]\n}\n\n/** The user turn for categories and discounts: the store, what it has, and the brief. */\nexport function aiCategoriesPrompt(input: Pick<GenerateAiCategoriesInput, 'store' | 'brief' | 'existingCategoryNames'>): string {\n const existing = input.existingCategoryNames.slice(0, AI_PRODUCT_CATEGORY_LIST_MAX)\n return [\n `Store: ${input.store || 'untitled store'}`,\n `Categories the store already has: ${existing.length ? existing.join(', ') : '(none)'}`,\n 'Brief:',\n input.brief.trim(),\n ].join('\\n')\n}\n\n/** Propose categories and discounts from a brief. It writes nothing. */\nexport function generateAiCategories(\n input: GenerateAiCategoriesInput & { maxTokens: number },\n): Promise<AiValidatedGeneration<Pick<AiCategoriesProposal, 'categories' | 'discounts'>>> {\n return runValidatedGeneration('store categories and discounts', {\n step: AI_PRODUCTS_STEP,\n ...(input.settings ? { settings: input.settings } : {}),\n ...(input.model ? { model: input.model } : {}),\n instructions: AI_CATEGORIES_INSTRUCTIONS,\n messages: [{ role: 'user', content: aiCategoriesPrompt(input) }],\n tool: AI_CATEGORIES_TOOL,\n maxTokens: input.maxTokens,\n ...thinkingOf(),\n ...(input.signal ? { signal: input.signal } : {}),\n ...(input.provider ? { provider: input.provider } : {}),\n check: (answer) =>\n checkAiCategories(answer, {\n existingCategoryNames: input.existingCategoryNames,\n merchantWords: input.brief,\n }),\n })\n}\n\n/** The routing row's thinking and effort, sent only where the row names one. */\nfunction thinkingOf() {\n const row = AI_ROUTING_TABLE[AI_PRODUCTS_STEP]\n return {\n ...(row.thinking ? { thinking: row.thinking } : {}),\n ...(row.effort ? { effort: row.effort } : {}),\n }\n}\n"],"names":["AI_CATALOG_OPTION_VALUES_MAX","AI_PRODUCT_CATEGORY_LIST_MAX","aiProductMerchantWords","AI_ROUTING_TABLE","AI_CATALOG_TOOL","AI_CATALOG_TOOL_NAME","AI_CATEGORIES_TOOL","AI_CATEGORIES_TOOL_NAME","AI_PRODUCT_COPY_TOOL","AI_PRODUCT_COPY_TOOL_NAME","checkAiCatalog","checkAiCategories","checkAiProductCopy","runValidatedGeneration","AI_PRODUCTS_STEP","AI_CATALOG_MAX_TOKENS","maxTokens","AI_PRODUCT_COPY_MAX_TOKENS","AI_PRODUCT_CATEGORIES_MAX_TOKENS","STOREFRONT_RULES","AI_PRODUCT_COPY_INSTRUCTIONS","text","map","rule","join","cacheBreakpoint","AI_CATALOG_INSTRUCTIONS","AI_CATEGORIES_INSTRUCTIONS","aiProductCopyPrompt","input","product","lines","store","name","type","trim","tags","length","options","push","option","values","seoTitle","seoDescription","categories","slice","category","id","photo","generateAiProductCopy","image","content","Boolean","step","settings","model","instructions","messages","role","tool","thinkingOf","signal","provider","check","answer","categoryIds","optionCount","merchantWords","aiCatalogPrompt","brief","generateAiCatalog","aiCategoriesPrompt","existing","existingCategoryNames","generateAiCategories","row","thinking","effort"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,4BAA4B,EAC5BC,4BAA4B,EAC5BC,sBAAsB,QAMjB,0BAAsB;AAG7B,SAASC,gBAAgB,QAA+B,0BAAsB;AAC9E,SACEC,eAAe,EACfC,oBAAoB,EACpBC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,yBAAyB,EACzBC,cAAc,EACdC,iBAAiB,EACjBC,kBAAkB,QACb,+BAA2B;AAClC,SAASC,sBAAsB,QAAoC,mBAAe;AAGlF;;;;;;;;;;;;;;CAcC,GAED,qEAAqE,GACrE,OAAO,MAAMC,mBAA+B,eAAc;AAE1D;;;;;;;CAOC,GACD,OAAO,MAAMC,wBAAwBZ,gBAAgB,CAACW,iBAAiB,CAACE,SAAS,CAAA;AACjF,OAAO,MAAMC,6BAA6B,KAAK;AAC/C,OAAO,MAAMC,mCAAmC,KAAK;AAErD;;;CAGC,GACD,MAAMC,mBAAmB;IACvB;IACA;IACA;IACA;CACD;AAED,uEAAuE,GACvE,OAAO,MAAMC,+BAAgD;IAC3D;QACEC,MACE,6LACA,CAAC,kBAAkB,EAAEZ,0BAA0B,mDAAmD,CAAC,GACnG,aACA;YACE;YACA;eACGU;YACH;YACA;YACA;YACA;YACA;YACA;SACD,CACEG,GAAG,CAAC,CAACC,OAAS,CAAC,EAAE,EAAEA,MAAM,EACzBC,IAAI,CAAC;QACVC,iBAAiB;IACnB;CACD,CAAA;AAED,6EAA6E,GAC7E,OAAO,MAAMC,0BAA2C;IACtD;QACEL,MACE,sNACA,CAAC,kBAAkB,EAAEhB,qBAAqB,mDAAmD,CAAC,GAC9F,aACA;YACE;YACA;eACGc;YACH,CAAC,sFAAsF,EAAEnB,6BAA6B,gDAAgD,CAAC;YACvK;YACA;YACA;SACD,CACEsB,GAAG,CAAC,CAACC,OAAS,CAAC,EAAE,EAAEA,MAAM,EACzBC,IAAI,CAAC;QACVC,iBAAiB;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