@exposify/express 0.3.12 → 0.3.13

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/README.md CHANGED
@@ -137,9 +137,9 @@ flagged for you to check. In CI, `describe --check` exits 1 if a tool has no
137
137
  description or one is out of date, and `describe --ci` writes AI
138
138
  descriptions for read routes only, listing the writes for a person.
139
139
 
140
- `npx @exposify/express inspect` prints every route with its tool name,
141
- whether agents get it, and why (`--json` for scripts): the answer to "why
142
- isn't my route showing up?".
140
+ `npx @exposify/express inspect` prints every route with its tool name and
141
+ whether agents get it; add `--why` for the reason on each (`--json` for
142
+ scripts): the answer to "why isn't my route showing up?".
143
143
 
144
144
  **Catch tool changes in CI:** `npx @exposify/express inspect --snapshot` writes
145
145
  `exposify.tools.json` (each route agents can call, and its tool name).
@@ -2137,6 +2137,8 @@ function parseLoginTheme(raw) {
2137
2137
  var DEFAULT_TIMEOUT_MS = 5e3;
2138
2138
  var REPORT_TIMEOUT_MS = 3e3;
2139
2139
  var REPORT_REFRESH_MS = 6e4;
2140
+ var CONNECT_INFO_TTL_MS = 6e4;
2141
+ var CONNECT_INFO_RETRY_MS = 5e3;
2140
2142
  var DEFAULT_MAX_CACHE_MS = 3e4;
2141
2143
  var EXPIRY_SKEW_MS = 6e4;
2142
2144
  var MAX_CACHE_ENTRIES = 500;
@@ -2247,6 +2249,21 @@ function createHostedAuthResolver(config) {
2247
2249
  let passwordDirect;
2248
2250
  const apiUrl = requireHttpsBaseUrl("apiUrl", config.apiUrl ?? readEnv(API_URL_ENV) ?? DEFAULT_API_URL);
2249
2251
  const stepSealer = createSealer(licenseKey, "exposify login-step v1");
2252
+ let connectInfo;
2253
+ let connectInflight;
2254
+ const fetchConnectInfo = async () => {
2255
+ try {
2256
+ const res = await fetchImpl(`${issuer}/connect-info`, { signal: AbortSignal.timeout(REPORT_TIMEOUT_MS) });
2257
+ if (res.status === 404) {
2258
+ connectInfo = { body: null, at: Date.now() - CONNECT_INFO_TTL_MS + CONNECT_INFO_RETRY_MS };
2259
+ } else if (res.ok) {
2260
+ const body = await res.json();
2261
+ connectInfo = { body: body && typeof body === "object" ? body : null, at: Date.now() };
2262
+ }
2263
+ } catch {
2264
+ }
2265
+ return connectInfo?.body ?? null;
2266
+ };
2250
2267
  const info = {
2251
2268
  issuer,
2252
2269
  sealLoginStep: (text) => stepSealer.seal(text),
@@ -2297,6 +2314,13 @@ function createHostedAuthResolver(config) {
2297
2314
  await brokerPost("session-ended", {}, authorization);
2298
2315
  },
2299
2316
  supabasePasswordDirect: () => passwordDirect,
2317
+ connectInfo() {
2318
+ if (connectInfo && Date.now() - connectInfo.at < CONNECT_INFO_TTL_MS) return Promise.resolve(connectInfo.body);
2319
+ return connectInflight ??= fetchConnectInfo().finally(() => connectInflight = void 0);
2320
+ },
2321
+ countConnectOpen() {
2322
+ void brokerPost("connect-open", {});
2323
+ },
2300
2324
  reportLogin(report) {
2301
2325
  const key = JSON.stringify(report);
2302
2326
  const send2 = async () => {
@@ -2141,6 +2141,8 @@ function parseLoginTheme(raw) {
2141
2141
  var DEFAULT_TIMEOUT_MS = 5e3;
2142
2142
  var REPORT_TIMEOUT_MS = 3e3;
2143
2143
  var REPORT_REFRESH_MS = 6e4;
2144
+ var CONNECT_INFO_TTL_MS = 6e4;
2145
+ var CONNECT_INFO_RETRY_MS = 5e3;
2144
2146
  var DEFAULT_MAX_CACHE_MS = 3e4;
2145
2147
  var EXPIRY_SKEW_MS = 6e4;
2146
2148
  var MAX_CACHE_ENTRIES = 500;
@@ -2251,6 +2253,21 @@ function createHostedAuthResolver(config) {
2251
2253
  let passwordDirect;
2252
2254
  const apiUrl = requireHttpsBaseUrl("apiUrl", config.apiUrl ?? readEnv(API_URL_ENV) ?? DEFAULT_API_URL);
2253
2255
  const stepSealer = createSealer(licenseKey, "exposify login-step v1");
2256
+ let connectInfo;
2257
+ let connectInflight;
2258
+ const fetchConnectInfo = async () => {
2259
+ try {
2260
+ const res = await fetchImpl(`${issuer}/connect-info`, { signal: AbortSignal.timeout(REPORT_TIMEOUT_MS) });
2261
+ if (res.status === 404) {
2262
+ connectInfo = { body: null, at: Date.now() - CONNECT_INFO_TTL_MS + CONNECT_INFO_RETRY_MS };
2263
+ } else if (res.ok) {
2264
+ const body = await res.json();
2265
+ connectInfo = { body: body && typeof body === "object" ? body : null, at: Date.now() };
2266
+ }
2267
+ } catch {
2268
+ }
2269
+ return connectInfo?.body ?? null;
2270
+ };
2254
2271
  const info = {
2255
2272
  issuer,
2256
2273
  sealLoginStep: (text) => stepSealer.seal(text),
@@ -2301,6 +2318,13 @@ function createHostedAuthResolver(config) {
2301
2318
  await brokerPost("session-ended", {}, authorization);
2302
2319
  },
2303
2320
  supabasePasswordDirect: () => passwordDirect,
2321
+ connectInfo() {
2322
+ if (connectInfo && Date.now() - connectInfo.at < CONNECT_INFO_TTL_MS) return Promise.resolve(connectInfo.body);
2323
+ return connectInflight ??= fetchConnectInfo().finally(() => connectInflight = void 0);
2324
+ },
2325
+ countConnectOpen() {
2326
+ void brokerPost("connect-open", {});
2327
+ },
2304
2328
  reportLogin(report) {
2305
2329
  const key = JSON.stringify(report);
2306
2330
  const send2 = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exposify/express",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -26,8 +26,8 @@
26
26
  "prepack": "yarn build"
27
27
  },
28
28
  "dependencies": {
29
- "@exposify/cli": "0.0.7",
30
- "@exposify/core": "0.3.17"
29
+ "@exposify/cli": "0.0.8",
30
+ "@exposify/core": "0.3.18"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "express": ">=4 <6"