@midsummer-ai/sdk 0.1.0-staging.5369 → 0.1.0-staging.5376

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/ai/contract.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as AiError } from "../ai-DUfnNSnz.mjs";
1
+ import { t as AiError } from "../ai-Db7J13YV.mjs";
2
2
  //#region src/ai/contract.ts
3
3
  /**
4
4
  * AI's contract: what every engine promises, as cases any test runner can run. The Stand-in runs
package/ai/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { i as boundAi, n as ai, r as aiClient, t as AiError } from "../ai-DUfnNSnz.mjs";
1
+ import { i as boundAi, n as ai, r as aiClient, t as AiError } from "../ai-Db7J13YV.mjs";
2
2
  export { AiError, ai, aiClient, boundAi };
package/ai/stand-in.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as aiStandIn } from "../ai-DUfnNSnz.mjs";
1
+ import { a as aiStandIn } from "../ai-Db7J13YV.mjs";
2
2
  export { aiStandIn };
@@ -1,4 +1,4 @@
1
- import { a as processEnv, n as here, r as late, t as clientHeaders } from "./here-C2jhTheQ.mjs";
1
+ import { a as processEnv, n as here, r as late, t as clientHeaders } from "./here-BO-wQDjz.mjs";
2
2
  //#region src/ai/stand-in.ts
3
3
  /**
4
4
  * AI's Stand-in: Model calls replied to on this computer, for `midsummer dev` and tests, with no
package/apps.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as platformApi, t as clientHeaders } from "./here-C2jhTheQ.mjs";
1
+ import { i as platformApi, t as clientHeaders } from "./here-BO-wQDjz.mjs";
2
2
  //#region src/apps.ts
3
3
  /**
4
4
  * For an app teams install on Midsummer: check that an event or a runner job Midsummer posted is
package/auth/contract.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { s as AuthError } from "../auth-DauDyrcI.mjs";
1
+ import { s as AuthError } from "../auth-87pDA6v7.mjs";
2
2
  import { d as SETTINGS_TTL_MS, n as LIMIT_WINDOW_MS, t as LIMITS } from "../guard-VPI6xq4z.mjs";
3
3
  import { IMPERSONATION_TOKEN_MS, startImpersonation } from "./impersonate.mjs";
4
4
  //#region src/auth/contract.ts
package/auth/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createAuth, i as auth, n as AUTH_ROUTES, o as databaseStore, r as SESSION_CACHE_S, s as AuthError, t as AUTH_PATH } from "../auth-DauDyrcI.mjs";
1
+ import { a as createAuth, i as auth, n as AUTH_ROUTES, o as databaseStore, r as SESSION_CACHE_S, s as AuthError, t as AUTH_PATH } from "../auth-87pDA6v7.mjs";
2
2
  import { checkSignInMail, signInWords } from "./mail.mjs";
3
3
  import { n as authFiles } from "../files-BhGkb17f.mjs";
4
4
  import { IMPERSONATION_S } from "./impersonate.mjs";
package/auth/mail.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as processEnv, n as here } from "../here-C2jhTheQ.mjs";
2
- import { l as email, t as EmailError } from "../email-D9XsEaRR.mjs";
1
+ import { a as processEnv, n as here } from "../here-BO-wQDjz.mjs";
2
+ import { l as email, t as EmailError } from "../email-3KTucUTK.mjs";
3
3
  //#region src/auth/mail.ts
4
4
  /**
5
5
  * The mail sign-in sends: a code, a sign-in link, an email check, a password reset, an invitation, a sign-in from
package/auth/react.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as DATABASE_TOKEN_PATH, u as signedInDatabase } from "../client-5gJ-6h4y.mjs";
1
+ import { t as DATABASE_TOKEN_PATH, u as signedInDatabase } from "../client-l7vxAg48.mjs";
2
2
  import { DatabaseProvider } from "../database/react.mjs";
3
3
  import { a as WORDS, c as deviceOf, i as CAPTCHA_WIDGETS, l as screenName, n as textOn, o as ago, t as authCss, u as setupKeyOf } from "../style-DXd-0Cxo.mjs";
4
4
  import { a as shapeAttributes, r as ICONS, t as qrPath } from "../qr-BySxqLW6.mjs";
@@ -1,6 +1,6 @@
1
- import { a as processEnv, i as platformApi, n as here } from "./here-C2jhTheQ.mjs";
1
+ import { a as processEnv, i as platformApi, n as here } from "./here-BO-wQDjz.mjs";
2
2
  import { DatabaseError } from "./database/errors.mjs";
3
- import { d as userToken, o as connect, s as databaseUrl } from "./client-5gJ-6h4y.mjs";
3
+ import { d as userToken, o as connect, s as databaseUrl } from "./client-l7vxAg48.mjs";
4
4
  import { CALL_STATUS } from "./calls/protocol.mjs";
5
5
  import { sendSignInMail } from "./auth/mail.mjs";
6
6
  import "./files-BhGkb17f.mjs";
package/billing/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as processEnv, n as here, r as late } from "../here-C2jhTheQ.mjs";
1
+ import { a as processEnv, n as here, r as late } from "../here-BO-wQDjz.mjs";
2
2
  //#region src/billing/index.ts
3
3
  /**
4
4
  * Billing from a Project's code: send a customer to a checkout, and ask what they have bought. Each customer is your
package/calls/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as processEnv, i as platformApi, n as here, t as clientHeaders } from "../here-C2jhTheQ.mjs";
1
+ import { a as processEnv, i as platformApi, n as here, t as clientHeaders } from "../here-BO-wQDjz.mjs";
2
2
  import { CALL_STATUS, TRACK_KINDS } from "./protocol.mjs";
3
3
  //#region src/calls/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { i as platformApi, n as here, t as clientHeaders } from "./here-C2jhTheQ.mjs";
1
+ import { i as platformApi, n as here, t as clientHeaders } from "./here-BO-wQDjz.mjs";
2
2
  import { n as bytesTagged, r as bytesUntagged } from "./bytes-C2pcyl9u.mjs";
3
3
  import { DatabaseError } from "./database/errors.mjs";
4
4
  import { a as socketAt, i as payloadOf, r as fetchAt, t as Connection } from "./connection-Dh3mUykO.mjs";
package/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as FRAMES_PATH, c as serveSigned, l as signedHttp, o as SOCKET_PATH, s as client } from "./src-CQmtQTvJ.mjs";
1
+ import { a as FRAMES_PATH, c as serveSigned, l as signedHttp, o as SOCKET_PATH, s as client } from "./src-BYXraOfJ.mjs";
2
2
  export { FRAMES_PATH, SOCKET_PATH, client, serveSigned, signedHttp };
package/contract.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as StorageError } from "./errors-BY4sZe52.mjs";
2
- import "./src-CQmtQTvJ.mjs";
2
+ import "./src-BYXraOfJ.mjs";
3
3
  //#region src/contract.ts
4
4
  /**
5
5
  * Storage's contract: what every engine promises, as cases any test runner can run. The Stand-in
@@ -1,3 +1,3 @@
1
1
  import { DatabaseError } from "./errors.mjs";
2
- import { a as clerk, c as oidc, d as userToken, i as auth0, l as profileClaims, n as DatabaseClient, o as connect, r as PROFILE_MOST, s as databaseUrl, t as DATABASE_TOKEN_PATH, u as signedInDatabase } from "../client-5gJ-6h4y.mjs";
2
+ import { a as clerk, c as oidc, d as userToken, i as auth0, l as profileClaims, n as DatabaseClient, o as connect, r as PROFILE_MOST, s as databaseUrl, t as DATABASE_TOKEN_PATH, u as signedInDatabase } from "../client-l7vxAg48.mjs";
3
3
  export { DATABASE_TOKEN_PATH, DatabaseClient, DatabaseError, PROFILE_MOST, auth0, clerk, connect, databaseUrl, oidc, profileClaims, signedInDatabase, userToken };
@@ -1,4 +1,4 @@
1
- import { r as storage } from "../src-CQmtQTvJ.mjs";
1
+ import { r as storage } from "../src-BYXraOfJ.mjs";
2
2
  import { standIn } from "../stand-in.mjs";
3
3
  import { _ as shapeError, a as tagBytes, b as valueAt, f as indexFields, g as shapeAt, i as keyBytes, o as untagBytes, v as tableCode } from "../bytes-C2pcyl9u.mjs";
4
4
  import { A as comparePrefix, M as indexTuple, O as valueKey, S as nextCron, T as readLimited, _ as isFunction, a as Refusal, b as limits, i as NotFoundError, j as documentBytes, k as compareKey, l as fetchOver, o as TooLarge, r as InsufficientError, y as isRouter } from "../server-Drjni3-F.mjs";
package/email/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { C as serveMessages, S as serveBound, b as boundEmail, x as client, y as MESSAGES_PATH } from "../email-D9XsEaRR.mjs";
1
+ import { C as serveMessages, S as serveBound, b as boundEmail, x as client, y as MESSAGES_PATH } from "../email-3KTucUTK.mjs";
2
2
  export { MESSAGES_PATH, boundEmail, client, serveBound, serveMessages };
@@ -1,4 +1,4 @@
1
- import { t as EmailError } from "../email-D9XsEaRR.mjs";
1
+ import { t as EmailError } from "../email-3KTucUTK.mjs";
2
2
  //#region src/email/contract.ts
3
3
  /**
4
4
  * Email's contract: what every engine promises, as cases any test runner can run. The Stand-in runs
package/email/inbox.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as inbox, d as INBOX_HEADER, f as MAX_REPLY, g as checkReply, h as checkPage, m as boundInbox, p as MAX_THREADS, v as serveInbox } from "../email-D9XsEaRR.mjs";
1
+ import { _ as inbox, d as INBOX_HEADER, f as MAX_REPLY, g as checkReply, h as checkPage, m as boundInbox, p as MAX_THREADS, v as serveInbox } from "../email-3KTucUTK.mjs";
2
2
  export { INBOX_HEADER, MAX_REPLY, MAX_THREADS, boundInbox, checkPage, checkReply, inbox, serveInbox };
package/email/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as inbox, a as MAX_MESSAGE_BYTES, c as checkMessage, d as INBOX_HEADER, i as MAX_BATCH, l as email, n as MAX_ATTACHMENTS, o as MAX_RECIPIENTS, p as MAX_THREADS, r as MAX_ATTACHMENT_BYTES, s as addressOf, t as EmailError, u as verifyWebhook } from "../email-D9XsEaRR.mjs";
1
+ import { _ as inbox, a as MAX_MESSAGE_BYTES, c as checkMessage, d as INBOX_HEADER, i as MAX_BATCH, l as email, n as MAX_ATTACHMENTS, o as MAX_RECIPIENTS, p as MAX_THREADS, r as MAX_ATTACHMENT_BYTES, s as addressOf, t as EmailError, u as verifyWebhook } from "../email-3KTucUTK.mjs";
2
2
  export { EmailError, INBOX_HEADER, MAX_ATTACHMENTS, MAX_ATTACHMENT_BYTES, MAX_BATCH, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, MAX_THREADS, addressOf, checkMessage, email, inbox, verifyWebhook };
package/email/smtp.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { l as email, t as EmailError, x as client } from "../email-D9XsEaRR.mjs";
1
+ import { l as email, t as EmailError, x as client } from "../email-3KTucUTK.mjs";
2
2
  import { createServer } from "node:net";
3
3
  import { createServer as createServer$1 } from "node:tls";
4
4
  //#region src/email/smtp.ts
@@ -1,4 +1,4 @@
1
- import { s as addressOf, t as EmailError } from "../email-D9XsEaRR.mjs";
1
+ import { s as addressOf, t as EmailError } from "../email-3KTucUTK.mjs";
2
2
  //#region src/email/stand-in.ts
3
3
  /**
4
4
  * Email's Stand-in: the Capability's behaviour in memory, for `midsummer dev` and tests. It sends
@@ -1,4 +1,4 @@
1
- import { a as processEnv, n as here, r as late, t as clientHeaders } from "./here-C2jhTheQ.mjs";
1
+ import { a as processEnv, n as here, r as late, t as clientHeaders } from "./here-BO-wQDjz.mjs";
2
2
  import { verifyEvent } from "./apps.mjs";
3
3
  //#region src/email/client.ts
4
4
  /**
@@ -4,15 +4,24 @@ function here() {
4
4
  const read = globalThis[Symbol.for("midsummer.context")];
5
5
  return read?.();
6
6
  }
7
- /** The process's environment, where `midsummer dev` puts its Stand-ins' addresses; empty where there is none. */
7
+ /**
8
+ * The values code runs with: the process's environment, where `midsummer dev` puts its Stand-ins' addresses, under the
9
+ * ones Midsummer hands the code a request or run is for (`here().env`). An agent's run gets its own this way, so two
10
+ * runs side by side in one isolate never read each other's Workload session. Empty where there are none.
11
+ */
8
12
  function processEnv() {
9
- return globalThis.process?.env ?? {};
13
+ const own = globalThis.process?.env ?? {};
14
+ const given = here()?.env;
15
+ return given ? {
16
+ ...own,
17
+ ...given
18
+ } : own;
10
19
  }
11
20
  /**
12
21
  * This package's version: `0.0.0-dev` here, and in a published package the version it was published at, which the
13
22
  * release writes in its place as it stages the package (`stampSdk` in `scripts/release/packages.ts`).
14
23
  */
15
- const SDK_VERSION = "0.1.0-staging.5369";
24
+ const SDK_VERSION = "0.1.0-staging.5376";
16
25
  /**
17
26
  * The header that tells Midsummer which client made each of this package's calls: `Midsummer-Client: sdk/<version>
18
27
  * <part>`, `part` the product whose client it is (`database`, `storage`, `queues`, ...), so the platform counts which
package/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as StorageError } from "./errors-BY4sZe52.mjs";
2
- import { i as streamsOf, n as bucket, r as storage, t as WORKLOAD_PATH } from "./src-CQmtQTvJ.mjs";
2
+ import { i as streamsOf, n as bucket, r as storage, t as WORKLOAD_PATH } from "./src-BYXraOfJ.mjs";
3
3
  export { StorageError, WORKLOAD_PATH, bucket, storage, streamsOf };
package/kv/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as processEnv, n as here, o as workloadTransport, r as late } from "../here-C2jhTheQ.mjs";
1
+ import { a as processEnv, n as here, o as workloadTransport, r as late } from "../here-BO-wQDjz.mjs";
2
2
  //#region src/kv/index.ts
3
3
  /**
4
4
  * The key-value store: each environment's store of keys, there before the first call, for sessions, counters, caches,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midsummer-ai/sdk",
3
- "version": "0.1.0-staging.5369",
3
+ "version": "0.1.0-staging.5376",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Midsummer's handles for an app's code: its Database, Storage, Queues, Vector DB, AI, Email and Agents, with stand-ins for tests.",
package/queues/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as processEnv, n as here, o as workloadTransport, r as late } from "../here-C2jhTheQ.mjs";
1
+ import { a as processEnv, n as here, o as workloadTransport, r as late } from "../here-BO-wQDjz.mjs";
2
2
  //#region src/queues/index.ts
3
3
  /**
4
4
  * Queues: a Team's Queues of Messages, which the SDK reaches by the name an Environment binds each one
package/s3.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as StorageError } from "./errors-BY4sZe52.mjs";
2
2
  import { C as sha256, d as checkPartNumber, f as checkParts, h as checkUploadId, l as checkMetadata, o as checkBucketName, s as checkKey } from "./names-Dk-eRYJU.mjs";
3
- import { i as streamsOf } from "./src-CQmtQTvJ.mjs";
3
+ import { i as streamsOf } from "./src-BYXraOfJ.mjs";
4
4
  import { inertHeaders } from "./inert.mjs";
5
5
  //#region src/s3.ts
6
6
  /**
package/socket.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { d as sameHex, f as sign, m as socketSession, p as socket, u as keyed } from "./src-CQmtQTvJ.mjs";
1
+ import { d as sameHex, f as sign, m as socketSession, p as socket, u as keyed } from "./src-BYXraOfJ.mjs";
2
2
  export { keyed, sameHex, sign, socket, socketSession };
@@ -1,6 +1,6 @@
1
1
  import { t as StorageError } from "./errors-BY4sZe52.mjs";
2
2
  import { c as checkListLimit, d as checkPartNumber, f as checkParts, g as checkWatch, h as checkUploadId, l as checkMetadata, m as checkSha256, o as checkBucketName, p as checkRange, r as checkBlake3, s as checkKey, u as checkMissingKeys, v as invalid, y as missingByHead } from "./names-Dk-eRYJU.mjs";
3
- import { a as processEnv, n as here, o as workloadTransport, r as late, t as clientHeaders } from "./here-C2jhTheQ.mjs";
3
+ import { a as processEnv, n as here, o as workloadTransport, r as late, t as clientHeaders } from "./here-BO-wQDjz.mjs";
4
4
  import { bucketsOf, decodeFrame, encodeFrame, remote, repeatable, serve, watchFrames } from "./wire.mjs";
5
5
  //#region src/socket.ts
6
6
  /**
package/storage/files.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as StorageError } from "../errors-BY4sZe52.mjs";
2
2
  import { o as checkBucketName } from "../names-Dk-eRYJU.mjs";
3
- import { t as clientHeaders } from "../here-C2jhTheQ.mjs";
3
+ import { t as clientHeaders } from "../here-BO-wQDjz.mjs";
4
4
  import { inertHeaders } from "../inert.mjs";
5
5
  import { DatabaseError } from "../database/errors.mjs";
6
6
  import { i as verifier, r as trustedOf, t as authConfigOf } from "../auth-1W-SzpD3.mjs";
@@ -1,4 +1,4 @@
1
- import { T as VectorError } from "../wire-DaZNP-qh.mjs";
1
+ import { T as VectorError } from "../wire-dLeI20PX.mjs";
2
2
  import { vectorDb } from "./index.mjs";
3
3
  //#region src/vector/contract.ts
4
4
  /**
package/vector/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as processEnv, n as here, r as late } from "../here-C2jhTheQ.mjs";
2
- import { C as Vectors, E as vectorErrorCodes, S as TextSearch, T as VectorError, _ as MAX_TOP_K, a as remote, b as NamespaceName, c as Aggregation, d as MAX_BATCH, f as MAX_DIMENSION, g as MAX_TEXT, h as MAX_QUERIES, l as Ids, m as MAX_METADATA_BYTES, n as direct, p as MAX_FULL_TEXT, u as List, v as MAX_VALUE, w as checked, x as Query, y as MultiQuery } from "../wire-DaZNP-qh.mjs";
1
+ import { a as processEnv, n as here, r as late } from "../here-BO-wQDjz.mjs";
2
+ import { C as Vectors, E as vectorErrorCodes, S as TextSearch, T as VectorError, _ as MAX_TOP_K, a as remote, b as NamespaceName, c as Aggregation, d as MAX_BATCH, f as MAX_DIMENSION, g as MAX_TEXT, h as MAX_QUERIES, l as Ids, m as MAX_METADATA_BYTES, n as direct, p as MAX_FULL_TEXT, u as List, v as MAX_VALUE, w as checked, x as Query, y as MultiQuery } from "../wire-dLeI20PX.mjs";
3
3
  //#region src/vector/index.ts
4
4
  /**
5
5
  * Vector DB: a Team's Vectors in Vector namespaces, searched by closeness and filtered by their
@@ -1,4 +1,4 @@
1
- import { T as VectorError } from "../wire-DaZNP-qh.mjs";
1
+ import { T as VectorError } from "../wire-dLeI20PX.mjs";
2
2
  import { embedded } from "./index.mjs";
3
3
  //#region src/vector/stand-in.ts
4
4
  /**
package/vector/wire.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as remote, i as places, n as direct, o as scoped, r as encode, s as serve, t as decode } from "../wire-DaZNP-qh.mjs";
1
+ import { a as remote, i as places, n as direct, o as scoped, r as encode, s as serve, t as decode } from "../wire-dLeI20PX.mjs";
2
2
  export { decode, direct, encode, places, remote, scoped, serve };
@@ -1,4 +1,4 @@
1
- import { a as processEnv, i as platformApi, n as here, r as late, t as clientHeaders } from "../here-C2jhTheQ.mjs";
1
+ import { a as processEnv, i as platformApi, n as here, r as late, t as clientHeaders } from "../here-BO-wQDjz.mjs";
2
2
  import { verifyEvent } from "../apps.mjs";
3
3
  //#region src/webhooks/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as clientHeaders } from "./here-C2jhTheQ.mjs";
1
+ import { t as clientHeaders } from "./here-BO-wQDjz.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/vector/errors.ts
4
4
  const vectorErrorCodes = [
package/wire.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as storageErrorCodes, r as storageErrorReasons, t as StorageError } from "./errors-BY4sZe52.mjs";
2
2
  import { c as checkListLimit, d as checkPartNumber, f as checkParts, h as checkUploadId, l as checkMetadata, m as checkSha256, o as checkBucketName, p as checkRange, r as checkBlake3, s as checkKey, u as checkMissingKeys, y as missingByHead } from "./names-Dk-eRYJU.mjs";
3
- import { t as clientHeaders } from "./here-C2jhTheQ.mjs";
3
+ import { t as clientHeaders } from "./here-BO-wQDjz.mjs";
4
4
  import { z } from "zod";
5
5
  //#region src/wire.ts
6
6
  /**