@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,208 @@
|
|
|
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 SeoListingFieldKey } from '@aglyn/aglyn/app-utils/seo-listing-fields';
|
|
18
|
+
import type { AiJobOutput, AiJobSummary } from './ai-jobs.types';
|
|
19
|
+
/**
|
|
20
|
+
* SEO by AI (AGL-2910): the proposals an `seo` job produces, in the shape
|
|
21
|
+
* both the job step and the console cards read. Pure data and readers — no
|
|
22
|
+
* server import — so a card can type what it renders from the same module
|
|
23
|
+
* the step writes it with.
|
|
24
|
+
*
|
|
25
|
+
* ## Proposals, never writes
|
|
26
|
+
*
|
|
27
|
+
* Every value here is a PROPOSAL. A page's search listing is served from the
|
|
28
|
+
* screen document, so a job never writes it: the values are staged in the
|
|
29
|
+
* page's SEO card and saved there. A site audit's content fixes — an image
|
|
30
|
+
* description, a page's one `h1` — become a new unpublished version only
|
|
31
|
+
* when a person applies them, and the site-wide proposals land in the SEO
|
|
32
|
+
* form unsaved. Nothing a job produces changes what a published site serves.
|
|
33
|
+
*
|
|
34
|
+
* ## The outputs of a job
|
|
35
|
+
*
|
|
36
|
+
* - `fields:{screen|product}:{id}` — one listing's values ({@link AiSeoFieldsProposal}).
|
|
37
|
+
* - `audit:report` — the site audit: every audited page, its findings and
|
|
38
|
+
* its score, and which pages need generated fixes ({@link AiSeoAuditReport}).
|
|
39
|
+
* - `audit:site` — structured data for the site's entity and the agent
|
|
40
|
+
* guidance `/llms.txt` leads with ({@link AiSeoSiteBatch}).
|
|
41
|
+
* - `audit:fixes:{n}` — one batch of page fixes ({@link AiSeoFixesBatch}).
|
|
42
|
+
*/
|
|
43
|
+
/** What an `seo` job is about, as its `inputs.target` names it. */
|
|
44
|
+
export type AiSeoTarget = 'screen' | 'product' | 'site';
|
|
45
|
+
export declare const AI_SEO_TARGETS: readonly AiSeoTarget[];
|
|
46
|
+
/** What an `seo` job is about, or `null` when its inputs name nothing an SEO job writes. */
|
|
47
|
+
export declare function aiSeoJobTarget(inputs: Record<string, unknown> | null | undefined): AiSeoTarget | null;
|
|
48
|
+
/** Proposed values for one listing, by field. */
|
|
49
|
+
export type AiSeoFieldValues = Partial<Record<SeoListingFieldKey, string>>;
|
|
50
|
+
/** Whether, and where, a page already says a target keyword. */
|
|
51
|
+
export interface AiSeoKeywordCoverage {
|
|
52
|
+
keyword: string;
|
|
53
|
+
inTitle: boolean;
|
|
54
|
+
inDescription: boolean;
|
|
55
|
+
inH1: boolean;
|
|
56
|
+
inBody: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** A proposal for one page's or one product's search listing. */
|
|
59
|
+
export interface AiSeoFieldsProposal {
|
|
60
|
+
kind: 'fields';
|
|
61
|
+
subject: {
|
|
62
|
+
kind: 'screen' | 'product';
|
|
63
|
+
/** `null` for a product not saved yet. */
|
|
64
|
+
id: string | null;
|
|
65
|
+
name: string;
|
|
66
|
+
/** The page's public path, for a screen. */
|
|
67
|
+
path?: string | null;
|
|
68
|
+
};
|
|
69
|
+
values: AiSeoFieldValues;
|
|
70
|
+
/** The target keywords the listing was asked to cover, and where it now does. */
|
|
71
|
+
keywords: AiSeoKeywordCoverage[];
|
|
72
|
+
/** Customer-safe lines worth knowing (a field left out, and why). */
|
|
73
|
+
notes: string[];
|
|
74
|
+
}
|
|
75
|
+
export type AiSeoFindingCode = 'title-missing' | 'title-too-long' | 'title-duplicate' | 'description-missing' | 'description-too-long' | 'description-duplicate' | 'h1-missing' | 'h1-multiple' | 'h1-thin' | 'image-alt-missing' | 'orphan' | 'keyword-missing' | 'search-discouraged' | 'entity-incomplete' | 'llms-guidance-missing';
|
|
76
|
+
export type AiSeoSeverity = 'high' | 'medium' | 'low';
|
|
77
|
+
export interface AiSeoFinding {
|
|
78
|
+
code: AiSeoFindingCode;
|
|
79
|
+
severity: AiSeoSeverity;
|
|
80
|
+
/** One customer-safe sentence. */
|
|
81
|
+
message: string;
|
|
82
|
+
/** The elements it is about: the images without a description, the extra headings. */
|
|
83
|
+
nodeIds?: string[];
|
|
84
|
+
/** The other pages it involves: a duplicate's twins. */
|
|
85
|
+
screenIds?: string[];
|
|
86
|
+
/** The target keyword, for `keyword-missing`. */
|
|
87
|
+
keyword?: string;
|
|
88
|
+
}
|
|
89
|
+
/** One audited page. */
|
|
90
|
+
export interface AiSeoPageReport {
|
|
91
|
+
screenId: string;
|
|
92
|
+
/** The public path, `/` for the home page. */
|
|
93
|
+
path: string;
|
|
94
|
+
name: string;
|
|
95
|
+
/** The published version the page was audited on. */
|
|
96
|
+
versionId: string | null;
|
|
97
|
+
/** 100 with nothing found, less for each finding by its severity. */
|
|
98
|
+
score: number;
|
|
99
|
+
findings: AiSeoFinding[];
|
|
100
|
+
keywords: AiSeoKeywordCoverage[];
|
|
101
|
+
}
|
|
102
|
+
/** The site audit: every audited page, what was found, and what still needs generating. */
|
|
103
|
+
export interface AiSeoAuditReport {
|
|
104
|
+
kind: 'audit';
|
|
105
|
+
pages: AiSeoPageReport[];
|
|
106
|
+
/** Published pages past the audit's page cap, not audited. */
|
|
107
|
+
skipped: number;
|
|
108
|
+
/** Findings about the site rather than a page. */
|
|
109
|
+
site: AiSeoFinding[];
|
|
110
|
+
/** Whether the site-wide proposal (structured data, agent guidance) is owed. */
|
|
111
|
+
siteProposal: boolean;
|
|
112
|
+
/** Pages whose fixes need generated text, in the order the batches take them. */
|
|
113
|
+
queue: string[];
|
|
114
|
+
/** How many pages one batch of fixes carries. */
|
|
115
|
+
batchSize: number;
|
|
116
|
+
/** The average page score. */
|
|
117
|
+
score: number;
|
|
118
|
+
/** Customer-safe lines about the audit itself: a keyword line naming no page, say. */
|
|
119
|
+
notes: string[];
|
|
120
|
+
}
|
|
121
|
+
/** A content fix: applied into a NEW version of the page, never the published one. */
|
|
122
|
+
export type AiSeoContentFix =
|
|
123
|
+
/** An image with no description gets one. */
|
|
124
|
+
{
|
|
125
|
+
kind: 'image-alt';
|
|
126
|
+
nodeId: string;
|
|
127
|
+
alt: string;
|
|
128
|
+
}
|
|
129
|
+
/** An existing heading becomes the page's `h1`, with this text. */
|
|
130
|
+
| {
|
|
131
|
+
kind: 'h1-set';
|
|
132
|
+
nodeId: string;
|
|
133
|
+
text: string;
|
|
134
|
+
}
|
|
135
|
+
/** A page with no heading to promote gets a new `h1` at the top of its content. */
|
|
136
|
+
| {
|
|
137
|
+
kind: 'h1-insert';
|
|
138
|
+
text: string;
|
|
139
|
+
}
|
|
140
|
+
/** An extra `h1` becomes an `h2`, so the page keeps one. */
|
|
141
|
+
| {
|
|
142
|
+
kind: 'h1-demote';
|
|
143
|
+
nodeId: string;
|
|
144
|
+
};
|
|
145
|
+
/** Everything proposed for one page. */
|
|
146
|
+
export interface AiSeoPageFix {
|
|
147
|
+
screenId: string;
|
|
148
|
+
/** Listing values, staged in the page's SEO card and saved there. */
|
|
149
|
+
values: AiSeoFieldValues;
|
|
150
|
+
content: AiSeoContentFix[];
|
|
151
|
+
/** Findings with no fix a job can make — an orphan needs a person's link. */
|
|
152
|
+
guidance: string[];
|
|
153
|
+
}
|
|
154
|
+
export interface AiSeoFixesBatch {
|
|
155
|
+
kind: 'fixes';
|
|
156
|
+
/** 1-based. */
|
|
157
|
+
batch: number;
|
|
158
|
+
fixes: AiSeoPageFix[];
|
|
159
|
+
notes: string[];
|
|
160
|
+
}
|
|
161
|
+
/** The site's structured-data fields a proposal may fill, by form field name. */
|
|
162
|
+
export declare const AI_SEO_ENTITY_FORM_FIELDS: readonly ["seo.entity.type", "seo.entity.name", "seo.entity.description", "seo.entity.email", "seo.entity.telephone", "seo.entity.contactType"];
|
|
163
|
+
/** The agent guidance fields `/llms.txt` leads with, by form field name. */
|
|
164
|
+
export declare const AI_SEO_AGENT_FORM_FIELDS: readonly ["seo.agent.whenToUse", "seo.agent.howToUse"];
|
|
165
|
+
export type AiSeoSiteFormField = (typeof AI_SEO_ENTITY_FORM_FIELDS)[number] | (typeof AI_SEO_AGENT_FORM_FIELDS)[number];
|
|
166
|
+
export interface AiSeoSiteProposal {
|
|
167
|
+
/** Values for the site SEO form, by field name; only what the site's pages support. */
|
|
168
|
+
values: Partial<Record<AiSeoSiteFormField, string>>;
|
|
169
|
+
/** `/llms.txt` as it would read once the guidance is saved. */
|
|
170
|
+
llmsPreview: string;
|
|
171
|
+
notes: string[];
|
|
172
|
+
}
|
|
173
|
+
export interface AiSeoSiteBatch {
|
|
174
|
+
kind: 'site';
|
|
175
|
+
site: AiSeoSiteProposal;
|
|
176
|
+
}
|
|
177
|
+
export type AiSeoProposal = AiSeoFieldsProposal | AiSeoAuditReport | AiSeoFixesBatch | AiSeoSiteBatch;
|
|
178
|
+
/** Output ids, one place. */
|
|
179
|
+
export declare const AI_SEO_OUTPUT_IDS: {
|
|
180
|
+
readonly report: "audit:report";
|
|
181
|
+
readonly site: "audit:site";
|
|
182
|
+
readonly fixes: (batch: number) => string;
|
|
183
|
+
readonly fields: (kind: "screen" | "product", id: string | null) => string;
|
|
184
|
+
};
|
|
185
|
+
/** What each finding is called where it is listed. */
|
|
186
|
+
export declare const AI_SEO_FINDING_LABELS: Record<AiSeoFindingCode, string>;
|
|
187
|
+
/** A stored proposal, or `null` for anything that is not one. */
|
|
188
|
+
export declare function readAiSeoProposal(value: unknown): AiSeoProposal | null;
|
|
189
|
+
/** One site audit, put back together from a job's outputs. */
|
|
190
|
+
export interface AiSeoAuditView {
|
|
191
|
+
report: AiSeoAuditReport;
|
|
192
|
+
/** Every page fix proposed so far, by screen id. */
|
|
193
|
+
fixes: Record<string, AiSeoPageFix>;
|
|
194
|
+
site: AiSeoSiteProposal | null;
|
|
195
|
+
/** Batches recorded so far. */
|
|
196
|
+
batches: number;
|
|
197
|
+
/** Whether every batch the report queued has been recorded. */
|
|
198
|
+
complete: boolean;
|
|
199
|
+
}
|
|
200
|
+
/** The audit a job's outputs describe, or `null` when they describe none. */
|
|
201
|
+
export declare function aiSeoAuditView(outputs: readonly AiJobOutput[]): AiSeoAuditView | null;
|
|
202
|
+
/** The listing proposal a job produced, when it produced one. */
|
|
203
|
+
export declare function aiSeoFieldsProposalOf(job: Pick<AiJobSummary, 'outputs'> | null): AiSeoFieldsProposal | null;
|
|
204
|
+
/** How many content fixes, and how many staged listings, an audit view would apply. */
|
|
205
|
+
export declare function aiSeoApplyCounts(view: AiSeoAuditView): {
|
|
206
|
+
pagesWithContent: number;
|
|
207
|
+
pagesWithValues: number;
|
|
208
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { isSeoListingFieldKey } from "@aglyn/aglyn/app-utils/seo-listing-fields";
|
|
17
|
+
export const AI_SEO_TARGETS = [
|
|
18
|
+
'screen',
|
|
19
|
+
'product',
|
|
20
|
+
'site'
|
|
21
|
+
];
|
|
22
|
+
/** What an `seo` job is about, or `null` when its inputs name nothing an SEO job writes. */ export function aiSeoJobTarget(inputs) {
|
|
23
|
+
const target = inputs == null ? void 0 : inputs['target'];
|
|
24
|
+
return typeof target === 'string' && AI_SEO_TARGETS.includes(target) ? target : null;
|
|
25
|
+
}
|
|
26
|
+
/** The site's structured-data fields a proposal may fill, by form field name. */ export const AI_SEO_ENTITY_FORM_FIELDS = [
|
|
27
|
+
'seo.entity.type',
|
|
28
|
+
'seo.entity.name',
|
|
29
|
+
'seo.entity.description',
|
|
30
|
+
'seo.entity.email',
|
|
31
|
+
'seo.entity.telephone',
|
|
32
|
+
'seo.entity.contactType'
|
|
33
|
+
];
|
|
34
|
+
/** The agent guidance fields `/llms.txt` leads with, by form field name. */ export const AI_SEO_AGENT_FORM_FIELDS = [
|
|
35
|
+
'seo.agent.whenToUse',
|
|
36
|
+
'seo.agent.howToUse'
|
|
37
|
+
];
|
|
38
|
+
/** Output ids, one place. */ export const AI_SEO_OUTPUT_IDS = {
|
|
39
|
+
report: 'audit:report',
|
|
40
|
+
site: 'audit:site',
|
|
41
|
+
fixes: (batch)=>`audit:fixes:${batch}`,
|
|
42
|
+
fields: (kind, id)=>`fields:${kind}:${id != null ? id : 'new'}`
|
|
43
|
+
};
|
|
44
|
+
/** What each finding is called where it is listed. */ export const AI_SEO_FINDING_LABELS = {
|
|
45
|
+
'title-missing': 'No search title',
|
|
46
|
+
'title-too-long': 'Title too long',
|
|
47
|
+
'title-duplicate': 'Title used on another page',
|
|
48
|
+
'description-missing': 'No search description',
|
|
49
|
+
'description-too-long': 'Description too long',
|
|
50
|
+
'description-duplicate': 'Description used on another page',
|
|
51
|
+
'h1-missing': 'No main heading',
|
|
52
|
+
'h1-multiple': 'More than one main heading',
|
|
53
|
+
'h1-thin': 'Main heading says little',
|
|
54
|
+
'image-alt-missing': 'Images without a description',
|
|
55
|
+
orphan: 'No page links here',
|
|
56
|
+
'keyword-missing': 'Target keyword not covered',
|
|
57
|
+
'search-discouraged': 'Search engines are discouraged',
|
|
58
|
+
'entity-incomplete': 'Structured data incomplete',
|
|
59
|
+
'llms-guidance-missing': 'No guidance for AI agents'
|
|
60
|
+
};
|
|
61
|
+
const isRecord = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
62
|
+
const strings = (value)=>Array.isArray(value) ? value.filter((entry)=>typeof entry === 'string') : [];
|
|
63
|
+
function readValues(value) {
|
|
64
|
+
const out = {};
|
|
65
|
+
if (!isRecord(value)) return out;
|
|
66
|
+
for (const [key, entry] of Object.entries(value)){
|
|
67
|
+
if (isSeoListingFieldKey(key) && typeof entry === 'string') out[key] = entry;
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
/** A stored proposal, or `null` for anything that is not one. */ export function readAiSeoProposal(value) {
|
|
72
|
+
if (!isRecord(value)) return null;
|
|
73
|
+
switch(value['kind']){
|
|
74
|
+
case 'fields':
|
|
75
|
+
{
|
|
76
|
+
var _subject_name;
|
|
77
|
+
const subject = isRecord(value['subject']) ? value['subject'] : null;
|
|
78
|
+
if (!subject || subject['kind'] !== 'screen' && subject['kind'] !== 'product') return null;
|
|
79
|
+
return {
|
|
80
|
+
kind: 'fields',
|
|
81
|
+
subject: {
|
|
82
|
+
kind: subject['kind'],
|
|
83
|
+
id: typeof subject['id'] === 'string' ? subject['id'] : null,
|
|
84
|
+
name: String((_subject_name = subject['name']) != null ? _subject_name : ''),
|
|
85
|
+
path: typeof subject['path'] === 'string' ? subject['path'] : null
|
|
86
|
+
},
|
|
87
|
+
values: readValues(value['values']),
|
|
88
|
+
keywords: Array.isArray(value['keywords']) ? value['keywords'] : [],
|
|
89
|
+
notes: strings(value['notes'])
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case 'audit':
|
|
93
|
+
return Array.isArray(value['pages']) ? value : null;
|
|
94
|
+
case 'fixes':
|
|
95
|
+
return Array.isArray(value['fixes']) ? value : null;
|
|
96
|
+
case 'site':
|
|
97
|
+
return isRecord(value['site']) ? value : null;
|
|
98
|
+
default:
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** The audit a job's outputs describe, or `null` when they describe none. */ export function aiSeoAuditView(outputs) {
|
|
103
|
+
let report = null;
|
|
104
|
+
let site = null;
|
|
105
|
+
const fixes = {};
|
|
106
|
+
let batches = 0;
|
|
107
|
+
for (const output of outputs){
|
|
108
|
+
if (output.resource !== 'seo') continue;
|
|
109
|
+
const proposal = readAiSeoProposal(output.proposal);
|
|
110
|
+
if (!proposal) continue;
|
|
111
|
+
if (proposal.kind === 'audit') report = proposal;
|
|
112
|
+
else if (proposal.kind === 'site') site = proposal.site;
|
|
113
|
+
else if (proposal.kind === 'fixes') {
|
|
114
|
+
batches += 1;
|
|
115
|
+
for (const fix of proposal.fixes)fixes[fix.screenId] = fix;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (!report) return null;
|
|
119
|
+
const owedBatches = Math.ceil(report.queue.length / Math.max(1, report.batchSize));
|
|
120
|
+
return {
|
|
121
|
+
report,
|
|
122
|
+
fixes,
|
|
123
|
+
site,
|
|
124
|
+
batches,
|
|
125
|
+
complete: batches >= owedBatches && (!report.siteProposal || site !== null)
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** The listing proposal a job produced, when it produced one. */ export function aiSeoFieldsProposalOf(job) {
|
|
129
|
+
var _ref;
|
|
130
|
+
for (const output of (_ref = job == null ? void 0 : job.outputs) != null ? _ref : []){
|
|
131
|
+
if (output.resource !== 'seo') continue;
|
|
132
|
+
const proposal = readAiSeoProposal(output.proposal);
|
|
133
|
+
if ((proposal == null ? void 0 : proposal.kind) === 'fields') return proposal;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
/** How many content fixes, and how many staged listings, an audit view would apply. */ export function aiSeoApplyCounts(view) {
|
|
138
|
+
let pagesWithContent = 0;
|
|
139
|
+
let pagesWithValues = 0;
|
|
140
|
+
for (const fix of Object.values(view.fixes)){
|
|
141
|
+
if (fix.content.length) pagesWithContent += 1;
|
|
142
|
+
if (Object.keys(fix.values).length) pagesWithValues += 1;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
pagesWithContent,
|
|
146
|
+
pagesWithValues
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=ai-seo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-seo.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 isSeoListingFieldKey,\n type SeoListingFieldKey,\n} from '@aglyn/aglyn/app-utils/seo-listing-fields'\nimport type { AiJobOutput, AiJobSummary } from './ai-jobs.types'\n\n/**\n * SEO by AI (AGL-2910): the proposals an `seo` job produces, in the shape\n * both the job step and the console cards read. Pure data and readers — no\n * server import — so a card can type what it renders from the same module\n * the step writes it with.\n *\n * ## Proposals, never writes\n *\n * Every value here is a PROPOSAL. A page's search listing is served from the\n * screen document, so a job never writes it: the values are staged in the\n * page's SEO card and saved there. A site audit's content fixes — an image\n * description, a page's one `h1` — become a new unpublished version only\n * when a person applies them, and the site-wide proposals land in the SEO\n * form unsaved. Nothing a job produces changes what a published site serves.\n *\n * ## The outputs of a job\n *\n * - `fields:{screen|product}:{id}` — one listing's values ({@link AiSeoFieldsProposal}).\n * - `audit:report` — the site audit: every audited page, its findings and\n * its score, and which pages need generated fixes ({@link AiSeoAuditReport}).\n * - `audit:site` — structured data for the site's entity and the agent\n * guidance `/llms.txt` leads with ({@link AiSeoSiteBatch}).\n * - `audit:fixes:{n}` — one batch of page fixes ({@link AiSeoFixesBatch}).\n */\n\n/** What an `seo` job is about, as its `inputs.target` names it. */\nexport type AiSeoTarget = 'screen' | 'product' | 'site'\n\nexport const AI_SEO_TARGETS: readonly AiSeoTarget[] = ['screen', 'product', 'site']\n\n/** What an `seo` job is about, or `null` when its inputs name nothing an SEO job writes. */\nexport function aiSeoJobTarget(inputs: Record<string, unknown> | null | undefined): AiSeoTarget | null {\n const target = inputs?.['target']\n return typeof target === 'string' && (AI_SEO_TARGETS as readonly string[]).includes(target)\n ? (target as AiSeoTarget)\n : null\n}\n\n/** Proposed values for one listing, by field. */\nexport type AiSeoFieldValues = Partial<Record<SeoListingFieldKey, string>>\n\n/** Whether, and where, a page already says a target keyword. */\nexport interface AiSeoKeywordCoverage {\n keyword: string\n inTitle: boolean\n inDescription: boolean\n inH1: boolean\n inBody: boolean\n}\n\n/** A proposal for one page's or one product's search listing. */\nexport interface AiSeoFieldsProposal {\n kind: 'fields'\n subject: {\n kind: 'screen' | 'product'\n /** `null` for a product not saved yet. */\n id: string | null\n name: string\n /** The page's public path, for a screen. */\n path?: string | null\n }\n values: AiSeoFieldValues\n /** The target keywords the listing was asked to cover, and where it now does. */\n keywords: AiSeoKeywordCoverage[]\n /** Customer-safe lines worth knowing (a field left out, and why). */\n notes: string[]\n}\n\nexport type AiSeoFindingCode =\n | 'title-missing'\n | 'title-too-long'\n | 'title-duplicate'\n | 'description-missing'\n | 'description-too-long'\n | 'description-duplicate'\n | 'h1-missing'\n | 'h1-multiple'\n | 'h1-thin'\n | 'image-alt-missing'\n | 'orphan'\n | 'keyword-missing'\n | 'search-discouraged'\n | 'entity-incomplete'\n | 'llms-guidance-missing'\n\nexport type AiSeoSeverity = 'high' | 'medium' | 'low'\n\nexport interface AiSeoFinding {\n code: AiSeoFindingCode\n severity: AiSeoSeverity\n /** One customer-safe sentence. */\n message: string\n /** The elements it is about: the images without a description, the extra headings. */\n nodeIds?: string[]\n /** The other pages it involves: a duplicate's twins. */\n screenIds?: string[]\n /** The target keyword, for `keyword-missing`. */\n keyword?: string\n}\n\n/** One audited page. */\nexport interface AiSeoPageReport {\n screenId: string\n /** The public path, `/` for the home page. */\n path: string\n name: string\n /** The published version the page was audited on. */\n versionId: string | null\n /** 100 with nothing found, less for each finding by its severity. */\n score: number\n findings: AiSeoFinding[]\n keywords: AiSeoKeywordCoverage[]\n}\n\n/** The site audit: every audited page, what was found, and what still needs generating. */\nexport interface AiSeoAuditReport {\n kind: 'audit'\n pages: AiSeoPageReport[]\n /** Published pages past the audit's page cap, not audited. */\n skipped: number\n /** Findings about the site rather than a page. */\n site: AiSeoFinding[]\n /** Whether the site-wide proposal (structured data, agent guidance) is owed. */\n siteProposal: boolean\n /** Pages whose fixes need generated text, in the order the batches take them. */\n queue: string[]\n /** How many pages one batch of fixes carries. */\n batchSize: number\n /** The average page score. */\n score: number\n /** Customer-safe lines about the audit itself: a keyword line naming no page, say. */\n notes: string[]\n}\n\n/** A content fix: applied into a NEW version of the page, never the published one. */\nexport type AiSeoContentFix =\n /** An image with no description gets one. */\n | { kind: 'image-alt'; nodeId: string; alt: string }\n /** An existing heading becomes the page's `h1`, with this text. */\n | { kind: 'h1-set'; nodeId: string; text: string }\n /** A page with no heading to promote gets a new `h1` at the top of its content. */\n | { kind: 'h1-insert'; text: string }\n /** An extra `h1` becomes an `h2`, so the page keeps one. */\n | { kind: 'h1-demote'; nodeId: string }\n\n/** Everything proposed for one page. */\nexport interface AiSeoPageFix {\n screenId: string\n /** Listing values, staged in the page's SEO card and saved there. */\n values: AiSeoFieldValues\n content: AiSeoContentFix[]\n /** Findings with no fix a job can make — an orphan needs a person's link. */\n guidance: string[]\n}\n\nexport interface AiSeoFixesBatch {\n kind: 'fixes'\n /** 1-based. */\n batch: number\n fixes: AiSeoPageFix[]\n notes: string[]\n}\n\n/** The site's structured-data fields a proposal may fill, by form field name. */\nexport const AI_SEO_ENTITY_FORM_FIELDS = [\n 'seo.entity.type',\n 'seo.entity.name',\n 'seo.entity.description',\n 'seo.entity.email',\n 'seo.entity.telephone',\n 'seo.entity.contactType',\n] as const\n\n/** The agent guidance fields `/llms.txt` leads with, by form field name. */\nexport const AI_SEO_AGENT_FORM_FIELDS = ['seo.agent.whenToUse', 'seo.agent.howToUse'] as const\n\nexport type AiSeoSiteFormField =\n | (typeof AI_SEO_ENTITY_FORM_FIELDS)[number]\n | (typeof AI_SEO_AGENT_FORM_FIELDS)[number]\n\nexport interface AiSeoSiteProposal {\n /** Values for the site SEO form, by field name; only what the site's pages support. */\n values: Partial<Record<AiSeoSiteFormField, string>>\n /** `/llms.txt` as it would read once the guidance is saved. */\n llmsPreview: string\n notes: string[]\n}\n\nexport interface AiSeoSiteBatch {\n kind: 'site'\n site: AiSeoSiteProposal\n}\n\nexport type AiSeoProposal =\n | AiSeoFieldsProposal\n | AiSeoAuditReport\n | AiSeoFixesBatch\n | AiSeoSiteBatch\n\n/** Output ids, one place. */\nexport const AI_SEO_OUTPUT_IDS = {\n report: 'audit:report',\n site: 'audit:site',\n fixes: (batch: number) => `audit:fixes:${batch}`,\n fields: (kind: 'screen' | 'product', id: string | null) => `fields:${kind}:${id ?? 'new'}`,\n} as const\n\n/** What each finding is called where it is listed. */\nexport const AI_SEO_FINDING_LABELS: Record<AiSeoFindingCode, string> = {\n 'title-missing': 'No search title',\n 'title-too-long': 'Title too long',\n 'title-duplicate': 'Title used on another page',\n 'description-missing': 'No search description',\n 'description-too-long': 'Description too long',\n 'description-duplicate': 'Description used on another page',\n 'h1-missing': 'No main heading',\n 'h1-multiple': 'More than one main heading',\n 'h1-thin': 'Main heading says little',\n 'image-alt-missing': 'Images without a description',\n orphan: 'No page links here',\n 'keyword-missing': 'Target keyword not covered',\n 'search-discouraged': 'Search engines are discouraged',\n 'entity-incomplete': 'Structured data incomplete',\n 'llms-guidance-missing': 'No guidance for AI agents',\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst strings = (value: unknown): string[] =>\n Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === 'string') : []\n\nfunction readValues(value: unknown): AiSeoFieldValues {\n const out: AiSeoFieldValues = {}\n if (!isRecord(value)) return out\n for (const [key, entry] of Object.entries(value)) {\n if (isSeoListingFieldKey(key) && typeof entry === 'string') out[key] = entry\n }\n return out\n}\n\n/** A stored proposal, or `null` for anything that is not one. */\nexport function readAiSeoProposal(value: unknown): AiSeoProposal | null {\n if (!isRecord(value)) return null\n switch (value['kind']) {\n case 'fields': {\n const subject = isRecord(value['subject']) ? value['subject'] : null\n if (!subject || (subject['kind'] !== 'screen' && subject['kind'] !== 'product')) return null\n return {\n kind: 'fields',\n subject: {\n kind: subject['kind'],\n id: typeof subject['id'] === 'string' ? subject['id'] : null,\n name: String(subject['name'] ?? ''),\n path: typeof subject['path'] === 'string' ? subject['path'] : null,\n },\n values: readValues(value['values']),\n keywords: Array.isArray(value['keywords']) ? (value['keywords'] as AiSeoKeywordCoverage[]) : [],\n notes: strings(value['notes']),\n }\n }\n case 'audit':\n return Array.isArray(value['pages']) ? (value as unknown as AiSeoAuditReport) : null\n case 'fixes':\n return Array.isArray(value['fixes']) ? (value as unknown as AiSeoFixesBatch) : null\n case 'site':\n return isRecord(value['site']) ? (value as unknown as AiSeoSiteBatch) : null\n default:\n return null\n }\n}\n\n/** One site audit, put back together from a job's outputs. */\nexport interface AiSeoAuditView {\n report: AiSeoAuditReport\n /** Every page fix proposed so far, by screen id. */\n fixes: Record<string, AiSeoPageFix>\n site: AiSeoSiteProposal | null\n /** Batches recorded so far. */\n batches: number\n /** Whether every batch the report queued has been recorded. */\n complete: boolean\n}\n\n/** The audit a job's outputs describe, or `null` when they describe none. */\nexport function aiSeoAuditView(outputs: readonly AiJobOutput[]): AiSeoAuditView | null {\n let report: AiSeoAuditReport | null = null\n let site: AiSeoSiteProposal | null = null\n const fixes: Record<string, AiSeoPageFix> = {}\n let batches = 0\n for (const output of outputs) {\n if (output.resource !== 'seo') continue\n const proposal = readAiSeoProposal(output.proposal)\n if (!proposal) continue\n if (proposal.kind === 'audit') report = proposal\n else if (proposal.kind === 'site') site = proposal.site\n else if (proposal.kind === 'fixes') {\n batches += 1\n for (const fix of proposal.fixes) fixes[fix.screenId] = fix\n }\n }\n if (!report) return null\n const owedBatches = Math.ceil(report.queue.length / Math.max(1, report.batchSize))\n return {\n report,\n fixes,\n site,\n batches,\n complete: batches >= owedBatches && (!report.siteProposal || site !== null),\n }\n}\n\n/** The listing proposal a job produced, when it produced one. */\nexport function aiSeoFieldsProposalOf(job: Pick<AiJobSummary, 'outputs'> | null): AiSeoFieldsProposal | null {\n for (const output of job?.outputs ?? []) {\n if (output.resource !== 'seo') continue\n const proposal = readAiSeoProposal(output.proposal)\n if (proposal?.kind === 'fields') return proposal\n }\n return null\n}\n\n/** How many content fixes, and how many staged listings, an audit view would apply. */\nexport function aiSeoApplyCounts(view: AiSeoAuditView): { pagesWithContent: number; pagesWithValues: number } {\n let pagesWithContent = 0\n let pagesWithValues = 0\n for (const fix of Object.values(view.fixes)) {\n if (fix.content.length) pagesWithContent += 1\n if (Object.keys(fix.values).length) pagesWithValues += 1\n }\n return { pagesWithContent, pagesWithValues }\n}\n"],"names":["isSeoListingFieldKey","AI_SEO_TARGETS","aiSeoJobTarget","inputs","target","includes","AI_SEO_ENTITY_FORM_FIELDS","AI_SEO_AGENT_FORM_FIELDS","AI_SEO_OUTPUT_IDS","report","site","fixes","batch","fields","kind","id","AI_SEO_FINDING_LABELS","orphan","isRecord","value","Array","isArray","strings","filter","entry","readValues","out","key","Object","entries","readAiSeoProposal","subject","name","String","path","values","keywords","notes","aiSeoAuditView","outputs","batches","output","resource","proposal","fix","screenId","owedBatches","Math","ceil","queue","length","max","batchSize","complete","siteProposal","aiSeoFieldsProposalOf","job","aiSeoApplyCounts","view","pagesWithContent","pagesWithValues","content","keys"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,oBAAoB,QAEf,4CAA2C;AA+BlD,OAAO,MAAMC,iBAAyC;IAAC;IAAU;IAAW;CAAO,CAAA;AAEnF,0FAA0F,GAC1F,OAAO,SAASC,eAAeC,MAAkD;IAC/E,MAAMC,SAASD,0BAAAA,MAAQ,CAAC,SAAS;IACjC,OAAO,OAAOC,WAAW,YAAY,AAACH,eAAqCI,QAAQ,CAACD,UAC/EA,SACD;AACN;AA+HA,+EAA+E,GAC/E,OAAO,MAAME,4BAA4B;IACvC;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAEV,0EAA0E,GAC1E,OAAO,MAAMC,2BAA2B;IAAC;IAAuB;CAAqB,CAAS;AAyB9F,2BAA2B,GAC3B,OAAO,MAAMC,oBAAoB;IAC/BC,QAAQ;IACRC,MAAM;IACNC,OAAO,CAACC,QAAkB,CAAC,YAAY,EAAEA,OAAO;IAChDC,QAAQ,CAACC,MAA4BC,KAAsB,CAAC,OAAO,EAAED,KAAK,CAAC,EAAEC,aAAAA,KAAM,OAAO;AAC5F,EAAU;AAEV,oDAAoD,GACpD,OAAO,MAAMC,wBAA0D;IACrE,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,cAAc;IACd,eAAe;IACf,WAAW;IACX,qBAAqB;IACrBC,QAAQ;IACR,mBAAmB;IACnB,sBAAsB;IACtB,qBAAqB;IACrB,yBAAyB;AAC3B,EAAC;AAED,MAAMC,WAAW,CAACC,QAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACC,MAAMC,OAAO,CAACF;AAEhE,MAAMG,UAAU,CAACH,QACfC,MAAMC,OAAO,CAACF,SAASA,MAAMI,MAAM,CAAC,CAACC,QAA2B,OAAOA,UAAU,YAAY,EAAE;AAEjG,SAASC,WAAWN,KAAc;IAChC,MAAMO,MAAwB,CAAC;IAC/B,IAAI,CAACR,SAASC,QAAQ,OAAOO;IAC7B,KAAK,MAAM,CAACC,KAAKH,MAAM,IAAII,OAAOC,OAAO,CAACV,OAAQ;QAChD,IAAInB,qBAAqB2B,QAAQ,OAAOH,UAAU,UAAUE,GAAG,CAACC,IAAI,GAAGH;IACzE;IACA,OAAOE;AACT;AAEA,+DAA+D,GAC/D,OAAO,SAASI,kBAAkBX,KAAc;IAC9C,IAAI,CAACD,SAASC,QAAQ,OAAO;IAC7B,OAAQA,KAAK,CAAC,OAAO;QACnB,KAAK;YAAU;oBAQIY;gBAPjB,MAAMA,UAAUb,SAASC,KAAK,CAAC,UAAU,IAAIA,KAAK,CAAC,UAAU,GAAG;gBAChE,IAAI,CAACY,WAAYA,OAAO,CAAC,OAAO,KAAK,YAAYA,OAAO,CAAC,OAAO,KAAK,WAAY,OAAO;gBACxF,OAAO;oBACLjB,MAAM;oBACNiB,SAAS;wBACPjB,MAAMiB,OAAO,CAAC,OAAO;wBACrBhB,IAAI,OAAOgB,OAAO,CAAC,KAAK,KAAK,WAAWA,OAAO,CAAC,KAAK,GAAG;wBACxDC,MAAMC,QAAOF,gBAAAA,OAAO,CAAC,OAAO,YAAfA,gBAAmB;wBAChCG,MAAM,OAAOH,OAAO,CAAC,OAAO,KAAK,WAAWA,OAAO,CAAC,OAAO,GAAG;oBAChE;oBACAI,QAAQV,WAAWN,KAAK,CAAC,SAAS;oBAClCiB,UAAUhB,MAAMC,OAAO,CAACF,KAAK,CAAC,WAAW,IAAKA,KAAK,CAAC,WAAW,GAA8B,EAAE;oBAC/FkB,OAAOf,QAAQH,KAAK,CAAC,QAAQ;gBAC/B;YACF;QACA,KAAK;YACH,OAAOC,MAAMC,OAAO,CAACF,KAAK,CAAC,QAAQ,IAAKA,QAAwC;QAClF,KAAK;YACH,OAAOC,MAAMC,OAAO,CAACF,KAAK,CAAC,QAAQ,IAAKA,QAAuC;QACjF,KAAK;YACH,OAAOD,SAASC,KAAK,CAAC,OAAO,IAAKA,QAAsC;QAC1E;YACE,OAAO;IACX;AACF;AAcA,2EAA2E,GAC3E,OAAO,SAASmB,eAAeC,OAA+B;IAC5D,IAAI9B,SAAkC;IACtC,IAAIC,OAAiC;IACrC,MAAMC,QAAsC,CAAC;IAC7C,IAAI6B,UAAU;IACd,KAAK,MAAMC,UAAUF,QAAS;QAC5B,IAAIE,OAAOC,QAAQ,KAAK,OAAO;QAC/B,MAAMC,WAAWb,kBAAkBW,OAAOE,QAAQ;QAClD,IAAI,CAACA,UAAU;QACf,IAAIA,SAAS7B,IAAI,KAAK,SAASL,SAASkC;aACnC,IAAIA,SAAS7B,IAAI,KAAK,QAAQJ,OAAOiC,SAASjC,IAAI;aAClD,IAAIiC,SAAS7B,IAAI,KAAK,SAAS;YAClC0B,WAAW;YACX,KAAK,MAAMI,OAAOD,SAAShC,KAAK,CAAEA,KAAK,CAACiC,IAAIC,QAAQ,CAAC,GAAGD;QAC1D;IACF;IACA,IAAI,CAACnC,QAAQ,OAAO;IACpB,MAAMqC,cAAcC,KAAKC,IAAI,CAACvC,OAAOwC,KAAK,CAACC,MAAM,GAAGH,KAAKI,GAAG,CAAC,GAAG1C,OAAO2C,SAAS;IAChF,OAAO;QACL3C;QACAE;QACAD;QACA8B;QACAa,UAAUb,WAAWM,eAAgB,CAAA,CAACrC,OAAO6C,YAAY,IAAI5C,SAAS,IAAG;IAC3E;AACF;AAEA,+DAA+D,GAC/D,OAAO,SAAS6C,sBAAsBC,GAAyC;;IAC7E,KAAK,MAAMf,kBAAUe,uBAAAA,IAAKjB,OAAO,mBAAI,EAAE,CAAE;QACvC,IAAIE,OAAOC,QAAQ,KAAK,OAAO;QAC/B,MAAMC,WAAWb,kBAAkBW,OAAOE,QAAQ;QAClD,IAAIA,CAAAA,4BAAAA,SAAU7B,IAAI,MAAK,UAAU,OAAO6B;IAC1C;IACA,OAAO;AACT;AAEA,qFAAqF,GACrF,OAAO,SAASc,iBAAiBC,IAAoB;IACnD,IAAIC,mBAAmB;IACvB,IAAIC,kBAAkB;IACtB,KAAK,MAAMhB,OAAOhB,OAAOO,MAAM,CAACuB,KAAK/C,KAAK,EAAG;QAC3C,IAAIiC,IAAIiB,OAAO,CAACX,MAAM,EAAES,oBAAoB;QAC5C,IAAI/B,OAAOkC,IAAI,CAAClB,IAAIT,MAAM,EAAEe,MAAM,EAAEU,mBAAmB;IACzD;IACA,OAAO;QAAED;QAAkBC;IAAgB;AAC7C"}
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* The site's inventory as a model sees it (AGL-2935): what the site already
|
|
19
|
+
* has, so a plan reuses before it creates (doctrine rule 7).
|
|
20
|
+
*
|
|
21
|
+
* COMPACT by construction (AGL-2937): ids, names, prop shapes and slugs —
|
|
22
|
+
* never a node tree, never a record's content. A component is its name and
|
|
23
|
+
* the props an instance fills in; a form is its field names; a dataset its
|
|
24
|
+
* field names. That is everything a planner needs to decide "reuse this"
|
|
25
|
+
* and a generator needs to place a reference, and it is a few hundred
|
|
26
|
+
* tokens where the trees would be tens of thousands.
|
|
27
|
+
*
|
|
28
|
+
* CAPPED three times, and the three are different numbers on purpose
|
|
29
|
+
* (AGL-2937). The reader holds each kind to `AI_SITE_INVENTORY_MAX_PER_KIND`;
|
|
30
|
+
* the prompt block LISTS only `AI_SITE_INVENTORY_LISTED_PER_KIND` of them and
|
|
31
|
+
* is held to `AI_SITE_INVENTORY_MAX_CHARS` besides; and the rest are answered
|
|
32
|
+
* on request, through the lookup tool the generation loop offers beside every
|
|
33
|
+
* door's own (`tools/ai-inventory-lookup-tool.ts`).
|
|
34
|
+
*
|
|
35
|
+
* The listing cap is what a prompt can afford: the block is volatile, so it
|
|
36
|
+
* is billed at full input rate on every request and every re-ask, and a site
|
|
37
|
+
* with two hundred components would spend most of a plan's prompt on rows it
|
|
38
|
+
* will not use. The read cap is what a LOOKUP can answer from, which is a
|
|
39
|
+
* different question — a search for "pricing card" is worth nothing if the
|
|
40
|
+
* card was never read. A kind cut by either is named in `truncated`, so the
|
|
41
|
+
* model is told more exist rather than concluding they do not.
|
|
42
|
+
*
|
|
43
|
+
* The shapes live here, apart from the reader (`runtime/site-inventory.ts`),
|
|
44
|
+
* so the prompt block, the validators and their specs can hold an inventory
|
|
45
|
+
* without loading the Admin SDK the reader needs.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Rows per kind the reader holds. Above the listing cap on purpose: the rows
|
|
49
|
+
* past it are what the lookup tool searches, and a row never read cannot be
|
|
50
|
+
* found. One projection of a few fields each, so the read is small even at
|
|
51
|
+
* this cap.
|
|
52
|
+
*/
|
|
53
|
+
export declare const AI_SITE_INVENTORY_MAX_PER_KIND = 200;
|
|
54
|
+
/** Rows per kind the prompt block lists; the rest are found by lookup. */
|
|
55
|
+
export declare const AI_SITE_INVENTORY_LISTED_PER_KIND = 40;
|
|
56
|
+
/** The rendered block's ceiling: 2,000 tokens at four characters a token. */
|
|
57
|
+
export declare const AI_SITE_INVENTORY_MAX_CHARS = 8000;
|
|
58
|
+
export type AiInventoryKind = 'components' | 'layouts' | 'templates' | 'forms' | 'datasets' | 'collections' | 'screens';
|
|
59
|
+
export declare const AI_INVENTORY_KINDS: readonly AiInventoryKind[];
|
|
60
|
+
/**
|
|
61
|
+
* A reusable component's declared props as an instance may fill them: prop
|
|
62
|
+
* name → its declared type (`text`, `image`, `href`, `number`, `boolean`, …).
|
|
63
|
+
*/
|
|
64
|
+
export type AiComponentPropTypes = Record<string, string>;
|
|
65
|
+
export interface AiInventoryComponent {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
/** The props an instance fills in: name → declared type. */
|
|
69
|
+
props: AiComponentPropTypes;
|
|
70
|
+
/**
|
|
71
|
+
* The facts in square brackets each prop's default shows until a page sets
|
|
72
|
+
* its own, by prop name (AGL-3056): what a page placing the component still
|
|
73
|
+
* asks the member to fill. Read for the member's note, never listed in a
|
|
74
|
+
* prompt; absent when no default holds one.
|
|
75
|
+
*/
|
|
76
|
+
bracketedDefaults?: Record<string, string[]>;
|
|
77
|
+
}
|
|
78
|
+
export interface AiInventoryLayout {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
/** The layout this one nests inside, when it nests. */
|
|
82
|
+
parentId: string | null;
|
|
83
|
+
}
|
|
84
|
+
export interface AiInventoryTemplate {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
kind: string;
|
|
88
|
+
}
|
|
89
|
+
export interface AiInventoryForm {
|
|
90
|
+
id: string;
|
|
91
|
+
name: string;
|
|
92
|
+
fields: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface AiInventoryDataset {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
fields: string[];
|
|
98
|
+
}
|
|
99
|
+
export interface AiInventoryCollection {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
slug: string;
|
|
103
|
+
}
|
|
104
|
+
export interface AiInventoryScreen {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
slug: string;
|
|
108
|
+
layoutId: string | null;
|
|
109
|
+
/** A collection's entry template rather than a page of its own. */
|
|
110
|
+
template: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The site's one theme, as a planner and the email rule read it: a short
|
|
114
|
+
* description, the light scheme's colors by palette path, and the families
|
|
115
|
+
* the theme loads.
|
|
116
|
+
*/
|
|
117
|
+
export interface AiInventoryTheme {
|
|
118
|
+
summary: string[];
|
|
119
|
+
colors: Record<string, string>;
|
|
120
|
+
fonts: string[];
|
|
121
|
+
}
|
|
122
|
+
export interface AiSiteInventory {
|
|
123
|
+
hostId: string;
|
|
124
|
+
components: AiInventoryComponent[];
|
|
125
|
+
layouts: AiInventoryLayout[];
|
|
126
|
+
templates: AiInventoryTemplate[];
|
|
127
|
+
forms: AiInventoryForm[];
|
|
128
|
+
datasets: AiInventoryDataset[];
|
|
129
|
+
collections: AiInventoryCollection[];
|
|
130
|
+
screens: AiInventoryScreen[];
|
|
131
|
+
theme: AiInventoryTheme | null;
|
|
132
|
+
/** Kinds with more records than are listed. */
|
|
133
|
+
truncated: AiInventoryKind[];
|
|
134
|
+
}
|
|
135
|
+
/** One inventory record, whatever kind it is. */
|
|
136
|
+
export type AiInventoryRow = AiInventoryComponent | AiInventoryLayout | AiInventoryTemplate | AiInventoryForm | AiInventoryDataset | AiInventoryCollection | AiInventoryScreen;
|
|
137
|
+
/**
|
|
138
|
+
* The rows of one kind. The inventory's fields are named after their kinds,
|
|
139
|
+
* so this is a lookup rather than a switch, and it is the one place that
|
|
140
|
+
* relies on the correspondence: the prompt block, the lookup tool and their
|
|
141
|
+
* specs all read a kind through it.
|
|
142
|
+
*/
|
|
143
|
+
export declare function aiInventoryRows(inventory: AiSiteInventory, kind: AiInventoryKind): readonly AiInventoryRow[];
|
|
144
|
+
/** The heading one kind's lines are listed under, naming its columns in order. */
|
|
145
|
+
export declare const AI_INVENTORY_KIND_HEADINGS: Readonly<Record<AiInventoryKind, string>>;
|
|
146
|
+
/**
|
|
147
|
+
* One record as a line, in the order its heading names the columns. The one
|
|
148
|
+
* renderer: the prompt block and the lookup tool's answer read alike, so a
|
|
149
|
+
* row found by lookup is the same shape as a row that was listed.
|
|
150
|
+
*/
|
|
151
|
+
export declare function aiInventoryLine(kind: AiInventoryKind, row: AiInventoryRow): string;
|
|
152
|
+
/** Every word of a record a lookup searches: its line, which holds them all. */
|
|
153
|
+
export declare function aiInventoryHaystack(kind: AiInventoryKind, row: AiInventoryRow): string;
|
|
154
|
+
/**
|
|
155
|
+
* The site's home screens, by id (AGL-3056): a screen at the root or at
|
|
156
|
+
* `home`, as a seeded site stores its first screen, or one named Home. A link
|
|
157
|
+
* with nowhere to go is sent there, which is why the doctrine names them.
|
|
158
|
+
*/
|
|
159
|
+
export declare function aiHomeScreenIds(inventory: AiSiteInventory | null): string[];
|
|
160
|
+
/** A site the org does not own; the inventory is never read for it. */
|
|
161
|
+
export declare class AiInventoryScopeError extends Error {
|
|
162
|
+
constructor(hostId: string);
|
|
163
|
+
}
|
|
164
|
+
export declare function emptyAiSiteInventory(hostId: string): AiSiteInventory;
|