From 769167da54e4a1f2481b2458033e449e31790503 Mon Sep 17 00:00:00 2001 From: CanisMinor Date: Thu, 19 Oct 2023 03:50:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20Update=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 2 + README.md | 72 +++++++++++++++++++++++++++++++--- README.zh-CN.md | 72 +++++++++++++++++++++++++++++++--- schema/lobeAgentSchema_v1.json | 67 +------------------------------ scripts/const.ts | 4 -- scripts/updateAwesome.ts | 13 ++++-- 6 files changed, 144 insertions(+), 86 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29524ee37..5328afcf7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,8 @@ jobs: - name: Prettier run: | + echo "module.exports = require('@lobehub/lint').remarklint;" >> .remarkrc.cjs + bun run lint:md echo "module.exports = require('@lobehub/lint').prettier;" >> .prettierrc.cjs bun run prettier diff --git a/README.md b/README.md index 3dd94ce32..b00c7d1d4 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Please play the role of a copywriter and help me name some designs/artworks. The +--- + ### Xiaohongshu Style Copywriter > By **[@guowc3456](/~https://github.com/guowc3456)** on **2023-10-11** @@ -105,6 +107,8 @@ You are a Xiaohongshu blogger, and your task is to generate Xiaohongshu-style co +--- + ### GPT Agent Prompt Optimization Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-10-07** @@ -133,6 +137,8 @@ A typical structured prompt is as follows: +--- + ### English News Translation Expert > By **[@宝玉](https://twitter.com/dotey)** on **2023-10-07** @@ -159,6 +165,8 @@ I will send you the complete content of the next message. Please print the two t +--- + ### C++ Code > By **[@dcityteg](/~https://github.com/dcityteg)** on **2023-10-06** @@ -174,6 +182,8 @@ Please complete the C++ question provided by the user in the following responses +--- + ### TS Type Definition Completion > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-10-01** @@ -235,6 +245,8 @@ Next, the user will enter a string of interface code, and you need to complete t +--- + ### LOGO Creative Master > By **[@yingxirz](/~https://github.com/yingxirz)** on **2023-09-29** @@ -250,6 +262,8 @@ Please play the role of a brand creative master, providing guidance and suggesti +--- + ### Interface Type Request Generator > By **[@laikedou](/~https://github.com/laikedou)** on **2023-09-27** @@ -280,6 +294,8 @@ export const methodApiDescApi = (params: IApiDescParams) => { +--- + ### Name Master > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-11** @@ -295,6 +311,8 @@ You are a naming expert. The names need to have a certain sense of technology an +--- + ### Title Expansion Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -310,6 +328,8 @@ You are a UX Writer skilled in title expansion. Users will input a title, and yo +--- + ### Frontend TypeScript Unit Testing Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -460,6 +480,8 @@ export const messagesReducer = ( +--- + ### Dva Refactor Zustand Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -536,6 +558,8 @@ export const useDSList = create((set, get) => ({ +--- + ### Information Organizer > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -553,6 +577,8 @@ After gathering a certain amount of information, you will provide a summary. All +--- + ### Web Content Summarization Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -568,6 +594,8 @@ The user will enter a URL, and you need to summarize the content of that URL in +--- + ### Master of Expressing Abstract Concepts > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -600,6 +628,8 @@ Blueprint, Template, Toolbox, Book, Palette +--- + ### Front-end Development Architect > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -615,6 +645,8 @@ You are a front-end architect, skilled in thinking about how to implement relate +--- + ### JS to TS Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -630,6 +662,8 @@ You are a frontend expert. Please convert the code below to TS without modifying +--- + ### Zustand Reducer Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -778,6 +812,8 @@ No usage example is required. +--- + ### Convert React Class Components to Functional Components > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -793,6 +829,8 @@ You are a frontend expert, specializing in refactoring React Class components to +--- + ### UX Writer > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -814,6 +852,8 @@ Output: Sorry, your requests are too many, the server is a bit tired, please try +--- + ### UX Writer > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -835,6 +875,8 @@ Output: Easily manage icon resources, upload locally or import from iconfont, an +--- + ### API Documentation Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -907,6 +949,8 @@ export default Demo; +--- + ### Deep Think > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-08** @@ -930,6 +974,8 @@ Please revise your responses using the following format: +--- + ### Markdown Product Feature Formatting Expert > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-08** @@ -952,6 +998,8 @@ Please format the input text features as follows: +--- + ### Coding Wizard > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -987,6 +1035,8 @@ Let's begin! Please provide any extra information necessary for my understanding +--- + ### Agent Prompt Improver > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1002,6 +1052,8 @@ Expert in GPT Agent Prompt optimization, please revise the following prompt. It +--- + ### Business Email > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1017,6 +1069,8 @@ As a business email writing expert, the user will provide recipient and other re +--- + ### Character Roleplay > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1049,6 +1103,8 @@ Your aim is to create a realistic and compelling portrayal of the character usin +--- + ### Startup Plan > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1064,6 +1120,8 @@ Create digital startup concepts reflecting public desires. For instance, if I sa +--- + ### Grammar Corrector > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1079,6 +1137,8 @@ As a grammar-checking AI, your task is to correct user inputs to ensure grammati +--- + ### Essay Improver > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1096,6 +1156,8 @@ Begin with clear, accurate instructions. Include precise details about the conte +--- + ### Web Development > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1111,6 +1173,8 @@ As a full-stack web developer, your role involves designing, developing, and mai +--- + ### Resume Editing > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1126,6 +1190,8 @@ As a resume editor, reviewing my current resume for errors or improvements. Iden +--- + ### Stable Diffusion Prompt Expert > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-01** @@ -1182,12 +1248,6 @@ Cartoon, 3D, disfigured, bad art, deformed, extra limbs, close-up, black and whi -
- -[![][back-to-top]](#readme-top) - -
- ## 🛳 Self Hosting If you want to deploy this service by yourself, you can follow the steps below. diff --git a/README.zh-CN.md b/README.zh-CN.md index e5ed2dd81..e74b68dcb 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -90,6 +90,8 @@ +--- + ### 小红书风格文案写手 > By **[@guowc3456](/~https://github.com/guowc3456)** on **2023-10-11** @@ -105,6 +107,8 @@ +--- + ### Agent Prompt 优化专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-10-07** @@ -133,6 +137,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 英文新闻翻译专家 > By **[@宝玉](https://twitter.com/dotey)** on **2023-10-07** @@ -159,6 +165,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### C++ 代码 > By **[@dcityteg](/~https://github.com/dcityteg)** on **2023-10-06** @@ -174,6 +182,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### TS 类型定义补全 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-10-01** @@ -235,6 +245,8 @@ interface Props { +--- + ### LOGO 创意大师 > By **[@yingxirz](/~https://github.com/yingxirz)** on **2023-09-29** @@ -250,6 +262,8 @@ interface Props { +--- + ### 接口类型请求生成器 > By **[@laikedou](/~https://github.com/laikedou)** on **2023-09-27** @@ -280,6 +294,8 @@ export const methodApiDescApi = (params: IApiDescParams) => { +--- + ### 起名大师 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-11** @@ -294,6 +310,8 @@ export const methodApiDescApi = (params: IApiDescParams) => { +--- + ### 标题扩写专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -308,6 +326,8 @@ export const methodApiDescApi = (params: IApiDescParams) => { +--- + ### 前端 TypeScript 单测专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -454,6 +474,8 @@ export const messagesReducer = ( +--- + ### Dva 重构 Zustand 专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -530,6 +552,8 @@ export const useDSList = create((set, get) => ({ +--- + ### 信息整理大师 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -546,6 +570,8 @@ export const useDSList = create((set, get) => ({ +--- + ### 网页内容总结专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -560,6 +586,8 @@ export const useDSList = create((set, get) => ({ +--- + ### 抽象概念实体化表达大师 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -591,6 +619,8 @@ export const useDSList = create((set, get) => ({ +--- + ### 前端研发架构师 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -605,6 +635,8 @@ export const useDSList = create((set, get) => ({ +--- + ### JS 代码转 TS 专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -619,6 +651,8 @@ export const useDSList = create((set, get) => ({ +--- + ### Zustand reducer 专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -766,6 +800,8 @@ export const messagesReducer = ( +--- + ### React Class 组件转 FC 组件 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -780,6 +816,8 @@ export const messagesReducer = ( +--- + ### UX Writer > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -801,6 +839,8 @@ export const messagesReducer = ( +--- + ### UX Writer > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -821,6 +861,8 @@ export const messagesReducer = ( +--- + ### API 文档优化专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-10** @@ -891,6 +933,8 @@ export default Demo; +--- + ### 深度思考 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-08** @@ -914,6 +958,8 @@ export default Demo; +--- + ### Markdown 产品特性格式化专家 > By **[@arvinxx](/~https://github.com/arvinxx)** on **2023-09-08** @@ -936,6 +982,8 @@ export default Demo; +--- + ### 编码巫师 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -971,6 +1019,8 @@ export default Demo; +--- + ### 助手提示词优化 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -986,6 +1036,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 商务邮件 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1001,6 +1053,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 角色扮演 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1033,6 +1087,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 创业计划 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1048,6 +1104,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 语法校正器 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1063,6 +1121,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 英文学术润色 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1080,6 +1140,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### Web 全栈工程师 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1095,6 +1157,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### 简历优化 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-07** @@ -1110,6 +1174,8 @@ GPT Agent Prompt 优化专家,优化用户提供的 Prompt 提示词,使其 +--- + ### Stable Diffusion 提示词专家 > By **[@canisminor1990](/~https://github.com/canisminor1990)** on **2023-09-01** @@ -1163,12 +1229,6 @@ Cartoon, 3D, disfigured, bad art, deformed, extra limbs, close-up, black and whi -
- -[![][back-to-top]](#readme-top) - -
- ## 🛳 自主托管 如果您想自己部署此服务,可以按照以下步骤操作 diff --git a/schema/lobeAgentSchema_v1.json b/schema/lobeAgentSchema_v1.json index 5a21a0e93..223493ef7 100644 --- a/schema/lobeAgentSchema_v1.json +++ b/schema/lobeAgentSchema_v1.json @@ -1,66 +1 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, - "properties": { - "author": { "type": "string" }, - "config": { - "type": "object", - "properties": { - "compressThreshold": { "type": "number" }, - "displayMode": { "type": "string", "enum": ["chat", "docs"] }, - "enableCompressThreshold": { "type": "boolean" }, - "enableHistoryCount": { "type": "boolean" }, - "enableMaxTokens": { "type": "boolean" }, - "fewShots": { - "type": "array", - "items": { - "type": "object", - "properties": { - "content": { "type": "string" }, - "role": { "type": "string", "enum": ["user", "system", "assistant", "function"] } - }, - "required": ["content", "role"], - "additionalProperties": false - } - }, - "historyCount": { "type": "number" }, - "inputTemplate": { "type": "string" }, - "model": { "type": "string", "default": "gpt-3.5-turbo" }, - "params": { - "type": "object", - "properties": { - "frequency_penalty": { "type": "number", "default": 0 }, - "max_tokens": { "type": "number" }, - "presence_penalty": { "type": "number", "default": 0 }, - "temperature": { "type": "number", "default": 0 }, - "top_p": { "type": "number", "default": 1 } - }, - "additionalProperties": false - }, - "plugins": { "type": "array", "items": { "type": "string" } }, - "systemRole": { "type": "string" } - }, - "required": ["systemRole"], - "additionalProperties": false - }, - "createAt": { "type": "string" }, - "examples": { "$ref": "#/properties/config/properties/fewShots" }, - "homepage": { "type": "string" }, - "identifier": { "type": "string" }, - "meta": { - "type": "object", - "properties": { - "avatar": { "type": "string" }, - "backgroundColor": { "type": "string" }, - "description": { "type": "string" }, - "tags": { "type": "array", "items": { "type": "string" } }, - "title": { "type": "string" } - }, - "required": ["avatar", "description", "tags", "title"], - "additionalProperties": false - }, - "schemaVersion": { "type": "number" } - }, - "required": ["author", "config", "createAt", "homepage", "identifier", "meta", "schemaVersion"], - "type": "object" - } \ No newline at end of file +{"type":"object","properties":{"author":{"type":"string"},"config":{"type":"object","properties":{"compressThreshold":{"type":"number"},"displayMode":{"type":"string","enum":["chat","docs"]},"enableCompressThreshold":{"type":"boolean"},"enableHistoryCount":{"type":"boolean"},"enableMaxTokens":{"type":"boolean"},"fewShots":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"role":{"type":"string","enum":["user","system","assistant","function"]}},"required":["content","role"],"additionalProperties":false}},"historyCount":{"type":"number"},"inputTemplate":{"type":"string"},"model":{"type":"string","default":"gpt-3.5-turbo"},"params":{"type":"object","properties":{"frequency_penalty":{"type":"number","default":0},"max_tokens":{"type":"number"},"presence_penalty":{"type":"number","default":0},"temperature":{"type":"number","default":0},"top_p":{"type":"number","default":1}},"additionalProperties":false},"plugins":{"type":"array","items":{"type":"string"}},"systemRole":{"type":"string"}},"required":["systemRole"],"additionalProperties":false},"createAt":{"type":"string"},"examples":{"$ref":"#/properties/config/properties/fewShots"},"homepage":{"type":"string"},"identifier":{"type":"string"},"meta":{"type":"object","properties":{"avatar":{"type":"string"},"backgroundColor":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":"string"}},"required":["avatar","description","tags","title"],"additionalProperties":false},"schemaVersion":{"type":"number"}},"required":["author","config","createAt","homepage","identifier","meta","schemaVersion"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"} diff --git a/scripts/const.ts b/scripts/const.ts index 1983ee519..198840b10 100644 --- a/scripts/const.ts +++ b/scripts/const.ts @@ -19,16 +19,12 @@ export const templatePath = resolve(root, 'agent-template.json'); export const templateFullPath = resolve(root, 'agent-template-full.json'); export const indexPath = resolve(publicDir, 'index.json') -export const index = readJSONSync(indexPath); export const indexCnPath = resolve(publicDir, 'index.zh-CN.json') -export const indexCn = readJSONSync(indexCnPath); export const readmePath = resolve(root, 'README.md') -export const readme = readFileSync(readmePath, 'utf-8'); export const readmeCnPath = resolve(root, 'README.zh-CN.md') -export const readmeCn = readFileSync(readmeCnPath, 'utf-8'); export const metaPath = resolve(root, 'meta.json'); export const meta = readJSONSync(metaPath); diff --git a/scripts/updateAwesome.ts b/scripts/updateAwesome.ts index fe3163cd5..2787577bf 100644 --- a/scripts/updateAwesome.ts +++ b/scripts/updateAwesome.ts @@ -1,20 +1,21 @@ -import { readme, readmePath, readmeCn, readmeCnPath, index, indexCn, publicDir } from './const'; import { readJSONSync } from 'fs-extra'; -import { writeFileSync } from 'fs'; +import { writeFileSync, readFileSync } from 'node:fs'; import { resolve } from 'node:path'; + +import { indexPath, readmePath, indexCnPath, readmeCnPath, publicDir } from './const'; import { updateAwesomeReadme } from './utils' const updateAwesome = (filePath: string, md: string, agents, locale?: string) => { const data = [] - agents.forEach(({identifier, author, createAt, homepage}) => { + agents.forEach(({identifier, author, createAt, homepage}, i) => { const agentConfigPath = resolve(publicDir, [identifier,locale,'json'].filter(Boolean).join('.')) const { config, meta } = readJSONSync(agentConfigPath) const header = `### ${meta.title}` const subHeader = `> By **[@${author}](${homepage})** on **${createAt}**` const content = ['```md', config.systemRole.replaceAll('`', '\\`'), '```'].join('\n') - const body = [header,subHeader,content, `
\n\n[![][back-to-top]](#readme-top)\n\n
`].join('\n\n') + const body = [i !== 0 ? '---' : false, header,subHeader,content, `
\n\n[![][back-to-top]](#readme-top)\n\n
`].filter(Boolean).join('\n\n') data.push(body) }) @@ -24,6 +25,10 @@ const updateAwesome = (filePath: string, md: string, agents, locale?: string) => } const runUpdateAwesome = () => { + const readmeCn = readFileSync(readmeCnPath, 'utf-8'); + const readme = readFileSync(readmePath, 'utf-8'); + const index = readJSONSync(indexPath); + const indexCn = readJSONSync(indexCnPath); updateAwesome(readmePath, readme, index.agents); updateAwesome(readmeCnPath, readmeCn, indexCn.agents, 'zh-CN') }