@meshagent/meshagent-ts-auth 0.49.0 → 0.50.0

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
@@ -1,3 +1,12 @@
1
+ ## [0.50.0]
2
+ - Chat clients now support per-turn LLM authorization providers, and websocket chat tokens are optional for `auth=none` deployments.
3
+ - The typed client gained `connectLlm`, optional access-subject IDs, service-account principals, room and service enabled flags, `llm_quota_manager`, and the `router` project settings document.
4
+ - Chat-thread constructors now take a chat client instead of requiring a room client, which is a breaking signature change for callers.
5
+ - The Tailwind chat package was updated to `tailwindcss` 4.3.3, and the chat and thread UI was refactored for more reliable optimistic streaming plus richer attachment and thread handling.
6
+
7
+ ## [0.49.1]
8
+ - Stability
9
+
1
10
  ## [0.49.0]
2
11
  - Breaking: `createProject` no longer accepts inline settings; project settings are now document-based with `room_roles` support.
3
12
  - Route path models now use a service-port/content-target union and support CORS, compression, index, and IAP for room-content routes.
@@ -42546,7 +42546,7 @@ ${newlined}
42546
42546
  }))
42547
42547
  }
42548
42548
  };
42549
- return { ...service, agents, container };
42549
+ return { ...service, enabled: service.enabled ?? true, agents, container };
42550
42550
  }
42551
42551
  var ServiceTemplateSpec = class _ServiceTemplateSpec {
42552
42552
  constructor(template) {
@@ -42656,6 +42656,7 @@ ${newlined}
42656
42656
  };
42657
42657
  return pruneUndefinedValues({
42658
42658
  ...service,
42659
+ enabled: service.enabled ?? true,
42659
42660
  container,
42660
42661
  agents
42661
42662
  });
@@ -43010,7 +43011,7 @@ ${newlined}
43010
43011
  serializeAccessSubject(subject) {
43011
43012
  return {
43012
43013
  type: subject.type,
43013
- id: subject.id,
43014
+ ...subject.id !== void 0 ? { id: subject.id } : {},
43014
43015
  ...subject.name !== void 0 ? { name: subject.name } : {},
43015
43016
  ...subject.firstName !== void 0 ? { first_name: subject.firstName } : {},
43016
43017
  ...subject.lastName !== void 0 ? { last_name: subject.lastName } : {},
@@ -43019,6 +43020,22 @@ ${newlined}
43019
43020
  ...subject.relation !== void 0 ? { relation: subject.relation } : {}
43020
43021
  };
43021
43022
  }
43023
+ parseLlmDelegation(data) {
43024
+ if (!data || typeof data !== "object" || typeof data.id !== "string" || typeof data.token !== "string" || typeof data.expires_at !== "string" || typeof data.project_id !== "string" || typeof data.max_budget !== "string") {
43025
+ throw new requirement_js_1.RoomException("Invalid LLM delegation payload");
43026
+ }
43027
+ return {
43028
+ id: data.id,
43029
+ token: data.token,
43030
+ expiresAt: data.expires_at,
43031
+ projectId: data.project_id,
43032
+ delegator: this.parseAccessSubject(data.delegator),
43033
+ subject: this.parseAccessSubject(data.subject),
43034
+ providers: Array.isArray(data.providers) ? data.providers : null,
43035
+ models: Array.isArray(data.models) ? data.models.filter((value) => typeof value === "string") : null,
43036
+ maxBudget: data.max_budget
43037
+ };
43038
+ }
43022
43039
  serializeAccessResource(resource) {
43023
43040
  return {
43024
43041
  type: resource.type,
@@ -43067,6 +43084,9 @@ ${newlined}
43067
43084
  metadata: parsedResource.metadata ?? {},
43068
43085
  annotations: parsedResource.annotations ?? {}
43069
43086
  };
43087
+ if (!parsedSubject.id) {
43088
+ throw new requirement_js_1.RoomException("Invalid room grant payload: missing subject id");
43089
+ }
43070
43090
  return {
43071
43091
  resource: parsedResource,
43072
43092
  subject: parsedSubject,
@@ -44228,6 +44248,21 @@ ${newlined}
44228
44248
  });
44229
44249
  return this.parseAgentConnectionInfo(data);
44230
44250
  }
44251
+ async connectLlm(params) {
44252
+ const data = await this.request("/llm/connect", {
44253
+ method: "POST",
44254
+ headers: { "Meshagent-Project-Id": params.projectId },
44255
+ json: {
44256
+ subject: this.serializeAccessSubject(params.subject),
44257
+ max_budget: params.maxBudget,
44258
+ ...params.providers !== void 0 ? { providers: params.providers } : {},
44259
+ ...params.models !== void 0 ? { models: params.models } : {},
44260
+ ...params.expiresInSeconds !== void 0 ? { expires_in_seconds: params.expiresInSeconds } : {}
44261
+ },
44262
+ action: "connect LLM delegation"
44263
+ });
44264
+ return this.parseLlmDelegation(data);
44265
+ }
44231
44266
  async listRooms(projectId, options = {}) {
44232
44267
  const { pageSize = 50, continuationToken, filter, view } = options;
44233
44268
  const data = await this.request(`/accounts/projects/${projectId}/rooms`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshagent/meshagent-ts-auth",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Meshagent Typescript Auth",
5
5
  "homepage": "https://github.com/meshagent/meshagent-ts-auth",
6
6
  "scripts": {
@@ -39,7 +39,7 @@
39
39
  "CHANGELOG.md"
40
40
  ],
41
41
  "dependencies": {
42
- "@meshagent/meshagent": "^0.49.0",
42
+ "@meshagent/meshagent": "^0.50.0",
43
43
  "typescript": "^5.8.3"
44
44
  },
45
45
  "devDependencies": {