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.
- package/README.md +33 -68
- package/assets/contracts/LICENSE +201 -0
- package/assets/contracts/LICENSE.environment +201 -0
- package/assets/contracts/LICENSE.operations +201 -0
- package/assets/contracts/deployment-provenance.json +15 -0
- package/assets/contracts/environment-provenance.json +11 -0
- package/assets/contracts/operations-provenance.json +12 -0
- package/assets/launch/application.server.ts.txt +13 -0
- package/assets/launch/auth-client.ts.txt +4 -0
- package/assets/launch/home.tsx.txt +20 -0
- package/assets/launch/minimal-application.server.ts.txt +5 -0
- package/assets/launch/minimal-server.ts.txt +7 -0
- package/assets/launch/oj/OJ.LICENSE +21 -0
- package/assets/launch/oj/run.mjs +82 -0
- package/assets/launch/oj/runtime.json +21 -0
- package/assets/launch/request-context.ts.txt +3 -0
- package/assets/launch/root.tsx.txt +26 -0
- package/assets/launch/router.tsx.txt +21 -0
- package/assets/launch/server.ts.txt +15 -0
- package/assets/launch/sign-in.tsx.txt +53 -0
- package/assets/launch/styles.css.txt +19 -0
- package/assets/security/credential-patterns.d.mts +3 -0
- package/assets/security/credential-patterns.mjs +59 -0
- package/assets/stack/api-index.ts.txt +6 -1
- package/assets/stack/stripe.ts.txt +30 -13
- package/assets/ui/catalog.json +36 -324
- package/dist/{platforms/web.d.ts → api-proxy.d.ts} +1 -3
- package/dist/api-proxy.js +48 -0
- package/dist/bin.js +55 -36
- package/dist/capability-catalog.d.ts +36 -57
- package/dist/capability-catalog.js +65 -67
- package/dist/capability-command.d.ts +3 -3
- package/dist/capability-command.js +146 -59
- package/dist/capability-editor.js +6 -5
- package/dist/capability-recipes.js +9 -296
- package/dist/cli-arguments.d.ts +2 -0
- package/dist/cli-arguments.js +101 -50
- package/dist/cli-commands.d.ts +1 -1
- package/dist/cli-commands.js +31 -5
- package/dist/cli-errors.d.ts +18 -0
- package/dist/cli-errors.js +63 -0
- package/dist/cli-output.d.ts +22 -0
- package/dist/cli-output.js +42 -7
- package/dist/command-runner.js +88 -0
- package/dist/command-schema.d.ts +16 -0
- package/dist/command-schema.js +496 -21
- package/dist/command-types.d.ts +1 -0
- package/dist/command-types.js +1 -0
- package/dist/completion.d.ts +2 -0
- package/dist/completion.js +201 -0
- package/dist/composition.d.ts +25 -0
- package/dist/composition.js +28 -0
- package/dist/contracts/cli-transport.d.ts +316 -0
- package/dist/contracts/cli-transport.js +236 -0
- package/dist/contracts/deployment.d.ts +233 -0
- package/dist/contracts/deployment.js +198 -0
- package/dist/contracts/environment-file.d.ts +7 -0
- package/dist/contracts/environment-file.js +112 -0
- package/dist/contracts/environment-transport.d.ts +79 -0
- package/dist/contracts/environment-transport.js +110 -0
- package/dist/contracts/production-transport.d.ts +71 -0
- package/dist/contracts/production-transport.js +56 -0
- package/dist/contracts/runtime-logs-transport.d.ts +127 -0
- package/dist/contracts/runtime-logs-transport.js +50 -0
- package/dist/contracts/source-bundle.d.ts +11 -0
- package/dist/contracts/source-bundle.js +197 -0
- package/dist/contracts/source-profile.d.ts +4 -0
- package/dist/contracts/source-profile.js +5 -0
- package/dist/contracts/staging-transport.d.ts +79 -0
- package/dist/contracts/staging-transport.js +43 -0
- package/dist/dependencies.d.ts +9 -27
- package/dist/dependencies.js +19 -66
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/launch.d.ts +27 -0
- package/dist/launch.js +262 -0
- package/dist/platform-command.d.ts +9 -0
- package/dist/platform-command.js +787 -0
- package/dist/platform-environment.d.ts +18 -0
- package/dist/platform-environment.js +257 -0
- package/dist/platform-operations.d.ts +26 -0
- package/dist/platform-operations.js +155 -0
- package/dist/platform-production.d.ts +16 -0
- package/dist/platform-production.js +135 -0
- package/dist/platform-source.d.ts +8 -0
- package/dist/platform-source.js +111 -0
- package/dist/platform-state.d.ts +15 -0
- package/dist/platform-state.js +229 -0
- package/dist/platforms/tanstack.d.ts +10 -0
- package/dist/platforms/tanstack.js +248 -0
- package/dist/registry/usage.d.ts +4 -1
- package/dist/registry/usage.js +59 -4
- package/dist/scaffold/bootstrap.d.ts +3 -3
- package/dist/scaffold/styling.d.ts +3 -2
- package/dist/transaction.js +28 -3
- package/dist/ui-catalog.d.ts +3 -5
- package/dist/ui-catalog.js +8 -24
- package/dist/ui-command.d.ts +3 -1
- package/dist/ui-command.js +74 -72
- package/dist/ui-project.d.ts +4 -2
- package/dist/ui-project.js +40 -38
- package/dist/util.js +40 -61
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/capabilities.md +23 -89
- package/docs/software-factory.md +208 -9
- package/docs/stack-standard.md +7 -17
- package/docs/ui.md +9 -22
- package/package.json +26 -22
- package/assets/stack/ai-schema.ts.txt +0 -5
- package/assets/stack/ai.ts.txt +0 -30
- package/assets/stack/desktop.rs.txt +0 -21
- package/assets/stack/events-schema.ts.txt +0 -12
- package/assets/stack/events.ts.txt +0 -59
- package/assets/stack/mobile-auth.ts.txt +0 -25
- package/assets/stack/mobile-billing.tsx.txt +0 -63
- package/assets/stack/mobile-session.tsx.txt +0 -83
- package/assets/stack/native-button.tsx.txt +0 -108
- package/assets/stack/native-global.css.txt +0 -4
- package/assets/stack/native-lib-utils.ts.txt +0 -5
- package/assets/stack/native-metro.config.js.txt +0 -6
- package/assets/stack/native-nativewind-env.d.ts.txt +0 -1
- package/assets/stack/native-tailwind.config.js.txt +0 -73
- package/assets/stack/native-text.tsx.txt +0 -89
- package/assets/stack/purchases.ts.txt +0 -65
- package/assets/stack/revenuecat.ts.txt +0 -88
- package/assets/stack/rtc-schema.ts.txt +0 -10
- package/assets/stack/rtc.ts.txt +0 -122
- package/assets/stack/web-sign-in.tsx.txt +0 -51
- package/dist/capabilities.d.ts +0 -11
- package/dist/capabilities.js +0 -14
- package/dist/dependency-order.d.ts +0 -2
- package/dist/dependency-order.js +0 -24
- package/dist/platforms/lint.d.ts +0 -1
- package/dist/platforms/lint.js +0 -5
- package/dist/platforms/web.js +0 -251
- package/dist/project-config.d.ts +0 -3
- package/dist/project-config.js +0 -16
- package/dist/registry/context.d.ts +0 -3
- package/dist/registry/context.js +0 -20
- package/dist/registry/options.d.ts +0 -2
- package/dist/registry/options.js +0 -44
- package/dist/registry/resolve.d.ts +0 -11
- package/dist/registry/resolve.js +0 -46
- package/dist/registry/types.d.ts +0 -60
- package/dist/scaffold/api.d.ts +0 -2
- package/dist/scaffold/api.js +0 -38
- package/dist/scaffold/backend.d.ts +0 -2
- package/dist/scaffold/backend.js +0 -36
- package/dist/scaffold/compose.d.ts +0 -4
- package/dist/scaffold/compose.js +0 -30
- package/dist/scaffold/database.d.ts +0 -2
- package/dist/scaffold/database.js +0 -41
- package/dist/scaffold/documentation.d.ts +0 -2
- package/dist/scaffold/documentation.js +0 -71
- package/dist/scaffold/environment.d.ts +0 -4
- package/dist/scaffold/environment.js +0 -22
- package/dist/scaffold/stack-documentation.d.ts +0 -2
- package/dist/scaffold/stack-documentation.js +0 -6
- package/dist/scaffold/storage.d.ts +0 -2
- package/dist/scaffold/storage.js +0 -21
- package/dist/scaffold/workspace.d.ts +0 -3
- package/dist/scaffold/workspace.js +0 -131
- package/dist/stack-registry.d.ts +0 -35
- package/dist/stack-registry.js +0 -189
- package/dist/standard.d.ts +0 -8
- package/dist/standard.js +0 -94
- package/dist/workspace-graph.d.ts +0 -7
- package/dist/workspace-graph.js +0 -74
- package/docs/anhedral-stack.md +0 -12
- package/docs/assets/anhedral-stack-light.png +0 -0
- package/docs/assets/anhedral-stack.png +0 -0
- package/docs/native-ui.md +0 -47
- /package/dist/{registry/types.js → command-runner.d.ts} +0 -0
package/dist/util.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { chmodSync,
|
|
1
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { readBoundedFile } from './bounded-file.js';
|
|
3
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
2
6
|
import { resolveCommand } from './command.js';
|
|
3
7
|
import { spawnSync } from 'node:child_process';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
8
|
import path from 'node:path';
|
|
6
9
|
const FAILURE_TAIL_BYTES = 128 * 1024;
|
|
7
10
|
function commandTimeout() {
|
|
@@ -42,77 +45,53 @@ export function appendGitignore(root, lines) {
|
|
|
42
45
|
const separator = existing.length > 0 && !/(?:\r\n|\n|\r)$/.test(existing) ? newline : '';
|
|
43
46
|
writeFile(filePath, `${existing}${separator}${additions.join(newline)}${newline}`);
|
|
44
47
|
}
|
|
45
|
-
function readTail(filePath) {
|
|
46
|
-
const file = openSync(filePath, 'r');
|
|
47
|
-
try {
|
|
48
|
-
const size = fstatSync(file).size;
|
|
49
|
-
const length = Math.min(size, FAILURE_TAIL_BYTES);
|
|
50
|
-
if (length === 0)
|
|
51
|
-
return '';
|
|
52
|
-
const buffer = Buffer.allocUnsafe(length);
|
|
53
|
-
readSync(file, buffer, 0, length, size - length);
|
|
54
|
-
return buffer.toString();
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
closeSync(file);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function dumpFailure(cmd, status, stdoutPath, stderrPath, spawnError) {
|
|
61
|
-
const stdoutText = readTail(stdoutPath);
|
|
62
|
-
const stderrText = readTail(stderrPath);
|
|
63
|
-
if (process.env.ANHEDRAL_QUIET !== '1') {
|
|
64
|
-
if (stdoutText)
|
|
65
|
-
process.stderr.write(stdoutText);
|
|
66
|
-
if (stderrText)
|
|
67
|
-
process.stderr.write(stderrText);
|
|
68
|
-
}
|
|
69
|
-
throw commandFailure(cmd, status, spawnError);
|
|
70
|
-
}
|
|
71
48
|
export function execFile(executable, args, cwd) {
|
|
72
49
|
const invocation = resolveCommand(executable, args);
|
|
73
50
|
const quiet = process.env.ANHEDRAL_QUIET === '1';
|
|
74
51
|
const display = [executable, ...args].join(' ');
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
52
|
+
const verbose = process.env.ANHEDRAL_VERBOSE === '1' && !quiet;
|
|
53
|
+
const requested = Number(process.env.ANHEDRAL_COMMAND_OUTPUT_BYTES);
|
|
54
|
+
const maximum = Number.isSafeInteger(requested) && requested >= 1024 && requested <= 16 * 1024 * 1024
|
|
55
|
+
? requested
|
|
56
|
+
: 16 * 1024 * 1024;
|
|
57
|
+
const root = mkdtempSync(path.join(tmpdir(), 'anhedral-command-'));
|
|
58
|
+
const configuration = path.join(root, 'input.json'), resultFile = path.join(root, 'result.json');
|
|
59
|
+
try {
|
|
60
|
+
const bytes = JSON.stringify({
|
|
61
|
+
...invocation,
|
|
79
62
|
cwd,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
63
|
+
timeout: commandTimeout(),
|
|
64
|
+
maximum,
|
|
65
|
+
verbose,
|
|
83
66
|
});
|
|
84
|
-
if (
|
|
85
|
-
throw
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
const captureRoot = mkdtempSync(path.join(tmpdir(), 'anhedral-exec-'));
|
|
90
|
-
const stdoutPath = path.join(captureRoot, 'stdout.log');
|
|
91
|
-
const stderrPath = path.join(captureRoot, 'stderr.log');
|
|
92
|
-
const stdout = openSync(stdoutPath, 'w');
|
|
93
|
-
const stderr = openSync(stderrPath, 'w');
|
|
94
|
-
try {
|
|
95
|
-
const result = spawnSync(invocation.command, invocation.args, {
|
|
67
|
+
if (Buffer.byteLength(bytes) > 1024 * 1024)
|
|
68
|
+
throw Error('Command configuration exceeds its bound.');
|
|
69
|
+
writeFileSync(configuration, bytes, { flag: 'wx', mode: 0o600 });
|
|
70
|
+
const wrapper = spawnSync(process.execPath, [fileURLToPath(new URL('./command-runner.js', import.meta.url)), configuration, resultFile], {
|
|
96
71
|
cwd,
|
|
97
72
|
shell: false,
|
|
98
|
-
stdio:
|
|
99
|
-
|
|
73
|
+
stdio: verbose ? 'inherit' : 'ignore',
|
|
74
|
+
timeout: commandTimeout() + 10000,
|
|
75
|
+
killSignal: 'SIGKILL',
|
|
100
76
|
});
|
|
101
|
-
|
|
102
|
-
|
|
77
|
+
if (wrapper.error || wrapper.status !== 0 || !existsSync(resultFile))
|
|
78
|
+
throw commandFailure(display, wrapper.status, wrapper.error);
|
|
79
|
+
const result = JSON.parse(readBoundedFile(resultFile, 1024 * 1024).toString('utf8'));
|
|
103
80
|
if (result.error || result.status !== 0) {
|
|
104
|
-
|
|
81
|
+
if (!quiet && !verbose)
|
|
82
|
+
for (const value of [result.stdout, result.stderr]) {
|
|
83
|
+
const tail = Buffer.from(value, 'base64');
|
|
84
|
+
if (tail.length)
|
|
85
|
+
process.stderr.write(tail.subarray(-FAILURE_TAIL_BYTES));
|
|
86
|
+
}
|
|
87
|
+
if (result.error === 'ENOBUFS')
|
|
88
|
+
throw Error(`Command output exceeded its capture limit: ${display}. Inspect the tool before retrying.`);
|
|
89
|
+
throw commandFailure(display, result.status, result.error
|
|
90
|
+
? Object.assign(new Error('Command execution failed'), { code: result.error })
|
|
91
|
+
: undefined);
|
|
105
92
|
}
|
|
106
93
|
}
|
|
107
94
|
finally {
|
|
108
|
-
|
|
109
|
-
closeSync(stdout);
|
|
110
|
-
}
|
|
111
|
-
catch { }
|
|
112
|
-
try {
|
|
113
|
-
closeSync(stderr);
|
|
114
|
-
}
|
|
115
|
-
catch { }
|
|
116
|
-
rmSync(captureRoot, { recursive: true, force: true });
|
|
95
|
+
rmSync(root, { recursive: true, force: true });
|
|
117
96
|
}
|
|
118
97
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "0.
|
|
1
|
+
export declare const GENERATOR_VERSION = "0.19.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const GENERATOR_VERSION = '0.
|
|
1
|
+
export const GENERATOR_VERSION = '0.19.0';
|
package/docs/capabilities.md
CHANGED
|
@@ -1,110 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Anhedral Stack additions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
There is one current **Anhedral Stack**. `anhedral init` creates its web foundation with TanStack Start SSR/server functions and source-owned shadcn Anhedral UI. Add the remaining services only when needed.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
anhedral init my-app
|
|
7
7
|
cd my-app
|
|
8
|
-
anhedral
|
|
9
|
-
anhedral add
|
|
10
|
-
anhedral add hono
|
|
11
|
-
anhedral add database-auth
|
|
12
|
-
anhedral stack status --json
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
`anhedral add` writes editable source and local configuration, then installs dependencies unless `--skip-install` is selected. It does not create provider resources, install credentials, run migrations, deploy, publish clients, update installed plugins or register a managed project. These are source composition commands, separate from Anhedral Cloud operations.
|
|
16
|
-
|
|
17
|
-
## Capabilities
|
|
18
|
-
|
|
19
|
-
| Name | Adds | Required source capabilities |
|
|
20
|
-
| --- | --- | --- |
|
|
21
|
-
| `hono` | API Worker, web proxy/service binding, health route | Next.js foundation |
|
|
22
|
-
| `database-auth` | Drizzle/D1, Better Auth, schema/migration tooling, web sign-in starter | `hono` |
|
|
23
|
-
| `r2` | Private R2 binding and authenticated owner-scoped file routes | `database-auth` |
|
|
24
|
-
| `stripe` | Stripe SDK, Checkout subscription starter, signed webhook receipts, canonical access checks | `database-auth` |
|
|
25
|
-
| `realtime` | Authenticated D1-backed events and resumable SSE | `database-auth` |
|
|
26
|
-
| `rtc` | Cloudflare Realtime SFU session/track adapter with ownership checks | `database-auth` |
|
|
27
|
-
| `ai` | Workers AI binding, authenticated text-generation route and atomic daily quota | `database-auth` |
|
|
28
|
-
| `expo` | Expo app and Better Auth/SecureStore client | `database-auth` |
|
|
29
|
-
| `native-ui` | NativeWind 4, shared theme CSS, RNR Button/Text starter, portal/root adapter, UI catalog metadata | `expo` |
|
|
30
|
-
| `revenuecat` | Native subscription SDK/UI, scoped webhooks and server-side entitlement reconciliation | `expo`, `stripe` |
|
|
31
|
-
| `wxt` | WXT React extension, scoped API host permission and editable popup | `database-auth` |
|
|
32
|
-
| `side-panel` | Chromium Side Panel entrypoint and background registration | `wxt` |
|
|
33
|
-
| `gpui` | Rust/GPUI desktop application and native build scripts | `database-auth` |
|
|
34
|
-
|
|
35
|
-
The progression is Next.js → Hono → database/auth, followed by independently selected branches. These are Anhedral's source-builder rules, not intrinsic restrictions of those technologies. `anhedral ui` still requires only the target Next.js or Expo application; it has no backend prerequisite. See [UI commands](ui.md).
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
anhedral add expo native-ui --dry-run --json
|
|
39
|
-
anhedral add side-panel --with-dependencies --dry-run --json
|
|
8
|
+
anhedral add backend --dry-run --json
|
|
9
|
+
anhedral add backend
|
|
40
10
|
anhedral add r2 stripe
|
|
41
|
-
anhedral
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Missing prerequisites stop the command before writes. Explicitly list the parents in the same command, or choose `--with-dependencies` to include them in dependency order. There is no `add all` shortcut that silently chooses every optional branch.
|
|
45
|
-
|
|
46
|
-
## Protecting existing applications
|
|
47
|
-
|
|
48
|
-
Additions require an Anhedral workspace with a Next.js foundation. They do not reinitialize it. All selected recipes are planned in memory before any installation. A late collision rejects the entire plan. JSON/JSONC changes preserve unrelated keys and comments; existing bindings and dependency pins that conflict require reconciliation. New source files never replace existing files.
|
|
49
|
-
|
|
50
|
-
CLI-owned composition adapters are fingerprinted in `anhedral.json`. Their edits are protected too: if an adapter was customized, a later addition stops rather than replacing it. Add business routes in `apps/api/src/index.ts`, custom binding/variable types in `custom-environment.ts`, auth methods in `auth-features.ts`/`auth.ts`, and native product UI in `apps/mobile/App.tsx`. Keep additional application behavior outside composition adapters.
|
|
51
|
-
|
|
52
|
-
Source writes use the existing journaled transaction/recovery implementation. Dependency resolution/install follows source commit; if installation fails, the CLI reports a post-commit error and retains the source for review and retry. Reviewed dependency patches are configured before the frozen install. `--skip-install` leaves dependency resolution/patch staging to a subsequent normal CLI installation or explicit consumer setup. `--dry-run` makes no writes or network requests, including transaction metadata.
|
|
53
|
-
|
|
54
|
-
Repeated additions leave source unchanged; the normal command still resolves and installs dependencies so it can recover from an earlier install failure. Use `--skip-install` for a source-only no-op. There is no removal command, provider deletion or implicit D1/R2 data deletion. An inconsistent parent/child declaration is rejected. Earlier full-stack generators and arbitrary custom layouts are not automatically adopted or overlaid; inspect their source and reconcile conflicts explicitly.
|
|
55
|
-
|
|
56
|
-
## Source state and activation
|
|
57
|
-
|
|
58
|
-
`stack list` shows the complete catalog. `stack status` reports `locked`, `available`, `installed` or `incomplete` source state. `stack doctor` exits unsuccessfully when declared source is missing. Neither command inspects live providers or proves deployment/activation. An installed capability can still need credentials, migrations, resource IDs and runtime verification.
|
|
59
|
-
|
|
60
|
-
The intended operational sequence remains source selection → resource provisioning → bindings/secrets/migrations → runtime validation/deployment → verified active service. Client binaries run on their target platforms, independently of Cloudflare server deployments.
|
|
61
|
-
|
|
62
|
-
## Configuration and local validation
|
|
63
|
-
|
|
64
|
-
Run dependency installation, inspect the generated files, then run `pnpm check`. The normal `add` path resolves lockfiles, stages any applicable reviewed patches and performs a frozen install. The consumer's `audit:deps` retains raw findings and accepts only the existing reviewed exact patches. Source-only generation does not apply a patch to a dependency that has not been resolved yet.
|
|
65
|
-
|
|
66
|
-
For API development, use the web service binding in production and `API_INTERNAL_URL=http://127.0.0.1:8787` in `apps/web/.env.local` locally. Copy selected API values from `apps/api/.dev.vars.example` to `.dev.vars`; never put server secrets in client public variables. Set a sufficiently long auth secret and the actual `PUBLIC_APP_URL` before enabling identity-dependent features.
|
|
67
|
-
|
|
68
|
-
D1's initial resource ID is deliberately a placeholder. Configure the actual D1 identity and private R2 bucket yourself. Keep R2 public access disabled. Generate and review additional SQL, then deliberately apply it to an isolated local database:
|
|
69
|
-
|
|
70
|
-
```sh
|
|
71
|
-
pnpm db:generate
|
|
72
|
-
pnpm db:migrate --local
|
|
11
|
+
anhedral stack status --json
|
|
73
12
|
```
|
|
74
13
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
The included routes form a subscription starter, rather than a complete commerce product. Choose the allowed Stripe price and RevenueCat entitlement. `BILLING_PROVIDER` selects `stripe`, `revenuecat` or `either` for the shared server access guard. The default billing environment is `sandbox`; a deliberate `BILLING_ENVIRONMENT=live` selection must match the provider key and webhook environment. The CLI sets neither live credentials nor live mode.
|
|
82
|
-
|
|
83
|
-
Checkout derives identity from the authenticated session, uses a server-selected price and requires an idempotency key. Stripe verifies the untouched body/signature through the web proxy. RevenueCat validates its configured authorization header, app scope and environment. D1 receipts deduplicate delivery. Webhook order, redirects and SDK callbacks never grant access.
|
|
84
|
-
|
|
85
|
-
The server re-reads canonical provider state, checks identity/product/environment/expiry, and fails closed on unavailable or unconfigured providers. Reuse `requireSession` and `requireEntitlement` on paid application routes. `/api/billing/access` demonstrates that guard. SDK account changes are serialized; native sign-out disconnects purchases before clearing the app session. One-time fulfillment, credits, tax, marketplace/Connect, pricing and store-policy decisions remain application work.
|
|
14
|
+
| Selection | Source added | Requires |
|
|
15
|
+
| --------- | ----------------------------------------------------------------------- | ----------------------------- |
|
|
16
|
+
| `backend` | Hono API, Drizzle/D1, Better Auth and web sign-in starter | Anhedral Stack web foundation |
|
|
17
|
+
| `r2` | Private storage binding and authenticated owner-scoped file routes | `backend` |
|
|
18
|
+
| `stripe` | Subscription Checkout, signed webhooks and canonical entitlement checks | `backend` |
|
|
86
19
|
|
|
87
|
-
|
|
20
|
+
`backend` is one public selection; its provenance records the concrete Hono and database/auth capabilities. Use `--with-dependencies` to include missing prerequisites in the same planned source transaction. `stack list` describes this stack's additions. `status`/`doctor` check source completeness, not live service activation.
|
|
88
21
|
|
|
89
|
-
##
|
|
22
|
+
## Source protection
|
|
90
23
|
|
|
91
|
-
|
|
24
|
+
Adding a capability also upgrades a canonical earlier TanStack Start foundation to the pinned OJ launchers and runtime helpers in the same source transaction, including when that capability is already installed. The exact earlier canonical document also receives the OJ-compatible side-effect CSS import; safe customized documents stay untouched, while edited documents retaining the earlier stylesheet URL import require reconciliation. Customized launchers or generated configuration require reconciliation before any writes. Additions never reinitialize an application. They plan all selected changes before writing, reject collisions and preserve unrelated JSON/JSONC settings. Composition adapters are fingerprinted in `anhedral.json`; modified adapters require reconciliation instead of silent replacement. Add product routes in `apps/api/src/index.ts`, custom types in `custom-environment.ts`, and auth method configuration in `auth-features.ts`/`auth.ts`.
|
|
92
25
|
|
|
93
|
-
|
|
26
|
+
Journaled transactions preserve recovery evidence and refuse ambiguous recreated files. Dependency installation follows source commit; a post-commit install failure keeps source for repair/retry. Reviewed dependency patches precede the frozen install. `--skip-install` writes source only. `--dry-run` performs no writes or network requests. Repeating an addition preserves source; normal installation may still retry dependencies.
|
|
94
27
|
|
|
95
|
-
|
|
28
|
+
There is no implicit capability removal or resource/data deletion. Existing applications retain their source and identity. Only the OJ/TanStack Start foundation and these three additions are supported.
|
|
96
29
|
|
|
97
|
-
##
|
|
30
|
+
## Local setup and validation
|
|
98
31
|
|
|
99
|
-
|
|
32
|
+
Minimal `pnpm dev` runs the web Worker. After backend is added, Vite also runs its auxiliary Hono Worker in the same process using isolated local D1 and optional R2. Copy `apps/api/.dev.vars.example` to `.dev.vars`; configure `PUBLIC_APP_URL` and a private `BETTER_AUTH_SECRET`. Never put server secrets in web/public variables.
|
|
100
33
|
|
|
101
|
-
|
|
34
|
+
Review initial SQL, then deliberately run `pnpm db:migrate --local`. For later schema additions, run `pnpm db:generate`, inspect the SQL and apply it explicitly. Remote migration requires deliberate `--remote` selection. Builds, startup and ordinary checks never migrate a configured database.
|
|
102
35
|
|
|
103
|
-
|
|
36
|
+
Better Auth methods start disabled. Configure credentials, email/policy, schema and client flows before enabling chosen methods. The sign-in page is an example, not automatic activation. R2 remains private and file routes enforce authenticated ownership.
|
|
104
37
|
|
|
105
|
-
|
|
38
|
+
Stripe adds source/schema, not a live payment service. Generate and review its billing migration before webhook tests. Configure test credentials, allowed prices and signed webhooks deliberately. Server-side canonical provider state controls entitlements; redirects, client claims and webhook ordering do not grant access. Live mode and real charges require separate activation.
|
|
106
39
|
|
|
40
|
+
## Source and hosting contracts
|
|
107
41
|
|
|
108
|
-
|
|
42
|
+
`anhedral.json` records nonsecret generator/capability versions and identity. Source provenance never grants hosting authority. The public deployment manifest uses runtime profile `anhedral-stack` for the web foundation and selected backend/R2/Stripe composition. Artifact identity, resource provisioning, secrets, migrations, runtime checks and production approval remain server-owned. See [the workflow](software-factory.md#platform-cli-access-and-source-upload).
|
|
109
43
|
|
|
110
|
-
|
|
44
|
+
Run `pnpm check` and `pnpm audit:deps` in generated applications. Framework/runtime, provider and browser acceptance are distinct; source installation alone establishes none of them.
|
package/docs/software-factory.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Anhedral Stack workflow
|
|
2
|
+
|
|
3
|
+
The Anhedral Stack has one current web foundation and progressive backend/storage/payment additions. There is no public stack selection or independent stack-registry repository.
|
|
2
4
|
|
|
3
5
|
1. Preview an empty destination with `anhedral init my-app --dry-run --json`, then
|
|
4
6
|
run `anhedral init my-app` and `pnpm dev` inside it.
|
|
@@ -23,17 +25,214 @@ with revision, checks, failures and remaining gaps. Keep raw reports in ignored
|
|
|
23
25
|
`.artifacts/`. Historical notes are not current instructions.
|
|
24
26
|
|
|
25
27
|
Canonical docs live in `docs/`; `pnpm build` refreshes bundled plugin references.
|
|
26
|
-
|
|
28
|
+
Current generated app guidance lives in `src/launch.ts`. OJ runs development and builds for the single TanStack Start foundation. Preserve shipped
|
|
27
29
|
reference paths, source-generation safety, dependency patch gates, UI provenance,
|
|
28
30
|
licenses and exact-artifact packaging. A build does not publish npm or update an
|
|
29
31
|
installed plugin. See [Contributing](https://github.com/anhedral/anhedral-cli/blob/main/.github/CONTRIBUTING.md)
|
|
30
32
|
for staging, release identity and validation tiers.
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
This repository also works as a Git submodule. Its own `pnpm-workspace.yaml`,
|
|
35
|
+
lockfile and safe `.npmrc` keep installs independent of a parent workspace;
|
|
36
|
+
the parent must exclude the CLI from its package graph. Run install/build/tests
|
|
37
|
+
inside this checkout with its pinned package manager. Commit public changes here
|
|
38
|
+
separately, then update the parent's Git pointer only after that commit is reviewed
|
|
39
|
+
and available in this repository. Never copy parent configuration, credentials or
|
|
40
|
+
implementation into this checkout. Public CI checks out only this repository,
|
|
41
|
+
without recursive submodules; publishing rejects calls from another repository.
|
|
42
|
+
These checks do not make a submodule a security sandbox: review tracked files,
|
|
43
|
+
package contents, inherited environment and publication authority independently.
|
|
44
|
+
|
|
45
|
+
The reviewed public module inventory in `scripts/public-package-policy.json` and
|
|
46
|
+
`pnpm check:boundaries` constrain compilation and package preparation; an unexpected
|
|
47
|
+
dist module or private import requires explicit review. Portable contracts are
|
|
48
|
+
synced only from a reviewed, licensed Platform projection with exact provenance,
|
|
49
|
+
never as a build side effect. Local credential scanning additionally retains the
|
|
50
|
+
CLI's stricter source-upload policy. Plugin packaging accepts its explicit reviewed
|
|
51
|
+
skills-only file set, refuses linked distribution roots and verifies the bounded
|
|
52
|
+
publisher archive format before npm publication. Oversized unscanned text is an
|
|
53
|
+
explicit review failure, not a clean secret scan.
|
|
54
|
+
|
|
55
|
+
## Runtime verification
|
|
56
|
+
|
|
57
|
+
Routine CI compiles the CLI once and runs fast source/security checks and selected
|
|
58
|
+
contract tests. Generated applications are not installed or built in that path.
|
|
59
|
+
Dispatch [CI](https://github.com/anhedral/anhedral-cli/blob/main/.github/workflows/ci.yml) with `runtime_proof` enabled for the
|
|
60
|
+
Anhedral Stack proof and one-day measurements. Broader compatibility and generated
|
|
61
|
+
application matrices remain in [Full validation](https://github.com/anhedral/anhedral-cli/blob/main/.github/workflows/validation.yml).
|
|
62
|
+
|
|
63
|
+
`node scripts/tanstack-runtime-smoke.mjs` installs a disposable Anhedral Stack
|
|
64
|
+
application and exercises local workerd, SSR/server functions, progressive backend,
|
|
65
|
+
private storage and the generated Stripe build/migration path. The compiled web
|
|
66
|
+
and API Workers run together with the migrated local D1 state. Bundle measurements
|
|
67
|
+
follow OJ’s emitted Worker configuration and count its runtime modules. It uses
|
|
68
|
+
isolated local data, never a configured database or live payment provider. Preserve source/tool/lock identities and distinguish prepared,
|
|
69
|
+
passed and failed evidence. Tests are not provider deployment acceptance. Run
|
|
70
|
+
`node tests/test-generated-config-lint.mjs <installed-workspace>` to exercise the
|
|
71
|
+
generated web ESLint policy; runtime proof checks both web-only and composed source.
|
|
72
|
+
|
|
73
|
+
Backend server entries call TanStack’s `createStartHandler(defaultStreamHandler)` directly so request-local API bindings survive OJ compilation. Source additions repair the exact previous owned adapter and preserve customer edits.
|
|
74
|
+
|
|
75
|
+
OJ dev commands attach an explicit host value with `--host=<hostname>`, as required by the pinned runtime. Generated workspaces explicitly allow dependency build scripts only for esbuild and workerd through the pnpm `allowBuilds` map. This keeps installation noninteractive under the pinned pnpm release and pnpm11 without allowing arbitrary dependency scripts.
|
|
76
|
+
|
|
77
|
+
## Platform CLI access and source upload
|
|
78
|
+
|
|
79
|
+
`login --start` prints browser approval instructions; `login --resume` redeems the
|
|
80
|
+
saved approval. Interactive `login` polls after showing the URL and confirmation
|
|
81
|
+
code. Tokens and device secrets use macOS Keychain or Linux Secret Service;
|
|
82
|
+
`--credential-file <path>` explicitly selects an owner-only file. Credential
|
|
83
|
+
storage is currently unsupported on Windows. Credentials are
|
|
84
|
+
bound to the explicit `--api-url` origin (HTTPS, with literal loopback for fixtures).
|
|
85
|
+
Do not use repository configuration to select the credential destination. `logout`
|
|
86
|
+
revokes server access before removing the saved credential; `whoami` checks live
|
|
87
|
+
identity. Add `whoami --context --human` (or `--context --json`) to inspect the
|
|
88
|
+
selected origin, credential-store kind and saved local team/project link. Identity
|
|
89
|
+
is checked live; the saved project link is explicitly not proof of current project
|
|
90
|
+
access. A link for a different origin or principal fails closed. Normal `whoami`
|
|
91
|
+
JSON is unchanged and context inspection never creates a project or starts login.
|
|
92
|
+
Explicit `--api-url` and `--credential-file` select the origin/store; saved state
|
|
93
|
+
cannot override either. API access must be separately enabled by Platform operators.
|
|
94
|
+
|
|
95
|
+
After generating source, run `projects list --human` to discover the selected
|
|
96
|
+
team's projects and accessible team IDs. Use `--team <uuid>` to select another
|
|
97
|
+
team and `--cursor <uuid>` for the next page. `projects create --name <name>
|
|
98
|
+
--link --human` registers a new Platform project and links the current directory;
|
|
99
|
+
omit `--link` to register it without changing local context. `--summary <text>`
|
|
100
|
+
is optional. Creation registers existing source for upload; it does not generate
|
|
101
|
+
another application or start a deployment. `projects create --dry-run` validates
|
|
102
|
+
the proposed input locally without authentication or network access.
|
|
103
|
+
|
|
104
|
+
Creation saves its request identity under `.anhedral/platform/` before sending
|
|
105
|
+
it. Repeat the same command after interruption to recover the same project;
|
|
106
|
+
changed input, identity or team requires review and an explicit `--new` request.
|
|
107
|
+
`--link` refuses a different existing local link. Init's source identity remains
|
|
108
|
+
unchanged. Platform checks current team membership and project permissions.
|
|
109
|
+
Project creation, linking and unlinking share a workspace lock. After a process
|
|
110
|
+
crash, inspect `.anhedral/platform/project-operation.lock` and remove only that
|
|
111
|
+
lock after confirming no project operation is running; preserve the request journal.
|
|
112
|
+
|
|
113
|
+
`link --project <uuid> --team <uuid>` checks current build authority and saves an
|
|
114
|
+
origin/principal-bound link under ignored `.anhedral/platform/`. `unlink` removes
|
|
115
|
+
that local link. `source upload --dry-run` inspects packaging; `source upload`
|
|
116
|
+
resumes the same immutable source request after interruption, including lost
|
|
117
|
+
responses. `source status` reads its server receipt. Changed source requires an
|
|
118
|
+
explicit `source upload --new`; an expired request also requires a new request.
|
|
119
|
+
The client honors nested `.gitignore`, excludes generated output and secret paths,
|
|
120
|
+
rejects symlinks and recognized credential material, and hashes every bounded
|
|
121
|
+
chunk plus the complete archive and canonical source inventory. The generated
|
|
122
|
+
`apps/web/src/routeTree.gen.ts` is excluded because the router regenerates it during
|
|
123
|
+
checks/builds; authored routes, router configuration and server source remain
|
|
124
|
+
included. Credential scanning is deliberately conservative; inspect source before uploading.
|
|
125
|
+
|
|
126
|
+
Public upload limits and message shapes live in `src/contracts`; protocol code is
|
|
127
|
+
in `src/platform-command.ts`. The server independently authenticates the caller,
|
|
128
|
+
checks current tenant/project authority and revocation, validates source, and
|
|
129
|
+
enforces admission. Client checks and supplied IDs cannot grant access. Upload
|
|
130
|
+
does not deploy, activate providers, migrate a database or replace identities.
|
|
131
|
+
Run `tests/test-platform.test.mjs` after building for isolated client fixtures.
|
|
132
|
+
|
|
133
|
+
`deploy plan --manifest <file>` plans from the saved sealed upload, independently
|
|
134
|
+
of subsequent local edits. The manifest follows Platform's `deploymentManifestSchema`
|
|
135
|
+
in `src/contracts/deployment.ts`; it must match the archive's recorded composition,
|
|
136
|
+
capabilities, CLI version and existing standalone identity. Runtime-profile admission is server-owned. Staged server sources include Hono/D1
|
|
137
|
+
and web candidates; source support does not establish a deployed cohort or provider readiness. Plans bind source/lockfile/migrations,
|
|
138
|
+
routing state, principal epoch and project authority. Signed plans report current artifact, source-version and dependency-lock compatibility.
|
|
139
|
+
A null project configuration revision means deployment has not yet captured its environment snapshot; it is not a request to find an operator approver.
|
|
140
|
+
Anhedral Stack source composition version 2 records framework foundation
|
|
141
|
+
`tanstack-start`; the public runtime profile is `anhedral-stack`. Its five compositions are
|
|
142
|
+
web-only, backend (`hono` plus `database-auth`), backend/R2, backend/Stripe and
|
|
143
|
+
backend/R2/Stripe. Backend manifests preserve `better-auth-d1-v1`; web-only uses
|
|
144
|
+
`none`. Broader retained capability/protocol values are compatibility implementation,
|
|
145
|
+
not current public selections or hosted support.
|
|
146
|
+
Continue selecting an explicit manifest; the CLI never infers an admitted artifact
|
|
147
|
+
from locally generated source. Native candidate receipts name an immutable registry
|
|
148
|
+
image with `scope: candidate-workspace`; legacy isolated-build receipts remain valid.
|
|
149
|
+
Both describe automatic build compatibility, not a requirement for a human artifact approver. Plans list exact runtime, source-version or lockfile mismatches and remediation. Do not relabel source provenance to clear a mismatch.
|
|
150
|
+
|
|
151
|
+
`deploy prepare` reserves an immutable candidate. `deploy status` reads
|
|
152
|
+
`awaiting-runtime`, `building`, `built`, `ready` or `failed`. A built candidate grants no
|
|
153
|
+
preview or publishing capability. A `ready` receipt reports Platform-admitted hosted
|
|
154
|
+
readiness; it does not approve production publication. Runtime admission and build
|
|
155
|
+
enforcement remain server-owned. These commands never provision, migrate, activate a preview or
|
|
156
|
+
deploy. Lost responses resume the same saved request. Changed manifest inputs or
|
|
157
|
+
routing require `deploy plan --manifest <file> --new`. Plan/source expiry and
|
|
158
|
+
revocation fail closed. State under `.anhedral/platform/deployment.json` contains
|
|
159
|
+
no credentials and cannot select a network origin or change the signed-in identity.
|
|
160
|
+
|
|
161
|
+
`env list` returns names, types, environments and versions. `env import --environment
|
|
162
|
+
staging|production --file <path>` reads a private dotenv file; `--stdin` accepts a
|
|
163
|
+
pipe. `env set <NAME>` reads one literal value from a file or pipe. Values are
|
|
164
|
+
never arguments, output or retry-state contents. Non-public names default to
|
|
165
|
+
secrets; `--type config` is explicit readable configuration. Public-prefixed
|
|
166
|
+
secrets, reserved names, duplicate names and oversized input fail before upload.
|
|
167
|
+
Files require owner-only permissions and a regular non-symlink final file;
|
|
168
|
+
ancestor checks reject observed symlinks but are not an atomic directory lock.
|
|
169
|
+
Use `--dry-run` without authentication for names/types only. Actual imports bind
|
|
170
|
+
API origin, principal, team, project and environment, require `--replace` for
|
|
171
|
+
existing variables, and resume one request after a lost response. Use `--new` for
|
|
172
|
+
a different import. Receipts are checked against names, types and expected versions.
|
|
173
|
+
Production changes remain subject to Platform approval and deployment policy.
|
|
174
|
+
|
|
175
|
+
`staging status` reads persistent staging history. `staging deploy --candidate
|
|
176
|
+
<uuid>` selects a ready candidate, freezes the current staging configuration and
|
|
177
|
+
retains one generation-bound request across retries. `--new` starts another
|
|
178
|
+
deployment after reviewing the current state. Saved receipts must match their
|
|
179
|
+
project, candidate, request and generation before replay. CLI runtime admission remains a
|
|
180
|
+
separate server gate; a built source upload alone is not a ready candidate.
|
|
181
|
+
`production status` reads current production generation, deployment history and approval policy. `production deploy --candidate <uuid> --name <slug>` freezes production configuration and publishes through the signed-in user's existing production permissions. Self-service teams need no second approver; an explicit independent-review policy remains enforced. Lost responses reuse the saved request and generation; use `--new` only for another candidate, name or deliberate deployment.
|
|
182
|
+
|
|
183
|
+
`logs` reads bounded, redacted runtime events, defaulting to staging. Select
|
|
184
|
+
production explicitly with `--environment production`; filter by deployment,
|
|
185
|
+
level, source or range, and pass `--cursor` for the next page. Coverage, dropped
|
|
186
|
+
events and seven-day retention are part of the response.
|
|
187
|
+
|
|
188
|
+
The plugin contains CLI usage instructions only. It registers no MCP server, remote
|
|
189
|
+
app, OAuth connection or executable hook, and it does not bundle a CLI runtime.
|
|
190
|
+
Users run the reviewed CLI version in a host terminal; managed project operations
|
|
191
|
+
use the separately configured CLI client described above. Packaging admits only
|
|
192
|
+
reviewed skills, references, assets and host manifests, and rejects connection files
|
|
193
|
+
or executable declarations. `tests/test-plugin-codex.test.mjs` installs the exact
|
|
194
|
+
archive in an isolated Codex home and verifies both skills with no MCP, app or hook
|
|
195
|
+
registration when Codex is available (`ANHEDRAL_CODEX_BIN` overrides the binary).
|
|
196
|
+
|
|
197
|
+
One distribution directory, `plugin/`, serves Codex and Claude Code. Codex reads
|
|
198
|
+
`plugin.json` and `skills/*/agents/openai.yaml`; Claude Code reads
|
|
199
|
+
`.claude-plugin/plugin.json` and the same `skills/*/SKILL.md`. Packaging validates
|
|
200
|
+
both manifests against one release identity. Root `.claude-plugin/marketplace.json`
|
|
201
|
+
is the Claude marketplace; add it with `claude plugin marketplace add
|
|
202
|
+
anhedral/anhedral-cli`, then install `anhedral@anhedral`. The existing pinned tag
|
|
203
|
+
predates the Claude files and this cleanup; a coordinated versioned release is
|
|
204
|
+
required before those changes are installable from the public marketplace. Local
|
|
205
|
+
review uses `claude plugin validate --strict plugin`, `claude --plugin-dir plugin`
|
|
206
|
+
and a temporary Codex marketplace, without account connection.
|
|
207
|
+
|
|
208
|
+
The CLI and plugin share one release version. Build prepares the
|
|
209
|
+
marketplace pointer to that version's immutable `plugin-v<version>` tag; it does
|
|
210
|
+
not create the tag or publish either artifact. During review that pointer may be
|
|
211
|
+
unavailable. Install an already published version until the coordinated release
|
|
212
|
+
has completed and its tag and artifact integrities have been verified.
|
|
213
|
+
|
|
214
|
+
## CLI presentation compatibility
|
|
215
|
+
|
|
216
|
+
The command schema owns options, nested help and offline shell completion. Root
|
|
217
|
+
help is an index; leaf help includes examples. Keep executable and exported parser
|
|
218
|
+
contracts covered by `test-cli-discovery`, `test-cli-experience`, `test-cli-output`,
|
|
219
|
+
`test-completion` and `test-platform-ux`. The CI gate runs these alongside existing
|
|
220
|
+
contracts; the executable suite accepts `ANHEDRAL_CLI_BIN` to validate an installed
|
|
221
|
+
exact candidate without contacting Platform.
|
|
222
|
+
|
|
223
|
+
Results belong on stdout; errors and permitted diagnostics belong on stderr.
|
|
224
|
+
Platform retains implicit compact JSON for compatibility, with opt-in `--human`.
|
|
225
|
+
Other families retain human defaults and explicit `--json`. Quiet suppresses
|
|
226
|
+
ordinary results unless JSON was explicitly requested. Explicit JSON, quiet,
|
|
227
|
+
headless input/output, CI and `--non-interactive` cannot initiate interactive
|
|
228
|
+
approval polling; `login --resume` explicitly redeems an existing approval.
|
|
33
229
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
230
|
+
Numeric failure status remains 1. Existing error fields/code families remain;
|
|
231
|
+
usage errors classify invalid origins and selectors before credential/network
|
|
232
|
+
access, including environment, staging and log selectors. Credential-store helpers
|
|
233
|
+
have bounded execution. Logout revokes server access first; a failed local deletion
|
|
234
|
+
reports cleanup still pending instead of successful logout. Categories and retryability are additive diagnostics, not authorization
|
|
235
|
+
to repeat a mutation. In particular, post-commit failures retain source, expose
|
|
236
|
+
committed paths and require repairing only the failed follow-up. Upload/deployment
|
|
237
|
+
retries keep the existing immutable request identity. None of these presentation
|
|
238
|
+
changes alters server admission or activates hosted execution.
|
package/docs/stack-standard.md
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
# Stack
|
|
1
|
+
# Anhedral Stack
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Anhedral UI. Add Hono, then Drizzle/D1 and Better Auth. Add private R2, payments,
|
|
5
|
-
realtime, AI and other clients as required. The [README](https://github.com/anhedral/anhedral-cli#readme) lists every
|
|
6
|
-
addition; [capabilities](capabilities.md) owns prerequisites and safety.
|
|
3
|
+
**Anhedral Stack** is the single current stack. The CLI generates its editable source; Platform independently owns managed builds, resource admission, deployment and operations. There is no public multi-stack registry or framework selector.
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
adapt forms and call the API. Share framework-independent contracts and tokens
|
|
10
|
-
without cross-importing application source. Keep R2 private and enforce identity,
|
|
11
|
-
ownership and limits before exposing files. Apply reviewed database migrations
|
|
12
|
-
explicitly, separately from builds and startup.
|
|
5
|
+
The web foundation uses TanStack Start SSR/server functions and source-owned shadcn Anhedral UI. `anhedral init` creates only that foundation. `add backend` composes Hono, Drizzle/D1 and Better Auth together. Add private R2 or Stripe subscriptions later when needed. See [additions](capabilities.md).
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
for Expo and a small reviewed native extension layer. Preserve licenses, semantic
|
|
16
|
-
tokens and local edits. See [UI commands](ui.md).
|
|
7
|
+
When selected, Hono owns privileged business/auth/data/storage operations. Web server functions call its scoped service binding; application source is never imported across application boundaries. Keep resources private, enforce identity/ownership/limits and configure secrets per environment.
|
|
17
8
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
reviewed pins until deliberately adopted and validated.
|
|
9
|
+
Auth methods and payment providers require explicit activation. Apply reviewed migrations separately from builds/startup. Source-owned UI preserves semantic tokens, consumer edits and upstream licensing; see [UI ownership](ui.md).
|
|
10
|
+
|
|
11
|
+
Recorded source provenance is not a hosting receipt. Runtime profile `anhedral-stack` identifies the current deployment contract; exact artifact/runtime policy, current authority and production approval still apply. Legacy generators, framework aliases and compatibility stack selection are removed. OJ is pinned by the generated runtime manifest.
|