This commit is contained in:
@@ -3,10 +3,11 @@
|
||||
*
|
||||
* When an agent realises it needs a tool that this movement does not expose,
|
||||
* it calls RequestTool({ name, reason }). The request is recorded so the gap
|
||||
* becomes visible in the task detail and per-piece aggregation, letting the
|
||||
* piece author add the tool to `allowed_tools` / `shared_tools`. This PR
|
||||
* (recording infra) does NOT grant the tool — it records and guides. The
|
||||
* inline approval/grant flow is layered on top in a later PR.
|
||||
* becomes visible in the task detail and per-piece aggregation, so an operator
|
||||
* can enable the tool for the workspace (Settings → Tools). When the run can
|
||||
* reach a user, the interactive approval path (`toolApprovalInteractive`)
|
||||
* pauses for consent and lets the run continue with the tool once approved;
|
||||
* otherwise the request is recorded and the agent proceeds without it.
|
||||
*
|
||||
* Classification (recorded as `category`):
|
||||
* - already_available → the tool IS exposed here; just call it (not recorded).
|
||||
@@ -27,7 +28,7 @@ const REQUEST_TOOL_DEF: ToolDef = {
|
||||
function: {
|
||||
name: 'RequestTool',
|
||||
description:
|
||||
'この movement に無いツールがどうしても必要なときに要求する。name と理由(reason)を渡すと記録され、ピース作者が allowed_tools / shared_tools に追加できる。要求しても今すぐ使えるようにはならない — 無しで進めるか、無理なら complete({status:"needs_user_input"}) でユーザーに依頼すること。詳細は ReadToolDoc({ name: "RequestTool" })。',
|
||||
'この movement に無いツールが必要なとき name と理由(reason)を渡して要求する。ユーザーが応答できる実行では承認を求め、承認されればそのまま使える。それ以外は記録のみで即時には使えないので、無しで進めるか complete({status:"needs_user_input"}) でユーザーに依頼する(恒久的に許可するにはワークスペースの設定 → ツールで有効化)。詳細は ReadToolDoc({ name: "RequestTool" })。',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@@ -103,7 +104,7 @@ export async function executeTool(
|
||||
output:
|
||||
`"${toolName}" はこの movement では許可されていないため使えません(要求を記録しました)。` +
|
||||
` このツール無しで進めるか、達成できない場合は complete({status:"needs_user_input", missing_info:"..."}) でユーザーに依頼してください。` +
|
||||
` ピースの allowed_tools / shared_tools に追加すると次回から使えます。`,
|
||||
` ワークスペースの設定(設定 → ツール)で許可すると次回から使えます。`,
|
||||
isError: false,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user