mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 02:50:20 +00:00
Gateway/UI: data-driven agents tools catalog with provenance (openclaw#24199) thanks @Takhoffman
Verified: - pnpm install --frozen-lockfile - pnpm build - gh pr checks 24199 --watch --fail-fast Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -195,6 +195,9 @@ import {
|
||||
SkillsStatusParamsSchema,
|
||||
type SkillsUpdateParams,
|
||||
SkillsUpdateParamsSchema,
|
||||
type ToolsCatalogParams,
|
||||
ToolsCatalogParamsSchema,
|
||||
type ToolsCatalogResult,
|
||||
type Snapshot,
|
||||
SnapshotSchema,
|
||||
type StateVersion,
|
||||
@@ -319,6 +322,7 @@ export const validateChannelsLogoutParams = ajv.compile<ChannelsLogoutParams>(
|
||||
);
|
||||
export const validateModelsListParams = ajv.compile<ModelsListParams>(ModelsListParamsSchema);
|
||||
export const validateSkillsStatusParams = ajv.compile<SkillsStatusParams>(SkillsStatusParamsSchema);
|
||||
export const validateToolsCatalogParams = ajv.compile<ToolsCatalogParams>(ToolsCatalogParamsSchema);
|
||||
export const validateSkillsBinsParams = ajv.compile<SkillsBinsParams>(SkillsBinsParamsSchema);
|
||||
export const validateSkillsInstallParams =
|
||||
ajv.compile<SkillsInstallParams>(SkillsInstallParamsSchema);
|
||||
@@ -487,6 +491,7 @@ export {
|
||||
AgentsListResultSchema,
|
||||
ModelsListParamsSchema,
|
||||
SkillsStatusParamsSchema,
|
||||
ToolsCatalogParamsSchema,
|
||||
SkillsInstallParamsSchema,
|
||||
SkillsUpdateParamsSchema,
|
||||
CronJobSchema,
|
||||
@@ -575,6 +580,8 @@ export type {
|
||||
AgentsListParams,
|
||||
AgentsListResult,
|
||||
SkillsStatusParams,
|
||||
ToolsCatalogParams,
|
||||
ToolsCatalogResult,
|
||||
SkillsBinsParams,
|
||||
SkillsBinsResult,
|
||||
SkillsInstallParams,
|
||||
|
||||
@@ -207,3 +207,64 @@ export const SkillsUpdateParamsSchema = Type.Object(
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ToolsCatalogParamsSchema = Type.Object(
|
||||
{
|
||||
agentId: Type.Optional(NonEmptyString),
|
||||
includePlugins: Type.Optional(Type.Boolean()),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ToolCatalogProfileSchema = Type.Object(
|
||||
{
|
||||
id: Type.Union([
|
||||
Type.Literal("minimal"),
|
||||
Type.Literal("coding"),
|
||||
Type.Literal("messaging"),
|
||||
Type.Literal("full"),
|
||||
]),
|
||||
label: NonEmptyString,
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ToolCatalogEntrySchema = Type.Object(
|
||||
{
|
||||
id: NonEmptyString,
|
||||
label: NonEmptyString,
|
||||
description: Type.String(),
|
||||
source: Type.Union([Type.Literal("core"), Type.Literal("plugin")]),
|
||||
pluginId: Type.Optional(NonEmptyString),
|
||||
optional: Type.Optional(Type.Boolean()),
|
||||
defaultProfiles: Type.Array(
|
||||
Type.Union([
|
||||
Type.Literal("minimal"),
|
||||
Type.Literal("coding"),
|
||||
Type.Literal("messaging"),
|
||||
Type.Literal("full"),
|
||||
]),
|
||||
),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ToolCatalogGroupSchema = Type.Object(
|
||||
{
|
||||
id: NonEmptyString,
|
||||
label: NonEmptyString,
|
||||
source: Type.Union([Type.Literal("core"), Type.Literal("plugin")]),
|
||||
pluginId: Type.Optional(NonEmptyString),
|
||||
tools: Type.Array(ToolCatalogEntrySchema),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const ToolsCatalogResultSchema = Type.Object(
|
||||
{
|
||||
agentId: NonEmptyString,
|
||||
profiles: Type.Array(ToolCatalogProfileSchema),
|
||||
groups: Type.Array(ToolCatalogGroupSchema),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
@@ -34,6 +34,11 @@ import {
|
||||
SkillsInstallParamsSchema,
|
||||
SkillsStatusParamsSchema,
|
||||
SkillsUpdateParamsSchema,
|
||||
ToolCatalogEntrySchema,
|
||||
ToolCatalogGroupSchema,
|
||||
ToolCatalogProfileSchema,
|
||||
ToolsCatalogParamsSchema,
|
||||
ToolsCatalogResultSchema,
|
||||
} from "./agents-models-skills.js";
|
||||
import {
|
||||
ChannelsLogoutParamsSchema,
|
||||
@@ -224,6 +229,11 @@ export const ProtocolSchemas: Record<string, TSchema> = {
|
||||
ModelsListParams: ModelsListParamsSchema,
|
||||
ModelsListResult: ModelsListResultSchema,
|
||||
SkillsStatusParams: SkillsStatusParamsSchema,
|
||||
ToolsCatalogParams: ToolsCatalogParamsSchema,
|
||||
ToolCatalogProfile: ToolCatalogProfileSchema,
|
||||
ToolCatalogEntry: ToolCatalogEntrySchema,
|
||||
ToolCatalogGroup: ToolCatalogGroupSchema,
|
||||
ToolsCatalogResult: ToolsCatalogResultSchema,
|
||||
SkillsBinsParams: SkillsBinsParamsSchema,
|
||||
SkillsBinsResult: SkillsBinsResultSchema,
|
||||
SkillsInstallParams: SkillsInstallParamsSchema,
|
||||
|
||||
@@ -32,6 +32,11 @@ import type {
|
||||
SkillsInstallParamsSchema,
|
||||
SkillsStatusParamsSchema,
|
||||
SkillsUpdateParamsSchema,
|
||||
ToolCatalogEntrySchema,
|
||||
ToolCatalogGroupSchema,
|
||||
ToolCatalogProfileSchema,
|
||||
ToolsCatalogParamsSchema,
|
||||
ToolsCatalogResultSchema,
|
||||
} from "./agents-models-skills.js";
|
||||
import type {
|
||||
ChannelsLogoutParamsSchema,
|
||||
@@ -213,6 +218,11 @@ export type ModelChoice = Static<typeof ModelChoiceSchema>;
|
||||
export type ModelsListParams = Static<typeof ModelsListParamsSchema>;
|
||||
export type ModelsListResult = Static<typeof ModelsListResultSchema>;
|
||||
export type SkillsStatusParams = Static<typeof SkillsStatusParamsSchema>;
|
||||
export type ToolsCatalogParams = Static<typeof ToolsCatalogParamsSchema>;
|
||||
export type ToolCatalogProfile = Static<typeof ToolCatalogProfileSchema>;
|
||||
export type ToolCatalogEntry = Static<typeof ToolCatalogEntrySchema>;
|
||||
export type ToolCatalogGroup = Static<typeof ToolCatalogGroupSchema>;
|
||||
export type ToolsCatalogResult = Static<typeof ToolsCatalogResultSchema>;
|
||||
export type SkillsBinsParams = Static<typeof SkillsBinsParamsSchema>;
|
||||
export type SkillsBinsResult = Static<typeof SkillsBinsResultSchema>;
|
||||
export type SkillsInstallParams = Static<typeof SkillsInstallParamsSchema>;
|
||||
|
||||
Reference in New Issue
Block a user