Synced from monorepo
Synced from monorepo Changes: - Workspace server: report `/ready` as failed with dwell on hub connect failure - Refresh OIDC token for the Grok agent in the shell - ACP terminal output recorder - Cross-platform provider auth commands in the shell - Default `/resume` to Grok sessions with a hint for hidden external sessions - Resume sessions by title with `--resume` - Limit app-builder archive size - Data-driven tag labels for slash commands - Doctor fixes for tmux - Custom provider gateways and subprocess environment policy in the shell - `/tutorial` — opt-in onboarding tour of Grok Build - Soft and required CLI version checks in the shell - Privacy banner env overrides survive live settings updates - Add remote flag to override the image-edit model - Return profile fields from auth info even when the access token is expired - Add edit control on queued prompt rows - Keep fail-closed policy when clearing orphans with no team - Setting to disable the Ctrl+Space/F8 voice shortcut - Pass `--raw` to pw-record so Linux dictation works on older PipeWire - Validate git URLs when adding marketplace entries - Stop shipping stale tool-doc parameter and tool names - Re-point dashboard attach after `/fork` only when the parent was attached - Surface Grok Computer media-generation results as file-path chunks - Clear web background-task tray on kill and keep the task description - Show privacy upsell banner in agent view until acted on - Add tools-server client callback surface - Protect persistent global hook sources Source-Revision: 95d84f443eddcbed6cbfd6eed22e2eafe6b3939d
This commit is contained in:
parent
a5727c5960
commit
69f0ba880a
286 changed files with 22939 additions and 9624 deletions
|
|
@ -271,6 +271,8 @@ fn load_hooks_from_directory(dir: &Path) -> (Vec<HookSpec>, Vec<HookError>) {
|
|||
let mut specs = Vec::new();
|
||||
let mut errors = Vec::new();
|
||||
|
||||
// Best-effort listing: a bad dirent is recorded and skipped so sibling
|
||||
// hooks still load. (Sandbox fail-closed listing lives in xai_grok_config.)
|
||||
let entries = match std::fs::read_dir(dir) {
|
||||
Ok(e) => e,
|
||||
Err(e) => {
|
||||
|
|
@ -285,7 +287,7 @@ fn load_hooks_from_directory(dir: &Path) -> (Vec<HookSpec>, Vec<HookError>) {
|
|||
}
|
||||
};
|
||||
|
||||
let mut json_files: Vec<std::path::PathBuf> = Vec::new();
|
||||
let mut json_files = Vec::new();
|
||||
for entry in entries {
|
||||
let entry = match entry {
|
||||
Ok(e) => e,
|
||||
|
|
@ -297,9 +299,11 @@ fn load_hooks_from_directory(dir: &Path) -> (Vec<HookSpec>, Vec<HookError>) {
|
|||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
let path = entry.path();
|
||||
if !is_valid_hook_file(&path) {
|
||||
let Some(name) = path.file_name().and_then(|n| n.to_str()) else {
|
||||
continue;
|
||||
};
|
||||
if !xai_grok_config::is_direct_hook_json_name(name) || !path.is_file() {
|
||||
continue;
|
||||
}
|
||||
json_files.push(path);
|
||||
|
|
@ -330,21 +334,12 @@ fn load_hooks_from_directory(dir: &Path) -> (Vec<HookSpec>, Vec<HookError>) {
|
|||
}
|
||||
|
||||
/// Check whether a path is a valid hook file (*.json, not hidden/temp).
|
||||
#[cfg(test)]
|
||||
fn is_valid_hook_file(path: &Path) -> bool {
|
||||
let Some(name) = path.file_name().and_then(|n| n.to_str()) else {
|
||||
return false;
|
||||
};
|
||||
|
||||
if path.extension().and_then(|e| e.to_str()) != Some("json") {
|
||||
return false;
|
||||
}
|
||||
if name.starts_with('.') {
|
||||
return false;
|
||||
}
|
||||
if name.ends_with('~') || name.ends_with(".swp") || name.ends_with(".swo") {
|
||||
return false;
|
||||
}
|
||||
path.is_file()
|
||||
xai_grok_config::is_direct_hook_json_name(name) && path.is_file()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue