sync: update from private repo (edc775f2)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-07-06 01:04:12 +00:00
parent 747377bef9
commit b1292e34b2
322 changed files with 28001 additions and 4686 deletions
+62 -2
View File
@@ -209,6 +209,33 @@ async function getMissionModule(): Promise<ToolModule | null> {
return _missionModule;
}
let _taskConversationModule: ToolModule | null | undefined;
async function getTaskConversationModule(): Promise<ToolModule | null> {
if (_taskConversationModule === undefined) {
_taskConversationModule = await tryLoadModule('./task-conversation.js');
if (_taskConversationModule) logger.debug('[tools/index] task-conversation module loaded');
}
return _taskConversationModule;
}
let _workspaceTaskSearchModule: ToolModule | null | undefined;
async function getWorkspaceTaskSearchModule(): Promise<ToolModule | null> {
if (_workspaceTaskSearchModule === undefined) {
_workspaceTaskSearchModule = await tryLoadModule('./workspace-task-search.js');
if (_workspaceTaskSearchModule) logger.debug('[tools/index] workspace-task-search module loaded');
}
return _workspaceTaskSearchModule;
}
let _fileProvenanceModule: ToolModule | null | undefined;
async function getFileProvenanceModule(): Promise<ToolModule | null> {
if (_fileProvenanceModule === undefined) {
_fileProvenanceModule = await tryLoadModule('./file-provenance.js');
if (_fileProvenanceModule) logger.debug('[tools/index] file-provenance module loaded');
}
return _fileProvenanceModule;
}
let _toolRequestModule: ToolModule | null | undefined;
async function getToolRequestModule(): Promise<ToolModule | null> {
if (_toolRequestModule === undefined) {
@@ -354,6 +381,15 @@ export async function getToolDefs(
const missionMod = await getMissionModule();
if (missionMod) Object.assign(allDefs, missionMod.TOOL_DEFS);
const taskConversationMod = await getTaskConversationModule();
if (taskConversationMod) Object.assign(allDefs, taskConversationMod.TOOL_DEFS);
const workspaceTaskSearchMod = await getWorkspaceTaskSearchModule();
if (workspaceTaskSearchMod) Object.assign(allDefs, workspaceTaskSearchMod.TOOL_DEFS);
const fileProvenanceMod = await getFileProvenanceModule();
if (fileProvenanceMod) Object.assign(allDefs, fileProvenanceMod.TOOL_DEFS);
const userFolderMod = await getUserFolderModule();
if (userFolderMod) Object.assign(allDefs, userFolderMod.TOOL_DEFS);
@@ -396,7 +432,7 @@ export async function getToolDefs(
// tools as `unknown`.
_allKnownToolNames = Object.keys(allDefs);
// メタツール: piece の allowed_tools に書かれていなくても常に利用可能
// メタツール: ワークスペースのツール設定に関係なく常に利用可能
// - ReadToolDoc: 全ツールのドキュメント参照
// - CreateChecklist / CheckItem / GetChecklist: 進捗管理 (複数ステップタスクで使用)
// - MissionUpdate: タスクの目標 / 進捗のピン止めメモを更新 (会話が長くなって
@@ -408,7 +444,7 @@ export async function getToolDefs(
// - ReadAppDoc / ListAppDocs / GetMyOrchestratorState: Help アシスタント用 (#help piece)
// ただし他の piece からも参照できるようにメタ扱い
// - RequestTool: 足りないツールの要求を記録(タスク詳細/ピース集計で可視化)
const META_TOOLS = ['ReadToolDoc', 'CreateChecklist', 'CheckItem', 'GetChecklist', 'MissionUpdate', 'ListUserAssets', 'RunUserScript', 'UpdateUserMemory', 'ReadUserMemory', 'ReadUserAgents', 'UpdateUserAgents', 'WriteUserScript', 'Brainstorm', 'ReadAppDoc', 'ListAppDocs', 'GetMyOrchestratorState', 'ReadSkill', 'ListSkills', 'InstallSkill', 'RequestTool'];
const META_TOOLS = ['ReadToolDoc', 'CreateChecklist', 'CheckItem', 'GetChecklist', 'MissionUpdate', 'SearchTaskConversation', 'ReadTaskConversation', 'SearchWorkspaceTasks', 'GetFileProvenance', 'ListWorkspaceFiles', 'ListUserAssets', 'RunUserScript', 'UpdateUserMemory', 'ReadUserMemory', 'ReadUserAgents', 'UpdateUserAgents', 'WriteUserScript', 'Brainstorm', 'ReadAppDoc', 'ListAppDocs', 'GetMyOrchestratorState', 'ReadSkill', 'ListSkills', 'InstallSkill', 'RequestTool'];
const effectiveAllowed = [...allowedTools];
for (const meta of META_TOOLS) {
if (!effectiveAllowed.includes(meta) && meta in allDefs) {
@@ -465,6 +501,9 @@ async function executeToolInner(
jobId: ctxWithMcp.jobId ?? '',
config: ctxWithMcp.mcpConfig,
quotaState: ctxWithMcp.mcpQuotaState,
// Job cancel/deadline signal so a slow/hung MCP server is interrupted
// instead of pinning the worker slot past the deadline.
abortSignal: ctx.abortSignal,
// Per-space isolation guard (defense in depth). undefined = legacy
// NULL-space job → only NULL-space servers are callable.
spaceId: ctx.spaceId ?? null,
@@ -605,6 +644,27 @@ async function executeToolInner(
if (missionResult !== null) return missionResult;
}
// task-conversation ツール (SearchTaskConversation / ReadTaskConversation)
const taskConversationMod = await getTaskConversationModule();
if (taskConversationMod) {
const taskConversationResult = await taskConversationMod.executeTool(name, input, ctx);
if (taskConversationResult !== null) return taskConversationResult;
}
// workspace-task-search ツール (SearchWorkspaceTasks)
const workspaceTaskSearchMod2 = await getWorkspaceTaskSearchModule();
if (workspaceTaskSearchMod2) {
const r = await workspaceTaskSearchMod2.executeTool(name, input, ctx);
if (r !== null) return r;
}
// file-provenance ツール (GetFileProvenance / ListWorkspaceFiles)
const fileProvenanceMod = await getFileProvenanceModule();
if (fileProvenanceMod) {
const fileProvenanceResult = await fileProvenanceMod.executeTool(name, input, ctx);
if (fileProvenanceResult !== null) return fileProvenanceResult;
}
// RequestTool: 足りないツールの要求を記録。分類用に既知ツール一覧を注入する
// (getToolDefs が movement 開始時に更新した最新スナップショット)。
const toolRequestMod = await getToolRequestModule();