@aglyn/plugins-ai 1.10.0 → 1.12.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/jobs/ai-job-import-step.d.ts +1 -1
- package/src/lib/jobs/ai-job-import-step.js +26 -7
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-privacy-step.js +2 -2
- package/src/lib/jobs/ai-job-privacy-step.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.js +27 -37
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-look.js +20 -1
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.js +7 -1
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/model/ai-credit-estimate.d.ts +15 -0
- package/src/lib/model/ai-credit-estimate.js +13 -0
- package/src/lib/model/ai-credit-estimate.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +46 -3
- package/src/lib/model/ai-site-import-fidelity.js +254 -62
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import-report.d.ts +7 -0
- package/src/lib/model/ai-site-import-report.js +17 -5
- package/src/lib/model/ai-site-import-report.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +46 -3
- package/src/lib/model/ai-site-import.js +34 -11
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +16 -0
- package/src/lib/model/ai-site-look.js +76 -14
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/site-import/fixtures/aglyn-com-recordings.d.ts +2 -1
- package/src/lib/site-import/fixtures/aglyn-com-recordings.js +3 -2
- package/src/lib/site-import/fixtures/aglyn-com-recordings.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-crawl-recordings.d.ts +5 -0
- package/src/lib/site-import/fixtures/site-import-crawl-recordings.js +116 -3
- package/src/lib/site-import/fixtures/site-import-crawl-recordings.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +7 -0
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +15 -0
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-layout-recordings.js +4 -3
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/fixtures/site-look-slate.d.ts +2 -1
- package/src/lib/site-import/fixtures/site-look-slate.js +2 -1
- package/src/lib/site-import/fixtures/site-look-slate.js.map +1 -1
- package/src/lib/site-import/site-import-crawl.d.ts +7 -1
- package/src/lib/site-import/site-import-crawl.js +101 -6
- package/src/lib/site-import/site-import-crawl.js.map +1 -1
- package/src/lib/site-import/site-import-css.d.ts +8 -1
- package/src/lib/site-import/site-import-css.js +30 -8
- package/src/lib/site-import/site-import-css.js.map +1 -1
- package/src/lib/site-import/site-import-html.d.ts +2 -0
- package/src/lib/site-import/site-import-html.js +3 -0
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.d.ts +9 -2
- package/src/lib/site-import/site-import-layout.js +104 -30
- package/src/lib/site-import/site-import-layout.js.map +1 -1
- package/src/lib/site-import/site-import-page.js +5 -0
- package/src/lib/site-import/site-import-page.js.map +1 -1
- package/src/lib/site-import/site-import-same-page.d.ts +41 -0
- package/src/lib/site-import/site-import-same-page.js +108 -0
- package/src/lib/site-import/site-import-same-page.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-ai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.
|
|
29
|
-
"@aglyn/shared-data-enums": "1.
|
|
30
|
-
"@aglyn/shared-data-mdi": "1.
|
|
31
|
-
"@aglyn/shared-data-types": "1.
|
|
32
|
-
"@aglyn/shared-ui-email-campaigns": "1.
|
|
33
|
-
"@aglyn/shared-ui-jsx": "1.
|
|
34
|
-
"@aglyn/shared-ui-snackstack": "1.
|
|
35
|
-
"@aglyn/shared-ui-theme": "1.
|
|
36
|
-
"@aglyn/shared-util-email": "1.
|
|
37
|
-
"@aglyn/shared-util-errors": "1.
|
|
38
|
-
"@aglyn/shared-util-http": "1.
|
|
39
|
-
"@aglyn/shared-util-timestamp": "1.
|
|
40
|
-
"@aglyn/shared-util-tools": "1.
|
|
41
|
-
"@aglyn/tenant-data-admin": "1.
|
|
42
|
-
"@aglyn/tenant-feature-instance": "1.
|
|
43
|
-
"@aglyn/tenant-runtime": "1.
|
|
28
|
+
"@aglyn/aglyn": "1.12.0",
|
|
29
|
+
"@aglyn/shared-data-enums": "1.12.0",
|
|
30
|
+
"@aglyn/shared-data-mdi": "1.12.0",
|
|
31
|
+
"@aglyn/shared-data-types": "1.12.0",
|
|
32
|
+
"@aglyn/shared-ui-email-campaigns": "1.12.0",
|
|
33
|
+
"@aglyn/shared-ui-jsx": "1.12.0",
|
|
34
|
+
"@aglyn/shared-ui-snackstack": "1.12.0",
|
|
35
|
+
"@aglyn/shared-ui-theme": "1.12.0",
|
|
36
|
+
"@aglyn/shared-util-email": "1.12.0",
|
|
37
|
+
"@aglyn/shared-util-errors": "1.12.0",
|
|
38
|
+
"@aglyn/shared-util-http": "1.12.0",
|
|
39
|
+
"@aglyn/shared-util-timestamp": "1.12.0",
|
|
40
|
+
"@aglyn/shared-util-tools": "1.12.0",
|
|
41
|
+
"@aglyn/tenant-data-admin": "1.12.0",
|
|
42
|
+
"@aglyn/tenant-feature-instance": "1.12.0",
|
|
43
|
+
"@aglyn/tenant-runtime": "1.12.0",
|
|
44
44
|
"@swc/helpers": "0.5.23"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -147,7 +147,7 @@ export declare function aiSiteImportBrandName(given: string, own: string): strin
|
|
|
147
147
|
* the source's own address, so a button that leaves the source leaves the
|
|
148
148
|
* new site too. `null` for an address no link may carry.
|
|
149
149
|
*/
|
|
150
|
-
export declare function aiSiteImportFrameLinkTo(state: Pick<AiSiteImportState, 'domain' | 'pages'
|
|
150
|
+
export declare function aiSiteImportFrameLinkTo(state: Pick<AiSiteImportState, 'domain' | 'pages'> & Partial<Pick<AiSiteImportState, 'leftOut'>>, wave: number): (href: string | null | undefined) => AiLayoutFrameSourceTo | null;
|
|
151
151
|
/** The ground a source's header bar sits on (AGL-4108): dark, the brand's color, the page's own, or paper. */
|
|
152
152
|
export declare function aiSiteImportHeaderGround(background: string | null, look: AiSiteImportHome['look']): AiLayoutFrameSourceGround;
|
|
153
153
|
/**
|
|
@@ -62,7 +62,7 @@ import { listDomainOwnershipClaims, normalizeOwnershipDomain } from "@aglyn/tena
|
|
|
62
62
|
import { getOrgForUser, memberHasOrgPermission } from "@aglyn/tenant-data-admin/server/organizations";
|
|
63
63
|
import { consumeRateLimit } from "@aglyn/tenant-data-admin/server/rate-limit-store";
|
|
64
64
|
import { isServerReleaseFlagOnForOrg } from "@aglyn/tenant-data-admin/server/release-flags";
|
|
65
|
-
import { AI_SITE_IMPORT_DOMAIN_INPUT, AI_SITE_IMPORT_FINISH_INPUT, AI_SITE_IMPORT_FRAME_SLOT, AI_SITE_IMPORT_LABEL_MAX_CHARS, AI_SITE_IMPORT_LEFT_OUT_COPY, AI_SITE_IMPORT_MAX_PAGES, AI_SITE_IMPORT_MIN_WORDS, AI_SITE_IMPORT_WAVE_PAGES, AI_SITE_IMPORT_WORDING_INPUT, aiSiteImportChoiceFromInputs, aiSiteImportChoiceOf, aiSiteImportFormsIn, aiSiteImportFrameIsRead, aiSiteImportInventory, aiSiteImportItemOpen, aiSiteImportLedger, aiSiteImportNextWork, aiSiteImportPageBuild, aiSiteImportPageSettled, aiSiteImportPagesRead, aiSiteImportPhotosIn, aiSiteImportReadStops, aiSiteImportReadVerdict, aiSiteImportReadVerdictMessage, aiSiteImportReadVerdictReason, aiSiteImportOwnFilms, aiSiteImportVideoNote, aiSiteImportWaveClosed, siteImportApprovedHostsWith, aiSiteImportWaveMessage, aiSiteImportWaveChoice, aiSiteImportWaveStamped, aiSiteImportWordsKept, aiSiteImportWaveStarted } from "../model/ai-site-import.js";
|
|
65
|
+
import { AI_SITE_IMPORT_DOMAIN_INPUT, AI_SITE_IMPORT_FINISH_INPUT, AI_SITE_IMPORT_FRAME_SLOT, AI_SITE_IMPORT_LABEL_MAX_CHARS, AI_SITE_IMPORT_LEFT_OUT_COPY, AI_SITE_IMPORT_MAX_PAGES, AI_SITE_IMPORT_MIN_WORDS, AI_SITE_IMPORT_WAVE_PAGES, AI_SITE_IMPORT_WORDING_INPUT, aiSiteImportChoiceFromInputs, aiSiteImportChoiceOf, aiSiteImportFormsIn, aiSiteImportFrameIsRead, aiSiteImportInventory, aiSiteImportItemOpen, aiSiteImportLedger, aiSiteImportNextWork, aiSiteImportPageBuild, aiSiteImportPageSettled, aiSiteImportPagesRead, aiSiteImportPhotosIn, aiSiteImportReadStops, aiSiteImportReadVerdict, aiSiteImportReadVerdictMessage, aiSiteImportReadVerdictReason, aiSiteImportOwnFilms, aiSiteImportVideoNote, aiSiteImportWaveClosed, siteImportApprovedHostsWith, aiSiteImportWaveMessage, aiSiteImportWaveChoice, aiSiteImportOtherAddresses, aiSiteImportWaveStamped, aiSiteImportWordsKept, aiSiteImportWaveStarted } from "../model/ai-site-import.js";
|
|
66
66
|
import { aiModelForStep } from "../providers/routing.js";
|
|
67
67
|
import { SITE_IMPORT_RELEASE_FLAG } from "../site-import/site-import-flag.js";
|
|
68
68
|
import { crawlSiteForImport, siteImportOrigins } from "../site-import/site-import-crawl.js";
|
|
@@ -262,6 +262,11 @@ const delivered = (items, slot)=>items.some((row)=>row.slot === slot && (row.sta
|
|
|
262
262
|
key(page.path),
|
|
263
263
|
page
|
|
264
264
|
]));
|
|
265
|
+
// A link to another address of a kept page goes to that page (AGL-4152).
|
|
266
|
+
for (const other of aiSiteImportOtherAddresses(state)){
|
|
267
|
+
const page = pages.get(other.sameAs);
|
|
268
|
+
if (page && !pages.has(other.path)) pages.set(other.path, page);
|
|
269
|
+
}
|
|
265
270
|
return (href)=>{
|
|
266
271
|
const raw = String(href != null ? href : '').trim();
|
|
267
272
|
if (!raw) return null;
|
|
@@ -535,10 +540,22 @@ const delivered = (items, slot)=>items.some((row)=>row.slot === slot && (row.sta
|
|
|
535
540
|
// Every page the import plans, in any wave (AGL-4107): a link to one still
|
|
536
541
|
// to come shows its words until it is live. Home's own links are words: a
|
|
537
542
|
// link home says home, which the source's words may not.
|
|
538
|
-
links:
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
543
|
+
links: [
|
|
544
|
+
...state.pages.filter((entry)=>entry.slug !== '/' && !entry.refused).map((entry)=>({
|
|
545
|
+
path: entry.path.replace(/\/+$/, '') || '/',
|
|
546
|
+
id: entry.draftId
|
|
547
|
+
})),
|
|
548
|
+
// Another address of a page goes to that page (AGL-4152).
|
|
549
|
+
...aiSiteImportOtherAddresses(state).flatMap((other)=>{
|
|
550
|
+
const target = state.pages.find((entry)=>entry.slug !== '/' && !entry.refused && (entry.path.replace(/\/+$/, '') || '/') === other.sameAs);
|
|
551
|
+
return target ? [
|
|
552
|
+
{
|
|
553
|
+
path: other.path,
|
|
554
|
+
id: target.draftId
|
|
555
|
+
}
|
|
556
|
+
] : [];
|
|
557
|
+
})
|
|
558
|
+
],
|
|
542
559
|
origins: [
|
|
543
560
|
`https://${state.domain}`,
|
|
544
561
|
`https://www.${state.domain.replace(/^www\./, '')}`
|
|
@@ -1003,10 +1020,12 @@ export function createAiJobImportStep(deps = {}) {
|
|
|
1003
1020
|
if (crawled.stoppedBy === 'robots-unreachable') return unspent({
|
|
1004
1021
|
review: waveReview(AI_SITE_IMPORT_COPY.robots(domain))
|
|
1005
1022
|
});
|
|
1006
|
-
const skipped = crawled.skipped.map((entry)=>({
|
|
1023
|
+
const skipped = crawled.skipped.map((entry)=>_extends({
|
|
1007
1024
|
url: entry.url,
|
|
1008
1025
|
reason: siteImportLeftOutReason(entry.reason, entry.status)
|
|
1009
|
-
}
|
|
1026
|
+
}, entry.sameAs ? {
|
|
1027
|
+
sameAs: entry.sameAs
|
|
1028
|
+
} : {}));
|
|
1010
1029
|
// Home first (AGL-4083): a site read without its home page plans nothing, quotes nothing and spends nothing.
|
|
1011
1030
|
const verdict = aiSiteImportReadVerdict(crawled);
|
|
1012
1031
|
const inventory = aiSiteImportInventory({
|