@burdenoff/microfe-botmanor 2026.1118.8 → 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.
- package/dist/botlit/components/A2ATrustBadge.d.ts +9 -0
- package/dist/botlit/components/A2ATrustBadge.js +55 -0
- package/dist/botlit/components/A2ATrustBadge.js.map +1 -0
- package/dist/botlit/hooks/useA2A.d.ts +107 -9
- package/dist/botlit/hooks/useA2A.js +215 -80
- package/dist/botlit/hooks/useA2A.js.map +1 -1
- package/dist/botlit/pages/A2AAgentDetailPage.js +715 -503
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/A2ARegistryPage.js +278 -179
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
- package/dist/botlit/pages/ExecutionsPage.js +1 -1
- package/dist/botlit/pages/InstalledPackagesPage.js +154 -154
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
- package/dist/botlit/pages/PromptStudioPage.js +172 -172
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -1
- package/dist/botlit/pages/StorePage.js +8 -8
- package/dist/botlit/pages/StorePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { TrustLevel } from '../types';
|
|
3
|
+
export declare const A2A_TRUST_LEVELS: readonly TrustLevel[];
|
|
4
|
+
export declare function toTrustLevel(value: string | null | undefined): TrustLevel;
|
|
5
|
+
/** Translated name of a trust level. */
|
|
6
|
+
export declare function useTrustLevelLabel(): (level: TrustLevel) => string;
|
|
7
|
+
export declare const A2ATrustBadge: FC<{
|
|
8
|
+
level: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
+
import { Badge as t } from "./Badge.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { AlertCircle as i, CheckCircle as a, Shield as o } from "lucide-react";
|
|
5
|
+
// src/botlit/components/A2ATrustBadge.tsx
|
|
6
|
+
var s = [
|
|
7
|
+
"UNVERIFIED",
|
|
8
|
+
"VERIFIED_PUBLISHER",
|
|
9
|
+
"INTERNAL"
|
|
10
|
+
];
|
|
11
|
+
function c(e) {
|
|
12
|
+
return s.includes(e) ? e : "UNVERIFIED";
|
|
13
|
+
}
|
|
14
|
+
function l() {
|
|
15
|
+
let t = e();
|
|
16
|
+
return (e) => {
|
|
17
|
+
switch (e) {
|
|
18
|
+
case "INTERNAL": return t("botlit.a2aRegistry.trustBadge.internal", "Internal");
|
|
19
|
+
case "VERIFIED_PUBLISHER": return t("botlit.a2aRegistry.trustBadge.verified", "Verified publisher");
|
|
20
|
+
default: return t("botlit.a2aRegistry.trustBadge.unverified", "Unverified");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
var u = ({ level: e }) => {
|
|
25
|
+
let s = l(), u = c(e);
|
|
26
|
+
switch (u) {
|
|
27
|
+
case "INTERNAL": return /* @__PURE__ */ r(t, {
|
|
28
|
+
variant: "success",
|
|
29
|
+
className: "flex items-center gap-1",
|
|
30
|
+
children: [/* @__PURE__ */ n(o, {
|
|
31
|
+
size: 12,
|
|
32
|
+
"aria-hidden": "true"
|
|
33
|
+
}), s(u)]
|
|
34
|
+
});
|
|
35
|
+
case "VERIFIED_PUBLISHER": return /* @__PURE__ */ r(t, {
|
|
36
|
+
variant: "default",
|
|
37
|
+
className: "flex items-center gap-1",
|
|
38
|
+
children: [/* @__PURE__ */ n(a, {
|
|
39
|
+
size: 12,
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
}), s(u)]
|
|
42
|
+
});
|
|
43
|
+
default: return /* @__PURE__ */ r(t, {
|
|
44
|
+
variant: "outline",
|
|
45
|
+
className: "flex items-center gap-1",
|
|
46
|
+
children: [/* @__PURE__ */ n(i, {
|
|
47
|
+
size: 12,
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
}), s(u)]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
export { u as A2ATrustBadge, s as A2A_TRUST_LEVELS, c as toTrustLevel, l as useTrustLevelLabel };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=A2ATrustBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A2ATrustBadge.js","names":["A2A_TRUST_LEVELS","toTrustLevel","value","useTrustLevelLabel","useTr","level","A2ATrustBadge","label","trust","Badge","Shield","CheckCircle","AlertCircle"],"sources":["../../../src/botlit/components/A2ATrustBadge.tsx"],"sourcesContent":["/**\n * A2A trust level badge and labels (BOFF-12507)\n * @module botlit/components\n *\n * One translated label per trust level, shared by the registry list and the\n * entry page, so the same level never reads differently on two pages.\n */\n\nimport type { FC } from 'react';\nimport { AlertCircle, CheckCircle, Shield } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\nimport type { TrustLevel } from '../types';\nimport { Badge } from './Badge';\n\nexport const A2A_TRUST_LEVELS: readonly TrustLevel[] = [\n 'UNVERIFIED',\n 'VERIFIED_PUBLISHER',\n 'INTERNAL',\n];\n\nexport function toTrustLevel(value: string | null | undefined): TrustLevel {\n return A2A_TRUST_LEVELS.includes(value as TrustLevel) ? (value as TrustLevel) : 'UNVERIFIED';\n}\n\n/** Translated name of a trust level. */\nexport function useTrustLevelLabel(): (level: TrustLevel) => string {\n const t = useTr();\n return (level) => {\n switch (level) {\n case 'INTERNAL':\n return t('botlit.a2aRegistry.trustBadge.internal', 'Internal');\n case 'VERIFIED_PUBLISHER':\n return t('botlit.a2aRegistry.trustBadge.verified', 'Verified publisher');\n default:\n return t('botlit.a2aRegistry.trustBadge.unverified', 'Unverified');\n }\n };\n}\n\nexport const A2ATrustBadge: FC<{ level: string }> = ({ level }) => {\n const label = useTrustLevelLabel();\n const trust = toTrustLevel(level);\n switch (trust) {\n case 'INTERNAL':\n return (\n <Badge variant=\"success\" className=\"flex items-center gap-1\">\n <Shield size={12} aria-hidden=\"true\" />\n {label(trust)}\n </Badge>\n );\n case 'VERIFIED_PUBLISHER':\n return (\n <Badge variant=\"default\" className=\"flex items-center gap-1\">\n <CheckCircle size={12} aria-hidden=\"true\" />\n {label(trust)}\n </Badge>\n );\n default:\n return (\n <Badge variant=\"outline\" className=\"flex items-center gap-1\">\n <AlertCircle size={12} aria-hidden=\"true\" />\n {label(trust)}\n </Badge>\n );\n }\n};\n"],"mappings":";;;;;AAcA,IAAaA,IAA0C;CACrD;CACA;CACA;AACF;AAEA,SAAgBC,EAAa,GAA8C;CACzE,OAAOD,EAAiB,SAASE,CAAmB,IAAKA,IAAuB;AAClF;AAGA,SAAgBC,IAAoD;CAClE,IAAM,IAAIC,EAAM;CAChB,QAAQ,MAAU;EAChB,QAAQC,GAAR;GACE,KAAK,YACH,OAAO,EAAE,0CAA0C,UAAU;GAC/D,KAAK,sBACH,OAAO,EAAE,0CAA0C,oBAAoB;GACzE,SACE,OAAO,EAAE,4CAA4C,YAAY;EACrE;CACF;AACF;AAEA,IAAaC,KAAwC,EAAE,eAAY;CACjE,IAAMC,IAAQJ,EAAmB,GAC3BK,IAAQP,EAAaI,CAAK;CAChC,QAAQG,GAAR;EACE,KAAK,YACH,OACE,kBAACC,GAAD;GAAO,SAAQ;GAAU,WAAU;GAAnC,UAAA,CACE,kBAACC,GAAD;IAAQ,MAAM;IAAI,eAAY;GAAQ,CAAA,GACrCH,EAAMC,CAAK,CACP;;EAEX,KAAK,sBACH,OACE,kBAACC,GAAD;GAAO,SAAQ;GAAU,WAAU;GAAnC,UAAA,CACE,kBAACE,GAAD;IAAa,MAAM;IAAI,eAAY;GAAQ,CAAA,GAC1CJ,EAAMC,CAAK,CACP;;EAEX,SACE,OACE,kBAACC,GAAD;GAAO,SAAQ;GAAU,WAAU;GAAnC,UAAA,CACE,kBAACG,GAAD;IAAa,MAAM;IAAI,eAAY;GAAQ,CAAA,GAC1CL,EAAMC,CAAK,CACP;;CAEb;AACF"}
|
|
@@ -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:
|
|
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
|
-
/**
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
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,
|
|
4
|
-
import { useCallback as
|
|
5
|
-
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
32
|
-
function
|
|
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
|
|
34
|
+
function x(e, t = "") {
|
|
36
35
|
return typeof e == "string" ? e : t;
|
|
37
36
|
}
|
|
38
|
-
function
|
|
37
|
+
function S(e) {
|
|
39
38
|
return e === !0;
|
|
40
39
|
}
|
|
41
|
-
function
|
|
40
|
+
function C(e) {
|
|
42
41
|
return Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
43
42
|
}
|
|
44
|
-
function
|
|
45
|
-
return Array.isArray(e) ? e.map(
|
|
43
|
+
function w(e) {
|
|
44
|
+
return Array.isArray(e) ? e.map(b) : [];
|
|
46
45
|
}
|
|
47
|
-
function
|
|
48
|
-
let t =
|
|
46
|
+
function T(e) {
|
|
47
|
+
let t = b(e), n = b(t.capabilities), r = b(t.authentication);
|
|
49
48
|
return {
|
|
50
|
-
url:
|
|
51
|
-
version:
|
|
52
|
-
providerOrganization:
|
|
53
|
-
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:
|
|
56
|
-
pushNotifications:
|
|
57
|
-
stateTransitionHistory:
|
|
54
|
+
streaming: S(n.streaming),
|
|
55
|
+
pushNotifications: S(n.pushNotifications),
|
|
56
|
+
stateTransitionHistory: S(n.stateTransitionHistory)
|
|
58
57
|
},
|
|
59
|
-
authenticationSchemes:
|
|
60
|
-
defaultInputModes:
|
|
61
|
-
defaultOutputModes:
|
|
62
|
-
skills:
|
|
63
|
-
id:
|
|
64
|
-
name:
|
|
65
|
-
description:
|
|
66
|
-
tags:
|
|
67
|
-
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
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
|
|
142
|
+
function L(e) {
|
|
89
143
|
let t = [];
|
|
90
144
|
if (!e) return {
|
|
91
145
|
valid: !1,
|
|
92
|
-
errors: [
|
|
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(
|
|
100
|
-
|
|
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
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
]),
|
|
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:
|
|
134
|
-
|
|
135
|
-
|
|
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
|
|
141
|
-
let t =
|
|
142
|
-
return
|
|
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
|
|
152
|
-
let t = s(), n =
|
|
286
|
+
function q() {
|
|
287
|
+
let t = s(), n = d((e) => ({ input: a({
|
|
153
288
|
...e,
|
|
154
289
|
workspaceId: t
|
|
155
|
-
},
|
|
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
|
|
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,
|
|
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
|
|
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 {
|
|
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
|