@ai-matrx/api 0.1.38 → 0.1.39

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/CHANGELOG.md CHANGED
@@ -2,15 +2,25 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
- - **`isBareTransportCode` is also on `/net` (2026-10-17).** Moved to `src/net/transport-code.ts` (pure, no client) and re-exported by the root as before, so a server-side reader (`@ai-matrx/data` `/access`) imports it without the root. Additive. Consumer action: none.
5
+ - **`isBareTransportCode` is owned by `@ai-matrx/kit/errors` (2026-10-17).** It is a pure text test, so it moved below every reader; `src/net/transport-code.ts` is gone and the `/net` re-export added earlier today is removed (its one importer, `@ai-matrx/data`, now imports kit). The root still exports it by the same name. Consumer action: import it from `@ai-matrx/api` (root) or `@ai-matrx/kit/errors`, never `@ai-matrx/api/net`.
6
+ - **The packed `/net` canary moved here** from `@ai-matrx/data`'s tarball check: every trio export, both loaders, plus the recover-on-attempt-2 smoke. Consumer action: none.
6
7
  - **Warm-up retries transient failures.** `createWarmup` re-sends a batch that failed with a network error or 408/425/429/5xx (not 501) after 2s, 8s and 30s while the scope is unchanged — a server rollover is exactly when a warm-up matters. New option `retryDelaysMs` (its length is the budget; `[]` disables). Refusals never retry. Consumer action: none.
7
8
  - **Removed** the deprecated aliases `ENDPOINTS.ai.chat` (use `ENDPOINTS.ai.manual`) and `ENDPOINTS.utilities.pdfExtractText` (use `ENDPOINTS.pdf.extractText`); no importer existed. Added `FEATURE.md`. Consumer action: none.
8
9
 
9
- ## 0.1.38
10
+ ## 0.1.39
10
11
 
11
12
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
12
13
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/api/src`.
13
14
 
15
+ ## 0.1.38
16
+
17
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
18
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
19
+ Diff: `git diff b887d4308f ec7de99183 -- apps/shared/api/src`
20
+
21
+ Changed shipped source files (1):
22
+ - `apps/shared/api/src/intelligence/keys.generated.ts`
23
+
14
24
  ## 0.1.37
15
25
 
16
26
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
@@ -56,12 +56,4 @@ async function* monitorStream(source, opts = {}) {
56
56
  }
57
57
  }
58
58
 
59
- // src/net/transport-code.ts
60
- var BARE_TRANSPORT_CODE = /^\s*(?:HTTP|HTTP\s*Error|Status(?:\s*Code)?)?\s*[:\-]?\s*\d{3}\s*[.:!]?\s*$/i;
61
- function isBareTransportCode(text) {
62
- if (!text) return false;
63
- return BARE_TRANSPORT_CODE.test(text);
64
- }
65
-
66
- exports.isBareTransportCode = isBareTransportCode;
67
59
  exports.monitorStream = monitorStream;
@@ -54,11 +54,4 @@ async function* monitorStream(source, opts = {}) {
54
54
  }
55
55
  }
56
56
 
57
- // src/net/transport-code.ts
58
- var BARE_TRANSPORT_CODE = /^\s*(?:HTTP|HTTP\s*Error|Status(?:\s*Code)?)?\s*[:\-]?\s*\d{3}\s*[.:!]?\s*$/i;
59
- function isBareTransportCode(text) {
60
- if (!text) return false;
61
- return BARE_TRANSPORT_CODE.test(text);
62
- }
63
-
64
- export { isBareTransportCode, monitorStream };
57
+ export { monitorStream };
package/dist/index.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkOOZ3H4CS_cjs = require('./chunk-OOZ3H4CS.cjs');
3
+ var chunkFNIYADWI_cjs = require('./chunk-FNIYADWI.cjs');
4
4
  var chunkMVXD6WI6_cjs = require('./chunk-MVXD6WI6.cjs');
5
5
  var chunkW7VYU3YW_cjs = require('./chunk-W7VYU3YW.cjs');
6
6
  var chunk2SXAAKGV_cjs = require('./chunk-2SXAAKGV.cjs');
7
+ var errors = require('@ai-matrx/kit/errors');
7
8
  var format = require('@ai-matrx/kit/format');
8
9
 
9
- // src/core/call.ts
10
10
  function buildMatrxRequestUrl(baseUrl, pathTemplate, pathParams, queryParams) {
11
11
  let resolvedPath = pathTemplate;
12
12
  if (pathParams) {
@@ -75,7 +75,7 @@ function bareStatusSentence(status) {
75
75
  return "The server refused this request and sent no reason with it \u2014 the missing reason is itself a defect worth reporting. Reload the page and try once more; if it repeats, report it with the request id above.";
76
76
  }
77
77
  function honestTransportMessage(raw, status) {
78
- if (raw && !chunkOOZ3H4CS_cjs.isBareTransportCode(raw)) return raw;
78
+ if (raw && !errors.isBareTransportCode(raw)) return raw;
79
79
  return bareStatusSentence(status ?? 0);
80
80
  }
81
81
  var SENSITIVE_HEADER_NAME = /authorization|cookie|token|api[-_]?key/i;
@@ -315,7 +315,7 @@ function normalizeMatrxError(err) {
315
315
  status
316
316
  };
317
317
  }
318
- if (chunkOOZ3H4CS_cjs.isBareTransportCode(err.message)) {
318
+ if (errors.isBareTransportCode(err.message)) {
319
319
  const status = Number.parseInt(err.message.replace(/\D+/g, ""), 10);
320
320
  return {
321
321
  type: classifyStatus(status),
@@ -2265,13 +2265,9 @@ var ENDPOINTS = {
2265
2265
  }
2266
2266
  };
2267
2267
 
2268
- Object.defineProperty(exports, "isBareTransportCode", {
2269
- enumerable: true,
2270
- get: function () { return chunkOOZ3H4CS_cjs.isBareTransportCode; }
2271
- });
2272
2268
  Object.defineProperty(exports, "monitorStream", {
2273
2269
  enumerable: true,
2274
- get: function () { return chunkOOZ3H4CS_cjs.monitorStream; }
2270
+ get: function () { return chunkFNIYADWI_cjs.monitorStream; }
2275
2271
  });
2276
2272
  Object.defineProperty(exports, "API_KEY_PREFIX", {
2277
2273
  enumerable: true,
@@ -2457,6 +2453,10 @@ Object.defineProperty(exports, "withRetry", {
2457
2453
  enumerable: true,
2458
2454
  get: function () { return chunk2SXAAKGV_cjs.withRetry; }
2459
2455
  });
2456
+ Object.defineProperty(exports, "isBareTransportCode", {
2457
+ enumerable: true,
2458
+ get: function () { return errors.isBareTransportCode; }
2459
+ });
2460
2460
  exports.ENDPOINTS = ENDPOINTS;
2461
2461
  exports.MATRX_LIVE_STREAM_UNAVAILABLE = MATRX_LIVE_STREAM_UNAVAILABLE;
2462
2462
  exports.MATRX_RESUME_CONFLICT = MATRX_RESUME_CONFLICT;
package/dist/index.d.cts CHANGED
@@ -2,8 +2,9 @@ import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c
2
2
  export { A as Api, e as ApiRequestInfo, a as ApiStream, f as AuthTier, g as CONTRACT_SHA256, C as CallOptions, h as CreateApiOptions, D as DEPLOYMENTS, i as DOMAINS, j as DeploymentName, E as Environment, H as HttpMethod, J as JsonOrStream, N as NdjsonEvent, O as OperationArgs, k as OperationDescriptor, l as OrgRule, S as SseEvent, m as StreamKind, n as createApi, o as isBinaryType, p as openJsonOrStream, q as openStream } from './index-D7z-_LrQ.cjs';
3
3
  import { CredentialsPort } from '@ai-matrx/auth/credentials';
4
4
  export { API_KEY_PREFIX, CredentialsPort, CredentialsSetting, MATRX_HEADERS, MatrxCredential, MatrxCredentialKind, credentialToHeaders, toCredentialsPort } from '@ai-matrx/auth/credentials';
5
- export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.cjs';
5
+ export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.cjs';
6
6
  import { g as MandateKey, b as DynamicMandateKey } from './keys.generated-DAXwWVYT.cjs';
7
+ export { isBareTransportCode } from '@ai-matrx/kit/errors';
7
8
 
8
9
  /**
9
10
  * `@ai-matrx/api` — the Matrx transport port.
package/dist/index.d.ts CHANGED
@@ -2,8 +2,9 @@ import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c
2
2
  export { A as Api, e as ApiRequestInfo, a as ApiStream, f as AuthTier, g as CONTRACT_SHA256, C as CallOptions, h as CreateApiOptions, D as DEPLOYMENTS, i as DOMAINS, j as DeploymentName, E as Environment, H as HttpMethod, J as JsonOrStream, N as NdjsonEvent, O as OperationArgs, k as OperationDescriptor, l as OrgRule, S as SseEvent, m as StreamKind, n as createApi, o as isBinaryType, p as openJsonOrStream, q as openStream } from './index-D7z-_LrQ.js';
3
3
  import { CredentialsPort } from '@ai-matrx/auth/credentials';
4
4
  export { API_KEY_PREFIX, CredentialsPort, CredentialsSetting, MATRX_HEADERS, MatrxCredential, MatrxCredentialKind, credentialToHeaders, toCredentialsPort } from '@ai-matrx/auth/credentials';
5
- export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.js';
5
+ export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.js';
6
6
  import { g as MandateKey, b as DynamicMandateKey } from './keys.generated-DAXwWVYT.js';
7
+ export { isBareTransportCode } from '@ai-matrx/kit/errors';
7
8
 
8
9
  /**
9
10
  * `@ai-matrx/api` — the Matrx transport port.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { isBareTransportCode } from './chunk-DIRPTJVH.js';
2
- export { isBareTransportCode, monitorStream } from './chunk-DIRPTJVH.js';
1
+ export { monitorStream } from './chunk-YTEOFGFC.js';
3
2
  export { API_KEY_PREFIX, MATRX_HEADERS, credentialToHeaders, toCredentialsPort } from './chunk-7MZPBCFV.js';
4
3
  import { OrganizationContextError, sendOnWire, WIRE_FETCH_OPTION_KEYS, BackendApiError, parseHttpError, MatrxApiError, applyOrganizationContextHeader, extractMatrxErrorCode, extractMatrxErrorMessage, readMatrxNdjsonStream, readMatrxSseStream, requireOrganizationContext, StreamTransportError } from './chunk-NRTRYB7K.js';
5
4
  export { BackendApiError, CONTRACT_SHA256, DEPLOYMENTS, DOMAINS, MatrxApiError, OrganizationContextError, StreamTransportError, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, createApi, createOrganizationOperation, describeBackendFailure, extractMatrxErrorCode, extractMatrxErrorMessage, getUserMessage, isBinaryType, isGenericUserMessage, isStreamTransportLost, openJsonOrStream, openStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parsePersistedBackendError, parseStreamError, requireOrganizationContext, unwrapUpstreamError } from './chunk-NRTRYB7K.js';
6
5
  import { isNetError, extractErrorMessage } from './chunk-KIEAFMKB.js';
7
6
  export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetworkError, OfflineError, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, resilientFetch, toNetError, withRetry } from './chunk-KIEAFMKB.js';
7
+ import { isBareTransportCode } from '@ai-matrx/kit/errors';
8
+ export { isBareTransportCode } from '@ai-matrx/kit/errors';
8
9
  import { formatDurationSeconds } from '@ai-matrx/kit/format';
9
10
 
10
- // src/core/call.ts
11
11
  function buildMatrxRequestUrl(baseUrl, pathTemplate, pathParams, queryParams) {
12
12
  let resolvedPath = pathTemplate;
13
13
  if (pathParams) {
package/dist/net.cjs CHANGED
@@ -1,17 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkOOZ3H4CS_cjs = require('./chunk-OOZ3H4CS.cjs');
3
+ var chunkFNIYADWI_cjs = require('./chunk-FNIYADWI.cjs');
4
4
  var chunk2SXAAKGV_cjs = require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
 
7
7
 
8
- Object.defineProperty(exports, "isBareTransportCode", {
9
- enumerable: true,
10
- get: function () { return chunkOOZ3H4CS_cjs.isBareTransportCode; }
11
- });
12
8
  Object.defineProperty(exports, "monitorStream", {
13
9
  enumerable: true,
14
- get: function () { return chunkOOZ3H4CS_cjs.monitorStream; }
10
+ get: function () { return chunkFNIYADWI_cjs.monitorStream; }
15
11
  });
16
12
  Object.defineProperty(exports, "AbortedError", {
17
13
  enumerable: true,
package/dist/net.d.cts CHANGED
@@ -201,7 +201,4 @@ interface StreamMonitorOptions {
201
201
  */
202
202
  declare function monitorStream<T>(source: AsyncIterable<T>, opts?: StreamMonitorOptions): AsyncGenerator<T, void, undefined>;
203
203
 
204
- /** True when a candidate sentence is really just the status line wearing words. */
205
- declare function isBareTransportCode(text: string | null | undefined): boolean;
206
-
207
- export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, type NetErrorCode, NetworkError, OfflineError, type ResilientFetchOptions, type ResilientFetchResult, type RetryOptions, type StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry };
204
+ export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, type NetErrorCode, NetworkError, OfflineError, type ResilientFetchOptions, type ResilientFetchResult, type RetryOptions, type StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry };
package/dist/net.d.ts CHANGED
@@ -201,7 +201,4 @@ interface StreamMonitorOptions {
201
201
  */
202
202
  declare function monitorStream<T>(source: AsyncIterable<T>, opts?: StreamMonitorOptions): AsyncGenerator<T, void, undefined>;
203
203
 
204
- /** True when a candidate sentence is really just the status line wearing words. */
205
- declare function isBareTransportCode(text: string | null | undefined): boolean;
206
-
207
- export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, type NetErrorCode, NetworkError, OfflineError, type ResilientFetchOptions, type ResilientFetchResult, type RetryOptions, type StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry };
204
+ export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, type NetErrorCode, NetworkError, OfflineError, type ResilientFetchOptions, type ResilientFetchResult, type RetryOptions, type StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry };
package/dist/net.js CHANGED
@@ -1,2 +1,2 @@
1
- export { isBareTransportCode, monitorStream } from './chunk-DIRPTJVH.js';
1
+ export { monitorStream } from './chunk-YTEOFGFC.js';
2
2
  export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetworkError, OfflineError, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, resilientFetch, toNetError, withRetry } from './chunk-KIEAFMKB.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/api",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "The one way every app talks to every AI Matrx server: generated from the server contract, split by domain so an app loads only the requests it calls. Transport, five credential kinds, organization binding, streams, job follow. No screens, app state or database code.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -439,5 +439,5 @@
439
439
  "check:sections": "node scripts/section-probe.mjs \"$PWD\"",
440
440
  "verify:tarball": "node scripts/verify-tarball.mjs"
441
441
  },
442
- "gitHead": "ec7de99183f4e72fa78cfa1d514cc4fdee44b523"
442
+ "gitHead": "95a286343b1aae1f7f02cb1d0df48d9b58c8537c"
443
443
  }