@mindstudio-ai/remy 0.1.175 → 0.1.177
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/dist/headless.js +356 -157
- package/dist/index.js +391 -175
- package/dist/prompt/compiled/interfaces.md +48 -3
- package/dist/prompt/static/coding.md +3 -1
- package/package.json +1 -1
|
@@ -92,6 +92,27 @@ The project uses `"jsx": "react-jsx"` (automatic JSX transform) — do not `impo
|
|
|
92
92
|
|
|
93
93
|
On deploy, the platform runs `npm install && npm run build` in the web directory and hosts the output on CDN.
|
|
94
94
|
|
|
95
|
+
#### Error Handling and Analytics
|
|
96
|
+
|
|
97
|
+
The SDK automatically reports uncaught errors, unhandled promise rejections, and pageviews to a per-app dashboard the owner gets for free. No setup required. The analytics dashboard covers visits, unique visitors, top pages, referrers, UTM breakdowns, country-level geo, device/browser/OS, new vs returning, and live online count.
|
|
98
|
+
|
|
99
|
+
What this means for code you write:
|
|
100
|
+
|
|
101
|
+
- **Don't install Sentry, Google Analytics, Plausible, Mixpanel, or similar unless the user specifically asks.** The platform dashboard already covers lay-person observability and analytics.
|
|
102
|
+
- **Caught errors are yours to handle. Uncaught errors are captured automatically** If you `try/catch`, show a toast or render a fallback. Let unexpected errors bubble; a React error boundary can render a fallback while the SDK reports the error.
|
|
103
|
+
- **For custom events**, use `analytics.track(name, props?)`. Props must be flat primitives (`string | number | boolean`); nested objects, arrays, `null`, and `undefined` are stripped. Server caps name ≤200 chars, ≤10 props, ≤50-char keys, ≤500-char values.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import { analytics } from '@mindstudio-ai/interface';
|
|
107
|
+
|
|
108
|
+
analytics.track('vendor_submitted', { vendorType: 'restaurant' });
|
|
109
|
+
analytics.track('checkout_completed', { itemCount: 3, total: 47.99 });
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Analytics is **cookie-banner-free by design**: per-app scoping, IP discarded after geo lookup, country-level only, query strings server-scrubbed except for a UTM whitelist (`utm_*`, `ref`, `source`, `gclid`, `fbclid`, `msclkid`), no fingerprinting, no third-party scripts. If a user asks about GDPR cookie consent for analytics, you can explain why it is not needed.
|
|
113
|
+
|
|
114
|
+
Disabling telemetry is a per-app dashboard setting (platform toggle, not code). Point users there if they ask.
|
|
115
|
+
|
|
95
116
|
## API Interface
|
|
96
117
|
|
|
97
118
|
REST endpoints for external consumers — other services, mobile apps, integrations. This is separate from the web frontend's internal RPC (`@mindstudio-ai/interface` calls `/_/methods` directly and does not use the API interface). The API interface lives at `/_/api/` and exposes only the methods you choose to route.
|
|
@@ -323,19 +344,43 @@ Accepts any HTTP method. The method receives `{ method, headers, query, body }`
|
|
|
323
344
|
|
|
324
345
|
## Email
|
|
325
346
|
|
|
326
|
-
Inbound email triggers.
|
|
347
|
+
Inbound email triggers. An app can register one inbound address that routes all inbound emails to one method.
|
|
327
348
|
|
|
328
349
|
### Config (`interface.json`)
|
|
329
350
|
|
|
330
351
|
```json
|
|
331
352
|
{
|
|
332
353
|
"email": {
|
|
333
|
-
"method": "handle-inbound-email"
|
|
354
|
+
"method": "handle-inbound-email",
|
|
355
|
+
"approvedSenders": ["billing@vendor.com", "*@trusted-partner.com"]
|
|
334
356
|
}
|
|
335
357
|
}
|
|
336
358
|
```
|
|
337
359
|
|
|
338
|
-
|
|
360
|
+
`approvedSenders` is optional. When set, only senders matching an exact address or `*@domain.com` wildcard reach the method; everything else is rejected by the platform with `400 invalid_sender` before the method runs.
|
|
361
|
+
|
|
362
|
+
Address pattern: `{custom-name}@mindstudio-hooks.com`.
|
|
363
|
+
|
|
364
|
+
### Input shape
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
{
|
|
368
|
+
to: string; // resolved from the SMTP envelope
|
|
369
|
+
from: string; // bare address, extracted from "Name <a@b>" form
|
|
370
|
+
subject: string; // 'No Subject' if missing
|
|
371
|
+
message: string; // plain text body; 'No Body' if neither text nor html was sent
|
|
372
|
+
html: string; // HTML body, or '' when text-only
|
|
373
|
+
attachments: string[]; // CDN URLs — already uploaded by the platform
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Attachments
|
|
378
|
+
|
|
379
|
+
`attachments[]` is an array of CDN URLs — the platform has already received and uploaded the files. Fetch them server-side via the URL when you need the bytes; pass them through as URLs to UI or downstream services.
|
|
380
|
+
|
|
381
|
+
### Auth
|
|
382
|
+
|
|
383
|
+
Methods invoked through this interface run with `auth.roles: ['system']` (see the system-roles section above). They have no user session and can't impersonate. Use `auth.requireRole('system')` to gate methods that should only be reachable via email.
|
|
339
384
|
|
|
340
385
|
## MCP (Model Context Protocol)
|
|
341
386
|
|
|
@@ -17,7 +17,6 @@ Aim for confidence that the core happy paths work. If the 80% case is solid, the
|
|
|
17
17
|
When making mechanical edits as part of iterating with the user (e.g., moving elements, changing labels, small redesigns and refactors), don't screenshot to confirm, simply trust your code. Re-screenshot only when changes are structural enough that the visual outcome is genuinely uncertain (new layout, new component composition, new route), or when the user reports something visible that you can't see in the code. The screenshot tool captures static/settled state - don't try to hack it with different instructions to capture transient states or animations or things like that. If what you need is not avaialble via screenshot, fall back to static analysis by tracing code.
|
|
18
18
|
|
|
19
19
|
### Process Logs
|
|
20
|
-
|
|
21
20
|
Process logs are available at .logs/ in NDJSON format (one JSON object per line) for debugging. Each line has at minimum ts (unix millis) and msg fields, plus structured context like level, module, requestId, toolCallId where available. You can use `jq` to examine logs and debug failures. Tools like run method or run scenario execute synchronously, so log data will be available by the time those tools return their results to you, there is no need to `sleep` before querying logfiles.
|
|
22
21
|
- `.logs/tunnel.ndjson`: method execution, schema sync, session lifecycle, platform connection
|
|
23
22
|
- `.logs/devServer.ndjson`: frontend build errors, HMR, module resolution failures - check this to see if compilation is broken on web frontends.
|
|
@@ -33,6 +32,8 @@ For multi-step tasks with branching logic (research, enrichment, content pipelin
|
|
|
33
32
|
|
|
34
33
|
For methods that take more than a few seconds, use `stream()` from `@mindstudio-ai/agent` to push real-time progress to the frontend. Pipe `onLog` from SDK actions through `stream()` so users see what's happening. The frontend calls the method with `stream: true` and gets updates via `onToken`. See the methods reference for the full pattern.
|
|
35
34
|
|
|
35
|
+
For counting visitor or funnel activity (signups, page interactions, checkout completions), use `analytics.track()` from `@mindstudio-ai/interface` or rely on auto-tracked pageviews.
|
|
36
|
+
|
|
36
37
|
When writing `db` filter predicates that reference outer-scope values (`input.*`, `auth.*`, foreign keys collected earlier, etc.), use the bindings form so the filter compiles to SQL — see `tables.md` "Filter Predicates" for patterns and the inline-comment convention.
|
|
37
38
|
|
|
38
39
|
### Auth
|
|
@@ -55,6 +56,7 @@ When writing `db` filter predicates that reference outer-scope values (`input.*`
|
|
|
55
56
|
|
|
56
57
|
### Error Visibility
|
|
57
58
|
- Runtime errors must render visibly on screen, not produce a blank white page. User and agent must be able to visibly debug and spot them.
|
|
59
|
+
- `@mindstudio-ai/interface` automatically reports uncaught errors and unhandled promise rejections to the user's dashboard.
|
|
58
60
|
|
|
59
61
|
### State Management
|
|
60
62
|
- Prefer to use a library like Zustand for global state. Load a big data bundle on app start into a Zustand store, then render everything from memory. Navigation between screens should feel instant — no loading spinners for data that's already in the store.
|