@aglyn/plugins-ai 1.0.0-beta.269 → 1.0.0-beta.271
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/activity/ai-activity-actions.d.ts +1 -1
- package/src/lib/activity/ai-activity-actions.js +1 -0
- package/src/lib/activity/ai-activity-actions.js.map +1 -1
- package/src/lib/assets/site-styles/beauty.webp +0 -0
- package/src/lib/assets/site-styles/blog.webp +0 -0
- package/src/lib/assets/site-styles/business.webp +0 -0
- package/src/lib/assets/site-styles/coming-soon.webp +0 -0
- package/src/lib/assets/site-styles/education.webp +0 -0
- package/src/lib/assets/site-styles/events.webp +0 -0
- package/src/lib/assets/site-styles/fitness.webp +0 -0
- package/src/lib/assets/site-styles/landing.webp +0 -0
- package/src/lib/assets/site-styles/music.webp +0 -0
- package/src/lib/assets/site-styles/nonprofit.webp +0 -0
- package/src/lib/assets/site-styles/personal.webp +0 -0
- package/src/lib/assets/site-styles/photography.webp +0 -0
- package/src/lib/assets/site-styles/portfolio.webp +0 -0
- package/src/lib/assets/site-styles/professional.webp +0 -0
- package/src/lib/assets/site-styles/realestate.webp +0 -0
- package/src/lib/assets/site-styles/restaurant.webp +0 -0
- package/src/lib/assets/site-styles/store.webp +0 -0
- package/src/lib/assets/site-styles/studio.webp +0 -0
- package/src/lib/assets/site-styles/trades.webp +0 -0
- package/src/lib/assets/site-styles/wellness.webp +0 -0
- package/src/lib/assets/site-styles/yoga.webp +0 -0
- package/src/lib/components/ai-credits-card.component.d.ts +8 -6
- package/src/lib/components/ai-credits-card.component.js +39 -22
- package/src/lib/components/ai-credits-card.component.js.map +1 -1
- package/src/lib/components/ai-job-input-form.component.d.ts +36 -0
- package/src/lib/components/ai-job-input-form.component.js +100 -0
- package/src/lib/components/ai-job-input-form.component.js.map +1 -0
- package/src/lib/components/ai-job-links.d.ts +6 -0
- package/src/lib/components/ai-job-links.js +9 -0
- package/src/lib/components/ai-job-links.js.map +1 -1
- package/src/lib/components/ai-job-requests.d.ts +4 -0
- package/src/lib/components/ai-job-requests.js +4 -0
- package/src/lib/components/ai-job-requests.js.map +1 -1
- package/src/lib/components/ai-products-hub-card.component.d.ts +6 -0
- package/src/lib/components/ai-products-hub-card.component.js +21 -6
- package/src/lib/components/ai-products-hub-card.component.js.map +1 -1
- package/src/lib/components/ai-site-build-page.component.js +3 -2
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.d.ts +1 -1
- package/src/lib/components/ai-site-start-card.component.js +99 -31
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +43 -2
- package/src/lib/components/ai-site-start-steps.component.js +651 -15
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
- package/src/lib/components/ai-site-start-tracking.d.ts +10 -0
- package/src/lib/components/ai-site-start-tracking.js +14 -0
- package/src/lib/components/ai-site-start-tracking.js.map +1 -1
- package/src/lib/components/ai-site-style-previews.js +26 -22
- package/src/lib/components/ai-site-style-previews.js.map +1 -1
- package/src/lib/components/ai-store-finish-card.component.d.ts +14 -3
- package/src/lib/components/ai-store-finish-card.component.js +67 -9
- package/src/lib/components/ai-store-finish-card.component.js.map +1 -1
- package/src/lib/components/ai-upsell-dialog.component.d.ts +7 -5
- package/src/lib/components/ai-upsell-dialog.component.js +8 -6
- package/src/lib/components/ai-upsell-dialog.component.js.map +1 -1
- package/src/lib/components/assist-build-card.component.js +14 -3
- package/src/lib/components/assist-build-card.component.js.map +1 -1
- package/src/lib/components/assist-jobs-drawer.component.js +9 -1
- package/src/lib/components/assist-jobs-drawer.component.js.map +1 -1
- package/src/lib/components/assist-panel.component.js +8 -4
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/components/staff-org-ai-card.component.js +4 -7
- package/src/lib/components/staff-org-ai-card.component.js.map +1 -1
- package/src/lib/declarations.d.ts +2 -2
- package/src/lib/declarations.js +9 -5
- package/src/lib/declarations.js.map +1 -1
- package/src/lib/jobs/ai-build-capabilities.js +3 -1
- package/src/lib/jobs/ai-build-capabilities.js.map +1 -1
- package/src/lib/jobs/ai-business-profile-prefill.d.ts +1 -1
- package/src/lib/jobs/ai-business-profile-prefill.js +14 -3
- package/src/lib/jobs/ai-business-profile-prefill.js.map +1 -1
- package/src/lib/jobs/ai-job-build-step.d.ts +3 -0
- package/src/lib/jobs/ai-job-build-step.js +13 -5
- package/src/lib/jobs/ai-job-build-step.js.map +1 -1
- package/src/lib/jobs/ai-job-form-step.d.ts +24 -1
- package/src/lib/jobs/ai-job-form-step.js +93 -7
- package/src/lib/jobs/ai-job-form-step.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +35 -11
- package/src/lib/jobs/ai-job-page-language.js +68 -2
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +17 -0
- package/src/lib/jobs/ai-job-page-step.js +40 -17
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +25 -2
- package/src/lib/jobs/ai-job-plan-step.js +103 -29
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-settings-step.js +4 -3
- package/src/lib/jobs/ai-job-settings-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-datasets.d.ts +27 -0
- package/src/lib/jobs/ai-job-site-datasets.js +140 -14
- package/src/lib/jobs/ai-job-site-datasets.js.map +1 -1
- package/src/lib/jobs/ai-job-site-look.js +18 -5
- package/src/lib/jobs/ai-job-site-look.js.map +1 -1
- package/src/lib/jobs/ai-job-site-step.d.ts +16 -1
- package/src/lib/jobs/ai-job-site-step.js +95 -22
- package/src/lib/jobs/ai-job-site-step.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +8 -1
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-job-tracking-step.d.ts +14 -3
- package/src/lib/jobs/ai-job-tracking-step.js +28 -5
- package/src/lib/jobs/ai-job-tracking-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.d.ts +8 -1
- package/src/lib/jobs/ai-jobs.js +63 -8
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-layout-owner-photos.d.ts +57 -0
- package/src/lib/jobs/ai-layout-owner-photos.js +110 -0
- package/src/lib/jobs/ai-layout-owner-photos.js.map +1 -0
- package/src/lib/jobs/ai-layout-stock-photos.d.ts +62 -4
- package/src/lib/jobs/ai-layout-stock-photos.js +523 -72
- package/src/lib/jobs/ai-layout-stock-photos.js.map +1 -1
- package/src/lib/jobs/ai-site-inspiration-signals.d.ts +98 -0
- package/src/lib/jobs/ai-site-inspiration-signals.js +585 -0
- package/src/lib/jobs/ai-site-inspiration-signals.js.map +1 -0
- package/src/lib/jobs/ai-site-inspiration.d.ts +157 -0
- package/src/lib/jobs/ai-site-inspiration.js +346 -0
- package/src/lib/jobs/ai-site-inspiration.js.map +1 -0
- package/src/lib/jobs/ai-site-publish.d.ts +26 -1
- package/src/lib/jobs/ai-site-publish.js +162 -13
- package/src/lib/jobs/ai-site-publish.js.map +1 -1
- package/src/lib/jobs/ai-theme-brand-inputs.d.ts +16 -0
- package/src/lib/jobs/ai-theme-brand-inputs.js +18 -4
- package/src/lib/jobs/ai-theme-brand-inputs.js.map +1 -1
- package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.d.ts +97 -0
- package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.js +137 -0
- package/src/lib/jobs/fixtures/ai-candle-shop-free-plan-recording.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-site-inspiration-pages.d.ts +38 -0
- package/src/lib/jobs/fixtures/ai-site-inspiration-pages.js +103 -0
- package/src/lib/jobs/fixtures/ai-site-inspiration-pages.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3942-recordings.d.ts +29 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3942-recordings.js +291 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3942-recordings.js.map +1 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.d.ts +25 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.js +174 -0
- package/src/lib/jobs/fixtures/ai-stock-photo-agl3988-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +1 -1
- package/src/lib/layout-language/ai-layout-compiler.js +438 -25
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-contact.d.ts +57 -0
- package/src/lib/layout-language/ai-layout-contact.js +137 -0
- package/src/lib/layout-language/ai-layout-contact.js.map +1 -0
- package/src/lib/layout-language/ai-layout-copy.d.ts +12 -0
- package/src/lib/layout-language/ai-layout-copy.js +34 -2
- package/src/lib/layout-language/ai-layout-copy.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +65 -8
- package/src/lib/layout-language/ai-layout-design.js +411 -97
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.js +23 -0
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-labels.d.ts +2 -0
- package/src/lib/layout-language/ai-layout-labels.js +12 -6
- package/src/lib/layout-language/ai-layout-labels.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +3 -2
- package/src/lib/layout-language/ai-layout-language.js +4 -3
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/layout-language/ai-layout-links.d.ts +13 -0
- package/src/lib/layout-language/ai-layout-links.js +30 -0
- package/src/lib/layout-language/ai-layout-links.js.map +1 -1
- package/src/lib/layout-language/ai-layout-pictures.d.ts +49 -6
- package/src/lib/layout-language/ai-layout-pictures.js +145 -22
- package/src/lib/layout-language/ai-layout-pictures.js.map +1 -1
- package/src/lib/model/ai-build-job.d.ts +16 -1
- package/src/lib/model/ai-build-job.js +40 -0
- package/src/lib/model/ai-build-job.js.map +1 -1
- package/src/lib/model/ai-job-input.d.ts +33 -0
- package/src/lib/model/ai-job-input.js +59 -0
- package/src/lib/model/ai-job-input.js.map +1 -0
- package/src/lib/model/ai-job-notice.d.ts +4 -0
- package/src/lib/model/ai-job-notice.js +11 -1
- package/src/lib/model/ai-job-notice.js.map +1 -1
- package/src/lib/model/ai-jobs.types.d.ts +40 -1
- package/src/lib/model/ai-jobs.types.js.map +1 -1
- package/src/lib/model/ai-site-details.d.ts +122 -0
- package/src/lib/model/ai-site-details.js +300 -0
- package/src/lib/model/ai-site-details.js.map +1 -0
- package/src/lib/model/ai-site-entity.d.ts +181 -0
- package/src/lib/model/ai-site-entity.js +390 -0
- package/src/lib/model/ai-site-entity.js.map +1 -0
- package/src/lib/model/ai-site-inspiration.d.ts +72 -0
- package/src/lib/model/ai-site-inspiration.js +109 -0
- package/src/lib/model/ai-site-inspiration.js.map +1 -0
- package/src/lib/model/ai-site-job.d.ts +13 -1
- package/src/lib/model/ai-site-job.js +15 -2
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.js +109 -21
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +10 -0
- package/src/lib/model/ai-site-look.js +24 -0
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/model/ai-site-start-seo.d.ts +19 -5
- package/src/lib/model/ai-site-start-seo.js +25 -7
- package/src/lib/model/ai-site-start-seo.js.map +1 -1
- package/src/lib/model/ai-site-start-steps.d.ts +9 -3
- package/src/lib/model/ai-site-start-steps.js +67 -5
- package/src/lib/model/ai-site-start-steps.js.map +1 -1
- package/src/lib/model/ai-site-start.d.ts +68 -4
- package/src/lib/model/ai-site-start.js +166 -13
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/ai-upsell-copy.js +4 -1
- package/src/lib/model/ai-upsell-copy.js.map +1 -1
- package/src/lib/native-nav.d.ts +26 -0
- package/src/lib/native-nav.js +58 -0
- package/src/lib/native-nav.js.map +1 -0
- package/src/lib/plan-entitlements.d.ts +4 -3
- package/src/lib/plan-entitlements.js +3 -8
- package/src/lib/plan-entitlements.js.map +1 -1
- package/src/lib/runtime/ai-dataset-generation.d.ts +8 -1
- package/src/lib/runtime/ai-dataset-generation.js +12 -2
- package/src/lib/runtime/ai-dataset-generation.js.map +1 -1
- package/src/lib/runtime/ai-doctrine-validators.d.ts +26 -33
- package/src/lib/runtime/ai-doctrine-validators.js +54 -44
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +1 -1
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.d.ts +7 -0
- package/src/lib/runtime/ai-node-tree.js +9 -1
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/server/ai-create-route.d.ts +1 -1
- package/src/lib/server/ai-create-route.js +3 -4
- package/src/lib/server/ai-create-route.js.map +1 -1
- package/src/lib/server/ai-jobs-resume.js +27 -3
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/server/ai-jobs-route.js +7 -0
- package/src/lib/server/ai-jobs-route.js.map +1 -1
- package/src/lib/usage/assist-credits.d.ts +4 -4
- package/src/lib/usage/assist-credits.js +4 -4
- package/src/lib/usage/assist-credits.js.map +1 -1
- package/src/lib/usage/staff-org-ai-view.js +6 -3
- package/src/lib/usage/staff-org-ai-view.js.map +1 -1
- package/src/lib/usage/staff-org-ai.d.ts +4 -2
- package/src/lib/usage/staff-org-ai.js +7 -7
- package/src/lib/usage/staff-org-ai.js.map +1 -1
- package/src/lib/usage/staff-org-usage-ai.js +2 -2
- package/src/lib/usage/staff-org-usage-ai.js.map +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
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 { PluginMediaAsset } from '@aglyn/aglyn/plugin-manager/plugin-media-ingest';
|
|
18
|
+
import type { AiLayoutPicturePhoto, AiLayoutPictureSlot, AiLayoutPictureSource } from '../layout-language/ai-layout-pictures';
|
|
19
|
+
import { aiLayoutStockPhotoSource, type AiLayoutStockPhotoDeps, type AiLayoutStockPhotoSourceInput } from './ai-layout-stock-photos';
|
|
20
|
+
/**
|
|
21
|
+
* THE BUSINESS'S OWN PHOTOS COME FIRST (AGL-3957).
|
|
22
|
+
*
|
|
23
|
+
* A site built for an owner at a booth or on a doorstep has, by the time its
|
|
24
|
+
* pages are drawn, the photos they sent from their phone through a site
|
|
25
|
+
* photo link: their van, their shop, their work. A photo of the owner's own
|
|
26
|
+
* work beats any stock photo, so a page's picture slots are filled from
|
|
27
|
+
* those first, and only the slots left over are searched for in the stock
|
|
28
|
+
* library, the way they were before.
|
|
29
|
+
*
|
|
30
|
+
* Which photo goes where is decided by shape and size, not by subject: an
|
|
31
|
+
* owner's photo says nothing a search could read. The hero takes the widest
|
|
32
|
+
* photo among the largest; the about picture takes the next largest; the
|
|
33
|
+
* gallery takes the rest, newest first, each photo once on the page and once
|
|
34
|
+
* across the job (`avoid`). A product's photo, a person's portrait and a
|
|
35
|
+
* record's cover are of one named thing, which a photo of the business in
|
|
36
|
+
* general is not, so those slots go to the stock search untouched.
|
|
37
|
+
*/
|
|
38
|
+
export interface AiLayoutOwnerPhotoDeps extends AiLayoutStockPhotoDeps {
|
|
39
|
+
/** The stock source the leftover slots go to; the real one otherwise. Specs hand in a fake. */
|
|
40
|
+
stock?: typeof aiLayoutStockPhotoSource;
|
|
41
|
+
/** The most owner photos read for one page. */
|
|
42
|
+
limit?: number;
|
|
43
|
+
}
|
|
44
|
+
/** A slot an owner's photo may fill: one of the business in general, not of one named thing. */
|
|
45
|
+
export declare function aiOwnerPhotoFits(slot: AiLayoutPictureSlot): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Assigns the owner's photos to the slots, in the order above. Pure, so a
|
|
48
|
+
* spec can hold the choice itself: `null` for a slot left to the stock
|
|
49
|
+
* search, in slot order.
|
|
50
|
+
*/
|
|
51
|
+
export declare function aiAssignOwnerPhotos(slots: readonly AiLayoutPictureSlot[], photos: readonly PluginMediaAsset[], avoid?: ReadonlySet<string>): Array<AiLayoutPicturePhoto | null>;
|
|
52
|
+
/**
|
|
53
|
+
* The source for one page: the owner's photos for the slots they fit, the
|
|
54
|
+
* stock library for the rest. `null` only when neither can answer — no
|
|
55
|
+
* media door and no stock library — which leaves every slot to the starters.
|
|
56
|
+
*/
|
|
57
|
+
export declare function aiLayoutSitePhotoSource(input: AiLayoutStockPhotoSourceInput, deps?: AiLayoutOwnerPhotoDeps): AiLayoutPictureSource | null;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
17
|
+
import { pluginMediaIngest } from "@aglyn/aglyn/plugin-manager/plugin-media-ingest";
|
|
18
|
+
import { aiLayoutStockPhotoSource } from "./ai-layout-stock-photos.js";
|
|
19
|
+
const OWNER_PHOTOS_LIMIT = 60;
|
|
20
|
+
/** A slot an owner's photo may fill: one of the business in general, not of one named thing. */ export function aiOwnerPhotoFits(slot) {
|
|
21
|
+
return !slot.product && !slot.people && !slot.record;
|
|
22
|
+
}
|
|
23
|
+
/** Fill order: the hero first, so the biggest photo is the first one seen; then about; then the gallery in document order. */ const ROLE_RANK = {
|
|
24
|
+
hero: 0,
|
|
25
|
+
about: 1,
|
|
26
|
+
gallery: 2
|
|
27
|
+
};
|
|
28
|
+
function area(photo) {
|
|
29
|
+
var _photo_width, _photo_height;
|
|
30
|
+
return ((_photo_width = photo.width) != null ? _photo_width : 0) * ((_photo_height = photo.height) != null ? _photo_height : 0);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Assigns the owner's photos to the slots, in the order above. Pure, so a
|
|
34
|
+
* spec can hold the choice itself: `null` for a slot left to the stock
|
|
35
|
+
* search, in slot order.
|
|
36
|
+
*/ export function aiAssignOwnerPhotos(slots, photos, avoid = new Set()) {
|
|
37
|
+
const pool = photos.filter((photo)=>{
|
|
38
|
+
var _photo_width, _photo_height;
|
|
39
|
+
return photo.src && ((_photo_width = photo.width) != null ? _photo_width : 0) > 0 && ((_photo_height = photo.height) != null ? _photo_height : 0) > 0 && !avoid.has(photo.src);
|
|
40
|
+
}).sort((a, b)=>area(b) - area(a));
|
|
41
|
+
const answers = slots.map(()=>null);
|
|
42
|
+
const used = new Set();
|
|
43
|
+
const order = slots.map((slot, index)=>({
|
|
44
|
+
slot,
|
|
45
|
+
index
|
|
46
|
+
})).filter(({ slot })=>aiOwnerPhotoFits(slot)).sort((a, b)=>ROLE_RANK[a.slot.role] - ROLE_RANK[b.slot.role] || a.index - b.index);
|
|
47
|
+
for (const { slot, index } of order){
|
|
48
|
+
const free = pool.filter((photo)=>!used.has(photo.src));
|
|
49
|
+
if (!free.length) break;
|
|
50
|
+
// The hero wants the widest of the three largest; a portrait phone photo
|
|
51
|
+
// in a wide frame is the one mismatch a visitor sees first.
|
|
52
|
+
const pick = slot.role === 'hero' ? [
|
|
53
|
+
...free.slice(0, 3)
|
|
54
|
+
].sort((a, b)=>{
|
|
55
|
+
var _b_width, _b_height, _a_width, _a_height;
|
|
56
|
+
return ((_b_width = b.width) != null ? _b_width : 0) / ((_b_height = b.height) != null ? _b_height : 1) - ((_a_width = a.width) != null ? _a_width : 0) / ((_a_height = a.height) != null ? _a_height : 1);
|
|
57
|
+
})[0] : free[0];
|
|
58
|
+
if (!pick) break;
|
|
59
|
+
used.add(pick.src);
|
|
60
|
+
answers[index] = _extends({
|
|
61
|
+
src: pick.src,
|
|
62
|
+
width: pick.width,
|
|
63
|
+
height: pick.height
|
|
64
|
+
}, pick.alt ? {
|
|
65
|
+
alt: pick.alt
|
|
66
|
+
} : {});
|
|
67
|
+
}
|
|
68
|
+
return answers;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The source for one page: the owner's photos for the slots they fit, the
|
|
72
|
+
* stock library for the rest. `null` only when neither can answer — no
|
|
73
|
+
* media door and no stock library — which leaves every slot to the starters.
|
|
74
|
+
*/ export function aiLayoutSitePhotoSource(input, deps = {}) {
|
|
75
|
+
var _deps_stock, _deps_ingest;
|
|
76
|
+
var _ingest_listOwnerPhotos;
|
|
77
|
+
const stock = ((_deps_stock = deps.stock) != null ? _deps_stock : aiLayoutStockPhotoSource)(input, deps);
|
|
78
|
+
const ingest = ((_deps_ingest = deps.ingest) != null ? _deps_ingest : pluginMediaIngest)();
|
|
79
|
+
const list = ingest == null ? void 0 : (_ingest_listOwnerPhotos = ingest.listOwnerPhotos) == null ? void 0 : _ingest_listOwnerPhotos.bind(ingest);
|
|
80
|
+
if (!list || !input.hostId) return stock;
|
|
81
|
+
return async (slots)=>{
|
|
82
|
+
var _input_avoid;
|
|
83
|
+
let photos = [];
|
|
84
|
+
try {
|
|
85
|
+
var _deps_limit;
|
|
86
|
+
photos = await list({
|
|
87
|
+
hostId: input.hostId,
|
|
88
|
+
limit: (_deps_limit = deps.limit) != null ? _deps_limit : OWNER_PHOTOS_LIMIT
|
|
89
|
+
});
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.warn('ai layout pictures: the owner photos could not be read; stock photos fill the page', {
|
|
92
|
+
error
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const answers = aiAssignOwnerPhotos(slots, photos, new Set((_input_avoid = input.avoid) != null ? _input_avoid : []));
|
|
96
|
+
if (!stock) return answers;
|
|
97
|
+
const open = slots.filter((_slot, index)=>!answers[index]);
|
|
98
|
+
if (!open.length) return answers;
|
|
99
|
+
// The stock source sees only the slots the owner's photos left, so its
|
|
100
|
+
// own no-repeat rules and search budget are spent on those alone.
|
|
101
|
+
const found = await stock(open);
|
|
102
|
+
let next = 0;
|
|
103
|
+
return answers.map((answer)=>{
|
|
104
|
+
var _ref;
|
|
105
|
+
return (_ref = answer != null ? answer : found[next++]) != null ? _ref : null;
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
//# sourceMappingURL=ai-layout-owner-photos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/jobs/ai-layout-owner-photos.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PluginMediaAsset } from '@aglyn/aglyn/plugin-manager/plugin-media-ingest'\nimport { pluginMediaIngest } from '@aglyn/aglyn/plugin-manager/plugin-media-ingest'\nimport type {\n AiLayoutPicturePhoto,\n AiLayoutPictureSlot,\n AiLayoutPictureSource,\n} from '../layout-language/ai-layout-pictures'\nimport {\n aiLayoutStockPhotoSource,\n type AiLayoutStockPhotoDeps,\n type AiLayoutStockPhotoSourceInput,\n} from './ai-layout-stock-photos'\n\n/**\n * THE BUSINESS'S OWN PHOTOS COME FIRST (AGL-3957).\n *\n * A site built for an owner at a booth or on a doorstep has, by the time its\n * pages are drawn, the photos they sent from their phone through a site\n * photo link: their van, their shop, their work. A photo of the owner's own\n * work beats any stock photo, so a page's picture slots are filled from\n * those first, and only the slots left over are searched for in the stock\n * library, the way they were before.\n *\n * Which photo goes where is decided by shape and size, not by subject: an\n * owner's photo says nothing a search could read. The hero takes the widest\n * photo among the largest; the about picture takes the next largest; the\n * gallery takes the rest, newest first, each photo once on the page and once\n * across the job (`avoid`). A product's photo, a person's portrait and a\n * record's cover are of one named thing, which a photo of the business in\n * general is not, so those slots go to the stock search untouched.\n */\n\nexport interface AiLayoutOwnerPhotoDeps extends AiLayoutStockPhotoDeps {\n /** The stock source the leftover slots go to; the real one otherwise. Specs hand in a fake. */\n stock?: typeof aiLayoutStockPhotoSource\n /** The most owner photos read for one page. */\n limit?: number\n}\n\nconst OWNER_PHOTOS_LIMIT = 60\n\n/** A slot an owner's photo may fill: one of the business in general, not of one named thing. */\nexport function aiOwnerPhotoFits(slot: AiLayoutPictureSlot): boolean {\n return !slot.product && !slot.people && !slot.record\n}\n\n/** Fill order: the hero first, so the biggest photo is the first one seen; then about; then the gallery in document order. */\nconst ROLE_RANK = { hero: 0, about: 1, gallery: 2 } as const\n\nfunction area(photo: PluginMediaAsset): number {\n return (photo.width ?? 0) * (photo.height ?? 0)\n}\n\n/**\n * Assigns the owner's photos to the slots, in the order above. Pure, so a\n * spec can hold the choice itself: `null` for a slot left to the stock\n * search, in slot order.\n */\nexport function aiAssignOwnerPhotos(\n slots: readonly AiLayoutPictureSlot[],\n photos: readonly PluginMediaAsset[],\n avoid: ReadonlySet<string> = new Set(),\n): Array<AiLayoutPicturePhoto | null> {\n const pool = photos\n .filter((photo) => photo.src && (photo.width ?? 0) > 0 && (photo.height ?? 0) > 0 && !avoid.has(photo.src))\n .sort((a, b) => area(b) - area(a))\n const answers: Array<AiLayoutPicturePhoto | null> = slots.map(() => null)\n const used = new Set<string>()\n const order = slots\n .map((slot, index) => ({ slot, index }))\n .filter(({ slot }) => aiOwnerPhotoFits(slot))\n .sort((a, b) => ROLE_RANK[a.slot.role] - ROLE_RANK[b.slot.role] || a.index - b.index)\n for (const { slot, index } of order) {\n const free = pool.filter((photo) => !used.has(photo.src))\n if (!free.length) break\n // The hero wants the widest of the three largest; a portrait phone photo\n // in a wide frame is the one mismatch a visitor sees first.\n const pick =\n slot.role === 'hero'\n ? [...free.slice(0, 3)].sort(\n (a, b) => (b.width ?? 0) / (b.height ?? 1) - (a.width ?? 0) / (a.height ?? 1),\n )[0]\n : free[0]\n if (!pick) break\n used.add(pick.src)\n answers[index] = {\n src: pick.src,\n width: pick.width as number,\n height: pick.height as number,\n ...(pick.alt ? { alt: pick.alt } : {}),\n }\n }\n return answers\n}\n\n/**\n * The source for one page: the owner's photos for the slots they fit, the\n * stock library for the rest. `null` only when neither can answer — no\n * media door and no stock library — which leaves every slot to the starters.\n */\nexport function aiLayoutSitePhotoSource(\n input: AiLayoutStockPhotoSourceInput,\n deps: AiLayoutOwnerPhotoDeps = {},\n): AiLayoutPictureSource | null {\n const stock = (deps.stock ?? aiLayoutStockPhotoSource)(input, deps)\n const ingest = (deps.ingest ?? pluginMediaIngest)()\n const list = ingest?.listOwnerPhotos?.bind(ingest)\n if (!list || !input.hostId) return stock\n return async (slots) => {\n let photos: PluginMediaAsset[] = []\n try {\n photos = await list({ hostId: input.hostId, limit: deps.limit ?? OWNER_PHOTOS_LIMIT })\n } catch (error) {\n console.warn('ai layout pictures: the owner photos could not be read; stock photos fill the page', { error })\n }\n const answers = aiAssignOwnerPhotos(slots, photos, new Set(input.avoid ?? []))\n if (!stock) return answers\n const open = slots.filter((_slot, index) => !answers[index])\n if (!open.length) return answers\n // The stock source sees only the slots the owner's photos left, so its\n // own no-repeat rules and search budget are spent on those alone.\n const found = await stock(open)\n let next = 0\n return answers.map((answer) => answer ?? found[next++] ?? null)\n }\n}\n"],"names":["pluginMediaIngest","aiLayoutStockPhotoSource","OWNER_PHOTOS_LIMIT","aiOwnerPhotoFits","slot","product","people","record","ROLE_RANK","hero","about","gallery","area","photo","width","height","aiAssignOwnerPhotos","slots","photos","avoid","Set","pool","filter","src","has","sort","a","b","answers","map","used","order","index","role","free","length","pick","slice","add","alt","aiLayoutSitePhotoSource","input","deps","ingest","stock","list","listOwnerPhotos","bind","hostId","limit","error","console","warn","open","_slot","found","next","answer"],"mappings":"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"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { type PluginMediaIngest } from '@aglyn/aglyn/plugin-manager/plugin-media-ingest';
|
|
18
18
|
import { type StockPhoto, type StockPhotoOrientation, type StockPhotoProvider, type StockPhotoSearchRequest } from '@aglyn/aglyn/plugin-manager/stock-photo-provider';
|
|
19
19
|
import type { NodesMap } from '@aglyn/aglyn/types/nodes';
|
|
20
|
-
import { type AiLayoutPictureSlot, type AiLayoutPictureSource } from '../layout-language/ai-layout-pictures';
|
|
20
|
+
import { type AiLayoutPicturePhoto, type AiLayoutPictureSlot, type AiLayoutPictureSource } from '../layout-language/ai-layout-pictures';
|
|
21
21
|
import type { AiBuildPlan } from '../model/ai-build-plan';
|
|
22
22
|
/**
|
|
23
23
|
* STOCK PHOTOS FOR A LANGUAGE PAGE'S PICTURE SLOTS (AGL-3660).
|
|
@@ -178,6 +178,14 @@ export declare const AI_STOCK_PHOTO_PAGES_INPUT = "stockPhotoPages";
|
|
|
178
178
|
* (AGL-3616) — which a page does not place again.
|
|
179
179
|
*/
|
|
180
180
|
export declare const AI_STOCK_PHOTO_AVOID_INPUT = "stockPhotoAvoid";
|
|
181
|
+
/**
|
|
182
|
+
* The unit job input holding the photos another part of the job placed
|
|
183
|
+
* outside its pages — a dataset's records — with their size and words
|
|
184
|
+
* (AGL-3988): what a picture the library failed takes before any starter.
|
|
185
|
+
*/
|
|
186
|
+
export declare const AI_STOCK_PHOTO_JOB_PHOTOS_INPUT = "stockPhotoJobPhotos";
|
|
187
|
+
/** The job photos a unit input holds ({@link AI_STOCK_PHOTO_JOB_PHOTOS_INPUT}): library photos with a size; anything else is dropped. */
|
|
188
|
+
export declare function aiStockJobPhotosOf(value: unknown): AiLayoutPicturePhoto[];
|
|
181
189
|
/**
|
|
182
190
|
* A word's singular, for matching only: "bowls" and "bowl", "vases" and
|
|
183
191
|
* "vase", "berries" and "berry", "dishes" and "dish" meet. Both sides of a
|
|
@@ -243,6 +251,12 @@ export interface AiStockSiteTerms {
|
|
|
243
251
|
setting?: string;
|
|
244
252
|
/** The craft's maker and tools as stems, which a record of its work never leads with ({@link CRAFT_KIN}, AGL-3856). */
|
|
245
253
|
maker?: string[];
|
|
254
|
+
/**
|
|
255
|
+
* What a craft whose pictures are people at a moment shows wherever a page
|
|
256
|
+
* would show its maker ({@link aiStockWorkScenes}, AGL-3942): the scenes
|
|
257
|
+
* its site's own words name, set where the site is.
|
|
258
|
+
*/
|
|
259
|
+
work?: AiStockScene[];
|
|
246
260
|
}
|
|
247
261
|
/** The site's terms, read from its business type. */
|
|
248
262
|
export declare function aiStockSiteTerms(businessType: string): AiStockSiteTerms;
|
|
@@ -308,6 +322,8 @@ export interface AiStockSearch extends StockPhotoSearchRequest {
|
|
|
308
322
|
refuseLead?: readonly string[];
|
|
309
323
|
/** Whether its hits are held to no world of the site's: a portfolio's record is of its subject, never of the craft (AGL-3856). */
|
|
310
324
|
worldless?: boolean;
|
|
325
|
+
/** Stems of the places its hits are not set in, which none of their first tags name: a Blue Ridge couple's beach ({@link aiStockSettingAway}, AGL-3942). */
|
|
326
|
+
away?: readonly string[];
|
|
311
327
|
/** Whether it fills a product: no room, no scene, no fragrance bottle ({@link PRODUCT_SCENES}, AGL-3660). */
|
|
312
328
|
product?: boolean;
|
|
313
329
|
/** Words its hits never carry unless the slot or the brief names them ({@link AiStockSiteTerms.shun}). */
|
|
@@ -355,6 +371,8 @@ export declare function aiStockRoleRefusals(role: Pick<AiStockPeopleRole, 'refus
|
|
|
355
371
|
* anywhere on it, whatever else its words name ("school").
|
|
356
372
|
*/
|
|
357
373
|
export declare function aiStockAdultsOnly(texts: ReadonlyArray<string | undefined>): boolean;
|
|
374
|
+
/** The stems of the places a setting is not ({@link SCENE_SETTINGS}); none for no setting. */
|
|
375
|
+
export declare function aiStockSettingAway(setting: string): string[];
|
|
358
376
|
/** What a picture of a moment shows ({@link aiStockScene}). */
|
|
359
377
|
export interface AiStockScene {
|
|
360
378
|
/** The searches that ask for it, the people and their setting first. */
|
|
@@ -369,6 +387,8 @@ export interface AiStockScene {
|
|
|
369
387
|
shun: string[];
|
|
370
388
|
/** The stems of its words, which let in what they name: a family's children. */
|
|
371
389
|
named: string[];
|
|
390
|
+
/** Stems of the places it is not set in, which none of a photo's first tags name ({@link aiStockSettingAway}, AGL-3942). */
|
|
391
|
+
away: string[];
|
|
372
392
|
}
|
|
373
393
|
/**
|
|
374
394
|
* The scene a picture's words name (AGL-3856): the people at a moment, and
|
|
@@ -377,7 +397,7 @@ export interface AiStockScene {
|
|
|
377
397
|
* family in autumn — read from every word, never only the first clause.
|
|
378
398
|
* `null` where it names no people.
|
|
379
399
|
*/
|
|
380
|
-
export declare function aiStockScene(text: string): AiStockScene | null;
|
|
400
|
+
export declare function aiStockScene(text: string, siteSetting?: string): AiStockScene | null;
|
|
381
401
|
/** Where a text's words set a picture ({@link SCENE_SETTINGS}): "mountains" of "Couples planning mountain weddings"; empty for none. */
|
|
382
402
|
export declare function aiStockSetting(text: string): string;
|
|
383
403
|
/**
|
|
@@ -391,6 +411,17 @@ export declare function aiStockSetting(text: string): string;
|
|
|
391
411
|
* neither names people at a moment nor a portrait.
|
|
392
412
|
*/
|
|
393
413
|
export declare function aiStockRecordScene(name: string, category?: string, siteSetting?: string): AiStockScene | null;
|
|
414
|
+
/**
|
|
415
|
+
* The work a craft whose pictures are people at a moment shows (AGL-3942):
|
|
416
|
+
* the scenes its site's own words name, in the order they name them, each
|
|
417
|
+
* set where the site is — a wedding photographer "for couples planning
|
|
418
|
+
* mountain weddings, and families" shows a wedding couple in the mountains
|
|
419
|
+
* and a family in the mountains. A family session still never shows a
|
|
420
|
+
* bride, whatever else the site names. Empty where its words name no people.
|
|
421
|
+
*/
|
|
422
|
+
export declare function aiStockWorkScenes(text: string, setting?: string): AiStockScene[];
|
|
423
|
+
/** Whether a setting is a place a photo shows on its own, a landscape searched by its name: "mountains", never "autumn". */
|
|
424
|
+
export declare function aiStockSettingIsLandscape(setting: string): boolean;
|
|
394
425
|
/** What a product falls back to once its own searches find nothing ({@link aiStockProductSearches}). */
|
|
395
426
|
export interface AiStockProductFallback {
|
|
396
427
|
/** The site's broad searches ({@link AiStockSiteTerms.broad}): "handmade soap". */
|
|
@@ -451,7 +482,15 @@ export declare function aiStockProductSearches(slot: Pick<AiLayoutPictureSlot, '
|
|
|
451
482
|
* asks first for the role its words or its list's name (`sectionName`) say,
|
|
452
483
|
* in the site's world: "teacher classroom" for a "Math instructor" (AGL-3856).
|
|
453
484
|
*/
|
|
454
|
-
export declare function aiStockSearchesFor(slot: Pick<AiLayoutPictureSlot, 'role' | 'alt' | 'aspect' | 'people' | 'record' | 'product'>, terms: Pick<AiStockSiteTerms, 'business' | 'craft' | 'domain' | 'broad'> & Partial<Pick<AiStockSiteTerms, 'making' | 'core' | 'scenes' | 'setting' | 'maker'>>, subject: string, part?: AiStockSlotPart, sectionName?: string): AiStockSearch[];
|
|
485
|
+
export declare function aiStockSearchesFor(slot: Pick<AiLayoutPictureSlot, 'role' | 'alt' | 'aspect' | 'people' | 'record' | 'product'>, terms: Pick<AiStockSiteTerms, 'business' | 'craft' | 'domain' | 'broad'> & Partial<Pick<AiStockSiteTerms, 'making' | 'core' | 'scenes' | 'setting' | 'maker' | 'work'>>, subject: string, part?: AiStockSlotPart, sectionName?: string): AiStockSearch[];
|
|
486
|
+
/**
|
|
487
|
+
* Whether a picture of a craft's site whose pictures are people at a moment
|
|
488
|
+
* shows that work wherever a page would show the maker (AGL-3942): an about
|
|
489
|
+
* picture, a story of the craft, an intro's cover. Not a record (which shows
|
|
490
|
+
* its own moment, {@link aiStockShowsTheWork}), a portrait of the business's
|
|
491
|
+
* people, nor a product; and only where the site's words name the work.
|
|
492
|
+
*/
|
|
493
|
+
export declare function aiStockShowsItsWork(slot: Pick<AiLayoutPictureSlot, 'record' | 'people' | 'product'>, terms: Partial<Pick<AiStockSiteTerms, 'scenes' | 'work'>>): boolean;
|
|
455
494
|
/**
|
|
456
495
|
* Whether a slot is a portfolio's record of a craft whose work is people at a
|
|
457
496
|
* moment (AGL-3856): a photographer's "Mountain Elopements" shows an
|
|
@@ -512,6 +551,8 @@ export interface AiStockJudgement {
|
|
|
512
551
|
roleScene?: readonly string[];
|
|
513
552
|
/** Stems of something else being done, which none of a hit's first tags may name ({@link AiStockPeopleRole.refuse}). */
|
|
514
553
|
roleRefuse?: readonly string[];
|
|
554
|
+
/** Stems of the places the picture is not set in, which none of a hit's first tags may name ({@link AiStockSearch.away}). */
|
|
555
|
+
away?: readonly string[];
|
|
515
556
|
}
|
|
516
557
|
/**
|
|
517
558
|
* Whether a hit carries a topic its site never named ({@link SENSITIVE_TOPICS}):
|
|
@@ -558,6 +599,13 @@ export declare function aiStockPick(photos: readonly StockPhoto[], used: Readonl
|
|
|
558
599
|
* not the job's, and are not listed.
|
|
559
600
|
*/
|
|
560
601
|
export declare function aiStockPlacedSrcs(nodes: NodesMap | null | undefined): string[];
|
|
602
|
+
/**
|
|
603
|
+
* The library photos a stored page shows, each as a slot takes it (AGL-3988):
|
|
604
|
+
* its source, its size and what it shows. A photo the job placed on another
|
|
605
|
+
* page is what a slot the library failed takes before any starter
|
|
606
|
+
* (`aiLayoutJobPhotoPicks`). Each photo once; one without a size is left out.
|
|
607
|
+
*/
|
|
608
|
+
export declare function aiStockPlacedPhotos(nodes: NodesMap | null | undefined): AiLayoutPicturePhoto[];
|
|
561
609
|
/** Forgets every job's placed photos; for specs. */
|
|
562
610
|
export declare function aiStockForgetJobPhotos(): void;
|
|
563
611
|
/**
|
|
@@ -579,7 +627,17 @@ export declare function aiStockForgetJobPhotos(): void;
|
|
|
579
627
|
* - a second thing comes only from the first two tags and where no place is
|
|
580
628
|
* said, what a person holds only from the first three, where it is set
|
|
581
629
|
* from the first ten;
|
|
582
|
-
* - no word is said twice: never "an elderly couple and an elderly"
|
|
630
|
+
* - no word is said twice: never "an elderly couple and an elderly";
|
|
631
|
+
* - the sky, the clouds and the light are no thing anyone holds, and the
|
|
632
|
+
* weather is said as where it is: "a couple in the fog at a wedding",
|
|
633
|
+
* "a couple in the snow in the mountains", never "a couple with a sky at
|
|
634
|
+
* sunset" or "a snow in the mountains"; a feeling ("care", "worry") is no
|
|
635
|
+
* thing either; whoever else is about ("tourists") is never said beside a
|
|
636
|
+
* family; a parent beside a child is said with them ("a father with a
|
|
637
|
+
* girl"); a tag that is a phrase of its own ("couple on bench") is read as
|
|
638
|
+
* its parts; a time of day comes after where ("in the mountains at
|
|
639
|
+
* sunset"), and a bench out of doors says where it stands ("on a bench by
|
|
640
|
+
* the lake") (AGL-3988).
|
|
583
641
|
*
|
|
584
642
|
* `null` where no tag names a thing.
|
|
585
643
|
*/
|