@percepta/create 3.1.2 → 3.1.3

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 (43) hide show
  1. package/README.md +3 -4
  2. package/dist/{chunk-CG7IJSB4.js → chunk-CO3YWUD6.js} +2 -2
  3. package/dist/{chunk-WMJT7CB5.js → chunk-V5EJIUBJ.js} +5 -2
  4. package/dist/index.js +21 -53
  5. package/dist/{init-XDWSYHYK.js → init-EQZ2TCSJ.js} +2 -2
  6. package/dist/{status-BTHGN6QH.js → status-QW5TQDYY.js} +1 -1
  7. package/dist/{sync-3Q27L7XZ.js → sync-RLBZDOFB.js} +1 -1
  8. package/dist/{upstream-C5KFAHVR.js → upstream-TQFVPMEG.js} +1 -1
  9. package/package.json +1 -1
  10. package/templates/monorepo/.dockerignore +18 -0
  11. package/templates/webapp/.github/workflows/__APP_NAME__-ryvn-release.yaml +6 -2
  12. package/templates/webapp/.github/workflows/__APP_NAME__-terraform-ryvn-release.yaml +98 -0
  13. package/templates/webapp/AGENTS.md +17 -5
  14. package/templates/webapp/Dockerfile +16 -7
  15. package/templates/webapp/README.md +64 -2
  16. package/templates/webapp/agent-skills/deploy.md +48 -65
  17. package/templates/webapp/agent-skills/inngest.md +4 -4
  18. package/templates/webapp/agent-skills/langfuse.md +15 -14
  19. package/templates/webapp/agent-skills/llm.md +59 -0
  20. package/templates/webapp/agent-skills/oneshot.md +14 -1
  21. package/templates/webapp/agent-skills/ryvn.md +1 -1
  22. package/templates/webapp/deploy/README.md +34 -33
  23. package/templates/webapp/deploy/ryvn/__APP_NAME__-terraform.service.yaml +10 -0
  24. package/templates/webapp/deploy/ryvn/__APP_NAME__.service.yaml +2 -2
  25. package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__-terraform.env.percepta-test.serviceinstallation.yaml +11 -0
  26. package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__.env.percepta-test.serviceinstallation.yaml +45 -9
  27. package/templates/webapp/env.example.template +20 -2
  28. package/templates/webapp/eslint.config.mjs +6 -0
  29. package/templates/webapp/next.config.ts +9 -0
  30. package/templates/webapp/package.json.template +6 -2
  31. package/templates/webapp/scripts/deploy-percepta-test.ts +837 -0
  32. package/templates/webapp/scripts/migrate.ts +3 -0
  33. package/templates/webapp/scripts/open-ryvn-deploy-pr.ts +5 -3
  34. package/templates/webapp/scripts/with-local-env.ts +75 -0
  35. package/templates/webapp/src/config/getEnvConfig.ts +14 -0
  36. package/templates/webapp/src/instrumentation.ts +102 -10
  37. package/templates/webapp/src/services/llm/LLMService.ts +88 -0
  38. package/templates/webapp/src/services/llm/LlmProviderService.ts +85 -0
  39. package/templates/webapp/terraform/schema/main.tf +4 -0
  40. package/templates/webapp/terraform/schema/outputs.tf +9 -0
  41. package/templates/webapp/terraform/schema/variables.tf +19 -0
  42. package/templates/webapp/terraform/schema/versions.tf +38 -0
  43. package/templates/webapp/.github/workflows/__APP_NAME__-terraform.yml +0 -28
@@ -54,8 +54,9 @@ spec:
54
54
 
55
55
  env:
56
56
  # Database — shared `demos` DB on the percepta-internal Postgres instance.
57
- # Tables live under a per-app schema created by the infra PR. DATABASE_SCHEMA
58
- # pins the connection search_path so Drizzle migrations + queries land there.
57
+ # Tables live under a per-app schema created by the __APP_NAME__-terraform
58
+ # Ryvn service. DATABASE_SCHEMA pins the connection search_path so Drizzle
59
+ # migrations + queries land there.
59
60
  - name: DATABASE_HOST
60
61
  valueFrom:
61
62
  secretKeyRef:
@@ -93,11 +94,11 @@ spec:
93
94
  value: https://__APP_NAME__.percepta-test.aitco.dev
94
95
  - key: BETTER_AUTH_URL
95
96
  value: https://__APP_NAME__.percepta-test.aitco.dev
96
- # Import BETTER_AUTH_SECRET and ENCRYPTION_SECRET_KEY from
97
- # deploy/ryvn/percepta-test.secrets.env in the Ryvn UI after the installation
98
- # exists. Secret values are intentionally not declared in GitOps IaC.
97
+ # deploy:percepta-test patches BETTER_AUTH_SECRET and ENCRYPTION_SECRET_KEY
98
+ # from deploy/ryvn/percepta-test.secrets.env after the installation exists.
99
+ # Secret values are intentionally not declared in GitOps IaC.
99
100
 
100
- # Inngest (shared percepta-test instance)
101
+ # Inngest (shared percepta-test platform service)
101
102
  - key: INNGEST_BASE_URL
102
103
  value: http://inngest.percepta-test.svc.cluster.local:8288
103
104
  - key: INNGEST_EVENT_KEY
@@ -109,10 +110,45 @@ spec:
109
110
  - key: INNGEST_SERVE_HOST
110
111
  value: http://__APP_NAME__-web-server.percepta-test.svc.cluster.local:3000/api/inngest
111
112
 
112
- # OpenTelemetry
113
- - key: OTEL_METRICS_EXPORTER_OTLP_ENDPOINT
113
+ # Observability (shared percepta-test OTEL collector + LGTM stack)
114
+ # Application logs are emitted to stdout and collected by the shared OTEL
115
+ # collector. Traces and metrics are exported over OTLP HTTP.
116
+ - key: OTEL_SERVICE_NAME
117
+ value: __APP_NAME__
118
+ - key: OTEL_RESOURCE_ATTRIBUTES
119
+ value: service.namespace=__REPO_NAME__,deployment.environment=percepta-test
120
+ - key: OTEL_TRACES_EXPORTER
121
+ value: otlp
122
+ - key: OTEL_METRICS_EXPORTER
123
+ value: otlp
124
+ - key: OTEL_LOGS_EXPORTER
125
+ value: none
126
+ - key: OTEL_EXPORTER_OTLP_PROTOCOL
127
+ value: http/protobuf
128
+ - key: OTEL_EXPORTER_OTLP_ENDPOINT
129
+ value: http://otel-collector-opentelemetry-collector.percepta-test.svc.cluster.local:4318
130
+ - key: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
131
+ value: http://otel-collector-opentelemetry-collector.percepta-test.svc.cluster.local:4318/v1/traces
132
+ - key: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
114
133
  value: http://otel-collector-opentelemetry-collector.percepta-test.svc.cluster.local:4318/v1/metrics
115
- - key: OTEL_EXPORT_INTERVAL_MS
134
+ - key: OTEL_METRIC_EXPORT_INTERVAL
116
135
  value: "60000"
136
+ - key: NEXT_PUBLIC_FARO_APP_NAME
137
+ value: __APP_NAME__
138
+ - key: NEXT_PUBLIC_FARO_APP_VERSION
139
+ value: "0.1.0"
140
+ - key: NEXT_PUBLIC_FARO_APP_ENVIRONMENT
141
+ value: percepta-test
117
142
  - key: LOG_LEVEL
118
143
  value: debug
144
+
145
+ # Langfuse (shared percepta-test platform service). Project keys come from
146
+ # the demos-commons Ryvn variable group below.
147
+ - key: LANGFUSE_BASE_URL
148
+ value: https://langfuse.percepta-test.aitco.dev
149
+
150
+ # LLM provider (shared demo Anthropic key comes from demos-commons).
151
+ - key: LLM_PROVIDER
152
+ value: anthropic
153
+ variableGroups:
154
+ - name: demos-commons
@@ -19,9 +19,9 @@ BETTER_AUTH_URL=http://localhost:3000
19
19
  ENCRYPTION_SECRET_KEY=generate-with-node-e-console-log-require-crypto-randomBytes-16-toString-hex
20
20
 
21
21
  # Inngest (Background Jobs)
22
- # INNGEST_BASE_URL=
22
+ INNGEST_BASE_URL=http://localhost:8288
23
23
  # INNGEST_SIGNING_KEY=
24
- # INNGEST_EVENT_KEY=
24
+ INNGEST_EVENT_KEY=local
25
25
 
26
26
  # Grafana Faro (client-side observability)
27
27
  # Leave NEXT_PUBLIC_FARO_COLLECTOR_URL empty to disable in local development.
@@ -36,6 +36,24 @@ NEXT_PUBLIC_FARO_APP_ENVIRONMENT=development
36
36
  # LANGFUSE_PUBLIC_KEY=
37
37
  # LANGFUSE_SECRET_KEY=
38
38
 
39
+ # LLM providers
40
+ # Deployed percepta-test apps inherit ANTHROPIC_API_KEY from the demos-commons
41
+ # Ryvn variable group. For local LLM testing, set ANTHROPIC_API_KEY once in your
42
+ # shell profile or ~/.config/percepta/create.env.
43
+ # ANTHROPIC_API_KEY=
44
+ # OPENAI_API_KEY=
45
+ # LLM_PROVIDER=anthropic
46
+ # LLM_MODEL=claude-sonnet-4-5-20250929
47
+
48
+ # OpenTelemetry (server-side traces and metrics)
49
+ # OTEL_SERVICE_NAME=__APP_NAME__
50
+ # OTEL_TRACES_EXPORTER=otlp
51
+ # OTEL_METRICS_EXPORTER=otlp
52
+ # OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
53
+ # OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
54
+ # OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces
55
+ # OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:4318/v1/metrics
56
+
39
57
  # AWS (uses default credential chain in development)
40
58
  # AWS_REGION=us-east-1
41
59
  # AWS_ACCESS_KEY_ID=
@@ -57,4 +57,10 @@ export default [
57
57
  "n/no-process-env": "off",
58
58
  },
59
59
  },
60
+ {
61
+ files: ["scripts/with-local-env.ts"],
62
+ rules: {
63
+ "n/no-process-env": "off",
64
+ },
65
+ },
60
66
  ];
@@ -1,8 +1,17 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
1
3
  import type { NextConfig } from "next";
2
4
 
5
+ const appDir = path.dirname(fileURLToPath(import.meta.url));
6
+ const monorepoRoot = path.resolve(appDir, "../..");
7
+
3
8
  const nextConfig: NextConfig = {
4
9
  // Enable standalone output for Docker:
5
10
  output: "standalone",
11
+ outputFileTracingRoot: monorepoRoot,
12
+ turbopack: {
13
+ root: monorepoRoot,
14
+ },
6
15
  };
7
16
 
8
17
  export default nextConfig;
@@ -6,13 +6,14 @@
6
6
  "node": ">=18.0.0"
7
7
  },
8
8
  "scripts": {
9
- "dev": "next dev --turbopack",
9
+ "dev": "tsx ./scripts/with-local-env.ts next dev --turbopack",
10
10
  "build": "next build",
11
11
  "start": "next start",
12
12
  "lint": "eslint .",
13
13
  "setup": "pnpm docker:up && pnpm db:setup-and-migrate && pnpm db:seed",
14
14
  "docker:up": "docker compose up -d",
15
15
  "docker:down": "docker compose down",
16
+ "inngest:dev": "pnpm dlx inngest-cli@latest dev -u http://localhost:3000/api/inngest",
16
17
  "db:generate": "drizzle-kit generate",
17
18
  "db:migrate": "tsx ./scripts/migrate.ts",
18
19
  "db:setup": "tsx ./scripts/setup-database.ts",
@@ -21,11 +22,13 @@
21
22
  "db:studio": "drizzle-kit studio",
22
23
  "db:create-user": "tsx ./scripts/create-user.ts",
23
24
  "db:seed": "tsx ./scripts/seed.ts",
24
- "deploy:percepta-test": "tsx ./scripts/open-ryvn-deploy-pr.ts",
25
+ "deploy:percepta-test": "tsx ./scripts/deploy-percepta-test.ts",
26
+ "deploy:percepta-test:pr": "tsx ./scripts/open-ryvn-deploy-pr.ts",
25
27
  "test": "vitest run",
26
28
  "test:watch": "vitest"
27
29
  },
28
30
  "dependencies": {
31
+ "@ai-sdk/anthropic": "^2.0.23",
29
32
  "@ai-sdk/openai": "^2.0.23",
30
33
  "@aws-sdk/client-s3": "^3.888.0",
31
34
  "@aws-sdk/client-secrets-manager": "^3.914.0",
@@ -47,6 +50,7 @@
47
50
  "@next/env": "^15.3.5",
48
51
  "@opentelemetry/api": "^1.9.0",
49
52
  "@opentelemetry/auto-instrumentations-node": "^0.62.1",
53
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.203.0",
50
54
  "@opentelemetry/sdk-node": "^0.203.0",
51
55
  "@percepta/design": "0.3.2",
52
56
  "@percepta/logger": "0.0.6",