@xemahq/llm-registry-api-client 0.13.0 → 0.14.1

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.
@@ -463,6 +463,37 @@ function isJsonMediaType(contentType) {
463
463
  const essence = contentType.split(';')[0]?.trim().toLowerCase() ?? '';
464
464
  return essence === 'application/json' || essence.endsWith('+json');
465
465
  }
466
+ /**
467
+ * Does this media type carry TEXT a caller reads as a string?
468
+ *
469
+ * The response body is decoded by its declared media type, in three classes,
470
+ * and each class matches what the generated function's return type says for
471
+ * the schema such a route declares:
472
+ *
473
+ * - JSON (`application/json` or an RFC 6839 `+json` suffix) → parsed;
474
+ * - TEXT (`text/*` — including `text/event-stream` — `application/javascript`,
475
+ * `application/ecmascript`, `application/xml` or an RFC 7303 `+xml`
476
+ * suffix) → a string, which is what a `{ type: string }` schema generates;
477
+ * - anything else — `application/octet-stream`, `application/gzip`,
478
+ * `application/pdf`, an Office document type, any `format: binary` body —
479
+ * → a `Blob`, which is what a `format: binary` schema generates.
480
+ *
481
+ * Reading every non-JSON body as text, as this transport did until 2026-10-04,
482
+ * handed a caller typed `Blob` a string: `response.text()` decodes the bytes
483
+ * as UTF-8, so a PDF or a gzip tarball arrived corrupted under a type that
484
+ * promised the bytes.
485
+ *
486
+ * A response with NO content type is read as text, so an empty body stays the
487
+ * empty string it always was.
488
+ */
489
+ function isTextMediaType(contentType) {
490
+ const essence = contentType.split(';')[0]?.trim().toLowerCase() ?? '';
491
+ return (essence.startsWith('text/') ||
492
+ essence === 'application/javascript' ||
493
+ essence === 'application/ecmascript' ||
494
+ essence === 'application/xml' ||
495
+ essence.endsWith('+xml'));
496
+ }
466
497
  async function parseBody(response) {
467
498
  // 204 FIRST, and deliberately — this ORDER is carried from `develop`, which
468
499
  // fixed the same defect independently and got this half right where `main`
@@ -478,7 +509,10 @@ async function parseBody(response) {
478
509
  if (isJsonMediaType(contentType)) {
479
510
  return response.json();
480
511
  }
481
- return response.text();
512
+ if (contentType === null || isTextMediaType(contentType)) {
513
+ return response.text();
514
+ }
515
+ return response.blob();
482
516
  }
483
517
  function parseRetryAfter(value) {
484
518
  if (!value)
@@ -13,6 +13,7 @@ import type { AgentWorkspaceDto } from './agentWorkspaceDto.js';
13
13
  import type { DurableWorkspaceRefDto } from './durableWorkspaceRefDto.js';
14
14
  import type { ScopeSource } from './scopeSource.js';
15
15
  import type { StandingSessionRefDto } from './standingSessionRefDto.js';
16
+ import type { WorkerInternetEgress } from './workerInternetEgress.js';
16
17
  import type { WorkspaceSharingPolicy } from './workspaceSharingPolicy.js';
17
18
  export interface AgentAuthoringResponseDto {
18
19
  /** Stable Agent identity id. */
@@ -27,6 +28,8 @@ export interface AgentAuthoringResponseDto {
27
28
  capability?: AgentCapabilityLayerDto | null;
28
29
  workspace?: AgentWorkspaceDto | null;
29
30
  reachTier: AgentReachTier;
31
+ /** Ceiling on whether the worker pod running this agent may open sockets to the public internet. A ceiling the agent ACCEPTS, never a grant: the effective mode is the most restrictive of the deployment, the owning Space, this value and the session, so `open` here widens nothing. What THIS agent itself states — NOT joined with the agent it `extends`; the resolved-agent and agent-blocks responses carry the joined value. ABSENT when it declares none — there is no default. */
32
+ internetEgressCeiling?: WorkerInternetEgress;
30
33
  sessionLifecycle?: AgentSessionLifecycle | null;
31
34
  workspaceSharing: WorkspaceSharingPolicy;
32
35
  standingSession?: StandingSessionRefDto | null;
@@ -8,6 +8,7 @@ import type { AgentConfigBlockDtoPermission } from './agentConfigBlockDtoPermiss
8
8
  import type { AgentConfigBlockDtoSteps } from './agentConfigBlockDtoSteps.js';
9
9
  import type { AgentConfigBlockDtoTemperature } from './agentConfigBlockDtoTemperature.js';
10
10
  import type { AgentConfigBlockDtoTools } from './agentConfigBlockDtoTools.js';
11
+ import type { WorkerInternetEgress } from './workerInternetEgress.js';
11
12
  export interface AgentConfigBlockDto {
12
13
  /** Agent slug — matches the .md filename */
13
14
  slug: string;
@@ -38,4 +39,6 @@ export interface AgentConfigBlockDto {
38
39
  * @nullable
39
40
  */
40
41
  permission?: AgentConfigBlockDtoPermission;
42
+ /** The RESOLVED worker internet-egress ceiling this agent is bound by: its STABLE revision's own declaration joined along its `extends` chain, the most restrictive winning. The caller joins it over every agent that shares the pod (primary and sub-agents), the most restrictive winning. ABSENT when the agent declares none: absent states nothing and must never be read as `governed` or as `open`. */
43
+ internetEgressCeiling?: WorkerInternetEgress;
41
44
  }
@@ -11,6 +11,7 @@ import type { AgentWorkspaceDto } from './agentWorkspaceDto.js';
11
11
  import type { DurableWorkspaceRefDto } from './durableWorkspaceRefDto.js';
12
12
  import type { ScopeSource } from './scopeSource.js';
13
13
  import type { StandingSessionRefDto } from './standingSessionRefDto.js';
14
+ import type { WorkerInternetEgress } from './workerInternetEgress.js';
14
15
  import type { WorkspaceSharingPolicy } from './workspaceSharingPolicy.js';
15
16
  export interface CreateAgentDto {
16
17
  /**
@@ -30,6 +31,8 @@ export interface CreateAgentDto {
30
31
  workspace?: AgentWorkspaceDto;
31
32
  /** The agent's permission ceiling. Omitted ⇒ `as-owner` (the agent's authority equals its owner's — today's acts-as behavior). Enforcement lives in authz; this service only owns + exposes the field. */
32
33
  reachTier?: AgentReachTier;
34
+ /** Ceiling on whether the worker pod running this agent may open sockets to the public internet. A ceiling the agent ACCEPTS, never a grant: the effective mode is the most restrictive of the deployment, the owning Space, this value and the session, so `open` here widens nothing. Omitted ⇒ the agent states nothing and no default is substituted. */
35
+ internetEgressCeiling?: WorkerInternetEgress;
33
36
  /** The agent's default session lifecycle — `ephemeral` (idle-auto-pauses) or `persistent` (always-on). A launched session inherits this unless the launch passes an explicit override. Omitted ⇒ the agent declares no preference and agent-session-api applies its own `ephemeral` default. */
34
37
  sessionLifecycle?: AgentSessionLifecycle;
35
38
  /** Whether a session launch of this agent may POOL onto a compatible, already-running pod as a new thread (`shareable`) or must always run in its own isolated worker (`isolated`). Omitted ⇒ the DB default `isolated` (the fail-safe) — mark `shareable` ONLY for workspace-stateless / chat-style agents that never mutate `/workspace`. */
@@ -8,6 +8,7 @@ import type { AgentOwnerSpaceRefDto } from './agentOwnerSpaceRefDto.js';
8
8
  import type { ExactAgentRevisionAuthorityResponseDtoReachTier } from './exactAgentRevisionAuthorityResponseDtoReachTier.js';
9
9
  import type { ExactAgentRevisionResolvedGraphDto } from './exactAgentRevisionResolvedGraphDto.js';
10
10
  import type { ResolvedDelegatedApertureDto } from './resolvedDelegatedApertureDto.js';
11
+ import type { WorkerInternetEgress } from './workerInternetEgress.js';
11
12
  export interface ExactAgentRevisionAuthorityResponseDto {
12
13
  resourceId: string;
13
14
  revisionId: string;
@@ -17,6 +18,8 @@ export interface ExactAgentRevisionAuthorityResponseDto {
17
18
  resolvedGraph: ExactAgentRevisionResolvedGraphDto;
18
19
  capabilityAperture: AgentCapabilityApertureDto;
19
20
  reachTier: ExactAgentRevisionAuthorityResponseDtoReachTier;
21
+ /** Ceiling on whether the worker pod running the PRIMARY agent may open sockets to the public internet. A ceiling the agent ACCEPTS, never a grant: the effective mode is the most restrictive of the deployment, the owning Space, this value and the session, so `open` here widens nothing. RESOLVED: the agent's own declaration joined along its `extends` chain, so a child never widens its base. ABSENT when nothing in the chain declares one — there is no default. */
22
+ internetEgressCeiling?: WorkerInternetEgress;
20
23
  /**
21
24
  * Every agent reachable by DELEGATION from the primary agent (composition
22
25
  * children and intrinsic delegates, cycles resolved to a fixed point,
@@ -171,6 +171,8 @@ export * from './llmRegistryControllerGetResolvedModelConfig200';
171
171
  export * from './llmRegistryControllerGetResolvedModelConfig200Data';
172
172
  export * from './migrationAcknowledgementDto';
173
173
  export * from './migrationAcknowledgementDtoDataEnvelope';
174
+ export * from './migrationConsumerDelegationDto';
175
+ export * from './migrationConsumerDelegationDtoConsumer';
174
176
  export * from './migrationConsumerDoneDto';
175
177
  export * from './migrationConsumerDoneDtoConsumer';
176
178
  export * from './migrationConsumerFailedDto';
@@ -372,6 +374,7 @@ export * from './widgetKindListDto';
372
374
  export * from './widgetKindListDtoDataEnvelope';
373
375
  export * from './widgetKindSource';
374
376
  export * from './workKindControllerListParams';
377
+ export * from './workerInternetEgress';
375
378
  export * from './workingFileEntryDto';
376
379
  export * from './workingFileEntryDtoSourceRef';
377
380
  export * from './workspaceSharingPolicy';
@@ -188,6 +188,8 @@ __exportStar(require("./llmRegistryControllerGetResolvedModelConfig200"), export
188
188
  __exportStar(require("./llmRegistryControllerGetResolvedModelConfig200Data"), exports);
189
189
  __exportStar(require("./migrationAcknowledgementDto"), exports);
190
190
  __exportStar(require("./migrationAcknowledgementDtoDataEnvelope"), exports);
191
+ __exportStar(require("./migrationConsumerDelegationDto"), exports);
192
+ __exportStar(require("./migrationConsumerDelegationDtoConsumer"), exports);
191
193
  __exportStar(require("./migrationConsumerDoneDto"), exports);
192
194
  __exportStar(require("./migrationConsumerDoneDtoConsumer"), exports);
193
195
  __exportStar(require("./migrationConsumerFailedDto"), exports);
@@ -389,6 +391,7 @@ __exportStar(require("./widgetKindListDto"), exports);
389
391
  __exportStar(require("./widgetKindListDtoDataEnvelope"), exports);
390
392
  __exportStar(require("./widgetKindSource"), exports);
391
393
  __exportStar(require("./workKindControllerListParams"), exports);
394
+ __exportStar(require("./workerInternetEgress"), exports);
392
395
  __exportStar(require("./workingFileEntryDto"), exports);
393
396
  __exportStar(require("./workingFileEntryDtoSourceRef"), exports);
394
397
  __exportStar(require("./workspaceSharingPolicy"), exports);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * LLM Registry API
4
+ * OpenAPI spec version: 0.1.3
5
+ */
6
+ import type { MigrationConsumerDelegationDtoConsumer } from './migrationConsumerDelegationDtoConsumer.js';
7
+ export interface MigrationConsumerDelegationDto {
8
+ consumer: MigrationConsumerDelegationDtoConsumer;
9
+ /** The delegation id. Lends model:gateway-session.mint@1 for the org, presentable only by this consumer’s workload. */
10
+ delegationId: string;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * LLM Registry API
4
+ * OpenAPI spec version: 0.1.3
5
+ */
6
+ export type MigrationConsumerDelegationDtoConsumer = typeof MigrationConsumerDelegationDtoConsumer[keyof typeof MigrationConsumerDelegationDtoConsumer];
7
+ export declare const MigrationConsumerDelegationDtoConsumer: {
8
+ readonly search_api: "search_api";
9
+ readonly memory_api: "memory_api";
10
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by @xemahq/api-client-generator — do not edit manually.
4
+ * LLM Registry API
5
+ * OpenAPI spec version: 0.1.3
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.MigrationConsumerDelegationDtoConsumer = void 0;
9
+ exports.MigrationConsumerDelegationDtoConsumer = {
10
+ search_api: 'search_api',
11
+ memory_api: 'memory_api',
12
+ };
@@ -3,6 +3,7 @@
3
3
  * LLM Registry API
4
4
  * OpenAPI spec version: 0.1.3
5
5
  */
6
+ import type { MigrationConsumerDelegationDto } from './migrationConsumerDelegationDto.js';
6
7
  export interface MigrationTargetDto {
7
8
  migrationId: string;
8
9
  toModelId: string;
@@ -12,4 +13,6 @@ export interface MigrationTargetDto {
12
13
  toProviderBaseUrl: string;
13
14
  toProviderIsSystem: boolean;
14
15
  toDimension: number;
16
+ /** The ORGANIZATION DELEGATION each consumer re-embeds under, created by the approving admin at migration start. A consumer mints a delegated context per use from ITS OWN entry (a delegation names exactly one presenting workload) and never caches it; every entry is revoked when the migration completes, fails or is rolled back. */
17
+ consumers: MigrationConsumerDelegationDto[];
15
18
  }
@@ -1,7 +1,2 @@
1
1
  "use strict";
2
- /**
3
- * Generated by @xemahq/api-client-generator — do not edit manually.
4
- * LLM Registry API
5
- * OpenAPI spec version: 0.1.3
6
- */
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,6 +11,7 @@ import type { AgentWorkspaceDto } from './agentWorkspaceDto.js';
11
11
  import type { DurableWorkspaceRefDto } from './durableWorkspaceRefDto.js';
12
12
  import type { ScopeSource } from './scopeSource.js';
13
13
  import type { StandingSessionRefDto } from './standingSessionRefDto.js';
14
+ import type { WorkerInternetEgress } from './workerInternetEgress.js';
14
15
  import type { WorkspaceSharingPolicy } from './workspaceSharingPolicy.js';
15
16
  export interface ResolvedAgentResponseDto {
16
17
  /** Stable Agent AuthoredResource identity selected by resolution. */
@@ -42,6 +43,8 @@ export interface ResolvedAgentResponseDto {
42
43
  capability: AgentCapabilityLayerDto;
43
44
  /** The root composition agent's reach-tier permission ceiling (Chunk 2). A composition row with no explicit tier resolves to `as-owner` (the default), so this field is always populated. agent-session-api persists it onto the session and stamps it onto `ExecutionContext.reachTier` so authorization-api applies the tier constraint inside the verdict. */
44
45
  reachTier: AgentReachTier;
46
+ /** Ceiling on whether the worker pod running this agent may open sockets to the public internet. A ceiling the agent ACCEPTS, never a grant: the effective mode is the most restrictive of the deployment, the owning Space, this value and the session, so `open` here widens nothing. RESOLVED: the agent's own declaration joined along its `extends` chain, so a child never widens its base. ABSENT when nothing in the chain declares one — there is no default. */
47
+ internetEgressCeiling?: WorkerInternetEgress;
45
48
  /** The resolved agent's declared default session lifecycle (`ephemeral`|`persistent`), or null when it declares no preference. agent-session-api inherits this as the session `lifecyclePolicy` unless the launch passes an explicit override; null ⇒ agent-session applies its own `ephemeral` default last. */
46
49
  sessionLifecycle?: AgentSessionLifecycle | null;
47
50
  /** Resolved workspace-sharing policy — whether a session launch of this agent may POOL onto a compatible running pod as a new thread (`shareable`) or must always run in its own isolated worker (`isolated`). Always populated: a row with no stored value resolves to `isolated` (WORKSPACE_SHARING_DEFAULT). agent-session-api reads this to gate session-thread pooling at launch. */
@@ -10,6 +10,7 @@ import type { AgentSessionLifecycle } from './agentSessionLifecycle.js';
10
10
  import type { AgentWorkspaceDto } from './agentWorkspaceDto.js';
11
11
  import type { DurableWorkspaceRefDto } from './durableWorkspaceRefDto.js';
12
12
  import type { StandingSessionRefDto } from './standingSessionRefDto.js';
13
+ import type { WorkerInternetEgress } from './workerInternetEgress.js';
13
14
  import type { WorkspaceSharingPolicy } from './workspaceSharingPolicy.js';
14
15
  export interface UpdateAgentDraftDto {
15
16
  displayName?: string;
@@ -20,6 +21,8 @@ export interface UpdateAgentDraftDto {
20
21
  workspace?: AgentWorkspaceDto;
21
22
  /** The agent's permission ceiling. Omitted leaves the stored value unchanged; a NULL stored value reads as `as-owner`. */
22
23
  reachTier?: AgentReachTier;
24
+ /** Ceiling on whether the worker pod running this agent may open sockets to the public internet. A ceiling the agent ACCEPTS, never a grant: the effective mode is the most restrictive of the deployment, the owning Space, this value and the session, so `open` here widens nothing. Omitted leaves the stored value unchanged; `null` CLEARS it, so the agent states nothing again. */
25
+ internetEgressCeiling?: WorkerInternetEgress | null;
23
26
  /** The agent's default session lifecycle (`ephemeral`|`persistent`). Omitted leaves the stored value unchanged; a NULL stored value means the agent declares no preference. */
24
27
  sessionLifecycle?: AgentSessionLifecycle;
25
28
  /** Whether a session launch may POOL onto a compatible running pod (`shareable`) or must always run isolated (`isolated`). Omitted leaves the stored value unchanged; the column default is `isolated`. */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * LLM Registry API
4
+ * OpenAPI spec version: 0.1.3
5
+ */
6
+ /**
7
+ * Ceiling on whether the worker pod running this agent may open sockets to the public internet. A ceiling the agent ACCEPTS, never a grant: the effective mode is the most restrictive of the deployment, the owning Space, this value and the session, so `open` here widens nothing. RESOLVED: the agent's own declaration joined along its `extends` chain, so a child never widens its base. ABSENT when nothing in the chain declares one — there is no default.
8
+ */
9
+ export type WorkerInternetEgress = typeof WorkerInternetEgress[keyof typeof WorkerInternetEgress];
10
+ export declare const WorkerInternetEgress: {
11
+ readonly open: "open";
12
+ readonly governed: "governed";
13
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by @xemahq/api-client-generator — do not edit manually.
4
+ * LLM Registry API
5
+ * OpenAPI spec version: 0.1.3
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.WorkerInternetEgress = void 0;
9
+ exports.WorkerInternetEgress = {
10
+ open: 'open',
11
+ governed: 'governed',
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/llm-registry-api-client",
3
- "version": "0.13.0",
3
+ "version": "0.14.1",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "service": "llm-registry-api",
20
20
  "biome": "agent-runtime",
21
21
  "target": "server",
22
- "generator": "@xemahq/api-client-generator@2.1.1",
22
+ "generator": "@xemahq/api-client-generator@2.2.0",
23
23
  "source": "openapi.public.json"
24
24
  },
25
25
  "license": "LicenseRef-Xema-BSL-1.1",