@crossdelta/platform-sdk 0.25.7 → 0.26.1

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/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ All notable changes to `@crossdelta/platform-sdk` will be documented in this fil
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.26.1] - 2026-10-17
9
+
10
+ ### Fixed
11
+ - **`pf dev` reads a `.env.local` value containing `$` as written.** `generate-env` now writes such a
12
+ value as `"…\$…"` (`@crossdelta/infrastructure` 0.18.1), and dotenv's `parse` kept the backslash, so
13
+ the ports and env `pf` hands to the apps carried `\$` instead of `$`. `parseEnvFile` reads with
14
+ `parseEnvContent` from `@crossdelta/infrastructure/env-file`, the reader that pairs with that writer.
15
+ It reads what `generate-env` writes and is stricter than dotenv about hand-written lines: spaces
16
+ around `=`, a key with `.` or `-` and a comment after the value are not read as dotenv read them.
17
+
18
+ ### Removed
19
+ - The `dotenv` dependency, which only `parseEnvFile` used.
20
+
21
+ ## [0.26.0] - 2026-10-11
22
+
23
+ ### Removed
24
+ - **BREAKING: `pf setup ai` and the AI generation path are gone.** `pf setup ai`, the `--ai` and `-d`
25
+ options of `pf new hono-micro` and `pf new nest-micro`, and the "Use AI?" step of `pf new` no longer
26
+ exist. Services are generated through the pf MCP server (`@crossdelta/pf-mcp`), which is unchanged.
27
+ The AI provider code, the events service updater, the NestJS and AST patchers that only it used, the
28
+ `generatorConfig` block with its `schemas/service-types.schema.json`, and the dependencies `ai`,
29
+ `@ai-sdk/anthropic`, `@ai-sdk/openai`, `@inquirer/prompts`, `ora` and `ts-morph` went with it.
30
+ `AI_IMAGE_PROVIDERS` (added in 0.25.0) is removed too; its only user, the demo-seed image script, now holds
31
+ its one entry itself.
32
+
33
+ ### Changed
34
+ - README: the AI section is replaced by a short section on the pf MCP server, and the commands table
35
+ lists `pf new workspace` and `pf pulumi`.
36
+
8
37
  ## [0.25.7] - 2026-10-09
9
38
 
10
39
  ### Fixed
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <code>pf</code> scaffolds real-world platforms: backend services, event-driven messaging, infrastructure. All wired together and kept in sync. <strong>AI-assisted.</strong>
12
+ <code>pf</code> scaffolds real-world platforms: backend services, event-driven messaging, infrastructure. All wired together and kept in sync.
13
13
  </p>
14
14
 
15
15
 
@@ -116,74 +116,47 @@ pf cloudevents publish order.created
116
116
 
117
117
  ---
118
118
 
119
- ## Commands
119
+ ## 🧰 Commands
120
120
 
121
121
  | Command | What it does |
122
122
  |:--------|:-------------|
123
123
  | `pf dev` | 🚀 Start development infrastructure (NATS) + all services in watch mode |
124
124
  | `pf new hono-micro <path>` | ⚡ Create a Hono service (lightweight, Bun-optimized) |
125
125
  | `pf new nest-micro <path>` | 🏢 Create a NestJS service (full-featured, decorators) |
126
+ | `pf new workspace [name]` | 🏗️ Create a new workspace with infrastructure setup |
126
127
  | `pf cloudevents add <type> --service <path>` | 🔗 Add contract + handler + wire stream |
127
128
  | `pf cloudevents list` | 📋 List available events and consumers |
128
129
  | `pf cloudevents publish <type>` | 📤 Publish mock event to NATS |
129
130
  | `pf setup completion` | 🔧 Install shell autocompletion (zsh/bash) |
130
- | `pf setup ai` | 🤖 Configure AI provider for code generation |
131
131
  | `pf test` | 🧪 Run tests across the monorepo |
132
132
  | `pf build` | 📦 Build all packages and services |
133
133
  | `pf lint` | ✨ Lint and format with Biome |
134
134
  | `pf audit` | 🔒 Run security audit on dependencies |
135
+ | `pf pulumi <args>` | ☁️ Run Pulumi in the workspace's `infra/` directory, e.g. `pf pulumi up` |
135
136
 
136
- > `pf` proxies all commands to Turborepo (works from any subdirectory). Extend via [custom commands and plugins](https://www.npmjs.com/package/@crossdelta/platform-sdk#configuration).
137
+ > Your workspace can add its own commands: an entry under `pf.commands` in the root `package.json` (optionally with `cwd` and `command`), or any root `scripts` entry, runs as `pf <name>`. Plugins listed under `pf.plugins` add command groups, as `@crossdelta/cloudevents` does for `pf cloudevents`. The plugin interface is described in `docs/plugins.md` in the package source.
137
138
 
138
139
  ---
139
140
 
140
- ## 🤖 AI-Assisted Generation
141
+ ## 🧩 Works with coding agents
141
142
 
142
- > **Optional but powerful.** Configure once, then use `--ai` with any generator.
143
+ `@crossdelta/pf-mcp` is a [Model Context Protocol](https://github.com/modelcontextprotocol/typescript-sdk) server for the Platform SDK. It exposes four tools:
143
144
 
144
- ```bash
145
- pf setup ai # OpenAI or Anthropic
146
-
147
- pf new hono-micro services/notifications --ai \
148
- -d "Send emails when orders are created"
149
- ```
150
-
151
- The AI generates **convention-following code** tailored to your platform:
145
+ | Tool | What it does |
146
+ |:-----|:-------------|
147
+ | `scan_workspace` | Scan the workspace for services, contracts, and configuration |
148
+ | `generate_service` | Generate a plan for a new microservice (dry-run by default) |
149
+ | `plan_review` | Validate a generation plan before applying |
150
+ | `apply_changes` | Apply the changes from a generation plan |
152
151
 
153
- <table>
154
- <tr>
155
- <td>✅</td>
156
- <td><strong>Event contracts</strong> with Zod schemas in <code>packages/contracts/</code></td>
157
- </tr>
158
- <tr>
159
- <td>✅</td>
160
- <td><strong>Event handlers</strong> that auto-discover and consume from NATS</td>
161
- </tr>
162
- <tr>
163
- <td>✅</td>
164
- <td><strong>Use-cases/Services</strong> with business logic separated from handlers</td>
165
- </tr>
166
- <tr>
167
- <td>✅</td>
168
- <td><strong>Tests</strong> for use-cases with realistic scenarios</td>
169
- </tr>
170
- <tr>
171
- <td>✅</td>
172
- <td><strong>Type-safe:</strong> no <code>any</code>, proper imports, strict TypeScript</td>
173
- </tr>
174
- <tr>
175
- <td>✅</td>
176
- <td><strong>Lint-compliant:</strong> passes Biome formatting out of the box</td>
177
- </tr>
178
- </table>
152
+ The server plans the structure; the agent writes the content. A service is created in this order: the agent calls `generate_service` with a prompt, receives a plan with files and a `planHash`, writes the code for those files, optionally calls `plan_review`, asks you to confirm, and then calls `apply_changes` with `expectedPlanHash`.
179
153
 
180
- **What makes it different:**
181
- - Uses your **existing contracts** when wiring events between services
182
- - Follows **framework-specific patterns** (Hono use-cases vs. NestJS Services)
183
- - Generates **only the code you need**, no bloat, no unused abstractions
184
- - **Hot-reload friendly:** `pf dev` automatically restarts when AI finishes
154
+ ```bash
155
+ bun add @crossdelta/pf-mcp
156
+ node ./node_modules/@crossdelta/pf-mcp/dist/cli.js --stdio
157
+ ```
185
158
 
186
- Works with OpenAI and Anthropic.
159
+ The server talks over stdio, so the MCP client of your agent has to start that command. It also serves the generator guidelines from `docs/generators/` in the package source as the MCP resource `docs://generators`.
187
160
 
188
161
  ---
189
162