Repository navigation
Conversation
The use case builder can write a use case out and read one back, so a colleague's work travels as a file. An agent, which takes as much thought to write, could only be described over someone's shoulder. Give it the same two actions. What travels is what describes the agent — the prompt, the model, the servers, whether it may run code. The id, the owner and the star count stay behind: they belong to the copy it was read from, and carrying them would claim something about whoever imports it. A file read back comes from outside, so each field is checked rather than trusted, and an unreadable one says so where the eye already is instead of half-filling the form. codeExecutionEnabled decides whether an agent may run code, so nothing short of a literal true turns it on — a string "true" from a hand-edited file does not.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ユースケースビルダーには JSON でユースケースを書き出す・読み込む機能がありますが、エージェントビルダーにはありません。エージェント定義も同じくらい作り込むものなので、同じ2つの操作を追加します。
変更内容
書き出すのはエージェントを説明する項目だけです。
{ "name": "...", "description": "...", "systemPrompt": "...", "modelId": "...", "mcpServers": ["..."], "codeExecutionEnabled": false }agentId・作成者・お気に入り数は含めていません。元のコピーに属する値で、持ち回ると取り込んだ人について何かを主張することになるためです。ユースケース側の実装も同じ考え方です。読み込むファイルは外部から来るため、各フィールドを型ごとに検証しています。特に
codeExecutionEnabledはコード実行の可否を決めるので、真偽値のtrue以外はfalseとして扱います(手で編集した JSON の"true"で有効になってはいけないため)。読めなかった場合はフォームを中途半端に埋めず、画面上にエラーを表示します。補足
agent_builderの翻訳は ja と en にのみ存在するため、その2言語に追加しました。テスト
packages/web/tests/hooks/agentDefinitionFile.test.tsに11件追加しています。