@sonordev/site-kit 8.2.0 → 8.3.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/AGENTS.md +13 -1
- package/CHANGELOG.md +5 -0
- package/README.md +9 -5
- package/agent-manifest.json +47 -8
- package/dist/{AnalyticsProvider-6TAA3XYB.js → AnalyticsProvider-QXO33JUF.js} +6 -6
- package/dist/{ArticleFaqSection-3Q26DP7P.js → ArticleFaqSection-DEWE5B4Q.js} +1 -1
- package/dist/{ArticleViewTracker-H4N7YCLC.js → ArticleViewTracker-KN6ENIRS.js} +17 -6
- package/dist/{BlocksPopup-FJT5YQD3.js → BlocksPopup-3RPN6YVJ.js} +6 -6
- package/dist/{ChatWidget-THQHHTAA.js → ChatWidget-D2X445PO.js} +6 -6
- package/dist/{FileField-OZXXJGUM.js → FileField-UNGSNGJ5.js} +4 -4
- package/dist/{FormSpotlight-MLDJS246.js → FormSpotlight-JFH2ENKQ.js} +1 -1
- package/dist/{FormStage-6RVY7M3R.js → FormStage-RC3WHHXP.js} +1 -1
- package/dist/{ManagedForm-3VV54RVH.js → ManagedForm-FOQZ2IYG.js} +7 -7
- package/dist/{ManagedNewsletterForm-RTJDGMGG.js → ManagedNewsletterForm-NFNF33V3.js} +16 -7
- package/dist/{SignalCore-T7ZOCA44.js → SignalCore-5KABGX5C.js} +4 -4
- package/dist/SiteChat-JQ46ZIJ4.js +6 -0
- package/dist/SiteDesignReporter-N7L6DR4J.js +12 -0
- package/dist/{SitePopups-K6ADAWFK.js → SitePopups-WZBKX5Q3.js} +6 -6
- package/dist/SitemapSync-GY6UADRI.js +9 -0
- package/dist/_client/booking-widget.js +6 -6
- package/dist/_client/testimonial-section.js +3 -3
- package/dist/affiliates/index.js +4 -4
- package/dist/analytics/index.js +6 -6
- package/dist/{article-styles-GFXJJDLE.js → article-styles-7QONZJR5.js} +3 -3
- package/dist/article-tables-6XHVULPU.js +2 -0
- package/dist/articles/Article.d.ts +2 -89
- package/dist/articles/ArticleFAQ.d.ts +2 -41
- package/dist/articles/ArticleFaqSection.d.ts +2 -2
- package/dist/articles/ArticleList.d.ts +2 -79
- package/dist/articles/ArticleViewTracker.d.ts +2 -15
- package/dist/articles/AuthorCard.d.ts +2 -10
- package/dist/articles/AuthorPage.d.ts +2 -8
- package/dist/articles/ClusterLandingPage.d.ts +2 -40
- package/dist/articles/ClusterNavigation.d.ts +2 -37
- package/dist/articles/ManagedNewsletterForm.d.ts +3 -12
- package/dist/articles/NewsletterShell.d.ts +2 -17
- package/dist/articles/NewsletterWidget.d.ts +2 -30
- package/dist/articles/PublicationLayout.d.ts +2 -67
- package/dist/articles/PublicationSidebar.d.ts +2 -36
- package/dist/articles/RelatedPosts.d.ts +2 -22
- package/dist/articles/ServiceCallout.d.ts +2 -56
- package/dist/articles/TableOfContents.d.ts +2 -6
- package/dist/articles/article-photos.d.ts +2 -9
- package/dist/articles/article-styles.d.ts +2 -21
- package/dist/articles/article-tables.d.ts +2 -12
- package/dist/articles/artwork.d.ts +2 -13
- package/dist/articles/author-schema.d.ts +2 -72
- package/dist/articles/author-social.d.ts +2 -14
- package/dist/articles/excerpt.d.ts +2 -17
- package/dist/articles/index.d.ts +2 -79
- package/dist/articles/index.js +16 -11
- package/dist/articles/news-sitemap.d.ts +2 -46
- package/dist/articles/processArticleHtml.d.ts +2 -34
- package/dist/articles/public-reads.d.ts +2 -26
- package/dist/articles/reading-time.d.ts +2 -9
- package/dist/articles/routes.d.ts +2 -52
- package/dist/articles/server-core.d.ts +2 -461
- package/dist/articles/server-ui.d.ts +2 -30
- package/dist/articles/server-ui.js +26 -17
- package/dist/articles/server.d.ts +2 -461
- package/dist/articles/server.js +14 -5
- package/dist/articles/types.d.ts +2 -316
- package/dist/articles/widget-styles.d.ts +2 -8
- package/dist/chat/index.js +8 -8
- package/dist/{chunk-575L73NT.js → chunk-2JMCBJM5.js} +1 -1
- package/dist/chunk-34ZYJTQR.js +1 -0
- package/dist/{chunk-7FSB2EXS.js → chunk-3OY52UFM.js} +1 -1
- package/dist/{chunk-WMVK77ND.js → chunk-4K735O3J.js} +1 -1
- package/dist/{chunk-66G47P5C.js → chunk-4PVMUPC6.js} +2 -2
- package/dist/{chunk-L5UOHS6E.js → chunk-5D7ZISUP.js} +1 -1
- package/dist/{chunk-SMYX3AAO.js → chunk-5RYSTKVU.js} +1 -1
- package/dist/{chunk-6CJGZFOU.js → chunk-A4MPHIVP.js} +1 -1
- package/dist/chunk-B7T2SFUF.js +1 -0
- package/dist/{chunk-FV2VD7WM.js → chunk-BC7JMY4Z.js} +3 -3
- package/dist/{chunk-57K4GW3D.js → chunk-BOCYBDKV.js} +1 -1
- package/dist/{chunk-NFRJTOTB.js → chunk-BSQP6PRA.js} +1 -1
- package/dist/{chunk-GKGSXUVQ.js → chunk-BVB5FBAA.js} +1 -1
- package/dist/{chunk-Q72M5KBS.js → chunk-C2UROFGZ.js} +1 -1
- package/dist/{chunk-3EU6S5YC.js → chunk-C4AFNZT2.js} +1 -1
- package/dist/{chunk-WACWV5EP.js → chunk-D6ZIQMHB.js} +3 -3
- package/dist/{chunk-GYF2ULVO.js → chunk-DJAYFHVF.js} +1 -1
- package/dist/{chunk-JC2VS2SB.js → chunk-DPSNMOMZ.js} +1 -1
- package/dist/{chunk-NNEIBXGU.js → chunk-E3UR37RX.js} +2 -2
- package/dist/{chunk-Y3INC4QJ.js → chunk-E4PTMORJ.js} +1 -1
- package/dist/{chunk-EBILJHUF.js → chunk-EA6FZMYA.js} +2 -2
- package/dist/{chunk-X7VKRHFF.js → chunk-FHUTOXS7.js} +1 -1
- package/dist/{chunk-JBEUZJS3.js → chunk-GKJVSZ7H.js} +3 -3
- package/dist/chunk-H72ZFO3F.js +1 -0
- package/dist/{chunk-FVXFLVXF.js → chunk-HND6BDXC.js} +3 -3
- package/dist/chunk-IEGDPRQB.js +14 -0
- package/dist/{chunk-CAH4Y4PY.js → chunk-JO76F5WP.js} +1 -1
- package/dist/{chunk-FQUGGPBM.js → chunk-KJVUOJMW.js} +58 -58
- package/dist/{chunk-SC4MZGWZ.js → chunk-LBDWAXAO.js} +1 -1
- package/dist/{chunk-WSNG2K3T.js → chunk-LPKKSYKX.js} +3 -3
- package/dist/{chunk-HUBMKTPW.js → chunk-M5SF7NCC.js} +1 -1
- package/dist/{chunk-YBAFUM3Z.js → chunk-MQ4REMTH.js} +2 -2
- package/dist/{chunk-BQZPHICL.js → chunk-NA4Z4CQG.js} +1 -1
- package/dist/{chunk-727R7C5R.js → chunk-OIWFXUVD.js} +2 -2
- package/dist/{chunk-H4R2GPAB.js → chunk-QBCWVT2S.js} +2 -2
- package/dist/{chunk-WYZ4OUON.js → chunk-QCZHYO5M.js} +1 -1
- package/dist/{chunk-I6QFPSUU.js → chunk-QDILCQBL.js} +9 -9
- package/dist/{chunk-WK3N3Y7V.js → chunk-SCTVADDL.js} +2 -2
- package/dist/{chunk-QXMIKDOL.js → chunk-SNRE3ZVZ.js} +3 -3
- package/dist/{chunk-WBC5B3JD.js → chunk-TT4JZDKM.js} +3 -3
- package/dist/{chunk-5ZCY36TY.js → chunk-U7Y3QG3A.js} +1 -1
- package/dist/{chunk-3G7YABRA.js → chunk-W7OPEMGJ.js} +4 -1
- package/dist/{chunk-XWIRU6UT.js → chunk-WBUG7XRL.js} +2 -2
- package/dist/{chunk-ZM2FNWIQ.js → chunk-WSOZ3FQN.js} +1 -1
- package/dist/chunk-X4IJS7LV.js +319 -0
- package/dist/{chunk-JIH32RH2.js → chunk-XA7Q2VQA.js} +1 -1
- package/dist/{chunk-GWP2VBFH.js → chunk-XLAXYPTK.js} +3 -3
- package/dist/client/index.js +4 -16
- package/dist/fleet/index.js +6 -6
- package/dist/forms/index.js +9 -325
- package/dist/forms/server.js +2 -2
- package/dist/images/index.js +4 -4
- package/dist/index.js +1 -1
- package/dist/layout/client.js +9 -9
- package/dist/layout/index.js +10 -10
- package/dist/llms/index.js +8 -8
- package/dist/maps/index.js +4 -4
- package/dist/mcp/sonor.d.ts +42 -3
- package/dist/mcp/sonor.js +25 -20
- package/dist/mcp/transport.d.ts +1 -1
- package/dist/press-kit/articles/Article.d.ts +89 -0
- package/dist/press-kit/articles/ArticleFAQ.d.ts +41 -0
- package/dist/press-kit/articles/ArticleFaqSection.d.ts +2 -0
- package/dist/press-kit/articles/ArticleList.d.ts +79 -0
- package/dist/press-kit/articles/ArticleViewTracker.d.ts +15 -0
- package/dist/press-kit/articles/AuthorCard.d.ts +10 -0
- package/dist/press-kit/articles/AuthorPage.d.ts +8 -0
- package/dist/press-kit/articles/ClusterLandingPage.d.ts +40 -0
- package/dist/press-kit/articles/ClusterNavigation.d.ts +37 -0
- package/dist/press-kit/articles/ManagedNewsletterForm.d.ts +12 -0
- package/dist/press-kit/articles/NewsletterShell.d.ts +17 -0
- package/dist/press-kit/articles/NewsletterWidget.d.ts +30 -0
- package/dist/press-kit/articles/PublicationLayout.d.ts +67 -0
- package/dist/press-kit/articles/PublicationSidebar.d.ts +36 -0
- package/dist/press-kit/articles/RelatedPosts.d.ts +22 -0
- package/dist/press-kit/articles/ServiceCallout.d.ts +56 -0
- package/dist/press-kit/articles/TableOfContents.d.ts +6 -0
- package/dist/press-kit/articles/article-photos.d.ts +9 -0
- package/dist/press-kit/articles/article-styles.d.ts +21 -0
- package/dist/press-kit/articles/article-tables.d.ts +12 -0
- package/dist/press-kit/articles/artwork.d.ts +13 -0
- package/dist/press-kit/articles/author-schema.d.ts +72 -0
- package/dist/press-kit/articles/author-social.d.ts +14 -0
- package/dist/press-kit/articles/excerpt.d.ts +17 -0
- package/dist/press-kit/articles/index.d.ts +79 -0
- package/dist/press-kit/articles/news-sitemap.d.ts +46 -0
- package/dist/press-kit/articles/processArticleHtml.d.ts +34 -0
- package/dist/press-kit/articles/public-reads.d.ts +26 -0
- package/dist/press-kit/articles/reading-time.d.ts +9 -0
- package/dist/press-kit/articles/routes.d.ts +52 -0
- package/dist/press-kit/articles/server-core.d.ts +461 -0
- package/dist/press-kit/articles/server-ui.d.ts +31 -0
- package/dist/press-kit/articles/types.d.ts +316 -0
- package/dist/press-kit/articles/widget-styles.d.ts +8 -0
- package/dist/reputation/index.js +3 -3
- package/dist/reputation/server.js +2 -2
- package/dist/revalidate/index.js +2 -2
- package/dist/runtime/index.js +5 -4
- package/dist/seo/client.js +6 -6
- package/dist/seo/index.js +7 -7
- package/dist/seo/llms.js +8 -8
- package/dist/seo/register-sitemap-cli.js +1 -1
- package/dist/seo/sitemap.js +6 -6
- package/dist/server/index.js +3 -2
- package/dist/shared/build-entries.d.ts +2 -1
- package/dist/shared/clientApiConfig.d.ts +2 -0
- package/dist/shared/import-specifiers.d.ts +1 -1
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.js +8 -0
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +6 -6
- package/dist/sync/index.js +6 -6
- package/dist/website/images.js +4 -4
- package/dist/website/index.js +7 -7
- package/dist/website/popups.js +6 -6
- package/dist/{writeLLMsTxt-DGKLYXIW.js → writeLLMsTxt-VKHCM5IS.js} +5 -5
- package/docs/MIGRATING-TO-PRESS-KIT.md +83 -0
- package/docs.json +145 -29
- package/package.json +15 -5
- package/src/articles/README.md +5 -360
- package/src/mcp/README.md +16 -0
- package/src/og/README.md +1 -1
- package/src/runtime/README.md +4 -0
- package/dist/SiteChat-JSHPGAE3.js +0 -6
- package/dist/SiteDesignReporter-L2JBAKKK.js +0 -12
- package/dist/SitemapSync-VV2YSMIW.js +0 -9
- package/dist/article-tables-AXSZOGNW.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { freshFetch } from './chunk-UAYAJPEP.js';
|
|
2
2
|
import { LLM_GEO_CONTRACT_VERSION } from './chunk-NZ4RXN3G.js';
|
|
3
3
|
import { withSiteParam } from './chunk-MJP63SSS.js';
|
|
4
|
-
import { getClientApiConfig } from './chunk-
|
|
4
|
+
import { getClientApiConfig } from './chunk-W7OPEMGJ.js';
|
|
5
5
|
import { cache } from 'react';
|
|
6
6
|
|
|
7
7
|
function getApiConfig() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { countStageViews, countStageQuestions, useFieldControls } from './chunk-
|
|
3
|
-
import { useFormLoadedAt, useFormTracking, submitForm, useRecaptchaWarmup, useForm } from './chunk-
|
|
2
|
+
import { countStageViews, countStageQuestions, useFieldControls } from './chunk-DPSNMOMZ.js';
|
|
3
|
+
import { useFormLoadedAt, useFormTracking, submitForm, useRecaptchaWarmup, useForm } from './chunk-MQ4REMTH.js';
|
|
4
4
|
import { readAgentSubmit, formToolAttributes } from './chunk-Q6E4OPGG.js';
|
|
5
5
|
import { isFieldVisible, validateField, isFieldComplete, isDisplayOnly, unseenControlValues } from './chunk-C2FZBUSS.js';
|
|
6
6
|
import { HoneypotField } from './chunk-DXO6SBMD.js';
|
|
@@ -63,7 +63,7 @@ function FormClient({
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
let cancelled = false;
|
|
66
|
-
const load = resolvedExperience === "stage" ? import('./FormStage-
|
|
66
|
+
const load = resolvedExperience === "stage" ? import('./FormStage-RC3WHHXP.js').then((m) => m.FormStage) : import('./FormSpotlight-JFH2ENKQ.js').then((m) => m.FormSpotlight);
|
|
67
67
|
load.then((Component) => {
|
|
68
68
|
if (!cancelled) setExperience(() => Component);
|
|
69
69
|
}).catch((err) => {
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
2
|
+
export { SiteKitCredential } from '../chunk-IEGDPRQB.js';
|
|
3
|
+
import '../chunk-U7Y3QG3A.js';
|
|
3
4
|
export { VISUAL_VIEWPORT_GAP_PROPERTY, VisualViewportGap, useVisualViewportGap } from '../chunk-6T6CQVNL.js';
|
|
4
5
|
export { useDeferredActivation } from '../chunk-YC7ELZS3.js';
|
|
5
6
|
import '../chunk-FESKKJAS.js';
|
|
@@ -8,19 +9,6 @@ export { trackConversion, trackEvent } from '../chunk-LCDVPAMR.js';
|
|
|
8
9
|
export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity } from '../chunk-ZKADJNR2.js';
|
|
9
10
|
import '../chunk-5TM3WPCI.js';
|
|
10
11
|
import '../chunk-GJWI74ZZ.js';
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-C4AFNZT2.js';
|
|
13
|
+
import '../chunk-C2UROFGZ.js';
|
|
13
14
|
import '../chunk-PKBMQBKP.js';
|
|
14
|
-
|
|
15
|
-
// src/client/SiteKitCredential.tsx
|
|
16
|
-
function SiteKitCredential({
|
|
17
|
-
apiKey,
|
|
18
|
-
apiUrl,
|
|
19
|
-
site,
|
|
20
|
-
debug
|
|
21
|
-
}) {
|
|
22
|
-
publishSiteCredential({ apiKey, apiUrl, site, debug });
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { SiteKitCredential };
|
package/dist/fleet/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-
|
|
2
|
+
export { FLEET_HEARTBEAT_PATH, FleetHeartbeat, detectNextVersion, sendFleetHeartbeat } from '../chunk-LPKKSYKX.js';
|
|
3
3
|
export { FLEET_CONTRACT_VERSION, FLEET_MODULES, FLEET_MODULES_MAX, FLEET_SITE_MAX_LENGTH, FLEET_VERSION_MAX_LENGTH, FLEET_VERSION_PATTERN, buildFleetHeartbeatPayload, isFleetModule, normalizeFleetModules, normalizeFleetSite, sanitizeFleetVersion } from '../chunk-ZTZQPYP6.js';
|
|
4
4
|
import '../chunk-YC7ELZS3.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-JO76F5WP.js';
|
|
6
6
|
import '../chunk-EKBEOXTH.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-OIWFXUVD.js';
|
|
8
|
+
import '../chunk-C4AFNZT2.js';
|
|
9
|
+
import '../chunk-W7OPEMGJ.js';
|
|
10
|
+
import '../chunk-C2UROFGZ.js';
|
|
11
11
|
import '../chunk-PKBMQBKP.js';
|
package/dist/forms/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export {
|
|
2
|
+
export { configureFormsApi, defineForm, field, formsApi, initializeForms } from '../chunk-X4IJS7LV.js';
|
|
3
|
+
export { FormClient, ManagedForm } from '../chunk-XLAXYPTK.js';
|
|
4
|
+
import '../chunk-DPSNMOMZ.js';
|
|
3
5
|
export { DatePicker } from '../chunk-SOD2F6C2.js';
|
|
4
6
|
export { FormCelebration } from '../chunk-YGGDU6C3.js';
|
|
5
|
-
|
|
6
|
-
export { useForm, useFormTracking } from '../chunk-YBAFUM3Z.js';
|
|
7
|
+
export { useForm, useFormTracking } from '../chunk-MQ4REMTH.js';
|
|
7
8
|
import '../chunk-Q6E4OPGG.js';
|
|
8
9
|
import '../chunk-5ROTTMBL.js';
|
|
9
|
-
export { FormEnhancer } from '../chunk-
|
|
10
|
+
export { FormEnhancer } from '../chunk-5RYSTKVU.js';
|
|
10
11
|
import '../chunk-C2FZBUSS.js';
|
|
11
12
|
import '../chunk-YC7ELZS3.js';
|
|
12
13
|
import '../chunk-DXO6SBMD.js';
|
|
@@ -17,325 +18,8 @@ import '../chunk-NJCTQH2P.js';
|
|
|
17
18
|
import '../chunk-L2V5PUFN.js';
|
|
18
19
|
import '../chunk-5TM3WPCI.js';
|
|
19
20
|
import '../chunk-GJWI74ZZ.js';
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import '../chunk-
|
|
23
|
-
import '../chunk-
|
|
21
|
+
import '../chunk-OIWFXUVD.js';
|
|
22
|
+
import '../chunk-C4AFNZT2.js';
|
|
23
|
+
import '../chunk-W7OPEMGJ.js';
|
|
24
|
+
import '../chunk-C2UROFGZ.js';
|
|
24
25
|
import '../chunk-PKBMQBKP.js';
|
|
25
|
-
|
|
26
|
-
// src/forms/formsApi.ts
|
|
27
|
-
var config = null;
|
|
28
|
-
function configureFormsApi(options) {
|
|
29
|
-
config = options;
|
|
30
|
-
}
|
|
31
|
-
function getConfig() {
|
|
32
|
-
if (config) return config;
|
|
33
|
-
const { apiUrl, apiKey } = readPublishedApiConfig();
|
|
34
|
-
if (apiUrl && apiKey) {
|
|
35
|
-
return { baseUrl: apiUrl, apiKey };
|
|
36
|
-
}
|
|
37
|
-
throw new Error(
|
|
38
|
-
"Forms API not configured. Use SiteKitLayout in your root layout or call configureFormsApi() first."
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
async function apiRequest(method, path, body) {
|
|
42
|
-
const { baseUrl, apiKey, getAuthToken } = getConfig();
|
|
43
|
-
const headers = {
|
|
44
|
-
"Content-Type": "application/json"
|
|
45
|
-
};
|
|
46
|
-
if (apiKey) {
|
|
47
|
-
headers["x-api-key"] = apiKey;
|
|
48
|
-
} else if (getAuthToken) {
|
|
49
|
-
const token = await getAuthToken();
|
|
50
|
-
headers["Authorization"] = `Bearer ${token}`;
|
|
51
|
-
}
|
|
52
|
-
const response = await sonorFetch(`${baseUrl}${path}`, {
|
|
53
|
-
method,
|
|
54
|
-
headers,
|
|
55
|
-
body: body ? JSON.stringify(body) : void 0
|
|
56
|
-
}, { retries: 0 });
|
|
57
|
-
if (!response.ok) {
|
|
58
|
-
const error = await response.json().catch(() => ({ message: response.statusText }));
|
|
59
|
-
throw new Error(error.message || `API error: ${response.status}`);
|
|
60
|
-
}
|
|
61
|
-
if (response.status === 204) {
|
|
62
|
-
return void 0;
|
|
63
|
-
}
|
|
64
|
-
return response.json();
|
|
65
|
-
}
|
|
66
|
-
var formsApi = {
|
|
67
|
-
/**
|
|
68
|
-
* List all forms for a project
|
|
69
|
-
*/
|
|
70
|
-
async list(options = {}) {
|
|
71
|
-
const params = new URLSearchParams();
|
|
72
|
-
if (options.projectId) params.set("projectId", options.projectId);
|
|
73
|
-
if (options.formType) params.set("formType", options.formType);
|
|
74
|
-
if (options.isActive !== void 0) params.set("isActive", String(options.isActive));
|
|
75
|
-
if (options.search) params.set("search", options.search);
|
|
76
|
-
const query = params.toString();
|
|
77
|
-
const result = await apiRequest("GET", `/forms${query ? `?${query}` : ""}`);
|
|
78
|
-
return result.data;
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* Get a single form by ID or slug
|
|
82
|
-
*/
|
|
83
|
-
async get(idOrSlug) {
|
|
84
|
-
return apiRequest("GET", `/forms/${idOrSlug}`);
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* Create a new form
|
|
88
|
-
*/
|
|
89
|
-
async create(input) {
|
|
90
|
-
return apiRequest("POST", "/forms", input);
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* Update an existing form
|
|
94
|
-
*/
|
|
95
|
-
async update(id, input) {
|
|
96
|
-
return apiRequest("PUT", `/forms/${id}`, input);
|
|
97
|
-
},
|
|
98
|
-
/**
|
|
99
|
-
* Delete a form
|
|
100
|
-
*/
|
|
101
|
-
async delete(id) {
|
|
102
|
-
return apiRequest("DELETE", `/forms/${id}`);
|
|
103
|
-
},
|
|
104
|
-
/**
|
|
105
|
-
* Add a field to an existing form
|
|
106
|
-
*/
|
|
107
|
-
async addField(formId, field2) {
|
|
108
|
-
const form = await formsApi.get(formId);
|
|
109
|
-
const maxSortOrder = Math.max(0, ...(form.fields || []).map((f) => f.sortOrder || 0));
|
|
110
|
-
return formsApi.update(formId, {
|
|
111
|
-
fields: [
|
|
112
|
-
...form.fields || [],
|
|
113
|
-
{ ...field2, sortOrder: field2.sortOrder ?? maxSortOrder + 1 }
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
},
|
|
117
|
-
/**
|
|
118
|
-
* Update a field in an existing form
|
|
119
|
-
*/
|
|
120
|
-
async updateField(formId, fieldSlug, updates) {
|
|
121
|
-
const form = await formsApi.get(formId);
|
|
122
|
-
return formsApi.update(formId, {
|
|
123
|
-
fields: (form.fields || []).map(
|
|
124
|
-
(f) => f.slug === fieldSlug ? { ...f, ...updates } : f
|
|
125
|
-
)
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
/**
|
|
129
|
-
* Remove a field from a form
|
|
130
|
-
*/
|
|
131
|
-
async removeField(formId, fieldSlug) {
|
|
132
|
-
const form = await formsApi.get(formId);
|
|
133
|
-
return formsApi.update(formId, {
|
|
134
|
-
fields: (form.fields || []).filter((f) => f.slug !== fieldSlug)
|
|
135
|
-
});
|
|
136
|
-
},
|
|
137
|
-
/**
|
|
138
|
-
* Reorder fields in a form
|
|
139
|
-
*/
|
|
140
|
-
async reorderFields(formId, fieldSlugs) {
|
|
141
|
-
const form = await formsApi.get(formId);
|
|
142
|
-
const fieldsMap = new Map((form.fields || []).map((f) => [f.slug, f]));
|
|
143
|
-
const orderedFields = fieldSlugs.map((slug, index) => {
|
|
144
|
-
const field2 = fieldsMap.get(slug);
|
|
145
|
-
if (!field2) throw new Error(`Field not found: ${slug}`);
|
|
146
|
-
return { ...field2, sortOrder: index };
|
|
147
|
-
});
|
|
148
|
-
return formsApi.update(formId, { fields: orderedFields });
|
|
149
|
-
},
|
|
150
|
-
/**
|
|
151
|
-
* Clone a form
|
|
152
|
-
*/
|
|
153
|
-
async clone(formId, newSlug, newName) {
|
|
154
|
-
const form = await formsApi.get(formId);
|
|
155
|
-
return formsApi.create({
|
|
156
|
-
projectId: form.projectId,
|
|
157
|
-
slug: newSlug,
|
|
158
|
-
name: newName || `${form.name} (Copy)`,
|
|
159
|
-
description: form.description,
|
|
160
|
-
formType: form.formType,
|
|
161
|
-
successMessage: form.successMessage,
|
|
162
|
-
redirectUrl: form.redirectUrl,
|
|
163
|
-
notificationEmails: form.notificationEmails,
|
|
164
|
-
submitButtonText: form.submitButtonText,
|
|
165
|
-
layout: form.layout,
|
|
166
|
-
showProgress: form.showProgress,
|
|
167
|
-
enableSaveDraft: form.enableSaveDraft,
|
|
168
|
-
isActive: false,
|
|
169
|
-
// Clone as inactive
|
|
170
|
-
fields: (form.fields || []).map(({ id, ...field2 }) => field2),
|
|
171
|
-
// Remove IDs
|
|
172
|
-
steps: (form.steps || []).map(({ id, ...step }) => step)
|
|
173
|
-
// Remove IDs
|
|
174
|
-
});
|
|
175
|
-
},
|
|
176
|
-
/**
|
|
177
|
-
* Activate or deactivate a form
|
|
178
|
-
*/
|
|
179
|
-
async setActive(formId, isActive) {
|
|
180
|
-
return formsApi.update(formId, { isActive });
|
|
181
|
-
},
|
|
182
|
-
/**
|
|
183
|
-
* Sync a form definition to the backend
|
|
184
|
-
* Creates the form if it doesn't exist, updates if it does
|
|
185
|
-
* Perfect for defining forms in code during development
|
|
186
|
-
*
|
|
187
|
-
* @example
|
|
188
|
-
* ```tsx
|
|
189
|
-
* // In your app initialization or form component
|
|
190
|
-
* await formsApi.sync({
|
|
191
|
-
* slug: 'contact',
|
|
192
|
-
* name: 'Contact Form',
|
|
193
|
-
* formType: 'prospect',
|
|
194
|
-
* fields: [
|
|
195
|
-
* field.text('name', 'Your Name', { isRequired: true }),
|
|
196
|
-
* field.email('email', 'Email Address'),
|
|
197
|
-
* field.phone('phone', 'Phone Number'),
|
|
198
|
-
* field.textarea('message', 'Message'),
|
|
199
|
-
* ]
|
|
200
|
-
* })
|
|
201
|
-
* ```
|
|
202
|
-
*/
|
|
203
|
-
async sync(input) {
|
|
204
|
-
return apiRequest(
|
|
205
|
-
"POST",
|
|
206
|
-
"/api/public/forms/sync",
|
|
207
|
-
input
|
|
208
|
-
);
|
|
209
|
-
},
|
|
210
|
-
/**
|
|
211
|
-
* Sync multiple forms at once
|
|
212
|
-
* Useful for initializing all forms in your app
|
|
213
|
-
*
|
|
214
|
-
* Runs sequentially to avoid bursting the API (many hosts throttle concurrent POSTs → 429).
|
|
215
|
-
*/
|
|
216
|
-
async syncAll(forms) {
|
|
217
|
-
const results = [];
|
|
218
|
-
for (const form of forms) {
|
|
219
|
-
results.push(await formsApi.sync(form));
|
|
220
|
-
}
|
|
221
|
-
return results;
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
var field = {
|
|
225
|
-
text: (slug, label, options) => ({
|
|
226
|
-
slug,
|
|
227
|
-
label,
|
|
228
|
-
fieldType: "text",
|
|
229
|
-
...options
|
|
230
|
-
}),
|
|
231
|
-
email: (slug, label, options) => ({
|
|
232
|
-
slug,
|
|
233
|
-
label,
|
|
234
|
-
fieldType: "email",
|
|
235
|
-
isRequired: true,
|
|
236
|
-
...options
|
|
237
|
-
}),
|
|
238
|
-
phone: (slug, label, options) => ({
|
|
239
|
-
slug,
|
|
240
|
-
label,
|
|
241
|
-
fieldType: "phone",
|
|
242
|
-
...options
|
|
243
|
-
}),
|
|
244
|
-
textarea: (slug, label, options) => ({
|
|
245
|
-
slug,
|
|
246
|
-
label,
|
|
247
|
-
fieldType: "textarea",
|
|
248
|
-
...options
|
|
249
|
-
}),
|
|
250
|
-
select: (slug, label, choices, options) => ({
|
|
251
|
-
slug,
|
|
252
|
-
label,
|
|
253
|
-
fieldType: "select",
|
|
254
|
-
options: choices,
|
|
255
|
-
...options
|
|
256
|
-
}),
|
|
257
|
-
radio: (slug, label, choices, options) => ({
|
|
258
|
-
slug,
|
|
259
|
-
label,
|
|
260
|
-
fieldType: "radio",
|
|
261
|
-
options: choices,
|
|
262
|
-
...options
|
|
263
|
-
}),
|
|
264
|
-
checkbox: (slug, label, options) => ({
|
|
265
|
-
slug,
|
|
266
|
-
label,
|
|
267
|
-
fieldType: "checkbox",
|
|
268
|
-
...options
|
|
269
|
-
}),
|
|
270
|
-
date: (slug, label, options) => ({
|
|
271
|
-
slug,
|
|
272
|
-
label,
|
|
273
|
-
fieldType: "date",
|
|
274
|
-
...options
|
|
275
|
-
}),
|
|
276
|
-
number: (slug, label, options) => ({
|
|
277
|
-
slug,
|
|
278
|
-
label,
|
|
279
|
-
fieldType: "number",
|
|
280
|
-
...options
|
|
281
|
-
}),
|
|
282
|
-
rating: (slug, label, options) => ({
|
|
283
|
-
slug,
|
|
284
|
-
label,
|
|
285
|
-
fieldType: "rating",
|
|
286
|
-
...options
|
|
287
|
-
}),
|
|
288
|
-
file: (slug, label, options) => ({
|
|
289
|
-
slug,
|
|
290
|
-
label,
|
|
291
|
-
fieldType: "file",
|
|
292
|
-
...options
|
|
293
|
-
}),
|
|
294
|
-
hidden: (slug, defaultValue) => ({
|
|
295
|
-
slug,
|
|
296
|
-
label: "",
|
|
297
|
-
fieldType: "hidden",
|
|
298
|
-
defaultValue
|
|
299
|
-
}),
|
|
300
|
-
heading: (slug, label) => ({
|
|
301
|
-
slug,
|
|
302
|
-
label,
|
|
303
|
-
fieldType: "heading"
|
|
304
|
-
}),
|
|
305
|
-
paragraph: (slug, label) => ({
|
|
306
|
-
slug,
|
|
307
|
-
label,
|
|
308
|
-
fieldType: "paragraph"
|
|
309
|
-
})
|
|
310
|
-
};
|
|
311
|
-
function defineForm(definition) {
|
|
312
|
-
const fieldsWithOrder = definition.fields.map((f, index) => ({
|
|
313
|
-
...f,
|
|
314
|
-
sortOrder: f.sortOrder ?? index
|
|
315
|
-
}));
|
|
316
|
-
return {
|
|
317
|
-
...definition,
|
|
318
|
-
fields: fieldsWithOrder,
|
|
319
|
-
formType: definition.formType || "contact",
|
|
320
|
-
successMessage: definition.successMessage || "Thank you for your submission!",
|
|
321
|
-
submitButtonText: definition.submitButtonText || "Submit",
|
|
322
|
-
layout: definition.layout || "stacked",
|
|
323
|
-
isActive: definition.isActive ?? true
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
async function initializeForms(forms) {
|
|
327
|
-
if (typeof window === "undefined") {
|
|
328
|
-
console.log(`[Site-Kit] ${forms.length} form(s) ready to sync: ${forms.map((f) => f.slug).join(", ")}`);
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
try {
|
|
332
|
-
const results = await formsApi.syncAll(forms);
|
|
333
|
-
const created = results.filter((r) => r.created).length;
|
|
334
|
-
const updated = results.filter((r) => r.updated).length;
|
|
335
|
-
console.log(`[Site-Kit] Forms synced: ${created} created, ${updated} updated`);
|
|
336
|
-
} catch (error) {
|
|
337
|
-
console.error("[Site-Kit] Failed to sync forms:", error);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export { configureFormsApi, defineForm, field, formsApi, initializeForms };
|
package/dist/forms/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ServerForm, getFormConfig } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ServerForm, getFormConfig } from '../chunk-NA4Z4CQG.js';
|
|
2
|
+
import '../chunk-5RYSTKVU.js';
|
|
3
3
|
import '../chunk-C2FZBUSS.js';
|
|
4
4
|
import '../chunk-YC7ELZS3.js';
|
|
5
5
|
export { StaticForm } from '../chunk-LNSF6BJC.js';
|
package/dist/images/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-
|
|
1
|
+
export { ManagedImage, assignImageToSlot, clearImageSlot, fetchManagedImage, fetchManagedImages, listImageFiles, uploadImage } from '../chunk-3OY52UFM.js';
|
|
2
2
|
export { ManagedFavicon, getManagedFaviconUrl } from '../chunk-GW7GSBO7.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-OIWFXUVD.js';
|
|
4
|
+
import '../chunk-C4AFNZT2.js';
|
|
5
|
+
import '../chunk-C2UROFGZ.js';
|
|
6
6
|
import '../chunk-PKBMQBKP.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SITE_KIT_VERSION } from './chunk-
|
|
1
|
+
export { SITE_KIT_VERSION } from './chunk-C2UROFGZ.js';
|
|
2
2
|
import './chunk-PKBMQBKP.js';
|
package/dist/layout/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { SiteKitClientProviders } from '../chunk-
|
|
2
|
+
export { SiteKitClientProviders } from '../chunk-QDILCQBL.js';
|
|
3
3
|
import '../chunk-6G43IRWR.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-U7Y3QG3A.js';
|
|
5
|
+
import '../chunk-LPKKSYKX.js';
|
|
6
6
|
import '../chunk-ZTZQPYP6.js';
|
|
7
7
|
import '../chunk-YC7ELZS3.js';
|
|
8
8
|
import '../chunk-FESKKJAS.js';
|
|
@@ -10,11 +10,11 @@ import '../chunk-A4CC4ZG3.js';
|
|
|
10
10
|
import '../chunk-ZKADJNR2.js';
|
|
11
11
|
import '../chunk-5TM3WPCI.js';
|
|
12
12
|
import '../chunk-GJWI74ZZ.js';
|
|
13
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-JO76F5WP.js';
|
|
14
14
|
import '../chunk-EKBEOXTH.js';
|
|
15
|
-
import '../chunk-
|
|
16
|
-
import '../chunk-
|
|
17
|
-
import '../chunk-
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
15
|
+
import '../chunk-OIWFXUVD.js';
|
|
16
|
+
import '../chunk-C4AFNZT2.js';
|
|
17
|
+
import '../chunk-W7OPEMGJ.js';
|
|
18
|
+
import '../chunk-C2UROFGZ.js';
|
|
19
|
+
import '../chunk-QCZHYO5M.js';
|
|
20
20
|
import '../chunk-PKBMQBKP.js';
|
package/dist/layout/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SiteKitClientProviders } from '../chunk-
|
|
1
|
+
import { SiteKitClientProviders } from '../chunk-QDILCQBL.js';
|
|
2
2
|
import '../chunk-6G43IRWR.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-U7Y3QG3A.js';
|
|
4
|
+
import '../chunk-LPKKSYKX.js';
|
|
5
5
|
import '../chunk-ZTZQPYP6.js';
|
|
6
6
|
import { ManagedFavicon } from '../chunk-GW7GSBO7.js';
|
|
7
7
|
import '../chunk-YC7ELZS3.js';
|
|
8
|
-
import { resolveClientCredential } from '../chunk-
|
|
8
|
+
import { resolveClientCredential } from '../chunk-WSOZ3FQN.js';
|
|
9
9
|
import '../chunk-UAYAJPEP.js';
|
|
10
10
|
import { ManagedScripts } from '../chunk-MVLMXC44.js';
|
|
11
11
|
import { resolveApiOrigin } from '../chunk-C7TLGL3R.js';
|
|
@@ -15,13 +15,13 @@ import '../chunk-A4CC4ZG3.js';
|
|
|
15
15
|
import '../chunk-ZKADJNR2.js';
|
|
16
16
|
import '../chunk-5TM3WPCI.js';
|
|
17
17
|
import '../chunk-GJWI74ZZ.js';
|
|
18
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-JO76F5WP.js';
|
|
19
19
|
import '../chunk-EKBEOXTH.js';
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-
|
|
22
|
-
import '../chunk-
|
|
23
|
-
import '../chunk-
|
|
24
|
-
import '../chunk-
|
|
20
|
+
import '../chunk-OIWFXUVD.js';
|
|
21
|
+
import '../chunk-C4AFNZT2.js';
|
|
22
|
+
import '../chunk-W7OPEMGJ.js';
|
|
23
|
+
import '../chunk-C2UROFGZ.js';
|
|
24
|
+
import '../chunk-QCZHYO5M.js';
|
|
25
25
|
import '../chunk-PKBMQBKP.js';
|
|
26
26
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
27
27
|
|
package/dist/llms/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { createLLMsFullTxtHandler, createLLMsTxtHandler, formatSourcedFactsSection, llmsResponseHeaders } from '../chunk-
|
|
1
|
+
export { createLLMsFullTxtHandler, createLLMsTxtHandler, formatSourcedFactsSection, llmsResponseHeaders } from '../chunk-2JMCBJM5.js';
|
|
2
2
|
export { buildAiDiscoveryHeaders, wantsLlmsDiscoveryLink } from '../chunk-PO2TRJPY.js';
|
|
3
3
|
export { AI_RETRIEVAL_CRAWLERS, AI_TRAINING_CRAWLERS, buildAiCrawlerRules, createRobotsTxtHandler } from '../chunk-QLTDFUJ7.js';
|
|
4
|
-
export { LEGACY_PUBLICATION_PATH, SEO_REVALIDATION_MAX_BODY_BYTES, SEO_REVALIDATION_MAX_ITEMS, createLlmsRevalidateHandler, createSeoRevalidationHandler, parseSeoRevalidationPayload } from '../chunk-
|
|
4
|
+
export { LEGACY_PUBLICATION_PATH, SEO_REVALIDATION_MAX_BODY_BYTES, SEO_REVALIDATION_MAX_ITEMS, createLlmsRevalidateHandler, createSeoRevalidationHandler, parseSeoRevalidationPayload } from '../chunk-FHUTOXS7.js';
|
|
5
5
|
export { AEOBlock, AEOCitedContent, AEOClaim, AEOComparison, AEODefinition, AEOEntity, AEOProvenanceList, AEOStep, AEOSteps, AEOSummary, DEFAULT_SPEAKABLE_SELECTORS, SpeakableSchema, createSpeakableSchema, getSpeakableSelectorsForPage } from '../chunk-PSAG45YF.js';
|
|
6
6
|
import '../chunk-XTRZGXB2.js';
|
|
7
|
-
export { AGENT_ACCESS_HEADING, appendAgentAccessSection, describesMcp, detectMcpServer, formatAgentAccessSection, generateLLMsFullTxt, generateLLMsTxt, writeLLMsTxtToPublic } from '../chunk-
|
|
8
|
-
export { getBusinessInfo, getFAQItems, getLLMsData, getOptimizedLLMsTxt, getPageSummaries, getServices } from '../chunk-
|
|
9
|
-
import '../chunk-
|
|
10
|
-
import '../chunk-
|
|
7
|
+
export { AGENT_ACCESS_HEADING, appendAgentAccessSection, describesMcp, detectMcpServer, formatAgentAccessSection, generateLLMsFullTxt, generateLLMsTxt, writeLLMsTxtToPublic } from '../chunk-D6ZIQMHB.js';
|
|
8
|
+
export { getBusinessInfo, getFAQItems, getLLMsData, getOptimizedLLMsTxt, getPageSummaries, getServices } from '../chunk-XA7Q2VQA.js';
|
|
9
|
+
import '../chunk-5D7ZISUP.js';
|
|
10
|
+
import '../chunk-4K735O3J.js';
|
|
11
11
|
import '../chunk-UAYAJPEP.js';
|
|
12
12
|
export { LLMS_DISCLAIMER_MAX_LENGTH, LLMS_PUBLIC_SUMMARY_MAX_LENGTH, LLM_GEO_CONTRACT_VERSION, MANAGED_LLM_SCHEMA_KNOWN_KEYS, pickManagedLlmSchemaForJsonLd, sanitizeLlmsDisclaimerLine, sanitizeLlmsPublicSummary, sanitizePrimaryLanguageTag } from '../chunk-NZ4RXN3G.js';
|
|
13
13
|
import '../chunk-4KZ6W3ZH.js';
|
|
@@ -15,6 +15,6 @@ import '../chunk-MJP63SSS.js';
|
|
|
15
15
|
import '../chunk-YVKRYQRG.js';
|
|
16
16
|
import '../chunk-FESKKJAS.js';
|
|
17
17
|
import '../chunk-A4CC4ZG3.js';
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-W7OPEMGJ.js';
|
|
19
|
+
import '../chunk-C2UROFGZ.js';
|
|
20
20
|
import '../chunk-PKBMQBKP.js';
|
package/dist/maps/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { monotonicMs } from '../chunk-MH2DSGC6.js';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
3
|
+
import { sonorFetch } from '../chunk-OIWFXUVD.js';
|
|
4
|
+
import '../chunk-C4AFNZT2.js';
|
|
5
|
+
import { getClientApiConfig } from '../chunk-W7OPEMGJ.js';
|
|
6
|
+
import '../chunk-C2UROFGZ.js';
|
|
7
7
|
import '../chunk-PKBMQBKP.js';
|
|
8
8
|
import { useState, useCallback, useEffect } from 'react';
|
|
9
9
|
import { APIProvider, Map as Map$1, AdvancedMarker, Pin, InfoWindow } from '@vis.gl/react-google-maps';
|
package/dist/mcp/sonor.d.ts
CHANGED
|
@@ -43,6 +43,44 @@ import { type McpServerDefinition } from './protocol';
|
|
|
43
43
|
import type { McpServerInfo, SiteKitMcpTool } from './types';
|
|
44
44
|
export { reportToolCallsToSonor } from './report';
|
|
45
45
|
export type { ReportToolCallsOptions } from './report';
|
|
46
|
+
/** The public fields article tools read. Readers can come from Press Kit or a site's own CMS. */
|
|
47
|
+
export interface McpArticle {
|
|
48
|
+
slug: string;
|
|
49
|
+
title: string;
|
|
50
|
+
excerpt?: string;
|
|
51
|
+
content?: string;
|
|
52
|
+
author?: unknown;
|
|
53
|
+
category?: unknown;
|
|
54
|
+
published_at?: string;
|
|
55
|
+
faq_items?: {
|
|
56
|
+
question: string;
|
|
57
|
+
answer: string;
|
|
58
|
+
}[];
|
|
59
|
+
editorial_photos?: {
|
|
60
|
+
url: string;
|
|
61
|
+
alt: string;
|
|
62
|
+
caption?: string;
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
placement: {
|
|
66
|
+
kind: 'after_intro';
|
|
67
|
+
} | {
|
|
68
|
+
kind: 'after_heading';
|
|
69
|
+
heading: string;
|
|
70
|
+
headingId?: string;
|
|
71
|
+
};
|
|
72
|
+
}[];
|
|
73
|
+
}
|
|
74
|
+
/** Pass getAllArticles and getArticle from @sonordev/press-kit/articles/server. */
|
|
75
|
+
export interface McpArticleReaders {
|
|
76
|
+
readMany: (options: {
|
|
77
|
+
maxPosts: number;
|
|
78
|
+
site?: string;
|
|
79
|
+
}) => Promise<McpArticle[]>;
|
|
80
|
+
readOne: (slug: string, options: {
|
|
81
|
+
site?: string;
|
|
82
|
+
}) => Promise<McpArticle | null>;
|
|
83
|
+
}
|
|
46
84
|
/**
|
|
47
85
|
* One priced thing a business sells, as `list_offerings` reads it. Only the
|
|
48
86
|
* fields the tool uses, so any source of offerings can supply them; the
|
|
@@ -89,10 +127,11 @@ export interface SonorMcpOptions {
|
|
|
89
127
|
siteUrl?: string;
|
|
90
128
|
/** Sub-site host on a multi-site project. Default: resolved from NEXT_PUBLIC_SITE_URL. */
|
|
91
129
|
site?: string;
|
|
92
|
-
/** Articles live under this path
|
|
93
|
-
|
|
130
|
+
/** Articles live under this path. Pass Press Kit's getAllArticles/getArticle as readMany/readOne.
|
|
131
|
+
* Omitting both readers retains the 8.x legacy adapter. false drops article tools. Default '/blog'. */
|
|
132
|
+
articles?: ({
|
|
94
133
|
path?: string;
|
|
95
|
-
} | false;
|
|
134
|
+
} & Partial<McpArticleReaders>) | false;
|
|
96
135
|
/** `false` drops get_reviews (a site with no reviews in Sonor). */
|
|
97
136
|
reviews?: boolean;
|
|
98
137
|
/**
|