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

Function new_intent

tests/harness/native_review_insert_test.py:12–24  ·  view source on GitHub ↗
(title, target=None)

Source from the content-addressed store, hash-verified

10
11
12def new_intent(title, target=None):
13 before = {row['id'] for row in data('intent', 'list', '--json')}
14 args = ['intent', 'new', title]
15 if target:
16 args += ['--review', 'urn:atomic:intent:' + target]
17 call(*args)
18 row = next(row for row in data('intent', 'list', '--json') if row['id'] not in before)
19 for path in (ROOT / '.vault/intents').glob('*/intent.md'):
20 text = path.read_text()
21 if re.search(r'^id: ' + re.escape(row['id']) + r'$', text, re.M):
22 uid = re.search(r'^uid: (.+)$', text, re.M).group(1)
23 return row['id'], uid
24 raise AssertionError('created intent has no materialized identity')
25
26
27def work_body(uid, complete):

Callers 1

mainFunction · 0.85

Calls 3

dataFunction · 0.90
callFunction · 0.90
groupMethod · 0.80

Tested by

no test coverage detected