create-ailk 0.46.6 → 0.48.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/README.md +180 -43
- package/component-catalog.json +223 -285
- package/component-catalog.md +1 -1
- package/dist/apply-design.d.ts +26 -68
- package/dist/apply-design.js +150 -322
- package/dist/cli.js +152 -17
- package/dist/compare-chrome.d.ts +108 -0
- package/dist/compare-chrome.js +481 -0
- package/dist/compare-look.d.ts +94 -0
- package/dist/compare-look.js +378 -0
- package/dist/copy.js +1 -1
- package/dist/design-compile.d.ts +17 -21
- package/dist/design-compile.js +32 -56
- package/dist/design-files.d.ts +93 -0
- package/dist/design-files.js +312 -0
- package/dist/design-home.d.ts +4 -2
- package/dist/design-home.js +88 -6
- package/dist/design-names.d.ts +13 -0
- package/dist/design-names.js +76 -0
- package/dist/design-package.d.ts +46 -56
- package/dist/design-package.js +285 -288
- package/dist/design-presets.d.ts +41 -0
- package/dist/design-presets.js +83 -4
- package/dist/design-scaffold.d.ts +12 -2
- package/dist/design-scaffold.js +72 -34
- package/dist/generated/design-settings.d.ts +56 -0
- package/dist/generated/design-settings.js +237 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/inventory.d.ts +3 -2
- package/dist/inventory.js +10 -4
- package/dist/lib/design-checks.d.ts +46 -0
- package/dist/lib/design-checks.js +79 -1
- package/dist/lib/env-catalog.js +5 -1
- package/dist/lib/module-license-gate.d.ts +1 -1
- package/dist/lib/module-license-gate.js +1 -1
- package/dist/lib/render-verdict.d.ts +13 -1
- package/dist/lib/render-verdict.js +41 -1
- package/dist/look-hub.d.ts +44 -0
- package/dist/look-hub.js +130 -0
- package/dist/look-record.d.ts +35 -0
- package/dist/look-record.js +85 -0
- package/dist/look-samples.d.ts +66 -0
- package/dist/look-samples.js +456 -0
- package/dist/look-settings.d.ts +53 -0
- package/dist/look-settings.js +363 -0
- package/dist/module-architecture.js +12 -0
- package/dist/parse-args.d.ts +10 -6
- package/dist/parse-args.js +26 -13
- package/dist/programmatic.d.ts +1 -19
- package/dist/programmatic.js +65 -103
- package/dist/retired-design-bodies.d.ts +29 -0
- package/dist/retired-design-bodies.js +51 -0
- package/dist/seed-flows.d.ts +1 -1
- package/dist/seed-flows.js +12 -14
- package/dist/seed-workspace.d.ts +4 -1
- package/dist/seed-workspace.js +139 -17
- package/dist/site-chrome.d.ts +41 -41
- package/dist/site-chrome.js +50 -70
- package/dist/site-fonts.d.ts +10 -14
- package/dist/site-fonts.js +5 -1
- package/dist/starter-grid.d.ts +2 -2
- package/dist/strip-look-copies.d.ts +67 -0
- package/dist/strip-look-copies.js +591 -0
- package/dist/template-manifest.d.ts +6 -14
- package/dist/template-manifest.js +0 -9
- package/dist/template-record.d.ts +3 -1
- package/dist/template-record.js +3 -1
- package/dist/topology.d.ts +15 -0
- package/dist/topology.js +60 -0
- package/dist/update.d.ts +57 -1
- package/dist/update.js +742 -13
- package/package.json +3 -4
- package/site-templates/aliases/hub.TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/designs/minimalism/DESIGN.md +163 -297
- package/site-templates/designs/minimalism/LOOK.md +42 -0
- package/site-templates/designs/minimalism/design.yaml +167 -0
- package/site-templates/designs/standard/DESIGN.md +145 -149
- package/site-templates/designs/standard/LOOK.md +42 -0
- package/site-templates/designs/standard/design.yaml +72 -0
- package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +2 -31
- package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +1 -25
- package/site-templates/shapes/person-service/content/_site.mdx +0 -26
- package/templates/.claude/rules/extending.md +3 -2
- package/templates/.env.example +11 -4
- package/templates/CLAUDE.md +1 -1
- package/templates/DESIGN.md +145 -149
- package/templates/README.md +15 -16
- package/templates/apps/api/.env.example +29 -4
- package/templates/apps/api/CLAUDE.md +7 -4
- package/templates/apps/api/src/__tests__/vercel-handler.test.ts +176 -2
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +30 -4
- package/templates/apps/api/src/vercel-handler.ts +32 -2
- package/templates/apps/mcp/.env.example +8 -0
- package/templates/apps/mcp/CLAUDE.md +5 -3
- package/templates/apps/web/.env.example +10 -3
- package/templates/apps/web/CLAUDE.md +31 -4
- package/templates/apps/web/app/[locale]/layout.tsx +141 -77
- package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +13 -3
- package/templates/apps/web/app/not-found.tsx +11 -11
- package/templates/apps/web/auth.ts +48 -35
- package/templates/apps/web/jest.config.cjs +5 -0
- package/templates/apps/web/lib/__tests__/hub-site-config.test.ts +542 -10
- package/templates/apps/web/lib/__tests__/library-fonts.test.ts +35 -0
- package/templates/apps/web/lib/__tests__/page-chrome-navigation.test.ts +233 -0
- package/templates/apps/web/lib/__tests__/page-chrome.test.ts +123 -26
- package/templates/apps/web/lib/__tests__/section-look.test.ts +150 -0
- package/templates/apps/web/lib/__tests__/site-identity-feature-list.test.ts +19 -1
- package/templates/apps/web/lib/__tests__/site-navigation.test.ts +288 -0
- package/templates/apps/web/lib/__tests__/site-theme.test.ts +81 -289
- package/templates/apps/web/lib/deck-page.ts +3 -10
- package/templates/apps/web/lib/deploy-fonts.ts +12 -0
- package/templates/apps/web/lib/hub-site-config.ts +237 -29
- package/templates/apps/web/lib/library-fonts.ts +41 -0
- package/templates/apps/web/lib/mcp-oauth.ts +11 -4
- package/templates/apps/web/lib/page-chrome.ts +105 -20
- package/templates/apps/web/lib/section-look.ts +28 -0
- package/templates/apps/web/lib/site-design.ts +205 -0
- package/templates/apps/web/lib/site-navigation.ts +208 -0
- package/templates/apps/web/lib/site-theme-head.ts +98 -13
- package/templates/apps/web/lib/site-theme.ts +40 -62
- package/templates/apps/web/messages/en.json +0 -6
- package/templates/apps/web/next.config.mjs +213 -11
- package/templates/apps/web/package.json +2 -0
- package/templates/apps/web/site-pages.config.tsx +4 -2
- package/templates/content/_site.mdx +0 -26
- package/templates/design.yaml +75 -0
- package/templates/project.yaml +14 -0
- package/versions.json +52 -51
- package/site-templates/marketing-site/DESIGN.md +0 -259
- package/site-templates/marketing-site-free/DESIGN.md +0 -259
- package/site-templates/saas-product/DESIGN.md +0 -259
- package/templates/apps/web/lib/__tests__/deck-page.test.ts +0 -288
- package/templates/apps/web/lib/__tests__/site-theme-head.test.ts +0 -70
- package/templates/apps/web/lib/site-chrome.ts +0 -46
- package/templates/apps/web/lib/site-fonts.ts +0 -15
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { sealMcpCallbacks } from "@working-theory/auth/mcp-continuation";
|
|
29
29
|
import type { PrismaClient } from "@working-theory/database";
|
|
30
|
-
import { MCP_SCOPES } from "@working-theory/validation";
|
|
30
|
+
import { DEFAULT_MCP_SCOPES, MCP_SCOPES, membershipReaches } from "@working-theory/validation";
|
|
31
31
|
import { type BetterAuthPlugin, betterAuth } from "better-auth";
|
|
32
32
|
import { prismaAdapter } from "better-auth/adapters/prisma";
|
|
33
33
|
import type { AuthMiddleware } from "better-auth/api";
|
|
@@ -265,7 +265,8 @@ export function mcpAuthorizationServer(deps: McpOAuthDeps) {
|
|
|
265
265
|
accessTokenExpiresIn: MCP_ACCESS_TOKEN_TTL_SECONDS,
|
|
266
266
|
refreshTokenExpiresIn: MCP_REFRESH_TOKEN_TTL_SECONDS,
|
|
267
267
|
scopes: [...MCP_SCOPES],
|
|
268
|
-
|
|
268
|
+
// #12470 D3 — a client naming no scope is never given an opt-in one.
|
|
269
|
+
defaultScope: ["offline_access", ...DEFAULT_MCP_SCOPES].join(" "),
|
|
269
270
|
metadata: { scopes_supported: ["offline_access", ...MCP_SCOPES] },
|
|
270
271
|
},
|
|
271
272
|
}),
|
|
@@ -569,6 +570,50 @@ export interface CreateAuthDeps {
|
|
|
569
570
|
prisma?: PrismaClient;
|
|
570
571
|
}
|
|
571
572
|
|
|
573
|
+
/**
|
|
574
|
+
* The person's workspaces for the MCP consent step and token self-check
|
|
575
|
+
* (#10357 D4): `listTenancy`'s rule — every workspace of every organization
|
|
576
|
+
* they belong to that their membership reaches (#12463 D3), with that
|
|
577
|
+
* membership's role. Exported so the consent flow suite drives this read.
|
|
578
|
+
*/
|
|
579
|
+
/**
|
|
580
|
+
* A deactivated membership counts as none (#11106 D6): its organization's
|
|
581
|
+
* workspaces leave the consent list and the token self-check, and return on
|
|
582
|
+
* reactivation.
|
|
583
|
+
*/
|
|
584
|
+
export function readMembershipsFrom(
|
|
585
|
+
prisma: { membership: Pick<PrismaClient["membership"], "findMany"> },
|
|
586
|
+
): (userId: string) => Promise<McpMembership[]> {
|
|
587
|
+
return async (userId) => {
|
|
588
|
+
const memberships = await prisma.membership.findMany({
|
|
589
|
+
where: { userId, deactivatedAt: null },
|
|
590
|
+
select: {
|
|
591
|
+
role: true,
|
|
592
|
+
allWorkspaces: true,
|
|
593
|
+
workspaceGrants: { select: { workspaceId: true } },
|
|
594
|
+
organization: {
|
|
595
|
+
select: {
|
|
596
|
+
name: true,
|
|
597
|
+
workspaces: { select: { id: true, name: true }, orderBy: { createdAt: "asc" } },
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
orderBy: { createdAt: "asc" },
|
|
602
|
+
});
|
|
603
|
+
// #12463 D3 — only the workspaces each membership reaches.
|
|
604
|
+
return memberships.flatMap((m) =>
|
|
605
|
+
m.organization.workspaces
|
|
606
|
+
.filter((w) => membershipReaches(m, w.id))
|
|
607
|
+
.map((w) => ({
|
|
608
|
+
workspaceId: w.id,
|
|
609
|
+
workspaceName: w.name,
|
|
610
|
+
organizationName: m.organization.name,
|
|
611
|
+
role: m.role,
|
|
612
|
+
})),
|
|
613
|
+
);
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
|
|
572
617
|
/**
|
|
573
618
|
* Build a Better Auth instance parameterised by deps.
|
|
574
619
|
*
|
|
@@ -798,39 +843,7 @@ export function createAuth(deps: CreateAuthDeps = {}) {
|
|
|
798
843
|
}
|
|
799
844
|
};
|
|
800
845
|
|
|
801
|
-
|
|
802
|
-
* The person's workspaces for the MCP consent step and token self-check
|
|
803
|
-
* (#10357 D4): `listTenancy`'s rule — every workspace of every organization
|
|
804
|
-
* they belong to, with that membership's role.
|
|
805
|
-
*/
|
|
806
|
-
/**
|
|
807
|
-
* A deactivated membership counts as none (#11106 D6): its organization's
|
|
808
|
-
* workspaces leave the consent list and the token self-check, and return on
|
|
809
|
-
* reactivation.
|
|
810
|
-
*/
|
|
811
|
-
const readMemberships = async (userId: string): Promise<McpMembership[]> => {
|
|
812
|
-
const memberships = await prisma.membership.findMany({
|
|
813
|
-
where: { userId, deactivatedAt: null },
|
|
814
|
-
select: {
|
|
815
|
-
role: true,
|
|
816
|
-
organization: {
|
|
817
|
-
select: {
|
|
818
|
-
name: true,
|
|
819
|
-
workspaces: { select: { id: true, name: true }, orderBy: { createdAt: "asc" } },
|
|
820
|
-
},
|
|
821
|
-
},
|
|
822
|
-
},
|
|
823
|
-
orderBy: { createdAt: "asc" },
|
|
824
|
-
});
|
|
825
|
-
return memberships.flatMap((m) =>
|
|
826
|
-
m.organization.workspaces.map((w) => ({
|
|
827
|
-
workspaceId: w.id,
|
|
828
|
-
workspaceName: w.name,
|
|
829
|
-
organizationName: m.organization.name,
|
|
830
|
-
role: m.role,
|
|
831
|
-
})),
|
|
832
|
-
);
|
|
833
|
-
};
|
|
846
|
+
const readMemberships = readMembershipsFrom(prisma);
|
|
834
847
|
const mcpServer = baseURL ? mcpAuthorizationServer({ readMemberships, clearOutsideSendSwitches }) : [];
|
|
835
848
|
|
|
836
849
|
/** The phone step (#11106 D9); its sign-in and reset paths close with it. */
|
|
@@ -74,6 +74,11 @@ module.exports = {
|
|
|
74
74
|
// Map all *.css to an empty stub — layout.tsx imports ./globals.css (#4090 item 1)
|
|
75
75
|
// and CSS is not parseable by ts-jest's CommonJS transform (apps-paid/marketing-web precedent, #1531).
|
|
76
76
|
"\\.css$": "<rootDir>/__tests__/__mocks__/style-mock.js",
|
|
77
|
+
// next/font is compiled by Next's SWC transform; outside it the loaders
|
|
78
|
+
// are not functions. Next's own jest stub answers `{ className, variable,
|
|
79
|
+
// style }` for any call — `lib/library-fonts.ts` (#12473 D6) and a
|
|
80
|
+
// generated `lib/site-fonts.ts` that sources a face both load through it.
|
|
81
|
+
"^next/font/(.*)$": "next/dist/build/jest/__mocks__/nextFontMock.js",
|
|
77
82
|
"^@working-theory/page-renderer/testing$":
|
|
78
83
|
"<rootDir>/node_modules/@working-theory/page-renderer/dist/testing.js",
|
|
79
84
|
"^@working-theory/page-renderer$":
|