@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,667 @@
|
|
|
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 { buildPageMarkdown } from "@aglyn/aglyn/app-utils/page-markdown";
|
|
18
|
+
import { checkEntitlement } from "@aglyn/aglyn/app-utils/plan-entitlements";
|
|
19
|
+
import { SCREEN_SEO_TEXT_GUIDANCE } from "@aglyn/aglyn/app-utils/screen-seo-fields";
|
|
20
|
+
import { CANVAS_ROOT_ELEMENT_ID } from "@aglyn/aglyn/foundation/constants/canvas";
|
|
21
|
+
import { duplicateResource } from "@aglyn/tenant-data-admin/server/duplicate-resource";
|
|
22
|
+
import { AI_BUILD_PLAN_LIMITS } from "../model/ai-build-plan.js";
|
|
23
|
+
import { AI_PAGE_CREATE_KINDS, aiPageCreationRefusal, aiPagePlanRefusal, parseAiPageJobInputs } from "../model/ai-page-job.js";
|
|
24
|
+
import { aiPlanCapabilitiesForJob, aiPlanUncreatable } from "../model/ai-plan-capabilities.js";
|
|
25
|
+
import { aiSiteWords } from "../model/ai-site-job.js";
|
|
26
|
+
import { aiModelForStep } from "../providers/routing.js";
|
|
27
|
+
import { aiDoctrineNeedsInputMessage, runValidatedGeneration } from "../runtime/ai-doctrine.js";
|
|
28
|
+
import { validateAiDoctrineTree } from "../runtime/ai-doctrine-validators.js";
|
|
29
|
+
import { AI_SEO_FIELDS_MAX_TOKENS, generateSeoFields } from "../runtime/seo-fields.js";
|
|
30
|
+
import { readSiteInventory } from "../runtime/site-inventory.js";
|
|
31
|
+
import { registerAiJobAdmission } from "./ai-job-admission.js";
|
|
32
|
+
import { aiGenerationWorstCaseMs } from "./ai-job-budget.js";
|
|
33
|
+
import { aiJobDraftId } from "./ai-job-draft-ids.js";
|
|
34
|
+
import { aiDraftAdmissionRefusal, aiDraftAllowanceRefusal, aiSiteSubdomain, readAiDraft, readAiDraftNodes, readAiPlanCapabilities, updateAiDraftNodes, writeAiDraft, writeAiDraftScreenSeo } from "./ai-job-drafts.js";
|
|
35
|
+
import { aiBracketedFactsNote, aiConfirmedPlan, aiDoctrineReview, aiGenerationSpent, aiLimitReview, aiModelNodeIds, aiUnspentOutcome } from "./ai-job-generation.js";
|
|
36
|
+
import { AI_JOB_PAGE_SECTION_MAX_TOKENS, AI_JOB_PAGE_SECTION_TOKENS, AI_JOB_PAGE_STEP_BUDGET, AI_JOB_PAGE_STEP_MINIMUM_MS, aiJobPageSectionMaxTokens } from "./ai-job-page-budget.js";
|
|
37
|
+
import { AI_JOB_PAGE_INSTRUCTIONS, AI_PAGE_SECTION_TOOL, aiEmptyPage, aiPageCheckContext, aiPageSectionCheck, aiPageSectionNodeId, aiPageSectionPrompt, aiPageSectionSmaller, aiPageWithSection } from "./ai-job-page-sections.js";
|
|
38
|
+
import { AI_PLAN_ITEMS_MIN, aiPlanCopiedPageViolations } from "./ai-job-plan-conformance.js";
|
|
39
|
+
import { aiCreationUnit, aiRunJobUnit, aiSiteBuiltRefs, aiSitePendingUnits, aiSiteUnitJob } from "./ai-job-site-step.js";
|
|
40
|
+
import { aiJobStepRunMinimumMs, aiJobStepRunnerFor, registerAiJobStep, registerAiJobStepPasses } from "./ai-jobs.js";
|
|
41
|
+
/**
|
|
42
|
+
* The page step (AGL-2907): the generation step of a `page` job, run once a
|
|
43
|
+
* member confirmed the job's plan. It builds ONE screen, section by section,
|
|
44
|
+
* from what the site already has, and leaves it an unpublished draft.
|
|
45
|
+
*
|
|
46
|
+
* ── Why a page is built in passes ────────────────────────────────────────
|
|
47
|
+
*
|
|
48
|
+
* A page is far larger than one answer the job beat can wait for: the beat
|
|
49
|
+
* gives a step what is left of its budget, and a whole page, answered and re-asked,
|
|
50
|
+
* takes several times that. The confirmed plan already names the page's
|
|
51
|
+
* sections, so the step builds one section per pass and asks the machine to
|
|
52
|
+
* continue. Every pass is one reservation and one generation — the section's
|
|
53
|
+
* lookup rounds, its answer and, when it breaks a rule, its one re-ask — sized
|
|
54
|
+
* so that worst case fits `AI_JOB_PAGE_STEP_MINIMUM_MS`, which the step
|
|
55
|
+
* registers as the least time a section pass needs before it starts.
|
|
56
|
+
*
|
|
57
|
+
* - The first pass builds the top section, which holds the page's h1, and
|
|
58
|
+
* writes the draft screen and its first version.
|
|
59
|
+
* - Each later pass builds the next section and adds it to that version.
|
|
60
|
+
* - The last pass generates no tree: it holds the whole page to the
|
|
61
|
+
* doctrine, writes the search title and description, and reports the
|
|
62
|
+
* draft with its measured weight and a navigation proposal.
|
|
63
|
+
*
|
|
64
|
+
* How a section is asked for and held to the rules as part of the page is
|
|
65
|
+
* `ai-job-page-sections.ts`.
|
|
66
|
+
*
|
|
67
|
+
* ── What the plan creates comes first (AGL-3031) ─────────────────────────
|
|
68
|
+
*
|
|
69
|
+
* A plan that creates a layout, forms or components is built in the same job,
|
|
70
|
+
* before its page, one creation a pass, through the site scaffold's unit
|
|
71
|
+
* machinery: each creation is handed to the step that builds that kind, under
|
|
72
|
+
* a job derived from this one, and lands as the draft that step writes. Where
|
|
73
|
+
* the job stands is read from its outputs, so nothing is kept anywhere else.
|
|
74
|
+
* Once every creation is built, the page's passes run on the plan with each
|
|
75
|
+
* `new:<name>` resolved to the record that was built, which the site's
|
|
76
|
+
* inventory now lists — so the page places the new component and binds the new
|
|
77
|
+
* form by id, and renders inside the new layout, exactly as it would one the
|
|
78
|
+
* site always had. A pass that builds a creation needs the time the step that
|
|
79
|
+
* builds it registers, not a section's (`aiPageJobRunMinimumMs`, AGL-3035), so
|
|
80
|
+
* neither the beat nor a door starts it with only a section's time left.
|
|
81
|
+
*
|
|
82
|
+
* ── Never published ──────────────────────────────────────────────────────
|
|
83
|
+
*
|
|
84
|
+
* The draft is written the way `/api/hosts/resources` and
|
|
85
|
+
* `/api/hosts/versions` write a screen and its first version, and nothing
|
|
86
|
+
* else is touched: not the host document, whose routing map is what the live
|
|
87
|
+
* site serves, and no collection, store, layout or navigation pointer
|
|
88
|
+
* (`ai-job-drafts.ts`). A screen the routing map does not name serves nothing
|
|
89
|
+
* until a member publishes it.
|
|
90
|
+
*/ /**
|
|
91
|
+
* A section pass's time, and the ceiling each pass asks on each model, are
|
|
92
|
+
* declared apart from the step (`ai-job-page-budget.ts`): the site scaffold
|
|
93
|
+
* builds its pages through this step and reads them without loading it.
|
|
94
|
+
*/ export { AI_JOB_PAGE_SECTION_MAX_TOKENS, AI_JOB_PAGE_SECTION_TOKENS, AI_JOB_PAGE_STEP_BUDGET, AI_JOB_PAGE_STEP_MINIMUM_MS, aiJobPageSectionMaxTokens, };
|
|
95
|
+
/**
|
|
96
|
+
* Tokens one element takes in a section's answer, ESTIMATED: the tree as JSON
|
|
97
|
+
* text inside the tool call, at four characters a token. Measured on the ten
|
|
98
|
+
* golden pages at a median of 38 and a most of 43 over their 39 sections, and
|
|
99
|
+
* `ai-job-page-evals.spec.ts` holds every golden section under it.
|
|
100
|
+
*/ export const AI_JOB_PAGE_TOKENS_PER_ELEMENT = 45;
|
|
101
|
+
/**
|
|
102
|
+
* Real tokens to every token estimated at four characters (AGL-3042). A
|
|
103
|
+
* section's ceiling is counted by the provider in its own tokens, which run
|
|
104
|
+
* above that estimate. MEASURED on the first live document run on a Free
|
|
105
|
+
* workspace (AGL-3024, test-org, 2026-09-16), as the cache read of a request
|
|
106
|
+
* over the estimate of the same cached prefix: 4,059 over 2,825 for the page
|
|
107
|
+
* plan and 6,649 over 4,310 for the layout, the higher of the two, 1.5427 —
|
|
108
|
+
* the ratio `ai-job-free-page.spec.ts` prices a Free page at. It is measured on
|
|
109
|
+
* prompt text; an answer's own is read off a recorded pass, whose output
|
|
110
|
+
* tokens the step's record keeps (`lastRuns`), beside the section it stored.
|
|
111
|
+
*/ export const AI_JOB_PAGE_REAL_TOKENS_PER_ESTIMATED = Math.max(4059 / 2825, 6649 / 4310);
|
|
112
|
+
/**
|
|
113
|
+
* Real tokens one element takes in a section's answer: the estimate at its
|
|
114
|
+
* golden most, in real tokens, rounded up — 45 × 1.5427 → 70 (AGL-3042).
|
|
115
|
+
*/ export const AI_JOB_PAGE_REAL_TOKENS_PER_ELEMENT = Math.ceil(AI_JOB_PAGE_TOKENS_PER_ELEMENT * AI_JOB_PAGE_REAL_TOKENS_PER_ESTIMATED);
|
|
116
|
+
/**
|
|
117
|
+
* The most elements a section's request asks it to keep under at an answer
|
|
118
|
+
* ceiling: 15 at the balanced tier's 1,050 (AGL-3042). Counted in real
|
|
119
|
+
* tokens, because the ceiling is: counted in the estimate, the budget is 23
|
|
120
|
+
* elements, which a section of the goldens' largest elements fills at 1,597
|
|
121
|
+
* real tokens — half as much again as the ceiling that cuts it off.
|
|
122
|
+
*/ export function aiJobPageSectionMaxElements(maxTokens) {
|
|
123
|
+
return Math.max(1, Math.floor(maxTokens / AI_JOB_PAGE_REAL_TOKENS_PER_ELEMENT));
|
|
124
|
+
}
|
|
125
|
+
/** A page's name when the plan names none. */ export const AI_JOB_PAGE_DEFAULT_NAME = 'New page';
|
|
126
|
+
export const AI_JOB_PAGE_NO_PLAN_COPY = 'This page job has no confirmed plan to build.';
|
|
127
|
+
export const AI_JOB_PAGE_DELETED_COPY = 'The draft page was deleted while it was being built.';
|
|
128
|
+
/** A creation the plan names that this deployment has no step to build. */ export const AI_JOB_PAGE_CREATION_UNAVAILABLE_COPY = 'This page needs something that cannot be built here yet. Describe the page again.';
|
|
129
|
+
/** A creation that finished without reporting what it built; the page cannot place it. */ export const AI_JOB_PAGE_CREATION_EMPTY_COPY = 'Part of this page could not be built. Describe the page again.';
|
|
130
|
+
/**
|
|
131
|
+
* What a page refused on its last pass tells the member beside the rules it
|
|
132
|
+
* broke (AGL-3143). The draft is reported with the review, and mending what
|
|
133
|
+
* the findings name in it is what lets the next pass finish the job.
|
|
134
|
+
*/ export const AI_JOB_PAGE_REFUSED_DRAFT_COPY = 'The draft is yours to open: mend what these name in it, then try again.';
|
|
135
|
+
/**
|
|
136
|
+
* The most passes a page job may take (AGL-3031): every creation the plan
|
|
137
|
+
* limits admit, every section they admit, and the last pass that reports the
|
|
138
|
+
* draft. A creation's step builds it in one pass, and a page one section a
|
|
139
|
+
* pass, so a runner that never finishes is still bounded while a real page is
|
|
140
|
+
* not.
|
|
141
|
+
*/ export const AI_JOB_PAGE_MAX_PASSES = AI_BUILD_PLAN_LIMITS.create + AI_BUILD_PLAN_LIMITS.sections + 1;
|
|
142
|
+
/**
|
|
143
|
+
* The units a plan's creations are built as, in the order a scaffold builds
|
|
144
|
+
* them: the layout, then the forms, then the components. Each is addressed by
|
|
145
|
+
* its place in the plan, so a unit run again finds its own draft.
|
|
146
|
+
*/ export function aiPageJobUnits(plan) {
|
|
147
|
+
return AI_PAGE_CREATE_KINDS.flatMap((kind)=>plan.create.flatMap((creation, index)=>{
|
|
148
|
+
if (creation.kind !== kind) return [];
|
|
149
|
+
const unit = aiCreationUnit(creation, `c${index}`);
|
|
150
|
+
return unit ? [
|
|
151
|
+
unit
|
|
152
|
+
] : [];
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The least time this page job's next pass needs (AGL-3035). A pass that
|
|
157
|
+
* builds a creation hands it to the step registered for that kind, under the
|
|
158
|
+
* job derived for it, so it needs what that step registers for that job — a
|
|
159
|
+
* layout's time, not a section's. Every other pass — a section, the last one —
|
|
160
|
+
* needs a section pass's.
|
|
161
|
+
*/ export function aiPageJobRunMinimumMs(job) {
|
|
162
|
+
var _job_outputs;
|
|
163
|
+
const confirmed = aiConfirmedPlan(job);
|
|
164
|
+
if (!confirmed) return AI_JOB_PAGE_STEP_MINIMUM_MS;
|
|
165
|
+
const units = aiPageJobUnits(confirmed);
|
|
166
|
+
const outputs = (_job_outputs = job.outputs) != null ? _job_outputs : [];
|
|
167
|
+
const [unit] = aiSitePendingUnits(units, outputs);
|
|
168
|
+
if (!unit) return AI_JOB_PAGE_STEP_MINIMUM_MS;
|
|
169
|
+
return aiJobStepRunMinimumMs(aiSiteUnitJob(job, unit, aiSiteBuiltRefs(units, outputs)));
|
|
170
|
+
}
|
|
171
|
+
/** The one-segment address a draft asks for, from the plan's slug. */ export function aiPageDraftSlug(screen) {
|
|
172
|
+
var _segments_;
|
|
173
|
+
const segments = screen.slug.split('/').map((part)=>part.trim()).filter(Boolean);
|
|
174
|
+
return (_segments_ = segments[segments.length - 1]) != null ? _segments_ : '';
|
|
175
|
+
}
|
|
176
|
+
/** A plan's listing value held to the length the SEO editor guides it to, cut at a word. */ function clip(value, max) {
|
|
177
|
+
const text = value.trim();
|
|
178
|
+
if (text.length <= max) return text;
|
|
179
|
+
const cut = text.slice(0, max + 1);
|
|
180
|
+
const space = cut.lastIndexOf(' ');
|
|
181
|
+
return (space > max / 2 ? cut.slice(0, space) : text.slice(0, max)).trim();
|
|
182
|
+
}
|
|
183
|
+
/** The site's name as its visitors see it, read the way the SEO step reads it. */ function siteNameOf(host) {
|
|
184
|
+
const text = (value)=>typeof value === 'string' ? value.trim() : '';
|
|
185
|
+
return text(host.get('seo.title')) || text(host.get('displayName')) || text(host.get('subdomain'));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The counts the confirmed plan's sections promised, against the page a COPY
|
|
189
|
+
* actually produced (AGL-3024); `null` when the copy keeps the plan, or when
|
|
190
|
+
* the plan promised no count to keep.
|
|
191
|
+
*
|
|
192
|
+
* The same hole the layout copy had (`aiCopiedLayoutReview`), on the kind the
|
|
193
|
+
* defect was measured on. This branch generates nothing, so no model ever
|
|
194
|
+
* answers for the plan: a plan reading "start from the Services page, one
|
|
195
|
+
* card per practice area" gets the Services page and whatever IT had, and
|
|
196
|
+
* until now reported `Done` — the one report that tells a customer there is
|
|
197
|
+
* no reason to re-read the page.
|
|
198
|
+
*
|
|
199
|
+
* A copy that cannot be read back settles nothing, and a promise this step
|
|
200
|
+
* cannot settle is reviewed by a person rather than reported as kept.
|
|
201
|
+
*/ export async function aiCopiedPageReview(firestore, input) {
|
|
202
|
+
var _ref;
|
|
203
|
+
if (!input.screen.sections.some((section)=>section.items >= AI_PLAN_ITEMS_MIN)) return null;
|
|
204
|
+
const stored = await readAiDraftNodes(firestore, {
|
|
205
|
+
kind: 'screen',
|
|
206
|
+
hostId: input.hostId,
|
|
207
|
+
id: input.id
|
|
208
|
+
});
|
|
209
|
+
const nodes = (_ref = stored == null ? void 0 : stored.nodes) != null ? _ref : {};
|
|
210
|
+
if (!nodes[CANVAS_ROOT_ELEMENT_ID]) {
|
|
211
|
+
return {
|
|
212
|
+
reason: 'doctrine',
|
|
213
|
+
message: `"${input.name}" was copied from the page the plan names, and this job could not read the copy back to check it shows what the plan says it shows. Open the page and check it before you put it in front of anyone.`,
|
|
214
|
+
findings: []
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const violations = aiPlanCopiedPageViolations(input.screen, {
|
|
218
|
+
rootId: CANVAS_ROOT_ELEMENT_ID,
|
|
219
|
+
nodes
|
|
220
|
+
});
|
|
221
|
+
if (!violations.length) return null;
|
|
222
|
+
return aiDoctrineReview({
|
|
223
|
+
message: `"${input.name}" is a copy of the page the plan names, and a copy is all it is: ${violations[0].message}`,
|
|
224
|
+
violations
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A page job is admitted with inputs that read, for a site of the job's own
|
|
229
|
+
* org with a screen to spare; and confirmed only for a plan it can build —
|
|
230
|
+
* one screen, whose creations are ones a page job builds, this deployment has
|
|
231
|
+
* a step for, and this workspace may still make on this site (AGL-3031).
|
|
232
|
+
*/ export const aiPageJobAdmission = async (context)=>{
|
|
233
|
+
const inputs = parseAiPageJobInputs(context.inputs);
|
|
234
|
+
if (typeof inputs === 'string') return {
|
|
235
|
+
status: 400,
|
|
236
|
+
error: inputs
|
|
237
|
+
};
|
|
238
|
+
const plan = context.plan;
|
|
239
|
+
if (plan) {
|
|
240
|
+
const refusal = aiPagePlanRefusal(plan);
|
|
241
|
+
if (refusal) return {
|
|
242
|
+
status: 400,
|
|
243
|
+
error: refusal
|
|
244
|
+
};
|
|
245
|
+
if (aiPageJobUnits(plan).some((unit)=>!aiJobStepRunnerFor(unit.jobKind))) {
|
|
246
|
+
return {
|
|
247
|
+
status: 400,
|
|
248
|
+
error: AI_JOB_PAGE_CREATION_UNAVAILABLE_COPY
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const org = context.org;
|
|
253
|
+
return aiDraftAdmissionRefusal(context.firestore, _extends({
|
|
254
|
+
orgId: context.orgId,
|
|
255
|
+
hostId: context.hostId,
|
|
256
|
+
kind: 'screen',
|
|
257
|
+
noun: 'page',
|
|
258
|
+
org
|
|
259
|
+
}, (plan == null ? void 0 : plan.create.length) ? {
|
|
260
|
+
ownCheck: async (hostId)=>{
|
|
261
|
+
const capabilities = aiPlanCapabilitiesForJob(await readAiPlanCapabilities(context.firestore, {
|
|
262
|
+
hostId,
|
|
263
|
+
org
|
|
264
|
+
}), {
|
|
265
|
+
noun: 'a page job',
|
|
266
|
+
creates: AI_PAGE_CREATE_KINDS
|
|
267
|
+
});
|
|
268
|
+
const refusal = aiPageCreationRefusal(aiPlanUncreatable(plan, capabilities));
|
|
269
|
+
return refusal ? {
|
|
270
|
+
status: 403,
|
|
271
|
+
error: refusal
|
|
272
|
+
} : null;
|
|
273
|
+
}
|
|
274
|
+
} : {}));
|
|
275
|
+
};
|
|
276
|
+
export function createAiJobPageStep(deps = {}) {
|
|
277
|
+
var _deps_readInventory, _deps_duplicate, _deps_seoFields, _deps_runnerFor;
|
|
278
|
+
const readInventory = (_deps_readInventory = deps.readInventory) != null ? _deps_readInventory : readSiteInventory;
|
|
279
|
+
const duplicate = (_deps_duplicate = deps.duplicate) != null ? _deps_duplicate : duplicateResource;
|
|
280
|
+
const seoFields = (_deps_seoFields = deps.seoFields) != null ? _deps_seoFields : generateSeoFields;
|
|
281
|
+
const runnerFor = (_deps_runnerFor = deps.runnerFor) != null ? _deps_runnerFor : aiJobStepRunnerFor;
|
|
282
|
+
return async (stepContext)=>{
|
|
283
|
+
var _ref, _job_outputs, _orgSnapshot_data, _ref1;
|
|
284
|
+
const { job, now, signal, firestore, modelFor } = stepContext;
|
|
285
|
+
const hostId = job.hostId;
|
|
286
|
+
if (!hostId) throw new Error('a page job names no site, and its admission refuses one');
|
|
287
|
+
// The switch's answer for this job, else the routing table's (AGL-2942).
|
|
288
|
+
const model = (_ref = modelFor == null ? void 0 : modelFor('job.page')) != null ? _ref : aiModelForStep('job.page');
|
|
289
|
+
const confirmed = aiConfirmedPlan(job);
|
|
290
|
+
if (!confirmed) return _extends({}, aiUnspentOutcome(model), {
|
|
291
|
+
failure: AI_JOB_PAGE_NO_PLAN_COPY
|
|
292
|
+
});
|
|
293
|
+
// The resume door refuses such a plan at confirmation; one confirmed
|
|
294
|
+
// before a site changed still stops here, before any spend.
|
|
295
|
+
const refusal = aiPagePlanRefusal(confirmed);
|
|
296
|
+
if (refusal) return _extends({}, aiUnspentOutcome(model), {
|
|
297
|
+
failure: refusal
|
|
298
|
+
});
|
|
299
|
+
// ── The creations first (AGL-3031): one a pass, by the steps that own them ──
|
|
300
|
+
const units = aiPageJobUnits(confirmed);
|
|
301
|
+
const outputs = (_job_outputs = job.outputs) != null ? _job_outputs : [];
|
|
302
|
+
const [unit] = aiSitePendingUnits(units, outputs);
|
|
303
|
+
if (unit) {
|
|
304
|
+
const runner = runnerFor(unit.jobKind);
|
|
305
|
+
if (!runner) return _extends({}, aiUnspentOutcome(model), {
|
|
306
|
+
failure: AI_JOB_PAGE_CREATION_UNAVAILABLE_COPY
|
|
307
|
+
});
|
|
308
|
+
const pass = await aiRunJobUnit(stepContext, {
|
|
309
|
+
unit,
|
|
310
|
+
units,
|
|
311
|
+
runner,
|
|
312
|
+
emptyCopy: AI_JOB_PAGE_CREATION_EMPTY_COPY
|
|
313
|
+
});
|
|
314
|
+
// A built creation is followed by the next, or by the page's first section.
|
|
315
|
+
return pass.built ? _extends({}, pass.outcome, {
|
|
316
|
+
continue: true
|
|
317
|
+
}) : pass.outcome;
|
|
318
|
+
}
|
|
319
|
+
// The page's plan with every creation resolved to the record it built, as
|
|
320
|
+
// a scaffold's page is planned against what the scaffold built.
|
|
321
|
+
const plan = units.length ? aiSiteUnitJob(job, {
|
|
322
|
+
kind: 'page',
|
|
323
|
+
jobKind: 'page',
|
|
324
|
+
resource: 'screen',
|
|
325
|
+
slot: 'page',
|
|
326
|
+
screen: confirmed.screens[0],
|
|
327
|
+
label: confirmed.screens[0].title
|
|
328
|
+
}, aiSiteBuiltRefs(units, outputs)).plan : confirmed;
|
|
329
|
+
const screen = plan.screens[0];
|
|
330
|
+
const name = screen.title || AI_JOB_PAGE_DEFAULT_NAME;
|
|
331
|
+
const slug = aiPageDraftSlug(screen);
|
|
332
|
+
const sectionIds = screen.sections.map((_, index)=>aiPageSectionNodeId(job.$id, index));
|
|
333
|
+
// The draft screen, by the id the job recorded for it: every pass writes and finds the same one.
|
|
334
|
+
const draftId = aiJobDraftId(job, 'screen');
|
|
335
|
+
const output = (draft, load, note)=>_extends({
|
|
336
|
+
resource: 'screen',
|
|
337
|
+
id: draft.id,
|
|
338
|
+
versionId: draft.versionId,
|
|
339
|
+
hostId,
|
|
340
|
+
hostSubdomain: draft.hostSubdomain,
|
|
341
|
+
label: draft.name
|
|
342
|
+
}, load ? {
|
|
343
|
+
load
|
|
344
|
+
} : {}, note ? {
|
|
345
|
+
note
|
|
346
|
+
} : {}, screen.nav ? {
|
|
347
|
+
proposal: {
|
|
348
|
+
navigation: {
|
|
349
|
+
label: name,
|
|
350
|
+
slug
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
} : {});
|
|
354
|
+
const [inventory, orgSnapshot, written] = await Promise.all([
|
|
355
|
+
readInventory(job.orgId, hostId, {
|
|
356
|
+
firestore
|
|
357
|
+
}),
|
|
358
|
+
firestore.collection('orgs').doc(job.orgId).get(),
|
|
359
|
+
readAiDraft(firestore, {
|
|
360
|
+
kind: 'screen',
|
|
361
|
+
hostId,
|
|
362
|
+
id: draftId
|
|
363
|
+
})
|
|
364
|
+
]);
|
|
365
|
+
const org = (_orgSnapshot_data = orgSnapshot.data()) != null ? _orgSnapshot_data : null;
|
|
366
|
+
if (written == null ? void 0 : written.deleted) return _extends({}, aiUnspentOutcome(model), {
|
|
367
|
+
failure: AI_JOB_PAGE_DELETED_COPY
|
|
368
|
+
});
|
|
369
|
+
// The plan starts from a copy of a screen the site has (rule 15): the copy
|
|
370
|
+
// is the draft — unrouted, as every copy is — and nothing is generated.
|
|
371
|
+
// Only a page is a page's start: a collection entry template's copy stays
|
|
372
|
+
// a template, so a plan naming one builds the page instead.
|
|
373
|
+
if (!written && screen.duplicateOf && inventory.screens.some((row)=>row.id === screen.duplicateOf && !row.template)) {
|
|
374
|
+
const copy = await duplicate('screen', {
|
|
375
|
+
orgId: job.orgId,
|
|
376
|
+
hostId,
|
|
377
|
+
sourceId: screen.duplicateOf,
|
|
378
|
+
name,
|
|
379
|
+
uid: job.createdBy,
|
|
380
|
+
org: org
|
|
381
|
+
});
|
|
382
|
+
if (copy.ok) {
|
|
383
|
+
// A copy is not a build (AGL-3024). Nothing is generated here, so
|
|
384
|
+
// whatever the plan promised BEYOND the source is in the draft only
|
|
385
|
+
// if the source already had it, and no model is left to answer for
|
|
386
|
+
// the difference — the copy itself has to.
|
|
387
|
+
const review = await aiCopiedPageReview(firestore, {
|
|
388
|
+
hostId,
|
|
389
|
+
id: copy.id,
|
|
390
|
+
name,
|
|
391
|
+
screen
|
|
392
|
+
});
|
|
393
|
+
if (review) return aiUnspentOutcome(model, {
|
|
394
|
+
review
|
|
395
|
+
});
|
|
396
|
+
const hostSubdomain = await aiSiteSubdomain(firestore, hostId);
|
|
397
|
+
return aiUnspentOutcome(model, {
|
|
398
|
+
outputs: [
|
|
399
|
+
output({
|
|
400
|
+
id: copy.id,
|
|
401
|
+
versionId: copy.versionId,
|
|
402
|
+
name: copy.name,
|
|
403
|
+
hostSubdomain
|
|
404
|
+
})
|
|
405
|
+
]
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
if (copy.ok === false && copy.status === 403) {
|
|
409
|
+
return aiUnspentOutcome(model, {
|
|
410
|
+
review: aiLimitReview(copy.error)
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const stored = written ? await readAiDraftNodes(firestore, {
|
|
415
|
+
kind: 'screen',
|
|
416
|
+
hostId,
|
|
417
|
+
id: draftId
|
|
418
|
+
}) : null;
|
|
419
|
+
if (written && !stored) return _extends({}, aiUnspentOutcome(model), {
|
|
420
|
+
failure: AI_JOB_PAGE_DELETED_COPY
|
|
421
|
+
});
|
|
422
|
+
const page = (_ref1 = stored == null ? void 0 : stored.nodes) != null ? _ref1 : aiEmptyPage();
|
|
423
|
+
const index = sectionIds.findIndex((id)=>!(id in page));
|
|
424
|
+
// A workspace that keeps no reusable components or saved forms builds its
|
|
425
|
+
// page inline, and every pass is held to the rules that way (AGL-3030).
|
|
426
|
+
const reusableComponents = checkEntitlement(org, 'reusableComponents');
|
|
427
|
+
// A link may take a visitor to a section of this page, by its name in the plan (AGL-3097).
|
|
428
|
+
const sections = screen.sections.map((section)=>section.name);
|
|
429
|
+
const context = aiPageCheckContext(inventory, {
|
|
430
|
+
reusableComponents,
|
|
431
|
+
sections
|
|
432
|
+
});
|
|
433
|
+
// ── The last pass: the whole page, its listing, and the draft reported ──
|
|
434
|
+
if (index === -1 && written) {
|
|
435
|
+
var _written_seo_title, _written_seo, _written_seo_description, _written_seo1;
|
|
436
|
+
// A link the page carries to one of its sections goes there, now every section is built.
|
|
437
|
+
const report = validateAiDoctrineTree({
|
|
438
|
+
rootId: CANVAS_ROOT_ELEMENT_ID,
|
|
439
|
+
nodes: page
|
|
440
|
+
}, 'page', _extends({}, context, {
|
|
441
|
+
scrollTargetIds: sectionIds
|
|
442
|
+
}));
|
|
443
|
+
// The facts the brief did not give, on the page or in the defaults its components show (AGL-3056).
|
|
444
|
+
const note = aiBracketedFactsNote({
|
|
445
|
+
tree: {
|
|
446
|
+
rootId: CANVAS_ROOT_ELEMENT_ID,
|
|
447
|
+
nodes: page
|
|
448
|
+
},
|
|
449
|
+
inventory
|
|
450
|
+
});
|
|
451
|
+
// The page's own draft, reported once however many times the last pass
|
|
452
|
+
// runs (AGL-3143): a refused pass reports it and a later one that
|
|
453
|
+
// passes does not report it twice.
|
|
454
|
+
const reported = outputs.some((entry)=>entry.resource === 'screen' && entry.id === draftId);
|
|
455
|
+
const reports = reported ? [] : [
|
|
456
|
+
output(written, report.load, note)
|
|
457
|
+
];
|
|
458
|
+
if (report.violations.length) {
|
|
459
|
+
var _ref2;
|
|
460
|
+
var _report_tree;
|
|
461
|
+
// The check mints its own ids; the review names the nodes by the ids the draft stores them under.
|
|
462
|
+
const storedIds = (_ref2 = (_report_tree = report.tree) == null ? void 0 : _report_tree.sourceIds) != null ? _ref2 : {};
|
|
463
|
+
const violations = report.violations.map((violation)=>violation.nodeIds ? _extends({}, violation, {
|
|
464
|
+
nodeIds: aiModelNodeIds(violation.nodeIds, storedIds)
|
|
465
|
+
}) : violation);
|
|
466
|
+
// THE DRAFT TRAVELS WITH THE REFUSAL (AGL-3143). Every other review
|
|
467
|
+
// parks on a model's answer, so trying again asks the model again and
|
|
468
|
+
// can come back different. This one reads the STORED page and spends
|
|
469
|
+
// nothing, so trying again refuses the same page for the same reasons
|
|
470
|
+
// forever — and a job parked here having reported no output names no
|
|
471
|
+
// draft at all, which leaves the member nowhere to mend the nodes the
|
|
472
|
+
// findings name and no way to finish the job from the console. The
|
|
473
|
+
// draft is reported now instead, and the job still parks: what the
|
|
474
|
+
// review names is mended in the draft, and the next pass then passes.
|
|
475
|
+
return aiUnspentOutcome(model, {
|
|
476
|
+
outputs: reports,
|
|
477
|
+
review: aiDoctrineReview({
|
|
478
|
+
message: `${aiDoctrineNeedsInputMessage(violations)} ${AI_JOB_PAGE_REFUSED_DRAFT_COPY}`,
|
|
479
|
+
violations,
|
|
480
|
+
answer: {
|
|
481
|
+
tree: {
|
|
482
|
+
rootId: CANVAS_ROOT_ELEMENT_ID,
|
|
483
|
+
nodes: page
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
})
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
let spent = aiUnspentOutcome(model);
|
|
490
|
+
if (!((_written_seo = written.seo) == null ? void 0 : (_written_seo_title = _written_seo.title) == null ? void 0 : _written_seo_title.trim()) || !((_written_seo1 = written.seo) == null ? void 0 : (_written_seo_description = _written_seo1.description) == null ? void 0 : _written_seo_description.trim())) {
|
|
491
|
+
var _ref3;
|
|
492
|
+
const seoModel = (_ref3 = modelFor == null ? void 0 : modelFor('job.seo')) != null ? _ref3 : aiModelForStep('job.seo');
|
|
493
|
+
// The plan's own listing, held to the editor's guidance, when the
|
|
494
|
+
// listing cannot be written inside this pass's time on the model the
|
|
495
|
+
// job runs.
|
|
496
|
+
let values = {
|
|
497
|
+
title: clip(screen.seoTitle, SCREEN_SEO_TEXT_GUIDANCE.title),
|
|
498
|
+
description: clip(screen.seoDescription, SCREEN_SEO_TEXT_GUIDANCE.description)
|
|
499
|
+
};
|
|
500
|
+
if (// A listing is written from the page's own text, with no inventory
|
|
501
|
+
// and so no lookup round.
|
|
502
|
+
aiGenerationWorstCaseMs({
|
|
503
|
+
maxTokens: AI_SEO_FIELDS_MAX_TOKENS,
|
|
504
|
+
model: seoModel,
|
|
505
|
+
lookups: 0
|
|
506
|
+
}) <= AI_JOB_PAGE_STEP_MINIMUM_MS) {
|
|
507
|
+
const host = await firestore.collection('hosts').doc(hostId).get();
|
|
508
|
+
const result = await seoFields(_extends({
|
|
509
|
+
subject: {
|
|
510
|
+
kind: 'screen',
|
|
511
|
+
name,
|
|
512
|
+
path: `/${slug}`
|
|
513
|
+
},
|
|
514
|
+
brand: siteNameOf(host),
|
|
515
|
+
// What the site is and who it is for (AGL-2918). The page's own
|
|
516
|
+
// Markdown says what the page is about and cannot say who it was
|
|
517
|
+
// written for, so the listing borrows the two answers the job was
|
|
518
|
+
// started from — the scaffold's derived page job carries them,
|
|
519
|
+
// and a page job started from the Screens page carries neither.
|
|
520
|
+
site: aiSiteWords(job.inputs),
|
|
521
|
+
text: buildPageMarkdown({
|
|
522
|
+
nodes: page,
|
|
523
|
+
rootId: CANVAS_ROOT_ELEMENT_ID
|
|
524
|
+
}),
|
|
525
|
+
fields: [
|
|
526
|
+
'title',
|
|
527
|
+
'description'
|
|
528
|
+
],
|
|
529
|
+
// Other screens by name only: their own listings are their content.
|
|
530
|
+
otherTitles: inventory.screens.map((row)=>row.name),
|
|
531
|
+
model: seoModel
|
|
532
|
+
}, signal ? {
|
|
533
|
+
signal
|
|
534
|
+
} : {}));
|
|
535
|
+
spent = _extends({}, spent, aiGenerationSpent(result));
|
|
536
|
+
if (result.status === 'ok') {
|
|
537
|
+
var _result_value_title, _result_value_description;
|
|
538
|
+
values = {
|
|
539
|
+
title: ((_result_value_title = result.value.title) == null ? void 0 : _result_value_title.trim()) || values.title,
|
|
540
|
+
description: ((_result_value_description = result.value.description) == null ? void 0 : _result_value_description.trim()) || values.description
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
await writeAiDraftScreenSeo(firestore, {
|
|
545
|
+
hostId,
|
|
546
|
+
id: draftId,
|
|
547
|
+
seo: values,
|
|
548
|
+
now
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
return _extends({}, spent, {
|
|
552
|
+
outputs: reports
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
// ── A section pass ──
|
|
556
|
+
if (!written) {
|
|
557
|
+
const allowance = await aiDraftAllowanceRefusal(firestore, {
|
|
558
|
+
kind: 'screen',
|
|
559
|
+
hostId,
|
|
560
|
+
org
|
|
561
|
+
});
|
|
562
|
+
if (allowance) return aiUnspentOutcome(model, {
|
|
563
|
+
review: aiLimitReview(allowance)
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
const maxTokens = aiJobPageSectionMaxTokens(model);
|
|
567
|
+
const maxElements = aiJobPageSectionMaxElements(maxTokens);
|
|
568
|
+
const result = await runValidatedGeneration('page-section', _extends({
|
|
569
|
+
step: 'job.page',
|
|
570
|
+
model,
|
|
571
|
+
instructions: AI_JOB_PAGE_INSTRUCTIONS,
|
|
572
|
+
inventory,
|
|
573
|
+
messages: [
|
|
574
|
+
{
|
|
575
|
+
role: 'user',
|
|
576
|
+
content: aiPageSectionPrompt({
|
|
577
|
+
job,
|
|
578
|
+
plan,
|
|
579
|
+
screen,
|
|
580
|
+
index,
|
|
581
|
+
maxElements,
|
|
582
|
+
reusableComponents
|
|
583
|
+
})
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
tool: AI_PAGE_SECTION_TOOL,
|
|
587
|
+
maxTokens,
|
|
588
|
+
// A section cut off at its ceiling is asked for smaller, and a member
|
|
589
|
+
// whose section still does not fit reads that it was too large (AGL-3042).
|
|
590
|
+
cutOff: {
|
|
591
|
+
noun: 'section',
|
|
592
|
+
smaller: aiPageSectionSmaller({
|
|
593
|
+
maxElements,
|
|
594
|
+
reusableComponents
|
|
595
|
+
})
|
|
596
|
+
},
|
|
597
|
+
thinking: 'off',
|
|
598
|
+
check: aiPageSectionCheck({
|
|
599
|
+
page,
|
|
600
|
+
sectionIds,
|
|
601
|
+
index,
|
|
602
|
+
context,
|
|
603
|
+
section: screen.sections[index],
|
|
604
|
+
inventory
|
|
605
|
+
})
|
|
606
|
+
}, signal ? {
|
|
607
|
+
signal
|
|
608
|
+
} : {}));
|
|
609
|
+
const spent = aiGenerationSpent(result);
|
|
610
|
+
if (result.status === 'refused') return _extends({}, spent, {
|
|
611
|
+
refused: true
|
|
612
|
+
});
|
|
613
|
+
if (result.status === 'needs_input') return _extends({}, spent, {
|
|
614
|
+
review: aiDoctrineReview(result)
|
|
615
|
+
});
|
|
616
|
+
if (!written) {
|
|
617
|
+
const draft = await writeAiDraft(firestore, {
|
|
618
|
+
kind: 'screen',
|
|
619
|
+
hostId,
|
|
620
|
+
id: draftId,
|
|
621
|
+
uid: job.createdBy,
|
|
622
|
+
org,
|
|
623
|
+
name,
|
|
624
|
+
nodes: aiPageWithSection(aiEmptyPage(), result.value, sectionIds),
|
|
625
|
+
slug,
|
|
626
|
+
layoutId: screen.layout && inventory.layouts.some((row)=>row.id === screen.layout) ? screen.layout : null,
|
|
627
|
+
now
|
|
628
|
+
});
|
|
629
|
+
if (draft.ok === false) {
|
|
630
|
+
if (draft.status === 404) throw new Error(`site ${hostId} vanished while its page was generated`);
|
|
631
|
+
return _extends({}, spent, {
|
|
632
|
+
review: aiLimitReview(draft.error)
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
} else {
|
|
636
|
+
const update = await updateAiDraftNodes(firestore, {
|
|
637
|
+
kind: 'screen',
|
|
638
|
+
hostId,
|
|
639
|
+
id: draftId,
|
|
640
|
+
now,
|
|
641
|
+
// A pass run again after its write finds its section and changes nothing.
|
|
642
|
+
update: (nodes)=>result.value.rootId in nodes ? null : aiPageWithSection(nodes, result.value, sectionIds)
|
|
643
|
+
});
|
|
644
|
+
if (update.ok === false) return _extends({}, spent, {
|
|
645
|
+
failure: AI_JOB_PAGE_DELETED_COPY
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
return _extends({}, spent, {
|
|
649
|
+
continue: true
|
|
650
|
+
});
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
export const runAiJobPageStep = createAiJobPageStep();
|
|
654
|
+
/**
|
|
655
|
+
* Registers the page step with the least time a section pass needs and the
|
|
656
|
+
* time its next pass needs, the passes a page with its creations may take, and
|
|
657
|
+
* the check a page job passes when it is created or its plan is confirmed.
|
|
658
|
+
*/ export function registerAiPageJob() {
|
|
659
|
+
registerAiJobStep('page', runAiJobPageStep, {
|
|
660
|
+
minimumMs: AI_JOB_PAGE_STEP_MINIMUM_MS,
|
|
661
|
+
minimumMsFor: aiPageJobRunMinimumMs
|
|
662
|
+
});
|
|
663
|
+
registerAiJobStepPasses('page', AI_JOB_PAGE_MAX_PASSES);
|
|
664
|
+
registerAiJobAdmission('page', aiPageJobAdmission);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
//# sourceMappingURL=ai-job-page-step.js.map
|