@burdenoff/microfe-botmanor 2026.1118.7 → 2026.1119.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.
Files changed (41) hide show
  1. package/dist/botlit/components/A2ATrustBadge.d.ts +9 -0
  2. package/dist/botlit/components/A2ATrustBadge.js +55 -0
  3. package/dist/botlit/components/A2ATrustBadge.js.map +1 -0
  4. package/dist/botlit/components/ChannelSelectorSheet.d.ts +9 -2
  5. package/dist/botlit/components/ChannelSelectorSheet.js.map +1 -1
  6. package/dist/botlit/hooks/index.d.ts +1 -1
  7. package/dist/botlit/hooks/index.js +14 -14
  8. package/dist/botlit/hooks/internal/globalWorkspaceScope.d.ts +15 -0
  9. package/dist/botlit/hooks/internal/globalWorkspaceScope.js +21 -0
  10. package/dist/botlit/hooks/internal/globalWorkspaceScope.js.map +1 -0
  11. package/dist/botlit/hooks/internal/workspaceGateway.d.ts +7 -0
  12. package/dist/botlit/hooks/internal/workspaceGateway.js +42 -22
  13. package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
  14. package/dist/botlit/hooks/useA2A.d.ts +107 -9
  15. package/dist/botlit/hooks/useA2A.js +215 -80
  16. package/dist/botlit/hooks/useA2A.js.map +1 -1
  17. package/dist/botlit/hooks/useChannelSetup.d.ts +2 -1
  18. package/dist/botlit/hooks/useChannelSetup.js +61 -52
  19. package/dist/botlit/hooks/useChannelSetup.js.map +1 -1
  20. package/dist/botlit/hooks/useChannels.d.ts +9 -0
  21. package/dist/botlit/hooks/useChannels.js +83 -73
  22. package/dist/botlit/hooks/useChannels.js.map +1 -1
  23. package/dist/botlit/hooks/useUserPlatformConnection.js +98 -78
  24. package/dist/botlit/hooks/useUserPlatformConnection.js.map +1 -1
  25. package/dist/botlit/pages/A2AAgentDetailPage.js +715 -503
  26. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  27. package/dist/botlit/pages/A2ARegistryPage.js +278 -179
  28. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  29. package/dist/botlit/pages/BotChannelsTab.js +457 -242
  30. package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
  31. package/dist/botlit/pages/ExecutionsPage.js +1 -1
  32. package/dist/botlit/pages/InstalledPackagesPage.js +154 -154
  33. package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
  34. package/dist/botlit/pages/PromptStudioPage.js +172 -172
  35. package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
  36. package/dist/botlit/pages/StorePage.js +8 -8
  37. package/dist/botlit/pages/StorePage.js.map +1 -1
  38. package/dist/botlit/permissions/index.js +3 -3
  39. package/dist/botlit/permissions/useBotmanorPermissions.js +5 -2
  40. package/dist/botlit/permissions/useBotmanorPermissions.js.map +1 -1
  41. package/package.json +1 -1
@@ -1,7 +1,15 @@
1
1
  import { CreateA2ARegistryEntryInput, UpdateA2ARegistryEntryInput } from '../../generated/wspace-types';
2
2
  import { A2AAgentFilter } from '../types';
3
3
  import { GraphQLInput } from './internal/mutationInput';
4
- import { QueryResult } from './internal/workspaceGateway';
4
+ import { PaginatedQueryResult, QueryResult } from './internal/workspaceGateway';
5
+ /** Page size for the registry list; further pages load on demand (BOFF-12509). */
6
+ export declare const A2A_LIST_PAGE_SIZE = 50;
7
+ /** Field limits for a registry entry (BOFF-12508). The name column is VARCHAR(255). */
8
+ export declare const A2A_NAME_MAX = 255;
9
+ export declare const A2A_DESCRIPTION_MAX = 2000;
10
+ export declare const A2A_URL_MAX = 2048;
11
+ /** The service refuses an agent card larger than 1 MiB. */
12
+ export declare const A2A_AGENT_CARD_MAX_BYTES: number;
5
13
  export interface A2AAgentRecord {
6
14
  id: string;
7
15
  name: string;
@@ -29,9 +37,15 @@ export interface UpdateA2AAgentVariables {
29
37
  agentId: string;
30
38
  input: GraphQLInput<UpdateA2ARegistryEntryInput>;
31
39
  }
40
+ /** One validation problem, as a translation key plus its English fallback. */
41
+ export interface A2AValidationIssue {
42
+ key: string;
43
+ fallback: string;
44
+ params?: Record<string, string | number>;
45
+ }
32
46
  export interface AgentCardValidation {
33
47
  valid: boolean;
34
- errors: string[];
48
+ errors: A2AValidationIssue[];
35
49
  }
36
50
  /**
37
51
  * The agent-card fields the UI renders. `agentCard` is a free-form `JSON`
@@ -61,19 +75,71 @@ export interface A2AAgentCardSkill {
61
75
  tags: string[];
62
76
  examples: string[];
63
77
  }
64
- /** One row of the `entitlements` JSON, normalised for rendering. */
78
+ /**
79
+ * The permissions the service checks on a registry entry's entitlements
80
+ * (`A2AEntitlementService`): a connection needs `agent:delegate` or
81
+ * `task:create`, and a task sent to the entry needs `task:create`.
82
+ */
83
+ export declare const A2A_ENTITLEMENT_PERMISSIONS: readonly ["agent:delegate", "task:create"];
84
+ export type A2AEntitlementPermission = (typeof A2A_ENTITLEMENT_PERMISSIONS)[number];
85
+ /**
86
+ * One row of the `entitlements` JSON in the shape the service enforces
87
+ * (BOFF-12506): a permission, an optional list of local sender agents it is
88
+ * limited to, and an optional validity window. A row without a permission is
89
+ * ignored by the service, so it is flagged `recognised: false` instead of
90
+ * being shown as if it granted anything.
91
+ */
65
92
  export interface A2AEntitlementView {
66
93
  id: string;
67
- sourceType: string;
68
- sourceId: string;
69
- allowedSkills: string[];
70
- disallowedSkills: string[];
71
- maxHops?: number;
94
+ recognised: boolean;
95
+ permission: string;
96
+ /** Local agents that may use this grant; empty means every agent in the workspace. */
97
+ agentIds: string[];
98
+ validFrom?: string;
99
+ validUntil?: string;
100
+ /**
101
+ * Fields the service stores but does not enforce on an A2A call (bucket, app
102
+ * and knowledge-base scope, rate limits). Kept on save, listed read-only.
103
+ */
104
+ unenforced: string[];
105
+ }
106
+ /** Editable form of one entitlement. Dates are `YYYY-MM-DD` (empty = open-ended). */
107
+ export interface A2AEntitlementDraft {
108
+ permission: A2AEntitlementPermission;
109
+ agentIds: string[];
110
+ validFrom: string;
111
+ validUntil: string;
112
+ /** The original JSON row, so fields the editor does not show survive a save. */
113
+ original?: Record<string, unknown>;
72
114
  }
73
115
  /** Reads the renderable view of an A2A agent card out of its JSON document. */
74
116
  export declare function readAgentCard(card: Record<string, unknown> | undefined): A2AAgentCardView;
75
117
  /** Reads the entitlement rows out of the `entitlements` JSON column. */
76
118
  export declare function readEntitlements(entitlements: Record<string, unknown> | unknown[] | null | undefined): A2AEntitlementView[];
119
+ /**
120
+ * Editable drafts for the entitlements the service recognises. Rows it ignores
121
+ * (no permission, or a permission it never checks) are not editable here;
122
+ * `toEntitlementsInput` keeps them untouched.
123
+ */
124
+ export declare function toEntitlementDrafts(entitlements: Record<string, unknown> | unknown[] | null | undefined): A2AEntitlementDraft[];
125
+ /**
126
+ * Rows of the stored JSON the editor does not manage, so a save from the
127
+ * editor does not silently drop them.
128
+ */
129
+ export declare function unmanagedEntitlements(entitlements: Record<string, unknown> | unknown[] | null | undefined): Record<string, unknown>[];
130
+ /**
131
+ * Serialises edited entitlements to the JSON the service enforces. A newly
132
+ * chosen start date begins at 00:00 UTC and an end date runs to the end of
133
+ * that UTC day; an unchanged stored timestamp is kept as it was.
134
+ */
135
+ export declare function toEntitlementsInput(drafts: A2AEntitlementDraft[], unmanaged?: Record<string, unknown>[]): Record<string, unknown>[];
136
+ /** Per-draft validation: an end date must not come before the start date. */
137
+ export declare function entitlementDraftError(draft: A2AEntitlementDraft): 'validityOrder' | undefined;
138
+ /**
139
+ * True when at least one entitlement, valid now, lets a connection be made —
140
+ * the service refuses every connection to an entry without one (default deny).
141
+ */
142
+ export declare function entitlementsAllowConnections(entitlements: Record<string, unknown> | unknown[] | null | undefined, now?: number): boolean;
77
143
  /** Number of skills the registered agent card advertises. */
78
144
  export declare function a2aAgentSkillCount(agent: Pick<A2AAgentRecord, 'agentCard'>): number;
79
145
  /**
@@ -81,6 +147,31 @@ export declare function a2aAgentSkillCount(agent: Pick<A2AAgentRecord, 'agentCar
81
147
  * the document the caller supplies — it does NOT contact the remote agent.
82
148
  */
83
149
  export declare function validateAgentCard(card: Record<string, unknown> | undefined): AgentCardValidation;
150
+ /** True for an absolute `https://` URL with a host. */
151
+ export declare function isHttpsUrl(value: string): boolean;
152
+ /** The registry form as the page edits it. */
153
+ export interface A2ARegistryFormValues {
154
+ name: string;
155
+ description: string;
156
+ wellKnownUrl: string;
157
+ agentCardJson: string;
158
+ }
159
+ export type A2ARegistryFormField = 'name' | 'description' | 'wellKnownUrl' | 'agentCardJson';
160
+ /** Parses the edited agent card; returns undefined when the JSON is malformed. */
161
+ export declare function parseAgentCardJson(json: string): Record<string, unknown> | undefined;
162
+ /**
163
+ * The name the entry is saved with: the typed name, or the card's own name
164
+ * when the field is left empty (BOFF-12510), so the list and the card agree
165
+ * unless the user deliberately overrides it.
166
+ */
167
+ export declare function effectiveEntryName(values: A2ARegistryFormValues): string;
168
+ /** The description the entry is saved with (typed, else the card's). */
169
+ export declare function effectiveEntryDescription(values: A2ARegistryFormValues): string;
170
+ /**
171
+ * Field-level validation for the register/edit form (BOFF-12508). Returns at
172
+ * most one issue per field, so each can be shown inline next to its input.
173
+ */
174
+ export declare function validateRegistryForm(values: A2ARegistryFormValues): Partial<Record<A2ARegistryFormField, A2AValidationIssue>>;
84
175
  export declare const a2aKeys: {
85
176
  all: readonly ["a2a"];
86
177
  lists: () => readonly ["a2a", "list"];
@@ -88,7 +179,14 @@ export declare const a2aKeys: {
88
179
  details: () => readonly ["a2a", "detail"];
89
180
  detail: (id: string) => readonly ["a2a", "detail", string];
90
181
  };
91
- export declare function useA2AAgents(filter?: A2AAgentFilter): QueryResult<A2AAgentRecord[]>;
182
+ /**
183
+ * The registry list, one page at a time (BOFF-12509). Status, trust level,
184
+ * visibility and bucket filter on the server. The service has no free-text
185
+ * filter, so `search` narrows the rows loaded so far; the page keeps loading
186
+ * further pages while a search is active, so a match is never hidden behind
187
+ * an unloaded page.
188
+ */
189
+ export declare function useA2AAgents(filter?: A2AAgentFilter): PaginatedQueryResult<A2AAgentRecord[]>;
92
190
  export declare function useA2AAgent(agentId: string | undefined): QueryResult<A2AAgentRecord | null>;
93
191
  export declare function useRegisterA2AAgent(): readonly [(input: RegisterA2AAgentVariables) => Promise<A2AAgentRecord>, import('./internal/workspaceGateway').MutationState<A2AAgentRecord>];
94
192
  export declare function useUpdateA2AAgent(): readonly [(input: UpdateA2AAgentVariables) => Promise<A2AAgentRecord>, import('./internal/workspaceGateway').MutationState<A2AAgentRecord>];
@@ -1,9 +1,8 @@
1
1
  import { CreateA2ARegistryEntryDocument as e, DeleteA2ARegistryEntryDocument as t, GetA2ARegistryEntryDocument as n, ListA2ARegistryEntriesDocument as r, UpdateA2ARegistryEntryDocument as i } from "../../generated/wspace-operations.js";
2
2
  import { buildMutationInput as a, fieldsOf as o } from "./internal/mutationInput.js";
3
- import { useWorkspaceId as s, useWorkspaceMutation as c, useWorkspaceQuery as l } from "./internal/workspaceGateway.js";
4
- import { useCallback as u, useMemo as d } from "react";
5
- // src/botlit/hooks/useA2A.ts
6
- var f = 100, p = o({
3
+ import { useWorkspaceId as s, useWorkspaceMutation as c, useWorkspacePaginatedQuery as l, useWorkspaceQuery as u } from "./internal/workspaceGateway.js";
4
+ import { useCallback as d, useMemo as f } from "react";
5
+ var p = 2e3, m = 2048, h = 1048576, g = o({
7
6
  agentCard: !0,
8
7
  bucketId: !0,
9
8
  description: !0,
@@ -16,7 +15,7 @@ var f = 100, p = o({
16
15
  visibility: !0,
17
16
  wellKnownUrl: !0,
18
17
  workspaceId: !0
19
- }), m = o({
18
+ }), _ = o({
20
19
  agentCard: !0,
21
20
  bucketId: !0,
22
21
  description: !0,
@@ -28,118 +27,254 @@ var f = 100, p = o({
28
27
  trustLevel: !0,
29
28
  visibility: !0,
30
29
  wellKnownUrl: !0
31
- }), h = [];
32
- function g(e) {
30
+ }), v = ["agent:delegate", "task:create"], y = [];
31
+ function b(e) {
33
32
  return typeof e == "object" && e && !Array.isArray(e) ? e : {};
34
33
  }
35
- function _(e, t = "") {
34
+ function x(e, t = "") {
36
35
  return typeof e == "string" ? e : t;
37
36
  }
38
- function v(e) {
37
+ function S(e) {
39
38
  return e === !0;
40
39
  }
41
- function y(e) {
40
+ function C(e) {
42
41
  return Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
43
42
  }
44
- function b(e) {
45
- return Array.isArray(e) ? e.map(g) : [];
43
+ function w(e) {
44
+ return Array.isArray(e) ? e.map(b) : [];
46
45
  }
47
- function x(e) {
48
- let t = g(e), n = g(t.capabilities), r = g(t.authentication);
46
+ function T(e) {
47
+ let t = b(e), n = b(t.capabilities), r = b(t.authentication);
49
48
  return {
50
- url: _(t.url),
51
- version: _(t.version),
52
- providerOrganization: _(g(t.provider).organization),
53
- documentationUrl: _(t.documentationUrl),
49
+ url: x(t.url),
50
+ version: x(t.version),
51
+ providerOrganization: x(b(t.provider).organization),
52
+ documentationUrl: x(t.documentationUrl),
54
53
  capabilities: {
55
- streaming: v(n.streaming),
56
- pushNotifications: v(n.pushNotifications),
57
- stateTransitionHistory: v(n.stateTransitionHistory)
54
+ streaming: S(n.streaming),
55
+ pushNotifications: S(n.pushNotifications),
56
+ stateTransitionHistory: S(n.stateTransitionHistory)
58
57
  },
59
- authenticationSchemes: y(r.schemes),
60
- defaultInputModes: y(t.defaultInputModes),
61
- defaultOutputModes: y(t.defaultOutputModes),
62
- skills: b(t.skills).map((e, t) => ({
63
- id: _(e.id, `skill-${t}`),
64
- name: _(e.name),
65
- description: _(e.description),
66
- tags: y(e.tags),
67
- examples: y(e.examples)
58
+ authenticationSchemes: C(r.schemes),
59
+ defaultInputModes: C(t.defaultInputModes),
60
+ defaultOutputModes: C(t.defaultOutputModes),
61
+ skills: w(t.skills).map((e, t) => ({
62
+ id: x(e.id, `skill-${t}`),
63
+ name: x(e.name),
64
+ description: x(e.description),
65
+ tags: C(e.tags),
66
+ examples: C(e.examples)
68
67
  }))
69
68
  };
70
69
  }
71
- function S(e) {
72
- return b(e).map((e, t) => {
73
- let n = e.maxHops;
70
+ var E = [
71
+ "bucketIds",
72
+ "appIds",
73
+ "knowledgeBaseIds"
74
+ ];
75
+ function D(e) {
76
+ let t = b(e.scope), n = E.filter((e) => C(t[e]).length > 0).map((e) => `scope.${e}`);
77
+ return Object.keys(b(e.rateLimit)).length > 0 && n.push("rateLimit"), n;
78
+ }
79
+ function O(e) {
80
+ return w(e).map((e, t) => {
81
+ let n = x(e.permission).trim().toLowerCase(), r = x(e.validFrom), i = x(e.validUntil);
74
82
  return {
75
- id: _(e.id, `entitlement-${t}`),
76
- sourceType: _(e.sourceType, "unknown"),
77
- sourceId: _(e.sourceId),
78
- allowedSkills: y(e.allowedSkills),
79
- disallowedSkills: y(e.disallowedSkills),
80
- maxHops: typeof n == "number" ? n : void 0
83
+ id: `entitlement-${t}`,
84
+ recognised: n.length > 0,
85
+ permission: n,
86
+ agentIds: C(b(e.scope).agentIds),
87
+ validFrom: r || void 0,
88
+ validUntil: i || void 0,
89
+ unenforced: D(e)
81
90
  };
82
91
  });
83
92
  }
84
- function C(e) {
93
+ function k(e) {
94
+ if (!e) return "";
95
+ let t = Date.parse(e);
96
+ return Number.isFinite(t) ? new Date(t).toISOString().slice(0, 10) : "";
97
+ }
98
+ function A(e) {
99
+ return v.includes(e);
100
+ }
101
+ function j(e) {
102
+ let t = w(e);
103
+ return O(e).flatMap((e, n) => e.recognised && A(e.permission) ? [{
104
+ permission: e.permission,
105
+ agentIds: e.agentIds,
106
+ validFrom: k(e.validFrom),
107
+ validUntil: k(e.validUntil),
108
+ original: t[n]
109
+ }] : []);
110
+ }
111
+ function M(e) {
112
+ let t = w(e);
113
+ return O(e).flatMap((e, n) => e.recognised && A(e.permission) ? [] : [t[n]]);
114
+ }
115
+ function N(e, t = []) {
116
+ return [...e.map((e) => {
117
+ let t = { ...e.original ?? {} };
118
+ t.permission = e.permission;
119
+ let n = { ...b(t.scope) };
120
+ e.agentIds.length > 0 ? n.agentIds = e.agentIds : delete n.agentIds, Object.keys(n).length > 0 ? t.scope = n : delete t.scope;
121
+ let r = e.original ?? {}, i = (t) => {
122
+ let n = x(r[t]);
123
+ return n && k(n) === e[t] ? n : void 0;
124
+ };
125
+ return e.validFrom ? t.validFrom = i("validFrom") ?? `${e.validFrom}T00:00:00.000Z` : delete t.validFrom, e.validUntil ? t.validUntil = i("validUntil") ?? `${e.validUntil}T23:59:59.999Z` : delete t.validUntil, t;
126
+ }), ...t];
127
+ }
128
+ function P(e) {
129
+ if (e.validFrom && e.validUntil && e.validUntil < e.validFrom) return "validityOrder";
130
+ }
131
+ function F(e, t = Date.now()) {
132
+ let n = (e) => {
133
+ let n = e.validFrom ? Date.parse(e.validFrom) : NaN, r = e.validUntil ? Date.parse(e.validUntil) : NaN;
134
+ return !(Number.isFinite(n) && t < n) && !(Number.isFinite(r) && t > r);
135
+ };
136
+ return O(e).some((e) => e.recognised && A(e.permission) && n(e));
137
+ }
138
+ function I(e) {
85
139
  let t = e.agentCard?.skills;
86
140
  return Array.isArray(t) ? t.length : 0;
87
141
  }
88
- function w(e) {
142
+ function L(e) {
89
143
  let t = [];
90
144
  if (!e) return {
91
145
  valid: !1,
92
- errors: ["An agent card is required"]
146
+ errors: [{
147
+ key: "botlit.a2aRegistry.validation.cardRequired",
148
+ fallback: "An agent card is required"
149
+ }]
93
150
  };
94
151
  for (let n of [
95
152
  "name",
96
153
  "description",
97
154
  "url",
98
155
  "version"
99
- ]) (typeof e[n] != "string" || e[n].trim() === "") && t.push(`Agent card is missing "${n}"`);
100
- return Array.isArray(e.skills) && e.skills.length !== 0 || t.push("Agent card must advertise at least one skill"), {
156
+ ]) (typeof e[n] != "string" || e[n].trim() === "") && t.push({
157
+ key: "botlit.a2aRegistry.validation.cardMissingField",
158
+ fallback: "Agent card is missing \"{{field}}\"",
159
+ params: { field: n }
160
+ });
161
+ return typeof e.url == "string" && e.url.trim() !== "" && !R(e.url) && t.push({
162
+ key: "botlit.a2aRegistry.validation.cardUrlHttps",
163
+ fallback: "The card's \"url\" must be an https:// address"
164
+ }), Array.isArray(e.skills) && e.skills.length !== 0 || t.push({
165
+ key: "botlit.a2aRegistry.validation.cardNoSkills",
166
+ fallback: "Agent card must advertise at least one skill"
167
+ }), {
101
168
  valid: t.length === 0,
102
169
  errors: t
103
170
  };
104
171
  }
105
- function T(e) {
106
- return e?.listA2ARegistryEntries ?? h;
107
- }
108
- function E(e) {
109
- let t = s(), n = e?.search?.trim().toLowerCase() ?? "", i = e?.status?.[0], a = e?.visibility?.[0], o = e?.trustLevel?.[0], c = e?.bucketId, p = d(() => ({
110
- filters: {
111
- workspaceId: t,
112
- status: i,
113
- visibility: a,
114
- trustLevel: o,
115
- bucketId: c
116
- },
117
- pagination: {
118
- limit: f,
119
- offset: 0
120
- }
121
- }), [
172
+ function R(e) {
173
+ try {
174
+ let t = new URL(e.trim());
175
+ return t.protocol === "https:" && t.hostname.length > 0;
176
+ } catch {
177
+ return !1;
178
+ }
179
+ }
180
+ function z(e) {
181
+ try {
182
+ let t = JSON.parse(e);
183
+ return typeof t == "object" && t && !Array.isArray(t) ? t : void 0;
184
+ } catch {
185
+ return;
186
+ }
187
+ }
188
+ function B(e) {
189
+ let t = e.name.trim();
190
+ if (t) return t;
191
+ let n = z(e.agentCardJson)?.name;
192
+ return typeof n == "string" ? n.trim() : "";
193
+ }
194
+ function V(e) {
195
+ let t = e.description.trim();
196
+ if (t) return t;
197
+ let n = z(e.agentCardJson)?.description;
198
+ return typeof n == "string" ? n.trim() : "";
199
+ }
200
+ function H(e) {
201
+ let t = {}, n = z(e.agentCardJson);
202
+ if (!e.agentCardJson.trim()) t.agentCardJson = {
203
+ key: "botlit.a2aRegistry.validation.cardRequired",
204
+ fallback: "An agent card is required"
205
+ };
206
+ else if (new TextEncoder().encode(e.agentCardJson).length > 1048576) t.agentCardJson = {
207
+ key: "botlit.a2aRegistry.validation.cardTooLarge",
208
+ fallback: "The agent card must be at most 1 MiB"
209
+ };
210
+ else if (!n) t.agentCardJson = {
211
+ key: "botlit.a2aRegistry.validation.cardInvalidJson",
212
+ fallback: "Agent card must be a valid JSON object"
213
+ };
214
+ else {
215
+ let e = L(n);
216
+ e.valid || (t.agentCardJson = e.errors[0]);
217
+ }
218
+ let r = B(e);
219
+ r ? r.length > 255 && (t.name = {
220
+ key: "botlit.a2aRegistry.validation.nameTooLong",
221
+ fallback: "Name must be at most {{max}} characters",
222
+ params: { max: 255 }
223
+ }) : t.name = {
224
+ key: "botlit.a2aRegistry.validation.nameRequired",
225
+ fallback: "Enter a name, or paste a card that has one"
226
+ }, V(e).length > 2e3 && (t.description = {
227
+ key: "botlit.a2aRegistry.validation.descriptionTooLong",
228
+ fallback: "Description must be at most {{max}} characters",
229
+ params: { max: p }
230
+ });
231
+ let i = e.wellKnownUrl.trim();
232
+ return i && (i.length > 2048 ? t.wellKnownUrl = {
233
+ key: "botlit.a2aRegistry.validation.urlTooLong",
234
+ fallback: "URL must be at most {{max}} characters",
235
+ params: { max: m }
236
+ } : R(i) || (t.wellKnownUrl = {
237
+ key: "botlit.a2aRegistry.validation.wellKnownHttps",
238
+ fallback: "Enter an https:// URL, e.g. https://agent.example.com/.well-known/agent.json"
239
+ })), t;
240
+ }
241
+ function U(e) {
242
+ return e;
243
+ }
244
+ function W(e) {
245
+ return e?.listA2ARegistryEntries ?? y;
246
+ }
247
+ function G(e) {
248
+ let t = s(), n = e?.search?.trim().toLowerCase() ?? "", i = e?.status?.[0], a = e?.visibility?.[0], o = e?.trustLevel?.[0], c = e?.bucketId, u = f(() => ({ filters: {
249
+ workspaceId: t,
250
+ status: i,
251
+ visibility: a,
252
+ trustLevel: o,
253
+ bucketId: c
254
+ } }), [
122
255
  t,
123
256
  i,
124
257
  a,
125
258
  o,
126
259
  c
127
- ]), m = u((e) => {
128
- let t = T(e);
129
- return n ? t.filter((e) => e.name.toLowerCase().includes(n) || (e.description ?? "").toLowerCase().includes(n)) : t;
130
- }, [n]);
131
- return l({
260
+ ]), d = l({
132
261
  document: r,
133
- variables: p,
134
- select: m,
135
- fallback: h,
262
+ variables: u,
263
+ pageSize: 50,
264
+ extractRows: W,
265
+ select: U,
266
+ fallback: y,
136
267
  enabled: !!t,
137
268
  errorMessage: "Failed to load the A2A registry"
138
- });
269
+ }), p = d.data, m = f(() => n ? p.filter((e) => e.name.toLowerCase().includes(n) || (e.description ?? "").toLowerCase().includes(n)) : p, [p, n]);
270
+ return {
271
+ ...d,
272
+ data: m
273
+ };
139
274
  }
140
- function D(e) {
141
- let t = d(() => ({ id: e ?? "" }), [e]);
142
- return l({
275
+ function K(e) {
276
+ let t = f(() => ({ id: e ?? "" }), [e]);
277
+ return u({
143
278
  document: n,
144
279
  variables: t,
145
280
  select: (e) => e?.getA2ARegistryEntry ?? null,
@@ -148,11 +283,11 @@ function D(e) {
148
283
  errorMessage: "Failed to load A2A agent"
149
284
  });
150
285
  }
151
- function O() {
152
- let t = s(), n = u((e) => ({ input: a({
286
+ function q() {
287
+ let t = s(), n = d((e) => ({ input: a({
153
288
  ...e,
154
289
  workspaceId: t
155
- }, p) }), [t]);
290
+ }, g) }), [t]);
156
291
  return c({
157
292
  document: e,
158
293
  variables: n,
@@ -160,18 +295,18 @@ function O() {
160
295
  errorMessage: "Failed to register A2A agent"
161
296
  });
162
297
  }
163
- function k() {
298
+ function J() {
164
299
  return c({
165
300
  document: i,
166
301
  variables: ({ agentId: e, input: t }) => ({
167
302
  id: e,
168
- input: a(t, m)
303
+ input: a(t, _)
169
304
  }),
170
305
  select: (e) => e?.updateA2ARegistryEntry,
171
306
  errorMessage: "Failed to update A2A agent"
172
307
  });
173
308
  }
174
- function A() {
309
+ function Y() {
175
310
  return c({
176
311
  document: t,
177
312
  variables: (e) => ({ id: e }),
@@ -179,6 +314,6 @@ function A() {
179
314
  errorMessage: "Failed to remove A2A agent"
180
315
  });
181
316
  }
182
- export { C as a2aAgentSkillCount, x as readAgentCard, S as readEntitlements, D as useA2AAgent, E as useA2AAgents, A as useDeleteA2AAgent, O as useRegisterA2AAgent, k as useUpdateA2AAgent, w as validateAgentCard };
317
+ export { h as A2A_AGENT_CARD_MAX_BYTES, p as A2A_DESCRIPTION_MAX, v as A2A_ENTITLEMENT_PERMISSIONS, m as A2A_URL_MAX, I as a2aAgentSkillCount, V as effectiveEntryDescription, B as effectiveEntryName, P as entitlementDraftError, F as entitlementsAllowConnections, R as isHttpsUrl, z as parseAgentCardJson, T as readAgentCard, O as readEntitlements, j as toEntitlementDrafts, N as toEntitlementsInput, M as unmanagedEntitlements, K as useA2AAgent, G as useA2AAgents, Y as useDeleteA2AAgent, q as useRegisterA2AAgent, J as useUpdateA2AAgent, L as validateAgentCard, H as validateRegistryForm };
183
318
 
184
319
  //# sourceMappingURL=useA2A.js.map