anhedral 0.17.0 → 0.19.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 (174) hide show
  1. package/README.md +33 -68
  2. package/assets/contracts/LICENSE +201 -0
  3. package/assets/contracts/LICENSE.environment +201 -0
  4. package/assets/contracts/LICENSE.operations +201 -0
  5. package/assets/contracts/deployment-provenance.json +15 -0
  6. package/assets/contracts/environment-provenance.json +11 -0
  7. package/assets/contracts/operations-provenance.json +12 -0
  8. package/assets/launch/application.server.ts.txt +13 -0
  9. package/assets/launch/auth-client.ts.txt +4 -0
  10. package/assets/launch/home.tsx.txt +20 -0
  11. package/assets/launch/minimal-application.server.ts.txt +5 -0
  12. package/assets/launch/minimal-server.ts.txt +7 -0
  13. package/assets/launch/oj/OJ.LICENSE +21 -0
  14. package/assets/launch/oj/run.mjs +82 -0
  15. package/assets/launch/oj/runtime.json +21 -0
  16. package/assets/launch/request-context.ts.txt +3 -0
  17. package/assets/launch/root.tsx.txt +26 -0
  18. package/assets/launch/router.tsx.txt +21 -0
  19. package/assets/launch/server.ts.txt +15 -0
  20. package/assets/launch/sign-in.tsx.txt +53 -0
  21. package/assets/launch/styles.css.txt +19 -0
  22. package/assets/security/credential-patterns.d.mts +3 -0
  23. package/assets/security/credential-patterns.mjs +59 -0
  24. package/assets/stack/api-index.ts.txt +6 -1
  25. package/assets/stack/stripe.ts.txt +30 -13
  26. package/assets/ui/catalog.json +36 -324
  27. package/dist/{platforms/web.d.ts → api-proxy.d.ts} +1 -3
  28. package/dist/api-proxy.js +48 -0
  29. package/dist/bin.js +55 -36
  30. package/dist/capability-catalog.d.ts +36 -57
  31. package/dist/capability-catalog.js +65 -67
  32. package/dist/capability-command.d.ts +3 -3
  33. package/dist/capability-command.js +146 -59
  34. package/dist/capability-editor.js +6 -5
  35. package/dist/capability-recipes.js +9 -296
  36. package/dist/cli-arguments.d.ts +2 -0
  37. package/dist/cli-arguments.js +101 -50
  38. package/dist/cli-commands.d.ts +1 -1
  39. package/dist/cli-commands.js +31 -5
  40. package/dist/cli-errors.d.ts +18 -0
  41. package/dist/cli-errors.js +63 -0
  42. package/dist/cli-output.d.ts +22 -0
  43. package/dist/cli-output.js +42 -7
  44. package/dist/command-runner.js +88 -0
  45. package/dist/command-schema.d.ts +16 -0
  46. package/dist/command-schema.js +496 -21
  47. package/dist/command-types.d.ts +1 -0
  48. package/dist/command-types.js +1 -0
  49. package/dist/completion.d.ts +2 -0
  50. package/dist/completion.js +201 -0
  51. package/dist/composition.d.ts +25 -0
  52. package/dist/composition.js +28 -0
  53. package/dist/contracts/cli-transport.d.ts +316 -0
  54. package/dist/contracts/cli-transport.js +236 -0
  55. package/dist/contracts/deployment.d.ts +233 -0
  56. package/dist/contracts/deployment.js +198 -0
  57. package/dist/contracts/environment-file.d.ts +7 -0
  58. package/dist/contracts/environment-file.js +112 -0
  59. package/dist/contracts/environment-transport.d.ts +79 -0
  60. package/dist/contracts/environment-transport.js +110 -0
  61. package/dist/contracts/production-transport.d.ts +71 -0
  62. package/dist/contracts/production-transport.js +56 -0
  63. package/dist/contracts/runtime-logs-transport.d.ts +127 -0
  64. package/dist/contracts/runtime-logs-transport.js +50 -0
  65. package/dist/contracts/source-bundle.d.ts +11 -0
  66. package/dist/contracts/source-bundle.js +197 -0
  67. package/dist/contracts/source-profile.d.ts +4 -0
  68. package/dist/contracts/source-profile.js +5 -0
  69. package/dist/contracts/staging-transport.d.ts +79 -0
  70. package/dist/contracts/staging-transport.js +43 -0
  71. package/dist/dependencies.d.ts +9 -27
  72. package/dist/dependencies.js +19 -66
  73. package/dist/index.d.ts +4 -2
  74. package/dist/index.js +3 -1
  75. package/dist/launch.d.ts +27 -0
  76. package/dist/launch.js +262 -0
  77. package/dist/platform-command.d.ts +9 -0
  78. package/dist/platform-command.js +787 -0
  79. package/dist/platform-environment.d.ts +18 -0
  80. package/dist/platform-environment.js +257 -0
  81. package/dist/platform-operations.d.ts +26 -0
  82. package/dist/platform-operations.js +155 -0
  83. package/dist/platform-production.d.ts +16 -0
  84. package/dist/platform-production.js +135 -0
  85. package/dist/platform-source.d.ts +8 -0
  86. package/dist/platform-source.js +111 -0
  87. package/dist/platform-state.d.ts +15 -0
  88. package/dist/platform-state.js +229 -0
  89. package/dist/platforms/tanstack.d.ts +10 -0
  90. package/dist/platforms/tanstack.js +248 -0
  91. package/dist/registry/usage.d.ts +4 -1
  92. package/dist/registry/usage.js +59 -4
  93. package/dist/scaffold/bootstrap.d.ts +3 -3
  94. package/dist/scaffold/styling.d.ts +3 -2
  95. package/dist/transaction.js +28 -3
  96. package/dist/ui-catalog.d.ts +3 -5
  97. package/dist/ui-catalog.js +8 -24
  98. package/dist/ui-command.d.ts +3 -1
  99. package/dist/ui-command.js +74 -72
  100. package/dist/ui-project.d.ts +4 -2
  101. package/dist/ui-project.js +40 -38
  102. package/dist/util.js +40 -61
  103. package/dist/version.d.ts +1 -1
  104. package/dist/version.js +1 -1
  105. package/docs/capabilities.md +23 -89
  106. package/docs/software-factory.md +208 -9
  107. package/docs/stack-standard.md +7 -17
  108. package/docs/ui.md +9 -22
  109. package/package.json +26 -22
  110. package/assets/stack/ai-schema.ts.txt +0 -5
  111. package/assets/stack/ai.ts.txt +0 -30
  112. package/assets/stack/desktop.rs.txt +0 -21
  113. package/assets/stack/events-schema.ts.txt +0 -12
  114. package/assets/stack/events.ts.txt +0 -59
  115. package/assets/stack/mobile-auth.ts.txt +0 -25
  116. package/assets/stack/mobile-billing.tsx.txt +0 -63
  117. package/assets/stack/mobile-session.tsx.txt +0 -83
  118. package/assets/stack/native-button.tsx.txt +0 -108
  119. package/assets/stack/native-global.css.txt +0 -4
  120. package/assets/stack/native-lib-utils.ts.txt +0 -5
  121. package/assets/stack/native-metro.config.js.txt +0 -6
  122. package/assets/stack/native-nativewind-env.d.ts.txt +0 -1
  123. package/assets/stack/native-tailwind.config.js.txt +0 -73
  124. package/assets/stack/native-text.tsx.txt +0 -89
  125. package/assets/stack/purchases.ts.txt +0 -65
  126. package/assets/stack/revenuecat.ts.txt +0 -88
  127. package/assets/stack/rtc-schema.ts.txt +0 -10
  128. package/assets/stack/rtc.ts.txt +0 -122
  129. package/assets/stack/web-sign-in.tsx.txt +0 -51
  130. package/dist/capabilities.d.ts +0 -11
  131. package/dist/capabilities.js +0 -14
  132. package/dist/dependency-order.d.ts +0 -2
  133. package/dist/dependency-order.js +0 -24
  134. package/dist/platforms/lint.d.ts +0 -1
  135. package/dist/platforms/lint.js +0 -5
  136. package/dist/platforms/web.js +0 -251
  137. package/dist/project-config.d.ts +0 -3
  138. package/dist/project-config.js +0 -16
  139. package/dist/registry/context.d.ts +0 -3
  140. package/dist/registry/context.js +0 -20
  141. package/dist/registry/options.d.ts +0 -2
  142. package/dist/registry/options.js +0 -44
  143. package/dist/registry/resolve.d.ts +0 -11
  144. package/dist/registry/resolve.js +0 -46
  145. package/dist/registry/types.d.ts +0 -60
  146. package/dist/scaffold/api.d.ts +0 -2
  147. package/dist/scaffold/api.js +0 -38
  148. package/dist/scaffold/backend.d.ts +0 -2
  149. package/dist/scaffold/backend.js +0 -36
  150. package/dist/scaffold/compose.d.ts +0 -4
  151. package/dist/scaffold/compose.js +0 -30
  152. package/dist/scaffold/database.d.ts +0 -2
  153. package/dist/scaffold/database.js +0 -41
  154. package/dist/scaffold/documentation.d.ts +0 -2
  155. package/dist/scaffold/documentation.js +0 -71
  156. package/dist/scaffold/environment.d.ts +0 -4
  157. package/dist/scaffold/environment.js +0 -22
  158. package/dist/scaffold/stack-documentation.d.ts +0 -2
  159. package/dist/scaffold/stack-documentation.js +0 -6
  160. package/dist/scaffold/storage.d.ts +0 -2
  161. package/dist/scaffold/storage.js +0 -21
  162. package/dist/scaffold/workspace.d.ts +0 -3
  163. package/dist/scaffold/workspace.js +0 -131
  164. package/dist/stack-registry.d.ts +0 -35
  165. package/dist/stack-registry.js +0 -189
  166. package/dist/standard.d.ts +0 -8
  167. package/dist/standard.js +0 -94
  168. package/dist/workspace-graph.d.ts +0 -7
  169. package/dist/workspace-graph.js +0 -74
  170. package/docs/anhedral-stack.md +0 -12
  171. package/docs/assets/anhedral-stack-light.png +0 -0
  172. package/docs/assets/anhedral-stack.png +0 -0
  173. package/docs/native-ui.md +0 -47
  174. /package/dist/{registry/types.js → command-runner.d.ts} +0 -0
@@ -0,0 +1,197 @@
1
+ import { SOURCE_LIMITS, sourceContainsCredential, uploadExcluded, uploadSecret, } from "./cli-transport.js";
2
+ import { excludedSource as excluded, generatedSource as generated, INVENTORY_PROFILE, secretSource as secret, } from "./source-profile.js";
3
+ const digest = async (value) => {
4
+ const bytes = typeof value === "string" ? new TextEncoder().encode(value) : Uint8Array.from(value);
5
+ return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)), (b) => b.toString(16).padStart(2, "0")).join("");
6
+ };
7
+ export async function readSourceBounded(body, maximum) {
8
+ if (!body)
9
+ throw new Error("Response body is missing.");
10
+ const reader = body.getReader(), chunks = [];
11
+ let size = 0;
12
+ try {
13
+ while (true) {
14
+ const chunk = await reader.read();
15
+ if (chunk.done)
16
+ break;
17
+ size += chunk.value.byteLength;
18
+ if (size > maximum) {
19
+ await reader.cancel();
20
+ throw new Error("Response exceeds its storage limit.");
21
+ }
22
+ chunks.push(chunk.value);
23
+ }
24
+ }
25
+ finally {
26
+ reader.releaseLock();
27
+ }
28
+ const bytes = new Uint8Array(size);
29
+ let offset = 0;
30
+ for (const chunk of chunks) {
31
+ bytes.set(chunk, offset);
32
+ offset += chunk.byteLength;
33
+ }
34
+ return bytes;
35
+ }
36
+ const executableModes = new WeakMap();
37
+ const decoder = new TextDecoder("utf-8", { fatal: true });
38
+ export function sourceFileExcluded(path) {
39
+ return (excluded.test(path) ||
40
+ generated.test(path) ||
41
+ secret.test(path) ||
42
+ uploadExcluded.test(path) ||
43
+ uploadSecret.test(path));
44
+ }
45
+ export function sourceExecutable(files, path) {
46
+ return executableModes.get(files)?.get(path) ?? false;
47
+ }
48
+ export function validateSourcePath(path) {
49
+ if (!path ||
50
+ path.length > 240 ||
51
+ path.startsWith("/") ||
52
+ path.includes("\\") ||
53
+ path.includes("\0") ||
54
+ path.split("/").some((p) => !p || p === "." || p === "..") ||
55
+ excluded.test(path) ||
56
+ generated.test(path) ||
57
+ secret.test(path))
58
+ throw Error("Choose a regular authored source file.");
59
+ return path;
60
+ }
61
+ export async function sourceInventory(files) {
62
+ let total = 0;
63
+ if (files.size > SOURCE_LIMITS.files)
64
+ throw Error("Source file count exceeded.");
65
+ const entries = [];
66
+ for (const [path, bytes] of [...files].sort(([a], [b]) => a.localeCompare(b))) {
67
+ validateSourcePath(path);
68
+ total += bytes.length;
69
+ if (total > SOURCE_LIMITS.bytes)
70
+ throw Error("Source byte limit exceeded.");
71
+ entries.push({
72
+ path,
73
+ size: bytes.length,
74
+ executable: sourceExecutable(files, path),
75
+ digest: await digest(bytes),
76
+ });
77
+ }
78
+ const manifest = JSON.stringify({ schemaVersion: 2, profile: INVENTORY_PROFILE, entries });
79
+ return { manifest, digest: await digest(manifest) };
80
+ }
81
+ export async function packSource(files) {
82
+ await sourceInventory(files);
83
+ const blocks = [];
84
+ const encode = new TextEncoder();
85
+ const add = (name, bytes, mode, kind = "0") => {
86
+ const header = new Uint8Array(512);
87
+ const put = (offset, text) => header.set(encode.encode(text), offset);
88
+ put(0, name);
89
+ put(100, mode.toString(8).padStart(7, "0") + "\0");
90
+ put(108, "0000000\0");
91
+ put(116, "0000000\0");
92
+ put(124, bytes.length.toString(8).padStart(11, "0") + "\0");
93
+ put(136, "00000000000\0");
94
+ header.fill(32, 148, 156);
95
+ put(156, kind);
96
+ put(257, "ustar\0");
97
+ put(263, "00");
98
+ const sum = header.reduce((a, b) => a + b, 0);
99
+ put(148, sum.toString(8).padStart(6, "0") + "\0 ");
100
+ blocks.push(header, bytes, new Uint8Array((512 - (bytes.length % 512)) % 512));
101
+ };
102
+ for (const [path, bytes] of [...files].sort(([a], [b]) => a.localeCompare(b))) {
103
+ const name = `./${path}`;
104
+ if (encode.encode(name).length > 100) {
105
+ add("././@LongLink", encode.encode(name + "\0"), 0o644, "L");
106
+ add("long-source-name", bytes, sourceExecutable(files, path) ? 0o755 : 0o644);
107
+ }
108
+ else
109
+ add(name, bytes, sourceExecutable(files, path) ? 0o755 : 0o644);
110
+ }
111
+ blocks.push(new Uint8Array(1024));
112
+ const stream = new Blob(blocks.map((bytes) => Uint8Array.from(bytes).buffer))
113
+ .stream()
114
+ .pipeThrough(new CompressionStream("gzip"));
115
+ return readSourceBounded(stream, SOURCE_LIMITS.bytes);
116
+ }
117
+ export async function unpackSource(compressed, strict = false) {
118
+ const stream = new Blob([Uint8Array.from(compressed).buffer])
119
+ .stream()
120
+ .pipeThrough(new DecompressionStream("gzip"));
121
+ const bytes = await readSourceBounded(stream, SOURCE_LIMITS.archiveBytes), files = new Map(), modes = new Map();
122
+ let terminated = false;
123
+ const str = (offset, length) => decoder.decode(bytes.subarray(offset, offset + length)).split("\0")[0];
124
+ let count = 0, total = 0, longName = null;
125
+ for (let offset = 0; offset + 512 <= bytes.length;) {
126
+ if (bytes.subarray(offset, offset + 512).every((v) => v === 0)) {
127
+ terminated = true;
128
+ if (strict && bytes.subarray(offset).some((v) => v !== 0))
129
+ throw Error("Trailing archive data.");
130
+ break;
131
+ }
132
+ if (++count > 10000)
133
+ throw new Error("Archive member count exceeded.");
134
+ const checksum = parseInt(str(offset + 148, 8).trim() || "0", 8);
135
+ let actual = 0;
136
+ for (let i = 0; i < 512; i++)
137
+ actual += i >= 148 && i < 156 ? 32 : bytes[offset + i];
138
+ if (actual !== checksum)
139
+ throw new Error("Source archive checksum failed.");
140
+ const size = parseInt(str(offset + 124, 12).trim() || "0", 8), executable = Boolean(parseInt(str(offset + 100, 8).trim() || "0", 8) & 0o111), kind = str(offset + 156, 1), prefix = str(offset + 345, 155);
141
+ if (!Number.isSafeInteger(size) || size < 0 || offset + 512 + size > bytes.length)
142
+ throw new Error("Invalid archive member size.");
143
+ const content = bytes.subarray(offset + 512, offset + 512 + size);
144
+ let name = longName ?? [prefix, str(offset, 100)].filter(Boolean).join("/");
145
+ longName = null;
146
+ offset += 512 + Math.ceil(size / 512) * 512;
147
+ if (kind === "L") {
148
+ longName = decoder.decode(content).split("\0")[0];
149
+ continue;
150
+ }
151
+ if (kind === "x" || kind === "g")
152
+ throw new Error("PAX archives are outside the pinned source format.");
153
+ name = name.replace(/^(?:\.\/)+/, "").replace(/\/$/, "");
154
+ if (!name || name === ".")
155
+ continue;
156
+ if (name.startsWith("/") ||
157
+ name.includes("\\") ||
158
+ name.includes("\0") ||
159
+ name.split("/").some((p) => p === ".." || !p))
160
+ throw new Error("Unsafe archive path.");
161
+ if (secret.test(name))
162
+ throw new Error("Forbidden source secret.");
163
+ if (excluded.test(name) || generated.test(name)) {
164
+ if (strict)
165
+ throw Error("Excluded archive member.");
166
+ continue;
167
+ }
168
+ if (strict &&
169
+ (name.length > 240 ||
170
+ /[\x00-\x1f\x7f]/.test(name) ||
171
+ uploadExcluded.test(name) ||
172
+ uploadSecret.test(name)))
173
+ throw Error("Forbidden upload member.");
174
+ if (kind === "5")
175
+ continue;
176
+ if (kind !== "" && kind !== "0")
177
+ throw new Error("Only regular source files are allowed.");
178
+ if (files.has(name) ||
179
+ files.size >= SOURCE_LIMITS.files ||
180
+ (total += size) > SOURCE_LIMITS.bytes)
181
+ throw new Error("Source inventory exceeds limits or duplicates a path.");
182
+ if (strict && sourceContainsCredential(content))
183
+ throw Error("Credential material is forbidden in source uploads.");
184
+ files.set(name, content);
185
+ modes.set(name, executable);
186
+ }
187
+ if (strict && (!terminated || longName !== null))
188
+ throw Error("Incomplete source archive.");
189
+ executableModes.set(files, modes);
190
+ return files;
191
+ }
192
+ export function setSourceExecutable(files, path, executable) {
193
+ let modes = executableModes.get(files);
194
+ if (!modes)
195
+ executableModes.set(files, (modes = new Map()));
196
+ modes.set(path, executable);
197
+ }
@@ -0,0 +1,4 @@
1
+ export declare const INVENTORY_PROFILE = "anhedral-vinext-source-v2";
2
+ export declare const excludedSource: RegExp;
3
+ export declare const generatedSource: RegExp;
4
+ export declare const secretSource: RegExp;
@@ -0,0 +1,5 @@
1
+ // Shared by trusted Worker source tools and native checkpoint inventory.
2
+ export const INVENTORY_PROFILE = "anhedral-vinext-source-v2";
3
+ export const excludedSource = /(?:^|\/)(?:node_modules|\.git|\.anhedral|\.next|\.turbo|\.wrangler|\.oj-cache|dist|build)(?:\/|$)/;
4
+ export const generatedSource = /^(?:apps\/mobile\/(?:\.expo|\.output)(?:\/|$)|apps\/api\/worker-configuration\.d\.ts$|apps\/web\/\.(?:void|open-next|tanstack)(?:\/|$)|apps\/web\/src\/routeTree\.gen\.ts$|apps\/web\/\.void-wrangler\.jsonc$|apps\/web\/(?:next-env\.d\.ts|worker-configuration\.d\.ts|tsconfig\.tsbuildinfo)$)/;
5
+ export const secretSource = /(?:^|\/)(?:\.env[^/]*|\.dev\.vars[^/]*)(?:\/|$)/;
@@ -0,0 +1,79 @@
1
+ import { z } from "zod";
2
+ export declare const stagingCreateSchema: z.ZodObject<{
3
+ requestId: z.ZodUUID;
4
+ candidateId: z.ZodUUID;
5
+ expectedGeneration: z.ZodNumber;
6
+ }, z.core.$strict>;
7
+ export declare const stagingConfigurationSchema: z.ZodObject<{
8
+ snapshotId: z.ZodUUID;
9
+ digest: z.ZodString;
10
+ environment: z.ZodLiteral<"staging">;
11
+ }, z.core.$strict>;
12
+ export declare const stagingDeploymentSchema: z.ZodObject<{
13
+ id: z.ZodUUID;
14
+ developmentId: z.ZodUUID;
15
+ candidateId: z.ZodUUID;
16
+ generation: z.ZodNumber;
17
+ status: z.ZodEnum<{
18
+ queued: "queued";
19
+ preparing: "preparing";
20
+ ready: "ready";
21
+ failed: "failed";
22
+ superseded: "superseded";
23
+ deployed: "deployed";
24
+ }>;
25
+ summary: z.ZodNullable<z.ZodString>;
26
+ sourceRevision: z.ZodString;
27
+ configuration: z.ZodObject<{
28
+ snapshotId: z.ZodUUID;
29
+ digest: z.ZodString;
30
+ environment: z.ZodLiteral<"staging">;
31
+ }, z.core.$strict>;
32
+ createdAt: z.ZodString;
33
+ updatedAt: z.ZodString;
34
+ }, z.core.$strip>;
35
+ export declare const stagingStateSchema: z.ZodObject<{
36
+ enabled: z.ZodOptional<z.ZodBoolean>;
37
+ canDeploy: z.ZodBoolean;
38
+ generation: z.ZodNumber;
39
+ activeDeploymentId: z.ZodNullable<z.ZodUUID>;
40
+ desiredDeploymentId: z.ZodNullable<z.ZodUUID>;
41
+ deployments: z.ZodArray<z.ZodObject<{
42
+ id: z.ZodUUID;
43
+ developmentId: z.ZodUUID;
44
+ candidateId: z.ZodUUID;
45
+ generation: z.ZodNumber;
46
+ status: z.ZodEnum<{
47
+ queued: "queued";
48
+ preparing: "preparing";
49
+ ready: "ready";
50
+ failed: "failed";
51
+ superseded: "superseded";
52
+ deployed: "deployed";
53
+ }>;
54
+ summary: z.ZodNullable<z.ZodString>;
55
+ sourceRevision: z.ZodString;
56
+ configuration: z.ZodObject<{
57
+ snapshotId: z.ZodUUID;
58
+ digest: z.ZodString;
59
+ environment: z.ZodLiteral<"staging">;
60
+ }, z.core.$strict>;
61
+ createdAt: z.ZodString;
62
+ updatedAt: z.ZodString;
63
+ }, z.core.$strip>>;
64
+ }, z.core.$strip>;
65
+ export type StagingCreate = z.infer<typeof stagingCreateSchema>;
66
+ export type StagingDeployment = z.infer<typeof stagingDeploymentSchema>;
67
+ export type StagingState = z.infer<typeof stagingStateSchema>;
68
+ export declare const stagingCreateReceiptSchema: z.ZodObject<{
69
+ id: z.ZodUUID;
70
+ developmentId: z.ZodUUID;
71
+ candidateId: z.ZodUUID;
72
+ requestId: z.ZodUUID;
73
+ generation: z.ZodNumber;
74
+ configuration: z.ZodObject<{
75
+ snapshotId: z.ZodUUID;
76
+ digest: z.ZodString;
77
+ environment: z.ZodLiteral<"staging">;
78
+ }, z.core.$strict>;
79
+ }, z.core.$strict>;
@@ -0,0 +1,43 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ import { z } from "zod";
3
+ const digest = z.string().regex(/^[a-f0-9]{64}$/);
4
+ export const stagingCreateSchema = z
5
+ .object({
6
+ requestId: z.uuid(),
7
+ candidateId: z.uuid(),
8
+ expectedGeneration: z.number().int().nonnegative(),
9
+ })
10
+ .strict();
11
+ export const stagingConfigurationSchema = z
12
+ .object({ snapshotId: z.uuid(), digest, environment: z.literal("staging") })
13
+ .strict();
14
+ export const stagingDeploymentSchema = z.object({
15
+ id: z.uuid(),
16
+ developmentId: z.uuid(),
17
+ candidateId: z.uuid(),
18
+ generation: z.number().int().positive(),
19
+ status: z.enum(["queued", "preparing", "ready", "deployed", "failed", "superseded"]),
20
+ summary: z.string().max(2000).nullable(),
21
+ sourceRevision: digest,
22
+ configuration: stagingConfigurationSchema,
23
+ createdAt: z.string(),
24
+ updatedAt: z.string(),
25
+ });
26
+ export const stagingStateSchema = z.object({
27
+ enabled: z.boolean().optional(),
28
+ canDeploy: z.boolean(),
29
+ generation: z.number().int().nonnegative(),
30
+ activeDeploymentId: z.uuid().nullable(),
31
+ desiredDeploymentId: z.uuid().nullable(),
32
+ deployments: z.array(stagingDeploymentSchema).max(30),
33
+ });
34
+ export const stagingCreateReceiptSchema = z
35
+ .object({
36
+ id: z.uuid(),
37
+ developmentId: z.uuid(),
38
+ candidateId: z.uuid(),
39
+ requestId: z.uuid(),
40
+ generation: z.number().int().positive(),
41
+ configuration: stagingConfigurationSchema,
42
+ })
43
+ .strict();
@@ -3,7 +3,15 @@ export interface DependencyGroup {
3
3
  devDependencies?: Record<string, string>;
4
4
  }
5
5
  export declare const WEB_DEPENDENCIES: DependencyGroup;
6
- export declare const OPENNEXT_GLOB_VERSION = "10.5.0";
6
+ export declare const ANHEDRAL_STACK_DEPENDENCIES: {
7
+ readonly '@tanstack/react-start': "1.169.4";
8
+ readonly '@tanstack/react-router': "1.170.46";
9
+ readonly '@cloudflare/vite-plugin': "1.67.0";
10
+ readonly '@tanstack/router-cli': "1.167.46";
11
+ readonly '@vitejs/plugin-react': "6.2.1";
12
+ readonly vite: "8.3.5";
13
+ readonly wrangler: "4.156.1";
14
+ };
7
15
  export declare const WORKSPACE_NODE_ENGINE = "^22.13.0 || >=24.0.0";
8
16
  export declare const PACKAGE_MANAGER = "pnpm@10.34.5";
9
17
  export declare const STACK_DEPENDENCIES: {
@@ -22,10 +30,8 @@ export declare const STACK_DEPENDENCIES: {
22
30
  readonly '@hono/zod-openapi': "1.6.3";
23
31
  readonly fallow: "3.34.0";
24
32
  readonly undici: "7.30.1";
25
- readonly 'react-native-purchases': "10.14.0";
26
33
  readonly stripe: "23.0.0";
27
34
  };
28
- /** Separate HTTP and inspector ports let all selected Workers run together. */
29
35
  export declare const WORKER_DEV_PORTS: {
30
36
  readonly api: {
31
37
  readonly http: 8787;
@@ -35,29 +41,5 @@ export declare const WORKER_DEV_PORTS: {
35
41
  export declare const CAPABILITY_DEPENDENCIES: {
36
42
  readonly 'better-auth': "1.7.7";
37
43
  readonly '@better-auth/drizzle-adapter': "1.7.7";
38
- readonly '@better-auth/expo': "1.7.7";
39
44
  readonly stripe: "23.0.0";
40
- readonly 'react-native-purchases': "10.14.0";
41
- readonly wxt: "0.21.5";
42
- readonly '@wxt-dev/module-react': "1.2.2";
43
- readonly expo: "56.0.12";
44
- readonly react: "19.2.3";
45
- readonly 'react-native': "0.85.3";
46
- readonly 'expo-secure-store': "56.0.4";
47
- readonly 'expo-linking': "56.0.14";
48
- readonly '@types/react': "19.2.14";
49
- readonly 'babel-preset-expo': "56.0.8";
50
- readonly nativewind: "4.2.7";
51
- readonly 'react-native-css-interop': "0.2.7";
52
- readonly 'react-native-reanimated': "4.3.1";
53
- readonly 'react-native-worklets': "0.8.3";
54
- readonly 'react-native-safe-area-context': "5.7.0";
55
- readonly 'class-variance-authority': "0.7.1";
56
- readonly clsx: "2.1.1";
57
- readonly 'tailwind-merge': "3.5.0";
58
- readonly 'tailwindcss-animate': "1.0.7";
59
- readonly '@rn-primitives/portal': "1.5.2";
60
- readonly '@rn-primitives/slot': "1.5.2";
61
- readonly tailwindcss: "3.4.19";
62
- readonly '@types/react-dom': "19.2.3";
63
45
  };
@@ -1,13 +1,9 @@
1
1
  export const WEB_DEPENDENCIES = {
2
2
  dependencies: {
3
- // renovate: datasource=npm depName=next
4
- next: '16.4.2',
5
3
  // renovate: datasource=npm depName=react
6
4
  react: '19.2.3',
7
5
  // renovate: datasource=npm depName=react-dom
8
6
  'react-dom': '19.2.3',
9
- // renovate: datasource=npm depName=server-only
10
- 'server-only': '0.0.1',
11
7
  // renovate: datasource=npm depName=@base-ui/react
12
8
  '@base-ui/react': '1.9.0',
13
9
  // renovate: datasource=npm depName=class-variance-authority
@@ -16,16 +12,12 @@ export const WEB_DEPENDENCIES = {
16
12
  clsx: '2.1.1',
17
13
  // renovate: datasource=npm depName=tailwind-merge
18
14
  'tailwind-merge': '3.5.0',
19
- // renovate: datasource=npm depName=@opennextjs/cloudflare
20
- '@opennextjs/cloudflare': '1.20.12',
21
15
  },
22
16
  devDependencies: {
23
17
  // renovate: datasource=npm depName=tailwindcss
24
18
  tailwindcss: '4.3.3',
25
19
  // renovate: datasource=npm depName=@tailwindcss/postcss
26
20
  '@tailwindcss/postcss': '4.3.3',
27
- // renovate: datasource=npm depName=eslint-config-next
28
- 'eslint-config-next': '16.4.2',
29
21
  // renovate: datasource=npm depName=eslint
30
22
  eslint: '9.39.5',
31
23
  // renovate: datasource=npm depName=typescript
@@ -40,8 +32,23 @@ export const WEB_DEPENDENCIES = {
40
32
  wrangler: '4.151.0',
41
33
  },
42
34
  };
43
- // renovate: datasource=npm depName=glob
44
- export const OPENNEXT_GLOB_VERSION = '10.5.0';
35
+ // Anhedral Stack framework/build tooling.
36
+ export const ANHEDRAL_STACK_DEPENDENCIES = {
37
+ // renovate: datasource=npm depName=@tanstack/react-start
38
+ '@tanstack/react-start': '1.169.4',
39
+ // renovate: datasource=npm depName=@tanstack/react-router
40
+ '@tanstack/react-router': '1.170.46',
41
+ // renovate: datasource=npm depName=@cloudflare/vite-plugin
42
+ '@cloudflare/vite-plugin': '1.67.0',
43
+ // renovate: datasource=npm depName=@tanstack/router-cli
44
+ '@tanstack/router-cli': '1.167.46',
45
+ // renovate: datasource=npm depName=@vitejs/plugin-react
46
+ '@vitejs/plugin-react': '6.2.1',
47
+ // renovate: datasource=npm depName=vite
48
+ vite: '8.3.5',
49
+ // renovate: datasource=npm depName=wrangler
50
+ wrangler: '4.156.1',
51
+ };
45
52
  export const WORKSPACE_NODE_ENGINE = '^22.13.0 || >=24.0.0';
46
53
  export const PACKAGE_MANAGER = 'pnpm@10.34.5';
47
54
  export const STACK_DEPENDENCIES = {
@@ -75,69 +82,15 @@ export const STACK_DEPENDENCIES = {
75
82
  fallow: '3.34.0',
76
83
  // renovate: datasource=npm depName=undici
77
84
  undici: '7.30.1',
78
- // renovate: datasource=npm depName=react-native-purchases
79
- 'react-native-purchases': '10.14.0',
80
85
  // renovate: datasource=npm depName=stripe
81
86
  stripe: '23.0.0',
82
87
  };
83
- /** Separate HTTP and inspector ports let all selected Workers run together. */
84
- export const WORKER_DEV_PORTS = {
85
- api: { http: 8787, inspector: 9231 },
86
- };
87
- // Independently selected progressive client and service recipes.
88
+ export const WORKER_DEV_PORTS = { api: { http: 8787, inspector: 9231 } };
89
+ // Backend, storage and payments extend the same Anhedral Stack foundation.
88
90
  export const CAPABILITY_DEPENDENCIES = {
89
91
  // renovate: datasource=npm depName=better-auth
90
92
  'better-auth': '1.7.7',
91
93
  // renovate: datasource=npm depName=@better-auth/drizzle-adapter
92
94
  '@better-auth/drizzle-adapter': '1.7.7',
93
- // renovate: datasource=npm depName=@better-auth/expo
94
- '@better-auth/expo': '1.7.7',
95
- // renovate: datasource=npm depName=stripe
96
95
  stripe: '23.0.0',
97
- // renovate: datasource=npm depName=react-native-purchases
98
- 'react-native-purchases': '10.14.0',
99
- // renovate: datasource=npm depName=wxt
100
- wxt: '0.21.5',
101
- // renovate: datasource=npm depName=@wxt-dev/module-react
102
- '@wxt-dev/module-react': '1.2.2',
103
- // renovate: datasource=npm depName=expo
104
- expo: '56.0.12',
105
- // renovate: datasource=npm depName=react
106
- react: '19.2.3',
107
- // renovate: datasource=npm depName=react-native
108
- 'react-native': '0.85.3',
109
- // renovate: datasource=npm depName=expo-secure-store
110
- 'expo-secure-store': '56.0.4',
111
- // renovate: datasource=npm depName=expo-linking
112
- 'expo-linking': '56.0.14',
113
- // renovate: datasource=npm depName=@types/react
114
- '@types/react': '19.2.14',
115
- // renovate: datasource=npm depName=babel-preset-expo
116
- 'babel-preset-expo': '56.0.8',
117
- // renovate: datasource=npm depName=nativewind
118
- nativewind: '4.2.7',
119
- // renovate: datasource=npm depName=react-native-css-interop
120
- 'react-native-css-interop': '0.2.7',
121
- // renovate: datasource=npm depName=react-native-reanimated
122
- 'react-native-reanimated': '4.3.1',
123
- // renovate: datasource=npm depName=react-native-worklets
124
- 'react-native-worklets': '0.8.3',
125
- // renovate: datasource=npm depName=react-native-safe-area-context
126
- 'react-native-safe-area-context': '5.7.0',
127
- // renovate: datasource=npm depName=class-variance-authority
128
- 'class-variance-authority': '0.7.1',
129
- // renovate: datasource=npm depName=clsx
130
- clsx: '2.1.1',
131
- // renovate: datasource=npm depName=tailwind-merge
132
- 'tailwind-merge': '3.5.0',
133
- // renovate: datasource=npm depName=tailwindcss-animate
134
- 'tailwindcss-animate': '1.0.7',
135
- // renovate: datasource=npm depName=@rn-primitives/portal
136
- '@rn-primitives/portal': '1.5.2',
137
- // renovate: datasource=npm depName=@rn-primitives/slot
138
- '@rn-primitives/slot': '1.5.2',
139
- // renovate: datasource=npm depName=tailwindcss
140
- tailwindcss: '3.4.19',
141
- // renovate: datasource=npm depName=@types/react-dom
142
- '@types/react-dom': '19.2.3',
143
96
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- export { parseStandardOptions, scaffoldStandardProject, STANDARD_PRODUCTS, STANDARD_USAGE, } from './standard.js';
2
- export type { StandardOptions, StandardProduct, StandardRunner } from './standard.js';
1
+ /** The Anhedral Stack: one web foundation with progressive backend, storage and payments. */
2
+ export { scaffoldLaunchProject as scaffoldAnhedralStack } from './launch.js';
3
+ export type { LaunchOptions as AnhedralStackOptions } from './launch.js';
4
+ export { parseAnhedralStackOptions as parseInitOptions } from './launch.js';
3
5
  export { GENERATOR_VERSION } from './version.js';
package/dist/index.js CHANGED
@@ -1,2 +1,4 @@
1
- export { parseStandardOptions, scaffoldStandardProject, STANDARD_PRODUCTS, STANDARD_USAGE, } from './standard.js';
1
+ /** The Anhedral Stack: one web foundation with progressive backend, storage and payments. */
2
+ export { scaffoldLaunchProject as scaffoldAnhedralStack } from './launch.js';
3
+ export { parseAnhedralStackOptions as parseInitOptions } from './launch.js';
2
4
  export { GENERATOR_VERSION } from './version.js';
@@ -0,0 +1,27 @@
1
+ import { type OutputOptions } from './cli-output.js';
2
+ import type { CommandRunner } from './command-types.js';
3
+ export interface LaunchOptions {
4
+ root: string;
5
+ name: string;
6
+ skipInstall: boolean;
7
+ dryRun: boolean;
8
+ json: boolean;
9
+ initializeGit: boolean;
10
+ }
11
+ export declare function parseAnhedralStackOptions(args: readonly string[]): LaunchOptions;
12
+ export declare function launchPlan(options: LaunchOptions): {
13
+ schemaVersion: number;
14
+ cliVersion: string;
15
+ root: string;
16
+ name: string;
17
+ products: string[];
18
+ stack: string;
19
+ foundation: string;
20
+ capabilities: ("hono" | "database-auth" | "r2" | "stripe")[];
21
+ targets: string[];
22
+ dryRun: boolean;
23
+ resourcesProvisioned: boolean;
24
+ hostedAdmission: string;
25
+ };
26
+ /** Fresh directories only; source commit and installation retain the existing recovery contract. */
27
+ export declare function scaffoldLaunchProject(options: LaunchOptions, run?: CommandRunner, output?: OutputOptions): Promise<void>;