create-ailk 0.16.0 → 0.18.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.
Files changed (42) hide show
  1. package/dist/lib/env-catalog.js +5 -9
  2. package/dist/spoke-checkout.d.ts +27 -2
  3. package/dist/spoke-checkout.js +207 -4
  4. package/dist/topology.d.ts +8 -0
  5. package/dist/topology.js +29 -5
  6. package/package.json +3 -3
  7. package/templates/apps/mcp/CLAUDE.md +51 -5
  8. package/templates/apps/mcp/__tests__/app-entry.test.ts +325 -0
  9. package/templates/apps/mcp/__tests__/boot.test.ts +203 -0
  10. package/templates/apps/mcp/__tests__/index.test.ts +86 -47
  11. package/templates/apps/mcp/__tests__/lib/content-adapter.test.ts +5 -6
  12. package/templates/apps/mcp/__tests__/lib/content-root.test.ts +93 -0
  13. package/templates/apps/mcp/__tests__/server.test.ts +63 -6
  14. package/templates/apps/mcp/src/app.ts +32 -0
  15. package/templates/apps/mcp/src/boot.ts +185 -0
  16. package/templates/apps/mcp/src/http-transport.ts +39 -15
  17. package/templates/apps/mcp/src/index.ts +17 -126
  18. package/templates/apps/mcp/src/lib/audit-single-page.ts +7 -6
  19. package/templates/apps/mcp/src/lib/content-adapter.ts +34 -5
  20. package/templates/apps/mcp/src/lib/topology.generated.ts +3 -0
  21. package/templates/apps/mcp/src/server.ts +10 -2
  22. package/templates/apps/mcp/src/serverless-app.ts +88 -0
  23. package/templates/apps/mcp/src/tools/get_business_hours.ts +6 -5
  24. package/templates/apps/mcp/src/tools/get_faq.ts +6 -5
  25. package/templates/apps/mcp/src/tools/get_locations.ts +6 -5
  26. package/templates/apps/mcp/src/tools/get_offerings.ts +6 -5
  27. package/templates/apps/mcp/src/tools/get_pricing.ts +6 -5
  28. package/templates/apps/mcp/src/tools/get_site_info.ts +6 -5
  29. package/templates/apps/mcp/src/tools/list_pages.ts +8 -7
  30. package/templates/apps/mcp/src/tools/read_content.ts +7 -7
  31. package/templates/apps/mcp/src/tools/search_content.ts +6 -5
  32. package/templates/apps/mcp/tsconfig.json +2 -0
  33. package/templates/apps/web/app/.well-known/mcp.json/build-manifest.ts +16 -4
  34. package/templates/apps/web/app/.well-known/mcp.json/route.ts +3 -0
  35. package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +18 -4
  36. package/templates/apps/web/app/openapi.json/__tests__/route.test.ts +46 -28
  37. package/templates/apps/web/lib/__tests__/relay.test.ts +13 -7
  38. package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -28
  39. package/templates/apps/web/lib/__tests__/site-brand.test.ts +42 -0
  40. package/templates/apps/web/lib/site-brand.tsx +22 -6
  41. package/templates/apps/web/lib/topology.generated.ts +3 -0
  42. package/versions.json +1 -1
@@ -36,6 +36,12 @@ import { parse as parseYaml } from "yaml";
36
36
  export const FALLBACK_SITE_NAME = "My Site";
37
37
  /** Neutral, non-vendor fallback — see module doc comment point 3. */
38
38
  export const FALLBACK_BASE_URL = "https://example.com";
39
+ /**
40
+ * Neutral fallback for the site description (#8057) — says what the site
41
+ * exposes to agents without naming the template or any vendor.
42
+ */
43
+ export const FALLBACK_SITE_DESCRIPTION =
44
+ "A website with an HTTP API and an MCP server for AI agents.";
39
45
 
40
46
  const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---/;
41
47
 
@@ -49,6 +55,8 @@ interface SiteFrontmatter {
49
55
  logomark?: unknown;
50
56
  /** `siteIdentity.legalName`, when declared as a non-empty string. */
51
57
  legalName?: string | undefined;
58
+ /** `siteIdentity.description`, when declared as a non-empty string. */
59
+ description?: string | undefined;
52
60
  }
53
61
 
54
62
  /**
@@ -90,15 +98,15 @@ function readSiteFrontmatter(): SiteFrontmatter | null {
90
98
  string,
91
99
  unknown
92
100
  >;
93
- const legalName =
101
+ const identity =
94
102
  siteIdentity && typeof siteIdentity === "object"
95
- ? (siteIdentity as Record<string, unknown>).legalName
103
+ ? (siteIdentity as Record<string, unknown>)
96
104
  : undefined;
105
+ const nonEmpty = (v: unknown): string | undefined =>
106
+ typeof v === "string" && v.trim().length > 0 ? v.trim() : undefined;
97
107
  return {
98
- legalName:
99
- typeof legalName === "string" && legalName.trim().length > 0
100
- ? legalName.trim()
101
- : undefined,
108
+ legalName: nonEmpty(identity?.legalName),
109
+ description: nonEmpty(identity?.description),
102
110
  siteName: typeof siteName === "string" ? siteName : undefined,
103
111
  baseUrl: typeof baseUrl === "string" ? baseUrl : undefined,
104
112
  logomark:
@@ -125,6 +133,14 @@ export const SITE_NAME =
125
133
  export const SITE_BASE_URL =
126
134
  process.env.NEXT_PUBLIC_BASE_URL ?? siteFrontmatter?.baseUrl ?? FALLBACK_BASE_URL;
127
135
 
136
+ /**
137
+ * The site's own description (#8057): `siteIdentity.description` from
138
+ * `_site.mdx`, else a neutral fallback that never names the template. Surfaced
139
+ * to agents by `/.well-known/mcp.json`.
140
+ */
141
+ export const SITE_DESCRIPTION =
142
+ siteFrontmatter?.description ?? FALLBACK_SITE_DESCRIPTION;
143
+
128
144
  /**
129
145
  * The footer copyright holder (#7796): `siteIdentity.legalName` when the site
130
146
  * declares one (schema.org's `Organization.legalName` — the owning entity,
@@ -5,8 +5,11 @@
5
5
  // A spoke (`--topology spoke`) has no database of its own: by default it
6
6
  // has no sign-in, so its render reads no session and imports nothing; with
7
7
  // `--hub-sign-in` (#7894) it reads the sealed hub-session cookie.
8
+ // UNSERVED_MCP_TOOLS names the MCP tools /.well-known/mcp.json leaves out
9
+ // on this topology (#8070).
8
10
 
9
11
  export const TOPOLOGY: "hub" | "spoke" = "hub";
12
+ export const UNSERVED_MCP_TOOLS: readonly string[] = [];
10
13
  export const SIGN_IN_ENABLED: boolean = true;
11
14
  export const SIGN_IN_PROVIDER: "site" | "hub" | "none" = "site";
12
15
  export const SIGN_IN_PATH: string | null = "/sign-in";
package/versions.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "@working-theory/schema-validator": "0.38.0",
30
30
  "@working-theory/sections-registry": "0.38.0",
31
31
  "@working-theory/site-config": "0.38.0",
32
- "@working-theory/spoke-checkout": "0.3.0",
32
+ "@working-theory/spoke-checkout": "0.4.0",
33
33
  "@working-theory/stripe-client": "0.38.0",
34
34
  "@working-theory/templates": "0.38.0",
35
35
  "@working-theory/theme": "0.38.0",