This commit is contained in:
@@ -58,18 +58,6 @@ function validatePiece(piece: any): string | null {
|
||||
if (typeof piece.max_movements !== 'number' || !Number.isFinite(piece.max_movements) || piece.max_movements <= 0) {
|
||||
return 'max_movements is required (positive integer, e.g. 50 for short tasks, 999 for open-ended ones)';
|
||||
}
|
||||
// Piece-level shared tools (union into every movement). Optional; when
|
||||
// present must be an array of non-empty strings. Kept in sync with the
|
||||
// HTTP-layer validator in src/bridge/pieces-api.ts.
|
||||
if (piece.shared_tools !== undefined) {
|
||||
if (!Array.isArray(piece.shared_tools)) return 'shared_tools must be an array';
|
||||
for (let i = 0; i < piece.shared_tools.length; i++) {
|
||||
const t = piece.shared_tools[i];
|
||||
if (typeof t !== 'string' || t.trim().length === 0) {
|
||||
return `shared_tools[${i}] must be a non-empty string`;
|
||||
}
|
||||
}
|
||||
}
|
||||
const names = new Set(piece.movements.map((m: any) => m.name));
|
||||
if (!names.has(piece.initial_movement)) return 'initial_movement must reference an existing movement';
|
||||
// Phase 6b: rules[].next only accepts existing movement names + WAIT_SUBTASKS.
|
||||
@@ -102,7 +90,7 @@ const LIST_PIECES_DEF: ToolDef = {
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'ListPieces',
|
||||
description: '全 Piece(実行テンプレート: ツール制限・movement フロー制御)の一覧を取得する。Skill(参照知識)の一覧は ListSkills を使うこと。新規作成前に必ず実行。詳細は ReadToolDoc({ name: "ListPieces" })。',
|
||||
description: '全 Piece(実行テンプレート: movement フロー制御)の一覧を取得する。Skill(参照知識)の一覧は ListSkills を使うこと。新規作成前に必ず実行。詳細は ReadToolDoc({ name: "ListPieces" })。',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {},
|
||||
@@ -130,7 +118,7 @@ const CREATE_PIECE_DEF: ToolDef = {
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'CreatePiece',
|
||||
description: '新 Piece(実行テンプレート: movement + allowed_tools を定義)を YAML から作成する。Skill の追加には InstallSkill を使うこと。詳細は ReadToolDoc({ name: "CreatePiece" })。',
|
||||
description: '新 Piece(実行テンプレート: movement フロー = persona/instruction/rules を定義)を YAML から作成する。ツールの可否は設定→ツールで決まるため piece には書かない。Skill の追加には InstallSkill を使うこと。詳細は ReadToolDoc({ name: "CreatePiece" })。',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@@ -148,7 +136,7 @@ const UPDATE_PIECE_DEF: ToolDef = {
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'UpdatePiece',
|
||||
description: '既存 Piece を完全な YAML で全体置換する(差分更新ではない)。詳細は ReadToolDoc({ name: "UpdatePiece" })。',
|
||||
description: '既存のカスタム Piece を完全な YAML で全体置換する(差分更新ではない。組み込み Piece は編集不可 — CreatePiece で別名を作ること)。詳細は ReadToolDoc({ name: "UpdatePiece" })。',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user