@mindstudio-ai/agent 0.1.83 → 0.1.85

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/index.d.ts CHANGED
@@ -1294,7 +1294,8 @@ interface Db {
1294
1294
 
1295
1295
  /**
1296
1296
  * Access level of a file store. `private` (the default) → reads are signed /
1297
- * session-authorized; `public` → CDN-served (public serving ships later).
1297
+ * session-authorized; `public` → world-readable, CDN-served on the app's own
1298
+ * domain (and resizable via image query params).
1298
1299
  */
1299
1300
  type FileAccess = 'public' | 'private';
1300
1301
  /** Options for {@link Store.put}. */
@@ -1401,6 +1402,17 @@ declare class Store {
1401
1402
  }>;
1402
1403
  /** Delete an object. No-op if it doesn't exist. */
1403
1404
  delete(key: string): Promise<void>;
1405
+ /**
1406
+ * Mint an ABSOLUTE, signed share URL for a key — works with **no** active
1407
+ * session (email it, or embed it on another site). Expires (default 24h).
1408
+ * Private stores only.
1409
+ *
1410
+ * The same link is available as `file.shareUrl()` on a {@link StoredFile};
1411
+ * this convenience skips the `head()` when you already hold just the key.
1412
+ */
1413
+ shareUrl(key: string, options?: {
1414
+ expiresIn?: number;
1415
+ }): Promise<string>;
1404
1416
  /**
1405
1417
  * Mint an {@link UploadToken} for a **client-direct** upload — the browser
1406
1418
  * POSTs the file straight to storage, so the bytes never pass through the
@@ -1412,6 +1424,10 @@ declare class Store {
1412
1424
  * `contentType` is set — an exact content-type match. When the store declares
1413
1425
  * `contentTypes`, `contentType` must be one of them.
1414
1426
  *
1427
+ * Note: a presigned POST can pin exactly ONE content-type per token, so the
1428
+ * *allowlist* is declared on `defineStore({ contentTypes })` and each token
1429
+ * pins one type from it. This is by design, not a per-token limitation.
1430
+ *
1415
1431
  * @example
1416
1432
  * ```ts
1417
1433
  * // backend method
@@ -1432,8 +1448,10 @@ declare class Store {
1432
1448
 
1433
1449
  /**
1434
1450
  * The `files` namespace — typed, private-by-default file storage for MindStudio
1435
- * apps. The twin of `db`: define a store at module scope, import the handle into
1436
- * route handlers.
1451
+ * apps. Think of a store as a CDN-backed bucket the app talks to, not app-defined
1452
+ * state like a `db` table: the API is *shaped* like `db` (define a store at module
1453
+ * scope, import the handle into route handlers), but its contents are arbitrary
1454
+ * durable blobs, and one store is shared across dev and prod.
1437
1455
  *
1438
1456
  * ```ts
1439
1457
  * // files/uploads.ts
@@ -1456,8 +1474,9 @@ declare class Store {
1456
1474
  interface DefineStoreOptions {
1457
1475
  /**
1458
1476
  * Access level. **Defaults to `'private'`** (signed / session-authorized
1459
- * reads). `'public'` marks the store CDN-served (public serving ships in a
1460
- * later phase). Pinned at define-time — no `put()` can change it.
1477
+ * reads). `'public'` marks the store world-readable and CDN-served on the
1478
+ * app's own domain (resizable via image query params). Pinned at define-time
1479
+ * — no `put()` can change it.
1461
1480
  */
1462
1481
  access?: FileAccess;
1463
1482
  /**
package/dist/index.js CHANGED
@@ -2011,6 +2011,23 @@ var Store = class {
2011
2011
  key
2012
2012
  });
2013
2013
  }
2014
+ /**
2015
+ * Mint an ABSOLUTE, signed share URL for a key — works with **no** active
2016
+ * session (email it, or embed it on another site). Expires (default 24h).
2017
+ * Private stores only.
2018
+ *
2019
+ * The same link is available as `file.shareUrl()` on a {@link StoredFile};
2020
+ * this convenience skips the `head()` when you already hold just the key.
2021
+ */
2022
+ async shareUrl(key, options) {
2023
+ const res = await this._call("sign", {
2024
+ store: this._store,
2025
+ access: this._access,
2026
+ key,
2027
+ ...options?.expiresIn ? { expiresIn: options.expiresIn } : {}
2028
+ });
2029
+ return res.url;
2030
+ }
2014
2031
  /**
2015
2032
  * Mint an {@link UploadToken} for a **client-direct** upload — the browser
2016
2033
  * POSTs the file straight to storage, so the bytes never pass through the
@@ -2022,6 +2039,10 @@ var Store = class {
2022
2039
  * `contentType` is set — an exact content-type match. When the store declares
2023
2040
  * `contentTypes`, `contentType` must be one of them.
2024
2041
  *
2042
+ * Note: a presigned POST can pin exactly ONE content-type per token, so the
2043
+ * *allowlist* is declared on `defineStore({ contentTypes })` and each token
2044
+ * pins one type from it. This is by design, not a per-token limitation.
2045
+ *
2025
2046
  * @example
2026
2047
  * ```ts
2027
2048
  * // backend method