@happyvertical/smrt-template-sveltekit 0.60.15 → 0.60.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -13,6 +13,12 @@ It is the ground-up alternative to `smrt-start`.
13
13
 
14
14
  ## Current generated-project contract
15
15
 
16
+ - `template/compose.yaml` carries the `x-happyvertical` deployment declaration
17
+ (contract v1, `@happyvertical/smrt-config/deployment`). It is the source of
18
+ `charts/smrt-app/fixtures/starter.json`: after changing its services or
19
+ annotations run `node scripts/compose-contract-fixture.mjs --write` and
20
+ commit the fixture; `scripts/compose-contract.test.mjs` fails on drift.
21
+
16
22
  - Node `>=26.0.0`; pnpm `11.25.0` via `packageManager` and `engines`. Node 25+
17
23
  images ship no Corepack, so the Dockerfile installs a pinned copy.
18
24
  - `runtime.profile` is the canonical infrastructure selector. Generated apps
@@ -1,4 +1,4 @@
1
1
  {
2
- "@happyvertical/smrt-app-mcp": "^0.60.15",
3
- "@happyvertical/smrt-mcp-openai": "^0.60.15"
2
+ "@happyvertical/smrt-app-mcp": "^0.60.17",
3
+ "@happyvertical/smrt-mcp-openai": "^0.60.17"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-template-sveltekit",
3
- "version": "0.60.15",
3
+ "version": "0.60.17",
4
4
  "description": "Minimal SvelteKit project template with s-m-r-t framework integration",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -37,26 +37,26 @@
37
37
  "directory": "packages/template-sveltekit"
38
38
  },
39
39
  "peerDependencies": {
40
- "@happyvertical/smrt-core": "0.60.15"
40
+ "@happyvertical/smrt-core": "0.60.17"
41
41
  },
42
42
  "devDependencies": {
43
- "@happyvertical/smrt-app-cli": "0.60.15",
44
- "@happyvertical/smrt-app-mcp": "0.60.15",
45
- "@happyvertical/smrt-app-runtime": "0.60.15",
46
- "@happyvertical/smrt-assets": "0.60.15",
47
- "@happyvertical/smrt-chat": "0.60.15",
48
- "@happyvertical/smrt-cli": "0.60.15",
49
- "@happyvertical/smrt-config": "0.60.15",
50
- "@happyvertical/smrt-jobs": "0.60.15",
51
- "@happyvertical/smrt-mcp-openai": "0.60.15",
52
- "@happyvertical/smrt-playbooks": "0.60.15",
53
- "@happyvertical/smrt-profiles": "0.60.15",
54
- "@happyvertical/smrt-scanner": "0.60.15",
55
- "@happyvertical/smrt-svelte": "0.60.15",
56
- "@happyvertical/smrt-tenancy": "0.60.15",
57
- "@happyvertical/smrt-ui": "0.60.15",
58
- "@happyvertical/smrt-users": "0.60.15",
59
- "@happyvertical/smrt-web": "0.60.15",
43
+ "@happyvertical/smrt-app-cli": "0.60.17",
44
+ "@happyvertical/smrt-app-mcp": "0.60.17",
45
+ "@happyvertical/smrt-app-runtime": "0.60.17",
46
+ "@happyvertical/smrt-assets": "0.60.17",
47
+ "@happyvertical/smrt-chat": "0.60.17",
48
+ "@happyvertical/smrt-cli": "0.60.17",
49
+ "@happyvertical/smrt-config": "0.60.17",
50
+ "@happyvertical/smrt-jobs": "0.60.17",
51
+ "@happyvertical/smrt-mcp-openai": "0.60.17",
52
+ "@happyvertical/smrt-playbooks": "0.60.17",
53
+ "@happyvertical/smrt-profiles": "0.60.17",
54
+ "@happyvertical/smrt-scanner": "0.60.17",
55
+ "@happyvertical/smrt-svelte": "0.60.17",
56
+ "@happyvertical/smrt-tenancy": "0.60.17",
57
+ "@happyvertical/smrt-ui": "0.60.17",
58
+ "@happyvertical/smrt-users": "0.60.17",
59
+ "@happyvertical/smrt-web": "0.60.17",
60
60
  "@happyvertical/sql": "^0.89.12",
61
61
  "@modelcontextprotocol/client": "2.3.1",
62
62
  "@modelcontextprotocol/server": "^2.3.1",
@@ -70,7 +70,7 @@
70
70
  "typescript": "6.0.3",
71
71
  "vite": "8.1.6",
72
72
  "vitest": "4.1.10",
73
- "@happyvertical/smrt-reports": "0.60.15"
73
+ "@happyvertical/smrt-reports": "0.60.17"
74
74
  },
75
75
  "publishConfig": {
76
76
  "registry": "https://registry.npmjs.org",
@@ -1,5 +1,18 @@
1
1
  # s-m-r-t SvelteKit app
2
2
 
3
+ <!-- smrt:agents:begin -->
4
+ ## smrt framework
5
+
6
+ - Framework reference: `.agents/smrt-framework.md`
7
+ - Intent index: `.agents/smrt-knowledge/intents/index.md`
8
+ - Before adding infrastructure, utility or integration code, read the intent index.
9
+ - If smrt has the home package but lacks the behaviour, or lacks it entirely, file an issue on happyvertical/smrt and mark any local shim temporary: framework first, no glue.
10
+ - Refresh this block and the references: `smrt docs:agents`.
11
+ - Check for duplicated capability: `smrt-dev-mcp review --directory . --format summary`.
12
+
13
+ _Generated; edit outside the markers only. Text between them is replaced on refresh._
14
+ <!-- smrt:agents:end -->
15
+
3
16
  This project uses s-m-r-t objects to generate REST routes, CLI commands, MCP
4
17
  tools, WebMCP definitions, and agent/developer knowledge artifacts.
5
18
 
@@ -67,6 +80,12 @@ tools, WebMCP definitions, and agent/developer knowledge artifacts.
67
80
  Keep the guard in place for SSR and seed live collections with SSR
68
81
  `initialData`.
69
82
  - Do not enable knowledge HTTP routes in production without explicit admin auth.
83
+ - `compose.yaml` is the deployment declaration: its `x-happyvertical` fields
84
+ (`role`, `health`, `binding`, top-level `migrate`) are what a hosting
85
+ platform that implements the contract reads and what
86
+ `smrt deploy:chart-values` renders. Keep them when editing services, keep
87
+ `entrypoint` equal to the image's own (the chart replaces it), use no `$`
88
+ variables in `command`, and run `pnpm deploy:check` after any Compose change.
70
89
  - Run task and schedule workers as separate deployed processes. The worker
71
90
  imports `.smrt/runtime/register.js` (compiled by `pnpm build`) before any
72
91
  runner starts, so jobs can target this app's own `@smrt()` objects; keep that
@@ -10,6 +10,10 @@ RUN pnpm build
10
10
 
11
11
  FROM node:26.12.1-alpine@sha256:ae8e1c19d56886270987e99b3cfcef13a919f0655b376ae322bc64ada76f88cd AS runtime
12
12
  WORKDIR /app
13
+ # The pnpm that `pnpm install` below downloads lives in a shared Corepack home
14
+ # the runtime user can read, so a worker or health command that goes through
15
+ # pnpm never downloads it again at container start.
16
+ ENV COREPACK_HOME=/usr/local/share/corepack
13
17
  RUN npm install --global corepack@0.36.0 && corepack enable
14
18
  COPY --from=build /app/package.json /app/pnpm-lock.yaml* /app/pnpm-workspace.yaml ./
15
19
  RUN pnpm install --frozen-lockfile --prod=false
@@ -18,7 +22,7 @@ ENV SMRT_RUNTIME_PROFILE=self-hosted
18
22
  COPY --from=build /app/build ./build
19
23
  COPY --from=build /app/.smrt ./.smrt
20
24
  COPY --from=build /app/smrt.config.ts ./smrt.config.ts
21
- RUN chown -R node:node /app
25
+ RUN chown -R node:node /app /usr/local/share/corepack
22
26
  USER node
23
27
  EXPOSE 3000
24
28
  CMD ["node", "build"]
@@ -409,6 +409,18 @@ concerns are intentionally absent here.
409
409
  - `cloud`: hosted identity, managed providers, required tenant context, and
410
410
  scalable workers. `.env.cloud.example` records the composition boundary.
411
411
 
412
+ `compose.yaml` is also the app's deployment declaration. Its `x-happyvertical`
413
+ fields name the web service and its health path, the two workers, the
414
+ migration command, and the `database` service as a stand-in for a platform's
415
+ PostgreSQL. Compose ignores them, so the file runs unchanged; `pnpm
416
+ deploy:check` validates the declaration against the supported platform subset,
417
+ and `pnpm exec smrt deploy:chart-values` renders it for the `smrt-app` chart.
418
+ The one-shot `migrate` service has no annotation and stays local: a platform
419
+ runs the declared migration command inside the web image instead. The three
420
+ application services set `entrypoint` to the node image's own entrypoint, which
421
+ changes nothing for Compose and lets a rendering that replaces the entrypoint
422
+ start the same process.
423
+
412
424
  The adapter-node `Dockerfile` and `compose.yaml` provide the production path.
413
425
  Compose gates the web and both workers on the one-shot, idempotent migration
414
426
  service. The runtime image retains the generated manifest and operator CLI for
@@ -1,33 +1,67 @@
1
1
  x-runtime-environment: &runtime-environment
2
2
  DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL in the ignored .env file}
3
3
 
4
+ # Deployment declaration (contract version 1). Compose ignores `x-` keys, so
5
+ # this file still runs as it always did. A platform that reads the contract
6
+ # deploys the `role` services from image digests, runs `migrate` before each
7
+ # release, and provides its own service in place of every `binding`.
8
+ # Check it with `pnpm exec smrt deploy:check`.
9
+ #
10
+ # `entrypoint` on the three application services repeats the node image's own
11
+ # entrypoint, so Compose runs exactly what it ran before, and a rendering that
12
+ # replaces the entrypoint (the smrt-app chart) starts the same process.
13
+ x-happyvertical:
14
+ version: 1
15
+ preset: smrt
16
+ # domain: app.example.com
17
+ migrate:
18
+ command: ["pnpm", "exec", "smrt", "db:migrate"]
19
+
4
20
  services:
5
21
  web:
6
22
  build: .
7
23
  env_file: .env.self-hosted
8
24
  environment: *runtime-environment
25
+ entrypoint: ["docker-entrypoint.sh"]
9
26
  command: node build
10
27
  ports:
11
28
  - "3000:3000"
12
29
  depends_on:
13
30
  migrate:
14
31
  condition: service_completed_successfully
32
+ x-happyvertical:
33
+ role: web
34
+ health:
35
+ path: /api/_runtime/health
15
36
  worker:
16
37
  build: .
17
38
  env_file: .env.self-hosted
18
39
  environment: *runtime-environment
40
+ entrypoint: ["docker-entrypoint.sh"]
19
41
  command: pnpm exec smrt app worker task
20
42
  depends_on:
21
43
  migrate:
22
44
  condition: service_completed_successfully
45
+ x-happyvertical:
46
+ role: worker
47
+ health:
48
+ command: ["pnpm", "exec", "smrt", "app", "doctor"]
23
49
  schedule-worker:
24
50
  build: .
25
51
  env_file: .env.self-hosted
26
52
  environment: *runtime-environment
53
+ entrypoint: ["docker-entrypoint.sh"]
27
54
  command: pnpm exec smrt app worker schedule
28
55
  depends_on:
29
56
  migrate:
30
57
  condition: service_completed_successfully
58
+ x-happyvertical:
59
+ role: worker
60
+ health:
61
+ command: ["pnpm", "exec", "smrt", "app", "doctor"]
62
+ # Local and self-hosted one-shot migration. It has no annotation, so a
63
+ # platform does not run it: there the `migrate` command above runs inside
64
+ # the web image.
31
65
  migrate:
32
66
  build:
33
67
  context: .
@@ -52,6 +86,8 @@ services:
52
86
  volumes:
53
87
  # PostgreSQL 18+ keeps PGDATA under /var/lib/postgresql/18/docker.
54
88
  - postgres-data:/var/lib/postgresql
89
+ x-happyvertical:
90
+ binding: postgres
55
91
 
56
92
  volumes:
57
93
  postgres-data:
@@ -28,7 +28,9 @@
28
28
  "app:import": "smrt app import",
29
29
  "mcp-apps:validate": "pnpm exec smrt mcp-apps validate --output-dir ./mcp-apps",
30
30
  "worker": "smrt app worker task",
31
- "worker:schedule": "smrt app worker schedule"
31
+ "worker:schedule": "smrt app worker schedule",
32
+ "deploy:check": "smrt deploy:check",
33
+ "docs:agents": "smrt docs:agents"
32
34
  },
33
35
  "devDependencies": {
34
36
  "@sveltejs/adapter-node": "^5.5.7",
@@ -39,21 +41,21 @@
39
41
  "svelte-check": "^4.7.6",
40
42
  "typescript": "6.0.3",
41
43
  "vite": "8.3.3",
42
- "@happyvertical/smrt-cli": "^0.60.15"
44
+ "@happyvertical/smrt-cli": "^0.60.17"
43
45
  },
44
46
  "dependencies": {
45
- "@happyvertical/smrt-app-runtime": "^0.60.15",
46
- "@happyvertical/smrt-config": "^0.60.15",
47
- "@happyvertical/smrt-core": "^0.60.15",
48
- "@happyvertical/smrt-jobs": "^0.60.15",
49
- "@happyvertical/smrt-profiles": "^0.60.15",
50
- "@happyvertical/smrt-svelte": "^0.60.15",
51
- "@happyvertical/smrt-tenancy": "^0.60.15",
52
- "@happyvertical/smrt-ui": "^0.60.15",
53
- "@happyvertical/smrt-users": "^0.60.15",
54
- "@happyvertical/smrt-web": "^0.60.15",
47
+ "@happyvertical/smrt-app-runtime": "^0.60.17",
48
+ "@happyvertical/smrt-config": "^0.60.17",
49
+ "@happyvertical/smrt-core": "^0.60.17",
50
+ "@happyvertical/smrt-jobs": "^0.60.17",
51
+ "@happyvertical/smrt-profiles": "^0.60.17",
52
+ "@happyvertical/smrt-svelte": "^0.60.17",
53
+ "@happyvertical/smrt-tenancy": "^0.60.17",
54
+ "@happyvertical/smrt-ui": "^0.60.17",
55
+ "@happyvertical/smrt-users": "^0.60.17",
56
+ "@happyvertical/smrt-web": "^0.60.17",
55
57
  "@happyvertical/sql": "^0.89.12",
56
58
  "@modelcontextprotocol/server": "^2.3.1",
57
- "@happyvertical/smrt-reports": "^0.60.15"
59
+ "@happyvertical/smrt-reports": "^0.60.17"
58
60
  }
59
61
  }
@@ -14,13 +14,12 @@
14
14
  * call them per request and never keep the result.
15
15
  */
16
16
 
17
- import { createProviderReadinessProbe } from '@happyvertical/smrt-app-runtime';
18
17
  import { createSmrtSvelteKitRuntime } from '@happyvertical/smrt-app-runtime/sveltekit';
19
18
 
20
19
  export const runtime = createSmrtSvelteKitRuntime({
21
20
  // Deployed profiles prove authentication, asset, and secret readiness
22
- // through the installed modules named by SMRT_*_READINESS_MODULE.
23
- providerReadiness: createProviderReadinessProbe,
21
+ // through the modules named by SMRT_*_READINESS_MODULE, or the default for the
22
+ // configured provider; pass `providerReadiness` only to replace that.
24
23
  // Per-object overrides, for example:
25
24
  // AuditLog: { db: { type: 'postgres', url: process.env.AUDIT_DB_URL! } }
26
25
  classOverrides: {},
@@ -19,23 +19,23 @@ export default {
19
19
 
20
20
  // Dependencies to add to generated project
21
21
  dependencies: {
22
- '@happyvertical/smrt-app-runtime': '^0.60.15',
23
- '@happyvertical/smrt-config': '^0.60.15',
24
- '@happyvertical/smrt-core': '^0.60.15',
25
- '@happyvertical/smrt-jobs': '^0.60.15',
26
- '@happyvertical/smrt-profiles': '^0.60.15',
27
- '@happyvertical/smrt-reports': '^0.60.15',
28
- '@happyvertical/smrt-svelte': '^0.60.15',
29
- '@happyvertical/smrt-tenancy': '^0.60.15',
30
- '@happyvertical/smrt-ui': '^0.60.15',
31
- '@happyvertical/smrt-users': '^0.60.15',
32
- '@happyvertical/smrt-web': '^0.60.15',
22
+ '@happyvertical/smrt-app-runtime': '^0.60.17',
23
+ '@happyvertical/smrt-config': '^0.60.17',
24
+ '@happyvertical/smrt-core': '^0.60.17',
25
+ '@happyvertical/smrt-jobs': '^0.60.17',
26
+ '@happyvertical/smrt-profiles': '^0.60.17',
27
+ '@happyvertical/smrt-reports': '^0.60.17',
28
+ '@happyvertical/smrt-svelte': '^0.60.17',
29
+ '@happyvertical/smrt-tenancy': '^0.60.17',
30
+ '@happyvertical/smrt-ui': '^0.60.17',
31
+ '@happyvertical/smrt-users': '^0.60.17',
32
+ '@happyvertical/smrt-web': '^0.60.17',
33
33
  '@happyvertical/sql': '^0.89.12',
34
34
  '@modelcontextprotocol/server': '^2.3.1',
35
35
  },
36
36
 
37
37
  devDependencies: {
38
- '@happyvertical/smrt-cli': '^0.60.15',
38
+ '@happyvertical/smrt-cli': '^0.60.17',
39
39
  '@sveltejs/adapter-node': '^5.5.7',
40
40
  '@sveltejs/kit': '2.70.3',
41
41
  '@sveltejs/vite-plugin-svelte': '^7.3.0',