@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,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { AI_EXPERIMENT_MAX_VARIANTS, AI_EXPERIMENT_TARGETS, aiExperimentNextStep, aiExperimentVerdictNamesWinner } from "./ai-experiment.js";
|
|
17
|
+
/**
|
|
18
|
+
* An `experiment` job's answer, read back from the output a console surface
|
|
19
|
+
* received, and what a surface is allowed to show of it (AGL-2914).
|
|
20
|
+
*
|
|
21
|
+
* The step decided the verdict from the counts and cut the model's words back
|
|
22
|
+
* to it. That work is undone the moment a card draws the answer with a
|
|
23
|
+
* confident heading, a highlighted arm or a "recommended" badge, because a
|
|
24
|
+
* reader takes the layout for the claim and never reads the sentence that
|
|
25
|
+
* hedges it. So the reading of the verdict happens ONCE more, here, in code a
|
|
26
|
+
* surface cannot skip: {@link aiExperimentVerdictDisplay} says what tone a
|
|
27
|
+
* verdict is drawn in and whether ANY arm may be marked, and an undecided
|
|
28
|
+
* result answers `false` however the proposal was filled in.
|
|
29
|
+
*
|
|
30
|
+
* ## The proposal is not trusted to describe itself
|
|
31
|
+
*
|
|
32
|
+
* An output's `proposal` is a plain record by the time it reaches a browser:
|
|
33
|
+
* it came back over HTTP, out of a document a job wrote. A `winnerId` in it
|
|
34
|
+
* beside a verdict of `inconclusive` is therefore possible — not because the
|
|
35
|
+
* step would write one, but because nothing between here and there is typed.
|
|
36
|
+
* {@link readAiExperimentExplanation} drops it, rather than trusting the
|
|
37
|
+
* field that would have been the model's if the step had not already taken it
|
|
38
|
+
* away.
|
|
39
|
+
*/ const isRecord = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
40
|
+
const text = (value)=>typeof value === 'string' ? value.trim() : '';
|
|
41
|
+
const count = (value)=>typeof value === 'number' && Number.isFinite(value) ? Math.max(0, value) : 0;
|
|
42
|
+
const percent = (value)=>typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
43
|
+
const VERDICTS = [
|
|
44
|
+
'unreadable',
|
|
45
|
+
'too-early',
|
|
46
|
+
'inconclusive',
|
|
47
|
+
'winner',
|
|
48
|
+
'control'
|
|
49
|
+
];
|
|
50
|
+
const DISPLAY = {
|
|
51
|
+
winner: {
|
|
52
|
+
namesAnArm: true,
|
|
53
|
+
tone: 'success',
|
|
54
|
+
status: 'One variant is ahead',
|
|
55
|
+
caveat: ''
|
|
56
|
+
},
|
|
57
|
+
control: {
|
|
58
|
+
namesAnArm: true,
|
|
59
|
+
tone: 'success',
|
|
60
|
+
status: 'The first variant is ahead',
|
|
61
|
+
caveat: ''
|
|
62
|
+
},
|
|
63
|
+
'too-early': {
|
|
64
|
+
namesAnArm: false,
|
|
65
|
+
tone: 'default',
|
|
66
|
+
status: 'No result yet',
|
|
67
|
+
caveat: 'This test has not answered yet. No variant is ahead of another.'
|
|
68
|
+
},
|
|
69
|
+
inconclusive: {
|
|
70
|
+
namesAnArm: false,
|
|
71
|
+
tone: 'default',
|
|
72
|
+
status: 'No winner',
|
|
73
|
+
caveat: 'This test did not settle anything. No variant is ahead of another.'
|
|
74
|
+
},
|
|
75
|
+
unreadable: {
|
|
76
|
+
namesAnArm: false,
|
|
77
|
+
tone: 'default',
|
|
78
|
+
status: 'Nothing to read',
|
|
79
|
+
caveat: 'There is nothing here to compare, so nothing is ahead.'
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
/** How a verdict is drawn; an unknown verdict is drawn as the most careful one. */ export function aiExperimentVerdictDisplay(verdict) {
|
|
83
|
+
var _DISPLAY_verdict;
|
|
84
|
+
return (_DISPLAY_verdict = DISPLAY[verdict]) != null ? _DISPLAY_verdict : DISPLAY['unreadable'];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Whether a surface may mark this arm. The verdict decides first, so an arm
|
|
88
|
+
* cannot be marked on a result that named none, whatever `winnerId` holds.
|
|
89
|
+
*/ export function aiExperimentArmIsNamed(explanation, armId) {
|
|
90
|
+
return aiExperimentVerdictNamesWinner(explanation.verdict) && explanation.winnerId !== null && explanation.winnerId === armId;
|
|
91
|
+
}
|
|
92
|
+
/** An explanation output's proposal, or `null` when it is not one. */ export function readAiExperimentExplanation(value) {
|
|
93
|
+
var _percent;
|
|
94
|
+
if (!isRecord(value) || value['task'] !== 'explain') return null;
|
|
95
|
+
const verdict = VERDICTS.includes(value['verdict']) ? value['verdict'] : null;
|
|
96
|
+
const headline = text(value['headline']);
|
|
97
|
+
if (!verdict || !headline) return null;
|
|
98
|
+
const arms = (Array.isArray(value['arms']) ? value['arms'] : []).filter(isRecord).map((arm)=>({
|
|
99
|
+
id: text(arm['id']),
|
|
100
|
+
exposures: count(arm['exposures']),
|
|
101
|
+
conversions: count(arm['conversions']),
|
|
102
|
+
rate: percent(arm['rate']),
|
|
103
|
+
lift: percent(arm['lift']),
|
|
104
|
+
confidence: percent(arm['confidence'])
|
|
105
|
+
})).filter((arm)=>arm.id).slice(0, AI_EXPERIMENT_MAX_VARIANTS);
|
|
106
|
+
const named = text(value['winnerId']);
|
|
107
|
+
// The verdict decides whether there is an arm to name, and the arm must be
|
|
108
|
+
// one the figures carry. A name that passes neither test is dropped rather
|
|
109
|
+
// than shown beside a result that does not support it.
|
|
110
|
+
const winnerId = aiExperimentVerdictNamesWinner(verdict) && named && arms.some((arm)=>arm.id === named) ? named : null;
|
|
111
|
+
const answered = text(value['next']);
|
|
112
|
+
return {
|
|
113
|
+
verdict,
|
|
114
|
+
test: text(value['test']),
|
|
115
|
+
headline,
|
|
116
|
+
points: (Array.isArray(value['points']) ? value['points'] : []).map(text).filter(Boolean),
|
|
117
|
+
winnerId,
|
|
118
|
+
// Undecided, the next step is the verdict's own sentence — the same one
|
|
119
|
+
// the step substituted — so a surface reading an older document still
|
|
120
|
+
// shows code's answer rather than whatever was stored beside it.
|
|
121
|
+
next: aiExperimentVerdictNamesWinner(verdict) ? answered : aiExperimentNextStep(verdict),
|
|
122
|
+
threshold: (_percent = percent(value['threshold'])) != null ? _percent : 0,
|
|
123
|
+
arms
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** A variants output's proposal, or `null` when it is not one. */ export function readAiExperimentVariants(value) {
|
|
127
|
+
if (!isRecord(value) || value['task'] !== 'variants') return null;
|
|
128
|
+
const target = AI_EXPERIMENT_TARGETS.includes(String(value['target'])) ? value['target'] : null;
|
|
129
|
+
if (!target) return null;
|
|
130
|
+
const variants = (Array.isArray(value['variants']) ? value['variants'] : []).filter(isRecord).map((variant)=>({
|
|
131
|
+
name: text(variant['name']),
|
|
132
|
+
headline: text(variant['headline']),
|
|
133
|
+
body: text(variant['body']),
|
|
134
|
+
subject: text(variant['subject']),
|
|
135
|
+
preheader: text(variant['preheader']),
|
|
136
|
+
rationale: text(variant['rationale'])
|
|
137
|
+
})).filter((variant)=>variant.headline || variant.body || variant.subject).slice(0, AI_EXPERIMENT_MAX_VARIANTS);
|
|
138
|
+
if (!variants.length) return null;
|
|
139
|
+
return {
|
|
140
|
+
target,
|
|
141
|
+
goal: text(value['goal']),
|
|
142
|
+
variants
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=ai-experiment-proposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-experiment-proposal.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AI_EXPERIMENT_MAX_VARIANTS,\n AI_EXPERIMENT_TARGETS,\n aiExperimentNextStep,\n aiExperimentVerdictNamesWinner,\n type AiExperimentArm,\n type AiExperimentTarget,\n type AiExperimentVariantProposal,\n type AiExperimentVerdict,\n} from './ai-experiment'\n\n/**\n * An `experiment` job's answer, read back from the output a console surface\n * received, and what a surface is allowed to show of it (AGL-2914).\n *\n * The step decided the verdict from the counts and cut the model's words back\n * to it. That work is undone the moment a card draws the answer with a\n * confident heading, a highlighted arm or a \"recommended\" badge, because a\n * reader takes the layout for the claim and never reads the sentence that\n * hedges it. So the reading of the verdict happens ONCE more, here, in code a\n * surface cannot skip: {@link aiExperimentVerdictDisplay} says what tone a\n * verdict is drawn in and whether ANY arm may be marked, and an undecided\n * result answers `false` however the proposal was filled in.\n *\n * ## The proposal is not trusted to describe itself\n *\n * An output's `proposal` is a plain record by the time it reaches a browser:\n * it came back over HTTP, out of a document a job wrote. A `winnerId` in it\n * beside a verdict of `inconclusive` is therefore possible — not because the\n * step would write one, but because nothing between here and there is typed.\n * {@link readAiExperimentExplanation} drops it, rather than trusting the\n * field that would have been the model's if the step had not already taken it\n * away.\n */\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst text = (value: unknown): string =>\n typeof value === 'string' ? value.trim() : ''\n\nconst count = (value: unknown): number =>\n typeof value === 'number' && Number.isFinite(value) ? Math.max(0, value) : 0\n\nconst percent = (value: unknown): number | null =>\n typeof value === 'number' && Number.isFinite(value) ? value : null\n\nconst VERDICTS: readonly AiExperimentVerdict[] = [\n 'unreadable',\n 'too-early',\n 'inconclusive',\n 'winner',\n 'control',\n]\n\n/** An explanation as a console surface reads it back. */\nexport interface AiExperimentExplanationProposal {\n verdict: AiExperimentVerdict\n test: string\n headline: string\n points: string[]\n /** The arm the FIGURES named, and only ever on a verdict that names one. */\n winnerId: string | null\n next: string\n /** The confidence one comparison had to clear, as a percentage. */\n threshold: number\n arms: AiExperimentArm[]\n}\n\n/** A variants answer as a console surface reads it back. */\nexport interface AiExperimentVariantsProposalView {\n target: AiExperimentTarget\n goal: string\n variants: AiExperimentVariantProposal[]\n}\n\n/**\n * How a verdict is drawn.\n *\n * `namesAnArm` is the one a surface must ask before it marks a row, a chip or\n * a heading: on `too-early`, `inconclusive` and `unreadable` there is no arm\n * to mark, and marking the one with the best rate anyway is the claim the\n * step refused to let the model make.\n *\n * `tone` is a MUI severity/color word rather than a color: `success` only\n * where the figures decided something, and the neutral `default` everywhere\n * else — an undecided result drawn in a color that reads as good or as bad\n * says something the figures did not.\n */\nexport interface AiExperimentVerdictDisplay {\n namesAnArm: boolean\n tone: 'success' | 'default'\n /** The verdict in a reader's words, short enough for a chip. */\n status: string\n /** What the result does not settle, or empty where it settles something. */\n caveat: string\n}\n\nconst DISPLAY: Record<AiExperimentVerdict, AiExperimentVerdictDisplay> = {\n winner: {\n namesAnArm: true,\n tone: 'success',\n status: 'One variant is ahead',\n caveat: '',\n },\n control: {\n namesAnArm: true,\n tone: 'success',\n status: 'The first variant is ahead',\n caveat: '',\n },\n 'too-early': {\n namesAnArm: false,\n tone: 'default',\n status: 'No result yet',\n caveat: 'This test has not answered yet. No variant is ahead of another.',\n },\n inconclusive: {\n namesAnArm: false,\n tone: 'default',\n status: 'No winner',\n caveat:\n 'This test did not settle anything. No variant is ahead of another.',\n },\n unreadable: {\n namesAnArm: false,\n tone: 'default',\n status: 'Nothing to read',\n caveat: 'There is nothing here to compare, so nothing is ahead.',\n },\n}\n\n/** How a verdict is drawn; an unknown verdict is drawn as the most careful one. */\nexport function aiExperimentVerdictDisplay(\n verdict: AiExperimentVerdict | string,\n): AiExperimentVerdictDisplay {\n return DISPLAY[verdict as AiExperimentVerdict] ?? DISPLAY['unreadable']\n}\n\n/**\n * Whether a surface may mark this arm. The verdict decides first, so an arm\n * cannot be marked on a result that named none, whatever `winnerId` holds.\n */\nexport function aiExperimentArmIsNamed(\n explanation: Pick<AiExperimentExplanationProposal, 'verdict' | 'winnerId'>,\n armId: string,\n): boolean {\n return (\n aiExperimentVerdictNamesWinner(explanation.verdict) &&\n explanation.winnerId !== null &&\n explanation.winnerId === armId\n )\n}\n\n/** An explanation output's proposal, or `null` when it is not one. */\nexport function readAiExperimentExplanation(\n value: unknown,\n): AiExperimentExplanationProposal | null {\n if (!isRecord(value) || value['task'] !== 'explain') return null\n const verdict = VERDICTS.includes(value['verdict'] as AiExperimentVerdict)\n ? (value['verdict'] as AiExperimentVerdict)\n : null\n const headline = text(value['headline'])\n if (!verdict || !headline) return null\n const arms = (Array.isArray(value['arms']) ? value['arms'] : [])\n .filter(isRecord)\n .map((arm): AiExperimentArm => ({\n id: text(arm['id']),\n exposures: count(arm['exposures']),\n conversions: count(arm['conversions']),\n rate: percent(arm['rate']),\n lift: percent(arm['lift']),\n confidence: percent(arm['confidence']),\n }))\n .filter((arm) => arm.id)\n .slice(0, AI_EXPERIMENT_MAX_VARIANTS)\n const named = text(value['winnerId'])\n // The verdict decides whether there is an arm to name, and the arm must be\n // one the figures carry. A name that passes neither test is dropped rather\n // than shown beside a result that does not support it.\n const winnerId =\n aiExperimentVerdictNamesWinner(verdict) &&\n named &&\n arms.some((arm) => arm.id === named)\n ? named\n : null\n const answered = text(value['next'])\n return {\n verdict,\n test: text(value['test']),\n headline,\n points: (Array.isArray(value['points']) ? value['points'] : [])\n .map(text)\n .filter(Boolean),\n winnerId,\n // Undecided, the next step is the verdict's own sentence — the same one\n // the step substituted — so a surface reading an older document still\n // shows code's answer rather than whatever was stored beside it.\n next: aiExperimentVerdictNamesWinner(verdict)\n ? answered\n : aiExperimentNextStep(verdict),\n threshold: percent(value['threshold']) ?? 0,\n arms,\n }\n}\n\n/** A variants output's proposal, or `null` when it is not one. */\nexport function readAiExperimentVariants(\n value: unknown,\n): AiExperimentVariantsProposalView | null {\n if (!isRecord(value) || value['task'] !== 'variants') return null\n const target = (AI_EXPERIMENT_TARGETS as readonly string[]).includes(\n String(value['target']),\n )\n ? (value['target'] as AiExperimentTarget)\n : null\n if (!target) return null\n const variants = (Array.isArray(value['variants']) ? value['variants'] : [])\n .filter(isRecord)\n .map((variant): AiExperimentVariantProposal => ({\n name: text(variant['name']),\n headline: text(variant['headline']),\n body: text(variant['body']),\n subject: text(variant['subject']),\n preheader: text(variant['preheader']),\n rationale: text(variant['rationale']),\n }))\n .filter((variant) => variant.headline || variant.body || variant.subject)\n .slice(0, AI_EXPERIMENT_MAX_VARIANTS)\n if (!variants.length) return null\n return { target, goal: text(value['goal']), variants }\n}\n"],"names":["AI_EXPERIMENT_MAX_VARIANTS","AI_EXPERIMENT_TARGETS","aiExperimentNextStep","aiExperimentVerdictNamesWinner","isRecord","value","Array","isArray","text","trim","count","Number","isFinite","Math","max","percent","VERDICTS","DISPLAY","winner","namesAnArm","tone","status","caveat","control","inconclusive","unreadable","aiExperimentVerdictDisplay","verdict","aiExperimentArmIsNamed","explanation","armId","winnerId","readAiExperimentExplanation","includes","headline","arms","filter","map","arm","id","exposures","conversions","rate","lift","confidence","slice","named","some","answered","test","points","Boolean","next","threshold","readAiExperimentVariants","target","String","variants","variant","name","body","subject","preheader","rationale","length","goal"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,0BAA0B,EAC1BC,qBAAqB,EACrBC,oBAAoB,EACpBC,8BAA8B,QAKzB,qBAAiB;AAExB;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,MAAMC,WAAW,CAACC,QAChB,OAAOA,UAAU,YAAYA,UAAU,QAAQ,CAACC,MAAMC,OAAO,CAACF;AAEhE,MAAMG,OAAO,CAACH,QACZ,OAAOA,UAAU,WAAWA,MAAMI,IAAI,KAAK;AAE7C,MAAMC,QAAQ,CAACL,QACb,OAAOA,UAAU,YAAYM,OAAOC,QAAQ,CAACP,SAASQ,KAAKC,GAAG,CAAC,GAAGT,SAAS;AAE7E,MAAMU,UAAU,CAACV,QACf,OAAOA,UAAU,YAAYM,OAAOC,QAAQ,CAACP,SAASA,QAAQ;AAEhE,MAAMW,WAA2C;IAC/C;IACA;IACA;IACA;IACA;CACD;AA6CD,MAAMC,UAAmE;IACvEC,QAAQ;QACNC,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,QAAQ;IACV;IACAC,SAAS;QACPJ,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,QAAQ;IACV;IACA,aAAa;QACXH,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,QAAQ;IACV;IACAE,cAAc;QACZL,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,QACE;IACJ;IACAG,YAAY;QACVN,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,QAAQ;IACV;AACF;AAEA,iFAAiF,GACjF,OAAO,SAASI,2BACdC,OAAqC;QAE9BV;IAAP,QAAOA,mBAAAA,OAAO,CAACU,QAA+B,YAAvCV,mBAA2CA,OAAO,CAAC,aAAa;AACzE;AAEA;;;CAGC,GACD,OAAO,SAASW,uBACdC,WAA0E,EAC1EC,KAAa;IAEb,OACE3B,+BAA+B0B,YAAYF,OAAO,KAClDE,YAAYE,QAAQ,KAAK,QACzBF,YAAYE,QAAQ,KAAKD;AAE7B;AAEA,oEAAoE,GACpE,OAAO,SAASE,4BACd3B,KAAc;QA6CDU;IA3Cb,IAAI,CAACX,SAASC,UAAUA,KAAK,CAAC,OAAO,KAAK,WAAW,OAAO;IAC5D,MAAMsB,UAAUX,SAASiB,QAAQ,CAAC5B,KAAK,CAAC,UAAU,IAC7CA,KAAK,CAAC,UAAU,GACjB;IACJ,MAAM6B,WAAW1B,KAAKH,KAAK,CAAC,WAAW;IACvC,IAAI,CAACsB,WAAW,CAACO,UAAU,OAAO;IAClC,MAAMC,OAAO,AAAC7B,CAAAA,MAAMC,OAAO,CAACF,KAAK,CAAC,OAAO,IAAIA,KAAK,CAAC,OAAO,GAAG,EAAE,AAAD,EAC3D+B,MAAM,CAAChC,UACPiC,GAAG,CAAC,CAACC,MAA0B,CAAA;YAC9BC,IAAI/B,KAAK8B,GAAG,CAAC,KAAK;YAClBE,WAAW9B,MAAM4B,GAAG,CAAC,YAAY;YACjCG,aAAa/B,MAAM4B,GAAG,CAAC,cAAc;YACrCI,MAAM3B,QAAQuB,GAAG,CAAC,OAAO;YACzBK,MAAM5B,QAAQuB,GAAG,CAAC,OAAO;YACzBM,YAAY7B,QAAQuB,GAAG,CAAC,aAAa;QACvC,CAAA,GACCF,MAAM,CAAC,CAACE,MAAQA,IAAIC,EAAE,EACtBM,KAAK,CAAC,GAAG7C;IACZ,MAAM8C,QAAQtC,KAAKH,KAAK,CAAC,WAAW;IACpC,2EAA2E;IAC3E,2EAA2E;IAC3E,uDAAuD;IACvD,MAAM0B,WACJ5B,+BAA+BwB,YAC/BmB,SACAX,KAAKY,IAAI,CAAC,CAACT,MAAQA,IAAIC,EAAE,KAAKO,SAC1BA,QACA;IACN,MAAME,WAAWxC,KAAKH,KAAK,CAAC,OAAO;IACnC,OAAO;QACLsB;QACAsB,MAAMzC,KAAKH,KAAK,CAAC,OAAO;QACxB6B;QACAgB,QAAQ,AAAC5C,CAAAA,MAAMC,OAAO,CAACF,KAAK,CAAC,SAAS,IAAIA,KAAK,CAAC,SAAS,GAAG,EAAE,AAAD,EAC1DgC,GAAG,CAAC7B,MACJ4B,MAAM,CAACe;QACVpB;QACA,wEAAwE;QACxE,sEAAsE;QACtE,iEAAiE;QACjEqB,MAAMjD,+BAA+BwB,WACjCqB,WACA9C,qBAAqByB;QACzB0B,SAAS,GAAEtC,WAAAA,QAAQV,KAAK,CAAC,YAAY,aAA1BU,WAA+B;QAC1CoB;IACF;AACF;AAEA,gEAAgE,GAChE,OAAO,SAASmB,yBACdjD,KAAc;IAEd,IAAI,CAACD,SAASC,UAAUA,KAAK,CAAC,OAAO,KAAK,YAAY,OAAO;IAC7D,MAAMkD,SAAS,AAACtD,sBAA4CgC,QAAQ,CAClEuB,OAAOnD,KAAK,CAAC,SAAS,KAEnBA,KAAK,CAAC,SAAS,GAChB;IACJ,IAAI,CAACkD,QAAQ,OAAO;IACpB,MAAME,WAAW,AAACnD,CAAAA,MAAMC,OAAO,CAACF,KAAK,CAAC,WAAW,IAAIA,KAAK,CAAC,WAAW,GAAG,EAAE,AAAD,EACvE+B,MAAM,CAAChC,UACPiC,GAAG,CAAC,CAACqB,UAA0C,CAAA;YAC9CC,MAAMnD,KAAKkD,OAAO,CAAC,OAAO;YAC1BxB,UAAU1B,KAAKkD,OAAO,CAAC,WAAW;YAClCE,MAAMpD,KAAKkD,OAAO,CAAC,OAAO;YAC1BG,SAASrD,KAAKkD,OAAO,CAAC,UAAU;YAChCI,WAAWtD,KAAKkD,OAAO,CAAC,YAAY;YACpCK,WAAWvD,KAAKkD,OAAO,CAAC,YAAY;QACtC,CAAA,GACCtB,MAAM,CAAC,CAACsB,UAAYA,QAAQxB,QAAQ,IAAIwB,QAAQE,IAAI,IAAIF,QAAQG,OAAO,EACvEhB,KAAK,CAAC,GAAG7C;IACZ,IAAI,CAACyD,SAASO,MAAM,EAAE,OAAO;IAC7B,OAAO;QAAET;QAAQU,MAAMzD,KAAKH,KAAK,CAAC,OAAO;QAAGoD;IAAS;AACvD"}
|
|
@@ -0,0 +1,309 @@
|
|
|
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 { PluginFigureTable } from '@aglyn/aglyn/plugin-manager/plugin-figures';
|
|
18
|
+
/**
|
|
19
|
+
* A/B tests by AI (AGL-2914): what an `experiment` job proposes, and what it
|
|
20
|
+
* is allowed to say about a result.
|
|
21
|
+
*
|
|
22
|
+
* ## The test is not ours
|
|
23
|
+
*
|
|
24
|
+
* A/B testing is the marketing plugin's: it models the experiment document,
|
|
25
|
+
* buckets visitors, counts exposures and conversions, compares a challenger
|
|
26
|
+
* with the control and decides an auto-winner. None of that is restated here,
|
|
27
|
+
* and none of it is imported — a plugin never imports another plugin. This
|
|
28
|
+
* module is the AI layer over it, and it reaches the test through the two
|
|
29
|
+
* generic seams core already publishes: the figure reader marketing registers
|
|
30
|
+
* for its results, and the job inputs a console surface hands the door.
|
|
31
|
+
*
|
|
32
|
+
* ## Variants are proposed, never written
|
|
33
|
+
*
|
|
34
|
+
* A variant of a screen or a section is a screen VERSION, and a variant of an
|
|
35
|
+
* email is that email's own copy: both belong to editors a person already
|
|
36
|
+
* uses, and the experiment document belongs to marketing. So a variants
|
|
37
|
+
* answer is a proposal, like a theme's or a listing's — words a person puts
|
|
38
|
+
* into the A/B testing card, or does not. Nothing here writes an experiment,
|
|
39
|
+
* starts one, or moves traffic.
|
|
40
|
+
*
|
|
41
|
+
* ## The verdict is code's, and the words are the model's
|
|
42
|
+
*
|
|
43
|
+
* `readAiExperimentResult` decides what a result supports BEFORE a model is
|
|
44
|
+
* asked anything, from the arms' own counts and the confidence marketing
|
|
45
|
+
* published beside them. The model is then asked to explain that verdict, and
|
|
46
|
+
* `checkAiExperimentExplanation` holds it to it: an explanation may name a
|
|
47
|
+
* winner only where the reading found one, and a winner it names anyway is
|
|
48
|
+
* dropped rather than shown. A confident explanation of noise is worse than
|
|
49
|
+
* no explanation, so the one thing the model is never trusted with is whether
|
|
50
|
+
* there is something to explain.
|
|
51
|
+
*/
|
|
52
|
+
/** What an `experiment` job was asked for. */
|
|
53
|
+
export type AiExperimentTask = 'variants' | 'explain';
|
|
54
|
+
export declare const AI_EXPERIMENT_TASKS: readonly AiExperimentTask[];
|
|
55
|
+
/** The task a job's inputs name, or `null` when they name none this step runs. */
|
|
56
|
+
export declare function aiExperimentTask(inputs: Readonly<Record<string, unknown>> | null | undefined): AiExperimentTask | null;
|
|
57
|
+
/**
|
|
58
|
+
* What the experiment varies, in the words the A/B testing card uses. The job
|
|
59
|
+
* carries it as an input because the card that opens the job knows it; it is
|
|
60
|
+
* never read out of marketing's own document.
|
|
61
|
+
*/
|
|
62
|
+
export type AiExperimentTarget = 'screen' | 'section' | 'email';
|
|
63
|
+
export declare const AI_EXPERIMENT_TARGETS: readonly AiExperimentTarget[];
|
|
64
|
+
/** The target a job's inputs name, or `null` when they name none. */
|
|
65
|
+
export declare function aiExperimentTarget(inputs: Readonly<Record<string, unknown>> | null | undefined): AiExperimentTarget | null;
|
|
66
|
+
/**
|
|
67
|
+
* How many variants a proposal may hold, the cap the A/B testing card stores
|
|
68
|
+
* and the page runner buckets against. Proposing a fifth would be proposing
|
|
69
|
+
* something nothing can save.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AI_EXPERIMENT_MAX_VARIANTS = 4;
|
|
72
|
+
/** The fewest a test can be: a control and one challenger. */
|
|
73
|
+
export declare const AI_EXPERIMENT_MIN_VARIANTS = 2;
|
|
74
|
+
/** How long a variant's name may run, as the card's own field holds one. */
|
|
75
|
+
export declare const AI_EXPERIMENT_NAME_MAX_CHARS = 60;
|
|
76
|
+
/** How long one line of a variant's copy may run. */
|
|
77
|
+
export declare const AI_EXPERIMENT_LINE_MAX_CHARS = 200;
|
|
78
|
+
/** How long a variant's body may run. */
|
|
79
|
+
export declare const AI_EXPERIMENT_BODY_MAX_CHARS = 1200;
|
|
80
|
+
/** How long the sentence saying what a variant changes may run. */
|
|
81
|
+
export declare const AI_EXPERIMENT_RATIONALE_MAX_CHARS = 200;
|
|
82
|
+
/** How much of what is under test is sent. Past this it is a document, not a subject. */
|
|
83
|
+
export declare const AI_EXPERIMENT_SUBJECT_MAX_CHARS = 4000;
|
|
84
|
+
/**
|
|
85
|
+
* One variant a proposal holds. `headline` and `body` are a screen's or a
|
|
86
|
+
* section's copy; `subject` and `preheader` are an email's. A variant carries
|
|
87
|
+
* the fields its target has and leaves the rest empty, so what a person pastes
|
|
88
|
+
* into the card is what that card has a place for.
|
|
89
|
+
*/
|
|
90
|
+
export interface AiExperimentVariantProposal {
|
|
91
|
+
name: string;
|
|
92
|
+
headline: string;
|
|
93
|
+
body: string;
|
|
94
|
+
subject: string;
|
|
95
|
+
preheader: string;
|
|
96
|
+
/** One sentence: what this variant changes and what it is testing. */
|
|
97
|
+
rationale: string;
|
|
98
|
+
}
|
|
99
|
+
/** A variants answer as the step keeps it. */
|
|
100
|
+
export interface AiExperimentVariantsProposal {
|
|
101
|
+
/** What the variants are trying to move, in the person's own terms. */
|
|
102
|
+
goal: string;
|
|
103
|
+
variants: AiExperimentVariantProposal[];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The reader marketing registers for its A/B test results, and the columns it
|
|
107
|
+
* publishes. Named here rather than imported because the owner is another
|
|
108
|
+
* plugin: a table that does not carry these columns is one this step cannot
|
|
109
|
+
* read, and it says so instead of guessing.
|
|
110
|
+
*/
|
|
111
|
+
export declare const AI_EXPERIMENT_FIGURE_READER = "marketing.experiments";
|
|
112
|
+
export declare const AI_EXPERIMENT_FIGURE_COLUMNS: {
|
|
113
|
+
readonly test: "test";
|
|
114
|
+
readonly variant: "variant";
|
|
115
|
+
readonly exposures: "shown";
|
|
116
|
+
readonly conversions: "conversions";
|
|
117
|
+
readonly rate: "rate";
|
|
118
|
+
readonly lift: "lift";
|
|
119
|
+
readonly confidence: "confidence";
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* One arm of a test, as the figures report it. `lift` and `confidence` are the
|
|
123
|
+
* owner's own comparison against the control, as percentages, and are `null`
|
|
124
|
+
* on the control row and wherever the owner could not compare.
|
|
125
|
+
*/
|
|
126
|
+
export interface AiExperimentArm {
|
|
127
|
+
id: string;
|
|
128
|
+
/** The exposures the reader counted: visitors shown this arm. */
|
|
129
|
+
exposures: number;
|
|
130
|
+
conversions: number;
|
|
131
|
+
/** Conversions over exposures, as a percentage; `null` with no exposures. */
|
|
132
|
+
rate: number | null;
|
|
133
|
+
/** Relative change against the control, as a percentage; `null` on the control. */
|
|
134
|
+
lift: number | null;
|
|
135
|
+
/** The owner's confidence that this arm beats the control, as a percentage. */
|
|
136
|
+
confidence: number | null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The exposures each arm needs before a comparison is read at all. Below this
|
|
140
|
+
* a test is early rather than inconclusive, which is a different thing to tell
|
|
141
|
+
* someone: one says wait, the other says stop.
|
|
142
|
+
*/
|
|
143
|
+
export declare const AI_EXPERIMENT_MIN_EXPOSURES = 200;
|
|
144
|
+
/**
|
|
145
|
+
* The successes and failures each arm needs, at the pooled rate, for the
|
|
146
|
+
* normal approximation behind a two-proportion test to be worth reading. The
|
|
147
|
+
* textbook condition, and the reason a test with plenty of traffic and almost
|
|
148
|
+
* no conversions is still too early to call.
|
|
149
|
+
*/
|
|
150
|
+
export declare const AI_EXPERIMENT_MIN_EXPECTED = 5;
|
|
151
|
+
/**
|
|
152
|
+
* The confidence a single comparison is called at: the same 95% the A/B
|
|
153
|
+
* testing card's auto-winner offers, so the explanation and the card agree
|
|
154
|
+
* about what "confident" means when there is one challenger.
|
|
155
|
+
*/
|
|
156
|
+
export declare const AI_EXPERIMENT_CONFIDENCE = 0.95;
|
|
157
|
+
/**
|
|
158
|
+
* The confidence ONE comparison must clear when a test has `challengers` of
|
|
159
|
+
* them (Šidák): testing three challengers at 95% each would call a winner by
|
|
160
|
+
* chance about one time in seven, so the bar rises with the number of chances
|
|
161
|
+
* taken. With one challenger this is exactly `AI_EXPERIMENT_CONFIDENCE`.
|
|
162
|
+
*/
|
|
163
|
+
export declare function aiExperimentConfidenceThreshold(challengers: number): number;
|
|
164
|
+
/**
|
|
165
|
+
* What a result supports:
|
|
166
|
+
*
|
|
167
|
+
* - `unreadable` — the figures do not describe a test with a control and a
|
|
168
|
+
* challenger, so there is nothing to read;
|
|
169
|
+
* - `too-early` — an arm is under the exposure floor, or so little has
|
|
170
|
+
* converted that the comparison behind the confidence is not worth reading;
|
|
171
|
+
* - `inconclusive` — enough has happened, and no arm is far enough from the
|
|
172
|
+
* control for the difference to be more than chance;
|
|
173
|
+
* - `winner` — a challenger is ahead by more than chance explains;
|
|
174
|
+
* - `control` — every challenger is behind by more than chance explains.
|
|
175
|
+
*/
|
|
176
|
+
export type AiExperimentVerdict = 'unreadable' | 'too-early' | 'inconclusive' | 'winner' | 'control';
|
|
177
|
+
/** The verdicts that name an arm, and so let an explanation name one. */
|
|
178
|
+
export declare const AI_EXPERIMENT_DECIDED_VERDICTS: readonly AiExperimentVerdict[];
|
|
179
|
+
/** Whether a verdict lets an explanation name a winner. */
|
|
180
|
+
export declare function aiExperimentVerdictNamesWinner(verdict: AiExperimentVerdict): boolean;
|
|
181
|
+
export interface AiExperimentReading {
|
|
182
|
+
verdict: AiExperimentVerdict;
|
|
183
|
+
/** The test's name as the figures label it. */
|
|
184
|
+
test: string;
|
|
185
|
+
/** The control first, then its challengers in the order the figures gave them. */
|
|
186
|
+
arms: AiExperimentArm[];
|
|
187
|
+
/** The arm the verdict names, on `winner` and `control`; `null` otherwise. */
|
|
188
|
+
winnerId: string | null;
|
|
189
|
+
/** The confidence one comparison had to clear, as a percentage. */
|
|
190
|
+
threshold: number;
|
|
191
|
+
/**
|
|
192
|
+
* Why the verdict is not a winner, in the words the explanation is asked to
|
|
193
|
+
* use; empty where it is one. Never a number — the figures carry those.
|
|
194
|
+
*/
|
|
195
|
+
reasons: string[];
|
|
196
|
+
}
|
|
197
|
+
/** Whether a table is the A/B test results, by the columns it publishes. */
|
|
198
|
+
export declare function isAiExperimentTable(table: Pick<PluginFigureTable, 'columns'> | null | undefined): boolean;
|
|
199
|
+
/** The tests a results table holds, by the name it labels each with. */
|
|
200
|
+
export declare function aiExperimentTestNames(table: Pick<PluginFigureTable, 'columns' | 'rows'> | null | undefined): string[];
|
|
201
|
+
/**
|
|
202
|
+
* One test's arms, in the order the table gave them — the control first, as
|
|
203
|
+
* the reader's own note says it publishes them. An empty list where the table
|
|
204
|
+
* is not the results, or holds no such test.
|
|
205
|
+
*/
|
|
206
|
+
export declare function readAiExperimentArms(table: Pick<PluginFigureTable, 'columns' | 'rows'> | null | undefined, test: string): AiExperimentArm[];
|
|
207
|
+
/** What an arm is told to wait for, in words with no figure in them. */
|
|
208
|
+
export declare const AI_EXPERIMENT_REASON_EXPOSURES = "at least one variant has not been shown to enough visitors yet";
|
|
209
|
+
export declare const AI_EXPERIMENT_REASON_CONVERSIONS = "too little has converted yet for the comparison to mean anything";
|
|
210
|
+
export declare const AI_EXPERIMENT_REASON_SPREAD = "no variant is far enough from the first one for the difference to be more than chance";
|
|
211
|
+
export declare const AI_EXPERIMENT_REASON_UNREADABLE = "these figures do not describe a test with a first variant and something to compare against it";
|
|
212
|
+
/**
|
|
213
|
+
* What a test's figures support (AGL-2914), decided before a model is asked
|
|
214
|
+
* anything.
|
|
215
|
+
*
|
|
216
|
+
* The first arm is the control, as the results reader publishes it. A verdict
|
|
217
|
+
* is reached in this order, and the first answer wins:
|
|
218
|
+
*
|
|
219
|
+
* 1. fewer than two arms — `unreadable`;
|
|
220
|
+
* 2. an arm under `AI_EXPERIMENT_MIN_EXPOSURES`, or one whose expected
|
|
221
|
+
* successes or failures at the pooled rate are under
|
|
222
|
+
* `AI_EXPERIMENT_MIN_EXPECTED` — `too-early`. The second is what stops a
|
|
223
|
+
* test with a hundred thousand visitors and four conversions reading as a
|
|
224
|
+
* decided one;
|
|
225
|
+
* 3. a challenger whose confidence clears the multiplicity-corrected
|
|
226
|
+
* threshold — `winner`, the most confident of them;
|
|
227
|
+
* 4. every challenger below `1 - threshold`, which is the same statement made
|
|
228
|
+
* about the control — `control`;
|
|
229
|
+
* 5. anything else — `inconclusive`.
|
|
230
|
+
*
|
|
231
|
+
* A challenger the owner could not compare (`confidence` is `null`) can never
|
|
232
|
+
* win, and leaves the control undecided too: not knowing is not evidence.
|
|
233
|
+
*/
|
|
234
|
+
export declare function readAiExperimentResult(test: string, arms: readonly AiExperimentArm[]): AiExperimentReading;
|
|
235
|
+
/** How long the sentence stating what happened may run. */
|
|
236
|
+
export declare const AI_EXPERIMENT_HEADLINE_MAX_CHARS = 280;
|
|
237
|
+
/** How many sentences of detail an explanation may carry. */
|
|
238
|
+
export declare const AI_EXPERIMENT_MAX_POINTS = 4;
|
|
239
|
+
/** How long one of them may run. */
|
|
240
|
+
export declare const AI_EXPERIMENT_POINT_MAX_CHARS = 280;
|
|
241
|
+
/** How long the sentence saying what to do next may run. */
|
|
242
|
+
export declare const AI_EXPERIMENT_NEXT_MAX_CHARS = 280;
|
|
243
|
+
/** An explanation as the model answers it. */
|
|
244
|
+
export interface AiExperimentExplanationAnswer {
|
|
245
|
+
headline: string;
|
|
246
|
+
points: string[];
|
|
247
|
+
/** The variant the answer says won; empty when it names none. */
|
|
248
|
+
winner: string;
|
|
249
|
+
next: string;
|
|
250
|
+
}
|
|
251
|
+
/** An explanation as the step keeps it, after the reading has had its say. */
|
|
252
|
+
export interface AiExperimentExplanation {
|
|
253
|
+
verdict: AiExperimentVerdict;
|
|
254
|
+
test: string;
|
|
255
|
+
headline: string;
|
|
256
|
+
points: string[];
|
|
257
|
+
/**
|
|
258
|
+
* The arm the explanation names, which is the arm the READING named: an
|
|
259
|
+
* answer that named another, or named one where the reading named none, has
|
|
260
|
+
* had it removed.
|
|
261
|
+
*/
|
|
262
|
+
winnerId: string | null;
|
|
263
|
+
next: string;
|
|
264
|
+
/** What was dropped from the answer, for the log; never shown to a customer. */
|
|
265
|
+
findings: string[];
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* What to do next where the result decided nothing. Code's sentence rather
|
|
269
|
+
* than the model's: "what next" is where an explanation that may not name a
|
|
270
|
+
* winner would name one anyway, and the honest answer is the same every time.
|
|
271
|
+
*/
|
|
272
|
+
export declare const AI_EXPERIMENT_NEXT_TOO_EARLY = "Leave the test running until every variant has been shown to enough visitors to compare.";
|
|
273
|
+
export declare const AI_EXPERIMENT_NEXT_INCONCLUSIVE = "These variants are too close to separate. Try a bigger change rather than a longer test.";
|
|
274
|
+
export declare const AI_EXPERIMENT_NEXT_UNREADABLE = "Open the test in A/B testing and check it has a first variant and at least one to compare against it.";
|
|
275
|
+
/** The next step an undecided verdict carries; empty for a decided one, which the answer writes. */
|
|
276
|
+
export declare function aiExperimentNextStep(verdict: AiExperimentVerdict): string;
|
|
277
|
+
/**
|
|
278
|
+
* The model's explanation held to the reading (AGL-2914).
|
|
279
|
+
*
|
|
280
|
+
* The reading decided the verdict; this decides what may be said about it.
|
|
281
|
+
* Where the reading found no winner, the named arm is removed and any sentence
|
|
282
|
+
* that claims one is dropped — not softened, dropped, because a hedge in front
|
|
283
|
+
* of a claim still reads as the claim. Where it found one, the answer may only
|
|
284
|
+
* name THAT arm; another is removed as well.
|
|
285
|
+
*
|
|
286
|
+
* An explanation left with no headline is no explanation, and the step fails
|
|
287
|
+
* rather than showing an empty card.
|
|
288
|
+
*/
|
|
289
|
+
export declare function checkAiExperimentExplanation(answer: AiExperimentExplanationAnswer | null, reading: AiExperimentReading): AiExperimentExplanation | null;
|
|
290
|
+
/**
|
|
291
|
+
* The fields a target's variant fills. An email varies its subject line, its
|
|
292
|
+
* preheader and its body; a screen or a section varies the copy on it. A
|
|
293
|
+
* variant that fills the other target's fields is answering a different
|
|
294
|
+
* question, and those fields are dropped.
|
|
295
|
+
*/
|
|
296
|
+
export declare function aiExperimentVariantFields(target: AiExperimentTarget): Array<keyof AiExperimentVariantProposal>;
|
|
297
|
+
/**
|
|
298
|
+
* A variants answer, held to what the A/B testing card can store (AGL-2914):
|
|
299
|
+
* between two and four variants, each with copy for the target under test,
|
|
300
|
+
* none repeating another's copy, and no markup anywhere — the card's fields
|
|
301
|
+
* are plain text and the besigner writes the elements.
|
|
302
|
+
*
|
|
303
|
+
* Returns the proposal with what could not be kept removed, or `null` when
|
|
304
|
+
* nothing usable is left.
|
|
305
|
+
*/
|
|
306
|
+
export declare function checkAiExperimentVariants(answer: AiExperimentVariantsProposal | null, target: AiExperimentTarget): {
|
|
307
|
+
proposal: AiExperimentVariantsProposal;
|
|
308
|
+
findings: string[];
|
|
309
|
+
} | null;
|