@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,79 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2026 Aglyn LLC
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/ // Straight from the SDK, not the admin barrel, for the reason `assist-usage.ts`
|
|
18
|
+
// gives at its head: the statics need no app, and the barrel would drag the
|
|
19
|
+
// default-app initialization into every unit test that touches a counter.
|
|
20
|
+
import { FieldValue } from "firebase-admin/firestore";
|
|
21
|
+
/**
|
|
22
|
+
* Every reason, in the order the card and the leaderboard list them: the
|
|
23
|
+
* workspace's own four first, then an allotment a manager set (AGL-2942),
|
|
24
|
+
* then the Free taste's (AGL-2925), which only a Free workspace can be
|
|
25
|
+
* refused by.
|
|
26
|
+
*/ export const ASSIST_REFUSAL_REASONS = [
|
|
27
|
+
'band',
|
|
28
|
+
'cap',
|
|
29
|
+
'messages',
|
|
30
|
+
'budget',
|
|
31
|
+
'allotment',
|
|
32
|
+
'account',
|
|
33
|
+
'requests',
|
|
34
|
+
'refusals',
|
|
35
|
+
'platform'
|
|
36
|
+
];
|
|
37
|
+
export function recordAssistRefusal(firestore, orgId, month, reason) {
|
|
38
|
+
try {
|
|
39
|
+
const ref = firestore.collection('orgs').doc(orgId).collection('assistUsage').doc(month);
|
|
40
|
+
// `set(…, { merge: true })`, never `update()`: the month document does
|
|
41
|
+
// not exist before the org's first admitted message, and a refusal can
|
|
42
|
+
// come first — a Free workspace at its daily cap on a fresh month.
|
|
43
|
+
void Promise.resolve(ref.set({
|
|
44
|
+
month,
|
|
45
|
+
refusals: {
|
|
46
|
+
[reason]: FieldValue.increment(1)
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
merge: true
|
|
50
|
+
})).catch(()=>undefined);
|
|
51
|
+
} catch (unused) {
|
|
52
|
+
// A double without `set`, a ref that could not be built — the refusal
|
|
53
|
+
// has already been decided and this must not change that.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The `refusals` map off a month document as a complete, zero-filled record.
|
|
58
|
+
*
|
|
59
|
+
* Zero-filled rather than sparse because the readers render every reason:
|
|
60
|
+
* "band 0" beside "cap 12" is the finding, and a sparse map would make the
|
|
61
|
+
* reader guess whether an absent key meant none or not yet counted. A
|
|
62
|
+
* non-numeric or negative value reads as 0 — the counter is only ever
|
|
63
|
+
* incremented, so anything else is a hand edit.
|
|
64
|
+
*/ export function assistRefusalCounts(raw) {
|
|
65
|
+
const map = raw != null ? raw : {};
|
|
66
|
+
const counts = Object.fromEntries(ASSIST_REFUSAL_REASONS.map((reason)=>{
|
|
67
|
+
var _map_reason;
|
|
68
|
+
const value = Number((_map_reason = map[reason]) != null ? _map_reason : 0);
|
|
69
|
+
return [
|
|
70
|
+
reason,
|
|
71
|
+
Number.isFinite(value) && value > 0 ? Math.floor(value) : 0
|
|
72
|
+
];
|
|
73
|
+
}));
|
|
74
|
+
return _extends({}, counts, {
|
|
75
|
+
total: ASSIST_REFUSAL_REASONS.reduce((sum, reason)=>sum + counts[reason], 0)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=assist-refusals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/usage/assist-refusals.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\n// Straight from the SDK, not the admin barrel, for the reason `assist-usage.ts`\n// gives at its head: the statics need no app, and the barrel would drag the\n// default-app initialization into every unit test that touches a counter.\nimport { FieldValue } from 'firebase-admin/firestore'\nimport type { AiRefusedBy } from '../model/ai-allotments'\n\n/**\n * THE PER-ORG REFUSAL COUNTER (AGL-2930).\n *\n * `reserveAssistMessage` refuses for four reasons and, until now, recorded\n * none of them: a refusal moved no counter by design, so the month document\n * could say how much an org spent and nothing about how often it was turned\n * away. Staff monitoring needs the second figure — a workspace refused at its\n * band forty times this month is a sales conversation, and one refused at the\n * operator's backstop is an incident — and neither is derivable from spend.\n *\n * The count lives on the SAME document the spend does, as a map:\n *\n * orgs/{orgId}/assistUsage/{YYYY-MM}.refusals.{reason}\n *\n * with `reason` one of the four `AssistRefusedBy` values. A map rather than\n * four top-level fields so a reader can take the whole thing in one `get`,\n * and so a fifth reason lands without a schema change.\n *\n * ## Fire-and-forget, and never throws\n *\n * The write is deliberately OUTSIDE the reservation transaction and off its\n * await path. A refusal is the cheap, no-token exit of the gate, and a\n * counter that could fail the refusal — or slow it, or retry the transaction\n * it was called from — would make the observation more expensive than the\n * thing observed. So this returns synchronously, swallows every error\n * including a double that has no `set`, and the only cost of a lost increment\n * is an undercount on a staff card.\n */\n\n/** A reason that actually refused — the `null` (admitted) case has no count. */\nexport type AssistRefusalReason = NonNullable<AiRefusedBy>\n\n/**\n * Every reason, in the order the card and the leaderboard list them: the\n * workspace's own four first, then an allotment a manager set (AGL-2942),\n * then the Free taste's (AGL-2925), which only a Free workspace can be\n * refused by.\n */\nexport const ASSIST_REFUSAL_REASONS: readonly AssistRefusalReason[] = [\n 'band',\n 'cap',\n 'messages',\n 'budget',\n 'allotment',\n 'account',\n 'requests',\n 'refusals',\n 'platform',\n]\n\nexport function recordAssistRefusal(\n firestore: FirebaseFirestore.Firestore,\n orgId: string,\n month: string,\n reason: AssistRefusalReason,\n): void {\n try {\n const ref = firestore\n .collection('orgs')\n .doc(orgId)\n .collection('assistUsage')\n .doc(month)\n // `set(…, { merge: true })`, never `update()`: the month document does\n // not exist before the org's first admitted message, and a refusal can\n // come first — a Free workspace at its daily cap on a fresh month.\n void Promise.resolve(\n ref.set(\n { month, refusals: { [reason]: FieldValue.increment(1) } },\n { merge: true },\n ),\n ).catch(() => undefined)\n } catch {\n // A double without `set`, a ref that could not be built — the refusal\n // has already been decided and this must not change that.\n }\n}\n\n/** Every reason's count, zero-filled, as the card and the leaderboard read them. */\nexport type AssistRefusalCounts = Record<AssistRefusalReason, number> & {\n total: number\n}\n\n/**\n * The `refusals` map off a month document as a complete, zero-filled record.\n *\n * Zero-filled rather than sparse because the readers render every reason:\n * \"band 0\" beside \"cap 12\" is the finding, and a sparse map would make the\n * reader guess whether an absent key meant none or not yet counted. A\n * non-numeric or negative value reads as 0 — the counter is only ever\n * incremented, so anything else is a hand edit.\n */\nexport function assistRefusalCounts(raw: unknown): AssistRefusalCounts {\n const map = (raw ?? {}) as Record<string, unknown>\n const counts = Object.fromEntries(\n ASSIST_REFUSAL_REASONS.map((reason) => {\n const value = Number(map[reason] ?? 0)\n return [reason, Number.isFinite(value) && value > 0 ? Math.floor(value) : 0]\n }),\n ) as Record<AssistRefusalReason, number>\n return {\n ...counts,\n total: ASSIST_REFUSAL_REASONS.reduce((sum, reason) => sum + counts[reason], 0),\n }\n}\n"],"names":["FieldValue","ASSIST_REFUSAL_REASONS","recordAssistRefusal","firestore","orgId","month","reason","ref","collection","doc","Promise","resolve","set","refusals","increment","merge","catch","undefined","assistRefusalCounts","raw","map","counts","Object","fromEntries","value","Number","isFinite","Math","floor","total","reduce","sum"],"mappings":";AAAA;;;;;;;;;;;;;;;CAeC,GAED,gFAAgF;AAChF,4EAA4E;AAC5E,0EAA0E;AAC1E,SAASA,UAAU,QAAQ,2BAA0B;AAmCrD;;;;;CAKC,GACD,OAAO,MAAMC,yBAAyD;IACpE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA;AAED,OAAO,SAASC,oBACdC,SAAsC,EACtCC,KAAa,EACbC,KAAa,EACbC,MAA2B;IAE3B,IAAI;QACF,MAAMC,MAAMJ,UACTK,UAAU,CAAC,QACXC,GAAG,CAACL,OACJI,UAAU,CAAC,eACXC,GAAG,CAACJ;QACP,uEAAuE;QACvE,uEAAuE;QACvE,mEAAmE;QACnE,KAAKK,QAAQC,OAAO,CAClBJ,IAAIK,GAAG,CACL;YAAEP;YAAOQ,UAAU;gBAAE,CAACP,OAAO,EAAEN,WAAWc,SAAS,CAAC;YAAG;QAAE,GACzD;YAAEC,OAAO;QAAK,IAEhBC,KAAK,CAAC,IAAMC;IAChB,EAAE,eAAM;IACN,sEAAsE;IACtE,0DAA0D;IAC5D;AACF;AAOA;;;;;;;;CAQC,GACD,OAAO,SAASC,oBAAoBC,GAAY;IAC9C,MAAMC,MAAOD,cAAAA,MAAO,CAAC;IACrB,MAAME,SAASC,OAAOC,WAAW,CAC/BtB,uBAAuBmB,GAAG,CAAC,CAACd;YACLc;QAArB,MAAMI,QAAQC,QAAOL,cAAAA,GAAG,CAACd,OAAO,YAAXc,cAAe;QACpC,OAAO;YAACd;YAAQmB,OAAOC,QAAQ,CAACF,UAAUA,QAAQ,IAAIG,KAAKC,KAAK,CAACJ,SAAS;SAAE;IAC9E;IAEF,OAAO,aACFH;QACHQ,OAAO5B,uBAAuB6B,MAAM,CAAC,CAACC,KAAKzB,SAAWyB,MAAMV,MAAM,CAACf,OAAO,EAAE;;AAEhF"}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The read side of the Aglyn Assist data loop (AGL-1860, AGL-2252).
|
|
19
|
+
*
|
|
20
|
+
* `orgs/{id}/assistSignals/{id}` is written on every assist turn and, until
|
|
21
|
+
* this module, was read by nothing. That is a specific kind of failure: the
|
|
22
|
+
* signal document exists BECAUSE AGL-1972 split the prose from the analytics
|
|
23
|
+
* so the corpus could outlive the 180-day expiry on what people typed. A
|
|
24
|
+
* corpus preserved for a reader that does not exist is just retention.
|
|
25
|
+
*
|
|
26
|
+
* Three questions, answered from one pass:
|
|
27
|
+
*
|
|
28
|
+
* 1. **Where are the docs thin?** Rank the cited docs paths by how often a
|
|
29
|
+
* question landed on them and how often the answer was rated down. A
|
|
30
|
+
* page cited constantly and rated down is a page that is being FOUND and
|
|
31
|
+
* is not answering — the single most actionable row in the set, and the
|
|
32
|
+
* one AGL-1860 wants turned into a docs issue.
|
|
33
|
+
* 2. **What did retrieval miss entirely?** A turn with no `docsPaths` is a
|
|
34
|
+
* question the corpus could not match at all, so the model answered
|
|
35
|
+
* ungrounded. That is a sharper gap signal than a low rating, and it is
|
|
36
|
+
* invisible in any ranking keyed on paths — a missing page cites nothing,
|
|
37
|
+
* so it appears nowhere. It is counted separately, by ROUTE, so the gap
|
|
38
|
+
* comes with the screen the person was looking at when they hit it.
|
|
39
|
+
* 3. **What is this costing, and to whom?** Per-org and fleet-wide token and
|
|
40
|
+
* dollar rollups, plus the cache-read rate. That last one settles a
|
|
41
|
+
* question the chat route could only pose: the cached system prefix
|
|
42
|
+
* measures 1,030–1,190 tokens against Sonnet 5's 1,024-token minimum, so
|
|
43
|
+
* whether it caches at all is an empirical question and `cacheReadTokens`
|
|
44
|
+
* is the only evidence. A prefix under the minimum caches silently not at
|
|
45
|
+
* all, and the bill is the only place it shows.
|
|
46
|
+
*
|
|
47
|
+
* Pure and free of Firestore, so it can be tested on fixtures rather than on
|
|
48
|
+
* a mocked SDK — the route does the reading, this does the arithmetic.
|
|
49
|
+
*/
|
|
50
|
+
/** One `assistSignals` document, as the route projects it. */
|
|
51
|
+
export interface AssistSignalRow {
|
|
52
|
+
orgId: string;
|
|
53
|
+
/**
|
|
54
|
+
* The signal's document id, which IS the exchange's id (AGL-2314).
|
|
55
|
+
*
|
|
56
|
+
* `recordAssistExchange` mints one id and writes both halves under it —
|
|
57
|
+
* `assistExchanges/{id}` for the prose that expires and `assistSignals/{id}`
|
|
58
|
+
* for the analytics that do not — deliberately, "so an exchange and its
|
|
59
|
+
* signal are joinable for as long as both exist, without storing a second
|
|
60
|
+
* pointer that could rot". Nothing ever made the join. This is the field
|
|
61
|
+
* that lets the corpus be read.
|
|
62
|
+
*/
|
|
63
|
+
exchangeId: string;
|
|
64
|
+
route: string;
|
|
65
|
+
/**
|
|
66
|
+
* What the turn was for, as the rollups name it (AGL-2937): `assist`, a
|
|
67
|
+
* besigner mode, or a job kind. A signal written before the field is read
|
|
68
|
+
* by its route, where a generation job's step reads as `job`.
|
|
69
|
+
*/
|
|
70
|
+
kind?: string;
|
|
71
|
+
model: string;
|
|
72
|
+
tier: 'free' | 'entitled' | string;
|
|
73
|
+
inputTokens: number;
|
|
74
|
+
outputTokens: number;
|
|
75
|
+
cacheReadTokens: number;
|
|
76
|
+
cacheWriteTokens: number;
|
|
77
|
+
/**
|
|
78
|
+
* What this turn cost us, at the serving model's provider rates. Every
|
|
79
|
+
* dollar mined out of this module is that figure: the signals page asks
|
|
80
|
+
* one money question and it is "what are we spending" (AGL-3015).
|
|
81
|
+
*/
|
|
82
|
+
providerCostUsd: number;
|
|
83
|
+
docsPaths: string[];
|
|
84
|
+
stopReason: string | null;
|
|
85
|
+
feedback: 'up' | 'down' | null;
|
|
86
|
+
/** Served with no model call — docs retrieval or a cache hit (AGL-2486). */
|
|
87
|
+
deflected: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface DocsGapRow {
|
|
90
|
+
path: string;
|
|
91
|
+
/** Turns that cited this path. */
|
|
92
|
+
questions: number;
|
|
93
|
+
up: number;
|
|
94
|
+
down: number;
|
|
95
|
+
/** Distinct orgs that landed here — a gap one org has is not a gap. */
|
|
96
|
+
orgs: number;
|
|
97
|
+
providerCostUsd: number;
|
|
98
|
+
/** `down / (up + down)`, or null when nobody rated. */
|
|
99
|
+
downRate: number | null;
|
|
100
|
+
}
|
|
101
|
+
export interface UngroundedRoute {
|
|
102
|
+
route: string;
|
|
103
|
+
questions: number;
|
|
104
|
+
down: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A turn whose PROSE is worth reading (AGL-2314).
|
|
108
|
+
*
|
|
109
|
+
* `assistExchanges` holds the verbatim half — the question a customer typed
|
|
110
|
+
* and the answer we gave — for 180 days, and the module header calls it "the
|
|
111
|
+
* data loop's corpus". No corpus consumer existed: nothing in the repo read
|
|
112
|
+
* the collection, so we were retaining customers' words, and publicly
|
|
113
|
+
* promising to, for zero product value.
|
|
114
|
+
*
|
|
115
|
+
* The shortlist is deliberately NOT every turn. Prose is fetched only for
|
|
116
|
+
* turns that FAILED — rated thumbs-down, or grounded in no documentation at
|
|
117
|
+
* all — because those are the ones where the counts cannot say what went
|
|
118
|
+
* wrong and the words can. Reading the successful ones would be surveillance
|
|
119
|
+
* with a dashboard on it.
|
|
120
|
+
*/
|
|
121
|
+
export interface ProseCandidate {
|
|
122
|
+
orgId: string;
|
|
123
|
+
/**
|
|
124
|
+
* That workspace by name, filled in by the route.
|
|
125
|
+
*
|
|
126
|
+
* Optional because this module is pure and Firestore-free: it can count a
|
|
127
|
+
* workspace's turns and it cannot know what the workspace is called. The
|
|
128
|
+
* route resolves the labels and the reader falls back to the id, so a
|
|
129
|
+
* workspace outside the lookup is still a lead somebody can search for.
|
|
130
|
+
*/
|
|
131
|
+
orgLabel?: string | null;
|
|
132
|
+
exchangeId: string;
|
|
133
|
+
/** The console screen the question was asked from. */
|
|
134
|
+
route: string;
|
|
135
|
+
feedback: 'up' | 'down' | null;
|
|
136
|
+
/** False when retrieval cited no documentation at all. */
|
|
137
|
+
grounded: boolean;
|
|
138
|
+
}
|
|
139
|
+
export interface OrgCostRow {
|
|
140
|
+
orgId: string;
|
|
141
|
+
/** That workspace by name — see {@link ProseCandidate.orgLabel}. */
|
|
142
|
+
orgLabel?: string | null;
|
|
143
|
+
messages: number;
|
|
144
|
+
inputTokens: number;
|
|
145
|
+
outputTokens: number;
|
|
146
|
+
cacheReadTokens: number;
|
|
147
|
+
cacheWriteTokens: number;
|
|
148
|
+
providerCostUsd: number;
|
|
149
|
+
down: number;
|
|
150
|
+
}
|
|
151
|
+
/** One row of a cost breakdown — see `totals.byTier` / `totals.byModel`. */
|
|
152
|
+
export interface CostSplit {
|
|
153
|
+
messages: number;
|
|
154
|
+
providerCostUsd: number;
|
|
155
|
+
}
|
|
156
|
+
/** One kind of model turn, summed (AGL-2937) — see `totals.byKind`. */
|
|
157
|
+
export interface KindTokenSplit {
|
|
158
|
+
messages: number;
|
|
159
|
+
providerCostUsd: number;
|
|
160
|
+
inputTokens: number;
|
|
161
|
+
outputTokens: number;
|
|
162
|
+
cacheReadTokens: number;
|
|
163
|
+
cacheWriteTokens: number;
|
|
164
|
+
/**
|
|
165
|
+
* The output 95 of every 100 turns of this kind stayed within, by nearest
|
|
166
|
+
* rank — the figure a kind's `max_tokens` is sized against.
|
|
167
|
+
*/
|
|
168
|
+
outputP95: number;
|
|
169
|
+
/** The share of this kind's prompt tokens the cache served — `aiCacheHitRate`. */
|
|
170
|
+
cacheHitRate: number | null;
|
|
171
|
+
}
|
|
172
|
+
/** The kinds as the board lists them, dearest first. */
|
|
173
|
+
export declare function kindTokenRows(split: Record<string, KindTokenSplit>): Array<KindTokenSplit & {
|
|
174
|
+
kind: string;
|
|
175
|
+
}>;
|
|
176
|
+
/** A sample's value at a percentile by nearest rank — always one that was seen; 0 for none. */
|
|
177
|
+
export declare function nearestRankPercentile(values: readonly number[], percentile: number): number;
|
|
178
|
+
/**
|
|
179
|
+
* A cost breakdown as a sorted, labelled list — dearest first (AGL-2340).
|
|
180
|
+
*
|
|
181
|
+
* Exported because the ordering is the readable half. A breakdown in
|
|
182
|
+
* whatever order the keys happened to be inserted is a table you have to
|
|
183
|
+
* scan; the point of the panel is that the expensive line is the top line.
|
|
184
|
+
*/
|
|
185
|
+
export declare function costSplitRows(split: Record<string, CostSplit>): {
|
|
186
|
+
key: string;
|
|
187
|
+
messages: number;
|
|
188
|
+
providerCostUsd: number;
|
|
189
|
+
}[];
|
|
190
|
+
/**
|
|
191
|
+
* One workspace on the month's spend leaderboard (AGL-2930).
|
|
192
|
+
*
|
|
193
|
+
* Read off `assistUsage/{month}` rather than off the signals: the signals
|
|
194
|
+
* carry every turn ever recorded and no month, so ranking them answers
|
|
195
|
+
* "who has spent the most since the beginning", and the board's question is
|
|
196
|
+
* "who is spending the most NOW". The month document is also where the
|
|
197
|
+
* refusal counter lives, so the row can say how often the org was refused
|
|
198
|
+
* beside how much it spent — the two numbers a staff reader compares.
|
|
199
|
+
*/
|
|
200
|
+
export interface AssistSpendRow {
|
|
201
|
+
orgId: string;
|
|
202
|
+
orgLabel?: string | null;
|
|
203
|
+
plan: string;
|
|
204
|
+
aiAddon: boolean;
|
|
205
|
+
/** Credits drawn this month, from the measured spend. */
|
|
206
|
+
credits: number;
|
|
207
|
+
providerCostUsd: number;
|
|
208
|
+
refusals: {
|
|
209
|
+
band: number;
|
|
210
|
+
cap: number;
|
|
211
|
+
messages: number;
|
|
212
|
+
budget: number;
|
|
213
|
+
/** A hard AI allotment a manager set (AGL-2942). */
|
|
214
|
+
allotment: number;
|
|
215
|
+
/** The Free taste's rungs (AGL-2925); zero on every paid workspace. */
|
|
216
|
+
account: number;
|
|
217
|
+
requests: number;
|
|
218
|
+
refusals: number;
|
|
219
|
+
platform: number;
|
|
220
|
+
total: number;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/** The Free taste's refusals as one figure: the board names the wall, not each rung. */
|
|
224
|
+
export declare function freeTasteRefusals(refusals: AssistSpendRow['refusals']): number;
|
|
225
|
+
/**
|
|
226
|
+
* The leaderboard's ordering: dearest first, then most credits, then by id
|
|
227
|
+
* so two equal rows render in one stable order rather than the order the
|
|
228
|
+
* scan happened to return them in. Returns the top `limit` and how many
|
|
229
|
+
* were ranked, so the page can say "top 25 of 140" rather than imply the
|
|
230
|
+
* cut is the whole fleet.
|
|
231
|
+
*/
|
|
232
|
+
export declare function rankAssistSpend(rows: readonly AssistSpendRow[], limit: number): {
|
|
233
|
+
rows: AssistSpendRow[];
|
|
234
|
+
ranked: number;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Today's platform-wide free-tier AI spend against its daily ceiling
|
|
238
|
+
* (AGL-2925), as the route reads it beside the mined signals. Declared here,
|
|
239
|
+
* where the page's report type lives, so the client page needs no import
|
|
240
|
+
* from the admin library to name it.
|
|
241
|
+
*/
|
|
242
|
+
export interface AssistFreeSpendReadout {
|
|
243
|
+
/** The UTC day the figures describe. */
|
|
244
|
+
day: string;
|
|
245
|
+
/**
|
|
246
|
+
* The day's free spend as the CEILING measures it — the billed figure,
|
|
247
|
+
* because the ceiling this is compared against was sized against it and
|
|
248
|
+
* the reservation refuses on the same reading (AGL-3015). The one dollar
|
|
249
|
+
* on this page that is not our provider bill, and it is a wall rather than
|
|
250
|
+
* a cost.
|
|
251
|
+
*/
|
|
252
|
+
estCostUsd: number;
|
|
253
|
+
requests: number;
|
|
254
|
+
refusals: number;
|
|
255
|
+
ceilingUsd: number;
|
|
256
|
+
/** True once staff were mailed at 80% today. */
|
|
257
|
+
alerted: boolean;
|
|
258
|
+
/** True while every Free workspace is refused generation for the day. */
|
|
259
|
+
paused: boolean;
|
|
260
|
+
}
|
|
261
|
+
export interface AssistMiningReport {
|
|
262
|
+
scanned: number;
|
|
263
|
+
/** True when the read hit its ceiling — see `mineAssistSignals`. */
|
|
264
|
+
truncated: boolean;
|
|
265
|
+
totals: {
|
|
266
|
+
messages: number;
|
|
267
|
+
inputTokens: number;
|
|
268
|
+
outputTokens: number;
|
|
269
|
+
cacheReadTokens: number;
|
|
270
|
+
cacheWriteTokens: number;
|
|
271
|
+
providerCostUsd: number;
|
|
272
|
+
/**
|
|
273
|
+
* Turns answered with NO model call — docs retrieval or an answer-cache
|
|
274
|
+
* hit (AGL-2486). Counted separately from `messages`, which is every
|
|
275
|
+
* turn, so `deflected / messages` is the deflection rate.
|
|
276
|
+
*/
|
|
277
|
+
deflected: number;
|
|
278
|
+
/**
|
|
279
|
+
* That rate, or `null` when nothing was scanned.
|
|
280
|
+
*
|
|
281
|
+
* Nullable rather than 0 for the reason `costUsd` on a reservation is:
|
|
282
|
+
* "no turns were scanned" and "every turn cost a model call" are opposite
|
|
283
|
+
* findings, and 0 says the second one when the truth is the first. This
|
|
284
|
+
* is the headline number for whether Assist is affordable to leave on,
|
|
285
|
+
* and it must not be able to report a false alarm on an idle month.
|
|
286
|
+
*/
|
|
287
|
+
deflectionRate: number | null;
|
|
288
|
+
/**
|
|
289
|
+
* Share of prompt tokens served from cache — reads over everything the
|
|
290
|
+
* prompts were billed as, cache writes included (`aiCacheHitRate`) — or
|
|
291
|
+
* null at zero.
|
|
292
|
+
*/
|
|
293
|
+
cacheReadRate: number | null;
|
|
294
|
+
/**
|
|
295
|
+
* Cost split by entitlement tier, then by model (AGL-2340).
|
|
296
|
+
*
|
|
297
|
+
* Both carried as `{ messages, providerCostUsd }` rather than a bare turn
|
|
298
|
+
* count, because the questions these answer are money questions and a
|
|
299
|
+
* count cannot answer either of them. `byTier` settles "is the free tier
|
|
300
|
+
* eating the margin, or are paying orgs?" — the free tier can be a
|
|
301
|
+
* minority of turns and a majority of spend, and a count says the
|
|
302
|
+
* opposite of the truth in exactly that case. `byModel` settles "would a
|
|
303
|
+
* cheaper model on the common path fix this?", where the whole point is
|
|
304
|
+
* that turns and dollars do not move together.
|
|
305
|
+
*/
|
|
306
|
+
byTier: Record<string, CostSplit>;
|
|
307
|
+
byModel: Record<string, CostSplit>;
|
|
308
|
+
/**
|
|
309
|
+
* Model turns split by what they were for (AGL-2937): cost, the four
|
|
310
|
+
* token counts, the p95 output and the cache hit rate of each kind. A
|
|
311
|
+
* turn answered with no model call has no tokens to split and is left
|
|
312
|
+
* out.
|
|
313
|
+
*/
|
|
314
|
+
byKind: Record<string, KindTokenSplit>;
|
|
315
|
+
stopReasons: Record<string, number>;
|
|
316
|
+
feedback: {
|
|
317
|
+
up: number;
|
|
318
|
+
down: number;
|
|
319
|
+
none: number;
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
docsGaps: DocsGapRow[];
|
|
323
|
+
/**
|
|
324
|
+
* How tall each ranking was BEFORE it was cut to `limit`.
|
|
325
|
+
*
|
|
326
|
+
* `truncated` reports only that the SCAN hit its ceiling. It says nothing
|
|
327
|
+
* about the rankings built from what was scanned, and those are cut too —
|
|
328
|
+
* every list below is sliced to `limit`. A table showing twenty-five of a
|
|
329
|
+
* hundred and thirty-seven cited pages looks exactly like one showing all
|
|
330
|
+
* twenty-five there are, which is the AGL-2220 shape the scan ceiling was
|
|
331
|
+
* given a banner to avoid, reproduced one layer down.
|
|
332
|
+
*
|
|
333
|
+
* Counted rather than inferred from `length === limit`: a ranking that is
|
|
334
|
+
* exactly `limit` rows tall is the case where the guess is wrong in both
|
|
335
|
+
* directions.
|
|
336
|
+
*/
|
|
337
|
+
ranked: {
|
|
338
|
+
docsGaps: number;
|
|
339
|
+
ungroundedRoutes: number;
|
|
340
|
+
orgs: number;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Today's free-tier spend against the platform ceiling (AGL-2925).
|
|
344
|
+
* Optional because the miner is pure and does not produce it — the route
|
|
345
|
+
* reads it from Firestore and attaches it beside the mined report.
|
|
346
|
+
*/
|
|
347
|
+
freeSpend?: AssistFreeSpendReadout;
|
|
348
|
+
/** Turns whose words are worth reading — see {@link ProseCandidate}. */
|
|
349
|
+
proseCandidates: ProseCandidate[];
|
|
350
|
+
ungrounded: {
|
|
351
|
+
questions: number;
|
|
352
|
+
down: number;
|
|
353
|
+
routes: UngroundedRoute[];
|
|
354
|
+
};
|
|
355
|
+
orgs: OrgCostRow[];
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Normalize one raw signal document. Every field is defaulted, because a
|
|
359
|
+
* signal written by an older build is still evidence and dropping it would
|
|
360
|
+
* bias the ranking toward whatever shipped most recently.
|
|
361
|
+
*/
|
|
362
|
+
export declare function assistSignalRow(orgId: string, exchangeId: string, data: Record<string, unknown>): AssistSignalRow;
|
|
363
|
+
/**
|
|
364
|
+
* Rank the docs gaps and roll the money up.
|
|
365
|
+
*
|
|
366
|
+
* `truncated` is carried through rather than hidden. A sweep that quietly
|
|
367
|
+
* stops at a ceiling and presents the remainder as the whole is the AGL-2220
|
|
368
|
+
* defect, and it is worse here than there: a partial sample of a RANKING
|
|
369
|
+
* looks exactly like a complete one, and the thing being ranked is where to
|
|
370
|
+
* spend documentation effort.
|
|
371
|
+
*/
|
|
372
|
+
export declare function mineAssistSignals(rows: AssistSignalRow[], options?: {
|
|
373
|
+
truncated?: boolean;
|
|
374
|
+
limit?: number;
|
|
375
|
+
}): AssistMiningReport;
|