@babav/knowledge-core-client 0.34.0 → 0.35.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/dist/index.d.ts CHANGED
@@ -959,6 +959,15 @@ export declare class AdminClient extends HttpBase {
959
959
  revokeApiKey: (tenantId: UUID, keyId: UUID) => Promise<void>;
960
960
  };
961
961
  agents: {
962
+ /** List agents (admin). Pass `tenant_id` for one tenant's agents (+ global); omit for all agents
963
+ * across every tenant. (A tenant lists its own via KnowledgeCoreClient.agents.list.) */
964
+ list: (q?: {
965
+ tenant_id?: UUID;
966
+ limit?: number;
967
+ cursor?: string;
968
+ }) => Promise<Page<Agent>>;
969
+ listAll: (tenantId?: UUID) => Promise<Agent[]>;
970
+ get: (id: UUID) => Promise<Agent>;
962
971
  create: (b: AgentWrite & {
963
972
  name: string;
964
973
  tenant_id?: UUID | null;
package/dist/index.js CHANGED
@@ -493,6 +493,11 @@ export class AdminClient extends HttpBase {
493
493
  // Agent provisioning (query agents). Pass `tenant_id` on create for a per-tenant agent; omit (or
494
494
  // null) for a Babav-global one. Model fields are validated against the model registry server-side.
495
495
  agents = {
496
+ /** List agents (admin). Pass `tenant_id` for one tenant's agents (+ global); omit for all agents
497
+ * across every tenant. (A tenant lists its own via KnowledgeCoreClient.agents.list.) */
498
+ list: (q) => this.request("GET", "/v1/agents", { query: q }),
499
+ listAll: (tenantId) => this.pageAll("/v1/agents", tenantId ? { tenant_id: tenantId } : {}),
500
+ get: (id) => this.request("GET", `/v1/agents/${id}`),
496
501
  create: (b) => this.request("POST", "/v1/agents", { json: b }),
497
502
  update: (id, b) => this.request("PATCH", `/v1/agents/${id}`, { json: b }),
498
503
  delete: (id) => this.request("DELETE", `/v1/agents/${id}`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babav/knowledge-core-client",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "TypeScript client for the Babav Knowledge Core API (Deno + Node 18+, zero deps). Includes the babav.visual grammar TYPES at the ./visual subpath (types only; all visual rendering is server-side).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -1093,6 +1093,12 @@ export class AdminClient extends HttpBase {
1093
1093
  // Agent provisioning (query agents). Pass `tenant_id` on create for a per-tenant agent; omit (or
1094
1094
  // null) for a Babav-global one. Model fields are validated against the model registry server-side.
1095
1095
  agents = {
1096
+ /** List agents (admin). Pass `tenant_id` for one tenant's agents (+ global); omit for all agents
1097
+ * across every tenant. (A tenant lists its own via KnowledgeCoreClient.agents.list.) */
1098
+ list: (q?: { tenant_id?: UUID; limit?: number; cursor?: string }) =>
1099
+ this.request<Page<Agent>>("GET", "/v1/agents", { query: q }),
1100
+ listAll: (tenantId?: UUID) => this.pageAll<Agent>("/v1/agents", tenantId ? { tenant_id: tenantId } : {}),
1101
+ get: (id: UUID) => this.request<Agent>("GET", `/v1/agents/${id}`),
1096
1102
  create: (b: AgentWrite & { name: string; tenant_id?: UUID | null }) =>
1097
1103
  this.request<Agent>("POST", "/v1/agents", { json: b }),
1098
1104
  update: (id: UUID, b: AgentWrite) =>