@aglyn/plugins-ai 1.13.0 → 1.15.0
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/package.json +17 -17
- package/src/lib/components/ai-site-build-page.component.js +5 -3
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-import-finish.component.d.ts +3 -1
- package/src/lib/components/ai-site-import-finish.component.js +3 -3
- package/src/lib/components/ai-site-import-finish.component.js.map +1 -1
- package/src/lib/components/ai-site-import-job.component.d.ts +4 -3
- package/src/lib/components/ai-site-import-job.component.js +141 -43
- package/src/lib/components/ai-site-import-job.component.js.map +1 -1
- package/src/lib/components/ai-site-import-plan.component.d.ts +42 -0
- package/src/lib/components/ai-site-import-plan.component.js +246 -0
- package/src/lib/components/ai-site-import-plan.component.js.map +1 -0
- package/src/lib/components/ai-site-import-start.component.d.ts +3 -1
- package/src/lib/components/ai-site-import-start.component.js +3 -2
- package/src/lib/components/ai-site-import-start.component.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.js +6 -2
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +3 -2
- package/src/lib/components/ai-site-start-steps.component.js +12 -5
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
- package/src/lib/jobs/ai-job-import-step.d.ts +47 -2
- package/src/lib/jobs/ai-job-import-step.js +356 -22
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.js +4 -1
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +21 -2
- package/src/lib/jobs/ai-job-page-language.js +217 -5
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +7 -0
- package/src/lib/jobs/ai-job-page-step.js +73 -12
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.js +4 -2
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-look.js +14 -5
- package/src/lib/jobs/ai-job-site-look.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +10 -2
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.js +2 -1
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +43 -2
- package/src/lib/jobs/ai-site-import-compile.js +126 -63
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +25 -1
- package/src/lib/jobs/ai-site-import-document.js +26 -7
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-honesty.d.ts +65 -0
- package/src/lib/jobs/ai-site-import-honesty.js +271 -0
- package/src/lib/jobs/ai-site-import-honesty.js.map +1 -0
- package/src/lib/jobs/ai-site-import-improve.d.ts +233 -0
- package/src/lib/jobs/ai-site-import-improve.js +1151 -0
- package/src/lib/jobs/ai-site-import-improve.js.map +1 -0
- package/src/lib/jobs/ai-site-import-look.d.ts +4 -0
- package/src/lib/jobs/ai-site-import-look.js +16 -6
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/jobs/ai-site-import-pictures.d.ts +83 -0
- package/src/lib/jobs/ai-site-import-pictures.js +261 -0
- package/src/lib/jobs/ai-site-import-pictures.js.map +1 -0
- package/src/lib/jobs/ai-site-import-plan.d.ts +78 -0
- package/src/lib/jobs/ai-site-import-plan.js +627 -0
- package/src/lib/jobs/ai-site-import-plan.js.map +1 -0
- package/src/lib/jobs/ai-site-import-wording.js +2 -5
- package/src/lib/jobs/ai-site-import-wording.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.d.ts +6 -0
- package/src/lib/layout-language/ai-layout-compiler.js +100 -14
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +9 -0
- package/src/lib/layout-language/ai-layout-design.js +29 -3
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-source.d.ts +5 -0
- package/src/lib/layout-language/ai-layout-frame-source.js +4 -2
- package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.d.ts +2 -0
- package/src/lib/layout-language/ai-layout-frame.js +20 -12
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +16 -2
- package/src/lib/layout-language/ai-layout-language.js +11 -5
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +71 -0
- package/src/lib/model/ai-site-import-fidelity.js +438 -6
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import-ledger.d.ts +82 -0
- package/src/lib/model/ai-site-import-ledger.js +254 -0
- package/src/lib/model/ai-site-import-ledger.js.map +1 -0
- package/src/lib/model/ai-site-import-view.d.ts +110 -6
- package/src/lib/model/ai-site-import-view.js +166 -13
- package/src/lib/model/ai-site-import-view.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +234 -2
- package/src/lib/model/ai-site-import.js +312 -15
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-job.js +4 -0
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.d.ts +2 -0
- package/src/lib/model/ai-site-kinds.js +7 -0
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +14 -5
- package/src/lib/model/ai-site-look.js +22 -16
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/model/ai-site-start.d.ts +37 -7
- package/src/lib/model/ai-site-start.js +54 -10
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/ai-site-starter-look.d.ts +69 -0
- package/src/lib/model/ai-site-starter-look.js +90 -0
- package/src/lib/model/ai-site-starter-look.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -0
- package/src/lib/runtime/ai-doctrine-validators.js +3 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.d.ts +10 -0
- package/src/lib/runtime/ai-doctrine.js +16 -2
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/site-inventory.js +2 -3
- package/src/lib/runtime/site-inventory.js.map +1 -1
- package/src/lib/server/ai-jobs-resume.js +12 -3
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/server/ai-jobs-route.js +5 -1
- package/src/lib/server/ai-jobs-route.js.map +1 -1
- package/src/lib/server/ai-site-import-route.d.ts +6 -0
- package/src/lib/server/ai-site-import-route.js +8 -1
- package/src/lib/server/ai-site-import-route.js.map +1 -1
- package/src/lib/server/assist-view-context.js +3 -3
- package/src/lib/server/assist-view-context.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +57 -7
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +277 -21
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-improve-answers.d.ts +33 -0
- package/src/lib/site-import/fixtures/site-import-improve-answers.js +457 -0
- package/src/lib/site-import/fixtures/site-import-improve-answers.js.map +1 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +29 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +26 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/site-import-concealed.d.ts +30 -0
- package/src/lib/site-import/site-import-concealed.js +231 -0
- package/src/lib/site-import/site-import-concealed.js.map +1 -0
- package/src/lib/site-import/site-import-crawl.d.ts +3 -1
- package/src/lib/site-import/site-import-crawl.js +8 -1
- package/src/lib/site-import/site-import-crawl.js.map +1 -1
- package/src/lib/site-import/site-import-css.js +13 -2
- package/src/lib/site-import/site-import-css.js.map +1 -1
- package/src/lib/site-import/site-import-flag.d.ts +17 -0
- package/src/lib/site-import/site-import-flag.js +15 -0
- package/src/lib/site-import/site-import-flag.js.map +1 -1
- package/src/lib/site-import/site-import-html.d.ts +28 -0
- package/src/lib/site-import/site-import-html.js +246 -49
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.js +211 -12
- package/src/lib/site-import/site-import-layout.js.map +1 -1
- package/src/lib/site-import/site-import-page.js +2 -0
- package/src/lib/site-import/site-import-page.js.map +1 -1
- package/src/lib/testing/stand-in-dataset-index.js +6 -2
- package/src/lib/testing/stand-in-dataset-index.js.map +1 -1
|
@@ -0,0 +1,233 @@
|
|
|
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 { AiLayoutDesign } from '../layout-language/ai-layout-design';
|
|
18
|
+
import { type AiLayoutImportHero, type AiLayoutItem, type AiLayoutSettlement } from '../layout-language/ai-layout-language';
|
|
19
|
+
import type { AiSiteImportAddedSection, AiSiteImportPagePictures, AiSiteImportPageRole, AiSiteImportPlan } from '../model/ai-site-import';
|
|
20
|
+
import { type SiteImportFidelityTheme, type SiteImportPageFidelity } from '../model/ai-site-import-fidelity';
|
|
21
|
+
import { type SiteImportLedger } from '../model/ai-site-import-ledger';
|
|
22
|
+
import type { AiSystemBlock, AiTool, AiUsage } from '../providers/contract';
|
|
23
|
+
import type { AiGenerationCheck } from '../runtime/ai-doctrine';
|
|
24
|
+
import type { AiCopyFraming, AiDoctrineViolation } from '../runtime/ai-doctrine-validators';
|
|
25
|
+
import { type AiSiteImportImprovedSection } from './ai-site-import-honesty';
|
|
26
|
+
import { type AiSiteImportDesigned } from './ai-site-import-compile';
|
|
27
|
+
import { type AiSiteImportDocument } from './ai-site-import-document';
|
|
28
|
+
/** The answer's kind of generation: the name its re-ask and its doctrine scope go by. */
|
|
29
|
+
export declare const AI_SITE_IMPORT_IMPROVE_KIND = "page-improve";
|
|
30
|
+
/**
|
|
31
|
+
* The most items a redesign's group keeps (AGL-4152): every item its owner's
|
|
32
|
+
* page has, where the layout language's own pages stop at seven. A page
|
|
33
|
+
* brought in is compiled as its source lays it out, with no such limit.
|
|
34
|
+
*/
|
|
35
|
+
export declare const AI_SITE_IMPORT_IMPROVE_MAX_ITEMS = 24;
|
|
36
|
+
/** What a block may be: the layout language's words and groups, and `keep`. A customer's quote and a figure only ever arrive by `keep`. */
|
|
37
|
+
export declare const AI_SITE_IMPORT_IMPROVE_BLOCK_KINDS: readonly ["eyebrow", "heading", "lede", "text", "note", "list", "button", "image", "cards", "steps", "faq", "keep"];
|
|
38
|
+
/** The redesign tool: the `submit_page` language, a `keep` block, and a picture on an item by its ref. */
|
|
39
|
+
export declare const AI_SITE_IMPORT_IMPROVE_TOOL: AiTool;
|
|
40
|
+
/** What a redesign is told, cached: every page of every site shares these bytes. */
|
|
41
|
+
export declare const AI_SITE_IMPORT_IMPROVE_TEXT: string;
|
|
42
|
+
/** The site's own digest, which every page of one import reads ahead of its ledger: cached once per site. */
|
|
43
|
+
export declare function aiSiteImportImproveDigest(input: {
|
|
44
|
+
siteName: string | null;
|
|
45
|
+
/** What the home page says of the site, and the pages of the import. */
|
|
46
|
+
scope: readonly string[];
|
|
47
|
+
plan?: AiSiteImportPlan | null;
|
|
48
|
+
}): string;
|
|
49
|
+
/** The most of a site's own words the digest holds. */
|
|
50
|
+
export declare const AI_SITE_IMPORT_IMPROVE_DIGEST_CHARS = 16000;
|
|
51
|
+
/** A redesign's system blocks: the platform's text cached across sites, then this site's digest, cached once per site. The ledger rides the user turn. */
|
|
52
|
+
export declare function aiSiteImportImproveInstructions(digest: string): readonly AiSystemBlock[];
|
|
53
|
+
/** The most characters a page's ledger shows. */
|
|
54
|
+
export declare const AI_SITE_IMPORT_LEDGER_MAX_CHARS = 16000;
|
|
55
|
+
/**
|
|
56
|
+
* A page's ledger as its answer reads it (AGL-4152): what it may place, where
|
|
57
|
+
* each link goes, and every line it rewrites, numbered. Uncached, per page, and
|
|
58
|
+
* fenced by the prompt: every word of it is the owner's.
|
|
59
|
+
*/
|
|
60
|
+
export declare function aiSiteImportLedgerText(ledger: SiteImportLedger, doc: Pick<AiSiteImportDocument, 'blocks' | 'photos'>, destinations: ReadonlyMap<string, string>): string;
|
|
61
|
+
/** Everywhere a link may go on this page, as an answer writes it, each with the destination it means. */
|
|
62
|
+
export declare function aiSiteImportImproveDestinations(doc: AiSiteImportDocument, ledger: SiteImportLedger, input?: {
|
|
63
|
+
sections?: number;
|
|
64
|
+
formSection?: number | null;
|
|
65
|
+
}): Map<string, string>;
|
|
66
|
+
/** A redesign's user turn: the page, its kind of site, how its opening is drawn, and its ledger, fenced as the owner's data. */
|
|
67
|
+
export declare function aiSiteImportImprovePrompt(input: {
|
|
68
|
+
screen: {
|
|
69
|
+
title: string;
|
|
70
|
+
slug: string;
|
|
71
|
+
};
|
|
72
|
+
doc: Pick<AiSiteImportDocument, 'url' | 'blocks' | 'photos' | 'proposed'>;
|
|
73
|
+
ledger: SiteImportLedger;
|
|
74
|
+
destinations: ReadonlyMap<string, string>;
|
|
75
|
+
kindLines: readonly string[];
|
|
76
|
+
seed: string;
|
|
77
|
+
/** What the page is for and what it needs (`aiSiteImportImproveRoleLines`). */
|
|
78
|
+
roleLines?: readonly string[];
|
|
79
|
+
}): string;
|
|
80
|
+
/**
|
|
81
|
+
* How many new sections a page of each role is asked for (AGL-4152): a home
|
|
82
|
+
* or a main service page two, a contact page none, its form framed instead.
|
|
83
|
+
*/
|
|
84
|
+
export declare const AI_SITE_IMPORT_NEW_SECTIONS: Readonly<Record<AiSiteImportPageRole, number>>;
|
|
85
|
+
/** The most sections a redesigned page runs to: a page the source already fills has no room for more. */
|
|
86
|
+
export declare const AI_SITE_IMPORT_IMPROVE_MOST_SECTIONS = 10;
|
|
87
|
+
/** What a page is for, as its plan says, else from its address and what it holds. */
|
|
88
|
+
export declare function aiSiteImportPageRoleOf(doc: Pick<AiSiteImportDocument, 'role' | 'proposed' | 'url' | 'title' | 'blocks' | 'forms' | 'layout'>, slug: string): AiSiteImportPageRole;
|
|
89
|
+
/** How many new sections a page is asked for: its role's, where the page has room, and none on a long page, whose groups fold. */
|
|
90
|
+
export declare function aiSiteImportNewSectionsWanted(role: AiSiteImportPageRole, ledger: Pick<SiteImportLedger, 'folded' | 'lines' | 'items'>, proposed?: boolean): number;
|
|
91
|
+
/** The lines a redesign's request says of its page's role and what it needs (AGL-4152). */
|
|
92
|
+
export declare function aiSiteImportImproveRoleLines(input: {
|
|
93
|
+
role: AiSiteImportPageRole;
|
|
94
|
+
wanted: number;
|
|
95
|
+
folded: boolean;
|
|
96
|
+
kind?: string | null;
|
|
97
|
+
seed: number;
|
|
98
|
+
}): string[];
|
|
99
|
+
/**
|
|
100
|
+
* The sections a redesign added (AGL-4152), by index: neither the opening nor
|
|
101
|
+
* a closing band, holding nothing kept but a picture, saying something of
|
|
102
|
+
* its own, and the rework of no section of the old page. Each section of the
|
|
103
|
+
* old page past its opening is reworked by the one section that says most
|
|
104
|
+
* of it; another section drawing on its words, such as a why-us of the
|
|
105
|
+
* opening's facts, is new.
|
|
106
|
+
*/
|
|
107
|
+
export declare function aiSiteImportImproveNewSections(answer: readonly AiSiteImportImprovedSection[], ledger: Pick<SiteImportLedger, 'lines' | 'items'>): number[];
|
|
108
|
+
/** What a redesign is asked to be, by its role (AGL-4152). */
|
|
109
|
+
export interface AiSiteImportImproveNeeds {
|
|
110
|
+
role: AiSiteImportPageRole;
|
|
111
|
+
/** New sections it needs (`aiSiteImportNewSectionsWanted`). */
|
|
112
|
+
wanted: number;
|
|
113
|
+
}
|
|
114
|
+
/** The fewest shapes a page of four sections or more is drawn in. */
|
|
115
|
+
export declare const AI_SITE_IMPORT_IMPROVE_LEAST_SHAPES = 3;
|
|
116
|
+
/**
|
|
117
|
+
* Whether a redesign is planned as a designer's page (AGL-4152), answer by
|
|
118
|
+
* answer: the new sections its role asks for, a picture in its opening, and
|
|
119
|
+
* sections drawn in more than one or two shapes. Each miss is named for the
|
|
120
|
+
* one re-ask.
|
|
121
|
+
*/
|
|
122
|
+
export declare function aiSiteImportImprovePlanMisses(answer: readonly AiSiteImportImprovedSection[], input: {
|
|
123
|
+
ledger: Pick<SiteImportLedger, 'lines' | 'items' | 'folded'>;
|
|
124
|
+
needs: AiSiteImportImproveNeeds;
|
|
125
|
+
}): AiDoctrineViolation[];
|
|
126
|
+
/** A redesign's answer, read by position: `null` where it gave no section it can draw. */
|
|
127
|
+
export declare function aiReadImprovedPage(raw: unknown, settled?: AiLayoutSettlement[]): AiSiteImportImprovedSection[] | null;
|
|
128
|
+
/** The site's hero as a page brought in draws it: a collage or a portrait holds what a page brought in does not. */
|
|
129
|
+
export declare function aiSiteImportImproveHero(design: AiLayoutDesign, plan?: AiSiteImportPlan | null): AiLayoutImportHero;
|
|
130
|
+
/** How many of a group's items sit across: planned for how much each says. */
|
|
131
|
+
export declare function aiSiteImportImproveColumns(items: readonly AiLayoutItem[]): number;
|
|
132
|
+
export interface AiSiteImportImproveCompileInput {
|
|
133
|
+
doc: AiSiteImportDocument;
|
|
134
|
+
ledger: SiteImportLedger;
|
|
135
|
+
design: AiLayoutDesign;
|
|
136
|
+
destinations: ReadonlyMap<string, string>;
|
|
137
|
+
formId: string | null;
|
|
138
|
+
plan?: AiSiteImportPlan | null;
|
|
139
|
+
/** The theme the page is drawn in, where it is known: a brand band only where the brand itself fills. */
|
|
140
|
+
theme?: SiteImportFidelityTheme | null;
|
|
141
|
+
}
|
|
142
|
+
/** What a redesign compiles into, and what its row and its check say of it. */
|
|
143
|
+
export interface AiSiteImportImprovedPage {
|
|
144
|
+
given: AiSiteImportDesigned;
|
|
145
|
+
names: string[];
|
|
146
|
+
written: string[];
|
|
147
|
+
added: AiSiteImportAddedSection[];
|
|
148
|
+
pictures: AiSiteImportPagePictures;
|
|
149
|
+
}
|
|
150
|
+
/** The sections a redesign holds, in the compiler's language: every `keep` expanded to the source's own blocks, every link resolved. */
|
|
151
|
+
export declare function aiSiteImportImprovedPage(answer: readonly AiSiteImportImprovedSection[], input: AiSiteImportImproveCompileInput): AiSiteImportImprovedPage;
|
|
152
|
+
/** The most an answer may ask for, whatever the page and the model: a whole page's design and words, with its thinking. */
|
|
153
|
+
export declare const AI_SITE_IMPORT_IMPROVE_MOST_TOKENS = 8000;
|
|
154
|
+
/**
|
|
155
|
+
* Room a page's ceiling keeps for its listing pass (AGL-4152): its p90 is 1,
|
|
156
|
+
* and it runs a model only where the source left the listing empty.
|
|
157
|
+
*/
|
|
158
|
+
export declare const AI_SITE_IMPORT_LISTING_ROOM_CREDITS = 10;
|
|
159
|
+
/**
|
|
160
|
+
* What a page's redesign may spend, its answer and its re-ask together
|
|
161
|
+
* (AGL-4152): the page's ceiling, less its listing pass's room. Held in code
|
|
162
|
+
* (`aiSiteImportImproveTokensWithin`): an answer asks no more than the
|
|
163
|
+
* ceiling buys, and a re-ask it cannot pay for is not asked.
|
|
164
|
+
*/
|
|
165
|
+
export declare const AI_SITE_IMPORT_IMPROVE_CEILING_CREDITS: number;
|
|
166
|
+
/** What a request reads before it is sent, at worst: its system blocks written to the cache, its turn as input. */
|
|
167
|
+
export declare function aiSiteImportImproveInputUsage(input: {
|
|
168
|
+
systemChars: number;
|
|
169
|
+
promptChars: number;
|
|
170
|
+
}): AiUsage;
|
|
171
|
+
/** What a usage is billed in credits on a model. */
|
|
172
|
+
export declare function aiSiteImportImproveCredits(usage: AiUsage, model: string): number;
|
|
173
|
+
/**
|
|
174
|
+
* The most output tokens a request may write (AGL-4152) with `spent` already
|
|
175
|
+
* spent and `input` still to read, and stay inside `ceiling` credits; at
|
|
176
|
+
* most `most`, and 0 where its reading alone would pass the ceiling.
|
|
177
|
+
*/
|
|
178
|
+
export declare function aiSiteImportImproveTokensWithin(input: {
|
|
179
|
+
model: string;
|
|
180
|
+
spent: AiUsage;
|
|
181
|
+
input: AiUsage;
|
|
182
|
+
ceiling?: number;
|
|
183
|
+
most: number;
|
|
184
|
+
}): number;
|
|
185
|
+
/** The least share of the last answer's length a re-ask must have room for: less, and it would be cut off. */
|
|
186
|
+
export declare const AI_SITE_IMPORT_REASK_ROOM = 0.9;
|
|
187
|
+
/**
|
|
188
|
+
* Whether a redesign's re-ask fits its page's ceiling (AGL-4152): the most
|
|
189
|
+
* tokens it may ask, given what the first answer spent, or 0 where the room
|
|
190
|
+
* left is under what the first answer wrote, and the page falls back with
|
|
191
|
+
* no re-ask rather than pass its ceiling.
|
|
192
|
+
*/
|
|
193
|
+
export declare function aiSiteImportImproveReaskTokens(input: {
|
|
194
|
+
model: string;
|
|
195
|
+
spent: AiUsage;
|
|
196
|
+
lastOutput: number;
|
|
197
|
+
most: number;
|
|
198
|
+
ceiling?: number;
|
|
199
|
+
}): number;
|
|
200
|
+
/** What a redesign settled: the page built, what it added and what it shows. */
|
|
201
|
+
export interface AiSiteImportImproved<T> {
|
|
202
|
+
built: T;
|
|
203
|
+
page: AiSiteImportImprovedPage;
|
|
204
|
+
}
|
|
205
|
+
/** Every line a redesign's facts may come from: its page, what the site says of itself, its wave's other pages, its name. */
|
|
206
|
+
export declare function aiSiteImportImproveScope(doc: Pick<AiSiteImportDocument, 'blocks' | 'siteLines' | 'scope' | 'title'>, siteName: string | null): string[];
|
|
207
|
+
/** A scored redesign's misses, each as the re-ask names it: what is red on its ledger and its design lines. */
|
|
208
|
+
export declare function aiSiteImportImprovedMisses(report: Pick<SiteImportPageFidelity, 'improved'>): AiDoctrineViolation[];
|
|
209
|
+
/** A redesign's read for a page: its ledger, and everywhere a link may go. */
|
|
210
|
+
export declare function aiSiteImportImproveLedger(doc: AiSiteImportDocument): SiteImportLedger;
|
|
211
|
+
/**
|
|
212
|
+
* A redesign's check (AGL-4152), answer by answer: its words and refs held to
|
|
213
|
+
* what the import read, its page compiled and held to the doctrine as a page
|
|
214
|
+
* written (`build`), and scored (`score`). Any miss is named for the one
|
|
215
|
+
* re-ask; a second miss is the caller's fallback.
|
|
216
|
+
*/
|
|
217
|
+
export declare function aiSiteImportImproveCheck<T>(input: {
|
|
218
|
+
doc: AiSiteImportDocument;
|
|
219
|
+
ledger: SiteImportLedger;
|
|
220
|
+
design: AiLayoutDesign;
|
|
221
|
+
scope: readonly string[];
|
|
222
|
+
formId: string | null;
|
|
223
|
+
framing?: AiCopyFraming | null;
|
|
224
|
+
plan?: AiSiteImportPlan | null;
|
|
225
|
+
theme?: SiteImportFidelityTheme | null;
|
|
226
|
+
/** What the page is for and the new sections it needs; absent, nothing is asked of its plan. */
|
|
227
|
+
needs?: AiSiteImportImproveNeeds | null;
|
|
228
|
+
build: (page: AiSiteImportImprovedPage) => {
|
|
229
|
+
value: T | null;
|
|
230
|
+
violations: AiDoctrineViolation[];
|
|
231
|
+
};
|
|
232
|
+
score: (built: T, destinations: readonly string[]) => AiDoctrineViolation[];
|
|
233
|
+
}): AiGenerationCheck<AiSiteImportImproved<T>>;
|