MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / repo_with_intents

Function repo_with_intents

atomic-cli/src/commands/intent/list.rs:389–410  ·  view source on GitHub ↗

Create a repo+vault and N intents; return (repo, sorted ids, tempdir).

(n: usize)

Source from the content-addressed store, hash-verified

387
388 /// Create a repo+vault and N intents; return (repo, sorted ids, tempdir).
389 fn repo_with_intents(n: usize) -> (Repository, Vec<String>, tempfile::TempDir) {
390 let dir = tempdir().unwrap();
391 let repo = Repository::init(dir.path()).unwrap();
392 repo.init_vault().unwrap();
393 let mut ids = Vec::new();
394 for i in 0..n {
395 let result = repo
396 .vault_intent_create(IntentCreateOptions {
397 title: format!("Intent {i}"),
398 priority: Some("medium".to_string()),
399 assignee: None,
400 labels: Vec::new(),
401 session_id: None,
402 turn_id: None,
403 kind: None,
404 })
405 .unwrap();
406 ids.push(result.id);
407 }
408 ids.sort();
409 (repo, ids, dir)
410 }
411
412 /// Lift+attest a stored intent with a given keypair, returning the node.
413 fn attest_with(repo: &Repository, id: &str, kp: &KeyPair) -> CanonicalNode {

Calls 6

vault_intent_createMethod · 0.80
sortMethod · 0.80
unwrapMethod · 0.45
pathMethod · 0.45
init_vaultMethod · 0.45
pushMethod · 0.45