@mindstudio-ai/agent 0.1.82 → 0.1.84

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/llms.txt CHANGED
@@ -808,6 +808,9 @@ Send an email to one or more recipient addresses.
808
808
  - Use the "to" field to send to one or more specific recipient email addresses directly. Allowed recipients depend on the sender: when the app sends from a domain it owns (a verified custom domain or its <slug>.madewithremy.com subdomain) any recipient is allowed; when it falls back to the shared Remy address, recipients must be verified app users or members of the app's organization. (v1 apps cannot use a direct "to" — they must resolve recipients via a connection.)
809
809
  - Alternatively, recipient email addresses can be resolved from OAuth connections configured by the app creator via connectionId. The user running the workflow does not specify the recipient directly.
810
810
  - Use "cc" and "bcc" to add visible / hidden recipients (a string or an array). They are subject to the same recipient rules as "to".
811
+ - "to" is optional only in the sense that recipients can come from elsewhere — omit it and supply "cc"/"bcc" for a hidden-list send, or omit all three and recipients are resolved from an OAuth connection. Naming nobody at all is an error.
812
+ - Bcc-only sends are supported: with no "to" or "cc", the To: header is addressed to the app's own sender address (the standard "undisclosed recipients" pattern) so recipients can't see each other. The returned "recipients" reflects that auto-filled address.
813
+ - Every recipient counts toward the app's daily outbound cap, including cc and bcc.
811
814
  - The sender defaults automatically: v2 apps send from the app's own identity — its verified custom domain if set, else its platform subdomain (noreply@<slug>.madewithremy.com), else the default Remy address.
812
815
  - Optionally set "from" to a custom handle, but ONLY if the app has a custom domain or subdomain: a bare handle ("support" → support@<app-domain>), a full "support@your-domain.com", or "Name <support@your-domain.com>". The domain must be one the app owns, or the step fails.
813
816
  - If the body is a URL to a hosted HTML file on the CDN, the HTML is fetched and used as the email body.
@@ -1800,3 +1803,40 @@ const { url } = await mindstudio.uploadFile(readFileSync('photo.png'), { extensi
1800
1803
  - `options.type`: string (optional) — MIME type (e.g. `"image/png"`). Determines which CDN subdomain is used.
1801
1804
 
1802
1805
  Output: `{ url: string }` — The permanent public CDN URL.
1806
+
1807
+ #### `files` — per-app file storage (private by default)
1808
+ Typed file storage for the app — the twin of the `db` namespace. Define a store at module scope, then read/write objects. Files are served on the app's own domain. Private stores (the default) are signed / session-authorized; public stores are world-readable, CDN-served, and images are resizable via query params (e.g. `?w=400&h=300&fit=cover`). Prefer this over the deprecated `uploadFile()` for app storage.
1809
+
1810
+ ```typescript
1811
+ import { files } from '@mindstudio-ai/agent';
1812
+
1813
+ // Define stores at module scope (access is pinned here).
1814
+ export const Uploads = files.defineStore('uploads'); // private (default)
1815
+ export const Assets = files.defineStore('assets', { access: 'public' });
1816
+
1817
+ // Store bytes and get a ready-to-use URL.
1818
+ const file = await Uploads.put(buffer, { contentType: 'application/pdf', filename: 'report.pdf' });
1819
+ file.url; // stable on-domain URL for a logged-in user (drop into <img>/<a download>)
1820
+ await file.shareUrl(); // absolute signed URL that works with NO session (email/embed); default 24h
1821
+ ```
1822
+
1823
+ Store methods:
1824
+ - `put(content, { key?, contentType?, filename?, contentAddressed? })` → `StoredFile`. `content` is `Buffer | Uint8Array | string`. Omit `key` for a random UUID; `contentAddressed: true` derives an immutable `<sha256>.<ext>` key.
1825
+ - `get(key)` → `Buffer` · `head(key)` → `StoredFile` · `exists(key)` → `boolean`
1826
+ - `list({ prefix?, cursor?, limit? })` → `{ files: StoredFile[]; cursor? }`
1827
+ - `delete(key)` → `void`
1828
+ - `shareUrl(key, { expiresIn? })` → signed absolute URL (private stores; no session needed)
1829
+
1830
+ `StoredFile`: `{ store, key, access, size?, contentType?, updatedAt?, url, shareUrl() }`.
1831
+
1832
+ `defineStore(name, options?)` options: `access: 'public' | 'private'` (default private), `maxSize` (bytes; cap for client-direct uploads), `contentTypes` (allowlist for client-direct uploads).
1833
+
1834
+ User uploads (client-direct — bytes go straight to storage, never through the app backend): a backend method mints a token, the frontend submits it with `@mindstudio-ai/interface`.
1835
+ ```typescript
1836
+ // backend method
1837
+ const token = await Uploads.createUploadToken({ contentType, maxSize: 25 * 1024 * 1024 });
1838
+ return token;
1839
+ // frontend (@mindstudio-ai/interface)
1840
+ import { platform } from '@mindstudio-ai/interface';
1841
+ const { url } = await platform.upload(token, file, { onProgress });
1842
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/agent",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "description": "TypeScript SDK for MindStudio direct step execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",