@mindstudio-ai/remy 0.1.189 → 0.1.190
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.
|
@@ -320,27 +320,53 @@ Standard cron expression format. Jobs are synced to the platform on deploy.
|
|
|
320
320
|
|
|
321
321
|
## Webhook
|
|
322
322
|
|
|
323
|
-
Inbound HTTP endpoints that invoke
|
|
323
|
+
Inbound HTTP endpoints that invoke a method directly and synchronously — the caller waits for the method to finish. Use for receiving webhooks from external services (Stripe, GitHub, Shopify, Slack, Twilio). Direct inbound webhooks with signature verification work natively; do **not** build confirmation-token or polling workarounds.
|
|
324
324
|
|
|
325
325
|
### Config (`interface.json`)
|
|
326
326
|
|
|
327
|
+
The top-level key must match the interface type (`webhook`):
|
|
328
|
+
|
|
327
329
|
```json
|
|
328
330
|
{
|
|
329
331
|
"webhook": {
|
|
330
332
|
"endpoints": [
|
|
331
333
|
{
|
|
332
334
|
"method": "handle-payment-webhook",
|
|
333
|
-
"
|
|
334
|
-
"
|
|
335
|
+
"secret": "whsec_pick_a_long_random_token",
|
|
336
|
+
"description": "Stripe events"
|
|
335
337
|
}
|
|
336
338
|
]
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
```
|
|
340
342
|
|
|
341
|
-
|
|
343
|
+
- `method` — the id of a method in `methods[]` to invoke.
|
|
344
|
+
- `secret` — a developer-chosen opaque token that is **both the routing key and the access guard**. It is stable across deploys (compilation is a passthrough — redeploying never rotates it), so a URL you register with Stripe/GitHub stays valid. Generate one long random value per endpoint and keep it constant.
|
|
345
|
+
- Declare multiple endpoints if needed; each `secret` maps to one method.
|
|
346
|
+
|
|
347
|
+
### Endpoint URL
|
|
348
|
+
|
|
349
|
+
Register this with the external service: `https://{app-host}/_/webhook/{secret}` — `{app-host}` is any host the app is served on: its `custom_subdomain` host (e.g. `myapp.madewithremy.com`), a custom domain if configured, or the UUID host (`<appId>.madewithremy.com` / `.msagent.ai`). All HTTP verbs are accepted.
|
|
350
|
+
|
|
351
|
+
### Input
|
|
352
|
+
|
|
353
|
+
The method receives:
|
|
354
|
+
|
|
355
|
+
```ts
|
|
356
|
+
{
|
|
357
|
+
method: string; // HTTP method
|
|
358
|
+
headers: Record<string, string>; // request headers
|
|
359
|
+
query: Record<string, string>; // query params
|
|
360
|
+
body: any; // parsed JSON / form body
|
|
361
|
+
rawBody: string; // exact raw request bytes (UTF-8), pre-parse
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
For signature verification **always use `rawBody`, never `body`** — providers (Stripe, GitHub, Shopify, Slack) HMAC the raw payload, and a re-serialized `body` will not match. E.g. `stripe.webhooks.constructEvent(input.rawBody, input.headers['stripe-signature'], endpointSecret)`. `rawBody` is populated for `application/json` and `application/x-www-form-urlencoded` bodies (what these providers send).
|
|
366
|
+
|
|
367
|
+
### Response
|
|
342
368
|
|
|
343
|
-
|
|
369
|
+
Whatever the method returns as output is sent back to the caller as JSON; if it returns no output, the platform responds `204`. A wrong/unknown secret returns `401`; an app with no live release returns `404`.
|
|
344
370
|
|
|
345
371
|
## Email
|
|
346
372
|
|
|
@@ -19,7 +19,7 @@ The scaffold starts with these spec files that cover the full picture of the app
|
|
|
19
19
|
- **`src/interfaces/@brand/voice.md`** — voice and terminology: tone, error messages, word choices
|
|
20
20
|
- **`src/roadmap/`** — feature roadmap. One file per feature (`type: roadmap`). See "Roadmap" below.
|
|
21
21
|
|
|
22
|
-
These are starting points, not constraints. Create as many spec files as the project needs — the `src/` folder is your workspace and every `.md` file in it becomes compilation context. If the app has substantial content (presentation slides, copy, lesson plans, menu items, quiz questions), put it in its own file (`src/content.md`, `src/slides.md`, `src/menu.md`, etc.) rather than cramming it into `app.md` or `web.md`. If the domain is complex, split `app.md` into multiple files by area (`src/billing.md`, `src/approvals.md`). Add interface specs for other interface types (`api.md`, `cron.md`, `agent.md`, etc.) if the app uses them.
|
|
22
|
+
These are starting points, not constraints. Create as many spec files as the project needs — the `src/` folder is your workspace and every `.md` file in it becomes compilation context. If the app has substantial content (presentation slides, copy, lesson plans, menu items, quiz questions), put it in its own file (`src/content.md`, `src/slides.md`, `src/menu.md`, etc.) rather than cramming it into `app.md` or `web.md`. If the domain is complex, split `app.md` into multiple files by area (`src/billing.md`, `src/approvals.md`). Add interface specs for other interface types (`api.md`, `webhook.md`, `cron.md`, `agent.md`, etc.) if the app uses them. For external HTTP, the Webhook interface (`webhook.md`) handles inbound provider webhooks (Stripe, GitHub) via secret-in-URL routing, while the API interface (`api.md`) covers bearer-auth sync endpoints, public REST APIs, and batch tools. Organize however serves clarity — the platform reads the entire `src/` folder.
|
|
23
23
|
|
|
24
24
|
Remember: users care about look and feel as much as (and often more than) underlying data structures. Don't treat the brand and interface specs as an afterthought — for many users, the visual identity and voice are the first things they want to get right.
|
|
25
25
|
|
|
@@ -8,7 +8,7 @@ Most things are fine. These are fast-moving products built by non-technical user
|
|
|
8
8
|
|
|
9
9
|
**A package is dead or superseded.** If the plan involves a package, do a quick web search. Only flag it if there's a clearly better, actively maintained alternative. "This works fine" is a valid finding.
|
|
10
10
|
|
|
11
|
-
**External HTTP endpoints should use
|
|
11
|
+
**External HTTP endpoints should use a platform interface, not custom HTTP handling.** If the plan involves receiving webhooks from external services (Stripe, Twilio, etc.), exposing sync endpoints, or serving any external HTTP requests, flag that the platform handles routing, auth, and the raw request body natively. Two native paths exist — the Webhook interface (`src/interfaces/webhook.md`: secret-in-URL routing, a good fit for provider-signature webhooks) and the API interface (`src/interfaces/api.md`: bearer-auth REST with OpenAPI generation, for sync endpoints and public APIs). Don't build custom HTTP handling or external proxies.
|
|
12
12
|
|
|
13
13
|
**There's a managed SDK action for this.** If the plan involves writing custom code for something that sounds like media processing, email/SMS, third-party APIs, or AI model calls — check `askMindStudioSdk`. The managed action handles retries, auth, and scaling.
|
|
14
14
|
|
|
@@ -19,7 +19,7 @@ Most things are fine. These are fast-moving products built by non-technical user
|
|
|
19
19
|
These are things we already know about and have decided to accept:
|
|
20
20
|
|
|
21
21
|
- **`dist/` is where code lives.** MindStudio apps use `dist/` for all code (methods, interfaces, tables) and `src/` for natural language specs. This is NOT the conventional "dist is build output" pattern. Never flag code being in `dist/` as wrong.
|
|
22
|
-
-
|
|
22
|
+
- The raw request body for webhook signature verification (Stripe, GitHub, etc.) is available natively — under `input._request.rawBody` on API interface methods, and at top-level `input.rawBody` on Webhook interface methods. Do NOT suggest external proxies or workarounds.
|
|
23
23
|
|
|
24
24
|
- Ignore limited browser support for `oklch` gradients using `in <colorspace>` syntax — we accept the compatibility tradeoff for better color quality
|
|
25
25
|
-Ignore limited browser support for CSS scroll-driven animations (`animation-timeline: scroll()` / `view()`) - we accept this tradeoff
|