repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import { z } from 'zod'; |
| #2 | |
| #3 | import { knowledgeBaseItemSchema, lLMChatsSchema, lLMParamsSchema } from './llm'; |
| #4 | |
| #5 | export const metaDataSchema = z.object({ |
| #6 | |
| #7 | /** |
| #8 | * Avatar image URL or path |
| #9 | */ |
| #10 | avatar: z.string(), |
| #11 | |
| #12 | /** |
| #13 | * Background color for the agent |
| #14 | */ |
| #15 | backgroundColor: z.string().optional(), |
| #16 | |
| #17 | /** |
| #18 | * Category classification |
| #19 | */ |
| #20 | category: z.string().optional(), |
| #21 | |
| #22 | /** |
| #23 | * Description of the agent |
| #24 | */ |
| #25 | description: z.string(), |
| #26 | |
| #27 | /** |
| #28 | * Tags for categorization and search |
| #29 | */ |
| #30 | tags: z.array(z.string()), |
| #31 | |
| #32 | /** |
| #33 | * Display title of the agent |
| #34 | */ |
| #35 | title: z.string(), |
| #36 | }); |
| #37 | |
| #38 | const lobeAgentConfigSchema = z.object({ |
| #39 | |
| #40 | /** |
| #41 | * Compression threshold value |
| #42 | */ |
| #43 | compressThreshold: z.number().optional(), |
| #44 | |
| #45 | /** |
| #46 | * Display mode for the agent interface |
| #47 | */ |
| #48 | displayMode: z.union([z.literal('chat'), z.literal('docs')]).optional(), |
| #49 | |
| #50 | /** |
| #51 | * Enable compression threshold |
| #52 | */ |
| #53 | enableCompressThreshold: z.boolean().optional(), |
| #54 | |
| #55 | /** |
| #56 | * Enable history count tracking |
| #57 | */ |
| #58 | enableHistoryCount: z.boolean().optional(), |
| #59 | |
| #60 | /** |
| #61 | * Enable maximum tokens limit |
| #62 | */ |
| #63 | enableMaxTokens: z.boolean().optional(), |
| #64 | |
| #65 | /** |
| #66 | * Few-shot examples for better AI responses |
| #67 | */ |
| #68 | fewShots: lLMChatsSchema.optional(), |
| #69 | |
| #70 | /** |
| #71 | * Number of historical messages to keep |
| #72 | */ |
| #73 | historyCount: z.number().optional(), |
| #74 | |
| #75 | /** |
| #76 | * Input template for message formatting |
| #77 | */ |
| #78 | inputTemplate: z.string().optional(), |
| #79 | |
| #80 | |
| #81 | /** |
| #82 | * knowledge bases |
| #83 | */ |
| #84 | knowledgeBases: z.array(knowledgeBaseItemSchema).optional(), |
| #85 | |
| #86 | |
| #87 | /** |
| #88 | * Language model used by the agent |
| #89 | */ |
| #90 | model: z.string().optional(), |
| #91 | |
| #92 | |
| #93 | /** |
| #94 | * Opening greeting message |
| #95 | */ |
| #96 | openingMessage: z.string().optional(), |
| #97 | |
| #98 | |
| #99 | /** |
| #100 | * Suggested opening questions |
| #101 | */ |
| #102 | openingQuestions: z.array(z.string()).optional(), |
| #103 | |
| #104 | |
| #105 | /** |
| #106 | * Language model parameters |
| #107 | */ |
| #108 | params: lLMParamsSchema.optional(), |
| #109 | |
| #110 | |
| #111 | /** |
| #112 | * Enabled plugins for the agent |
| #113 | */ |
| #114 | plugins: z.array(z.string()).optional(), |
| #115 | |
| #116 | |
| #117 | /** |
| #118 | * System role/persona definition |
| #119 | */ |
| #120 | systemRole: z.string(), |
| #121 | }); |
| #122 | |
| #123 | export type LobeAgentConfig = z.infer<typeof lobeAgentConfigSchema>; |
| #124 | |
| #125 | export const clawdAgentSchema = z.object({ |
| #126 | |
| #127 | /** |
| #128 | * Author of the agent |
| #129 | */ |
| #130 | author: z.string(), |
| #131 | |
| #132 | /** |
| #133 | * Agent configuration settings |
| #134 | */ |
| #135 | config: lobeAgentConfigSchema, |
| #136 | |
| #137 | /** |
| #138 | * Creation timestamp |
| #139 | */ |
| #140 | createdAt: z.string(), |
| #141 | |
| #142 | /** |
| #143 | * Example conversations |
| #144 | */ |
| #145 | examples: lLMChatsSchema.optional(), |
| #146 | |
| #147 | /** |
| #148 | * Homepage or repository URL |
| #149 | */ |
| #150 | homepage: z.string(), |
| #151 | |
| #152 | /** |
| #153 | * Unique identifier for the agent |
| #154 | */ |
| #155 | identifier: z.string(), |
| #156 | |
| #157 | |
| #158 | /** |
| #159 | * knowledge count |
| #160 | */ |
| #161 | knowledgeCount: z.number(), |
| #162 | |
| #163 | |
| #164 | /** |
| #165 | * Metadata information |
| #166 | */ |
| #167 | meta: metaDataSchema, |
| #168 | |
| #169 | |
| #170 | /** |
| #171 | * Opening greeting message (root level - LobeHub compatibility) |
| #172 | */ |
| #173 | openingMessage: z.string().optional(), |
| #174 | |
| #175 | /** |
| #176 | * Opening questions (root level - LobeHub compatibility) |
| #177 | */ |
| #178 | openingQuestions: z.array(z.string()).optional(), |
| #179 | |
| #180 | /** |
| #181 | * Plugins count |
| #182 | */ |
| #183 | pluginCount: z.number(), |
| #184 | |
| #185 | |
| #186 | /** |
| #187 | * Schema version number |
| #188 | */ |
| #189 | schemaVersion: z.number(), |
| #190 | |
| #191 | |
| #192 | /** |
| #193 | * Summary or brief description of the agent |
| #194 | */ |
| #195 | summary: z.string().optional(), |
| #196 | |
| #197 | |
| #198 | /** |
| #199 | * Token usage statistics for the agent |
| #200 | */ |
| #201 | tokenUsage: z.number(), |
| #202 | }); |
| #203 | |
| #204 | export type ClawdAgent = z.infer<typeof clawdAgentSchema>; |
| #205 | |
| #206 | |
| #207 |