@midsummer-ai/sdk 0.1.0-staging.3817 → 0.1.0-staging.3823

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/auth/contract.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { r as AuthError } from "../auth-BvX0Xd2G.mjs";
2
- import { d as SETTINGS_TTL_MS, n as LIMIT_WINDOW_MS, t as LIMITS } from "../guard-DrFHnHzr.mjs";
1
+ import { r as AuthError } from "../auth-DokDWe3i.mjs";
2
+ import { d as SETTINGS_TTL_MS, n as LIMIT_WINDOW_MS, t as LIMITS } from "../guard-Br3K8CVx.mjs";
3
3
  import { IMPERSONATION_TOKEN_MS, startImpersonation } from "./impersonate.mjs";
4
4
  //#region src/auth/contract.ts
5
5
  /**
package/auth/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as SESSION_CACHE_S, c as databaseStore, i as IMPERSONATION_S, n as AUTH_ROUTES, o as auth, r as AuthError, s as createAuth, t as AUTH_PATH } from "../auth-BvX0Xd2G.mjs";
1
+ import { a as SESSION_CACHE_S, c as databaseStore, i as IMPERSONATION_S, n as AUTH_ROUTES, o as auth, r as AuthError, s as createAuth, t as AUTH_PATH } from "../auth-DokDWe3i.mjs";
2
2
  import { checkSignInMail, signInWords } from "./mail.mjs";
3
3
  import { n as authFiles } from "../files-DhPeWwcT.mjs";
4
4
  export { AUTH_PATH, AUTH_ROUTES, AuthError, IMPERSONATION_S, SESSION_CACHE_S, auth, authFiles, checkSignInMail, createAuth, databaseStore, signInWords };
package/auth/password.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as hashPassword$1, r as verifyPassword$1 } from "../engine-BEuwy5dz.mjs";
1
+ import { n as hashPassword$1, r as verifyPassword$1 } from "../engine-Be7yur9O.mjs";
2
2
  import { isBcrypt as isBcrypt$1 } from "./import.mjs";
3
3
  //#region src/auth/password.ts
4
4
  /**
package/auth/react.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as DATABASE_TOKEN_PATH, u as signedInDatabase } from "../client-DD0xZprk.mjs";
2
2
  import { DatabaseProvider } from "../database/react.mjs";
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-CCFT-5rG.mjs";
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-BJzVvUKV.mjs";
4
4
  import { a as shapeAttributes, r as ICONS, t as qrPath } from "../qr-BySxqLW6.mjs";
5
5
  import { AuthClientError, authClient } from "./client.mjs";
6
6
  import { Fragment, createContext, createElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
@@ -294,7 +294,7 @@ function Submit(props) {
294
294
  "aria-busy": props.busy || void 0
295
295
  }, props.busy ? WORDS.busy : props.label);
296
296
  }
297
- /** A quiet action in a line of them, such as "Resend code". */
297
+ /** A quiet action in a line of them, such as asking for another code. */
298
298
  const LinkButton = (props) => createElement("button", {
299
299
  type: "button",
300
300
  className: "msa-link",
@@ -389,12 +389,12 @@ function Confirm(props) {
389
389
  const [asking, setAsking] = useState(false);
390
390
  if (!asking) return createElement("button", {
391
391
  type: "button",
392
- className: "msa-button msa-ghost msa-small",
392
+ className: "msa-button msa-quiet msa-small",
393
393
  onClick: () => setAsking(true)
394
394
  }, props.label);
395
395
  return createElement(Fragment, null, createElement("button", {
396
396
  type: "button",
397
- className: "msa-button msa-ghost msa-small",
397
+ className: "msa-button msa-quiet msa-small",
398
398
  onClick: () => setAsking(false)
399
399
  }, WORDS.account.cancel), createElement("button", {
400
400
  type: "button",
@@ -868,7 +868,7 @@ function FieldRow(props) {
868
868
  function Actions(props) {
869
869
  return createElement("div", { className: "msa-panel-actions" }, props.onCancel ? createElement("button", {
870
870
  type: "button",
871
- className: "msa-button msa-ghost msa-small",
871
+ className: "msa-button msa-quiet msa-small",
872
872
  onClick: props.onCancel
873
873
  }, WORDS.account.cancel) : null, createElement("button", {
874
874
  type: "submit",
@@ -1133,7 +1133,7 @@ function UserProfile() {
1133
1133
  ].filter(Boolean).join(" · "),
1134
1134
  control: one.id === session.id ? createElement("span", { className: "msa-tag" }, WORDS.account.thisDevice) : createElement("button", {
1135
1135
  type: "button",
1136
- className: "msa-button msa-ghost msa-small",
1136
+ className: "msa-button msa-quiet msa-small",
1137
1137
  onClick: () => void run("sessions", async () => {
1138
1138
  await client.sessions.revoke(one.token);
1139
1139
  await load();
@@ -1292,7 +1292,7 @@ function OrganizationSwitcher() {
1292
1292
  autoFocus: true
1293
1293
  }), createElement("button", {
1294
1294
  type: "button",
1295
- className: "msa-button msa-ghost",
1295
+ className: "msa-button msa-quiet",
1296
1296
  onClick: () => {
1297
1297
  setCreating(false);
1298
1298
  setName("");
@@ -1415,7 +1415,7 @@ function OrganizationProfile(props) {
1415
1415
  detail: roles[one.role ?? "member"],
1416
1416
  control: createElement("button", {
1417
1417
  type: "button",
1418
- className: "msa-button msa-ghost msa-small",
1418
+ className: "msa-button msa-quiet msa-small",
1419
1419
  onClick: () => void run("invitations", async () => {
1420
1420
  await client.organizations.cancelInvitation(one.id);
1421
1421
  await load();
@@ -3,8 +3,8 @@ import { d as userToken, o as connect, s as databaseUrl } from "./client-DD0xZpr
3
3
  import { sendSignInMail } from "./auth/mail.mjs";
4
4
  import "./files-DhPeWwcT.mjs";
5
5
  import { standIn } from "./auth/stand-in.mjs";
6
- import { a as WORDS, c as deviceOf, i as CAPTCHA_WIDGETS, l as screenName, n as textOn, o as ago, r as GEIST_WOFF2, s as defaultAppName, t as authCss, u as setupKeyOf } from "./style-CCFT-5rG.mjs";
7
- import { _ as challenge, a as leakedPassword, b as remembering, c as refusal, f as mayJoin, g as agentOfKey, i as guard, l as verifyHuman, m as settingsReader, o as ourWords, p as publicSettings, r as REFUSALS, s as rateLimiter, u as JoinRefused, v as consentPage, x as resourceOf, y as credentialOf } from "./guard-DrFHnHzr.mjs";
6
+ import { a as WORDS, c as deviceOf, i as CAPTCHA_WIDGETS, l as screenName, n as textOn, o as ago, r as GEIST_WOFF2, s as defaultAppName, t as authCss, u as setupKeyOf } from "./style-BJzVvUKV.mjs";
7
+ import { _ as challenge, a as leakedPassword, b as remembering, c as refusal, f as mayJoin, g as agentOfKey, i as guard, l as verifyHuman, m as settingsReader, o as ourWords, p as publicSettings, r as REFUSALS, s as rateLimiter, u as JoinRefused, v as consentPage, x as resourceOf, y as credentialOf } from "./guard-Br3K8CVx.mjs";
8
8
  import { i as iconSvg, n as qrSvg } from "./qr-BySxqLW6.mjs";
9
9
  //#region src/auth/store.ts
10
10
  const KIND = {
@@ -818,8 +818,8 @@ const actions = (label, action) => `<div class="msa-panel-actions"><button class
818
818
  /** A row's action; one that removes something asks first, by opening to its button for good beside it. */
819
819
  const rowButton = (action, words, hidden = {}, confirm) => {
820
820
  const fieldsOf = Object.entries(hidden).map(([name, value]) => `<input type="hidden" name="${escape(name)}" value="${escape(value)}">`).join("");
821
- if (!confirm) return `<form method="post">${fieldsOf}<button class="msa-button msa-ghost msa-small" name="action" value="${escape(action)}">${escape(words)}</button></form>`;
822
- return `<details class="msa-confirm"><summary class="msa-button msa-ghost msa-small"><span class="msa-closed">${escape(words)}</span><span class="msa-opened">${escape(WORDS.account.cancel)}</span></summary><form method="post">${fieldsOf}<button class="msa-button msa-danger msa-small" name="action" value="${escape(action)}">${escape(confirm)}</button></form></details>`;
821
+ if (!confirm) return `<form method="post">${fieldsOf}<button class="msa-button msa-quiet msa-small" name="action" value="${escape(action)}">${escape(words)}</button></form>`;
822
+ return `<details class="msa-confirm"><summary class="msa-button msa-quiet msa-small"><span class="msa-closed">${escape(words)}</span><span class="msa-opened">${escape(WORDS.account.cancel)}</span></summary><form method="post">${fieldsOf}<button class="msa-button msa-danger msa-small" name="action" value="${escape(action)}">${escape(confirm)}</button></form></details>`;
823
823
  };
824
824
  /** The account page's panel each of its forms belongs to, where a refusal of it is said. */
825
825
  const SECTION_OF = {
@@ -976,7 +976,7 @@ function organizationBody(input) {
976
976
  const memberRows = members.map((member) => {
977
977
  const user = member.user ?? {};
978
978
  const roleWords = roles[member.role] ?? String(member.role);
979
- const control = manages && member.userId !== input.userId ? `<form method="post" class="msa-row-control"><input type="hidden" name="member" value="${escape(member.id)}">${select("role", `${WORDS.fields.role}, ${String(user.email)}`, roleOptions(String(member.role)))}<button class="msa-button msa-ghost msa-small" name="action" value="role">${escape(words.save)}</button></form>${rowButton("remove", words.remove, { member: String(member.id) }, words.removeForGood)}` : `<span class="msa-tag">${escape(member.userId === input.userId ? `${words.you} · ${roleWords}` : roleWords)}</span>`;
979
+ const control = manages && member.userId !== input.userId ? `<form method="post" class="msa-row-control"><input type="hidden" name="member" value="${escape(member.id)}">${select("role", `${WORDS.fields.role}, ${String(user.email)}`, roleOptions(String(member.role)))}<button class="msa-button msa-quiet msa-small" name="action" value="role">${escape(words.save)}</button></form>${rowButton("remove", words.remove, { member: String(member.id) }, words.removeForGood)}` : `<span class="msa-tag">${escape(member.userId === input.userId ? `${words.you} · ${roleWords}` : roleWords)}</span>`;
980
980
  return row(String(user.name || user.email), user.name ? String(user.email ?? "") : "", control);
981
981
  }).join("");
982
982
  const pending = (full.invitations ?? []).filter((one) => one.status === "pending");
@@ -1234,7 +1234,7 @@ const DAY_S = 86400;
1234
1234
  * the engine (a session with no cookie, the settings, the hosted pages), never load it. Loaded at import, it added 0.2
1235
1235
  * to 0.6 s to the first answer of each new copy of a Next.js app's server on Midsummer.
1236
1236
  */
1237
- const engineAdapter = () => import("./engine-BEuwy5dz.mjs").then((n) => n.t);
1237
+ const engineAdapter = () => import("./engine-Be7yur9O.mjs").then((n) => n.t);
1238
1238
  const keyOf = (row) => ({
1239
1239
  id: row.id,
1240
1240
  name: row.name,
@@ -1,6 +1,6 @@
1
1
  import { i as __toCommonJS, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CL6CfywC.mjs";
2
2
  import { KEY_PREFIX } from "./auth/key.mjs";
3
- import { h as IDENTITY_SCOPES, o as ourWords, u as JoinRefused, x as resourceOf } from "./guard-DrFHnHzr.mjs";
3
+ import { h as IDENTITY_SCOPES, o as ourWords, u as JoinRefused, x as resourceOf } from "./guard-Br3K8CVx.mjs";
4
4
  import { impersonationIdentifier } from "./auth/impersonate.mjs";
5
5
  import { $ as queueAfterTransactionHook, $t as getOrigin, A as freshSessionMiddleware, At as userSchema, B as sensitiveSessionMiddleware, Bt as jwtVerify, C as parseScopeField, Ct as parseAccountOutput, D as constantTimeEqual, Dt as parseUserInput, E as generateRandomString, Et as parseSessionOutput, F as listSessions, Ft as decodeJwt, G as createAuthMiddleware, Gt as JWTExpired, H as appendQueryParams, Ht as JOSEError, I as requestOnlySessionMiddleware, It as decodeProtectedHeader, J as defu, Jt as hasServerSessionStore, K as isAPIError$1, Kt as sha256, L as revokeOtherSessions, Lt as importJWK, M as getSession, Mt as number, N as getSessionFromCtx, Nt as string, O as getOAuthServerContext, Ot as parseUserOutput, P as isStateful, Pt as signJWT, Q as getCurrentAdapter, Qt as getHost, R as revokeSession, Rt as createLocalJWKSet, S as parseProviderEmailVerified, St as mergeSchema, T as symmetricEncrypt, Tt as parseSessionInput, U as normalizePathname, Ut as JWKSNoMatchingKey, V as sessionMiddleware, Vt as isJwkSet, W as createAuthEndpoint, Wt as JWKSTimeout, X as findInvalidTrustedProxies, Xt as isPromise, Y as createRateLimitKey, Yt as shouldBindAccountCookieToSessionUser, Z as getIP, Zt as getBaseURL, _ as encodeBasicCredentials, _t as parseSetCookieHeader, a as resolveSigningKey, an as BASE_ERROR_CODES, at as tryGetCurrentAuthEndpointContext, b as getPrimaryClientId, bt as buildSyntheticUserOutput, c as getDefaultKeyAlg, ct as deleteSessionCookie, d as getOperationId, dt as setCookieCache, en as getProtocol, et as runWithAdapter, f as verifyJwsAccessToken, ft as setSessionCookie, g as resolveClientAssertionParams, gt as createRouter$1, h as betterFetch, ht as setAccountCookie, i as getJwtToken, in as trimTrailingSlashes, it as getCurrentAuthEndpointContext, j as getAuthoritativeSessionFromCtx, jt as coreSchema, k as setOAuthState, kt as filterOutputFields, l as getJwksAdapter, lt as expireCookie, m as fetchRefusingRedirects, mt as getAccountCookie, n as metadataResponse, nn as isRequestLike, nt as runtimeSchemaCheckFor, o as signJWT$1, on as defineErrorCodes, ot as createHash, p as DPOP_SIGNING_ALGORITHMS, pt as createHMAC, q as isLoopbackHost$1, qt as hkdf, r as oauthProvider, rn as resolveBaseURL, rt as schemaCheckFor, s as createJwk, sn as wildcardMatch, st as createCookieGetter, t as getIssuer, tn as isDynamicBaseURLConfig, tt as runWithTransaction, u as dispatchAuthEndpoint, ut as getCookies, v as generateCodeChallenge, vt as parseCookieCachePayload, w as symmetricDecrypt, wt as parseAdditionalUserInputFromProviderProfile, x as mergeScopes, xt as getSessionDefaultFields, y as getOAuth2Tokens, yt as getDate$1, z as revokeSessions, zt as SignJWT } from "./authorize-BzDrbYtI-0gOzDrp2.mjs";
6
6
  import { B as getBooleanEnvVar, E as bytesToHex, F as logger, H as isDevelopment, M as utf8ToBytes, P as createLogger, R as ENV, U as isProduction, V as getEnvVar, W as isTest, a as createRandomStringGenerator, b as getAuthTables, c as ATTR_DB_COLLECTION_NAME, d as ATTR_HTTP_RESPONSE_STATUS_CODE, g as base64Url, h as base64$1, i as generateId$1, o as createWithSpan, s as ATTR_CONTEXT, t as encodeDeterministicId, u as ATTR_HOOK_TYPE, v as toUint8Array, y as safeJSONParse, z as env } from "./get-id-field-vhOArqXN.mjs";
@@ -1,5 +1,5 @@
1
1
  import "./auth/key.mjs";
2
- import { l as screenName, t as authCss } from "./style-CCFT-5rG.mjs";
2
+ import { l as screenName, t as authCss } from "./style-BJzVvUKV.mjs";
3
3
  //#region src/auth/agents.ts
4
4
  /**
5
5
  * Agents as users of your app: API keys, and sign-in for MCP clients, both limited to the scopes your app
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midsummer-ai/sdk",
3
- "version": "0.1.0-staging.3817",
3
+ "version": "0.1.0-staging.3823",
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.",
@@ -558,10 +558,10 @@ function authCss(base = "") {
558
558
  .msa-danger{border-color:var(--ms-button-danger-edge);background-color:var(--ms-button-danger);background-image:var(--ms-button-danger-sheen);color:var(--ms-button-danger-foreground);box-shadow:var(--ms-shadow-button-danger)}
559
559
  .msa-danger:hover{background-color:var(--ms-button-danger-hover);box-shadow:var(--ms-shadow-button-danger-hover)}
560
560
  .msa-danger:active{background-color:var(--ms-button-danger-pressed);box-shadow:var(--ms-shadow-button-danger-pressed)}
561
- .msa-ghost{background:transparent;color:var(--ms-text-secondary)}
562
- .msa-ghost:hover,.msa-ghost:active{color:var(--ms-text-primary)}
561
+ .msa-quiet{background:transparent;color:var(--ms-text-secondary)}
562
+ .msa-quiet:hover,.msa-quiet:active{color:var(--ms-text-primary)}
563
563
  .msa-button:disabled,.msa-button[aria-disabled="true"]{border-color:var(--ms-border-subtle);background:var(--ms-surface-secondary);color:var(--ms-text-tertiary);box-shadow:none;cursor:default}
564
- .msa-ghost:disabled{border-color:transparent;background:transparent}
564
+ .msa-quiet:disabled{border-color:transparent;background:transparent}
565
565
  .msa-link{display:inline-flex;align-items:center;min-height:24px;padding:0;border:0;border-radius:4px;background:none;font:inherit;font-weight:var(--font-weight-medium);color:var(--ms-text-secondary);text-decoration-line:none;white-space:nowrap;cursor:pointer;outline:none;transition:color var(--motion-duration-quick) var(--motion-ease-out)}
566
566
  .msa-link:hover{text-decoration-line:underline}
567
567
  .msa-link:active{color:var(--ms-text-primary)}