agent-harness-adapter-core 0.2.2

One agent setup, every coding agent: install instructions, skills and hooks, declared once or read from AGENTS.md and .agents/, into Claude Code, Codex, Gemini CLI, Copilot, Cursor, OpenCode and more; hooks speak Claude Code's protocol everywhere.
Documentation
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
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
//! `<tool> harness install` and `status` over a set of harnesses, generic
//! over a [`Tool`].
// @zen-component: KIT-Harness

use std::{
    collections::BTreeMap,
    path::{Path, PathBuf},
    sync::Arc,
};

use crate::{
    Error, Result,
    fs::read_text,
    harness::{
        Context, Harness, Markers, Part, Profile, Reads, Scope, State, Tool,
        file::render_files,
        merge::render_merge,
        part::Kind,
        record::{Record, read_record, render_record},
        result::{Action, HarnessResult, InstallResult, MissingSource, PartResult},
        shared::{Candidate, Role, choose},
        state::{Observed, expected, hash, observe, state},
        write::{Plan, apply_plan},
    },
    integration::{Integration, Item},
};

/// The options of [`install`], built with [`InstallOptions::new`].
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct InstallOptions {
    /// The harness ids, e.g. `claude`.
    pub harnesses: Vec<String>,
    /// `--scope`.
    pub scope: Scope,
    /// `--without`, when given at all: replaces the declined parts of every
    /// harness named.
    pub without: Option<Vec<String>>,
    /// `--force`: write a part whose state is `edited`.
    pub force: bool,
}

impl InstallOptions {
    /// Install `harnesses` at `scope`, with the stored declined parts and
    /// without `--force`.
    pub fn new<I: IntoIterator<Item = S>, S: Into<String>>(harnesses: I, scope: Scope) -> Self {
        InstallOptions {
            harnesses: harnesses.into_iter().map(Into::into).collect(),
            scope,
            without: None,
            force: false,
        }
    }

    /// `--without`: decline these parts, replacing the stored list.
    #[must_use]
    pub fn without<I: IntoIterator<Item = S>, S: Into<String>>(mut self, parts: I) -> Self {
        self.without = Some(parts.into_iter().map(Into::into).collect());
        self
    }

    /// `--force`: also write the parts the user edited.
    #[must_use]
    pub fn force(mut self, force: bool) -> Self {
        self.force = force;
        self
    }
}

/// One harness of the set: its profile, where it loads each item, and what
/// it declined.
pub(super) struct Member {
    pub(super) harness: Arc<dyn Harness>,
    pub(super) named: bool,
    pub(super) profile: Profile,
    pub(super) reads: BTreeMap<Item, Reads>,
    pub(super) unsupported: Vec<Item>,
    pub(super) declined: Vec<String>,
    /// The hook events of the integration the harness does not run.
    pub(super) missed: Vec<crate::hook::Event>,
}

/// A part's role, state and what the tree held, computed before any write.
pub(super) struct Examined<'a> {
    pub(super) member: usize,
    pub(super) part: &'a Part,
    pub(super) path: String,
    pub(super) state: State,
    pub(super) existed: bool,
    pub(super) by: Option<String>,
    pub(super) in_place: bool,
}

/// Where a shared part's content is: `location`, written by `by`, or the
/// item's SOURCE (`by` none: IN PLACE).
#[derive(Debug, Clone)]
pub(super) struct Covered {
    pub(super) location: String,
    pub(super) by: Option<String>,
}

/// Everything `install` and `status` read.
pub(super) struct Run {
    pub(super) cx: Context,
    pub(super) markers: Markers,
    pub(super) record_path: PathBuf,
    pub(super) record: Record,
    pub(super) members: Vec<Member>,
    pub(super) warnings: Vec<String>,
    /// Per item read from a SOURCE under the root, its location.
    pub(super) sources: BTreeMap<Item, String>,
    pub(super) missing: Vec<MissingSource>,
}

/// `path` relative to `root` when it lies under it, `/`-separated.
fn display(root: &Path, path: &Path) -> String {
    let shown = path.strip_prefix(root).unwrap_or(path);
    shown.to_string_lossy().replace('\\', "/")
}

/// The profile `harness` renders for `integration`, then the raw parts.
// @zen-impl: KIT-17_AC-3
// @zen-impl: KIT-17_AC-4
fn profile(
    harness: &dyn Harness,
    integration: &Integration,
    cx: &Context,
) -> Result<(Profile, Vec<Item>)> {
    let mut parts = harness.render(integration, cx)?;
    let mut rendered = Vec::new();
    for p in &parts {
        let item = p.name().parse::<Item>().map_err(|()| {
            Error::Internal(format!(
                "harness `{}` rendered a part named `{}`, not an item",
                harness.id(),
                p.name()
            ))
        })?;
        if rendered.contains(&item) {
            return Err(Error::Internal(format!(
                "harness `{}` rendered `{item}` twice",
                harness.id()
            )));
        }
        rendered.push(item);
    }
    // A raw part may take an item's name when the harness renders nothing
    // for that item, e.g. a tool's own way to install its MCP server there.
    for raw in integration.parts_for(harness.id()) {
        if parts.iter().any(|p| p.name() == raw.name()) {
            return Err(Error::Internal(format!(
                "the part `{}` of `{}` clashes with another part's name",
                raw.name(),
                harness.id()
            )));
        }
        if let Ok(item) = raw.name().parse::<Item>() {
            rendered.push(item);
        }
        parts.push(raw.clone());
    }
    let unsupported = integration
        .items()
        .into_iter()
        .filter(|i| !rendered.contains(i))
        .collect();
    Ok((Profile::new(parts), unsupported))
}

/// Resolve the set, render each profile, read the declined parts.
// @zen-impl: KIT-1_AC-1
// @zen-impl: KIT-1_AC-2
// @zen-impl: KIT-19_AC-1
// @zen-impl: KIT-8_AC-1
pub(super) fn run<T: Tool + ?Sized>(
    tool: &T,
    named: &[String],
    scope: Scope,
    without: Option<&[String]>,
) -> Result<Run> {
    let supported = tool.harnesses();
    for id in named {
        let h = supported
            .iter()
            .find(|h| h.id() == id)
            .ok_or_else(|| Error::UnknownHarness {
                harness: id.clone(),
            })?;
        if !h.scopes().contains(&scope) {
            return Err(Error::UnsupportedScope {
                harness: id.clone(),
                scope,
            });
        }
    }
    let root = tool.root(scope)?;
    let record_path = tool.record_path(scope)?;
    let record = read_record(&record_path, &display(&root, &record_path))?;
    let user_root = match scope {
        Scope::User => Some(root.clone()),
        _ => tool.root(Scope::User).ok(),
    };
    let cx = Context::new(tool.name(), scope, root, user_root);
    let declared = tool.integration(scope);
    let integration = declared.resolve(&cx);
    let sources: BTreeMap<Item, String> = Item::ALL
        .into_iter()
        .filter_map(|i| Some((i, cx.relative(&declared.source(i)?.path)?)))
        .collect();
    let missing = declared
        .missing()
        .iter()
        .map(|m| MissingSource {
            item: m.item,
            path: cx
                .relative(&m.path)
                .unwrap_or_else(|| m.path.display().to_string()),
        })
        .collect();
    let store = tool.declined_store(scope)?;
    let mut members = Vec::new();
    for h in supported {
        let is_named = named.iter().any(|n| n == h.id());
        let recorded = record.harnesses.contains_key(h.id());
        if !(is_named || recorded) || !h.scopes().contains(&scope) {
            continue;
        }
        let (profile, unsupported) = profile(h.as_ref(), &integration, &cx)?;
        let mut missed: Vec<crate::hook::Event> = Vec::new();
        if profile.part(Item::Hooks.as_str()).is_some() {
            for e in integration.hooks().iter().map(|hk| hk.event()) {
                if !h.hook_events().contains(&e) && !missed.contains(&e) {
                    missed.push(e);
                }
            }
        }
        // Read even when `--without` replaces it: a store that cannot be
        // read refuses here, before any write.
        let stored = store.declined(h.id())?;
        let declined = match without {
            Some(w) if is_named => w
                .iter()
                .filter(|p| profile.part(p).is_some())
                .cloned()
                .collect(),
            _ => stored,
        };
        let mut reads = BTreeMap::new();
        for p in profile.parts() {
            if let Ok(item) = p.name().parse::<Item>() {
                reads.insert(item, h.reads(item, &cx)?);
            }
        }
        members.push(Member {
            harness: h,
            named: is_named,
            profile,
            reads,
            unsupported,
            declined,
            missed,
        });
    }
    if let Some(part) = without.into_iter().flatten().find(|p| {
        !members
            .iter()
            .any(|m| m.named && m.profile.part(p).is_some())
    }) {
        return Err(Error::UnknownPart {
            harness: named.join(", "),
            part: part.clone(),
        });
    }
    Ok(Run {
        markers: Markers::new(tool.name()),
        cx,
        record_path,
        record,
        members,
        warnings: integration.warnings().to_vec(),
        sources,
        missing,
    })
}

impl Run {
    /// The recorded hash of `member`'s part `name`; for an item, else that
    /// of another harness whose part for it has the same location.
    fn recorded(&self, member: usize, part: &Part) -> Option<&str> {
        let own = |m: &Member| {
            self.record
                .harnesses
                .get(m.harness.id())
                .and_then(|t| t.get(part.name()))
                .map(String::as_str)
        };
        own(&self.members[member]).or_else(|| {
            part.name().parse::<Item>().ok()?;
            self.members.iter().find_map(|m| {
                let p = m.profile.part(part.name())?;
                (p.location() == part.location()).then(|| own(m)).flatten()
            })
        })
    }

    /// The shared parts: per item, the choice of KIT-Shared.
    // @zen-impl: KIT-19_AC-6
    pub(super) fn share(&mut self) -> Result<BTreeMap<(usize, String), Covered>> {
        let mut shared = BTreeMap::new();
        for item in Item::ALL {
            let mut idx = Vec::new();
            let mut cands = Vec::new();
            for (i, m) in self.members.iter().enumerate() {
                let Some(part) = m.profile.part(item.as_str()) else {
                    continue;
                };
                if m.declined.iter().any(|d| d == item.as_str()) {
                    continue;
                }
                idx.push(i);
                cands.push(Candidate {
                    harness: m.harness.id(),
                    named: m.named,
                    part,
                    reads: &m.reads[&item],
                });
            }
            let choice = choose(
                item.as_str(),
                &cands,
                self.sources.get(&item).map(String::as_str),
            )?;
            self.warnings.extend(choice.warnings);
            for (k, role) in choice.roles.into_iter().enumerate() {
                if let Role::InPlace { location } = role {
                    shared.insert(
                        (idx[k], item.as_str().to_string()),
                        Covered { location, by: None },
                    );
                } else if let Role::Shared { location, by } = role {
                    let m = &self.members[idx[k]];
                    let own = cands[k].part.location();
                    let has_hash = self
                        .record
                        .harnesses
                        .get(m.harness.id())
                        .is_some_and(|t| t.contains_key(item.as_str()));
                    if has_hash && own != location {
                        self.warnings.push(format!(
                            "{}: the {item} now come from {location} ({by}); the earlier copy in {own} is left in place",
                            m.harness.id()
                        ));
                    }
                    shared.insert(
                        (idx[k], item.as_str().to_string()),
                        Covered {
                            location,
                            by: Some(by),
                        },
                    );
                }
            }
        }
        Ok(shared)
    }

    /// Examine every part of every member: declined, shared, or its state.
    // @zen-impl: KIT-8_AC-2
    pub(super) fn examine(
        &self,
        shared: &BTreeMap<(usize, String), Covered>,
    ) -> Result<Vec<Examined<'_>>> {
        let mut out = Vec::new();
        for (i, m) in self.members.iter().enumerate() {
            for part in m.profile.parts() {
                let path = part.location();
                // A declined part is never read: a broken file it would merge
                // into must not block the rest.
                if m.declined.iter().any(|d| d == part.name()) {
                    out.push(Examined {
                        member: i,
                        part,
                        path,
                        state: State::Skipped,
                        existed: false,
                        by: None,
                        in_place: false,
                    });
                    continue;
                }
                if let Some(c) = shared.get(&(i, part.name().to_string())) {
                    out.push(Examined {
                        member: i,
                        part,
                        path: c.location.clone(),
                        state: State::Shared,
                        existed: false,
                        by: c.by.clone(),
                        in_place: c.by.is_none(),
                    });
                    continue;
                }
                // A copy of a SOURCE differs from its recorded hash once the
                // SOURCE changes: stale.
                // @zen-impl: KIT-23_AC-4
                let observed = observe(&self.cx.root, part, &path, &self.markers)?;
                let st = state(&observed, &expected(part), self.recorded(i, part), false);
                let present = matches!(observed, Observed::Present(_));
                // A file part existed when any of its files did (its directory
                // may hold others'); a region or merge when its file did.
                let existed = present
                    || match &part.kind {
                        Kind::Files { files, .. } => files
                            .iter()
                            .any(|(rel, _)| self.cx.path(&path).join(rel).exists()),
                        Kind::Region { .. } | Kind::Merge { .. } => self.cx.path(&path).exists(),
                        Kind::External(_) => false,
                    };
                out.push(Examined {
                    member: i,
                    part,
                    path,
                    state: st,
                    existed,
                    by: None,
                    in_place: false,
                });
            }
        }
        Ok(out)
    }

    /// The result of the named members, from their parts' results.
    pub(super) fn result(&self, parts: Vec<(usize, PartResult)>) -> InstallResult {
        let harnesses = self
            .members
            .iter()
            .enumerate()
            .filter(|(_, m)| m.named)
            .map(|(i, m)| {
                let parts: Vec<PartResult> = parts
                    .iter()
                    .filter(|(j, _)| *j == i)
                    .map(|(_, p)| p.clone())
                    .collect();
                HarnessResult {
                    harness: m.harness.id().to_string(),
                    notes: missed_note(m)
                        .into_iter()
                        .chain(m.harness.notes(&self.cx, &parts))
                        .collect(),
                    parts,
                    unsupported: m.unsupported.clone(),
                }
            })
            .collect();
        InstallResult {
            scope: self.cx.scope,
            root: self.cx.root.clone(),
            harnesses,
            warnings: self.warnings.clone(),
            missing: self.missing.clone(),
        }
    }
}

/// The note for hooks whose event the harness does not run (PLAN-017 F7).
// @zen-impl: KIT-20_AC-2
fn missed_note(m: &Member) -> Option<String> {
    if m.missed.is_empty() {
        return None;
    }
    let events: Vec<&str> = m.missed.iter().map(|e| e.as_str()).collect();
    Some(format!(
        "{} has no {} event: those hooks do not run there",
        m.harness.id(),
        events.join(", ")
    ))
}

/// The existing text of `path`: planned already (`None` for a planned
/// deletion), or on disk.
pub(super) fn existing_text(plan: &Plan, path: &Path) -> Result<Option<String>> {
    if let Some(planned) = plan.pending(path) {
        return Ok(planned.map(str::to_string));
    }
    read_text(path)
}

/// Plan the write of one part, from the pending or the on-disk text.
// @zen-impl: KIT-7_AC-1
fn plan_part(cx: &Context, markers: &Markers, plan: &mut Plan, e: &Examined<'_>) -> Result<()> {
    let fs_path = cx.path(&e.path);
    match &e.part.kind {
        Kind::Files { .. } => {
            for (rel, text) in render_files(e.part) {
                plan.set(fs_path.join(rel), text);
            }
        }
        Kind::Region { block, .. } => {
            let existing = existing_text(plan, &fs_path)?;
            if let Some(text) = markers.render(existing.as_deref(), block) {
                plan.set(fs_path, text);
            }
        }
        Kind::Merge { ops, .. } => {
            let existing = existing_text(plan, &fs_path)?;
            if let Some(text) = render_merge(&e.path, existing.as_deref(), ops)? {
                plan.set(fs_path, text);
            }
        }
        Kind::External(ext) => plan.externals.push(ext.clone()),
    }
    Ok(())
}

/// Make the tree match each named harness's profile: a declined part is
/// skipped, a shared part left to its writer, an absent part created, a
/// stale part rewritten, an edited part left unless `force`, a current part
/// left. Every refusal comes before any write.
// @zen-impl: KIT-4_AC-1
// @zen-impl: KIT-4_AC-2
// @zen-impl: KIT-6_AC-1
pub fn install<T: Tool + ?Sized>(tool: &T, opts: &InstallOptions) -> Result<InstallResult> {
    let mut run = run(tool, &opts.harnesses, opts.scope, opts.without.as_deref())?;
    let shared = run.share()?;
    let examined = run.examine(&shared)?;
    let mut plan = Plan::default();
    let mut record = run.record.clone();
    // Every named harness is installed, even one with nothing to write yet
    // (e.g. its sources are all missing), so later runs know it.
    for m in run.members.iter().filter(|m| m.named) {
        record
            .harnesses
            .entry(m.harness.id().to_string())
            .or_default();
    }
    let mut parts = Vec::new();
    for e in &examined {
        let m = &run.members[e.member];
        if !m.named {
            continue;
        }
        let written = match e.state {
            State::Absent | State::Stale => true,
            State::Edited => opts.force,
            _ => false,
        };
        let action = if !written {
            None
        } else if !e.existed {
            Some(Action::Created)
        } else if matches!(e.part.kind, Kind::Files { .. }) {
            Some(Action::Rewrote)
        } else {
            Some(Action::Updated)
        };
        if written {
            plan_part(&run.cx, &run.markers, &mut plan, e)?;
        }
        let table = record
            .harnesses
            .entry(m.harness.id().to_string())
            .or_default();
        match e.state {
            State::Skipped => {
                table.remove(e.part.name());
            }
            // A shared part keeps any hash; an edited part left keeps its own.
            State::Shared => {}
            State::Edited if !written => {}
            _ => {
                table.insert(e.part.name().to_string(), hash(&expected(e.part)));
            }
        }
        parts.push((
            e.member,
            PartResult {
                part: e.part.name().to_string(),
                state: e.state,
                action,
                path: e.path.clone(),
                by: e.by.clone(),
                in_place: e.in_place,
            },
        ));
    }
    if record != run.record || !run.record_path.is_file() {
        plan.record = Some((
            run.record_path.clone(),
            Some(render_record(&record, &tool.record_header())),
        ));
    }
    apply_plan(&plan)?;
    if opts.without.is_some() {
        let store = tool.declined_store(opts.scope)?;
        for m in run.members.iter().filter(|m| m.named) {
            store.set_declined(m.harness.id(), &m.declined)?;
        }
    }
    Ok(run.result(parts))
}

/// The harness ids `names` stands for at `scope`: `all` is every harness
/// of the tool with files at the scope, in the tool's order; other names
/// are kept as given.
// @zen-impl: KIT-1_AC-3
pub fn expand<T: Tool + ?Sized, S: AsRef<str>>(tool: &T, names: &[S], scope: Scope) -> Vec<String> {
    if names.iter().any(|n| n.as_ref() == "all") {
        return tool
            .harnesses()
            .iter()
            .filter(|h| h.scopes().contains(&scope))
            .map(|h| h.id().to_string())
            .collect();
    }
    names.iter().map(|n| n.as_ref().to_string()).collect()
}

/// The ids of the harnesses installed at `scope` (those in the record), in
/// the tool's order; nothing is written.
// @zen-impl: KIT-5_AC-2
pub fn installed<T: Tool + ?Sized>(tool: &T, scope: Scope) -> Result<Vec<String>> {
    let root = tool.root(scope)?;
    let path = tool.record_path(scope)?;
    let record = read_record(&path, &display(&root, &path))?;
    Ok(tool
        .harnesses()
        .iter()
        .map(|h| h.id().to_string())
        .filter(|id| record.harnesses.contains_key(id))
        .collect())
}

/// The state of every part of `harnesses` at `scope`; nothing is written.
// @zen-impl: KIT-5_AC-1
pub fn status<T: Tool + ?Sized, I: IntoIterator<Item = S>, S: AsRef<str>>(
    tool: &T,
    harnesses: I,
    scope: Scope,
) -> Result<InstallResult> {
    let named: Vec<String> = harnesses
        .into_iter()
        .map(|s| s.as_ref().to_string())
        .collect();
    let mut run = run(tool, &named, scope, None)?;
    let shared = run.share()?;
    let parts: Vec<(usize, PartResult)> = run
        .examine(&shared)?
        .into_iter()
        .map(|e| {
            (
                e.member,
                PartResult {
                    part: e.part.name().to_string(),
                    state: e.state,
                    action: None,
                    path: e.path,
                    by: e.by,
                    in_place: e.in_place,
                },
            )
        })
        .collect();
    let parts = parts
        .into_iter()
        .filter(|(i, _)| run.members[*i].named)
        .collect();
    Ok(run.result(parts))
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn display_is_relative_under_the_root() {
        assert_eq!(
            display(Path::new("/r"), Path::new("/r/.tool/h.toml")),
            ".tool/h.toml"
        );
        assert_eq!(
            display(Path::new("/r"), Path::new("/x/h.toml")),
            "/x/h.toml"
        );
    }

    #[test]
    fn options_build() {
        let o = InstallOptions::new(["claude", "codex"], Scope::User)
            .without(["mcp"])
            .force(true);
        assert_eq!(o.harnesses, ["claude", "codex"]);
        assert_eq!(o.scope, Scope::User);
        assert_eq!(o.without, Some(vec!["mcp".to_string()]));
        assert!(o.force);
        assert_eq!(InstallOptions::new(["c"], Scope::Project).without, None);
    }
}