objective: add read tools

This commit is contained in:
2026-07-26 02:21:22 +09:00
parent 2200f60b94
commit 18b5cead7a
9 changed files with 352 additions and 2 deletions
+23
View File
@@ -630,6 +630,29 @@ where
let workspace_client = worker.workspace_client().clone();
let worker = worker.engine_mut();
// Objective tools expose read-only project Objective context through the
// Backend Workspace API. Workers must not guess local `.yoi/objectives`
// paths or read Objective files directly.
if feature_config.objective.enabled {
if let WorkspaceClient::Http {
workspace_id,
base_url,
} = &workspace_client
{
for definition in crate::feature::builtin::objective::workspace_http_objective_tools(
workspace_id.clone(),
base_url.clone(),
) {
worker.register_tool(definition);
}
} else {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
"objective tools require Backend Workspace API authority",
));
}
}
// Memory tools require explicit feature exposure. Workspace memory access
// is authority-bound to the Backend Workspace API; the Worker must not
// register local filesystem memory tools even when it has local cwd/root