owner-clone-ai-mcp 1.65.0 → 1.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/domains/knowledge.js +56 -1
- package/domains/skills.js +28 -0
- package/package.json +1 -1
package/domains/knowledge.js
CHANGED
|
@@ -156,9 +156,50 @@ text_content(自由テキスト)か、content(カテゴリ別の構造化
|
|
|
156
156
|
required: ['title'],
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
|
+
{
|
|
160
|
+
name: 'edit_knowledge',
|
|
161
|
+
description: `ナレッジを「部分編集」します(全文の再送不要・変更箇所だけ指定)。【書き込み権限付きキーが必要】
|
|
162
|
+
★一部の文言修正・「◯◯以降を書き換え」・末尾追記・1フィールドだけの差し替えは、update_knowledge(全文差し替え)ではなくこのツールを使うこと。長文でもトークン消費が激減し、編集対象外の箇所が変わる事故が構造的に起きません。保存後は自動で再ベクトル化されます。
|
|
163
|
+
|
|
164
|
+
操作(operations 配列・複数可・上から順に適用。1つでも失敗したら全体を保存しない=安全):
|
|
165
|
+
• replace_text {find, replace}: 完全一致置換。既定は「全体で1件のみ一致」が条件(複数一致はエラー=誤置換防止。全て置換するときだけ replace_all:true)
|
|
166
|
+
• replace_after {anchor, new_text}: anchor はそのまま残し、その直後から末尾までを差し替え
|
|
167
|
+
• replace_between {from_anchor, to_anchor, new_text}: 両anchorは残し、間だけを差し替え
|
|
168
|
+
• append {text}: 末尾に追記(field 省略時は body)
|
|
169
|
+
• set_field {field, value}: 指定フィールドの値だけ差し替え(他フィールドは無改変)
|
|
170
|
+
各操作に field(対象フィールド名)を指定可。省略時は本文系の全文字列フィールドを横断して検索します。画像・資料・配列フィールド(images/files/services等)は対象外(update_knowledge を使用)。
|
|
171
|
+
タグは tags_add / tags_remove で部分更新(既存タグを維持したまま追加・削除)。
|
|
172
|
+
一致0件エラーが出たら get_knowledge_item で現在の本文を確認し、完全一致する文字列を指定し直してください。`,
|
|
173
|
+
annotations: { destructiveHint: false, idempotentHint: false },
|
|
174
|
+
inputSchema: {
|
|
175
|
+
type: 'object',
|
|
176
|
+
properties: {
|
|
177
|
+
id: { type: 'string', description: 'ナレッジのID' },
|
|
178
|
+
operations: {
|
|
179
|
+
type: 'array',
|
|
180
|
+
description: '編集操作の配列(1〜20件)',
|
|
181
|
+
items: {
|
|
182
|
+
type: 'object',
|
|
183
|
+
properties: {
|
|
184
|
+
action: { type: 'string', enum: ['replace_text', 'replace_after', 'replace_between', 'append', 'set_field'] },
|
|
185
|
+
field: { type: 'string', description: '対象フィールド名(省略時: replace系=全文字列フィールド横断 / append=body / set_field=必須)' },
|
|
186
|
+
find: { type: 'string' }, replace: { type: 'string' }, replace_all: { type: 'boolean' },
|
|
187
|
+
anchor: { type: 'string' }, from_anchor: { type: 'string' }, to_anchor: { type: 'string' }, new_text: { type: 'string' },
|
|
188
|
+
text: { type: 'string' }, value: { type: 'string' },
|
|
189
|
+
},
|
|
190
|
+
required: ['action'],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
tags_add: { type: 'array', items: { type: 'string' }, description: '追加するタグ(既存は維持)' },
|
|
194
|
+
tags_remove: { type: 'array', items: { type: 'string' }, description: '削除するタグ' },
|
|
195
|
+
title: { type: 'string', description: '新しいタイトル(省略時は変更なし)' },
|
|
196
|
+
},
|
|
197
|
+
required: ['id'],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
159
200
|
{
|
|
160
201
|
name: 'update_knowledge',
|
|
161
|
-
description: '
|
|
202
|
+
description: '既存のナレッジを更新します(全文差し替え)。★一部だけの修正・追記・特定箇所以降の書き換えは edit_knowledge(部分編集)を使うこと=全文再送不要でトークン激減・編集対象外の箇所が変わる事故も起きない。【書き込み権限付きキーが必要】本文を変更した場合は自動的に再ベクトル化されます。folder_id でフォルダ移動も可能(null で未分類に移動)。content(カテゴリ別構造化オブジェクト)を渡すと構造化保存+本文自動生成(フィールド仕様は必ず get_knowledge_schema(category) で取得)。content で作り直す場合も各フィールドへ分解し要約・省略しないこと。構造化カテゴリ(other/note_* 以外)では全文を text_content や content.body に丸投げしないこと(body は URLインポート等のフォールバック専用)。原文の保全が必要なら全文を content.source_text に入れる(安全網・重複可)。',
|
|
162
203
|
annotations: { destructiveHint: false, idempotentHint: true },
|
|
163
204
|
inputSchema: {
|
|
164
205
|
type: 'object',
|
|
@@ -488,6 +529,20 @@ const handlers = {
|
|
|
488
529
|
return `✅ ${data.message}\nID: ${data.id}\nタイトル: ${data.title}\nカテゴリ: ${data.category}${tagLine}\n作成日時: ${data.created_at}`;
|
|
489
530
|
},
|
|
490
531
|
|
|
532
|
+
// 部分編集(2026-08-14): 変更箇所だけ送る=長文でもトークン消費が激減し、対象外の箇所は物理的に変わらない
|
|
533
|
+
async edit_knowledge(args) {
|
|
534
|
+
const body = {};
|
|
535
|
+
if (Array.isArray(args.operations) && args.operations.length) body.operations = args.operations;
|
|
536
|
+
if (Array.isArray(args.tags_add) && args.tags_add.length) body.tags_add = args.tags_add;
|
|
537
|
+
if (Array.isArray(args.tags_remove) && args.tags_remove.length) body.tags_remove = args.tags_remove;
|
|
538
|
+
if (args.title) body.title = args.title;
|
|
539
|
+
const data = await callApi(`/knowledge/${args.id}`, { method: 'PATCH', body: JSON.stringify(body) });
|
|
540
|
+
const ch = Array.isArray(data.changes) && data.changes.length
|
|
541
|
+
? `\n適用: ${data.changes.map(c => `${c.action}(${(c.fields || []).join(',')})`).join(' / ')}` : '';
|
|
542
|
+
const tagLine = data.tags?.length ? `\nタグ: ${data.tags.join(', ')}` : '';
|
|
543
|
+
return `✅ ${data.message}\nID: ${data.id}\nタイトル: ${data.title}${ch}${tagLine}`;
|
|
544
|
+
},
|
|
545
|
+
|
|
491
546
|
async update_knowledge(args) {
|
|
492
547
|
const body = {};
|
|
493
548
|
if (args.title) body.title = args.title;
|
package/domains/skills.js
CHANGED
|
@@ -277,6 +277,23 @@ Claude Code はその指示を読んで続けて prepare_skill(X) を呼び出
|
|
|
277
277
|
// ────────────────────────────────────────────────────────────────────────────
|
|
278
278
|
// スキルバージョン管理
|
|
279
279
|
// ────────────────────────────────────────────────────────────────────────────
|
|
280
|
+
{
|
|
281
|
+
name: 'invoke_skill',
|
|
282
|
+
description: `スキルをサーバー側で実行し、結果テキストだけを受け取ります(Owner Clone AI 側のAIが処理・あなたのローカルAIのトークンを消費しない)。
|
|
283
|
+
◆ 使い分け: 複雑なスキル・MCPツール指示を含むスキル・ゴール型は prepare_skill(自律実行)を使う。シンプルなテキスト処理を手早く済ませたい時だけ invoke_skill。
|
|
284
|
+
◆ 共有で受け取ったスキルもこのツールで実行できます(prepare_skill でも可)。
|
|
285
|
+
※ サーバー実行のためスキル所有者のAI設定で処理され、prompt_template 内のMCPツール指示は動作しません。`,
|
|
286
|
+
annotations: { destructiveHint: false, idempotentHint: false },
|
|
287
|
+
inputSchema: {
|
|
288
|
+
type: 'object',
|
|
289
|
+
properties: {
|
|
290
|
+
id: { type: 'string', description: 'スキルID(list_skillsで確認。skill_id でも可)' },
|
|
291
|
+
params: { type: 'object', description: 'スキルのパラメータ({name: 値})' },
|
|
292
|
+
version: { type: 'string', description: '実行するバージョン(省略時は現行)' },
|
|
293
|
+
},
|
|
294
|
+
required: ['id'],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
280
297
|
{
|
|
281
298
|
name: 'list_skill_versions',
|
|
282
299
|
description: `スキルのバージョン履歴一覧を取得します。
|
|
@@ -540,6 +557,17 @@ const handlers = {
|
|
|
540
557
|
return `スキルを削除しました(ID: ${id})`;
|
|
541
558
|
},
|
|
542
559
|
|
|
560
|
+
// サーバー実行(2026-08-17追加): 結果テキストのみ受け取る。skill_id 別名も受理
|
|
561
|
+
invoke_skill: async ({ id, skill_id, params = {}, version }) => {
|
|
562
|
+
const r = await callApi(`/skills/${id || skill_id}/invoke`, {
|
|
563
|
+
method: 'POST',
|
|
564
|
+
body: JSON.stringify({ params, version: version || undefined }),
|
|
565
|
+
});
|
|
566
|
+
const out = r.result ?? r.output ?? r.text ?? (typeof r === 'string' ? r : JSON.stringify(r));
|
|
567
|
+
const saved = r.knowledge_item_id ? `\n\n📁 結果はナレッジに保存されました(ID: ${r.knowledge_item_id})` : '';
|
|
568
|
+
return `${out}${saved}`;
|
|
569
|
+
},
|
|
570
|
+
|
|
543
571
|
// BUG-20260811-01対策: 引数名を skill_id と誤って渡された場合も受理(idが正)
|
|
544
572
|
prepare_skill: async ({ id, skill_id, params = {}, version }) => {
|
|
545
573
|
const ctx = await callApi(`/skills/${id || skill_id}/prepare`, {
|