@aglyn/plugins-ai 1.0.0-beta.218 → 1.0.0-beta.219
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/README.md +2 -2
- package/package.json +17 -17
- package/src/index.d.ts +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/activity/ai-activity-actions.js +8 -1
- package/src/lib/activity/ai-activity-actions.js.map +1 -1
- package/src/lib/components/ai-assist-provider.component.js +2 -2
- package/src/lib/components/ai-assist-provider.component.js.map +1 -1
- package/src/lib/components/ai-brief-dialog.component.js +3 -3
- package/src/lib/components/ai-brief-dialog.component.js.map +1 -1
- package/src/lib/components/ai-experiment-cards.component.js +1 -1
- package/src/lib/components/ai-experiment-cards.component.js.map +1 -1
- package/src/lib/components/ai-job-plan.component.d.ts +8 -0
- package/src/lib/components/ai-job-plan.component.js +21 -4
- package/src/lib/components/ai-job-plan.component.js.map +1 -1
- package/src/lib/components/ai-permissions-on-host.component.d.ts +12 -2
- package/src/lib/components/ai-permissions-on-host.component.js +12 -3
- package/src/lib/components/ai-permissions-on-host.component.js.map +1 -1
- package/src/lib/components/ai-product-copy-card.component.d.ts +1 -1
- package/src/lib/components/ai-product-copy-card.component.js.map +1 -1
- package/src/lib/components/ai-product-import-option.component.d.ts +1 -1
- package/src/lib/components/ai-product-import-option.component.js.map +1 -1
- package/src/lib/components/ai-product-zones.d.ts +124 -0
- package/src/lib/components/ai-product-zones.js +32 -0
- package/src/lib/components/ai-product-zones.js.map +1 -0
- package/src/lib/components/ai-products-hub-card.component.d.ts +1 -1
- package/src/lib/components/ai-products-hub-card.component.js.map +1 -1
- package/src/lib/components/ai-products-proposals.component.d.ts +1 -1
- package/src/lib/components/ai-products-proposals.component.js.map +1 -1
- package/src/lib/components/ai-seo-audit-card.component.js +35 -92
- package/src/lib/components/ai-seo-audit-card.component.js.map +1 -1
- package/src/lib/components/ai-seo-fields-card.component.js.map +1 -1
- package/src/lib/components/ai-theme-proposal-card.component.js.map +1 -1
- package/src/lib/components/assist-jobs-drawer.component.js +21 -15
- package/src/lib/components/assist-jobs-drawer.component.js.map +1 -1
- package/src/lib/components/assist-panel.component.js +2 -2
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/components/assist-signals-page.component.js +2 -2
- package/src/lib/components/assist-signals-page.component.js.map +1 -1
- package/src/lib/jobs/ai-email-bindings.d.ts +28 -21
- package/src/lib/jobs/ai-email-bindings.js +75 -42
- package/src/lib/jobs/ai-email-bindings.js.map +1 -1
- package/src/lib/jobs/ai-job-campaign-step.d.ts +0 -2
- package/src/lib/jobs/ai-job-campaign-step.js +5 -10
- package/src/lib/jobs/ai-job-campaign-step.js.map +1 -1
- package/src/lib/jobs/ai-job-component-step.js +9 -3
- package/src/lib/jobs/ai-job-component-step.js.map +1 -1
- package/src/lib/jobs/ai-job-drafts.js +1 -1
- package/src/lib/jobs/ai-job-drafts.js.map +1 -1
- package/src/lib/jobs/ai-job-email-step.d.ts +0 -2
- package/src/lib/jobs/ai-job-email-step.js +1 -3
- package/src/lib/jobs/ai-job-email-step.js.map +1 -1
- package/src/lib/jobs/ai-job-experiment-step.d.ts +1 -1
- package/src/lib/jobs/ai-job-experiment-step.js +1 -1
- package/src/lib/jobs/ai-job-experiment-step.js.map +1 -1
- package/src/lib/jobs/ai-job-generation.d.ts +1 -1
- package/src/lib/jobs/ai-job-generation.js +10 -2
- package/src/lib/jobs/ai-job-generation.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-step.js +1 -1
- package/src/lib/jobs/ai-job-layout-step.js.map +1 -1
- package/src/lib/jobs/ai-job-page-sections.d.ts +4 -2
- package/src/lib/jobs/ai-job-page-sections.js +7 -4
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.js +7 -2
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-conformance.js +33 -0
- package/src/lib/jobs/ai-job-plan-conformance.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +3 -0
- package/src/lib/jobs/ai-job-plan-step.js +29 -17
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plugin-drafts.d.ts +14 -6
- package/src/lib/jobs/ai-job-plugin-drafts.js +12 -4
- package/src/lib/jobs/ai-job-plugin-drafts.js.map +1 -1
- package/src/lib/jobs/ai-job-products-step.d.ts +7 -0
- package/src/lib/jobs/ai-job-products-step.js +54 -32
- package/src/lib/jobs/ai-job-products-step.js.map +1 -1
- package/src/lib/jobs/ai-job-seo-step.d.ts +3 -24
- package/src/lib/jobs/ai-job-seo-step.js +35 -108
- package/src/lib/jobs/ai-job-seo-step.js.map +1 -1
- package/src/lib/jobs/ai-job-template-step.js +1 -0
- package/src/lib/jobs/ai-job-template-step.js.map +1 -1
- package/src/lib/jobs/ai-job-theme-step.d.ts +1 -1
- package/src/lib/jobs/ai-job-theme-step.js +1 -1
- package/src/lib/jobs/ai-job-theme-step.js.map +1 -1
- package/src/lib/jobs/ai-job-workflow-step.js +17 -9
- package/src/lib/jobs/ai-job-workflow-step.js.map +1 -1
- package/src/lib/jobs/ai-workflow-records.d.ts +19 -11
- package/src/lib/jobs/ai-workflow-records.js +60 -27
- package/src/lib/jobs/ai-workflow-records.js.map +1 -1
- package/src/lib/model/ai-allotments.d.ts +11 -3
- package/src/lib/model/ai-allotments.js +21 -4
- package/src/lib/model/ai-allotments.js.map +1 -1
- package/src/lib/model/ai-automation-outline.d.ts +21 -2
- package/src/lib/model/ai-automation-outline.js.map +1 -1
- package/src/lib/model/ai-build-plan.d.ts +57 -0
- package/src/lib/model/ai-build-plan.js +116 -7
- package/src/lib/model/ai-build-plan.js.map +1 -1
- package/src/lib/model/ai-seo.d.ts +11 -51
- package/src/lib/model/ai-seo.js +0 -17
- package/src/lib/model/ai-seo.js.map +1 -1
- package/src/lib/model/ai-site-inventory.js +1 -1
- package/src/lib/model/ai-site-inventory.js.map +1 -1
- package/src/lib/model/ai-template-subjects.js +2 -2
- package/src/lib/model/ai-template-subjects.js.map +1 -1
- package/src/lib/model/ai-theme-proposal.d.ts +1 -1
- package/src/lib/model/ai-theme-proposal.js +1 -1
- package/src/lib/model/ai-theme-proposal.js.map +1 -1
- package/src/lib/model/ai-workflow-job.d.ts +1 -3
- package/src/lib/model/ai-workflow-job.js +1 -2
- package/src/lib/model/ai-workflow-job.js.map +1 -1
- package/src/lib/plan-entitlements.d.ts +149 -0
- package/src/lib/plan-entitlements.js +168 -0
- package/src/lib/plan-entitlements.js.map +1 -0
- package/src/lib/plugin.js +1 -1
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +25 -4
- package/src/lib/runtime/ai-doctrine-validators.js +178 -21
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +5 -5
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-eval-live.js +29 -14
- package/src/lib/runtime/ai-eval-live.js.map +1 -1
- package/src/lib/runtime/ai-eval.d.ts +8 -1
- package/src/lib/runtime/ai-eval.js +29 -2
- package/src/lib/runtime/ai-eval.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.js +3 -3
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/runtime/ai-palette.d.ts +6 -0
- package/src/lib/runtime/ai-palette.generated.js +15 -12
- package/src/lib/runtime/ai-palette.generated.js.map +1 -1
- package/src/lib/runtime/ai-palette.js +7 -1
- package/src/lib/runtime/ai-palette.js.map +1 -1
- package/src/lib/runtime/seo-audit.d.ts +13 -63
- package/src/lib/runtime/seo-audit.js +22 -207
- package/src/lib/runtime/seo-audit.js.map +1 -1
- package/src/lib/runtime/site-inventory.js +1 -1
- package/src/lib/runtime/site-inventory.js.map +1 -1
- package/src/lib/server/ai-assist-prompts.js +3 -3
- package/src/lib/server/ai-assist-prompts.js.map +1 -1
- package/src/lib/server/assist-chat.js +11 -10
- package/src/lib/server/assist-chat.js.map +1 -1
- package/src/lib/server/assist-view-context.js +23 -23
- package/src/lib/server/assist-view-context.js.map +1 -1
- package/src/lib/server.d.ts +1 -0
- package/src/lib/server.js.map +1 -1
- package/src/lib/testing/stand-in-automation-index.d.ts +20 -0
- package/src/lib/testing/stand-in-automation-index.js +102 -0
- package/src/lib/testing/stand-in-automation-index.js.map +1 -0
- package/src/lib/testing/stand-in-list-send-time.d.ts +4 -0
- package/src/lib/testing/stand-in-list-send-time.js +77 -0
- package/src/lib/testing/stand-in-list-send-time.js.map +1 -0
- package/src/lib/testing/stand-in-pipeline-index.d.ts +32 -0
- package/src/lib/testing/stand-in-pipeline-index.js +59 -0
- package/src/lib/testing/stand-in-pipeline-index.js.map +1 -0
- package/src/lib/testing/stand-in-product-index.d.ts +20 -0
- package/src/lib/testing/stand-in-product-index.js +105 -0
- package/src/lib/testing/stand-in-product-index.js.map +1 -0
- package/src/lib/tools/ai-component-tool.js +2 -2
- package/src/lib/tools/ai-component-tool.js.map +1 -1
- package/src/lib/tools/ai-duplicate-resource-tool.js +1 -1
- package/src/lib/tools/ai-duplicate-resource-tool.js.map +1 -1
- package/src/lib/tools/ai-seo-tool.d.ts +6 -18
- package/src/lib/tools/ai-seo-tool.js +7 -38
- package/src/lib/tools/ai-seo-tool.js.map +1 -1
- package/src/lib/tools/ai-workflow-tool.d.ts +1 -1
- package/src/lib/tools/ai-workflow-tool.js +1 -1
- package/src/lib/tools/ai-workflow-tool.js.map +1 -1
- package/src/lib/usage/ai-allotment-alerts.js +8 -1
- package/src/lib/usage/ai-allotment-alerts.js.map +1 -1
- package/src/lib/usage/assist-free-taste.js +2 -1
- package/src/lib/usage/assist-free-taste.js.map +1 -1
- package/src/lib/usage-axes.d.ts +39 -0
- package/src/lib/usage-axes.js +70 -0
- package/src/lib/usage-axes.js.map +1 -0
- package/src/lib/runtime/seo-page-facts.d.ts +0 -61
- package/src/lib/runtime/seo-page-facts.js +0 -150
- package/src/lib/runtime/seo-page-facts.js.map +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
*/ // Types only: the manifest generator loads this module on its own to compile
|
|
17
|
+
// the plan figures, before the catalog file core reads them from exists in
|
|
18
|
+
// its new shape, so nothing here may reach a core module at runtime.
|
|
19
|
+
/**
|
|
20
|
+
* AI credits an Enterprise agreement includes per month, before the contract
|
|
21
|
+
* says otherwise.
|
|
22
|
+
*
|
|
23
|
+
* ## Never `UNLIMITED`, and the reason is not stylistic
|
|
24
|
+
*
|
|
25
|
+
* `UNLIMITED` is `Number.POSITIVE_INFINITY`, `JSON.stringify(Infinity)` is
|
|
26
|
+
* `null`, and `Number(null)` is `0`. An unbounded assist band therefore
|
|
27
|
+
* serialises to a band of ZERO through every route that does not also send
|
|
28
|
+
* the explicit flag `restoreQuotaLimit` rebuilds from — which would hand the
|
|
29
|
+
* only customers with a signed contract the one budget that refuses
|
|
30
|
+
* everything. A finite number crosses the wire as itself.
|
|
31
|
+
*
|
|
32
|
+
* The band is also a real liability rather than a capacity we already own.
|
|
33
|
+
* Storage and page views are infrastructure metered into the deal; assist is
|
|
34
|
+
* a per-token charge from a third party, and generative building spends it in
|
|
35
|
+
* units two orders of magnitude apart.
|
|
36
|
+
*
|
|
37
|
+
* ## Why this number
|
|
38
|
+
*
|
|
39
|
+
* Enterprise carries no list price, so the band cannot be sized the way every
|
|
40
|
+
* self-serve tier's is — against what that tier's other cost terms leave out
|
|
41
|
+
* of a known price. It is anchored to the top of the ladder instead: 116,000
|
|
42
|
+
* credits is twice Agency's band, the rule every Enterprise fallback follows
|
|
43
|
+
* since the 2026-09-07 pricing decision (see the `enterprise` row of
|
|
44
|
+
* `PLAN_ENTITLEMENTS`). In cost that is $116 of provider spend a month, or
|
|
45
|
+
* under 9% of any deal priced at or above the self-serve top. A deal below
|
|
46
|
+
* that is sold as Agency, not written as an Enterprise agreement.
|
|
47
|
+
*
|
|
48
|
+
* ## It is a DEFAULT, and a contract raises it
|
|
49
|
+
*
|
|
50
|
+
* `resolveOrgEntitlements` applies a per-org
|
|
51
|
+
* `entitlements.assistCreditsPerMonth` override ahead of this, so a deal that
|
|
52
|
+
* buys more assist buys it on that org without moving the figure every other
|
|
53
|
+
* agreement is measured against — the same mechanism the other contracted
|
|
54
|
+
* bands use.
|
|
55
|
+
*/ export const ENTERPRISE_ASSIST_CREDITS_PER_MONTH = 116000;
|
|
56
|
+
/**
|
|
57
|
+
* The Free AI taste (AGL-2925): the credits a Free workspace draws on each
|
|
58
|
+
* month, behind a hard wall.
|
|
59
|
+
*
|
|
60
|
+
* ## Why it exists
|
|
61
|
+
*
|
|
62
|
+
* So the AI landing pages can say "generate your first page free" and mean
|
|
63
|
+
* it. Three hundred credits is one or two generated sections or a handful of
|
|
64
|
+
* copy rewrites — enough to see what the assistant does, not enough to build
|
|
65
|
+
* a site on. The band is a WALL: `PLAN_PRICING.free
|
|
66
|
+
* .extraAssistCreditsUsdPer1k` stays `null`, so `assistBandRefuses` answers
|
|
67
|
+
* true and the reservation refuses at 100% with no overage, no switch and no
|
|
68
|
+
* invoice. Nothing about a Free workspace can produce a charge.
|
|
69
|
+
*
|
|
70
|
+
* ## What it costs, and why that is the number
|
|
71
|
+
*
|
|
72
|
+
* A credit is `ASSIST_CREDIT_COST_USD` of provider spend, so the band costs
|
|
73
|
+
* at most **$0.30 per Free workspace per month** — asserted by
|
|
74
|
+
* `apps/console/specs/tier-margin-floor.spec.ts`. It is the one AI band with
|
|
75
|
+
* no invoice behind it, which is why the same issue closes every multiplier
|
|
76
|
+
* a script could use before the flag flips:
|
|
77
|
+
*
|
|
78
|
+
* - it is metered per ACCOUNT as well as per workspace, so the three free
|
|
79
|
+
* workspaces an account may hold (AGL-2265) share one 300-credit
|
|
80
|
+
* allowance rather than tripling it (`reserveAssistMessage`);
|
|
81
|
+
* - a fresh account waits `AI_FREE_MIN_ACCOUNT_AGE_HOURS` before it can
|
|
82
|
+
* spend, and every free request is bounded per IP, per uid and per
|
|
83
|
+
* account per day;
|
|
84
|
+
* - a platform-wide daily ceiling on free spend pauses the taste for
|
|
85
|
+
* everyone until the UTC day rolls, paid workspaces untouched.
|
|
86
|
+
*
|
|
87
|
+
* The account allowance reads THIS constant rather than the workspace's
|
|
88
|
+
* resolved band, because a staff override that widens one workspace's band
|
|
89
|
+
* is a decision about that workspace, not about how much one person may draw
|
|
90
|
+
* across all of theirs.
|
|
91
|
+
*/ export const FREE_AI_TASTE_CREDITS_PER_MONTH = 300;
|
|
92
|
+
/** The AI credits each plan includes a month — see the key's own docblock. */ export const AI_CREDITS_BY_PLAN = {
|
|
93
|
+
// The Free AI taste (AGL-2925): a real band, and a wall. See the constant
|
|
94
|
+
// for what it buys, what it costs and the precautions that keep one person
|
|
95
|
+
// from drawing it three times over.
|
|
96
|
+
free: FREE_AI_TASTE_CREDITS_PER_MONTH,
|
|
97
|
+
// The first paid rung of the assist ladder (AGL-3203). Starter banded at 0
|
|
98
|
+
// until 2026-09-20, which put a PAYING workspace below the Free taste's 300
|
|
99
|
+
// on the one axis a visitor compares straight down the column — the
|
|
100
|
+
// `/pricing` row read `300 / mo` for Free and `—` for Starter. A paid plan
|
|
101
|
+
// that includes less of something than the free plan is not a packaging
|
|
102
|
+
// subtlety; it is the comparison table arguing against the upgrade.
|
|
103
|
+
//
|
|
104
|
+
// 750 is deliberately small: 2.5x the taste, enough that the assistant is a
|
|
105
|
+
// thing the tier HAS rather than a thing it is shown, and $0.75 of provider
|
|
106
|
+
// spend a month at `ASSIST_CREDIT_COST_USD` against a $16 annual price — a
|
|
107
|
+
// twentieth of the $8.81 the tier's other metered bands already cost, and
|
|
108
|
+
// the widest margin on the ladder absorbs it with room left
|
|
109
|
+
// (`tier-margin-floor.spec.ts` carries the arithmetic).
|
|
110
|
+
//
|
|
111
|
+
// It is NOT a wall, unlike Free's: `PLAN_PRICING.starter
|
|
112
|
+
// .extraAssistCreditsUsdPer1k` is $3.00, so past 750 the tier meters and
|
|
113
|
+
// bills like every paid plan above it. The two fields move together by rule
|
|
114
|
+
// — a positive band with no rate beside it is usage past a bound that is
|
|
115
|
+
// silently free, which `plan-entitlements.spec.ts` forbids.
|
|
116
|
+
//
|
|
117
|
+
// `features.aiAssist` is TRUE, and AGL-3203 shipping it false was the
|
|
118
|
+
// defect AGL-3207 closes. The reasoning then was "the band is credits, not
|
|
119
|
+
// the guided rung, exactly as on Free" — but on Free the band IS spendable,
|
|
120
|
+
// through `aiGenerative`, which is the door the taste exists for. Starter
|
|
121
|
+
// carried neither flag, so it was the only row on the ladder sold a band
|
|
122
|
+
// with nothing to spend it through: 750 credits reachable only by buying
|
|
123
|
+
// the $9 add-on that was also the only thing that made them usable. "No
|
|
124
|
+
// plan bands at zero any more" was true of the number and false of the
|
|
125
|
+
// capability.
|
|
126
|
+
//
|
|
127
|
+
// It opens `aiAssist` rather than `aiGenerative` because that is the shape
|
|
128
|
+
// of every paid rung above it — the included band funds the guided
|
|
129
|
+
// assistant and generation is the add-on. Opening the generative door here
|
|
130
|
+
// instead would hand the FIRST paid rung a door Pro through Agency have to
|
|
131
|
+
// buy.
|
|
132
|
+
//
|
|
133
|
+
// No cost moves: `tier-margin-floor.spec.ts` already prices this tier's
|
|
134
|
+
// assist term at 100% burn of the 750 credits, 75¢/mo. A door does not
|
|
135
|
+
// widen a band; it only makes spend that was already modeled reachable.
|
|
136
|
+
//
|
|
137
|
+
// The AI add-on adds `AI_ADDON_CREDITS_PER_MONTH.starter` on top and
|
|
138
|
+
// switches `aiGenerative` on as well.
|
|
139
|
+
starter: 750,
|
|
140
|
+
// $2.75 of provider spend, against the $8.35 the tier's other seven cost
|
|
141
|
+
// terms leave out of $56. See the key's docblock for why the remainder and
|
|
142
|
+
// not the price is what sizes this.
|
|
143
|
+
pro: 2750,
|
|
144
|
+
// $7.50, against the $22.69 the other seven terms leave out of $139.
|
|
145
|
+
business: 7500,
|
|
146
|
+
// $10.00, against the $30.62 the other seven terms leave out of $249.
|
|
147
|
+
scale: 10000,
|
|
148
|
+
// $13.00, against the $39.74 the other seven terms leave out of $399 — the
|
|
149
|
+
// thinnest remainder on the ladder, and the tier that binds the whole
|
|
150
|
+
// assist ladder's share of it.
|
|
151
|
+
advanced: 13000,
|
|
152
|
+
// $58.00, against the $176.71 the other seven terms leave out of $1,299.
|
|
153
|
+
agency: 58000,
|
|
154
|
+
enterprise: ENTERPRISE_ASSIST_CREDITS_PER_MONTH
|
|
155
|
+
};
|
|
156
|
+
/** The AI plugin's plan figures, for the manifest generator. */ export function aiPlanEntitlements() {
|
|
157
|
+
return {
|
|
158
|
+
quotas: [
|
|
159
|
+
{
|
|
160
|
+
key: 'assistCreditsPerMonth',
|
|
161
|
+
label: 'AI credits / mo',
|
|
162
|
+
byPlan: AI_CREDITS_BY_PLAN
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=plan-entitlements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/ai/src/lib/plan-entitlements.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Types only: the manifest generator loads this module on its own to compile\n// the plan figures, before the catalog file core reads them from exists in\n// its new shape, so nothing here may reach a core module at runtime.\nimport type { OrgPlan } from '@aglyn/aglyn/foundation/definitions/org-billing.types'\nimport type { PluginPlanEntitlementsDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-plan-entitlements'\n\n/**\n * THE AI PLUGIN'S PLAN BAND (AGL-3080): how many AI credits each plan\n * includes a month. Compiled into core's `PLAN_ENTITLEMENTS` by the manifest\n * generator (`register.planEntitlements`), so `/pricing`, the plan comparison\n * and every gate read the same figure they always have; this is where it is\n * written, beside the reasoning that sized it.\n */\ndeclare module '@aglyn/aglyn/plugin-manager/plugin-entitlement-keys' {\n interface PluginEntitlementQuotas {\n /**\n * AI credits per calendar month — the band assist spends against.\n *\n * A CREDIT IS A UNIT OF MODEL COST, not a message. One assist action can\n * cost two orders of magnitude more than another: a question is a few\n * thousand tokens, while generating a screen carries the node tree, the\n * component catalog and the theme tokens in, structured markup out, and\n * iterates. A message allowance would price those the same, so one\n * workspace's ten screen builds would outspend another's thousand\n * questions and both would read as \"within allowance\".\n *\n * The unit is defined by `ASSIST_CREDIT_COST_USD` and the conversion\n * lives in `assist-credits.ts`. Only that module turns credits into\n * dollars; everything a customer sees counts credits, because the dollar\n * figure behind them is our provider bill and not a price.\n *\n * ## HOW THE BAND IS SIZED, and why it is not a share of the price\n *\n * A credit is a dollar of provider spend at `ASSIST_CREDIT_COST_USD`, so\n * the band IS a liability figure: the plan's whole assist give is\n * `assistCreditsPerMonth / 1000` dollars. Credits past it are not a give\n * — since AGL-2653 they are SOLD at `extraAssistCreditsUsdPer1k`, unless\n * the org's `assistOverage.hardCap` asks `reserveAssistMessage` to refuse\n * at the band instead. Sizing it as a share of the subscription price\n * says nothing about whether the tier can afford it, because the price is\n * also carrying storage, bandwidth, form submissions, dataset storage,\n * API requests, contacts and email.\n *\n * So each band is sized against what those SEVEN other terms leave.\n * Every paid band takes between a quarter and a third of that remainder,\n * which keeps the tier's worst case positive and keeps the ladder's\n * shape: the margin each tier holds at 100% of every band stays in\n * proportion to what it held before assist was sold at all.\n * `tier-margin-floor.spec.ts` is the model, and it pins both the rule and\n * the resulting figures.\n *\n * The Aglyn AI add-on (AGL-2896) adds `AI_ADDON_CREDITS_PER_MONTH[plan]`\n * to this band in `resolveOrgEntitlements` — one pool, widened, rather\n * than a second meter.\n */\n assistCreditsPerMonth?: number\n }\n}\n\n/**\n * AI credits an Enterprise agreement includes per month, before the contract\n * says otherwise.\n *\n * ## Never `UNLIMITED`, and the reason is not stylistic\n *\n * `UNLIMITED` is `Number.POSITIVE_INFINITY`, `JSON.stringify(Infinity)` is\n * `null`, and `Number(null)` is `0`. An unbounded assist band therefore\n * serialises to a band of ZERO through every route that does not also send\n * the explicit flag `restoreQuotaLimit` rebuilds from — which would hand the\n * only customers with a signed contract the one budget that refuses\n * everything. A finite number crosses the wire as itself.\n *\n * The band is also a real liability rather than a capacity we already own.\n * Storage and page views are infrastructure metered into the deal; assist is\n * a per-token charge from a third party, and generative building spends it in\n * units two orders of magnitude apart.\n *\n * ## Why this number\n *\n * Enterprise carries no list price, so the band cannot be sized the way every\n * self-serve tier's is — against what that tier's other cost terms leave out\n * of a known price. It is anchored to the top of the ladder instead: 116,000\n * credits is twice Agency's band, the rule every Enterprise fallback follows\n * since the 2026-09-07 pricing decision (see the `enterprise` row of\n * `PLAN_ENTITLEMENTS`). In cost that is $116 of provider spend a month, or\n * under 9% of any deal priced at or above the self-serve top. A deal below\n * that is sold as Agency, not written as an Enterprise agreement.\n *\n * ## It is a DEFAULT, and a contract raises it\n *\n * `resolveOrgEntitlements` applies a per-org\n * `entitlements.assistCreditsPerMonth` override ahead of this, so a deal that\n * buys more assist buys it on that org without moving the figure every other\n * agreement is measured against — the same mechanism the other contracted\n * bands use.\n */\nexport const ENTERPRISE_ASSIST_CREDITS_PER_MONTH = 116_000\n\n/**\n * The Free AI taste (AGL-2925): the credits a Free workspace draws on each\n * month, behind a hard wall.\n *\n * ## Why it exists\n *\n * So the AI landing pages can say \"generate your first page free\" and mean\n * it. Three hundred credits is one or two generated sections or a handful of\n * copy rewrites — enough to see what the assistant does, not enough to build\n * a site on. The band is a WALL: `PLAN_PRICING.free\n * .extraAssistCreditsUsdPer1k` stays `null`, so `assistBandRefuses` answers\n * true and the reservation refuses at 100% with no overage, no switch and no\n * invoice. Nothing about a Free workspace can produce a charge.\n *\n * ## What it costs, and why that is the number\n *\n * A credit is `ASSIST_CREDIT_COST_USD` of provider spend, so the band costs\n * at most **$0.30 per Free workspace per month** — asserted by\n * `apps/console/specs/tier-margin-floor.spec.ts`. It is the one AI band with\n * no invoice behind it, which is why the same issue closes every multiplier\n * a script could use before the flag flips:\n *\n * - it is metered per ACCOUNT as well as per workspace, so the three free\n * workspaces an account may hold (AGL-2265) share one 300-credit\n * allowance rather than tripling it (`reserveAssistMessage`);\n * - a fresh account waits `AI_FREE_MIN_ACCOUNT_AGE_HOURS` before it can\n * spend, and every free request is bounded per IP, per uid and per\n * account per day;\n * - a platform-wide daily ceiling on free spend pauses the taste for\n * everyone until the UTC day rolls, paid workspaces untouched.\n *\n * The account allowance reads THIS constant rather than the workspace's\n * resolved band, because a staff override that widens one workspace's band\n * is a decision about that workspace, not about how much one person may draw\n * across all of theirs.\n */\nexport const FREE_AI_TASTE_CREDITS_PER_MONTH = 300\n\n/** The AI credits each plan includes a month — see the key's own docblock. */\nexport const AI_CREDITS_BY_PLAN: Readonly<Record<OrgPlan, number>> = {\n // The Free AI taste (AGL-2925): a real band, and a wall. See the constant\n // for what it buys, what it costs and the precautions that keep one person\n // from drawing it three times over.\n free: FREE_AI_TASTE_CREDITS_PER_MONTH,\n // The first paid rung of the assist ladder (AGL-3203). Starter banded at 0\n // until 2026-09-20, which put a PAYING workspace below the Free taste's 300\n // on the one axis a visitor compares straight down the column — the\n // `/pricing` row read `300 / mo` for Free and `—` for Starter. A paid plan\n // that includes less of something than the free plan is not a packaging\n // subtlety; it is the comparison table arguing against the upgrade.\n //\n // 750 is deliberately small: 2.5x the taste, enough that the assistant is a\n // thing the tier HAS rather than a thing it is shown, and $0.75 of provider\n // spend a month at `ASSIST_CREDIT_COST_USD` against a $16 annual price — a\n // twentieth of the $8.81 the tier's other metered bands already cost, and\n // the widest margin on the ladder absorbs it with room left\n // (`tier-margin-floor.spec.ts` carries the arithmetic).\n //\n // It is NOT a wall, unlike Free's: `PLAN_PRICING.starter\n // .extraAssistCreditsUsdPer1k` is $3.00, so past 750 the tier meters and\n // bills like every paid plan above it. The two fields move together by rule\n // — a positive band with no rate beside it is usage past a bound that is\n // silently free, which `plan-entitlements.spec.ts` forbids.\n //\n // `features.aiAssist` is TRUE, and AGL-3203 shipping it false was the\n // defect AGL-3207 closes. The reasoning then was \"the band is credits, not\n // the guided rung, exactly as on Free\" — but on Free the band IS spendable,\n // through `aiGenerative`, which is the door the taste exists for. Starter\n // carried neither flag, so it was the only row on the ladder sold a band\n // with nothing to spend it through: 750 credits reachable only by buying\n // the $9 add-on that was also the only thing that made them usable. \"No\n // plan bands at zero any more\" was true of the number and false of the\n // capability.\n //\n // It opens `aiAssist` rather than `aiGenerative` because that is the shape\n // of every paid rung above it — the included band funds the guided\n // assistant and generation is the add-on. Opening the generative door here\n // instead would hand the FIRST paid rung a door Pro through Agency have to\n // buy.\n //\n // No cost moves: `tier-margin-floor.spec.ts` already prices this tier's\n // assist term at 100% burn of the 750 credits, 75¢/mo. A door does not\n // widen a band; it only makes spend that was already modeled reachable.\n //\n // The AI add-on adds `AI_ADDON_CREDITS_PER_MONTH.starter` on top and\n // switches `aiGenerative` on as well.\n starter: 750,\n // $2.75 of provider spend, against the $8.35 the tier's other seven cost\n // terms leave out of $56. See the key's docblock for why the remainder and\n // not the price is what sizes this.\n pro: 2_750,\n // $7.50, against the $22.69 the other seven terms leave out of $139.\n business: 7_500,\n // $10.00, against the $30.62 the other seven terms leave out of $249.\n scale: 10_000,\n // $13.00, against the $39.74 the other seven terms leave out of $399 — the\n // thinnest remainder on the ladder, and the tier that binds the whole\n // assist ladder's share of it.\n advanced: 13_000,\n // $58.00, against the $176.71 the other seven terms leave out of $1,299.\n agency: 58_000,\n enterprise: ENTERPRISE_ASSIST_CREDITS_PER_MONTH,\n}\n\n/** The AI plugin's plan figures, for the manifest generator. */\nexport function aiPlanEntitlements(): PluginPlanEntitlementsDeclaration {\n return {\n quotas: [\n {\n key: 'assistCreditsPerMonth',\n label: 'AI credits / mo',\n byPlan: AI_CREDITS_BY_PLAN,\n },\n ],\n }\n}\n"],"names":["ENTERPRISE_ASSIST_CREDITS_PER_MONTH","FREE_AI_TASTE_CREDITS_PER_MONTH","AI_CREDITS_BY_PLAN","free","starter","pro","business","scale","advanced","agency","enterprise","aiPlanEntitlements","quotas","key","label","byPlan"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,6EAA6E;AAC7E,2EAA2E;AAC3E,qEAAqE;AAyDrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCC,GACD,OAAO,MAAMA,sCAAsC,OAAO;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,MAAMC,kCAAkC,IAAG;AAElD,4EAA4E,GAC5E,OAAO,MAAMC,qBAAwD;IACnE,0EAA0E;IAC1E,2EAA2E;IAC3E,oCAAoC;IACpCC,MAAMF;IACN,2EAA2E;IAC3E,4EAA4E;IAC5E,oEAAoE;IACpE,2EAA2E;IAC3E,wEAAwE;IACxE,oEAAoE;IACpE,EAAE;IACF,4EAA4E;IAC5E,4EAA4E;IAC5E,2EAA2E;IAC3E,0EAA0E;IAC1E,4DAA4D;IAC5D,wDAAwD;IACxD,EAAE;IACF,yDAAyD;IACzD,yEAAyE;IACzE,4EAA4E;IAC5E,yEAAyE;IACzE,4DAA4D;IAC5D,EAAE;IACF,sEAAsE;IACtE,2EAA2E;IAC3E,4EAA4E;IAC5E,0EAA0E;IAC1E,yEAAyE;IACzE,yEAAyE;IACzE,wEAAwE;IACxE,uEAAuE;IACvE,cAAc;IACd,EAAE;IACF,2EAA2E;IAC3E,mEAAmE;IACnE,2EAA2E;IAC3E,2EAA2E;IAC3E,OAAO;IACP,EAAE;IACF,wEAAwE;IACxE,uEAAuE;IACvE,wEAAwE;IACxE,EAAE;IACF,qEAAqE;IACrE,sCAAsC;IACtCG,SAAS;IACT,yEAAyE;IACzE,2EAA2E;IAC3E,oCAAoC;IACpCC,KAAK;IACL,qEAAqE;IACrEC,UAAU;IACV,sEAAsE;IACtEC,OAAO;IACP,2EAA2E;IAC3E,sEAAsE;IACtE,+BAA+B;IAC/BC,UAAU;IACV,yEAAyE;IACzEC,QAAQ;IACRC,YAAYV;AACd,EAAC;AAED,8DAA8D,GAC9D,OAAO,SAASW;IACd,OAAO;QACLC,QAAQ;YACN;gBACEC,KAAK;gBACLC,OAAO;gBACPC,QAAQb;YACV;SACD;IACH;AACF"}
|
package/src/lib/plugin.js
CHANGED
package/src/lib/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/plugins/ai/src/lib/plugin.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 { PLATFORM_BRAND_NAME, registerConsoleExtension } from '@aglyn/aglyn'\nimport { AiCollaboratorPermissionsCell } from './components/ai-collaborator-permissions-column.component'\nimport { AiSaveAsComponent } from './components/ai-save-as-component.component'\nimport {\n AiGenerateSectionControl,\n AiRewriteControl,\n} from './components/besigner-ai-controls.component'\nimport {\n AiAssistProviderOnHost,\n AssistPanelOnHost,\n} from './components/ai-permissions-on-host.component'\nimport AiCreditsCard from './components/ai-credits-card.component'\nimport {\n AiCollaboratorCreditsCell,\n AiCollaboratorCreditsHeader,\n AiMemberCreditsCell,\n AiMemberCreditsHeader,\n} from './components/ai-credits-columns.component'\nimport { AssistSignalsPage } from './components/assist-signals-page.component'\nimport BillingAssistOverageCard from './components/billing-assist-overage-card.component'\nimport { AiTopUsersCard } from './components/billing-ai-top-users.component'\nimport { AiAllotmentsCard } from './components/billing-ai-allotments.component'\nimport {\n AiCollaboratorAllotmentCell,\n AiCollaboratorAllotmentHeader,\n AiSiteAllotmentCard,\n} from './components/host-ai-allotments.component'\nimport MemberAiAllotmentCard from './components/member-ai-allotment-card.component'\nimport MemberAiUsageCard from './components/member-ai-usage-card.component'\nimport AiThemeProposalCard from './components/ai-theme-proposal-card.component'\nimport StaffOrgAiCard from './components/staff-org-ai-card.component'\nimport {\n StaffOrgUsageAiCreditsCell,\n StaffOrgUsageAiOverageCell,\n StaffOrgUsageAiPool,\n StaffOrgUsageAssistCell,\n} from './components/staff-org-usage-ai-columns.component'\nimport {\n StaffOrgsAiSpendCell,\n StaffOrgsAiSpendHeader,\n} from './components/staff-orgs-ai-spend-column.component'\nimport StaffUserAiUsageCard from './components/staff-user-ai-usage-card.component'\nimport AiSeoAuditCard from './components/ai-seo-audit-card.component'\nimport AiSiteBatchCard from './components/ai-site-batch-card.component'\nimport AiSiteSeoStartCard from './components/ai-site-seo-start-card.component'\nimport AiSiteStartCard from './components/ai-site-start-card.component'\nimport AiSeoFieldsCard from './components/ai-seo-fields-card.component'\nimport AiDescribeAutomationButton from './components/ai-describe-automation.component'\nimport AiCrmEmailDraft from './components/ai-crm-email-draft.component'\nimport AiCrmImportMapping from './components/ai-crm-import-mapping.component'\nimport AiCrmRecordCard from './components/ai-crm-record-card.component'\nimport AiDescribePageButton from './components/ai-describe-page.component'\nimport {\n AiDescribeComponentButton,\n AiDescribeFormButton,\n AiDescribeLayoutButton,\n AiDescribeTemplateButton,\n} from './components/ai-describe-button.component'\nimport {\n AiExperimentResultCard,\n AiExperimentVariantsCard,\n} from './components/ai-experiment-cards.component'\nimport {\n AiExplainAutomation,\n AiExplainRunFailure,\n} from './components/ai-explain-automation.component'\nimport AiProductCopyCard from './components/ai-product-copy-card.component'\nimport AiProductImportOption from './components/ai-product-import-option.component'\nimport AiProductsHubCard from './components/ai-products-hub-card.component'\nimport { AI_PLUGIN_ID } from './constants'\nimport { registerAiDeclarations } from './declarations'\n\n/**\n * The Aglyn AI plugin's console half (AGL-2939): the assistant dock, the\n * besigner copy assistant's provider, the billing, member and staff cards,\n * the member tables' credit columns and the Assist signal staff page — each\n * mounted through a shell-owned zone (AGL-2940) or the staff area's generic\n * route, so no console page imports this plugin.\n *\n * No `featureFlag` on the extension: the plugin's doors are gated one by\n * one — the dock reads the `release_assist` verdict the shell hands it, the\n * generative doors answer 404 behind `release_ai_generative`, the billing\n * cards render only where the plan sells a band — and a flag here would\n * switch off the released doors with the unreleased ones.\n */\nexport function registerAiConsole(): void {\n registerAiDeclarations()\n registerConsoleExtension({\n pluginId: AI_PLUGIN_ID,\n displayName: 'AI',\n // The besigner copy assistant (AGL-89/419): mounted by the shell around\n // every console page, and opened by this plugin's besigner controls.\n providers: [AiAssistProviderOnHost],\n // The Assist docs-gap and cost board (AGL-1860, AGL-2252), at the staff\n // URL and under the tab it has always had.\n staffPages: [\n {\n id: 'assist-signals',\n label: 'Assist signal',\n header: {\n // The configured brand, not ours (AGL-2153/2260): a white-label\n // deployment and a self-host operator both read this header.\n title: `${PLATFORM_BRAND_NAME} Assist Signal`,\n docsTopic: 'assistSignals',\n },\n Component: AssistSignalsPage,\n },\n ],\n widgets: [\n {\n slot: 'assistPanel',\n widgetId: 'ai-assist-dock',\n title: 'Assistant',\n Component: AssistPanelOnHost,\n },\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-credits-meter',\n title: 'AI credits',\n Component: AiCreditsCard,\n },\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-credits-overage',\n title: 'AI credits overage',\n Component: BillingAssistOverageCard,\n },\n // The per-member usage (AGL-2928): who drew the credits the meter\n // counts, on Billing → Usage, on each member's page, on the staff\n // user page, and as a column of both member tables.\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-usage-by-member',\n title: 'Who is generating what',\n permission: 'billing.view',\n Component: AiTopUsersCard,\n },\n // The collaborators table's AI column (AGL-2927): whether each person\n // may open the AI doors on the site, per site, ahead of the columns\n // that report what they drew.\n {\n slot: 'hostMembers',\n widgetId: 'ai-collaborator-permissions',\n title: 'AI',\n column: { header: 'AI' },\n Component: AiCollaboratorPermissionsCell,\n },\n // The copy assistant's besigner controls (AGL-89, AGL-169): Generate a\n // section on every editor's toolbar, and Rewrite with AI under the\n // selected element's fields. Each opens the provider's dialog, and is\n // drawn only while the reader holds the door's permission.\n {\n slot: 'besignerToolbar',\n widgetId: 'ai-generate-section',\n title: 'Generate a section with AI',\n Component: AiGenerateSectionControl,\n },\n {\n slot: 'besignerInspector',\n widgetId: 'ai-rewrite-copy',\n title: 'Rewrite with AI',\n Component: AiRewriteControl,\n },\n // Save the selection as a reusable component (AGL-2908): the component\n // job's second entry point, which proposes the properties a section\n // should declare and applies them as the manual promote does.\n {\n slot: 'besignerInspector',\n widgetId: 'ai-save-as-component',\n title: 'Make a reusable component with AI',\n permission: 'ai.generate',\n Component: AiSaveAsComponent,\n },\n {\n slot: 'orgMember',\n widgetId: 'ai-member-usage',\n title: 'AI usage',\n Component: MemberAiUsageCard,\n },\n // The allotments (AGL-2942): a member's or a site's monthly share of\n // the pool, set on Billing → Usage, on each member's page and on a\n // site's collaborators card — each card asks the route what its\n // reader may see and change.\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-allotments',\n title: 'AI allotments',\n permission: 'billing.view',\n Component: AiAllotmentsCard,\n },\n {\n slot: 'orgMember',\n widgetId: 'ai-member-allotment',\n title: 'AI allotment',\n Component: MemberAiAllotmentCard,\n },\n {\n slot: 'hostMembers',\n widgetId: 'ai-collaborator-allotment',\n title: 'AI allotment',\n column: {\n header: 'AI allotment',\n align: 'right',\n Header: AiCollaboratorAllotmentHeader,\n },\n Component: AiCollaboratorAllotmentCell,\n },\n {\n slot: 'hostMembers',\n widgetId: 'ai-site-allotment',\n title: 'Site AI allotment',\n Component: AiSiteAllotmentCard,\n },\n // Themes by AI (AGL-2938): a brief on the site's Theme section, a\n // proposal previewed before and after, and the editor's own Save to\n // keep it. Generation is sold as `aiGenerative` and held by\n // `ai.generate`, so the shell withholds the card from a plan or a\n // member without either; the card itself asks the route about the\n // release flag before it shows anything.\n {\n slot: 'hostTheme',\n widgetId: 'ai-theme-proposal',\n title: 'Theme assistant',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiThemeProposalCard,\n },\n {\n slot: 'staffOrg',\n widgetId: 'ai-org-usage',\n title: 'AI usage',\n Component: StaffOrgAiCard,\n },\n {\n slot: 'staffUser',\n widgetId: 'ai-account-usage',\n title: 'AI usage across organizations',\n Component: StaffUserAiUsageCard,\n },\n // The staff tables' AI figures (AGL-2984): the Organizations list's\n // spend column, and the usage table's three columns with the credit\n // pool line the org page draws above it.\n {\n slot: 'staffOrgsListColumn',\n widgetId: 'ai-orgs-spend',\n title: 'AI spend (month)',\n column: {\n header: 'AI spend (month)',\n align: 'right',\n Header: StaffOrgsAiSpendHeader,\n },\n Component: StaffOrgsAiSpendCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-assist-cost',\n title: 'Assist',\n column: { header: 'Assist', align: 'right' },\n Component: StaffOrgUsageAssistCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-credits',\n title: 'AI credits used',\n column: { header: 'AI credits used', align: 'right' },\n Component: StaffOrgUsageAiCreditsCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-overage',\n title: 'AI overage billed ($)',\n column: { header: 'AI overage billed ($)', align: 'right' },\n Component: StaffOrgUsageAiOverageCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-pool',\n title: 'AI credit pool',\n Component: StaffOrgUsageAiPool,\n },\n {\n slot: 'orgMembersListColumn',\n widgetId: 'ai-member-credits',\n title: 'AI credits (month)',\n column: { header: 'AI credits (month)', align: 'right', Header: AiMemberCreditsHeader },\n Component: AiMemberCreditsCell,\n },\n {\n slot: 'hostMembers',\n widgetId: 'ai-collaborator-credits',\n title: 'AI credits (site, month)',\n column: {\n header: 'AI credits (site, month)',\n align: 'right',\n Header: AiCollaboratorCreditsHeader,\n },\n Component: AiCollaboratorCreditsCell,\n },\n // SEO by AI (AGL-2910): \"Write SEO\" inside every search listing editor\n // — a page's SEO card and a product's listing — and the site audit on\n // the site's SEO section. Generation is sold as `aiGenerative` and held\n // by `ai.generate`, so the shell withholds both from a plan or a member\n // without either; each card asks the jobs route about the release flag\n // before it shows anything, and neither ever writes what it proposes.\n {\n slot: 'seoFields',\n widgetId: 'ai-seo-fields',\n title: 'SEO assistant',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSeoFieldsCard,\n },\n {\n slot: 'hostSeo',\n widgetId: 'ai-seo-audit',\n title: 'SEO audit',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSeoAuditCard,\n },\n // A page from a brief (AGL-2907): \"Describe it\" beside Templates and\n // Create New Screen. Gated as the other generative widgets are, and it\n // asks the jobs route about the release flag before it shows anything.\n {\n slot: 'hostScreens',\n widgetId: 'ai-describe-page',\n title: 'Describe a page',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribePageButton,\n },\n // The same entry for a page template, a layout and a form (AGL-3043),\n // beside the create action of the page that lists each: the same\n // dialog, the same gates, and the same question to the jobs route\n // before it shows anything.\n {\n slot: 'hostTemplates',\n widgetId: 'ai-describe-template',\n title: 'Describe a page template',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeTemplateButton,\n },\n {\n slot: 'hostLayouts',\n widgetId: 'ai-describe-layout',\n title: 'Describe a layout',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeLayoutButton,\n },\n {\n slot: 'hostForms',\n widgetId: 'ai-describe-form',\n title: 'Describe a form',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeFormButton,\n },\n // And a reusable component from a brief (AGL-3051), beside Templates\n // and Create Component: the component job's first entry point, which\n // had none in the console.\n {\n slot: 'hostComponents',\n widgetId: 'ai-describe-component',\n title: 'Describe a reusable component',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeComponentButton,\n },\n // Automations by AI (AGL-2919), in the zones the workflows plugin hosts\n // on its Automation page: \"Describe it\" beside Add action and Recipes,\n // \"Explain it\" in the editor of a saved automation, and \"Why did this\n // fail?\" on a failed run. Gated as the other generative widgets are;\n // each asks the jobs route about the release flag before it shows\n // anything, and none of them changes an automation.\n {\n slot: 'hostAutomations',\n widgetId: 'ai-describe-automation',\n title: 'Describe an automation',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeAutomationButton,\n },\n {\n slot: 'automationEditor',\n widgetId: 'ai-explain-automation',\n title: 'Explain this automation',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExplainAutomation,\n },\n {\n slot: 'automationRun',\n widgetId: 'ai-explain-run-failure',\n title: 'Why did this run fail?',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExplainRunFailure,\n },\n // CRM by AI (AGL-2917): a record's summary and next step on its page,\n // a draft in the one-to-one composer, and an import's column matches.\n // The CRM hosts each zone, so it is drawn only where the CRM is; the\n // shell holds the plan and `ai.generate`, each card asks the jobs route\n // about the release flag before it shows anything, and none writes what\n // it proposes.\n {\n slot: 'recordInsights',\n widgetId: 'ai-crm-record',\n title: 'AI summary',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiCrmRecordCard,\n },\n {\n slot: 'recordEmail',\n widgetId: 'ai-crm-email',\n title: 'Draft with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiCrmEmailDraft,\n },\n {\n slot: 'importMapping',\n widgetId: 'ai-crm-import-mapping',\n title: 'Match columns with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiCrmImportMapping,\n },\n // The guided start (AGL-2918), on the page a newly created site lands\n // on: a few questions that become a site scaffold. Gated as the other\n // generative widgets are, and it asks the jobs route about the release\n // flag before it shows anything — so a workspace the feature is not\n // released to gets the blank page and nothing else. Skipping is the\n // zone's own `startBlank`, which creates nothing.\n {\n slot: 'hostFirstRun',\n widgetId: 'ai-site-start',\n title: 'Start this site with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSiteStartCard,\n },\n // The listing those answers describe (AGL-2918), on the site's SEO\n // section: the site-wide search title and description the guided start\n // implies, offered where they are edited. The same gates as every\n // generative widget, and it stages into the SEO form rather than\n // writing it — a person's Update is the write, as it is for the audit\n // card beside it.\n {\n slot: 'hostSeo',\n widgetId: 'ai-site-seo-start',\n title: 'The listing your answers describe',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSiteSeoStartCard,\n },\n // The agency batch (AGL-2911): one brief across many of the org's\n // sites, from the page that lists them. The card asks the jobs route\n // about the release flag before it shows anything, and its own door\n // holds the plan band and the caller's permission on every site it is\n // pointed at.\n {\n slot: 'orgSites',\n widgetId: 'ai-site-batch',\n title: 'Generate sites with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSiteBatchCard,\n },\n // Commerce by AI (AGL-2916): product copy in the product editor, the\n // catalog, categories and discounts on the products hub, and copy for\n // an import as it lands. The commerce plugin hosts the zones and makes\n // every write; each card asks the jobs route about the release flag\n // before it shows anything.\n {\n slot: 'productEditor',\n widgetId: 'ai-product-copy',\n title: 'Product copy assistant',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiProductCopyCard,\n },\n {\n slot: 'productsHub',\n widgetId: 'ai-products-hub',\n title: 'Build your catalog with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiProductsHubCard,\n },\n {\n slot: 'productImport',\n widgetId: 'ai-product-import',\n title: 'Write imported product copy with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiProductImportOption,\n },\n // A/B tests by AI (AGL-2914): variants written in the experiment\n // editor, and one test's result read in plain words below its figures.\n // The A/B testing card hosts both zones, so they are drawn only where\n // that card is and only on a site with A/B testing; the shell holds the\n // plan band and `ai.generate`, and each card asks the jobs route about\n // the release flag before it shows anything. Neither writes: the\n // experiment editor's Save is the only write, and an explanation has\n // nothing to apply.\n {\n slot: 'experimentVariants',\n widgetId: 'ai-experiment-variants',\n title: 'Write variants with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExperimentVariantsCard,\n },\n {\n slot: 'experimentResult',\n widgetId: 'ai-experiment-result',\n title: 'Explain this result with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExperimentResultCard,\n },\n ],\n })\n}\n"],"names":["PLATFORM_BRAND_NAME","registerConsoleExtension","AiCollaboratorPermissionsCell","AiSaveAsComponent","AiGenerateSectionControl","AiRewriteControl","AiAssistProviderOnHost","AssistPanelOnHost","AiCreditsCard","AiCollaboratorCreditsCell","AiCollaboratorCreditsHeader","AiMemberCreditsCell","AiMemberCreditsHeader","AssistSignalsPage","BillingAssistOverageCard","AiTopUsersCard","AiAllotmentsCard","AiCollaboratorAllotmentCell","AiCollaboratorAllotmentHeader","AiSiteAllotmentCard","MemberAiAllotmentCard","MemberAiUsageCard","AiThemeProposalCard","StaffOrgAiCard","StaffOrgUsageAiCreditsCell","StaffOrgUsageAiOverageCell","StaffOrgUsageAiPool","StaffOrgUsageAssistCell","StaffOrgsAiSpendCell","StaffOrgsAiSpendHeader","StaffUserAiUsageCard","AiSeoAuditCard","AiSiteBatchCard","AiSiteSeoStartCard","AiSiteStartCard","AiSeoFieldsCard","AiDescribeAutomationButton","AiCrmEmailDraft","AiCrmImportMapping","AiCrmRecordCard","AiDescribePageButton","AiDescribeComponentButton","AiDescribeFormButton","AiDescribeLayoutButton","AiDescribeTemplateButton","AiExperimentResultCard","AiExperimentVariantsCard","AiExplainAutomation","AiExplainRunFailure","AiProductCopyCard","AiProductImportOption","AiProductsHubCard","AI_PLUGIN_ID","registerAiDeclarations","registerAiConsole","pluginId","displayName","providers","staffPages","id","label","header","title","docsTopic","Component","widgets","slot","widgetId","permission","column","align","Header","featureFlag"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,mBAAmB,EAAEC,wBAAwB,QAAQ,eAAc;AAC5E,SAASC,6BAA6B,QAAQ,+DAA2D;AACzG,SAASC,iBAAiB,QAAQ,iDAA6C;AAC/E,SACEC,wBAAwB,EACxBC,gBAAgB,QACX,iDAA6C;AACpD,SACEC,sBAAsB,EACtBC,iBAAiB,QACZ,mDAA+C;AACtD,OAAOC,mBAAmB,4CAAwC;AAClE,SACEC,yBAAyB,EACzBC,2BAA2B,EAC3BC,mBAAmB,EACnBC,qBAAqB,QAChB,+CAA2C;AAClD,SAASC,iBAAiB,QAAQ,gDAA4C;AAC9E,OAAOC,8BAA8B,wDAAoD;AACzF,SAASC,cAAc,QAAQ,iDAA6C;AAC5E,SAASC,gBAAgB,QAAQ,kDAA8C;AAC/E,SACEC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,mBAAmB,QACd,+CAA2C;AAClD,OAAOC,2BAA2B,qDAAiD;AACnF,OAAOC,uBAAuB,iDAA6C;AAC3E,OAAOC,yBAAyB,mDAA+C;AAC/E,OAAOC,oBAAoB,8CAA0C;AACrE,SACEC,0BAA0B,EAC1BC,0BAA0B,EA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,wEAAwE;YACxE,uEAAuE;YACvE,iEAAiE;YACjE,qEAAqE;YACrE,oBAAoB;YACpB;gBACEgB,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWlB;YACb;YACA;gBACEoB,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWnB;YACb;SACD;IACH;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/ai/src/lib/plugin.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 { PLATFORM_BRAND_NAME, registerConsoleExtension } from '@aglyn/aglyn'\nimport { AiCollaboratorPermissionsCell } from './components/ai-collaborator-permissions-column.component'\nimport { AiSaveAsComponent } from './components/ai-save-as-component.component'\nimport {\n AiGenerateSectionControl,\n AiRewriteControl,\n} from './components/besigner-ai-controls.component'\nimport {\n AiAssistProviderOnHost,\n AssistPanelOnHost,\n} from './components/ai-permissions-on-host.component'\nimport AiCreditsCard from './components/ai-credits-card.component'\nimport {\n AiCollaboratorCreditsCell,\n AiCollaboratorCreditsHeader,\n AiMemberCreditsCell,\n AiMemberCreditsHeader,\n} from './components/ai-credits-columns.component'\nimport { AssistSignalsPage } from './components/assist-signals-page.component'\nimport BillingAssistOverageCard from './components/billing-assist-overage-card.component'\nimport { AiTopUsersCard } from './components/billing-ai-top-users.component'\nimport { AiAllotmentsCard } from './components/billing-ai-allotments.component'\nimport {\n AiCollaboratorAllotmentCell,\n AiCollaboratorAllotmentHeader,\n AiSiteAllotmentCard,\n} from './components/host-ai-allotments.component'\nimport MemberAiAllotmentCard from './components/member-ai-allotment-card.component'\nimport MemberAiUsageCard from './components/member-ai-usage-card.component'\nimport AiThemeProposalCard from './components/ai-theme-proposal-card.component'\nimport StaffOrgAiCard from './components/staff-org-ai-card.component'\nimport {\n StaffOrgUsageAiCreditsCell,\n StaffOrgUsageAiOverageCell,\n StaffOrgUsageAiPool,\n StaffOrgUsageAssistCell,\n} from './components/staff-org-usage-ai-columns.component'\nimport {\n StaffOrgsAiSpendCell,\n StaffOrgsAiSpendHeader,\n} from './components/staff-orgs-ai-spend-column.component'\nimport StaffUserAiUsageCard from './components/staff-user-ai-usage-card.component'\nimport AiSeoAuditCard from './components/ai-seo-audit-card.component'\nimport AiSiteBatchCard from './components/ai-site-batch-card.component'\nimport AiSiteSeoStartCard from './components/ai-site-seo-start-card.component'\nimport AiSiteStartCard from './components/ai-site-start-card.component'\nimport AiSeoFieldsCard from './components/ai-seo-fields-card.component'\nimport AiDescribeAutomationButton from './components/ai-describe-automation.component'\nimport AiCrmEmailDraft from './components/ai-crm-email-draft.component'\nimport AiCrmImportMapping from './components/ai-crm-import-mapping.component'\nimport AiCrmRecordCard from './components/ai-crm-record-card.component'\nimport AiDescribePageButton from './components/ai-describe-page.component'\nimport {\n AiDescribeComponentButton,\n AiDescribeFormButton,\n AiDescribeLayoutButton,\n AiDescribeTemplateButton,\n} from './components/ai-describe-button.component'\nimport {\n AiExperimentResultCard,\n AiExperimentVariantsCard,\n} from './components/ai-experiment-cards.component'\nimport {\n AiExplainAutomation,\n AiExplainRunFailure,\n} from './components/ai-explain-automation.component'\nimport AiProductCopyCard from './components/ai-product-copy-card.component'\nimport AiProductImportOption from './components/ai-product-import-option.component'\nimport AiProductsHubCard from './components/ai-products-hub-card.component'\nimport { AI_PLUGIN_ID } from './constants'\nimport { registerAiDeclarations } from './declarations'\n\n/**\n * The Aglyn AI plugin's console half (AGL-2939): the assistant dock, the\n * besigner copy assistant's provider, the billing, member and staff cards,\n * the member tables' credit columns and the Assist signal staff page — each\n * mounted through a shell-owned zone (AGL-2940) or the staff area's generic\n * route, so no console page imports this plugin.\n *\n * No `featureFlag` on the extension: the plugin's doors are gated one by\n * one — the dock reads the `release_assist` verdict the shell hands it, the\n * generative doors answer 404 behind `release_ai_generative`, the billing\n * cards render only where the plan sells a band — and a flag here would\n * switch off the released doors with the unreleased ones.\n */\nexport function registerAiConsole(): void {\n registerAiDeclarations()\n registerConsoleExtension({\n pluginId: AI_PLUGIN_ID,\n displayName: 'AI',\n // The besigner copy assistant (AGL-89/419): mounted by the shell around\n // every console page, and opened by this plugin's besigner controls.\n providers: [AiAssistProviderOnHost],\n // The Assist docs-gap and cost board (AGL-1860, AGL-2252), at the staff\n // URL and under the tab it has always had.\n staffPages: [\n {\n id: 'assist-signals',\n label: 'Assist signal',\n header: {\n // The configured brand, not ours (AGL-2153/2260): a white-label\n // deployment and a self-host operator both read this header.\n title: `${PLATFORM_BRAND_NAME} Assist Signal`,\n docsTopic: 'assistSignals',\n },\n Component: AssistSignalsPage,\n },\n ],\n widgets: [\n {\n slot: 'consoleDock',\n widgetId: 'ai-assist-dock',\n title: 'Assistant',\n Component: AssistPanelOnHost,\n },\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-credits-meter',\n title: 'AI credits',\n Component: AiCreditsCard,\n },\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-credits-overage',\n title: 'AI credits overage',\n Component: BillingAssistOverageCard,\n },\n // The per-member usage (AGL-2928): who drew the credits the meter\n // counts, on Billing → Usage, on each member's page, on the staff\n // user page, and as a column of both member tables.\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-usage-by-member',\n title: 'Who is generating what',\n permission: 'billing.view',\n Component: AiTopUsersCard,\n },\n // The collaborators table's AI column (AGL-2927): whether each person\n // may open the AI doors on the site, per site, ahead of the columns\n // that report what they drew.\n {\n slot: 'hostMembers',\n widgetId: 'ai-collaborator-permissions',\n title: 'AI',\n column: { header: 'AI' },\n Component: AiCollaboratorPermissionsCell,\n },\n // The copy assistant's besigner controls (AGL-89, AGL-169): Generate a\n // section on every editor's toolbar, and Rewrite with AI under the\n // selected element's fields. Each opens the provider's dialog, and is\n // drawn only while the reader holds the door's permission.\n {\n slot: 'besignerToolbar',\n widgetId: 'ai-generate-section',\n title: 'Generate a section with AI',\n Component: AiGenerateSectionControl,\n },\n {\n slot: 'besignerInspector',\n widgetId: 'ai-rewrite-copy',\n title: 'Rewrite with AI',\n Component: AiRewriteControl,\n },\n // Save the selection as a reusable component (AGL-2908): the component\n // job's second entry point, which proposes the properties a section\n // should declare and applies them as the manual promote does.\n {\n slot: 'besignerInspector',\n widgetId: 'ai-save-as-component',\n title: 'Make a reusable component with AI',\n permission: 'ai.generate',\n Component: AiSaveAsComponent,\n },\n {\n slot: 'orgMember',\n widgetId: 'ai-member-usage',\n title: 'AI usage',\n Component: MemberAiUsageCard,\n },\n // The allotments (AGL-2942): a member's or a site's monthly share of\n // the pool, set on Billing → Usage, on each member's page and on a\n // site's collaborators card — each card asks the route what its\n // reader may see and change.\n {\n slot: 'orgBillingUsage',\n widgetId: 'ai-allotments',\n title: 'AI allotments',\n permission: 'billing.view',\n Component: AiAllotmentsCard,\n },\n {\n slot: 'orgMember',\n widgetId: 'ai-member-allotment',\n title: 'AI allotment',\n Component: MemberAiAllotmentCard,\n },\n {\n slot: 'hostMembers',\n widgetId: 'ai-collaborator-allotment',\n title: 'AI allotment',\n column: {\n header: 'AI allotment',\n align: 'right',\n Header: AiCollaboratorAllotmentHeader,\n },\n Component: AiCollaboratorAllotmentCell,\n },\n {\n slot: 'hostMembers',\n widgetId: 'ai-site-allotment',\n title: 'Site AI allotment',\n Component: AiSiteAllotmentCard,\n },\n // Themes by AI (AGL-2938): a brief on the site's Theme section, a\n // proposal previewed before and after, and the editor's own Save to\n // keep it. Generation is sold as `aiGenerative` and held by\n // `ai.generate`, so the shell withholds the card from a plan or a\n // member without either; the card itself asks the route about the\n // release flag before it shows anything.\n {\n slot: 'hostTheme',\n widgetId: 'ai-theme-proposal',\n title: 'Theme assistant',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiThemeProposalCard,\n },\n {\n slot: 'staffOrg',\n widgetId: 'ai-org-usage',\n title: 'AI usage',\n Component: StaffOrgAiCard,\n },\n {\n slot: 'staffUser',\n widgetId: 'ai-account-usage',\n title: 'AI usage across organizations',\n Component: StaffUserAiUsageCard,\n },\n // The staff tables' AI figures (AGL-2984): the Organizations list's\n // spend column, and the usage table's three columns with the credit\n // pool line the org page draws above it.\n {\n slot: 'staffOrgsListColumn',\n widgetId: 'ai-orgs-spend',\n title: 'AI spend (month)',\n column: {\n header: 'AI spend (month)',\n align: 'right',\n Header: StaffOrgsAiSpendHeader,\n },\n Component: StaffOrgsAiSpendCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-assist-cost',\n title: 'Assist',\n column: { header: 'Assist', align: 'right' },\n Component: StaffOrgUsageAssistCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-credits',\n title: 'AI credits used',\n column: { header: 'AI credits used', align: 'right' },\n Component: StaffOrgUsageAiCreditsCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-overage',\n title: 'AI overage billed ($)',\n column: { header: 'AI overage billed ($)', align: 'right' },\n Component: StaffOrgUsageAiOverageCell,\n },\n {\n slot: 'staffOrgUsageColumn',\n widgetId: 'ai-usage-pool',\n title: 'AI credit pool',\n Component: StaffOrgUsageAiPool,\n },\n {\n slot: 'orgMembersListColumn',\n widgetId: 'ai-member-credits',\n title: 'AI credits (month)',\n column: { header: 'AI credits (month)', align: 'right', Header: AiMemberCreditsHeader },\n Component: AiMemberCreditsCell,\n },\n {\n slot: 'hostMembers',\n widgetId: 'ai-collaborator-credits',\n title: 'AI credits (site, month)',\n column: {\n header: 'AI credits (site, month)',\n align: 'right',\n Header: AiCollaboratorCreditsHeader,\n },\n Component: AiCollaboratorCreditsCell,\n },\n // SEO by AI (AGL-2910): \"Write SEO\" inside every search listing editor\n // — a page's SEO card and a product's listing — and the site audit on\n // the site's SEO section. Generation is sold as `aiGenerative` and held\n // by `ai.generate`, so the shell withholds both from a plan or a member\n // without either; each card asks the jobs route about the release flag\n // before it shows anything, and neither ever writes what it proposes.\n {\n slot: 'seoFields',\n widgetId: 'ai-seo-fields',\n title: 'SEO assistant',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSeoFieldsCard,\n },\n {\n slot: 'hostSeo',\n widgetId: 'ai-seo-audit',\n title: 'SEO audit',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSeoAuditCard,\n },\n // A page from a brief (AGL-2907): \"Describe it\" beside Templates and\n // Create New Screen. Gated as the other generative widgets are, and it\n // asks the jobs route about the release flag before it shows anything.\n {\n slot: 'hostScreens',\n widgetId: 'ai-describe-page',\n title: 'Describe a page',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribePageButton,\n },\n // The same entry for a page template, a layout and a form (AGL-3043),\n // beside the create action of the page that lists each: the same\n // dialog, the same gates, and the same question to the jobs route\n // before it shows anything.\n {\n slot: 'hostTemplates',\n widgetId: 'ai-describe-template',\n title: 'Describe a page template',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeTemplateButton,\n },\n {\n slot: 'hostLayouts',\n widgetId: 'ai-describe-layout',\n title: 'Describe a layout',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeLayoutButton,\n },\n {\n slot: 'hostForms',\n widgetId: 'ai-describe-form',\n title: 'Describe a form',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeFormButton,\n },\n // And a reusable component from a brief (AGL-3051), beside Templates\n // and Create Component: the component job's first entry point, which\n // had none in the console.\n {\n slot: 'hostComponents',\n widgetId: 'ai-describe-component',\n title: 'Describe a reusable component',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeComponentButton,\n },\n // Automations by AI (AGL-2919), in the zones the workflows plugin hosts\n // on its Automation page: \"Describe it\" beside Add action and Recipes,\n // \"Explain it\" in the editor of a saved automation, and \"Why did this\n // fail?\" on a failed run. Gated as the other generative widgets are;\n // each asks the jobs route about the release flag before it shows\n // anything, and none of them changes an automation.\n {\n slot: 'hostAutomations',\n widgetId: 'ai-describe-automation',\n title: 'Describe an automation',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiDescribeAutomationButton,\n },\n {\n slot: 'automationEditor',\n widgetId: 'ai-explain-automation',\n title: 'Explain this automation',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExplainAutomation,\n },\n {\n slot: 'automationRun',\n widgetId: 'ai-explain-run-failure',\n title: 'Why did this run fail?',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExplainRunFailure,\n },\n // CRM by AI (AGL-2917): a record's summary and next step on its page,\n // a draft in the one-to-one composer, and an import's column matches.\n // The CRM hosts each zone, so it is drawn only where the CRM is; the\n // shell holds the plan and `ai.generate`, each card asks the jobs route\n // about the release flag before it shows anything, and none writes what\n // it proposes.\n {\n slot: 'recordInsights',\n widgetId: 'ai-crm-record',\n title: 'AI summary',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiCrmRecordCard,\n },\n {\n slot: 'recordEmail',\n widgetId: 'ai-crm-email',\n title: 'Draft with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiCrmEmailDraft,\n },\n {\n slot: 'importMapping',\n widgetId: 'ai-crm-import-mapping',\n title: 'Match columns with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiCrmImportMapping,\n },\n // The guided start (AGL-2918), on the page a newly created site lands\n // on: a few questions that become a site scaffold. Gated as the other\n // generative widgets are, and it asks the jobs route about the release\n // flag before it shows anything — so a workspace the feature is not\n // released to gets the blank page and nothing else. Skipping is the\n // zone's own `startBlank`, which creates nothing.\n {\n slot: 'hostFirstRun',\n widgetId: 'ai-site-start',\n title: 'Start this site with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSiteStartCard,\n },\n // The listing those answers describe (AGL-2918), on the site's SEO\n // section: the site-wide search title and description the guided start\n // implies, offered where they are edited. The same gates as every\n // generative widget, and it stages into the SEO form rather than\n // writing it — a person's Update is the write, as it is for the audit\n // card beside it.\n {\n slot: 'hostSeo',\n widgetId: 'ai-site-seo-start',\n title: 'The listing your answers describe',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSiteSeoStartCard,\n },\n // The agency batch (AGL-2911): one brief across many of the org's\n // sites, from the page that lists them. The card asks the jobs route\n // about the release flag before it shows anything, and its own door\n // holds the plan band and the caller's permission on every site it is\n // pointed at.\n {\n slot: 'orgSites',\n widgetId: 'ai-site-batch',\n title: 'Generate sites with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiSiteBatchCard,\n },\n // Commerce by AI (AGL-2916): product copy in the product editor, the\n // catalog, categories and discounts on the products hub, and copy for\n // an import as it lands. The commerce plugin hosts the zones and makes\n // every write; each card asks the jobs route about the release flag\n // before it shows anything.\n {\n slot: 'productEditor',\n widgetId: 'ai-product-copy',\n title: 'Product copy assistant',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiProductCopyCard,\n },\n {\n slot: 'productsHub',\n widgetId: 'ai-products-hub',\n title: 'Build your catalog with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiProductsHubCard,\n },\n {\n slot: 'productImport',\n widgetId: 'ai-product-import',\n title: 'Write imported product copy with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiProductImportOption,\n },\n // A/B tests by AI (AGL-2914): variants written in the experiment\n // editor, and one test's result read in plain words below its figures.\n // The A/B testing card hosts both zones, so they are drawn only where\n // that card is and only on a site with A/B testing; the shell holds the\n // plan band and `ai.generate`, and each card asks the jobs route about\n // the release flag before it shows anything. Neither writes: the\n // experiment editor's Save is the only write, and an explanation has\n // nothing to apply.\n {\n slot: 'experimentVariants',\n widgetId: 'ai-experiment-variants',\n title: 'Write variants with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExperimentVariantsCard,\n },\n {\n slot: 'experimentResult',\n widgetId: 'ai-experiment-result',\n title: 'Explain this result with AI',\n featureFlag: 'aiGenerative',\n permission: 'ai.generate',\n Component: AiExperimentResultCard,\n },\n ],\n })\n}\n"],"names":["PLATFORM_BRAND_NAME","registerConsoleExtension","AiCollaboratorPermissionsCell","AiSaveAsComponent","AiGenerateSectionControl","AiRewriteControl","AiAssistProviderOnHost","AssistPanelOnHost","AiCreditsCard","AiCollaboratorCreditsCell","AiCollaboratorCreditsHeader","AiMemberCreditsCell","AiMemberCreditsHeader","AssistSignalsPage","BillingAssistOverageCard","AiTopUsersCard","AiAllotmentsCard","AiCollaboratorAllotmentCell","AiCollaboratorAllotmentHeader","AiSiteAllotmentCard","MemberAiAllotmentCard","MemberAiUsageCard","AiThemeProposalCard","StaffOrgAiCard","StaffOrgUsageAiCreditsCell","StaffOrgUsageAiOverageCell","StaffOrgUsageAiPool","StaffOrgUsageAssistCell","StaffOrgsAiSpendCell","StaffOrgsAiSpendHeader","StaffUserAiUsageCard","AiSeoAuditCard","AiSiteBatchCard","AiSiteSeoStartCard","AiSiteStartCard","AiSeoFieldsCard","AiDescribeAutomationButton","AiCrmEmailDraft","AiCrmImportMapping","AiCrmRecordCard","AiDescribePageButton","AiDescribeComponentButton","AiDescribeFormButton","AiDescribeLayoutButton","AiDescribeTemplateButton","AiExperimentResultCard","AiExperimentVariantsCard","AiExplainAutomation","AiExplainRunFailure","AiProductCopyCard","AiProductImportOption","AiProductsHubCard","AI_PLUGIN_ID","registerAiDeclarations","registerAiConsole","pluginId","displayName","providers","staffPages","id","label","header","title","docsTopic","Component","widgets","slot","widgetId","permission","column","align","Header","featureFlag"],"mappings":"A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YACnE,uEAAuE;YACvE,kEAAkE;YAClE,iEAAiE;YACjE,sEAAsE;YACtE,kBAAkB;YAClB;gBACEgC,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAW/B;YACb;YACA,kEAAkE;YAClE,qEAAqE;YACrE,oEAAoE;YACpE,sEAAsE;YACtE,cAAc;YACd;gBACEiC,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWhC;YACb;YACA,qEAAqE;YACrE,sEAAsE;YACtE,uEAAuE;YACvE,oEAAoE;YACpE,4BAA4B;YAC5B;gBACEkC,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWf;YACb;YACA;gBACEiB,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWb;YACb;YACA;gBACEe,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWd;YACb;YACA,iEAAiE;YACjE,uEAAuE;YACvE,sEAAsE;YACtE,wEAAwE;YACxE,uEAAuE;YACvE,iEAAiE;YACjE,qEAAqE;YACrE,oBAAoB;YACpB;gBACEgB,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWlB;YACb;YACA;gBACEoB,MAAM;gBACNC,UAAU;gBACVL,OAAO;gBACPU,aAAa;gBACbJ,YAAY;gBACZJ,WAAWnB;YACb;SACD;IACH;AACF"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { type AiBuildPlan } from '../model/ai-build-plan';
|
|
17
|
+
import { type AiBuildPlan, type AiBuildPlanEmbed } from '../model/ai-build-plan';
|
|
18
18
|
import { type AiPlanCapabilities } from '../model/ai-plan-capabilities';
|
|
19
19
|
import type { AiSiteInventory } from '../model/ai-site-inventory';
|
|
20
20
|
import { type AiNodeTreeContext, type AiNodeTreeResult } from './ai-node-tree';
|
|
@@ -100,8 +100,12 @@ export interface AiDoctrineTreeContext extends AiNodeTreeContext {
|
|
|
100
100
|
} | null;
|
|
101
101
|
/** Placed library assets by media id. */
|
|
102
102
|
assets?: Record<string, AiAssetFacts>;
|
|
103
|
-
/**
|
|
104
|
-
|
|
103
|
+
/**
|
|
104
|
+
* The third-party players the confirmed plan lists for this output
|
|
105
|
+
* (AGL-3433): a Video embed is admitted only where one is listed, playing
|
|
106
|
+
* the link the brief gave or none. Absent or empty admits none.
|
|
107
|
+
*/
|
|
108
|
+
plannedEmbeds?: readonly Pick<AiBuildPlanEmbed, 'host' | 'url'>[];
|
|
105
109
|
framing?: AiCopyFraming;
|
|
106
110
|
/**
|
|
107
111
|
* Whether the workspace keeps reusable components and saved forms
|
|
@@ -495,7 +499,8 @@ export declare function detectCutLines(repairs: readonly string[], written: Read
|
|
|
495
499
|
* wraps one other container and adds nothing, no empty containers, no inline
|
|
496
500
|
* style repeated where a token or a component prop would carry it, no font
|
|
497
501
|
* beyond the theme's, images lazy below the first, video by poster rather
|
|
498
|
-
* than autoplay,
|
|
502
|
+
* than autoplay, no third-party player the confirmed plan does not list, and
|
|
503
|
+
* none playing a video the brief did not give.
|
|
499
504
|
*/
|
|
500
505
|
export declare function detectHeavyDocument(tree: AiDoctrineTree, outputKind: AiOutputKind, context?: AiDoctrineTreeContext): AiDoctrineViolation[];
|
|
501
506
|
/**
|
|
@@ -733,6 +738,22 @@ export declare function detectPlanOverFreeWall(plan: AiBuildPlan, inventory: AiS
|
|
|
733
738
|
* instead of reporting itself done.
|
|
734
739
|
*/
|
|
735
740
|
export declare function detectPlanUnreadableRegions(plan: AiBuildPlan): AiDoctrineViolation[];
|
|
741
|
+
/**
|
|
742
|
+
* Rule 16 (plan): a third-party player is planned where it can play
|
|
743
|
+
* (AGL-3433). A screen of the plan or a component it creates carries at most
|
|
744
|
+
* its kind's budget. A template renders for every record it serves and a
|
|
745
|
+
* layout around every page, so neither carries one, and a form, an email or a
|
|
746
|
+
* dataset has nowhere to. A link the plan gives is one its host plays.
|
|
747
|
+
*/
|
|
748
|
+
export declare function detectPlanEmbeds(plan: AiBuildPlan): AiDoctrineViolation[];
|
|
749
|
+
/**
|
|
750
|
+
* Rule 16 (plan, against the brief): a player is planned only where the brief
|
|
751
|
+
* asks for one (AGL-3433). The plan quotes the brief's words, and those words
|
|
752
|
+
* are found in the brief and ask for a video; a link it gives is one the brief
|
|
753
|
+
* gives. The plan step holds this, being the one door that reads the brief
|
|
754
|
+
* beside the plan.
|
|
755
|
+
*/
|
|
756
|
+
export declare function aiPlanEmbedBriefViolations(plan: AiBuildPlan, brief: string): AiDoctrineViolation[];
|
|
736
757
|
/**
|
|
737
758
|
* Every plan rule, against the site inventory the plan was made from and,
|
|
738
759
|
* where the job read them, what it may create there (AGL-3030). `null`
|