@getcatalystiq/agent-plane-ui 0.1.20 → 0.1.21
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.cjs +45 -2
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +45 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4070,7 +4070,7 @@ function AgentA2aInfo({
|
|
|
4070
4070
|
] });
|
|
4071
4071
|
}
|
|
4072
4072
|
var AgentIdentityTab = React.lazy(() => import('./agent-identity-tab-F4MU2HP2.cjs').then((m) => ({ default: m.AgentIdentityTab })));
|
|
4073
|
-
function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
4073
|
+
function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, adminApiBaseUrl, adminApiKey }) {
|
|
4074
4074
|
const { LinkComponent, basePath } = chunkXXF4U7WL_cjs.useNavigation();
|
|
4075
4075
|
const { mutate } = swr.useSWRConfig();
|
|
4076
4076
|
const cacheKey = `agent-${agentId}`;
|
|
@@ -4081,6 +4081,49 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
|
4081
4081
|
const invalidate = React.useCallback(() => {
|
|
4082
4082
|
mutate(cacheKey);
|
|
4083
4083
|
}, [mutate, cacheKey]);
|
|
4084
|
+
const adminFetch = React.useCallback(async (path, options) => {
|
|
4085
|
+
if (!adminApiBaseUrl) throw new Error("Admin API not configured");
|
|
4086
|
+
const res = await fetch(`${adminApiBaseUrl}${path}`, {
|
|
4087
|
+
...options,
|
|
4088
|
+
headers: {
|
|
4089
|
+
"Content-Type": "application/json",
|
|
4090
|
+
...adminApiKey ? { Authorization: `Bearer ${adminApiKey}` } : {},
|
|
4091
|
+
...options?.headers
|
|
4092
|
+
}
|
|
4093
|
+
});
|
|
4094
|
+
if (!res.ok) {
|
|
4095
|
+
const body = await res.json().catch(() => ({ error: { message: res.statusText } }));
|
|
4096
|
+
throw new Error(body?.error?.message ?? `Request failed: ${res.status}`);
|
|
4097
|
+
}
|
|
4098
|
+
return res.json();
|
|
4099
|
+
}, [adminApiBaseUrl, adminApiKey]);
|
|
4100
|
+
const soulCallbacks = React.useMemo(() => {
|
|
4101
|
+
if (!adminApiBaseUrl) return {};
|
|
4102
|
+
return {
|
|
4103
|
+
onGenerateSoul: async () => {
|
|
4104
|
+
const result = await adminFetch(`/api/admin/agents/${agentId}/generate-soul`, { method: "POST" });
|
|
4105
|
+
return { files: result.files };
|
|
4106
|
+
},
|
|
4107
|
+
onImportSoul: async (ref) => {
|
|
4108
|
+
const [owner, name] = ref.split("/");
|
|
4109
|
+
const result = await adminFetch(`/api/admin/agents/${agentId}/import-soul`, {
|
|
4110
|
+
method: "POST",
|
|
4111
|
+
body: JSON.stringify({ owner, name })
|
|
4112
|
+
});
|
|
4113
|
+
return { files: result.imported_files };
|
|
4114
|
+
},
|
|
4115
|
+
onExportSoul: async () => {
|
|
4116
|
+
const result = await adminFetch(`/api/admin/agents/${agentId}/export-soul`);
|
|
4117
|
+
return { files: result.files, name: agent?.name ?? "agent" };
|
|
4118
|
+
},
|
|
4119
|
+
onPublishSoul: async (owner) => {
|
|
4120
|
+
await adminFetch(`/api/admin/agents/${agentId}/publish-soul`, {
|
|
4121
|
+
method: "POST",
|
|
4122
|
+
body: JSON.stringify({ owner })
|
|
4123
|
+
});
|
|
4124
|
+
}
|
|
4125
|
+
};
|
|
4126
|
+
}, [adminApiBaseUrl, adminFetch, agentId, agent?.name]);
|
|
4084
4127
|
if (isLoading) {
|
|
4085
4128
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
4086
4129
|
/* @__PURE__ */ jsxRuntime.jsx(chunkVZ43ATC5_cjs.Skeleton, { className: "h-9 w-40" }),
|
|
@@ -4141,7 +4184,7 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
|
4141
4184
|
},
|
|
4142
4185
|
{
|
|
4143
4186
|
label: "Identity",
|
|
4144
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkVZ43ATC5_cjs.Skeleton, { className: "h-64 w-full" }), children: /* @__PURE__ */ jsxRuntime.jsx(AgentIdentityTab, { agent, FileTreeEditor: chunkVZ43ATC5_cjs.FileTreeEditor, onSaved: invalidate }) })
|
|
4187
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkVZ43ATC5_cjs.Skeleton, { className: "h-64 w-full" }), children: /* @__PURE__ */ jsxRuntime.jsx(AgentIdentityTab, { agent, FileTreeEditor: chunkVZ43ATC5_cjs.FileTreeEditor, onSaved: invalidate, ...soulCallbacks }) })
|
|
4145
4188
|
},
|
|
4146
4189
|
{
|
|
4147
4190
|
label: "Connectors",
|
package/dist/index.d.cts
CHANGED
|
@@ -599,8 +599,13 @@ interface AgentDetailPageProps {
|
|
|
599
599
|
a2aBaseUrl?: string;
|
|
600
600
|
/** Tenant slug (needed for A2A URLs) */
|
|
601
601
|
tenantSlug?: string;
|
|
602
|
+
/** Admin API base URL — when provided, enables Generate/Import/Export/Publish buttons on the Identity tab */
|
|
603
|
+
adminApiBaseUrl?: string;
|
|
604
|
+
/** Admin API key or auth token for admin endpoints */
|
|
605
|
+
adminApiKey?: string;
|
|
602
606
|
}
|
|
603
|
-
|
|
607
|
+
|
|
608
|
+
declare function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, adminApiBaseUrl, adminApiKey }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
|
|
604
609
|
|
|
605
610
|
interface Agent {
|
|
606
611
|
id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -599,8 +599,13 @@ interface AgentDetailPageProps {
|
|
|
599
599
|
a2aBaseUrl?: string;
|
|
600
600
|
/** Tenant slug (needed for A2A URLs) */
|
|
601
601
|
tenantSlug?: string;
|
|
602
|
+
/** Admin API base URL — when provided, enables Generate/Import/Export/Publish buttons on the Identity tab */
|
|
603
|
+
adminApiBaseUrl?: string;
|
|
604
|
+
/** Admin API key or auth token for admin endpoints */
|
|
605
|
+
adminApiKey?: string;
|
|
602
606
|
}
|
|
603
|
-
|
|
607
|
+
|
|
608
|
+
declare function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, adminApiBaseUrl, adminApiKey }: AgentDetailPageProps): react_jsx_runtime.JSX.Element;
|
|
604
609
|
|
|
605
610
|
interface Agent {
|
|
606
611
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -4046,7 +4046,7 @@ function AgentA2aInfo({
|
|
|
4046
4046
|
] });
|
|
4047
4047
|
}
|
|
4048
4048
|
var AgentIdentityTab = lazy(() => import('./agent-identity-tab-ETPM6LQN.js').then((m) => ({ default: m.AgentIdentityTab })));
|
|
4049
|
-
function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
4049
|
+
function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug, adminApiBaseUrl, adminApiKey }) {
|
|
4050
4050
|
const { LinkComponent, basePath } = useNavigation();
|
|
4051
4051
|
const { mutate } = useSWRConfig();
|
|
4052
4052
|
const cacheKey = `agent-${agentId}`;
|
|
@@ -4057,6 +4057,49 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
|
4057
4057
|
const invalidate = useCallback(() => {
|
|
4058
4058
|
mutate(cacheKey);
|
|
4059
4059
|
}, [mutate, cacheKey]);
|
|
4060
|
+
const adminFetch = useCallback(async (path, options) => {
|
|
4061
|
+
if (!adminApiBaseUrl) throw new Error("Admin API not configured");
|
|
4062
|
+
const res = await fetch(`${adminApiBaseUrl}${path}`, {
|
|
4063
|
+
...options,
|
|
4064
|
+
headers: {
|
|
4065
|
+
"Content-Type": "application/json",
|
|
4066
|
+
...adminApiKey ? { Authorization: `Bearer ${adminApiKey}` } : {},
|
|
4067
|
+
...options?.headers
|
|
4068
|
+
}
|
|
4069
|
+
});
|
|
4070
|
+
if (!res.ok) {
|
|
4071
|
+
const body = await res.json().catch(() => ({ error: { message: res.statusText } }));
|
|
4072
|
+
throw new Error(body?.error?.message ?? `Request failed: ${res.status}`);
|
|
4073
|
+
}
|
|
4074
|
+
return res.json();
|
|
4075
|
+
}, [adminApiBaseUrl, adminApiKey]);
|
|
4076
|
+
const soulCallbacks = useMemo(() => {
|
|
4077
|
+
if (!adminApiBaseUrl) return {};
|
|
4078
|
+
return {
|
|
4079
|
+
onGenerateSoul: async () => {
|
|
4080
|
+
const result = await adminFetch(`/api/admin/agents/${agentId}/generate-soul`, { method: "POST" });
|
|
4081
|
+
return { files: result.files };
|
|
4082
|
+
},
|
|
4083
|
+
onImportSoul: async (ref) => {
|
|
4084
|
+
const [owner, name] = ref.split("/");
|
|
4085
|
+
const result = await adminFetch(`/api/admin/agents/${agentId}/import-soul`, {
|
|
4086
|
+
method: "POST",
|
|
4087
|
+
body: JSON.stringify({ owner, name })
|
|
4088
|
+
});
|
|
4089
|
+
return { files: result.imported_files };
|
|
4090
|
+
},
|
|
4091
|
+
onExportSoul: async () => {
|
|
4092
|
+
const result = await adminFetch(`/api/admin/agents/${agentId}/export-soul`);
|
|
4093
|
+
return { files: result.files, name: agent?.name ?? "agent" };
|
|
4094
|
+
},
|
|
4095
|
+
onPublishSoul: async (owner) => {
|
|
4096
|
+
await adminFetch(`/api/admin/agents/${agentId}/publish-soul`, {
|
|
4097
|
+
method: "POST",
|
|
4098
|
+
body: JSON.stringify({ owner })
|
|
4099
|
+
});
|
|
4100
|
+
}
|
|
4101
|
+
};
|
|
4102
|
+
}, [adminApiBaseUrl, adminFetch, agentId, agent?.name]);
|
|
4060
4103
|
if (isLoading) {
|
|
4061
4104
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
4062
4105
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-40" }),
|
|
@@ -4117,7 +4160,7 @@ function AgentDetailPage({ agentId, a2aBaseUrl, tenantSlug }) {
|
|
|
4117
4160
|
},
|
|
4118
4161
|
{
|
|
4119
4162
|
label: "Identity",
|
|
4120
|
-
content: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full" }), children: /* @__PURE__ */ jsx(AgentIdentityTab, { agent, FileTreeEditor, onSaved: invalidate }) })
|
|
4163
|
+
content: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full" }), children: /* @__PURE__ */ jsx(AgentIdentityTab, { agent, FileTreeEditor, onSaved: invalidate, ...soulCallbacks }) })
|
|
4121
4164
|
},
|
|
4122
4165
|
{
|
|
4123
4166
|
label: "Connectors",
|