Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ hand. Projects are saved as `.screenforge` packages.
SRT and WebVTT export.
- **Camera smarts**: on-device face tracking keeps you centred; DaVinci Resolve style colour
grading and `.cube` LUTs.
- **Details for publishing**: every export writes a title, a description (ending with the
chapters) and tags beside the video (`Demo.details.txt`) and shows them to copy. With the agent
on, Claude writes them from the transcript while the video renders; otherwise they come from
the project name, the opening words and the chapter titles.

## Async video and Loom

- **Share links** (Pro) make ScreenForge an async video tool: Export uploads the video and lists
the page link, the MP4, Markdown with the poster (GitHub, Notion) and an HTML embed, each with
a copy button. Exporting again keeps the same link.
- **Import from Loom**: paste a `loom.com/share/…` link in the New project window (or run
`sf import <link>`). The video is downloaded and becomes a project named after its Loom title.
Public videos only ("anyone with the link"), and not ones whose owner turned downloads off.
Loom's camera bubble is part of its picture, so it comes in with the screen.

Captions, on-device narration and face tracking run locally; the agent runs on Claude and the
ElevenLabs voices on ElevenLabs, both through the ScreenForge backend (see `site/privacy.html` for what is sent).
Expand Down
34 changes: 33 additions & 1 deletion apps/sf-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ enum Cmd {
Chapters { path: PathBuf },
/// Re-save a package (useful to migrate v3 → v4 on disk). Writes project.json.bak first.
Resave { path: PathBuf },
/// Copy a .screenstudio package into a folder as a .screenforge package (the original is untouched)
/// Copy a .screenstudio package into a folder as a .screenforge package (the original is
/// untouched), or download a public Loom video (a loom.com/share/… link) as a new project
Import {
path: PathBuf,
/// Destination folder (default: ~/ScreenForge Projects)
Expand Down Expand Up @@ -185,6 +186,11 @@ fn main() -> Result<()> {
if modified(&txt).zip(modified(&result)).is_some_and(|(t, v)| t >= v) {
eprintln!("wrote {} (chapters for a YouTube description)", txt.display());
}
// title, description and tags from the template (the app asks Claude when AI is on)
let details = sf_engine::details::template(&sf_export::details_input(&session, opts.range_ms));
let dtxt = sf_export::details_txt_path(&result);
std::fs::write(&dtxt, details.to_text())?;
eprintln!("wrote {} (title, description and tags)", dtxt.display());
Ok(())
}
Cmd::Presets { folder } => {
Expand Down Expand Up @@ -277,6 +283,12 @@ fn main() -> Result<()> {
println!("saved {} (migrated: {})", path.display(), pkg.migrated);
Ok(())
}
Cmd::Import { path, to } if sf_recording::loom::is_link(&path.to_string_lossy()) => {
let folder = to.unwrap_or_else(sf_session::create::default_projects_folder);
let dest = import_loom(&path.to_string_lossy(), &folder)?;
println!("imported {} as {}", path.display(), dest.display());
Ok(())
}
Cmd::Import { path, to } => {
let folder = to.unwrap_or_else(sf_session::create::default_projects_folder);
let dest = sf_project::package::import_screen_studio(&path, &folder)?;
Expand All @@ -291,6 +303,26 @@ fn main() -> Result<()> {
}
}

/// Download a Loom share link and make a project of it in `folder` (named after the video).
fn import_loom(link: &str, folder: &std::path::Path) -> Result<PathBuf> {
let cancel = std::sync::atomic::AtomicBool::new(false);
let work = std::env::temp_dir().join(format!("sf-loom-{}-{}", std::process::id(), chrono::Local::now().format("%Y%m%d%H%M%S")));
let result = (|| -> Result<PathBuf> {
let file = sf_recording::loom::download(link, &work.join("download"), |f| {
eprint!("\rdownloading {:5.1}%", f * 100.0);
let _ = std::io::stderr().flush();
}, &cancel)?;
eprintln!();
let name = file.file_stem().map(|s| s.to_string_lossy().into_owned()).unwrap_or_else(|| "Loom video".into());
let rec = work.join("recording");
sf_recording::import::import_video(&file, &rec, |_| {}, &cancel)?;
let opts = sf_session::create::CreateOptions { name, projects_folder: folder.to_path_buf(), default_config: None, create_automatic_zooms: false, markers_ms: vec![], device_mockup: false };
Ok(sf_session::create::create_project_from_recording(&rec, opts)?.path)
})();
let _ = std::fs::remove_dir_all(&work);
result
}

fn inspect(path: &std::path::Path, json: bool) -> Result<()> {
let pkg = sf_project::ProjectPackage::open(path)?;
if json {
Expand Down
13 changes: 13 additions & 0 deletions apps/studio/src/agent_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ fn route() -> Result<Route, String> {
Ok(Route { url: format!("{}/functions/v1/agent", sf_license::SUPABASE_URL), anon_key: sf_license::SUPABASE_ANON_KEY.into(), device })
}

/// How Export asks Claude for a video's title, description and tags: the agent's route and the
/// model chosen in the agent panel. `None` when this computer cannot be identified.
pub fn details_route() -> Option<(Route, &'static str)> {
let model = settings_path().map(|p| Settings::load(&p)).unwrap_or_default().pick();
route().ok().map(|r| (r, model))
}

/// The editor's side of the agent: catalogs gathered on the UI thread when a turn starts, and
/// what needs files or the network (presets, Unsplash, imports), run on the agent's thread.
struct StudioHost {
Expand Down Expand Up @@ -437,6 +444,12 @@ fn credits_label(n: f64) -> String {

impl AgentPanel {
/// Ask the backend for this computer's balance.
/// Whether the agent (AI) is on for this computer, as the backend last said: `None` until
/// it has answered.
pub fn ai_allowed(&self) -> Option<bool> {
self.credits.as_ref().and_then(|c| c["allowed"].as_bool())
}

fn fetch_credits(&mut self) {
if self.credits_rx.is_some() {
return;
Expand Down
Loading
Loading