mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Better handling skill depdenencies on ENV VAR. (#9017)
An experimental flow for env var skill dependencies. Skills can now declare required env vars in SKILL.md; if missing, the CLI prompts the user to get the value, and Core will store it in memory (eventually to a local persistent store) <img width="790" height="169" alt="image" src="https://github.com/user-attachments/assets/cd928918-9403-43cb-a7e7-b8d59bcccd9a" />
This commit is contained in:
1 parent
b7f26d74f0
commit
bdd8a7d58b
15 files changed
+289
-2
No files matched your search
@@ -1146,6 +1146,22 @@ impl StatefulWidgetRef for &TextArea {
|
||||
}
|
||||
|
||||
impl TextArea {
|
||||
pub(crate) fn render_ref_masked(
|
||||
&self,
|
||||
area: Rect,
|
||||
buf: &mut Buffer,
|
||||
state: &mut TextAreaState,
|
||||
mask_char: char,
|
||||
) {
|
||||
let lines = self.wrapped_lines(area.width);
|
||||
let scroll = self.effective_scroll(area.height, &lines, state.scroll);
|
||||
state.scroll = scroll;
|
||||
|
||||
let start = scroll as usize;
|
||||
let end = (scroll + area.height).min(lines.len() as u16) as usize;
|
||||
self.render_lines_masked(area, buf, &lines, start..end, mask_char);
|
||||
}
|
||||
|
||||
fn render_lines(
|
||||
&self,
|
||||
area: Rect,
|
||||
@@ -1175,6 +1191,26 @@ impl TextArea {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn render_lines_masked(
|
||||
&self,
|
||||
area: Rect,
|
||||
buf: &mut Buffer,
|
||||
lines: &[Range<usize>],
|
||||
range: std::ops::Range<usize>,
|
||||
mask_char: char,
|
||||
) {
|
||||
for (row, idx) in range.enumerate() {
|
||||
let r = &lines[idx];
|
||||
let y = area.y + row as u16;
|
||||
let line_range = r.start..r.end - 1;
|
||||
let masked = self.text[line_range.clone()]
|
||||
.chars()
|
||||
.map(|_| mask_char)
|
||||
.collect::<String>();
|
||||
buf.set_string(area.x, y, &masked, Style::default());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user