thesa 4.6.0

Archive repositories, models, datasets, websites, assets, audio, scholarly papers, and technical reports
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
use std::path::PathBuf;

use clap::{Args, Parser, Subcommand};
use siteforge::ExportFormat as SiteforgeExportFormat;

use crate::types::{
    AssetFormat, AssetProvider, AssetResolution, AudioKind, DatasetProvider, Mode, ModelProvider,
    PaperProvider, PaperSort, RepositoryProvider, SiteArchiveProfile,
};

fn parse_asset_limit(value: &str) -> Result<usize, String> {
    let limit = value
        .parse::<usize>()
        .map_err(|_| "asset limit must be an integer from 1 to 100".to_string())?;
    if (1..=100).contains(&limit) {
        Ok(limit)
    } else {
        Err("asset limit must be from 1 to 100".to_string())
    }
}

fn parse_audio_limit(value: &str) -> Result<usize, String> {
    let limit = value
        .parse::<usize>()
        .map_err(|_| "audio limit must be an integer from 1 to 50".to_string())?;
    if (1..=50).contains(&limit) {
        Ok(limit)
    } else {
        Err("audio limit must be from 1 to 50".to_string())
    }
}

fn parse_paper_limit(value: &str) -> Result<usize, String> {
    let limit = value
        .parse::<usize>()
        .map_err(|_| "paper limit must be an integer from 1 to 100".to_string())?;
    if (1..=100).contains(&limit) {
        Ok(limit)
    } else {
        Err("paper limit must be from 1 to 100".to_string())
    }
}

#[derive(Parser, Clone)]
#[command(
    name = "thesa",
    version,
    about = "Archive repositories, models, datasets, websites, assets, audio, scholarly papers, and technical reports",
    subcommand_precedence_over_arg = true
)]
pub(crate) struct Cli {
    /// Print autonomous-agent instructions; optionally select one route
    #[arg(long, value_name = "SELECTOR", num_args = 0..=1, default_missing_value = "all")]
    pub(crate) agent: Option<String>,

    #[command(subcommand)]
    pub(crate) command: Option<Commands>,

    /// Target: repository, model, dataset, website URL, asset, audio, or paper query
    pub(crate) target: Option<String>,

    /// Output directory where archives are stored
    #[arg(short = 'o', long = "output", default_value = "./archives")]
    pub(crate) output: PathBuf,

    /// GitHub token for API requests (optional, falls back to GITHUB_TOKEN env)
    #[arg(short = 't', long = "token")]
    pub(crate) token: Option<String>,

    /// Bitbucket access token for API requests (falls back to BITBUCKET_TOKEN env)
    #[arg(long = "bitbucket-token")]
    pub(crate) bitbucket_token: Option<String>,

    /// Hugging Face token for API requests (optional, falls back to HF_TOKEN env)
    #[arg(long = "hf-token")]
    pub(crate) hf_token: Option<String>,

    /// CivitAI token for API requests (optional, falls back to CIVITAI_TOKEN env)
    #[arg(long = "civitai-token")]
    pub(crate) civitai_token: Option<String>,

    /// Sketchfab API token for authenticated CC0 downloads
    #[arg(
        long = "asset-token",
        env = "SKETCHFAB_API_TOKEN",
        hide_env_values = true
    )]
    pub(crate) asset_token: Option<String>,

    /// Clone depth for each repository
    #[arg(long = "depth")]
    pub(crate) depth: Option<u32>,

    /// Number of items to process at once where the selected archive route supports batching
    #[arg(short = 'c', long = "concurrency", default_value_t = 4)]
    pub(crate) concurrency: usize,

    /// Skip existing directories instead of failing or replacing
    #[arg(long = "skip-existing")]
    pub(crate) skip_existing: bool,

    /// Filter items by substring in name
    #[arg(long = "filter")]
    pub(crate) filter: Option<String>,

    /// Print plan only; do not execute
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,

    /// Force the interactive Scrin interface
    #[arg(short = 'T', long = "tui")]
    pub(crate) tui: bool,

    /// Archive mode: repositories, models, datasets, sites, assets, audio, or papers
    #[arg(
        long = "mode",
        value_enum,
        default_value_t = Mode::Repos,
        help = "Archive mode: repos, models, datasets, sites, assets, audio, or papers"
    )]
    pub(crate) mode: Mode,

    /// Repository provider for bare targets: github or bitbucket
    #[arg(long = "repo-provider", value_enum, default_value_t = RepositoryProvider::Github)]
    pub(crate) repo_provider: RepositoryProvider,

    /// Model provider: hf (Hugging Face), ollama, civitai
    #[arg(long = "provider", value_enum, default_value_t = ModelProvider::Hf)]
    pub(crate) provider: ModelProvider,

    /// Dataset provider: hf (Hugging Face Datasets), zenodo
    #[arg(long = "dataset-provider", value_enum, default_value_t = DatasetProvider::Hf)]
    pub(crate) dataset_provider: DatasetProvider,

    /// Free 3D asset provider
    #[arg(long = "asset-provider", value_enum, default_value_t = AssetProvider::Polyhaven)]
    pub(crate) asset_provider: AssetProvider,

    /// Free 3D asset scene format
    #[arg(long = "asset-format", value_enum, default_value_t = AssetFormat::Auto)]
    pub(crate) asset_format: AssetFormat,

    /// Free 3D asset texture resolution
    #[arg(long = "asset-resolution", value_enum, default_value_t = AssetResolution::Auto)]
    pub(crate) asset_resolution: AssetResolution,

    /// Maximum advertised bytes per free 3D asset bundle; 0 disables the cap
    #[arg(long = "asset-max-download-bytes", default_value_t = 1024 * 1024 * 1024)]
    pub(crate) asset_max_download_bytes: u64,

    /// Maximum ranked asset results to discover (1-100)
    #[arg(long = "asset-limit", default_value_t = 20, value_parser = parse_asset_limit)]
    pub(crate) asset_limit: usize,

    /// Intended audio use: music, game-audio, or any
    #[arg(long = "audio-kind", value_enum, default_value_t = AudioKind::Any)]
    pub(crate) audio_kind: AudioKind,

    /// Maximum reusable audio results to discover (1-50)
    #[arg(long = "audio-limit", default_value_t = 20, value_parser = parse_audio_limit)]
    pub(crate) audio_limit: usize,

    /// Maximum bytes per audio download; 0 disables the cap
    #[arg(long = "audio-max-download-bytes", default_value_t = 512 * 1024 * 1024)]
    pub(crate) audio_max_download_bytes: u64,

    /// Scholarly paper or technical report provider
    #[arg(long = "paper-provider", value_enum, default_value_t = PaperProvider::Arxiv)]
    pub(crate) paper_provider: PaperProvider,

    /// Override paper query ordering; omitted preserves query @sort
    #[arg(long = "paper-sort", value_enum)]
    pub(crate) paper_sort: Option<PaperSort>,

    /// Maximum ranked paper results to discover (1-100)
    #[arg(long = "paper-limit", default_value_t = 20, value_parser = parse_paper_limit)]
    pub(crate) paper_limit: usize,

    /// Maximum bytes per paper document; 0 disables the caller cap
    #[arg(long = "paper-max-download-bytes", default_value_t = 256 * 1024 * 1024)]
    pub(crate) paper_max_download_bytes: u64,

    /// Use Hugging Face mirror (hf-mirror.com) — no token required
    #[arg(long = "hf-mirror")]
    pub(crate) hf_mirror: bool,
}

#[derive(Debug, Clone, Subcommand)]
#[allow(clippy::large_enum_variant)]
pub(crate) enum Commands {
    /// Archive artifacts from a supported source provider
    Archive {
        /// Print plan only; do not execute
        #[arg(long = "dry-run")]
        dry_run: bool,

        #[command(subcommand)]
        source: ArchiveCommands,
    },

    /// Verify a thesa archive directory using .thesa/manifest.json and checksums
    Verify {
        /// Archive output directory containing a .thesa manifest sidecar
        archive: PathBuf,

        /// Emit machine-readable JSON report
        #[arg(long)]
        json: bool,
    },
}

#[derive(Debug, Clone, Subcommand)]
pub(crate) enum ArchiveCommands {
    /// Refresh existing GitHub or Bitbucket archives with git pull --ff-only
    #[command(alias = "update", alias = "pull")]
    Refresh(GitRefreshArgs),

    /// Archive a website with siteforge
    Site(SiteArchiveArgs),

    /// Archive datasets with baseforge
    Dataset(DatasetArchiveArgs),

    /// Archive free 3D assets with assetforge
    #[command(alias = "assets", alias = "3d")]
    Asset(AssetArchiveArgs),

    /// Archive reusable audio with soundforge
    #[command(alias = "sound", alias = "sounds", alias = "soundforge")]
    Audio(AudioArchiveArgs),

    /// Archive scholarly papers and technical reports with paperforge
    #[command(alias = "papers", alias = "paperforge")]
    Paper(PaperArchiveArgs),

    /// Archive a generic URL/website with siteforge
    Url(SiteArchiveArgs),

    /// List Siteforge website archives
    List(SiteforgeRootArgs),

    /// Inspect one Siteforge archive
    Inspect(SiteforgeArchiveIdArgs),

    /// Search Siteforge archives
    Search(SiteforgeSearchArgs),

    /// Export a Siteforge archive
    Export(SiteforgeExportArgs),

    /// Create AI context packs for a Siteforge archive
    Pack(SiteforgePackArgs),

    /// Verify a Siteforge archive by archive id
    Verify(SiteforgeArchiveIdArgs),

    /// Resume an interrupted Siteforge archive by archive id
    Resume(SiteforgeArchiveIdArgs),

    /// Print Siteforge diagnostics
    Diagnostics(SiteforgeDiagnosticsArgs),
}

#[derive(Debug, Clone, Args)]
pub(crate) struct GitRefreshArgs {
    /// Optional owner, organization, or workspace to refresh
    #[arg(value_name = "NAMESPACE")]
    pub(crate) owner: Option<String>,

    /// Root to scan for Git repository archives
    #[arg(long = "archive-root", short = 'r', default_value = "./archives")]
    pub(crate) archive_root: PathBuf,

    /// Owner, organization, or workspace to refresh from the archive tree
    #[arg(
        long = "owner",
        alias = "user",
        alias = "username",
        alias = "workspace",
        value_name = "NAMESPACE"
    )]
    pub(crate) owner_filter: Option<String>,

    /// Number of repositories to refresh at once
    #[arg(short = 'c', long = "concurrency", default_value_t = 4)]
    pub(crate) concurrency: usize,

    /// Only refresh archives whose owner/repo slug or path contains this text
    #[arg(long = "filter")]
    pub(crate) filter: Option<String>,

    /// Print discovered archives only; do not run git pull
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteforgeRootArgs {
    /// Siteforge archive root
    #[arg(long = "archive-root", default_value = "./archives/sites")]
    pub(crate) archive_root: PathBuf,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct DatasetArchiveArgs {
    /// Dataset target: namespace, dataset id, `search:<query>`, top, latest, or provider URL
    pub(crate) target: String,

    /// Dataset provider
    #[arg(long = "provider", value_enum, default_value_t = DatasetProvider::Hf)]
    pub(crate) provider: DatasetProvider,

    /// Dataset archive root
    #[arg(
        long = "archive-root",
        short = 'r',
        default_value = "./archives/datasets"
    )]
    pub(crate) archive_root: PathBuf,

    /// Number of dataset files to download at once
    #[arg(short = 'c', long = "concurrency", default_value_t = 4)]
    pub(crate) concurrency: usize,

    /// Skip existing dataset directories
    #[arg(long = "skip-existing")]
    pub(crate) skip_existing: bool,

    /// Filter discovered datasets by substring
    #[arg(long = "filter")]
    pub(crate) filter: Option<String>,

    /// Hugging Face token for private/gated datasets (falls back to HF_TOKEN env)
    #[arg(long = "hf-token")]
    pub(crate) hf_token: Option<String>,

    /// Print plan only; do not download
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct AssetArchiveArgs {
    /// Asset target: id, `search:<query>`, `category:<name>`, top, latest, or provider URL
    pub(crate) target: String,

    /// Free 3D asset provider
    #[arg(long = "provider", value_enum, default_value_t = AssetProvider::Polyhaven)]
    pub(crate) provider: AssetProvider,

    /// 3D scene format
    #[arg(long = "format", value_enum, default_value_t = AssetFormat::Auto)]
    pub(crate) format: AssetFormat,

    /// Texture resolution
    #[arg(long = "resolution", value_enum, default_value_t = AssetResolution::Auto)]
    pub(crate) resolution: AssetResolution,

    /// Asset archive root
    #[arg(
        long = "archive-root",
        short = 'r',
        default_value = "./archives/assets"
    )]
    pub(crate) archive_root: PathBuf,

    /// Skip matching complete assets after provider and checksum verification
    #[arg(long = "skip-existing")]
    pub(crate) skip_existing: bool,

    /// Filter discovered assets by id, name, category, or tag
    #[arg(long = "filter")]
    pub(crate) filter: Option<String>,

    /// Maximum advertised bytes per selected asset bundle; 0 disables the cap
    #[arg(long = "max-download-bytes", default_value_t = 1024 * 1024 * 1024)]
    pub(crate) max_download_bytes: u64,

    /// Maximum ranked results to discover (1-100)
    #[arg(long, default_value_t = 20, value_parser = parse_asset_limit)]
    pub(crate) limit: usize,

    /// Sketchfab API token for authenticated CC0 downloads
    #[arg(long, env = "SKETCHFAB_API_TOKEN", hide_env_values = true)]
    pub(crate) token: Option<String>,

    /// Print plan only; do not download
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct AudioArchiveArgs {
    /// Audio target: file, search, category, top, latest, or Commons file URL
    pub(crate) target: String,

    /// Intended audio use
    #[arg(long = "kind", value_enum, default_value_t = AudioKind::Any)]
    pub(crate) kind: AudioKind,

    /// Audio archive root
    #[arg(
        long = "archive-root",
        alias = "output",
        short = 'r',
        default_value = "./archives/audio"
    )]
    pub(crate) archive_root: PathBuf,

    /// Skip matching complete audio after checksum verification
    #[arg(long = "skip-existing")]
    pub(crate) skip_existing: bool,

    /// Filter discovered audio by title, description, category, or license
    #[arg(long = "filter")]
    pub(crate) filter: Option<String>,

    /// Maximum bytes per selected audio download; 0 disables the cap
    #[arg(long = "max-download-bytes", default_value_t = 512 * 1024 * 1024)]
    pub(crate) max_download_bytes: u64,

    /// Maximum results to discover (1-50)
    #[arg(long, default_value_t = 20, value_parser = parse_audio_limit)]
    pub(crate) limit: usize,

    /// Print plan only; do not download
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct PaperArchiveArgs {
    /// PaperForge query, exact id, DOI, or supported provider URL
    pub(crate) query: String,

    /// Paper provider
    #[arg(long = "provider", value_enum)]
    pub(crate) provider: Option<PaperProvider>,

    /// Override query ordering; omitted preserves query @sort
    #[arg(long = "sort", value_enum)]
    pub(crate) sort: Option<PaperSort>,

    /// Paper archive root
    #[arg(
        long = "archive-root",
        alias = "output",
        short = 'r',
        default_value = "./archives/papers"
    )]
    pub(crate) archive_root: PathBuf,

    /// Skip only matching complete papers after PaperForge verification
    #[arg(long = "skip-existing")]
    pub(crate) skip_existing: bool,

    /// Filter papers by id, title, author, topic, DOI, journal, or license
    #[arg(long = "filter")]
    pub(crate) filter: Option<String>,

    /// Maximum bytes per paper document; 0 disables the caller cap
    #[arg(long = "max-download-bytes", default_value_t = 256 * 1024 * 1024)]
    pub(crate) max_download_bytes: u64,

    /// Maximum ranked results to discover (1-100)
    #[arg(long, default_value_t = 20, value_parser = parse_paper_limit)]
    pub(crate) limit: usize,

    /// Print the bounded discovery and ranking plan only
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteforgeArchiveIdArgs {
    /// Siteforge archive id
    pub(crate) archive_id: String,

    #[command(flatten)]
    pub(crate) root: SiteforgeRootArgs,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteforgeSearchArgs {
    /// Query text
    pub(crate) query: String,

    /// Restrict search to one archive id
    #[arg(long = "archive-id")]
    pub(crate) archive_id: Option<String>,

    /// Maximum matches to print
    #[arg(long = "limit", default_value_t = 20)]
    pub(crate) limit: usize,

    #[command(flatten)]
    pub(crate) root: SiteforgeRootArgs,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteforgeExportArgs {
    /// Siteforge archive id
    pub(crate) archive_id: String,

    /// Export format
    #[arg(long = "format", value_enum)]
    pub(crate) format: SiteforgeExportFormat,

    /// Export output path
    #[arg(long = "output")]
    pub(crate) output: Option<PathBuf>,

    #[command(flatten)]
    pub(crate) root: SiteforgeRootArgs,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteforgePackArgs {
    /// Siteforge archive id
    pub(crate) archive_id: String,

    /// Maximum tokens per generated pack
    #[arg(long = "max-tokens")]
    pub(crate) max_tokens: Option<usize>,

    #[command(flatten)]
    pub(crate) root: SiteforgeRootArgs,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteforgeDiagnosticsArgs {
    /// Optional Siteforge archive id
    pub(crate) archive_id: Option<String>,

    #[command(flatten)]
    pub(crate) root: SiteforgeRootArgs,
}

#[derive(Debug, Clone, Args)]
pub(crate) struct SiteArchiveArgs {
    /// Seed URL to archive. Optional when --input provides seeds.
    #[arg(value_name = "URL")]
    pub(crate) url: Option<String>,

    /// File containing seed URLs, one per line. Blank lines and # comments are ignored.
    #[arg(long = "input", value_name = "FILE")]
    pub(crate) input: Option<PathBuf>,

    /// Output root for website archives
    #[arg(short = 'o', long = "output", default_value = "./archives/sites")]
    pub(crate) output: PathBuf,

    /// Archive all in-scope pages under the site instead of one page
    #[arg(long = "full-site")]
    pub(crate) full_site: bool,

    /// Allow following links outside the seed domain
    #[arg(long = "allow-cross-domain")]
    pub(crate) allow_cross_domain: bool,

    /// Maximum crawl depth
    #[arg(long = "max-depth")]
    pub(crate) max_depth: Option<usize>,

    /// Maximum pages to archive
    #[arg(long = "max-pages")]
    pub(crate) max_pages: Option<usize>,

    /// Number of concurrent fetch workers
    #[arg(short = 'c', short_alias = 'j', long = "concurrency", alias = "jobs")]
    pub(crate) concurrency: Option<usize>,

    /// Politeness delay between requests per worker, in milliseconds
    #[arg(long = "delay-ms")]
    pub(crate) delay_ms: Option<u64>,

    /// Stable archive id for the siteforge archive
    #[arg(long = "archive-id")]
    pub(crate) archive_id: Option<String>,

    /// Include URL glob pattern. May be repeated.
    #[arg(long = "include", value_name = "GLOB")]
    pub(crate) include_url_patterns: Vec<String>,

    /// Exclude URL glob pattern. May be repeated.
    #[arg(long = "exclude", value_name = "GLOB")]
    pub(crate) exclude_url_patterns: Vec<String>,

    /// Siteforge archive output profile: full, agent, or lean
    #[arg(long = "archive-profile", value_enum)]
    pub(crate) archive_profile: Option<SiteArchiveProfile>,

    /// Maximum bytes to fetch per HTML page
    #[arg(long = "max-page-size-bytes")]
    pub(crate) max_page_size_bytes: Option<u64>,

    /// Maximum bytes to fetch per asset
    #[arg(long = "max-asset-size-bytes")]
    pub(crate) max_asset_size_bytes: Option<u64>,

    /// Maximum total archive size in bytes
    #[arg(long = "max-total-archive-size-bytes")]
    pub(crate) max_total_archive_size_bytes: Option<u64>,

    /// Render JavaScript pages through siteforge's browser renderer
    #[arg(long = "render-js")]
    pub(crate) render_js: bool,

    /// Render only pages that look like thin JavaScript app shells
    #[arg(long = "render-js-auto", conflicts_with = "render_js")]
    pub(crate) render_js_auto: bool,

    /// Browser command template for Siteforge JavaScript rendering
    #[arg(long = "browser-command", value_name = "COMMAND")]
    pub(crate) browser_command: Option<String>,

    /// Browser profile directory for Siteforge JavaScript rendering
    #[arg(long = "browser-profile", value_name = "DIR")]
    pub(crate) browser_profile: Option<PathBuf>,

    /// Milliseconds to wait after browser render before extracting DOM
    #[arg(long = "render-wait-ms")]
    pub(crate) render_wait_ms: Option<u64>,

    /// Extra request header. Repeatable. Format: "Name: Value"
    #[arg(long = "header", value_name = "NAME: VALUE")]
    pub(crate) headers: Vec<String>,

    /// Cookie header value to send with requests
    #[arg(long = "cookie", value_name = "COOKIE_HEADER")]
    pub(crate) cookie: Option<String>,

    /// User-Agent header used by Siteforge fetchers/renderers
    #[arg(long = "user-agent", value_name = "VALUE")]
    pub(crate) user_agent: Option<String>,

    /// HTTP timeout per request, in seconds
    #[arg(long = "timeout-secs")]
    pub(crate) timeout_secs: Option<u64>,

    /// Number of Siteforge retry attempts for failed frontier items
    #[arg(long = "retry-count")]
    pub(crate) retry_count: Option<usize>,

    /// Enable Siteforge OCR for code-like downloaded assets
    #[arg(long = "ocr")]
    pub(crate) ocr_enabled: bool,

    /// Print plan only; do not execute
    #[arg(long = "dry-run")]
    pub(crate) dry_run: bool,
}