@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,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
|
+
import { checkEntitlement } from "@aglyn/aglyn/app-utils/plan-entitlements";
|
|
18
|
+
import { HOST_EVENT_LABELS, HOST_EVENT_TYPES } from "@aglyn/aglyn/app-utils/workflows";
|
|
19
|
+
/**
|
|
20
|
+
* A `workflow` job (AGL-2919): an automation drafted from a description, or an
|
|
21
|
+
* existing automation explained — what it does, or why one of its runs failed.
|
|
22
|
+
*
|
|
23
|
+
* One kind, three modes, because the three share everything a job carries:
|
|
24
|
+
* the site, the gates, the meter and the automation vocabulary. `inputs.mode`
|
|
25
|
+
* picks the mode, and a job created without one drafts.
|
|
26
|
+
*
|
|
27
|
+
* - `draft` writes a new automation to the site's Actions through the
|
|
28
|
+
* workflows plugin's draft writer, OFF, built only from the triggers and
|
|
29
|
+
* steps below that this workspace can run. What the description names that
|
|
30
|
+
* the site does not have is left as a placeholder, never guessed.
|
|
31
|
+
* - `explain` reads a saved automation — an action or a workflow — and
|
|
32
|
+
* answers in plain words what it does.
|
|
33
|
+
* - `diagnose` reads a saved automation and one of its FAILED runs, as the
|
|
34
|
+
* run history recorded it, and answers why it failed and what to change.
|
|
35
|
+
*
|
|
36
|
+
* Nothing in any mode switches an automation on, runs one, or changes one.
|
|
37
|
+
*/ export const AI_WORKFLOW_JOB_MODES = [
|
|
38
|
+
'draft',
|
|
39
|
+
'explain',
|
|
40
|
+
'diagnose'
|
|
41
|
+
];
|
|
42
|
+
/** What an explained automation is: an action, or a workflow of function calls. */ export const AI_WORKFLOW_TARGET_TYPES = [
|
|
43
|
+
'action',
|
|
44
|
+
'workflow'
|
|
45
|
+
];
|
|
46
|
+
const DOCUMENT_ID = /^[A-Za-z0-9_-]{1,128}$/;
|
|
47
|
+
/** A job's inputs read into its mode, or the sentence that says what is wrong with them. */ export function parseAiWorkflowJobInputs(inputs) {
|
|
48
|
+
var _ref;
|
|
49
|
+
const mode = (_ref = inputs == null ? void 0 : inputs['mode']) != null ? _ref : 'draft';
|
|
50
|
+
if (!AI_WORKFLOW_JOB_MODES.includes(mode)) {
|
|
51
|
+
return 'inputs.mode must be draft, explain or diagnose';
|
|
52
|
+
}
|
|
53
|
+
if (mode === 'draft') return {
|
|
54
|
+
mode
|
|
55
|
+
};
|
|
56
|
+
const targetType = inputs == null ? void 0 : inputs['targetType'];
|
|
57
|
+
const targetId = inputs == null ? void 0 : inputs['targetId'];
|
|
58
|
+
if (!AI_WORKFLOW_TARGET_TYPES.includes(targetType) || typeof targetId !== 'string' || !DOCUMENT_ID.test(targetId)) {
|
|
59
|
+
return 'Pick the automation to explain';
|
|
60
|
+
}
|
|
61
|
+
const target = {
|
|
62
|
+
targetType: targetType,
|
|
63
|
+
targetId
|
|
64
|
+
};
|
|
65
|
+
if (mode === 'explain') return _extends({
|
|
66
|
+
mode
|
|
67
|
+
}, target);
|
|
68
|
+
const runId = inputs == null ? void 0 : inputs['runId'];
|
|
69
|
+
if (typeof runId !== 'string' || !DOCUMENT_ID.test(runId)) return 'Pick the run to explain';
|
|
70
|
+
return _extends({
|
|
71
|
+
mode: 'diagnose'
|
|
72
|
+
}, target, {
|
|
73
|
+
runId
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** Each need as a sentence names it. */ export const AI_AUTOMATION_NEED_LABELS = {
|
|
77
|
+
crm: 'the CRM',
|
|
78
|
+
webhooks: 'webhooks',
|
|
79
|
+
bookings: 'bookings'
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* What this workspace can run, from the entitlements the executor itself
|
|
83
|
+
* reads before it runs a step: `crm` for the CRM steps, `webhooks` for a
|
|
84
|
+
* webhook post, and `bookings` for the booking trigger's door.
|
|
85
|
+
*/ export function aiAutomationCapabilities(org) {
|
|
86
|
+
const billing = org;
|
|
87
|
+
return {
|
|
88
|
+
crm: checkEntitlement(billing, 'crm'),
|
|
89
|
+
webhooks: checkEntitlement(billing, 'webhooks'),
|
|
90
|
+
bookings: checkEntitlement(billing, 'bookings')
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// ── The vocabulary ────────────────────────────────────────────────────────
|
|
94
|
+
/**
|
|
95
|
+
* The triggers a drafted automation may start on: every host event, which is
|
|
96
|
+
* every event a server door emits. The on-page events (a click, a scroll) are
|
|
97
|
+
* left out: they watch one element of one page, which a description cannot
|
|
98
|
+
* name, and they belong to the page's own interactions.
|
|
99
|
+
*/ export const AI_AUTOMATION_TRIGGERS = HOST_EVENT_TYPES;
|
|
100
|
+
/** The triggers only a door of a part of the platform emits. */ export const AI_AUTOMATION_TRIGGER_NEEDS = {
|
|
101
|
+
booking: 'bookings',
|
|
102
|
+
taskCompleted: 'crm',
|
|
103
|
+
contactStageChanged: 'crm',
|
|
104
|
+
dealStageChanged: 'crm',
|
|
105
|
+
dealWon: 'crm',
|
|
106
|
+
dealLost: 'crm'
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* The steps a drafted automation may take: the server steps and the flow
|
|
110
|
+
* steps, which act on the person an event names. The on-page steps — show an
|
|
111
|
+
* element, open a menu, run a script — are left out for the reason the
|
|
112
|
+
* on-page triggers are: they need a selector on a page a description cannot
|
|
113
|
+
* name.
|
|
114
|
+
*/ export const AI_AUTOMATION_STEP_TYPES = [
|
|
115
|
+
'sendEmail',
|
|
116
|
+
'notifyAdmins',
|
|
117
|
+
'enrollList',
|
|
118
|
+
'assignCampaign',
|
|
119
|
+
'runWorkflow',
|
|
120
|
+
'datasetAppend',
|
|
121
|
+
'updateDataset',
|
|
122
|
+
'webhookPost',
|
|
123
|
+
'siteAlert',
|
|
124
|
+
'wait',
|
|
125
|
+
'waitForEvent',
|
|
126
|
+
'exitFlow',
|
|
127
|
+
'setContactStage',
|
|
128
|
+
'addContactTag',
|
|
129
|
+
'assignContactOwner',
|
|
130
|
+
'createCrmTask',
|
|
131
|
+
'logCrmActivity'
|
|
132
|
+
];
|
|
133
|
+
/** The steps the executor refuses without a part of the platform. */ export const AI_AUTOMATION_STEP_NEEDS = {
|
|
134
|
+
webhookPost: 'webhooks',
|
|
135
|
+
setContactStage: 'crm',
|
|
136
|
+
addContactTag: 'crm',
|
|
137
|
+
assignContactOwner: 'crm',
|
|
138
|
+
createCrmTask: 'crm',
|
|
139
|
+
logCrmActivity: 'crm'
|
|
140
|
+
};
|
|
141
|
+
/** The trigger's name as the Actions editor labels it. */ export function aiAutomationTriggerLabel(event) {
|
|
142
|
+
var _HOST_EVENT_LABELS_event;
|
|
143
|
+
return (_HOST_EVENT_LABELS_event = HOST_EVENT_LABELS[event]) != null ? _HOST_EVENT_LABELS_event : event;
|
|
144
|
+
}
|
|
145
|
+
// ── A description the vocabulary cannot build ─────────────────────────────
|
|
146
|
+
/**
|
|
147
|
+
* Why a description was answered with no automation. Each is a fixed reason
|
|
148
|
+
* with a fixed sentence, so what a person reads is never the model's own
|
|
149
|
+
* account of itself.
|
|
150
|
+
*/ export const AI_AUTOMATION_UNSUPPORTED = [
|
|
151
|
+
'not-an-automation',
|
|
152
|
+
'no-trigger',
|
|
153
|
+
'no-step',
|
|
154
|
+
'needs-crm',
|
|
155
|
+
'needs-webhooks',
|
|
156
|
+
'needs-bookings'
|
|
157
|
+
];
|
|
158
|
+
/** The need an unsupported reason names, for the reasons that name one. */ export const AI_AUTOMATION_UNSUPPORTED_NEED = {
|
|
159
|
+
'needs-crm': 'crm',
|
|
160
|
+
'needs-webhooks': 'webhooks',
|
|
161
|
+
'needs-bookings': 'bookings'
|
|
162
|
+
};
|
|
163
|
+
export const AI_AUTOMATION_UNSUPPORTED_COPY = {
|
|
164
|
+
'not-an-automation': 'This description is not an automation — something that happens, and what to do then — so nothing was drafted.',
|
|
165
|
+
'no-trigger': 'Nothing on the platform can start an automation like this one, so nothing was drafted. Describe it as something that happens on your site, such as a form being submitted.',
|
|
166
|
+
'no-step': 'An automation cannot do what this description asks yet, so nothing was drafted.',
|
|
167
|
+
'needs-crm': 'This automation needs the CRM, which this workspace’s plan does not include, so nothing was drafted.',
|
|
168
|
+
'needs-webhooks': 'This automation needs webhooks, which this workspace’s plan does not include, so nothing was drafted.',
|
|
169
|
+
'needs-bookings': 'This automation needs bookings, which this workspace’s plan does not include, so nothing was drafted.'
|
|
170
|
+
};
|
|
171
|
+
// ── What a job tells a person ─────────────────────────────────────────────
|
|
172
|
+
/** The id the workflows plugin is registered under. */ export const AI_WORKFLOWS_PLUGIN_ID = 'workflows';
|
|
173
|
+
/** The resource the workflows plugin writes a drafted automation under. */ export const AI_AUTOMATION_RESOURCE = 'automation';
|
|
174
|
+
export const AI_WORKFLOW_NO_SITE_COPY = 'This automation job names a site this workspace does not have.';
|
|
175
|
+
export const AI_WORKFLOW_UNAVAILABLE_COPY = 'Automations are not available on this site.';
|
|
176
|
+
export const AI_WORKFLOW_GONE_COPY = 'That automation no longer exists.';
|
|
177
|
+
export const AI_WORKFLOW_RUN_GONE_COPY = 'That run is no longer in the automation’s history.';
|
|
178
|
+
export const AI_WORKFLOW_RUN_NOT_FAILED_COPY = 'That run did not fail, so there is nothing to explain.';
|
|
179
|
+
export const AI_WORKFLOW_NO_DRAFT_COPY = 'The AI could not draft an automation from this description. Try describing what happens, and what should happen then.';
|
|
180
|
+
export const AI_WORKFLOW_NO_EXPLANATION_COPY = 'The AI could not explain this automation. Try again.';
|
|
181
|
+
export const AI_WORKFLOW_SAVE_FAILURE_COPY = 'The automation was drafted but could not be saved. Try the job again.';
|
|
182
|
+
|
|
183
|
+
//# sourceMappingURL=ai-workflow-job.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/model/ai-workflow-job.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HostActionStepType } from '@aglyn/aglyn/app-utils/actions'\nimport { checkEntitlement } from '@aglyn/aglyn/app-utils/plan-entitlements'\nimport {\n HOST_EVENT_LABELS,\n HOST_EVENT_TYPES,\n type HostEventType,\n} from '@aglyn/aglyn/app-utils/workflows'\nimport type { AglynOrgBilling } from '@aglyn/aglyn/foundation/definitions/org-billing.types'\n\n/**\n * A `workflow` job (AGL-2919): an automation drafted from a description, or an\n * existing automation explained — what it does, or why one of its runs failed.\n *\n * One kind, three modes, because the three share everything a job carries:\n * the site, the gates, the meter and the automation vocabulary. `inputs.mode`\n * picks the mode, and a job created without one drafts.\n *\n * - `draft` writes a new automation to the site's Actions through the\n * workflows plugin's draft writer, OFF, built only from the triggers and\n * steps below that this workspace can run. What the description names that\n * the site does not have is left as a placeholder, never guessed.\n * - `explain` reads a saved automation — an action or a workflow — and\n * answers in plain words what it does.\n * - `diagnose` reads a saved automation and one of its FAILED runs, as the\n * run history recorded it, and answers why it failed and what to change.\n *\n * Nothing in any mode switches an automation on, runs one, or changes one.\n */\n\nexport const AI_WORKFLOW_JOB_MODES = ['draft', 'explain', 'diagnose'] as const\nexport type AiWorkflowJobMode = (typeof AI_WORKFLOW_JOB_MODES)[number]\n\n/** What an explained automation is: an action, or a workflow of function calls. */\nexport const AI_WORKFLOW_TARGET_TYPES = ['action', 'workflow'] as const\nexport type AiWorkflowTargetType = (typeof AI_WORKFLOW_TARGET_TYPES)[number]\n\nexport type AiWorkflowJobInputs =\n | { mode: 'draft' }\n | { mode: 'explain'; targetType: AiWorkflowTargetType; targetId: string }\n | { mode: 'diagnose'; targetType: AiWorkflowTargetType; targetId: string; runId: string }\n\nconst DOCUMENT_ID = /^[A-Za-z0-9_-]{1,128}$/\n\n/** A job's inputs read into its mode, or the sentence that says what is wrong with them. */\nexport function parseAiWorkflowJobInputs(\n inputs: Readonly<Record<string, unknown>> | null | undefined,\n): AiWorkflowJobInputs | string {\n const mode = inputs?.['mode'] ?? 'draft'\n if (!(AI_WORKFLOW_JOB_MODES as readonly unknown[]).includes(mode)) {\n return 'inputs.mode must be draft, explain or diagnose'\n }\n if (mode === 'draft') return { mode }\n const targetType = inputs?.['targetType']\n const targetId = inputs?.['targetId']\n if (\n !(AI_WORKFLOW_TARGET_TYPES as readonly unknown[]).includes(targetType) ||\n typeof targetId !== 'string' ||\n !DOCUMENT_ID.test(targetId)\n ) {\n return 'Pick the automation to explain'\n }\n const target = { targetType: targetType as AiWorkflowTargetType, targetId }\n if (mode === 'explain') return { mode, ...target }\n const runId = inputs?.['runId']\n if (typeof runId !== 'string' || !DOCUMENT_ID.test(runId)) return 'Pick the run to explain'\n return { mode: 'diagnose', ...target, runId }\n}\n\n// ── What a workspace can run ──────────────────────────────────────────────\n\n/** A part of the platform some triggers and steps need beyond the actions builder itself. */\nexport type AiAutomationNeed = 'crm' | 'webhooks' | 'bookings'\n\nexport type AiAutomationCapabilities = Readonly<Record<AiAutomationNeed, boolean>>\n\n/** Each need as a sentence names it. */\nexport const AI_AUTOMATION_NEED_LABELS: Readonly<Record<AiAutomationNeed, string>> = {\n crm: 'the CRM',\n webhooks: 'webhooks',\n bookings: 'bookings',\n}\n\n/**\n * What this workspace can run, from the entitlements the executor itself\n * reads before it runs a step: `crm` for the CRM steps, `webhooks` for a\n * webhook post, and `bookings` for the booking trigger's door.\n */\nexport function aiAutomationCapabilities(\n org: Partial<AglynOrgBilling> | Readonly<Record<string, unknown>> | null | undefined,\n): AiAutomationCapabilities {\n const billing = org as Partial<AglynOrgBilling> | null | undefined\n return {\n crm: checkEntitlement(billing, 'crm'),\n webhooks: checkEntitlement(billing, 'webhooks'),\n bookings: checkEntitlement(billing, 'bookings'),\n }\n}\n\n// ── The vocabulary ────────────────────────────────────────────────────────\n\n/**\n * The triggers a drafted automation may start on: every host event, which is\n * every event a server door emits. The on-page events (a click, a scroll) are\n * left out: they watch one element of one page, which a description cannot\n * name, and they belong to the page's own interactions.\n */\nexport const AI_AUTOMATION_TRIGGERS: readonly HostEventType[] = HOST_EVENT_TYPES\n\n/** The triggers only a door of a part of the platform emits. */\nexport const AI_AUTOMATION_TRIGGER_NEEDS: Readonly<Partial<Record<HostEventType, AiAutomationNeed>>> = {\n booking: 'bookings',\n taskCompleted: 'crm',\n contactStageChanged: 'crm',\n dealStageChanged: 'crm',\n dealWon: 'crm',\n dealLost: 'crm',\n}\n\n/**\n * The steps a drafted automation may take: the server steps and the flow\n * steps, which act on the person an event names. The on-page steps — show an\n * element, open a menu, run a script — are left out for the reason the\n * on-page triggers are: they need a selector on a page a description cannot\n * name.\n */\nexport const AI_AUTOMATION_STEP_TYPES = [\n 'sendEmail',\n 'notifyAdmins',\n 'enrollList',\n 'assignCampaign',\n 'runWorkflow',\n 'datasetAppend',\n 'updateDataset',\n 'webhookPost',\n 'siteAlert',\n 'wait',\n 'waitForEvent',\n 'exitFlow',\n 'setContactStage',\n 'addContactTag',\n 'assignContactOwner',\n 'createCrmTask',\n 'logCrmActivity',\n] as const satisfies readonly HostActionStepType[]\n\nexport type AiAutomationStepType = (typeof AI_AUTOMATION_STEP_TYPES)[number]\n\n/** The steps the executor refuses without a part of the platform. */\nexport const AI_AUTOMATION_STEP_NEEDS: Readonly<Partial<Record<AiAutomationStepType, AiAutomationNeed>>> = {\n webhookPost: 'webhooks',\n setContactStage: 'crm',\n addContactTag: 'crm',\n assignContactOwner: 'crm',\n createCrmTask: 'crm',\n logCrmActivity: 'crm',\n}\n\n/** The trigger's name as the Actions editor labels it. */\nexport function aiAutomationTriggerLabel(event: string): string {\n return HOST_EVENT_LABELS[event as HostEventType] ?? event\n}\n\n// ── A description the vocabulary cannot build ─────────────────────────────\n\n/**\n * Why a description was answered with no automation. Each is a fixed reason\n * with a fixed sentence, so what a person reads is never the model's own\n * account of itself.\n */\nexport const AI_AUTOMATION_UNSUPPORTED = [\n 'not-an-automation',\n 'no-trigger',\n 'no-step',\n 'needs-crm',\n 'needs-webhooks',\n 'needs-bookings',\n] as const\n\nexport type AiAutomationUnsupported = (typeof AI_AUTOMATION_UNSUPPORTED)[number]\n\n/** The need an unsupported reason names, for the reasons that name one. */\nexport const AI_AUTOMATION_UNSUPPORTED_NEED: Readonly<\n Partial<Record<AiAutomationUnsupported, AiAutomationNeed>>\n> = {\n 'needs-crm': 'crm',\n 'needs-webhooks': 'webhooks',\n 'needs-bookings': 'bookings',\n}\n\nexport const AI_AUTOMATION_UNSUPPORTED_COPY: Readonly<Record<AiAutomationUnsupported, string>> = {\n 'not-an-automation':\n 'This description is not an automation — something that happens, and what to do then — so nothing was drafted.',\n 'no-trigger':\n 'Nothing on the platform can start an automation like this one, so nothing was drafted. Describe it as something that happens on your site, such as a form being submitted.',\n 'no-step': 'An automation cannot do what this description asks yet, so nothing was drafted.',\n 'needs-crm':\n 'This automation needs the CRM, which this workspace’s plan does not include, so nothing was drafted.',\n 'needs-webhooks':\n 'This automation needs webhooks, which this workspace’s plan does not include, so nothing was drafted.',\n 'needs-bookings':\n 'This automation needs bookings, which this workspace’s plan does not include, so nothing was drafted.',\n}\n\n// ── What a job tells a person ─────────────────────────────────────────────\n\n/** The id the workflows plugin is registered under. */\nexport const AI_WORKFLOWS_PLUGIN_ID = 'workflows'\n\n/** The resource the workflows plugin writes a drafted automation under. */\nexport const AI_AUTOMATION_RESOURCE = 'automation'\n\nexport const AI_WORKFLOW_NO_SITE_COPY = 'This automation job names a site this workspace does not have.'\nexport const AI_WORKFLOW_UNAVAILABLE_COPY = 'Automations are not available on this site.'\nexport const AI_WORKFLOW_GONE_COPY = 'That automation no longer exists.'\nexport const AI_WORKFLOW_RUN_GONE_COPY = 'That run is no longer in the automation’s history.'\nexport const AI_WORKFLOW_RUN_NOT_FAILED_COPY = 'That run did not fail, so there is nothing to explain.'\nexport const AI_WORKFLOW_NO_DRAFT_COPY =\n 'The AI could not draft an automation from this description. Try describing what happens, and what should happen then.'\nexport const AI_WORKFLOW_NO_EXPLANATION_COPY =\n 'The AI could not explain this automation. Try again.'\nexport const AI_WORKFLOW_SAVE_FAILURE_COPY =\n 'The automation was drafted but could not be saved. Try the job again.'\n"],"names":["checkEntitlement","HOST_EVENT_LABELS","HOST_EVENT_TYPES","AI_WORKFLOW_JOB_MODES","AI_WORKFLOW_TARGET_TYPES","DOCUMENT_ID","parseAiWorkflowJobInputs","inputs","mode","includes","targetType","targetId","test","target","runId","AI_AUTOMATION_NEED_LABELS","crm","webhooks","bookings","aiAutomationCapabilities","org","billing","AI_AUTOMATION_TRIGGERS","AI_AUTOMATION_TRIGGER_NEEDS","booking","taskCompleted","contactStageChanged","dealStageChanged","dealWon","dealLost","AI_AUTOMATION_STEP_TYPES","AI_AUTOMATION_STEP_NEEDS","webhookPost","setContactStage","addContactTag","assignContactOwner","createCrmTask","logCrmActivity","aiAutomationTriggerLabel","event","AI_AUTOMATION_UNSUPPORTED","AI_AUTOMATION_UNSUPPORTED_NEED","AI_AUTOMATION_UNSUPPORTED_COPY","AI_WORKFLOWS_PLUGIN_ID","AI_AUTOMATION_RESOURCE","AI_WORKFLOW_NO_SITE_COPY","AI_WORKFLOW_UNAVAILABLE_COPY","AI_WORKFLOW_GONE_COPY","AI_WORKFLOW_RUN_GONE_COPY","AI_WORKFLOW_RUN_NOT_FAILED_COPY","AI_WORKFLOW_NO_DRAFT_COPY","AI_WORKFLOW_NO_EXPLANATION_COPY","AI_WORKFLOW_SAVE_FAILURE_COPY"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,SAASA,gBAAgB,QAAQ,2CAA0C;AAC3E,SACEC,iBAAiB,EACjBC,gBAAgB,QAEX,mCAAkC;AAGzC;;;;;;;;;;;;;;;;;;CAkBC,GAED,OAAO,MAAMC,wBAAwB;IAAC;IAAS;IAAW;CAAW,CAAS;AAG9E,iFAAiF,GACjF,OAAO,MAAMC,2BAA2B;IAAC;IAAU;CAAW,CAAS;AAQvE,MAAMC,cAAc;AAEpB,0FAA0F,GAC1F,OAAO,SAASC,yBACdC,MAA4D;;IAE5D,MAAMC,eAAOD,0BAAAA,MAAQ,CAAC,OAAO,mBAAI;IACjC,IAAI,CAAC,AAACJ,sBAA6CM,QAAQ,CAACD,OAAO;QACjE,OAAO;IACT;IACA,IAAIA,SAAS,SAAS,OAAO;QAAEA;IAAK;IACpC,MAAME,aAAaH,0BAAAA,MAAQ,CAAC,aAAa;IACzC,MAAMI,WAAWJ,0BAAAA,MAAQ,CAAC,WAAW;IACrC,IACE,CAAC,AAACH,yBAAgDK,QAAQ,CAACC,eAC3D,OAAOC,aAAa,YACpB,CAACN,YAAYO,IAAI,CAACD,WAClB;QACA,OAAO;IACT;IACA,MAAME,SAAS;QAAEH,YAAYA;QAAoCC;IAAS;IAC1E,IAAIH,SAAS,WAAW,OAAO;QAAEA;OAASK;IAC1C,MAAMC,QAAQP,0BAAAA,MAAQ,CAAC,QAAQ;IAC/B,IAAI,OAAOO,UAAU,YAAY,CAACT,YAAYO,IAAI,CAACE,QAAQ,OAAO;IAClE,OAAO;QAAEN,MAAM;OAAeK;QAAQC;;AACxC;AASA,sCAAsC,GACtC,OAAO,MAAMC,4BAAwE;IACnFC,KAAK;IACLC,UAAU;IACVC,UAAU;AACZ,EAAC;AAED;;;;CAIC,GACD,OAAO,SAASC,yBACdC,GAAoF;IAEpF,MAAMC,UAAUD;IAChB,OAAO;QACLJ,KAAKhB,iBAAiBqB,SAAS;QAC/BJ,UAAUjB,iBAAiBqB,SAAS;QACpCH,UAAUlB,iBAAiBqB,SAAS;IACtC;AACF;AAEA,6EAA6E;AAE7E;;;;;CAKC,GACD,OAAO,MAAMC,yBAAmDpB,iBAAgB;AAEhF,8DAA8D,GAC9D,OAAO,MAAMqB,8BAA0F;IACrGC,SAAS;IACTC,eAAe;IACfC,qBAAqB;IACrBC,kBAAkB;IAClBC,SAAS;IACTC,UAAU;AACZ,EAAC;AAED;;;;;;CAMC,GACD,OAAO,MAAMC,2BAA2B;IACtC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAiD;AAIlD,mEAAmE,GACnE,OAAO,MAAMC,2BAA8F;IACzGC,aAAa;IACbC,iBAAiB;IACjBC,eAAe;IACfC,oBAAoB;IACpBC,eAAe;IACfC,gBAAgB;AAClB,EAAC;AAED,wDAAwD,GACxD,OAAO,SAASC,yBAAyBC,KAAa;QAC7CtC;IAAP,QAAOA,2BAAAA,iBAAiB,CAACsC,MAAuB,YAAzCtC,2BAA6CsC;AACtD;AAEA,6EAA6E;AAE7E;;;;CAIC,GACD,OAAO,MAAMC,4BAA4B;IACvC;IACA;IACA;IACA;IACA;IACA;CACD,CAAS;AAIV,yEAAyE,GACzE,OAAO,MAAMC,iCAET;IACF,aAAa;IACb,kBAAkB;IAClB,kBAAkB;AACpB,EAAC;AAED,OAAO,MAAMC,iCAAoF;IAC/F,qBACE;IACF,cACE;IACF,WAAW;IACX,aACE;IACF,kBACE;IACF,kBACE;AACJ,EAAC;AAED,6EAA6E;AAE7E,qDAAqD,GACrD,OAAO,MAAMC,yBAAyB,YAAW;AAEjD,yEAAyE,GACzE,OAAO,MAAMC,yBAAyB,aAAY;AAElD,OAAO,MAAMC,2BAA2B,iEAAgE;AACxG,OAAO,MAAMC,+BAA+B,8CAA6C;AACzF,OAAO,MAAMC,wBAAwB,oCAAmC;AACxE,OAAO,MAAMC,4BAA4B,qDAAoD;AAC7F,OAAO,MAAMC,kCAAkC,yDAAwD;AACvG,OAAO,MAAMC,4BACX,wHAAuH;AACzH,OAAO,MAAMC,kCACX,uDAAsD;AACxD,OAAO,MAAMC,gCACX,wEAAuE"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { ScreenSeoTextField } from '@aglyn/aglyn/app-utils/screen-seo-fields';
|
|
18
|
+
import type { ReusableComponentProp } from '@aglyn/aglyn/foundation/definitions/platform.types';
|
|
19
|
+
/**
|
|
20
|
+
* Assist level 3, the edit contract (AGL-2906): what the chat door proposes
|
|
21
|
+
* for a besigner canvas, and what the panel applies once the author says so.
|
|
22
|
+
*
|
|
23
|
+
* Shared by the server, which validates a model's proposal into these
|
|
24
|
+
* shapes, and the client, which applies them. Pure data and pure functions,
|
|
25
|
+
* so the panel imports it without pulling the palette or the runtime.
|
|
26
|
+
*
|
|
27
|
+
* ## The boundary
|
|
28
|
+
*
|
|
29
|
+
* A proposal is OPERATIONS, never a document. The server writes nothing: it
|
|
30
|
+
* answers with ops that name elements already on the canvas, or a validated
|
|
31
|
+
* subtree to insert, and the client applies them through the canvas's own
|
|
32
|
+
* guarded mutators, on confirm, as one undoable step. Every change lands as
|
|
33
|
+
* an unsaved edit on the version the editor has open — a draft — and on a
|
|
34
|
+
* version the live site serves, the editor's own new-version flow runs first.
|
|
35
|
+
*/
|
|
36
|
+
/** The eight operations a proposal may carry. */
|
|
37
|
+
export declare const ASSIST_EDIT_OP_KINDS: readonly ["insertSubtree", "updateProps", "updateSx", "move", "remove", "setSeo", "rename", "saveAsComponent"];
|
|
38
|
+
export type AssistEditOpKind = (typeof ASSIST_EDIT_OP_KINDS)[number];
|
|
39
|
+
/** The id of the besigner view's edit action — the one edit a view offers. */
|
|
40
|
+
export declare const ASSIST_EDIT_ACTION_ID = "edit.canvas";
|
|
41
|
+
/** The name of the structured-output tool a model proposes an edit through. */
|
|
42
|
+
export declare const ASSIST_EDIT_TOOL_NAME = "propose_canvas_edit";
|
|
43
|
+
/** The besigner documents the edit rung opens on: those that keep versions. */
|
|
44
|
+
export type AssistEditDocumentKind = 'screen' | 'component' | 'layout';
|
|
45
|
+
export declare const ASSIST_EDIT_DOCUMENT_KINDS: readonly AssistEditDocumentKind[];
|
|
46
|
+
/** The document a besigner route has open. */
|
|
47
|
+
export interface AssistEditDocument {
|
|
48
|
+
kind: AssistEditDocumentKind;
|
|
49
|
+
documentId: string;
|
|
50
|
+
versionId: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The open document off a console path, or null off a route the edit rung
|
|
54
|
+
* serves. Only the versioned editors qualify — a template or an email editor
|
|
55
|
+
* has no version to make first, so the rung does not open there.
|
|
56
|
+
*/
|
|
57
|
+
export declare function assistEditDocumentOf(route: string): AssistEditDocument | null;
|
|
58
|
+
/** Elements a request describes at most — the selection, its surroundings, its subtree. */
|
|
59
|
+
export declare const ASSIST_EDIT_CONTEXT_MAX_NODES = 60;
|
|
60
|
+
/** Props described per element at most. */
|
|
61
|
+
export declare const ASSIST_EDIT_CONTEXT_MAX_PROPS = 16;
|
|
62
|
+
/** Characters of a string prop the selected element carries into a request. */
|
|
63
|
+
export declare const ASSIST_EDIT_SELECTED_TEXT_CHARS = 400;
|
|
64
|
+
/** Characters of a string prop every other element carries. */
|
|
65
|
+
export declare const ASSIST_EDIT_OUTLINE_TEXT_CHARS = 80;
|
|
66
|
+
/**
|
|
67
|
+
* One element of the canvas outline a request carries. Ids, component ids
|
|
68
|
+
* and short primitive values only — never a stored document, never markup.
|
|
69
|
+
*/
|
|
70
|
+
export interface AssistEditCanvasNode {
|
|
71
|
+
id: string;
|
|
72
|
+
componentId: string;
|
|
73
|
+
/** Null for the document root. */
|
|
74
|
+
parentId: string | null;
|
|
75
|
+
/** Position among the parent's children. */
|
|
76
|
+
index: number;
|
|
77
|
+
childCount: number;
|
|
78
|
+
/** The layer name, when the author gave it one. */
|
|
79
|
+
name?: string;
|
|
80
|
+
/** Primitive props, strings shortened. */
|
|
81
|
+
props?: Record<string, string | number | boolean>;
|
|
82
|
+
/** The element's own styles — carried for the selected element only. */
|
|
83
|
+
sx?: Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Described by its place alone, without props: an element around the
|
|
86
|
+
* selection, there so the model knows it exists and can ask for it.
|
|
87
|
+
*/
|
|
88
|
+
brief?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* An element described earlier whose contents this one's are built like,
|
|
91
|
+
* the way the cards of a row are. Its own contents are left out.
|
|
92
|
+
*/
|
|
93
|
+
like?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface AssistEditCanvasContext {
|
|
96
|
+
/** The element the author has selected, or null. */
|
|
97
|
+
selectedId: string | null;
|
|
98
|
+
/**
|
|
99
|
+
* Elements in the whole document, the root included, so the prompt can say
|
|
100
|
+
* how much of it `nodes` leaves out. Absent from an outline sent by a panel
|
|
101
|
+
* that predates it.
|
|
102
|
+
*/
|
|
103
|
+
total?: number;
|
|
104
|
+
nodes: AssistEditCanvasNode[];
|
|
105
|
+
}
|
|
106
|
+
/** An element of a validated subtree, in the flat shape the canvas stores. */
|
|
107
|
+
export interface AssistEditNode {
|
|
108
|
+
$id: string;
|
|
109
|
+
componentId: string;
|
|
110
|
+
pluginId?: string;
|
|
111
|
+
parentId: string | null;
|
|
112
|
+
nodes: string[];
|
|
113
|
+
props: Record<string, unknown>;
|
|
114
|
+
sx?: Record<string, unknown>;
|
|
115
|
+
hidden?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Every op that acts on an element names the component the server validated
|
|
119
|
+
* it as, so the client can refuse an element that has changed since.
|
|
120
|
+
*/
|
|
121
|
+
interface AssistEditNodeOpBase {
|
|
122
|
+
nodeId: string;
|
|
123
|
+
componentId: string;
|
|
124
|
+
}
|
|
125
|
+
export interface AssistEditInsertOp {
|
|
126
|
+
op: 'insertSubtree';
|
|
127
|
+
parentId: string;
|
|
128
|
+
/** The component the parent was validated as. */
|
|
129
|
+
parentComponentId: string;
|
|
130
|
+
/** Position among the parent's children; null appends. */
|
|
131
|
+
index: number | null;
|
|
132
|
+
rootId: string;
|
|
133
|
+
nodes: Record<string, AssistEditNode>;
|
|
134
|
+
}
|
|
135
|
+
export interface AssistEditUpdatePropsOp extends AssistEditNodeOpBase {
|
|
136
|
+
op: 'updateProps';
|
|
137
|
+
/** Merged over the props the element has; nothing else it carries changes. */
|
|
138
|
+
props: Record<string, unknown>;
|
|
139
|
+
}
|
|
140
|
+
export interface AssistEditUpdateSxOp extends AssistEditNodeOpBase {
|
|
141
|
+
op: 'updateSx';
|
|
142
|
+
/** Merged over the element's own styles, one key at a time. */
|
|
143
|
+
sx: Record<string, unknown>;
|
|
144
|
+
}
|
|
145
|
+
export interface AssistEditMoveOp extends AssistEditNodeOpBase {
|
|
146
|
+
op: 'move';
|
|
147
|
+
parentId: string;
|
|
148
|
+
/** The component the new parent was validated as. */
|
|
149
|
+
parentComponentId: string;
|
|
150
|
+
index: number | null;
|
|
151
|
+
}
|
|
152
|
+
export interface AssistEditRemoveOp extends AssistEditNodeOpBase {
|
|
153
|
+
op: 'remove';
|
|
154
|
+
}
|
|
155
|
+
export interface AssistEditRenameOp extends AssistEditNodeOpBase {
|
|
156
|
+
op: 'rename';
|
|
157
|
+
name: string;
|
|
158
|
+
}
|
|
159
|
+
export interface AssistEditSetSeoOp {
|
|
160
|
+
op: 'setSeo';
|
|
161
|
+
fields: Partial<Record<ScreenSeoTextField, string>>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* A property the promoted subtree declares (AGL-2908), in the shape the
|
|
165
|
+
* Properties dialog stores one — without a default.
|
|
166
|
+
*
|
|
167
|
+
* The server never sees a full value: the outline it read the selection from
|
|
168
|
+
* shortens every string. So the default is read off the live canvas at apply
|
|
169
|
+
* time, from the very field the token is about to replace, which is what
|
|
170
|
+
* makes the instance render what was there a moment before.
|
|
171
|
+
*/
|
|
172
|
+
export type AssistEditComponentProp = Omit<ReusableComponentProp, 'defaultValue'>;
|
|
173
|
+
/** Where one property's token goes: an element of the selection, and a field of it. */
|
|
174
|
+
export interface AssistEditPropBinding {
|
|
175
|
+
nodeId: string;
|
|
176
|
+
/** The component the element was validated as, so a changed one is refused. */
|
|
177
|
+
componentId: string;
|
|
178
|
+
/** A prop of that element, or `hideIf` for a part a Yes / no hides. */
|
|
179
|
+
field: string;
|
|
180
|
+
/** The property whose `{{prop.<name>}}` token the field takes. */
|
|
181
|
+
prop: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Save the selection as a reusable component (AGL-2908), with the properties
|
|
185
|
+
* the model proposed and the tokens bound into the tree.
|
|
186
|
+
*
|
|
187
|
+
* The only op that creates a document. It creates exactly the one the manual
|
|
188
|
+
* Save as reusable component creates, through the same host resources route,
|
|
189
|
+
* where the plan's entitlement and the route's allow-list are enforced — and
|
|
190
|
+
* it changes the open canvas the same way that action does, by swapping the
|
|
191
|
+
* promoted subtree for an instance. Nothing is published and nothing is
|
|
192
|
+
* saved: the swap is an unsaved edit on the version the editor has open.
|
|
193
|
+
*/
|
|
194
|
+
export interface AssistEditSaveAsComponentOp extends AssistEditNodeOpBase {
|
|
195
|
+
op: 'saveAsComponent';
|
|
196
|
+
/** The name the component is created under. */
|
|
197
|
+
name: string;
|
|
198
|
+
props: AssistEditComponentProp[];
|
|
199
|
+
bindings: AssistEditPropBinding[];
|
|
200
|
+
}
|
|
201
|
+
export type AssistEditOp = AssistEditInsertOp | AssistEditUpdatePropsOp | AssistEditUpdateSxOp | AssistEditMoveOp | AssistEditRemoveOp | AssistEditRenameOp | AssistEditSetSeoOp | AssistEditSaveAsComponentOp;
|
|
202
|
+
/** Where a proposal applies, as the server read it off the request. */
|
|
203
|
+
export interface AssistEditTarget extends AssistEditDocument {
|
|
204
|
+
hostId: string;
|
|
205
|
+
}
|
|
206
|
+
/** The counts the card shows before the author decides. */
|
|
207
|
+
export interface AssistEditDiff {
|
|
208
|
+
/** Elements added, every element of every inserted subtree counted. */
|
|
209
|
+
added: number;
|
|
210
|
+
/** Elements removed — each with whatever it contains. */
|
|
211
|
+
removed: number;
|
|
212
|
+
propsChanged: number;
|
|
213
|
+
stylesChanged: number;
|
|
214
|
+
moved: number;
|
|
215
|
+
renamed: number;
|
|
216
|
+
/** Search fields filled in. */
|
|
217
|
+
seoFields: number;
|
|
218
|
+
/** Properties the selection declares once it is saved as a component. */
|
|
219
|
+
componentProps: number;
|
|
220
|
+
/** Selections saved as a reusable component — at most one per proposal. */
|
|
221
|
+
componentsSaved: number;
|
|
222
|
+
}
|
|
223
|
+
/** The most reasons a proposal carries for the changes validation left out. */
|
|
224
|
+
export declare const ASSIST_EDIT_MAX_DROPPED_REASONS = 10;
|
|
225
|
+
export interface AssistEditProposal {
|
|
226
|
+
id: typeof ASSIST_EDIT_ACTION_ID;
|
|
227
|
+
/** One line, in the model's words, of what the edit does. */
|
|
228
|
+
summary: string;
|
|
229
|
+
ops: AssistEditOp[];
|
|
230
|
+
diff: AssistEditDiff;
|
|
231
|
+
/** Why each change the model wrote and validation refused was left out. */
|
|
232
|
+
dropped: string[];
|
|
233
|
+
target: AssistEditTarget;
|
|
234
|
+
}
|
|
235
|
+
/** The counts for a list of ops. */
|
|
236
|
+
export declare function summarizeAssistEditOps(ops: readonly AssistEditOp[]): AssistEditDiff;
|
|
237
|
+
/** The diff as the lines a person reads, zero counts omitted. */
|
|
238
|
+
export declare function describeAssistEditDiff(diff: AssistEditDiff): string[];
|
|
239
|
+
/** The applied ops counted by kind, as the activity row names them (`{ set: 3, insert: 1 }`). */
|
|
240
|
+
export declare function assistEditOpCounts(ops: readonly AssistEditOp[]): Record<string, number>;
|
|
241
|
+
/** The words `assistEditOpCounts` counts under, for a door that reads them back. */
|
|
242
|
+
export declare const ASSIST_EDIT_OP_COUNT_WORDS: readonly string[];
|
|
243
|
+
/**
|
|
244
|
+
* Whether a `done` event's `edit` field is a proposal this client can apply.
|
|
245
|
+
* The server built it, so this is a shape check rather than a validation: it
|
|
246
|
+
* keeps a malformed or foreign payload from reaching the canvas mutators.
|
|
247
|
+
*/
|
|
248
|
+
export declare function isAssistEditProposal(value: unknown): value is AssistEditProposal;
|
|
249
|
+
/** The body of `POST /api/assist/edit-applied`. */
|
|
250
|
+
export interface AssistEditAppliedReport {
|
|
251
|
+
orgId: string;
|
|
252
|
+
hostId: string;
|
|
253
|
+
/** The exchange whose answer carried the proposal. */
|
|
254
|
+
exchangeId: string;
|
|
255
|
+
documentKind: AssistEditDocumentKind;
|
|
256
|
+
documentId: string;
|
|
257
|
+
/** The version the edits landed on — a new one when the open one was live. */
|
|
258
|
+
versionId: string;
|
|
259
|
+
opCounts: Record<string, number>;
|
|
260
|
+
}
|
|
261
|
+
export {};
|
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
* Assist level 3, the edit contract (AGL-2906): what the chat door proposes
|
|
18
|
+
* for a besigner canvas, and what the panel applies once the author says so.
|
|
19
|
+
*
|
|
20
|
+
* Shared by the server, which validates a model's proposal into these
|
|
21
|
+
* shapes, and the client, which applies them. Pure data and pure functions,
|
|
22
|
+
* so the panel imports it without pulling the palette or the runtime.
|
|
23
|
+
*
|
|
24
|
+
* ## The boundary
|
|
25
|
+
*
|
|
26
|
+
* A proposal is OPERATIONS, never a document. The server writes nothing: it
|
|
27
|
+
* answers with ops that name elements already on the canvas, or a validated
|
|
28
|
+
* subtree to insert, and the client applies them through the canvas's own
|
|
29
|
+
* guarded mutators, on confirm, as one undoable step. Every change lands as
|
|
30
|
+
* an unsaved edit on the version the editor has open — a draft — and on a
|
|
31
|
+
* version the live site serves, the editor's own new-version flow runs first.
|
|
32
|
+
*/ /** The eight operations a proposal may carry. */ export const ASSIST_EDIT_OP_KINDS = [
|
|
33
|
+
'insertSubtree',
|
|
34
|
+
'updateProps',
|
|
35
|
+
'updateSx',
|
|
36
|
+
'move',
|
|
37
|
+
'remove',
|
|
38
|
+
'setSeo',
|
|
39
|
+
'rename',
|
|
40
|
+
'saveAsComponent'
|
|
41
|
+
];
|
|
42
|
+
/** The id of the besigner view's edit action — the one edit a view offers. */ export const ASSIST_EDIT_ACTION_ID = 'edit.canvas';
|
|
43
|
+
/** The name of the structured-output tool a model proposes an edit through. */ export const ASSIST_EDIT_TOOL_NAME = 'propose_canvas_edit';
|
|
44
|
+
export const ASSIST_EDIT_DOCUMENT_KINDS = [
|
|
45
|
+
'screen',
|
|
46
|
+
'component',
|
|
47
|
+
'layout'
|
|
48
|
+
];
|
|
49
|
+
const COLLECTION_KINDS = {
|
|
50
|
+
screens: 'screen',
|
|
51
|
+
components: 'component',
|
|
52
|
+
layouts: 'layout'
|
|
53
|
+
};
|
|
54
|
+
const BESIGNER_DOCUMENT_ROUTE = /^\/[^/]+\/hosts\/[^/]+\/(screens|components|layouts)\/([A-Za-z0-9_-]{1,64})\/versions\/([A-Za-z0-9_-]{1,64})\/besigner\/?$/;
|
|
55
|
+
/**
|
|
56
|
+
* The open document off a console path, or null off a route the edit rung
|
|
57
|
+
* serves. Only the versioned editors qualify — a template or an email editor
|
|
58
|
+
* has no version to make first, so the rung does not open there.
|
|
59
|
+
*/ export function assistEditDocumentOf(route) {
|
|
60
|
+
const match = BESIGNER_DOCUMENT_ROUTE.exec(String(route != null ? route : ''));
|
|
61
|
+
if (!match) return null;
|
|
62
|
+
return {
|
|
63
|
+
kind: COLLECTION_KINDS[match[1]],
|
|
64
|
+
documentId: match[2],
|
|
65
|
+
versionId: match[3]
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/* ------------------------------------------------------------------ *
|
|
69
|
+
* What the client tells the server about the canvas
|
|
70
|
+
* ------------------------------------------------------------------ */ /** Elements a request describes at most — the selection, its surroundings, its subtree. */ export const ASSIST_EDIT_CONTEXT_MAX_NODES = 60;
|
|
71
|
+
/** Props described per element at most. */ export const ASSIST_EDIT_CONTEXT_MAX_PROPS = 16;
|
|
72
|
+
/** Characters of a string prop the selected element carries into a request. */ export const ASSIST_EDIT_SELECTED_TEXT_CHARS = 400;
|
|
73
|
+
/** Characters of a string prop every other element carries. */ export const ASSIST_EDIT_OUTLINE_TEXT_CHARS = 80;
|
|
74
|
+
/** The most reasons a proposal carries for the changes validation left out. */ export const ASSIST_EDIT_MAX_DROPPED_REASONS = 10;
|
|
75
|
+
/** The counts for a list of ops. */ export function summarizeAssistEditOps(ops) {
|
|
76
|
+
const diff = {
|
|
77
|
+
added: 0,
|
|
78
|
+
removed: 0,
|
|
79
|
+
propsChanged: 0,
|
|
80
|
+
stylesChanged: 0,
|
|
81
|
+
moved: 0,
|
|
82
|
+
renamed: 0,
|
|
83
|
+
seoFields: 0,
|
|
84
|
+
componentProps: 0,
|
|
85
|
+
componentsSaved: 0
|
|
86
|
+
};
|
|
87
|
+
for (const op of ops){
|
|
88
|
+
switch(op.op){
|
|
89
|
+
case 'insertSubtree':
|
|
90
|
+
diff.added += Object.keys(op.nodes).length;
|
|
91
|
+
break;
|
|
92
|
+
case 'remove':
|
|
93
|
+
diff.removed += 1;
|
|
94
|
+
break;
|
|
95
|
+
case 'updateProps':
|
|
96
|
+
diff.propsChanged += 1;
|
|
97
|
+
break;
|
|
98
|
+
case 'updateSx':
|
|
99
|
+
diff.stylesChanged += 1;
|
|
100
|
+
break;
|
|
101
|
+
case 'move':
|
|
102
|
+
diff.moved += 1;
|
|
103
|
+
break;
|
|
104
|
+
case 'rename':
|
|
105
|
+
diff.renamed += 1;
|
|
106
|
+
break;
|
|
107
|
+
case 'setSeo':
|
|
108
|
+
diff.seoFields += Object.keys(op.fields).length;
|
|
109
|
+
break;
|
|
110
|
+
case 'saveAsComponent':
|
|
111
|
+
diff.componentsSaved += 1;
|
|
112
|
+
diff.componentProps += op.props.length;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return diff;
|
|
117
|
+
}
|
|
118
|
+
const plural = (count, one, many)=>`${count} ${count === 1 ? one : many}`;
|
|
119
|
+
/** The diff as the lines a person reads, zero counts omitted. */ export function describeAssistEditDiff(diff) {
|
|
120
|
+
const lines = [];
|
|
121
|
+
if (diff.added) lines.push(`${plural(diff.added, 'element', 'elements')} added`);
|
|
122
|
+
if (diff.removed) lines.push(`${plural(diff.removed, 'element', 'elements')} removed`);
|
|
123
|
+
if (diff.propsChanged) {
|
|
124
|
+
lines.push(`${plural(diff.propsChanged, 'element’s settings', 'elements’ settings')} changed`);
|
|
125
|
+
}
|
|
126
|
+
if (diff.stylesChanged) {
|
|
127
|
+
lines.push(`${plural(diff.stylesChanged, 'element', 'elements')} restyled`);
|
|
128
|
+
}
|
|
129
|
+
if (diff.moved) lines.push(`${plural(diff.moved, 'element', 'elements')} moved`);
|
|
130
|
+
if (diff.renamed) lines.push(`${plural(diff.renamed, 'layer', 'layers')} renamed`);
|
|
131
|
+
if (diff.seoFields) {
|
|
132
|
+
lines.push(`${plural(diff.seoFields, 'search field', 'search fields')} filled in`);
|
|
133
|
+
}
|
|
134
|
+
if (diff.componentsSaved) {
|
|
135
|
+
lines.push(`saved as a reusable component with ${plural(diff.componentProps, 'property', 'properties')}`);
|
|
136
|
+
}
|
|
137
|
+
return lines;
|
|
138
|
+
}
|
|
139
|
+
/** The word each op kind is counted under in the activity row. */ const OP_COUNT_WORDS = {
|
|
140
|
+
updateProps: 'set',
|
|
141
|
+
updateSx: 'restyle',
|
|
142
|
+
insertSubtree: 'insert',
|
|
143
|
+
move: 'move',
|
|
144
|
+
remove: 'remove',
|
|
145
|
+
rename: 'rename',
|
|
146
|
+
setSeo: 'seo',
|
|
147
|
+
saveAsComponent: 'component'
|
|
148
|
+
};
|
|
149
|
+
/** The applied ops counted by kind, as the activity row names them (`{ set: 3, insert: 1 }`). */ export function assistEditOpCounts(ops) {
|
|
150
|
+
const counts = {};
|
|
151
|
+
for (const op of ops){
|
|
152
|
+
var _counts_word;
|
|
153
|
+
const word = OP_COUNT_WORDS[op.op];
|
|
154
|
+
if (word) counts[word] = ((_counts_word = counts[word]) != null ? _counts_word : 0) + 1;
|
|
155
|
+
}
|
|
156
|
+
return counts;
|
|
157
|
+
}
|
|
158
|
+
/** The words `assistEditOpCounts` counts under, for a door that reads them back. */ export const ASSIST_EDIT_OP_COUNT_WORDS = Object.values(OP_COUNT_WORDS);
|
|
159
|
+
const isRecord = (value)=>typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
160
|
+
/**
|
|
161
|
+
* Whether a `done` event's `edit` field is a proposal this client can apply.
|
|
162
|
+
* The server built it, so this is a shape check rather than a validation: it
|
|
163
|
+
* keeps a malformed or foreign payload from reaching the canvas mutators.
|
|
164
|
+
*/ export function isAssistEditProposal(value) {
|
|
165
|
+
if (!isRecord(value) || value['id'] !== ASSIST_EDIT_ACTION_ID) return false;
|
|
166
|
+
const target = value['target'];
|
|
167
|
+
if (!isRecord(target)) return false;
|
|
168
|
+
if (!ASSIST_EDIT_DOCUMENT_KINDS.includes(target['kind'])) return false;
|
|
169
|
+
if (typeof target['documentId'] !== 'string' || !target['documentId']) return false;
|
|
170
|
+
const ops = value['ops'];
|
|
171
|
+
if (!Array.isArray(ops) || !ops.length) return false;
|
|
172
|
+
return ops.every((op)=>isRecord(op) && ASSIST_EDIT_OP_KINDS.includes(op['op']));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=assist-edit.js.map
|