@aglyn/plugins-ai 1.0.0-beta.238 → 1.0.0-beta.240
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-job-links.js +8 -0
- package/src/lib/components/ai-job-links.js.map +1 -1
- package/src/lib/components/ai-job-requests.d.ts +5 -0
- package/src/lib/components/ai-job-requests.js +4 -2
- package/src/lib/components/ai-job-requests.js.map +1 -1
- package/src/lib/components/ai-jobs-store.d.ts +12 -0
- package/src/lib/components/ai-jobs-store.js +15 -0
- package/src/lib/components/ai-jobs-store.js.map +1 -1
- package/src/lib/components/ai-usage-meter-refresh.d.ts +35 -0
- package/src/lib/components/ai-usage-meter-refresh.js +63 -0
- package/src/lib/components/ai-usage-meter-refresh.js.map +1 -0
- package/src/lib/components/assist-panel.component.js +17 -1
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/components/use-ai-usage-meter.d.ts +2 -0
- package/src/lib/components/use-ai-usage-meter.js +8 -3
- package/src/lib/components/use-ai-usage-meter.js.map +1 -1
- package/src/lib/jobs/ai-build-unit-outcome.d.ts +3 -1
- package/src/lib/jobs/ai-build-unit-outcome.js +19 -3
- package/src/lib/jobs/ai-build-unit-outcome.js.map +1 -1
- package/src/lib/jobs/ai-job-build-step.js +29 -2
- package/src/lib/jobs/ai-job-build-step.js.map +1 -1
- package/src/lib/jobs/ai-job-draft-ids.js +7 -2
- package/src/lib/jobs/ai-job-draft-ids.js.map +1 -1
- package/src/lib/jobs/ai-job-form-dataset.d.ts +100 -0
- package/src/lib/jobs/ai-job-form-dataset.js +161 -0
- package/src/lib/jobs/ai-job-form-dataset.js.map +1 -0
- package/src/lib/jobs/ai-job-form-step.d.ts +15 -3
- package/src/lib/jobs/ai-job-form-step.js +37 -9
- package/src/lib/jobs/ai-job-form-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.js +7 -2
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +9 -0
- package/src/lib/jobs/ai-job-page-language.js +44 -4
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-sections.js +13 -2
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.js +32 -2
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +18 -0
- package/src/lib/jobs/ai-job-plan-step.js +41 -4
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-datasets.d.ts +183 -0
- package/src/lib/jobs/ai-job-site-datasets.js +530 -0
- package/src/lib/jobs/ai-job-site-datasets.js.map +1 -0
- package/src/lib/jobs/ai-job-site-step.d.ts +15 -8
- package/src/lib/jobs/ai-job-site-step.js +148 -29
- package/src/lib/jobs/ai-job-site-step.js.map +1 -1
- package/src/lib/jobs/fixtures/ai-dataset-site-plan-recordings.d.ts +30 -0
- package/src/lib/jobs/fixtures/ai-dataset-site-plan-recordings.js +637 -0
- package/src/lib/jobs/fixtures/ai-dataset-site-plan-recordings.js.map +1 -0
- package/src/lib/layout-language/ai-layout-compiler.d.ts +10 -0
- package/src/lib/layout-language/ai-layout-compiler.js +93 -1
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-gaps.js +17 -1
- package/src/lib/layout-language/ai-layout-gaps.js.map +1 -1
- package/src/lib/layout-language/ai-layout-listings.d.ts +32 -3
- package/src/lib/layout-language/ai-layout-listings.js +62 -9
- package/src/lib/layout-language/ai-layout-listings.js.map +1 -1
- package/src/lib/layout-language/ai-layout-pictures.js +12 -4
- package/src/lib/layout-language/ai-layout-pictures.js.map +1 -1
- package/src/lib/model/ai-build-job.d.ts +2 -0
- package/src/lib/model/ai-build-job.js +16 -1
- package/src/lib/model/ai-build-job.js.map +1 -1
- package/src/lib/model/ai-build-plan.d.ts +23 -3
- package/src/lib/model/ai-build-plan.js +47 -6
- package/src/lib/model/ai-build-plan.js.map +1 -1
- package/src/lib/model/ai-plan-capabilities.d.ts +7 -0
- package/src/lib/model/ai-plan-capabilities.js.map +1 -1
- package/src/lib/model/ai-site-job.d.ts +19 -2
- package/src/lib/model/ai-site-job.js +21 -6
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/runtime/ai-dataset-generation.d.ts +77 -0
- package/src/lib/runtime/ai-dataset-generation.js +127 -0
- package/src/lib/runtime/ai-dataset-generation.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +84 -0
- package/src/lib/runtime/ai-doctrine-validators.js +307 -1
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +10 -4
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-node-tree.d.ts +2 -0
- package/src/lib/runtime/ai-node-tree.js +16 -0
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/tools/ai-dataset-tool.d.ts +68 -0
- package/src/lib/tools/ai-dataset-tool.js +231 -0
- package/src/lib/tools/ai-dataset-tool.js.map +1 -0
- package/src/lib/usage/free-ai-credits-left.js +26 -2
- package/src/lib/usage/free-ai-credits-left.js.map +1 -1
|
@@ -220,5 +220,15 @@ export declare const AI_LAYOUT_STORE_EMPTY: {
|
|
|
220
220
|
/** Said where the site has no page to get in touch on. */
|
|
221
221
|
readonly textAlone: "Our first pieces are being finished now. Check back soon.";
|
|
222
222
|
};
|
|
223
|
+
/** The fields a record's card shows: its name, a kicker line and its words, each by id. */
|
|
224
|
+
export declare function aiLayoutRecordCardFields(fields: readonly {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
type: string;
|
|
228
|
+
}[]): {
|
|
229
|
+
title: string | null;
|
|
230
|
+
kicker: string | null;
|
|
231
|
+
body: string | null;
|
|
232
|
+
};
|
|
223
233
|
/** The id the compiled page's root is stored under. */
|
|
224
234
|
export declare const AI_LAYOUT_PAGE_ROOT_ID = "_@_";
|
|
@@ -2040,9 +2040,10 @@ function instances(scope, placed, items, perRow) {
|
|
|
2040
2040
|
} : null;
|
|
2041
2041
|
const index = listing.placements.find((placement)=>placement.role === 'index' && placement.screenId !== page.targets.pageId);
|
|
2042
2042
|
if (!index) return null;
|
|
2043
|
+
const text = listing.kind === 'tracks' ? 'All music' : listing.kind === 'records' ? 'See all' : 'Shop all';
|
|
2043
2044
|
return {
|
|
2044
2045
|
kind: 'button',
|
|
2045
|
-
text
|
|
2046
|
+
text,
|
|
2046
2047
|
to: `page:${index.screenId}`,
|
|
2047
2048
|
style: 'secondary'
|
|
2048
2049
|
};
|
|
@@ -2461,6 +2462,8 @@ function listingSection(scope, blocks, placed) {
|
|
|
2461
2462
|
emptyActionLabel: listing.emptyAction.label,
|
|
2462
2463
|
emptyActionHref: listing.emptyAction.href
|
|
2463
2464
|
} : {}), null, null, 'products');
|
|
2465
|
+
} else if (listing.kind === 'records') {
|
|
2466
|
+
id = recordsElement(scope, listing, featured ? shown : null);
|
|
2464
2467
|
} else {
|
|
2465
2468
|
id = postsElement(scope, listing, featured ? shown : COLLECTION_INDEX_POSTS);
|
|
2466
2469
|
}
|
|
@@ -2577,6 +2580,95 @@ function listingSection(scope, blocks, placed) {
|
|
|
2577
2580
|
card
|
|
2578
2581
|
], 'posts');
|
|
2579
2582
|
}
|
|
2583
|
+
// ── A dataset's records (AGL-3616) ───────────────────────────────────────
|
|
2584
|
+
/** A field whose name says it is a record's kicker: its category, role, time or place. */ const RECORD_KICKER = /\b(category|categories|type|kind|role|title|position|section|course|date|dates|time|times|when|day|days|location|place|where|venue|city|duration|level|tag|tags)\b/i;
|
|
2585
|
+
/** A field whose name says it is a record's words: its description, bio or answer. */ const RECORD_BODY = /\b(description|summary|details?|about|bio|biography|answer|text|notes?|body|blurb|overview|excerpt|ingredients|includes)\b/i;
|
|
2586
|
+
/** A dataset of questions and answers, listed as a ruled list rather than cards. */ const RECORD_QUESTIONS = /\b(faqs?|questions?|q ?& ?a)\b/i;
|
|
2587
|
+
/** The fields a record's card shows: its name, a kicker line and its words, each by id. */ export function aiLayoutRecordCardFields(fields) {
|
|
2588
|
+
var _ref, _ref1, _ref2, _ref3;
|
|
2589
|
+
var _texts_find, _rest_find, _rest_find1, _rest_find2;
|
|
2590
|
+
const texts = fields.filter((field)=>field.type === 'text' || field.type === 'sorted');
|
|
2591
|
+
const title = (_ref = (_texts_find = texts.find((field)=>field.type === 'text')) == null ? void 0 : _texts_find.id) != null ? _ref : null;
|
|
2592
|
+
const rest = texts.filter((field)=>field.id !== title);
|
|
2593
|
+
const body = (_ref1 = (_rest_find = rest.find((field)=>field.type === 'text' && RECORD_BODY.test(field.name))) == null ? void 0 : _rest_find.id) != null ? _ref1 : null;
|
|
2594
|
+
const kicker = (_ref2 = (_rest_find1 = rest.find((field)=>field.id !== body && RECORD_KICKER.test(field.name))) == null ? void 0 : _rest_find1.id) != null ? _ref2 : null;
|
|
2595
|
+
// Failing a named one, the next text field is the record's words.
|
|
2596
|
+
const words = (_ref3 = body != null ? body : (_rest_find2 = rest.find((field)=>field.type === 'text' && field.id !== kicker)) == null ? void 0 : _rest_find2.id) != null ? _ref3 : null;
|
|
2597
|
+
return {
|
|
2598
|
+
title,
|
|
2599
|
+
kicker,
|
|
2600
|
+
body: words
|
|
2601
|
+
};
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* A dataset's records, as the site's design lists them: a Box that repeats
|
|
2605
|
+
* its one card over the dataset — the platform's own repeat, which the page
|
|
2606
|
+
* renders once per record — or, for questions and answers, a ruled list.
|
|
2607
|
+
* The card binds the record's fields as `{{item.<field>}}`: its name as the
|
|
2608
|
+
* item's title, a kicker over it (its category, role or time), and its words.
|
|
2609
|
+
* A featured band shows the first few; a page of its own, every record.
|
|
2610
|
+
*/ function recordsElement(scope, listing, limit) {
|
|
2611
|
+
var _listing_fields;
|
|
2612
|
+
const { page } = scope;
|
|
2613
|
+
const tree = page.tree;
|
|
2614
|
+
const fields = aiLayoutRecordCardFields((_listing_fields = listing.fields) != null ? _listing_fields : []);
|
|
2615
|
+
const questions = RECORD_QUESTIONS.test(listing.name);
|
|
2616
|
+
const textAlign = scope.centered && !questions ? {
|
|
2617
|
+
align: 'center'
|
|
2618
|
+
} : {};
|
|
2619
|
+
const kicker = fields.kicker ? tree.add('muiTypography', _extends({
|
|
2620
|
+
children: `{{item.${fields.kicker}}}`,
|
|
2621
|
+
variant: 'overline',
|
|
2622
|
+
component: 'p'
|
|
2623
|
+
}, textAlign), accent(scope), null, 'recordKicker') : null;
|
|
2624
|
+
const title = fields.title ? tree.add('muiTypography', _extends({
|
|
2625
|
+
children: `{{item.${fields.title}}}`,
|
|
2626
|
+
variant: questions ? 'h6' : 'h5',
|
|
2627
|
+
component: itemElement(scope)
|
|
2628
|
+
}, textAlign), null, null, 'recordTitle') : null;
|
|
2629
|
+
const body = fields.body ? tree.add('muiTypography', _extends({
|
|
2630
|
+
children: `{{item.${fields.body}}}`,
|
|
2631
|
+
variant: 'body2'
|
|
2632
|
+
}, textAlign), muted(scope), null, 'recordBody') : null;
|
|
2633
|
+
page.settled.push({
|
|
2634
|
+
at: scope.at,
|
|
2635
|
+
what: `${listing.name} listed from its dataset${questions ? ' as a ruled list' : ' as cards'}`
|
|
2636
|
+
});
|
|
2637
|
+
const card = questions ? tree.add('muiStack', {
|
|
2638
|
+
spacing: '1'
|
|
2639
|
+
}, {
|
|
2640
|
+
borderTop: 1,
|
|
2641
|
+
pt: 3
|
|
2642
|
+
}, [
|
|
2643
|
+
title,
|
|
2644
|
+
body
|
|
2645
|
+
], 'record') : tree.add('muiStack', _extends({
|
|
2646
|
+
spacing: '1'
|
|
2647
|
+
}, scope.centered ? {
|
|
2648
|
+
alignItems: 'center'
|
|
2649
|
+
} : {}), null, [
|
|
2650
|
+
kicker,
|
|
2651
|
+
title,
|
|
2652
|
+
body
|
|
2653
|
+
], 'record');
|
|
2654
|
+
return tree.add(AI_LAYOUT_LISTING_ELEMENTS.records, _extends({
|
|
2655
|
+
repeatDataset: listing.datasetId
|
|
2656
|
+
}, limit ? {
|
|
2657
|
+
repeatLimit: String(limit)
|
|
2658
|
+
} : {}), questions ? {
|
|
2659
|
+
display: 'grid',
|
|
2660
|
+
gap: 3
|
|
2661
|
+
} : {
|
|
2662
|
+
display: 'grid',
|
|
2663
|
+
gridTemplateColumns: {
|
|
2664
|
+
xs: '1fr',
|
|
2665
|
+
md: 'repeat(3, 1fr)'
|
|
2666
|
+
},
|
|
2667
|
+
gap: 5
|
|
2668
|
+
}, [
|
|
2669
|
+
card
|
|
2670
|
+
], 'records');
|
|
2671
|
+
}
|
|
2580
2672
|
/** The id the compiled page's root is stored under. */ export const AI_LAYOUT_PAGE_ROOT_ID = CANVAS_ROOT_ELEMENT_ID;
|
|
2581
2673
|
|
|
2582
2674
|
//# sourceMappingURL=ai-layout-compiler.js.map
|