@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,464 @@
|
|
|
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 { UpstreamServiceError } from '@aglyn/shared-util-errors';
|
|
18
|
+
/**
|
|
19
|
+
* The provider contract (AGL-2939): the one shape every AI door speaks, and
|
|
20
|
+
* the one thing an adapter has to implement. The runtime, the gate, the
|
|
21
|
+
* jobs, the doctrine and the usage code import this and never a vendor
|
|
22
|
+
* URL, header or model literal — Anthropic is one adapter behind it, and
|
|
23
|
+
* an OpenAI-compatible endpoint is the second, which is what proves the
|
|
24
|
+
* seam holds.
|
|
25
|
+
*
|
|
26
|
+
* ── Prompt caching, by construction ───────────────────────────────────────
|
|
27
|
+
*
|
|
28
|
+
* `system` is an ordered list of blocks, and caching is a PREFIX match: a
|
|
29
|
+
* breakpoint covers every block before it, and one byte that differs per
|
|
30
|
+
* request anywhere inside that prefix gives every distinct value its own
|
|
31
|
+
* copy of it. The AGL-2352 rule is that no per-org byte may sit inside a
|
|
32
|
+
* cached prefix — a white-label brand name interpolated into a cached block
|
|
33
|
+
* multiplies the prefix count by the number of brands, each written off its
|
|
34
|
+
* own traffic and expired before it is read. So a block marked `volatile`
|
|
35
|
+
* may not sit at or before the last `cacheBreakpoint`, and the runtime
|
|
36
|
+
* refuses the request before a byte leaves the process. A provider with no
|
|
37
|
+
* cache honors the order and ignores the markers.
|
|
38
|
+
*
|
|
39
|
+
* ── Structured output ─────────────────────────────────────────────────────
|
|
40
|
+
*
|
|
41
|
+
* A `tools` entry is sent strict, with additional properties forbidden on
|
|
42
|
+
* its schema, so a tool call's `input` validates against the schema
|
|
43
|
+
* exactly. Tool choice stays automatic — forced tool use is not portable
|
|
44
|
+
* across models — and the caller's system text names the tool it wants. An
|
|
45
|
+
* adapter delivers `input` as an object; a stream assembles it from
|
|
46
|
+
* fragments and parses the whole once, at the block's end. Nothing
|
|
47
|
+
* string-matches the serialized form: models differ in how they escape it.
|
|
48
|
+
* A provider bounds how much strict schema one request may carry, and an
|
|
49
|
+
* adapter declares those bounds as `toolSchemaLimits`: three bounds a vendor
|
|
50
|
+
* publishes and counts, and a fourth, the size of the grammar the schemas
|
|
51
|
+
* compile to, that none publishes and only a live request settles.
|
|
52
|
+
*
|
|
53
|
+
* ── Thinking ──────────────────────────────────────────────────────────────
|
|
54
|
+
*
|
|
55
|
+
* `thinking: 'off'` and `'adaptive'` are sent when the provider has the
|
|
56
|
+
* control; an omitted field sends NOTHING, leaving the model's own default
|
|
57
|
+
* in force. The omission is deliberate rather than a gap: some models
|
|
58
|
+
* reject an explicit setting, and the copy assistant serves its element
|
|
59
|
+
* mode on such a model. `effort` rides the same rule.
|
|
60
|
+
*
|
|
61
|
+
* ── Pictures ──────────────────────────────────────────────────────────────
|
|
62
|
+
*
|
|
63
|
+
* A user turn may carry pictures beside its text (AGL-2916): `content` is
|
|
64
|
+
* then an ordered list of parts, and a turn with nothing but text stays a
|
|
65
|
+
* string, which every adapter passes through as it always has. A picture is
|
|
66
|
+
* base64 bytes of one of `AI_IMAGE_MEDIA_TYPES`, never a URL, so no provider
|
|
67
|
+
* fetches anything on the platform's behalf. The runtime refuses a picture
|
|
68
|
+
* on an assistant turn, a picture for a model whose descriptor does not say
|
|
69
|
+
* `vision`, and a picture past the size or count bounds, all before any
|
|
70
|
+
* network is touched. Each adapter maps the parts onto its vendor's shape.
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* One system block. `cacheBreakpoint` marks the end of a cacheable prefix;
|
|
74
|
+
* `volatile` declares that the text carries a per-request or per-org byte
|
|
75
|
+
* and therefore may never sit inside one.
|
|
76
|
+
*/
|
|
77
|
+
export interface AiSystemBlock {
|
|
78
|
+
text: string;
|
|
79
|
+
cacheBreakpoint?: true;
|
|
80
|
+
volatile?: true;
|
|
81
|
+
}
|
|
82
|
+
/** A structured-output tool. `strict` is required, not optional. */
|
|
83
|
+
export interface AiTool {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
/** A JSON schema of `type: 'object'`; `additionalProperties` is forced off. */
|
|
87
|
+
inputSchema: Record<string, unknown>;
|
|
88
|
+
strict: true;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* How much of a request's strict tools a provider can compile (AGL-3096). A
|
|
92
|
+
* provider that constrains decoding to a tool's schema compiles every strict
|
|
93
|
+
* schema of a request together, before the model runs, and refuses a request
|
|
94
|
+
* whose schemas are past its bounds. That refusal is permanent: the schema is
|
|
95
|
+
* the same on every retry. Each bound is a TOTAL over every strict tool one
|
|
96
|
+
* request sends, as `aiToolSchemaCounts` counts them. A bound left out is one
|
|
97
|
+
* the provider does not state.
|
|
98
|
+
*
|
|
99
|
+
* A provider may also refuse a request whose schemas compile to too large a
|
|
100
|
+
* grammar, which none of the published counts can see: a request counting 1
|
|
101
|
+
* strict tool, 0 optional parameters and 1 union was refused for exactly that
|
|
102
|
+
* (AGL-3096). `compiledSchemaBytes` stands in for it, on live evidence.
|
|
103
|
+
*/
|
|
104
|
+
export interface AiToolSchemaLimits {
|
|
105
|
+
/** The most strict tools one request may send. */
|
|
106
|
+
strictTools?: number;
|
|
107
|
+
/** The most properties, across every strict schema, left out of their object's `required`. */
|
|
108
|
+
optionalParameters?: number;
|
|
109
|
+
/** The most schemas, across every strict schema, that are a union: an `anyOf` or `oneOf`, or a list of types. */
|
|
110
|
+
unionParameters?: number;
|
|
111
|
+
/**
|
|
112
|
+
* The most bytes of schema a request's grammar may be compiled from, as
|
|
113
|
+
* `aiToolSchemaCompiledBytes` measures them.
|
|
114
|
+
*
|
|
115
|
+
* Unlike the bounds above, this one is EMPIRICAL. A provider refuses a
|
|
116
|
+
* request whose compiled grammar is too large without publishing the size,
|
|
117
|
+
* so the number here is not read off a vendor's page: it is the largest a
|
|
118
|
+
* live request has been watched to carry, and every number above it is
|
|
119
|
+
* unknown rather than safe. Raising it on an offline measurement alone
|
|
120
|
+
* puts the guard back where it could not see the break.
|
|
121
|
+
*/
|
|
122
|
+
compiledSchemaBytes?: number;
|
|
123
|
+
}
|
|
124
|
+
/** A request's strict tools, counted on the measures `AiToolSchemaLimits` bounds. */
|
|
125
|
+
export type AiToolSchemaCounts = Required<AiToolSchemaLimits>;
|
|
126
|
+
/**
|
|
127
|
+
* The bytes of schema a request's grammar is compiled from, over all its
|
|
128
|
+
* strict tools. It is a stand-in for the size of the grammar itself, which
|
|
129
|
+
* nothing outside the provider can measure, and it errs toward more: a `$ref`
|
|
130
|
+
* counts at each place it is used, because a compiler that writes it out
|
|
131
|
+
* there pays for it there.
|
|
132
|
+
*/
|
|
133
|
+
export declare function aiToolSchemaCompiledBytes(tools: readonly AiTool[]): number;
|
|
134
|
+
/**
|
|
135
|
+
* The strict tools of one request, counted on each measure a provider bounds.
|
|
136
|
+
* Every tool the contract sends is strict. Each schema is walked whole: every
|
|
137
|
+
* property, every `items`, every branch of an `anyOf`, `allOf` or `oneOf`, and
|
|
138
|
+
* a local `$ref` at each place it is used. A union nested in an array's items
|
|
139
|
+
* or in another union's branch counts on its own, as it does for a provider
|
|
140
|
+
* that compiles it; a `$ref` counted where it is used errs toward more.
|
|
141
|
+
*/
|
|
142
|
+
export declare function aiToolSchemaCounts(tools: readonly AiTool[]): AiToolSchemaCounts;
|
|
143
|
+
/** Each bound a request's tools are past, as a sentence; empty when every one holds. */
|
|
144
|
+
export declare function aiToolSchemaBreaches(tools: readonly AiTool[], limits: AiToolSchemaLimits | undefined): string[];
|
|
145
|
+
export type AiEffort = 'low' | 'medium' | 'high';
|
|
146
|
+
export type AiThinking = 'off' | 'adaptive';
|
|
147
|
+
/**
|
|
148
|
+
* The picture formats a request may carry (AGL-2916): the four every model
|
|
149
|
+
* the catalog marks as reading images accepts. A door converts anything else
|
|
150
|
+
* — an AVIF, an SVG — before it attaches the picture, or attaches none.
|
|
151
|
+
*/
|
|
152
|
+
export declare const AI_IMAGE_MEDIA_TYPES: readonly ["image/jpeg", "image/png", "image/webp", "image/gif"];
|
|
153
|
+
export type AiImageMediaType = (typeof AI_IMAGE_MEDIA_TYPES)[number];
|
|
154
|
+
/**
|
|
155
|
+
* The largest picture one part may carry, in decoded bytes: the ceiling the
|
|
156
|
+
* providers behind the contract accept for one image. A door that attaches a
|
|
157
|
+
* picture resizes it far below this; the runtime refuses anything above it
|
|
158
|
+
* before a byte leaves the process, rather than letting the provider do it
|
|
159
|
+
* after the request was paid for in time.
|
|
160
|
+
*/
|
|
161
|
+
export declare const AI_IMAGE_MAX_BYTES: number;
|
|
162
|
+
/** The most pictures one request may carry. */
|
|
163
|
+
export declare const AI_REQUEST_MAX_IMAGES = 8;
|
|
164
|
+
/** Text in a message made of parts. */
|
|
165
|
+
export interface AiTextPart {
|
|
166
|
+
type: 'text';
|
|
167
|
+
text: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* A picture in a message (AGL-2916): its bytes, base64-encoded, and their
|
|
171
|
+
* format. Only a USER turn carries one, and only to a model whose descriptor
|
|
172
|
+
* says it reads images; the runtime refuses any other request before a byte
|
|
173
|
+
* leaves the process, so a door cannot send a picture by accident to a model
|
|
174
|
+
* that would reject it, or to a turn the model wrote.
|
|
175
|
+
*/
|
|
176
|
+
export interface AiImagePart {
|
|
177
|
+
type: 'image';
|
|
178
|
+
mediaType: AiImageMediaType;
|
|
179
|
+
/** The picture's bytes, base64-encoded, with no `data:` prefix. */
|
|
180
|
+
data: string;
|
|
181
|
+
}
|
|
182
|
+
export type AiMessagePart = AiTextPart | AiImagePart;
|
|
183
|
+
export interface AiMessage {
|
|
184
|
+
role: 'user' | 'assistant';
|
|
185
|
+
/**
|
|
186
|
+
* The turn's text, or its parts in order — text and pictures — for a door
|
|
187
|
+
* that shows the model an image. A door with nothing but text sends a
|
|
188
|
+
* string, which every adapter passes through as it always has.
|
|
189
|
+
*/
|
|
190
|
+
content: string | readonly AiMessagePart[];
|
|
191
|
+
}
|
|
192
|
+
/** A message's text: its parts' text joined, with every picture left out. */
|
|
193
|
+
export declare function aiMessageText(message: Pick<AiMessage, 'content'>): string;
|
|
194
|
+
/** Every picture a list of messages carries, in order. */
|
|
195
|
+
export declare function aiMessageImages(messages: readonly Pick<AiMessage, 'content'>[]): AiImagePart[];
|
|
196
|
+
/** The decoded size of a base64 string, without decoding it. */
|
|
197
|
+
export declare function aiBase64Bytes(data: string): number;
|
|
198
|
+
/** What every door hands the runtime; `provider` and `model` resolve there. */
|
|
199
|
+
export interface AiRequestBase {
|
|
200
|
+
model: string;
|
|
201
|
+
system: AiSystemBlock[];
|
|
202
|
+
messages: AiMessage[];
|
|
203
|
+
tools?: AiTool[];
|
|
204
|
+
maxTokens: number;
|
|
205
|
+
effort?: AiEffort;
|
|
206
|
+
thinking?: AiThinking;
|
|
207
|
+
signal?: AbortSignal;
|
|
208
|
+
}
|
|
209
|
+
/** The request an adapter receives: the runtime has already validated it. */
|
|
210
|
+
export interface AiProviderRequest extends AiRequestBase {
|
|
211
|
+
/** The provider's own key, resolved by the runtime from the environment or the org's setting. */
|
|
212
|
+
apiKey: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Token usage in the meter's shape. Cache reads and writes are separate
|
|
216
|
+
* because they are priced separately; a provider with no cache reports 0.
|
|
217
|
+
*/
|
|
218
|
+
export interface AiUsage {
|
|
219
|
+
inputTokens: number;
|
|
220
|
+
outputTokens: number;
|
|
221
|
+
cacheReadTokens: number;
|
|
222
|
+
cacheWriteTokens: number;
|
|
223
|
+
/**
|
|
224
|
+
* How many of `outputTokens` the model spent thinking, where the provider
|
|
225
|
+
* reports it; absent where it does not (AGL-3143).
|
|
226
|
+
*
|
|
227
|
+
* Inside `outputTokens`, never beside it: a rate table prices the four
|
|
228
|
+
* figures above and would charge these twice if it read this one.
|
|
229
|
+
*
|
|
230
|
+
* It is here because it is the figure that says where a generation's
|
|
231
|
+
* output went. A tool call that comes back far smaller than the tokens it
|
|
232
|
+
* cost has three shapes, and only this separates the first from the other
|
|
233
|
+
* two: the model thought and then answered briefly, which is a model
|
|
234
|
+
* working as asked; a runaway string the partial parse discarded; or
|
|
235
|
+
* decoding that wrote nothing usable. Kept on every answer, because a
|
|
236
|
+
* generation burns its budget thinking without ever reaching its ceiling,
|
|
237
|
+
* and `rawOutput` is only there when it does.
|
|
238
|
+
*/
|
|
239
|
+
thinkingTokens?: number;
|
|
240
|
+
}
|
|
241
|
+
export interface AiToolUse {
|
|
242
|
+
name: string;
|
|
243
|
+
input: Record<string, unknown>;
|
|
244
|
+
}
|
|
245
|
+
/** A completed, non-streaming answer. */
|
|
246
|
+
export interface AiCompletion {
|
|
247
|
+
kind: 'completion';
|
|
248
|
+
/** Every text block, joined. */
|
|
249
|
+
text: string;
|
|
250
|
+
toolUse: AiToolUse[];
|
|
251
|
+
usage: AiUsage;
|
|
252
|
+
/**
|
|
253
|
+
* The exchange at the serving model's BILLED rates — what a customer's
|
|
254
|
+
* credits are drawn from, and never a margin's cost side (AGL-3015). What
|
|
255
|
+
* the same exchange cost us is `estimateAiProviderCostUsd`, recorded by
|
|
256
|
+
* the meter; a result travels no further than the credit path, so it
|
|
257
|
+
* carries the one figure that path needs.
|
|
258
|
+
*/
|
|
259
|
+
estCostUsd: number;
|
|
260
|
+
stopReason: string | null;
|
|
261
|
+
/**
|
|
262
|
+
* WHERE THE OUTPUT WENT (AGL-3143). The provider's own output for this
|
|
263
|
+
* call, as it answered it, kept ONLY when the call stopped at its ceiling
|
|
264
|
+
* and cut to `AI_RAW_OUTPUT_MAX_CHARS`.
|
|
265
|
+
*
|
|
266
|
+
* A tool call truncated mid-answer reaches `toolUse` as whatever the
|
|
267
|
+
* provider could still parse, and the parsed input alone cannot say where
|
|
268
|
+
* the tokens went: a runaway string the partial parse discarded and a
|
|
269
|
+
* decoding stall that wrote nothing usable both leave a small input
|
|
270
|
+
* against a spent ceiling. This is what tells them apart. These are the
|
|
271
|
+
* model's own words, so they belong to the trace alone: never to a reader,
|
|
272
|
+
* and never to a log, which carries the figures that separate the two
|
|
273
|
+
* shapes — `outputTokens`, `parsedChars`, `rawChars`.
|
|
274
|
+
*/
|
|
275
|
+
rawOutput?: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Whether a model call stopped because it reached the output ceiling it was
|
|
279
|
+
* asked for (AGL-3042). `max_tokens` is the contract's word, and the
|
|
280
|
+
* OpenAI-compatible adapter maps its endpoint's `length` onto it; `length` is
|
|
281
|
+
* read as well, for an adapter that passes its provider's own word through.
|
|
282
|
+
*/
|
|
283
|
+
export declare function aiStoppedAtCeiling(stopReason: string | null): boolean;
|
|
284
|
+
/** The most characters of raw output a call cut off at its ceiling keeps. */
|
|
285
|
+
export declare const AI_RAW_OUTPUT_MAX_CHARS = 20000;
|
|
286
|
+
/**
|
|
287
|
+
* A cut-off call's output as the trace keeps it: what the provider answered,
|
|
288
|
+
* serialized where it is not already text, and cut to the bound with an
|
|
289
|
+
* ellipsis so a reader can tell a cut trace from a short answer.
|
|
290
|
+
*/
|
|
291
|
+
export declare function aiRawOutputOf(output: unknown): string;
|
|
292
|
+
/**
|
|
293
|
+
* WHERE THE OUTPUT WENT, as a log may carry it (AGL-3143): the figures that
|
|
294
|
+
* separate the shapes a call cut off at its ceiling comes in, and nothing
|
|
295
|
+
* else.
|
|
296
|
+
*
|
|
297
|
+
* Thinking accounts for the spend first, because the thinking budget is
|
|
298
|
+
* drawn from the same ceiling as the answer: a call can spend nearly all of
|
|
299
|
+
* one thinking and still be cut off with a correct, tiny tool input, which
|
|
300
|
+
* is a ceiling to raise rather than a decoder to fix. What thinking does not
|
|
301
|
+
* account for is told apart by how much was written — long, and a runaway
|
|
302
|
+
* string the partial parse discarded; short, and decoding wrote nothing
|
|
303
|
+
* usable.
|
|
304
|
+
*
|
|
305
|
+
* It takes the raw output rather than a count on purpose. The bytes are the
|
|
306
|
+
* model's own words and therefore the site's content, so they belong to the
|
|
307
|
+
* trace alone and never to a log; passing them through one function that can
|
|
308
|
+
* only ever return their LENGTH is what holds that rule at every door,
|
|
309
|
+
* instead of asking each one to remember it.
|
|
310
|
+
*/
|
|
311
|
+
export declare function aiCutOffFigures(call: {
|
|
312
|
+
usage: AiUsage;
|
|
313
|
+
/** The tool input that still parsed, or null where none did. */
|
|
314
|
+
parsed: unknown;
|
|
315
|
+
rawOutput: string | null | undefined;
|
|
316
|
+
}): {
|
|
317
|
+
outputTokens: number;
|
|
318
|
+
thinkingTokens: number | null;
|
|
319
|
+
parsedChars: number;
|
|
320
|
+
rawChars: number | null;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* The model declined. Tokens were spent, so the usage is real and the
|
|
324
|
+
* caller meters it; the text is whatever partial answer preceded the stop,
|
|
325
|
+
* usually nothing. Every adapter maps its provider's own decline signal —
|
|
326
|
+
* a refusal stop, a content filter — onto this one kind.
|
|
327
|
+
*/
|
|
328
|
+
export interface AiRefusal {
|
|
329
|
+
kind: 'refusal';
|
|
330
|
+
text: string;
|
|
331
|
+
usage: AiUsage;
|
|
332
|
+
estCostUsd: number;
|
|
333
|
+
stopReason: 'refusal';
|
|
334
|
+
}
|
|
335
|
+
export type AiResult = AiCompletion | AiRefusal;
|
|
336
|
+
export type AiStreamEvent = {
|
|
337
|
+
type: 'delta';
|
|
338
|
+
text: string;
|
|
339
|
+
} | {
|
|
340
|
+
type: 'tool';
|
|
341
|
+
name: string;
|
|
342
|
+
input: Record<string, unknown>;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* The provider's in-stream error. The stream is still open and ends with
|
|
346
|
+
* `done`, so the caller decides what the reader is told; the provider's
|
|
347
|
+
* own words went to the log, not here.
|
|
348
|
+
*/
|
|
349
|
+
| {
|
|
350
|
+
type: 'error';
|
|
351
|
+
retryable: boolean;
|
|
352
|
+
} | {
|
|
353
|
+
type: 'done';
|
|
354
|
+
usage: AiUsage;
|
|
355
|
+
estCostUsd: number;
|
|
356
|
+
stopReason: string | null;
|
|
357
|
+
/**
|
|
358
|
+
* WHERE THE OUTPUT WENT, for a stream (AGL-3143): the bytes the
|
|
359
|
+
* stream's tool calls were written in, kept ONLY when the stream
|
|
360
|
+
* stopped at its ceiling and cut to `AI_RAW_OUTPUT_MAX_CHARS`. The
|
|
361
|
+
* streaming counterpart of `AiCompletion.rawOutput`.
|
|
362
|
+
*
|
|
363
|
+
* A `tool` event carries what `aiToolInputOf` could still parse, which
|
|
364
|
+
* for a call cut mid-answer is a prefix of the object or nothing at
|
|
365
|
+
* all; the fragments those events were assembled from are the only
|
|
366
|
+
* record of what the model actually emitted, and without them a
|
|
367
|
+
* runaway string and a decoding stall look identical from the
|
|
368
|
+
* outside. These are the model's own words, so they belong to the
|
|
369
|
+
* trace alone: never to a reader, and never to a log, which carries
|
|
370
|
+
* the figures that separate the two shapes.
|
|
371
|
+
*/
|
|
372
|
+
rawOutput?: string;
|
|
373
|
+
};
|
|
374
|
+
/** What a provider says about one of its models; the catalog carries both rates. */
|
|
375
|
+
export interface AiModelDescriptor {
|
|
376
|
+
id: string;
|
|
377
|
+
/** The provider id the model is served by. */
|
|
378
|
+
provider: string;
|
|
379
|
+
label: string;
|
|
380
|
+
capabilities: {
|
|
381
|
+
streaming: boolean;
|
|
382
|
+
tools: boolean;
|
|
383
|
+
/** Whether the provider accepts an explicit `thinking` setting for this model. */
|
|
384
|
+
thinking: boolean;
|
|
385
|
+
/** Whether the provider caches a system prefix for this model. */
|
|
386
|
+
promptCache: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* Whether the model reads a picture in a user turn (AGL-2916). Absent
|
|
389
|
+
* reads as no, so a provider registered before the field existed is never
|
|
390
|
+
* sent an image it did not say it can read.
|
|
391
|
+
*/
|
|
392
|
+
vision?: boolean;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
/** The one sentence a customer may read when a provider fails. */
|
|
396
|
+
export declare const AI_UPSTREAM_FAILURE_COPY = "The AI request failed \u2014 try again.";
|
|
397
|
+
/**
|
|
398
|
+
* A non-2xx answer from the provider. `message` is the fixed customer-safe
|
|
399
|
+
* sentence; the provider's payload is in the log under `requestId`.
|
|
400
|
+
*/
|
|
401
|
+
export declare class AiUpstreamError extends UpstreamServiceError {
|
|
402
|
+
readonly name = "AiUpstreamError";
|
|
403
|
+
constructor(status: number | null, retryable: boolean, requestId: string | null);
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* A request the runtime refuses to send. Thrown synchronously before any
|
|
407
|
+
* network is touched, and it names the block at fault: this is a
|
|
408
|
+
* programming error in the caller's prompt assembly, not a condition to
|
|
409
|
+
* handle at runtime.
|
|
410
|
+
*/
|
|
411
|
+
export declare class AiRequestShapeError extends Error {
|
|
412
|
+
constructor(message: string);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* A provider: one vendor's wire protocol behind the contract. `id` is the
|
|
416
|
+
* routing key (`anthropic`, `openai-compatible`); `models` is what the
|
|
417
|
+
* provider can serve; `complete` and `stream` are the two shapes every door
|
|
418
|
+
* uses. An adapter maps its vendor's errors onto `AiUpstreamError` and its
|
|
419
|
+
* declines onto `AiRefusal`, and reports usage in the meter's shape.
|
|
420
|
+
*/
|
|
421
|
+
export interface AiProvider {
|
|
422
|
+
readonly id: string;
|
|
423
|
+
readonly label: string;
|
|
424
|
+
/** The environment variable that carries this provider's key, for operator messages. */
|
|
425
|
+
readonly apiKeyEnv: string;
|
|
426
|
+
/**
|
|
427
|
+
* The key from the server environment, or `undefined` when the provider
|
|
428
|
+
* is not configured to answer. Each adapter reads its own variable by
|
|
429
|
+
* name in its own module, so every key read is one the key-exposure
|
|
430
|
+
* guard can see (AGL-2240) and no door names a vendor's variable.
|
|
431
|
+
*/
|
|
432
|
+
readApiKey(): string | undefined;
|
|
433
|
+
/** The host the provider is reached at, for the subprocessor inventory. */
|
|
434
|
+
readonly endpointHost: string;
|
|
435
|
+
/**
|
|
436
|
+
* How much of one request's strict tools this provider compiles, where it
|
|
437
|
+
* states a bound. The doors never read it: a spec holds every tool set a
|
|
438
|
+
* door sends to every registered provider's limits, so a schema a provider
|
|
439
|
+
* would refuse is red before it ships rather than a 400 on every request.
|
|
440
|
+
*/
|
|
441
|
+
readonly toolSchemaLimits?: AiToolSchemaLimits;
|
|
442
|
+
models(): readonly AiModelDescriptor[];
|
|
443
|
+
complete(request: AiProviderRequest): Promise<AiResult>;
|
|
444
|
+
/**
|
|
445
|
+
* Resolves once the provider has ACCEPTED the request — after the
|
|
446
|
+
* headers, before the first token — with an iterator of events. A non-2xx
|
|
447
|
+
* answer rejects with `AiUpstreamError` before the iterator exists, so a
|
|
448
|
+
* door can still send a plain error status and hand back its reservation.
|
|
449
|
+
*/
|
|
450
|
+
stream(request: AiProviderRequest): Promise<AsyncIterable<AiStreamEvent>>;
|
|
451
|
+
}
|
|
452
|
+
/** A count off the wire: finite, non-negative, whole; anything else is 0. */
|
|
453
|
+
export declare function aiTokenCount(value: unknown): number;
|
|
454
|
+
/**
|
|
455
|
+
* A tool call's `input` as an object. A provider sends an object or, for
|
|
456
|
+
* the one shape a stream assembles by hand, a JSON string.
|
|
457
|
+
*
|
|
458
|
+
* A string that does not parse to an object is an EMPTY input, not a throw.
|
|
459
|
+
* The case that produces one is a stream cut off mid-call by the output
|
|
460
|
+
* ceiling, and a throw there would end the stream before its `done` event —
|
|
461
|
+
* the event that carries the usage a door must meter for tokens already
|
|
462
|
+
* spent. An empty input is one every door's own validation refuses.
|
|
463
|
+
*/
|
|
464
|
+
export declare function aiToolInputOf(value: unknown): Record<string, unknown>;
|