@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,26 @@
|
|
|
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 { ConsoleHostSeoZoneProps } from '@aglyn/aglyn/plugin-manager/feature-plugins';
|
|
18
|
+
import { type AiSiteSeoProposal } from '../model/ai-site-start-seo';
|
|
19
|
+
/**
|
|
20
|
+
* Whether the site's settings already say what the proposal says. Both values
|
|
21
|
+
* have to match: a site whose title was applied and whose description was
|
|
22
|
+
* then rewritten still has something to take.
|
|
23
|
+
*/
|
|
24
|
+
export declare function aiSiteSeoAlreadySaid(proposal: AiSiteSeoProposal, seo: Record<string, unknown> | undefined): boolean;
|
|
25
|
+
export declare function AiSiteSeoStartCard({ hostId, orgId, seo, proposeDraft }: ConsoleHostSeoZoneProps): import("react").JSX.Element;
|
|
26
|
+
export default AiSiteSeoStartCard;
|
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
19
|
+
import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
|
|
20
|
+
import { useUser } from "@aglyn/tenant-feature-instance";
|
|
21
|
+
import { Alert, Button, Stack, Typography } from "@mui/material";
|
|
22
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
23
|
+
import { AI_SITE_SEO_FORM_FIELDS, aiSiteSeoProposalOf } from "../model/ai-site-start-seo.js";
|
|
24
|
+
/**
|
|
25
|
+
* The site's own search listing, from the guided start's answers (AGL-2918),
|
|
26
|
+
* on the site's SEO section through the `hostSeo` zone.
|
|
27
|
+
*
|
|
28
|
+
* The guided start asks what kind of site this is and who it is for. Those
|
|
29
|
+
* two answers are exactly the site-wide search title and description every
|
|
30
|
+
* page with none of its own falls back to, and until now they reached
|
|
31
|
+
* neither: a scaffolded site published its pages listed under whatever its
|
|
32
|
+
* creation seeded. The scaffold now carries the pair as an output of the
|
|
33
|
+
* `site` job (`aiSiteSeoProposal`), and this card is where a person reads it
|
|
34
|
+
* and puts it in the form.
|
|
35
|
+
*
|
|
36
|
+
* ── It writes nothing, and it asks for nothing ───────────────────────────
|
|
37
|
+
*
|
|
38
|
+
* "Put in the form" is the zone's own `proposeDraft`: the two values land in
|
|
39
|
+
* the SEO form below as unsaved edits and the form's Update is the write. No
|
|
40
|
+
* job is started from here and no model is asked anything — the card only
|
|
41
|
+
* reads jobs the site already ran.
|
|
42
|
+
*
|
|
43
|
+
* ── Absent unless there is something to offer ────────────────────────────
|
|
44
|
+
*
|
|
45
|
+
* Nothing renders until the jobs route has admitted this workspace, so a
|
|
46
|
+
* workspace whose release flag is off sees the ordinary SEO section and no
|
|
47
|
+
* trace of this. Nothing renders either when no scaffold ever ran here, or
|
|
48
|
+
* when the site's stored SEO already says what the proposal would say —
|
|
49
|
+
* a card whose only button does nothing is worse than no card.
|
|
50
|
+
*/ /** How many recent jobs the card reads to find this site's guided start. */ const RECENT_JOBS_READ = 20;
|
|
51
|
+
/** What each value is called where the card lists it. */ const FIELD_LABELS = {
|
|
52
|
+
[AI_SITE_SEO_FORM_FIELDS.title]: 'Title',
|
|
53
|
+
[AI_SITE_SEO_FORM_FIELDS.description]: 'Description'
|
|
54
|
+
};
|
|
55
|
+
/** What the site's settings hold for one field now, read as the form seeded it. */ function storedValue(seo, field) {
|
|
56
|
+
const key = field.replace(/^seo\./, '');
|
|
57
|
+
const value = seo == null ? void 0 : seo[key];
|
|
58
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Whether the site's settings already say what the proposal says. Both values
|
|
62
|
+
* have to match: a site whose title was applied and whose description was
|
|
63
|
+
* then rewritten still has something to take.
|
|
64
|
+
*/ export function aiSiteSeoAlreadySaid(proposal, seo) {
|
|
65
|
+
return Object.entries(proposal.values).every(([field, value])=>storedValue(seo, field) === value.trim());
|
|
66
|
+
}
|
|
67
|
+
export function AiSiteSeoStartCard({ hostId, orgId, seo, proposeDraft }) {
|
|
68
|
+
var _ref;
|
|
69
|
+
const { data: user } = useUser();
|
|
70
|
+
// Held in a ref so a request reads WHO is signed in, never the identity of
|
|
71
|
+
// the object that says so.
|
|
72
|
+
const userRef = useRef(user);
|
|
73
|
+
userRef.current = user;
|
|
74
|
+
const uid = (_ref = user == null ? void 0 : user.uid) != null ? _ref : null;
|
|
75
|
+
const [verdict, setVerdict] = useState('checking');
|
|
76
|
+
const [job, setJob] = useState(null);
|
|
77
|
+
const [staged, setStaged] = useState(false);
|
|
78
|
+
useEffect(()=>{
|
|
79
|
+
if (!orgId || !hostId || !uid) return;
|
|
80
|
+
let active = true;
|
|
81
|
+
void (async ()=>{
|
|
82
|
+
try {
|
|
83
|
+
var _ref;
|
|
84
|
+
const response = await authorizedFetch(userRef.current, `/api/ai/jobs?orgId=${encodeURIComponent(orgId)}&limit=${RECENT_JOBS_READ}`);
|
|
85
|
+
if (!active) return;
|
|
86
|
+
if (!response.ok) {
|
|
87
|
+
setVerdict('hidden');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const payload = await response.json().catch(()=>null);
|
|
91
|
+
if (!active) return;
|
|
92
|
+
// The scaffold that ran for THIS site and reported a listing; the
|
|
93
|
+
// route answers newest first, so the first match is the last start.
|
|
94
|
+
const latest = ((_ref = payload == null ? void 0 : payload.jobs) != null ? _ref : []).find((entry)=>entry.kind === 'site' && entry.hostId === hostId && aiSiteSeoProposalOf(entry.outputs) !== null);
|
|
95
|
+
if (latest) setJob(latest);
|
|
96
|
+
setVerdict('ready');
|
|
97
|
+
} catch (unused) {
|
|
98
|
+
if (active) setVerdict('hidden');
|
|
99
|
+
}
|
|
100
|
+
})();
|
|
101
|
+
return ()=>{
|
|
102
|
+
active = false;
|
|
103
|
+
};
|
|
104
|
+
}, [
|
|
105
|
+
orgId,
|
|
106
|
+
hostId,
|
|
107
|
+
uid
|
|
108
|
+
]);
|
|
109
|
+
const proposal = useMemo(()=>job ? aiSiteSeoProposalOf(job.outputs) : null, [
|
|
110
|
+
job
|
|
111
|
+
]);
|
|
112
|
+
const stage = useCallback(()=>{
|
|
113
|
+
if (!job || !proposal) return;
|
|
114
|
+
proposeDraft(proposal.values, `${job.id}:site-listing`);
|
|
115
|
+
setStaged(true);
|
|
116
|
+
}, [
|
|
117
|
+
job,
|
|
118
|
+
proposal,
|
|
119
|
+
proposeDraft
|
|
120
|
+
]);
|
|
121
|
+
if (verdict !== 'ready' || !proposal) return null;
|
|
122
|
+
if (!staged && aiSiteSeoAlreadySaid(proposal, seo)) return null;
|
|
123
|
+
return /*#__PURE__*/ _jsx(CardDisplay, {
|
|
124
|
+
contentGutterX: true,
|
|
125
|
+
contentGutterY: true,
|
|
126
|
+
HeaderProps: {
|
|
127
|
+
title: 'The listing your answers describe',
|
|
128
|
+
subheader: 'What you said this site is, and who it is for, as the title and description every ' + 'page without its own falls back to. Nothing is saved until you press Update below.'
|
|
129
|
+
},
|
|
130
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
131
|
+
spacing: 2,
|
|
132
|
+
children: [
|
|
133
|
+
Object.entries(proposal.values).map(([field, value])=>{
|
|
134
|
+
var _FIELD_LABELS_field;
|
|
135
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
136
|
+
spacing: 0.25,
|
|
137
|
+
children: [
|
|
138
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
139
|
+
variant: "caption",
|
|
140
|
+
color: "text.secondary",
|
|
141
|
+
children: (_FIELD_LABELS_field = FIELD_LABELS[field]) != null ? _FIELD_LABELS_field : field
|
|
142
|
+
}),
|
|
143
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
144
|
+
variant: "body2",
|
|
145
|
+
sx: {
|
|
146
|
+
wordBreak: 'break-word'
|
|
147
|
+
},
|
|
148
|
+
children: value
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
}, field);
|
|
152
|
+
}),
|
|
153
|
+
proposal.notes.map((note)=>/*#__PURE__*/ _jsx(Typography, {
|
|
154
|
+
variant: "caption",
|
|
155
|
+
color: "text.secondary",
|
|
156
|
+
children: note
|
|
157
|
+
}, note)),
|
|
158
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
159
|
+
size: "small",
|
|
160
|
+
variant: "outlined",
|
|
161
|
+
sx: {
|
|
162
|
+
alignSelf: 'flex-start'
|
|
163
|
+
},
|
|
164
|
+
disabled: staged,
|
|
165
|
+
onClick: stage,
|
|
166
|
+
children: 'Put in the form'
|
|
167
|
+
}),
|
|
168
|
+
staged && /*#__PURE__*/ _jsx(Alert, {
|
|
169
|
+
severity: "success",
|
|
170
|
+
children: 'In the SEO form below as unsaved changes. Read them, then press Update.'
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
export default AiSiteSeoStartCard;
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=ai-site-seo-start-card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-site-seo-start-card.component.tsx"],"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\n'use client'\n\nimport type { ConsoleHostSeoZoneProps } from '@aglyn/aglyn/plugin-manager/feature-plugins'\nimport { CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\nimport { useUser } from '@aglyn/tenant-feature-instance'\nimport { Alert, Button, Stack, Typography } from '@mui/material'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport type { AiJobSummary } from '../model/ai-jobs.types'\nimport {\n AI_SITE_SEO_FORM_FIELDS,\n aiSiteSeoProposalOf,\n type AiSiteSeoProposal,\n} from '../model/ai-site-start-seo'\n\n/**\n * The site's own search listing, from the guided start's answers (AGL-2918),\n * on the site's SEO section through the `hostSeo` zone.\n *\n * The guided start asks what kind of site this is and who it is for. Those\n * two answers are exactly the site-wide search title and description every\n * page with none of its own falls back to, and until now they reached\n * neither: a scaffolded site published its pages listed under whatever its\n * creation seeded. The scaffold now carries the pair as an output of the\n * `site` job (`aiSiteSeoProposal`), and this card is where a person reads it\n * and puts it in the form.\n *\n * ── It writes nothing, and it asks for nothing ───────────────────────────\n *\n * \"Put in the form\" is the zone's own `proposeDraft`: the two values land in\n * the SEO form below as unsaved edits and the form's Update is the write. No\n * job is started from here and no model is asked anything — the card only\n * reads jobs the site already ran.\n *\n * ── Absent unless there is something to offer ────────────────────────────\n *\n * Nothing renders until the jobs route has admitted this workspace, so a\n * workspace whose release flag is off sees the ordinary SEO section and no\n * trace of this. Nothing renders either when no scaffold ever ran here, or\n * when the site's stored SEO already says what the proposal would say —\n * a card whose only button does nothing is worse than no card.\n */\n\n/** How many recent jobs the card reads to find this site's guided start. */\nconst RECENT_JOBS_READ = 20\n\ntype Verdict = 'checking' | 'ready' | 'hidden'\n\n/** What each value is called where the card lists it. */\nconst FIELD_LABELS: Record<string, string> = {\n [AI_SITE_SEO_FORM_FIELDS.title]: 'Title',\n [AI_SITE_SEO_FORM_FIELDS.description]: 'Description',\n}\n\n/** What the site's settings hold for one field now, read as the form seeded it. */\nfunction storedValue(seo: Record<string, unknown> | undefined, field: string): string {\n const key = field.replace(/^seo\\./, '')\n const value = seo?.[key]\n return typeof value === 'string' ? value.trim() : ''\n}\n\n/**\n * Whether the site's settings already say what the proposal says. Both values\n * have to match: a site whose title was applied and whose description was\n * then rewritten still has something to take.\n */\nexport function aiSiteSeoAlreadySaid(\n proposal: AiSiteSeoProposal,\n seo: Record<string, unknown> | undefined,\n): boolean {\n return Object.entries(proposal.values).every(\n ([field, value]) => storedValue(seo, field) === value.trim(),\n )\n}\n\nexport function AiSiteSeoStartCard({ hostId, orgId, seo, proposeDraft }: ConsoleHostSeoZoneProps) {\n const { data: user } = useUser()\n // Held in a ref so a request reads WHO is signed in, never the identity of\n // the object that says so.\n const userRef = useRef(user)\n userRef.current = user\n const uid = user?.uid ?? null\n const [verdict, setVerdict] = useState<Verdict>('checking')\n const [job, setJob] = useState<AiJobSummary | null>(null)\n const [staged, setStaged] = useState(false)\n\n useEffect(() => {\n if (!orgId || !hostId || !uid) return\n let active = true\n void (async () => {\n try {\n const response = await authorizedFetch(\n userRef.current,\n `/api/ai/jobs?orgId=${encodeURIComponent(orgId)}&limit=${RECENT_JOBS_READ}`,\n )\n if (!active) return\n if (!response.ok) {\n setVerdict('hidden')\n return\n }\n const payload = await response.json().catch(() => null)\n if (!active) return\n // The scaffold that ran for THIS site and reported a listing; the\n // route answers newest first, so the first match is the last start.\n const latest = ((payload?.jobs ?? []) as AiJobSummary[]).find(\n (entry) =>\n entry.kind === 'site' &&\n entry.hostId === hostId &&\n aiSiteSeoProposalOf(entry.outputs) !== null,\n )\n if (latest) setJob(latest)\n setVerdict('ready')\n } catch {\n if (active) setVerdict('hidden')\n }\n })()\n return () => {\n active = false\n }\n }, [orgId, hostId, uid])\n\n const proposal = useMemo(() => (job ? aiSiteSeoProposalOf(job.outputs) : null), [job])\n\n const stage = useCallback(() => {\n if (!job || !proposal) return\n proposeDraft(proposal.values, `${job.id}:site-listing`)\n setStaged(true)\n }, [job, proposal, proposeDraft])\n\n if (verdict !== 'ready' || !proposal) return null\n if (!staged && aiSiteSeoAlreadySaid(proposal, seo)) return null\n\n return (\n <CardDisplay\n contentGutterX\n contentGutterY\n HeaderProps={{\n title: 'The listing your answers describe',\n subheader:\n 'What you said this site is, and who it is for, as the title and description every ' +\n 'page without its own falls back to. Nothing is saved until you press Update below.',\n }}\n >\n <Stack spacing={2}>\n {Object.entries(proposal.values).map(([field, value]) => (\n <Stack key={field} spacing={0.25}>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {FIELD_LABELS[field] ?? field}\n </Typography>\n <Typography variant=\"body2\" sx={{ wordBreak: 'break-word' }}>\n {value}\n </Typography>\n </Stack>\n ))}\n {proposal.notes.map((note) => (\n <Typography key={note} variant=\"caption\" color=\"text.secondary\">\n {note}\n </Typography>\n ))}\n <Button\n size=\"small\"\n variant=\"outlined\"\n sx={{ alignSelf: 'flex-start' }}\n disabled={staged}\n onClick={stage}\n >\n {'Put in the form'}\n </Button>\n {staged && (\n <Alert severity=\"success\">\n {'In the SEO form below as unsaved changes. Read them, then press Update.'}\n </Alert>\n )}\n </Stack>\n </CardDisplay>\n )\n}\n\nexport default AiSiteSeoStartCard\n"],"names":["CardDisplay","authorizedFetch","useUser","Alert","Button","Stack","Typography","useCallback","useEffect","useMemo","useRef","useState","AI_SITE_SEO_FORM_FIELDS","aiSiteSeoProposalOf","RECENT_JOBS_READ","FIELD_LABELS","title","description","storedValue","seo","field","key","replace","value","trim","aiSiteSeoAlreadySaid","proposal","Object","entries","values","every","AiSiteSeoStartCard","hostId","orgId","proposeDraft","data","user","userRef","current","uid","verdict","setVerdict","job","setJob","staged","setStaged","active","response","encodeURIComponent","ok","payload","json","catch","latest","jobs","find","entry","kind","outputs","stage","id","contentGutterX","contentGutterY","HeaderProps","subheader","spacing","map","variant","color","sx","wordBreak","notes","note","size","alignSelf","disabled","onClick","severity"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAGA,SAASA,WAAW,QAAQ,uBAAsB;AAClD,SAASC,eAAe,QAAQ,2CAA0C;AAC1E,SAASC,OAAO,QAAQ,iCAAgC;AACxD,SAASC,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAe;AAChE,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAEzE,SACEC,uBAAuB,EACvBC,mBAAmB,QAEd,gCAA4B;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GAED,0EAA0E,GAC1E,MAAMC,mBAAmB;AAIzB,uDAAuD,GACvD,MAAMC,eAAuC;IAC3C,CAACH,wBAAwBI,KAAK,CAAC,EAAE;IACjC,CAACJ,wBAAwBK,WAAW,CAAC,EAAE;AACzC;AAEA,iFAAiF,GACjF,SAASC,YAAYC,GAAwC,EAAEC,KAAa;IAC1E,MAAMC,MAAMD,MAAME,OAAO,CAAC,UAAU;IACpC,MAAMC,QAAQJ,uBAAAA,GAAK,CAACE,IAAI;IACxB,OAAO,OAAOE,UAAU,WAAWA,MAAMC,IAAI,KAAK;AACpD;AAEA;;;;CAIC,GACD,OAAO,SAASC,qBACdC,QAA2B,EAC3BP,GAAwC;IAExC,OAAOQ,OAAOC,OAAO,CAACF,SAASG,MAAM,EAAEC,KAAK,CAC1C,CAAC,CAACV,OAAOG,MAAM,GAAKL,YAAYC,KAAKC,WAAWG,MAAMC,IAAI;AAE9D;AAEA,OAAO,SAASO,mBAAmB,EAAEC,MAAM,EAAEC,KAAK,EAAEd,GAAG,EAAEe,YAAY,EAA2B;;IAC9F,MAAM,EAAEC,MAAMC,IAAI,EAAE,GAAGlC;IACvB,2EAA2E;IAC3E,2BAA2B;IAC3B,MAAMmC,UAAU3B,OAAO0B;IACvBC,QAAQC,OAAO,GAAGF;IAClB,MAAMG,cAAMH,wBAAAA,KAAMG,GAAG,mBAAI;IACzB,MAAM,CAACC,SAASC,WAAW,GAAG9B,SAAkB;IAChD,MAAM,CAAC+B,KAAKC,OAAO,GAAGhC,SAA8B;IACpD,MAAM,CAACiC,QAAQC,UAAU,GAAGlC,SAAS;IAErCH,UAAU;QACR,IAAI,CAACyB,SAAS,CAACD,UAAU,CAACO,KAAK;QAC/B,IAAIO,SAAS;QACb,KAAK,AAAC,CAAA;YACJ,IAAI;;gBACF,MAAMC,WAAW,MAAM9C,gBACrBoC,QAAQC,OAAO,EACf,CAAC,mBAAmB,EAAEU,mBAAmBf,OAAO,OAAO,EAAEnB,kBAAkB;gBAE7E,IAAI,CAACgC,QAAQ;gBACb,IAAI,CAACC,SAASE,EAAE,EAAE;oBAChBR,WAAW;oBACX;gBACF;gBACA,MAAMS,UAAU,MAAMH,SAASI,IAAI,GAAGC,KAAK,CAAC,IAAM;gBAClD,IAAI,CAACN,QAAQ;gBACb,kEAAkE;gBAClE,oEAAoE;gBACpE,MAAMO,SAAS,SAAEH,2BAAAA,QAASI,IAAI,mBAAI,EAAE,EAAqBC,IAAI,CAC3D,CAACC,QACCA,MAAMC,IAAI,KAAK,UACfD,MAAMxB,MAAM,KAAKA,UACjBnB,oBAAoB2C,MAAME,OAAO,MAAM;gBAE3C,IAAIL,QAAQV,OAAOU;gBACnBZ,WAAW;YACb,EAAE,eAAM;gBACN,IAAIK,QAAQL,WAAW;YACzB;QACF,CAAA;QACA,OAAO;YACLK,SAAS;QACX;IACF,GAAG;QAACb;QAAOD;QAAQO;KAAI;IAEvB,MAAMb,WAAWjB,QAAQ,IAAOiC,MAAM7B,oBAAoB6B,IAAIgB,OAAO,IAAI,MAAO;QAAChB;KAAI;IAErF,MAAMiB,QAAQpD,YAAY;QACxB,IAAI,CAACmC,OAAO,CAAChB,UAAU;QACvBQ,aAAaR,SAASG,MAAM,EAAE,GAAGa,IAAIkB,EAAE,CAAC,aAAa,CAAC;QACtDf,UAAU;IACZ,GAAG;QAACH;QAAKhB;QAAUQ;KAAa;IAEhC,IAAIM,YAAY,WAAW,CAACd,UAAU,OAAO;IAC7C,IAAI,CAACkB,UAAUnB,qBAAqBC,UAAUP,MAAM,OAAO;IAE3D,qBACE,KAACnB;QACC6D,cAAc;QACdC,cAAc;QACdC,aAAa;YACX/C,OAAO;YACPgD,WACE,uFACA;QACJ;kBAEA,cAAA,MAAC3D;YAAM4D,SAAS;;gBACbtC,OAAOC,OAAO,CAACF,SAASG,MAAM,EAAEqC,GAAG,CAAC,CAAC,CAAC9C,OAAOG,MAAM;wBAG7CR;yCAFL,MAACV;wBAAkB4D,SAAS;;0CAC1B,KAAC3D;gCAAW6D,SAAQ;gCAAUC,OAAM;2CACjCrD,sBAAAA,YAAY,CAACK,MAAM,YAAnBL,sBAAuBK;;0CAE1B,KAACd;gCAAW6D,SAAQ;gCAAQE,IAAI;oCAAEC,WAAW;gCAAa;0CACvD/C;;;uBALOH;;gBASbM,SAAS6C,KAAK,CAACL,GAAG,CAAC,CAACM,qBACnB,KAAClE;wBAAsB6D,SAAQ;wBAAUC,OAAM;kCAC5CI;uBADcA;8BAInB,KAACpE;oBACCqE,MAAK;oBACLN,SAAQ;oBACRE,IAAI;wBAAEK,WAAW;oBAAa;oBAC9BC,UAAU/B;oBACVgC,SAASjB;8BAER;;gBAEFf,wBACC,KAACzC;oBAAM0E,UAAS;8BACb;;;;;AAMb;AAEA,eAAe9C,mBAAkB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { ConsoleHostFirstRunZoneProps } from '@aglyn/aglyn/plugin-manager/feature-plugins';
|
|
18
|
+
export declare function AiSiteStartCard({ hostId, orgId, startBlank, }: ConsoleHostFirstRunZoneProps): import("react").JSX.Element;
|
|
19
|
+
export default AiSiteStartCard;
|
|
@@ -0,0 +1,348 @@
|
|
|
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
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
import { lockdownRefusalText, parseLockdownRefusal } from "@aglyn/aglyn";
|
|
20
|
+
import { ICON_VARIANT_CLOSE } from "@aglyn/shared-data-enums";
|
|
21
|
+
import { MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
22
|
+
import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
|
|
23
|
+
import { useUser } from "@aglyn/tenant-feature-instance";
|
|
24
|
+
import { Alert, AppBar, Box, Button, Chip, Container, Dialog, DialogActions, DialogContent, Divider, IconButton, MenuItem, Stack, TextField, Toolbar, Typography } from "@mui/material";
|
|
25
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
26
|
+
import { AI_SITE_PAGES, AI_SITE_SUBMISSION_CHOICES, aiSiteCreditEstimate } from "../model/ai-site-job.js";
|
|
27
|
+
import { AI_SITE_START_ANSWERS, AI_SITE_START_EXAMPLES, AI_SITE_START_TYPES, aiSiteStartBrief, aiSiteStartInputs, aiSiteStartRefusal } from "../model/ai-site-start.js";
|
|
28
|
+
/** Labels the dialog for a reader, from its own heading. */ const TITLE_ID = 'ai-site-start-title';
|
|
29
|
+
export function AiSiteStartCard({ hostId, orgId, startBlank }) {
|
|
30
|
+
var _ref;
|
|
31
|
+
const { data: user } = useUser();
|
|
32
|
+
// Held in a ref so a request reads WHO is signed in, never the identity of
|
|
33
|
+
// the object that says so.
|
|
34
|
+
const userRef = useRef(user);
|
|
35
|
+
userRef.current = user;
|
|
36
|
+
const uid = (_ref = user == null ? void 0 : user.uid) != null ? _ref : null;
|
|
37
|
+
const [verdict, setVerdict] = useState('checking');
|
|
38
|
+
const [answers, setAnswers] = useState(AI_SITE_START_ANSWERS);
|
|
39
|
+
const [busy, setBusy] = useState(false);
|
|
40
|
+
const [notice, setNotice] = useState(null);
|
|
41
|
+
const [started, setStarted] = useState(false);
|
|
42
|
+
useEffect(()=>{
|
|
43
|
+
if (!orgId || !uid) return;
|
|
44
|
+
let active = true;
|
|
45
|
+
void (async ()=>{
|
|
46
|
+
try {
|
|
47
|
+
const response = await authorizedFetch(userRef.current, `/api/ai/jobs?orgId=${encodeURIComponent(orgId)}&limit=1`);
|
|
48
|
+
if (active) {
|
|
49
|
+
setVerdict(response.status === 404 || response.status === 403 ? 'hidden' : 'ready');
|
|
50
|
+
}
|
|
51
|
+
} catch (unused) {
|
|
52
|
+
if (active) setVerdict('hidden');
|
|
53
|
+
}
|
|
54
|
+
})();
|
|
55
|
+
return ()=>{
|
|
56
|
+
active = false;
|
|
57
|
+
};
|
|
58
|
+
}, [
|
|
59
|
+
orgId,
|
|
60
|
+
uid
|
|
61
|
+
]);
|
|
62
|
+
const answer = useCallback((patch)=>setAnswers((current)=>_extends({}, current, patch)), []);
|
|
63
|
+
const refusal = aiSiteStartRefusal(answers);
|
|
64
|
+
const plan = useCallback(async ()=>{
|
|
65
|
+
if (!orgId || aiSiteStartRefusal(answers)) return;
|
|
66
|
+
setBusy(true);
|
|
67
|
+
setNotice(null);
|
|
68
|
+
try {
|
|
69
|
+
const response = await authorizedFetch(userRef.current, '/api/ai/jobs', {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: {
|
|
72
|
+
'Content-Type': 'application/json'
|
|
73
|
+
},
|
|
74
|
+
body: JSON.stringify({
|
|
75
|
+
orgId,
|
|
76
|
+
hostId,
|
|
77
|
+
kind: 'site',
|
|
78
|
+
brief: aiSiteStartBrief(answers),
|
|
79
|
+
inputs: aiSiteStartInputs(answers)
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
const payload = await response.json().catch(()=>null);
|
|
83
|
+
if (!response.ok) {
|
|
84
|
+
var _ref;
|
|
85
|
+
const locked = parseLockdownRefusal(response.status, payload);
|
|
86
|
+
setNotice(locked ? lockdownRefusalText(locked) : String((_ref = payload == null ? void 0 : payload.error) != null ? _ref : 'The site could not be started. Try again.'));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
setStarted(true);
|
|
90
|
+
} catch (unused) {
|
|
91
|
+
setNotice('The site could not be started. Try again.');
|
|
92
|
+
} finally{
|
|
93
|
+
setBusy(false);
|
|
94
|
+
}
|
|
95
|
+
}, [
|
|
96
|
+
orgId,
|
|
97
|
+
hostId,
|
|
98
|
+
answers
|
|
99
|
+
]);
|
|
100
|
+
if (verdict !== 'ready') return null;
|
|
101
|
+
const estimate = aiSiteCreditEstimate(answers.pages, {
|
|
102
|
+
welcomeEmail: answers.welcomeEmail
|
|
103
|
+
});
|
|
104
|
+
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
105
|
+
open: true,
|
|
106
|
+
fullScreen: true,
|
|
107
|
+
onClose: startBlank,
|
|
108
|
+
"aria-labelledby": TITLE_ID,
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ _jsx(AppBar, {
|
|
111
|
+
position: "relative",
|
|
112
|
+
color: "surface",
|
|
113
|
+
enableColorOnDark: true,
|
|
114
|
+
children: /*#__PURE__*/ _jsxs(Toolbar, {
|
|
115
|
+
children: [
|
|
116
|
+
/*#__PURE__*/ _jsx(IconButton, {
|
|
117
|
+
edge: "start",
|
|
118
|
+
color: "inherit",
|
|
119
|
+
onClick: startBlank,
|
|
120
|
+
"aria-label": "Close the guided start",
|
|
121
|
+
children: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
122
|
+
path: ICON_VARIANT_CLOSE.path
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
126
|
+
id: TITLE_ID,
|
|
127
|
+
variant: "h6",
|
|
128
|
+
component: "div",
|
|
129
|
+
noWrap: true,
|
|
130
|
+
sx: {
|
|
131
|
+
textOverflow: 'ellipsis',
|
|
132
|
+
ml: 2,
|
|
133
|
+
flex: 1
|
|
134
|
+
},
|
|
135
|
+
children: 'Start this site with AI'
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ _jsx(Divider, {
|
|
138
|
+
sx: {
|
|
139
|
+
height: 28,
|
|
140
|
+
m: 0.5
|
|
141
|
+
},
|
|
142
|
+
orientation: "vertical"
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
145
|
+
color: "inherit",
|
|
146
|
+
onClick: startBlank,
|
|
147
|
+
children: started ? 'Close' : 'Skip and start blank'
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
})
|
|
151
|
+
}),
|
|
152
|
+
/*#__PURE__*/ _jsx(DialogContent, {
|
|
153
|
+
children: /*#__PURE__*/ _jsx(Container, {
|
|
154
|
+
maxWidth: "md",
|
|
155
|
+
disableGutters: true,
|
|
156
|
+
sx: {
|
|
157
|
+
py: 2
|
|
158
|
+
},
|
|
159
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
160
|
+
spacing: 3,
|
|
161
|
+
children: [
|
|
162
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
163
|
+
variant: "body2",
|
|
164
|
+
color: "text.secondary",
|
|
165
|
+
children: 'Answer a few questions and AI plans the whole site — its pages, its ' + 'navigation, its layout and a contact form. Nothing is built until you ' + 'confirm the plan, and everything it builds is an unpublished draft.'
|
|
166
|
+
}),
|
|
167
|
+
notice && /*#__PURE__*/ _jsx(Alert, {
|
|
168
|
+
severity: "info",
|
|
169
|
+
children: notice
|
|
170
|
+
}),
|
|
171
|
+
started ? /*#__PURE__*/ _jsx(Alert, {
|
|
172
|
+
severity: "success",
|
|
173
|
+
children: 'Your site is being planned. Open AI jobs in the Assist panel to read the plan ' + 'and confirm it — nothing is built, and nothing is published, until you do.'
|
|
174
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
175
|
+
children: [
|
|
176
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
177
|
+
children: [
|
|
178
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
179
|
+
fullWidth: true,
|
|
180
|
+
label: "What kind of site are you creating?",
|
|
181
|
+
placeholder: "a neighborhood dog groomer that takes bookings",
|
|
182
|
+
value: answers.siteType,
|
|
183
|
+
onChange: (event)=>answer({
|
|
184
|
+
siteType: event.target.value
|
|
185
|
+
})
|
|
186
|
+
}),
|
|
187
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
188
|
+
direction: "row",
|
|
189
|
+
spacing: 1,
|
|
190
|
+
sx: {
|
|
191
|
+
flexWrap: 'wrap',
|
|
192
|
+
mt: 1,
|
|
193
|
+
rowGap: 1
|
|
194
|
+
},
|
|
195
|
+
children: AI_SITE_START_TYPES.map((type)=>/*#__PURE__*/ _jsx(Chip, {
|
|
196
|
+
label: type,
|
|
197
|
+
size: "small",
|
|
198
|
+
variant: answers.siteType === type ? 'filled' : 'outlined',
|
|
199
|
+
onClick: ()=>answer({
|
|
200
|
+
siteType: type
|
|
201
|
+
})
|
|
202
|
+
}, type))
|
|
203
|
+
})
|
|
204
|
+
]
|
|
205
|
+
}),
|
|
206
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
207
|
+
fullWidth: true,
|
|
208
|
+
label: "Who is it for?",
|
|
209
|
+
placeholder: "local dog owners who want a regular groom booked online",
|
|
210
|
+
value: answers.audience,
|
|
211
|
+
onChange: (event)=>answer({
|
|
212
|
+
audience: event.target.value
|
|
213
|
+
}),
|
|
214
|
+
helperText: "Optional. It narrows who the pages are written for."
|
|
215
|
+
}),
|
|
216
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
217
|
+
children: [
|
|
218
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
219
|
+
variant: "subtitle2",
|
|
220
|
+
gutterBottom: true,
|
|
221
|
+
children: 'Which of these do you like?'
|
|
222
|
+
}),
|
|
223
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
224
|
+
variant: "body2",
|
|
225
|
+
color: "text.secondary",
|
|
226
|
+
gutterBottom: true,
|
|
227
|
+
children: 'Optional. Picking one steers the shape of the site, not its words.'
|
|
228
|
+
}),
|
|
229
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
230
|
+
direction: "row",
|
|
231
|
+
spacing: 1,
|
|
232
|
+
sx: {
|
|
233
|
+
flexWrap: 'wrap',
|
|
234
|
+
rowGap: 1
|
|
235
|
+
},
|
|
236
|
+
children: AI_SITE_START_EXAMPLES.map((example)=>/*#__PURE__*/ _jsx(Chip, {
|
|
237
|
+
label: `${example.label} — ${example.blurb}`,
|
|
238
|
+
variant: answers.example === example.id ? 'filled' : 'outlined',
|
|
239
|
+
onClick: ()=>answer({
|
|
240
|
+
example: answers.example === example.id ? null : example.id
|
|
241
|
+
})
|
|
242
|
+
}, example.id))
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
}),
|
|
246
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
247
|
+
select: true,
|
|
248
|
+
fullWidth: true,
|
|
249
|
+
label: "Where do form submissions go?",
|
|
250
|
+
value: answers.submissions,
|
|
251
|
+
onChange: (event)=>answer({
|
|
252
|
+
submissions: event.target.value
|
|
253
|
+
}),
|
|
254
|
+
helperText: "You can change this on the form itself afterwards.",
|
|
255
|
+
children: AI_SITE_SUBMISSION_CHOICES.map((option)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
256
|
+
value: option.id,
|
|
257
|
+
children: `${option.label} — ${option.blurb}`
|
|
258
|
+
}, option.id))
|
|
259
|
+
}),
|
|
260
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
261
|
+
direction: {
|
|
262
|
+
xs: 'column',
|
|
263
|
+
sm: 'row'
|
|
264
|
+
},
|
|
265
|
+
spacing: 2,
|
|
266
|
+
children: [
|
|
267
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
268
|
+
select: true,
|
|
269
|
+
label: "Pages",
|
|
270
|
+
value: answers.pages,
|
|
271
|
+
onChange: (event)=>answer({
|
|
272
|
+
pages: Number(event.target.value)
|
|
273
|
+
}),
|
|
274
|
+
sx: {
|
|
275
|
+
minWidth: 160
|
|
276
|
+
},
|
|
277
|
+
children: Array.from({
|
|
278
|
+
length: AI_SITE_PAGES.max - AI_SITE_PAGES.min + 1
|
|
279
|
+
}, (_, index)=>AI_SITE_PAGES.min + index).map((count)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
280
|
+
value: count,
|
|
281
|
+
children: count
|
|
282
|
+
}, count))
|
|
283
|
+
}),
|
|
284
|
+
/*#__PURE__*/ _jsxs(TextField, {
|
|
285
|
+
select: true,
|
|
286
|
+
label: "Welcome email",
|
|
287
|
+
value: answers.welcomeEmail ? 'yes' : 'no',
|
|
288
|
+
onChange: (event)=>answer({
|
|
289
|
+
welcomeEmail: event.target.value === 'yes'
|
|
290
|
+
}),
|
|
291
|
+
sx: {
|
|
292
|
+
minWidth: 160
|
|
293
|
+
},
|
|
294
|
+
children: [
|
|
295
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
296
|
+
value: "yes",
|
|
297
|
+
children: 'Draft one'
|
|
298
|
+
}),
|
|
299
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
300
|
+
value: "no",
|
|
301
|
+
children: 'No'
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
})
|
|
305
|
+
]
|
|
306
|
+
}),
|
|
307
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
308
|
+
variant: "body2",
|
|
309
|
+
color: "text.secondary",
|
|
310
|
+
children: `About ${estimate.toLocaleString('en-US')} credits, estimated. What it really ` + 'costs is what each step spends, and you can watch that add up while it runs.'
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
})
|
|
314
|
+
]
|
|
315
|
+
})
|
|
316
|
+
})
|
|
317
|
+
}),
|
|
318
|
+
!started && /* Wraps, because the reason and the button together are wider than a
|
|
319
|
+
phone: on one line the reason would push the button off the edge. */ /*#__PURE__*/ _jsxs(DialogActions, {
|
|
320
|
+
sx: {
|
|
321
|
+
px: 3,
|
|
322
|
+
py: 2,
|
|
323
|
+
flexWrap: 'wrap',
|
|
324
|
+
rowGap: 1
|
|
325
|
+
},
|
|
326
|
+
children: [
|
|
327
|
+
refusal && /*#__PURE__*/ _jsx(Typography, {
|
|
328
|
+
variant: "body2",
|
|
329
|
+
color: "text.secondary",
|
|
330
|
+
sx: {
|
|
331
|
+
mr: 'auto'
|
|
332
|
+
},
|
|
333
|
+
children: refusal
|
|
334
|
+
}),
|
|
335
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
336
|
+
variant: "contained",
|
|
337
|
+
disabled: busy || Boolean(refusal),
|
|
338
|
+
onClick: plan,
|
|
339
|
+
children: busy ? 'Starting…' : 'Plan my site'
|
|
340
|
+
})
|
|
341
|
+
]
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
export default AiSiteStartCard;
|
|
347
|
+
|
|
348
|
+
//# sourceMappingURL=ai-site-start-card.component.js.map
|