@bernierllc/braingrid-cli-wrapper 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +29 -0
- package/README.md +401 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +131 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +131 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/cli.ts.html +298 -0
- package/coverage/lcov-report/src/commands/createIdea.ts.html +193 -0
- package/coverage/lcov-report/src/commands/createTask.ts.html +235 -0
- package/coverage/lcov-report/src/commands/index.html +176 -0
- package/coverage/lcov-report/src/commands/listProjects.ts.html +160 -0
- package/coverage/lcov-report/src/commands/listTasks.ts.html +226 -0
- package/coverage/lcov-report/src/commands/updateTaskStatus.ts.html +205 -0
- package/coverage/lcov-report/src/index.html +146 -0
- package/coverage/lcov-report/src/index.ts.html +172 -0
- package/coverage/lcov-report/src/models.ts.html +364 -0
- package/coverage/lcov.info +240 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/cli.ts.html +298 -0
- package/coverage/src/commands/createIdea.ts.html +193 -0
- package/coverage/src/commands/createTask.ts.html +235 -0
- package/coverage/src/commands/index.html +176 -0
- package/coverage/src/commands/listProjects.ts.html +160 -0
- package/coverage/src/commands/listTasks.ts.html +226 -0
- package/coverage/src/commands/updateTaskStatus.ts.html +205 -0
- package/coverage/src/index.html +146 -0
- package/coverage/src/index.ts.html +172 -0
- package/coverage/src/models.ts.html +364 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +53 -0
- package/dist/commands/createIdea.d.ts +5 -0
- package/dist/commands/createIdea.js +29 -0
- package/dist/commands/createTask.d.ts +11 -0
- package/dist/commands/createTask.js +34 -0
- package/dist/commands/listProjects.d.ts +5 -0
- package/dist/commands/listProjects.js +24 -0
- package/dist/commands/listTasks.d.ts +10 -0
- package/dist/commands/listTasks.js +35 -0
- package/dist/commands/updateTaskStatus.d.ts +10 -0
- package/dist/commands/updateTaskStatus.js +27 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +28 -0
- package/dist/models.d.ts +89 -0
- package/dist/models.js +74 -0
- package/jest.config.cjs +22 -0
- package/package.json +46 -0
- package/src/__tests__/execa-mock-validation.test.ts +34 -0
- package/src/cli.test.ts +86 -0
- package/src/cli.ts +71 -0
- package/src/commands/createIdea.test.ts +77 -0
- package/src/commands/createIdea.ts +36 -0
- package/src/commands/createTask.test.ts +100 -0
- package/src/commands/createTask.ts +50 -0
- package/src/commands/listProjects.test.ts +72 -0
- package/src/commands/listProjects.ts +25 -0
- package/src/commands/listTasks.test.ts +183 -0
- package/src/commands/listTasks.ts +47 -0
- package/src/commands/updateTaskStatus.test.ts +96 -0
- package/src/commands/updateTaskStatus.ts +40 -0
- package/src/index.ts +29 -0
- package/src/models.test.ts +197 -0
- package/src/models.ts +93 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<title>Code coverage report for src/models.ts</title>
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
+
<link rel="stylesheet" href="../base.css" />
|
|
10
|
+
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
+
<style type='text/css'>
|
|
13
|
+
.coverage-summary .sorter {
|
|
14
|
+
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div class='wrapper'>
|
|
21
|
+
<div class='pad1'>
|
|
22
|
+
<h1><a href="../index.html">All files</a> / <a href="index.html">src</a> models.ts</h1>
|
|
23
|
+
<div class='clearfix'>
|
|
24
|
+
|
|
25
|
+
<div class='fl pad1y space-right2'>
|
|
26
|
+
<span class="strong">100% </span>
|
|
27
|
+
<span class="quiet">Statements</span>
|
|
28
|
+
<span class='fraction'>12/12</span>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<div class='fl pad1y space-right2'>
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
|
+
<span class="quiet">Branches</span>
|
|
35
|
+
<span class='fraction'>0/0</span>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<div class='fl pad1y space-right2'>
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
|
+
<span class="quiet">Functions</span>
|
|
42
|
+
<span class='fraction'>1/1</span>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<div class='fl pad1y space-right2'>
|
|
47
|
+
<span class="strong">100% </span>
|
|
48
|
+
<span class="quiet">Lines</span>
|
|
49
|
+
<span class='fraction'>12/12</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<p class="quiet">
|
|
55
|
+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
+
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
<div class='status-line high'></div>
|
|
65
|
+
<pre><table class="coverage">
|
|
66
|
+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
+
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
+
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
+
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
+
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
+
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
+
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
+
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
+
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
+
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
+
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
+
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
+
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
+
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
+
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
+
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
+
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
+
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
+
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
+
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
+
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
+
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
+
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
+
<a name='L25'></a><a href='#L25'>25</a>
|
|
91
|
+
<a name='L26'></a><a href='#L26'>26</a>
|
|
92
|
+
<a name='L27'></a><a href='#L27'>27</a>
|
|
93
|
+
<a name='L28'></a><a href='#L28'>28</a>
|
|
94
|
+
<a name='L29'></a><a href='#L29'>29</a>
|
|
95
|
+
<a name='L30'></a><a href='#L30'>30</a>
|
|
96
|
+
<a name='L31'></a><a href='#L31'>31</a>
|
|
97
|
+
<a name='L32'></a><a href='#L32'>32</a>
|
|
98
|
+
<a name='L33'></a><a href='#L33'>33</a>
|
|
99
|
+
<a name='L34'></a><a href='#L34'>34</a>
|
|
100
|
+
<a name='L35'></a><a href='#L35'>35</a>
|
|
101
|
+
<a name='L36'></a><a href='#L36'>36</a>
|
|
102
|
+
<a name='L37'></a><a href='#L37'>37</a>
|
|
103
|
+
<a name='L38'></a><a href='#L38'>38</a>
|
|
104
|
+
<a name='L39'></a><a href='#L39'>39</a>
|
|
105
|
+
<a name='L40'></a><a href='#L40'>40</a>
|
|
106
|
+
<a name='L41'></a><a href='#L41'>41</a>
|
|
107
|
+
<a name='L42'></a><a href='#L42'>42</a>
|
|
108
|
+
<a name='L43'></a><a href='#L43'>43</a>
|
|
109
|
+
<a name='L44'></a><a href='#L44'>44</a>
|
|
110
|
+
<a name='L45'></a><a href='#L45'>45</a>
|
|
111
|
+
<a name='L46'></a><a href='#L46'>46</a>
|
|
112
|
+
<a name='L47'></a><a href='#L47'>47</a>
|
|
113
|
+
<a name='L48'></a><a href='#L48'>48</a>
|
|
114
|
+
<a name='L49'></a><a href='#L49'>49</a>
|
|
115
|
+
<a name='L50'></a><a href='#L50'>50</a>
|
|
116
|
+
<a name='L51'></a><a href='#L51'>51</a>
|
|
117
|
+
<a name='L52'></a><a href='#L52'>52</a>
|
|
118
|
+
<a name='L53'></a><a href='#L53'>53</a>
|
|
119
|
+
<a name='L54'></a><a href='#L54'>54</a>
|
|
120
|
+
<a name='L55'></a><a href='#L55'>55</a>
|
|
121
|
+
<a name='L56'></a><a href='#L56'>56</a>
|
|
122
|
+
<a name='L57'></a><a href='#L57'>57</a>
|
|
123
|
+
<a name='L58'></a><a href='#L58'>58</a>
|
|
124
|
+
<a name='L59'></a><a href='#L59'>59</a>
|
|
125
|
+
<a name='L60'></a><a href='#L60'>60</a>
|
|
126
|
+
<a name='L61'></a><a href='#L61'>61</a>
|
|
127
|
+
<a name='L62'></a><a href='#L62'>62</a>
|
|
128
|
+
<a name='L63'></a><a href='#L63'>63</a>
|
|
129
|
+
<a name='L64'></a><a href='#L64'>64</a>
|
|
130
|
+
<a name='L65'></a><a href='#L65'>65</a>
|
|
131
|
+
<a name='L66'></a><a href='#L66'>66</a>
|
|
132
|
+
<a name='L67'></a><a href='#L67'>67</a>
|
|
133
|
+
<a name='L68'></a><a href='#L68'>68</a>
|
|
134
|
+
<a name='L69'></a><a href='#L69'>69</a>
|
|
135
|
+
<a name='L70'></a><a href='#L70'>70</a>
|
|
136
|
+
<a name='L71'></a><a href='#L71'>71</a>
|
|
137
|
+
<a name='L72'></a><a href='#L72'>72</a>
|
|
138
|
+
<a name='L73'></a><a href='#L73'>73</a>
|
|
139
|
+
<a name='L74'></a><a href='#L74'>74</a>
|
|
140
|
+
<a name='L75'></a><a href='#L75'>75</a>
|
|
141
|
+
<a name='L76'></a><a href='#L76'>76</a>
|
|
142
|
+
<a name='L77'></a><a href='#L77'>77</a>
|
|
143
|
+
<a name='L78'></a><a href='#L78'>78</a>
|
|
144
|
+
<a name='L79'></a><a href='#L79'>79</a>
|
|
145
|
+
<a name='L80'></a><a href='#L80'>80</a>
|
|
146
|
+
<a name='L81'></a><a href='#L81'>81</a>
|
|
147
|
+
<a name='L82'></a><a href='#L82'>82</a>
|
|
148
|
+
<a name='L83'></a><a href='#L83'>83</a>
|
|
149
|
+
<a name='L84'></a><a href='#L84'>84</a>
|
|
150
|
+
<a name='L85'></a><a href='#L85'>85</a>
|
|
151
|
+
<a name='L86'></a><a href='#L86'>86</a>
|
|
152
|
+
<a name='L87'></a><a href='#L87'>87</a>
|
|
153
|
+
<a name='L88'></a><a href='#L88'>88</a>
|
|
154
|
+
<a name='L89'></a><a href='#L89'>89</a>
|
|
155
|
+
<a name='L90'></a><a href='#L90'>90</a>
|
|
156
|
+
<a name='L91'></a><a href='#L91'>91</a>
|
|
157
|
+
<a name='L92'></a><a href='#L92'>92</a>
|
|
158
|
+
<a name='L93'></a><a href='#L93'>93</a>
|
|
159
|
+
<a name='L94'></a><a href='#L94'>94</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
160
|
+
<span class="cline-any cline-neutral"> </span>
|
|
161
|
+
<span class="cline-any cline-neutral"> </span>
|
|
162
|
+
<span class="cline-any cline-neutral"> </span>
|
|
163
|
+
<span class="cline-any cline-neutral"> </span>
|
|
164
|
+
<span class="cline-any cline-neutral"> </span>
|
|
165
|
+
<span class="cline-any cline-neutral"> </span>
|
|
166
|
+
<span class="cline-any cline-neutral"> </span>
|
|
167
|
+
<span class="cline-any cline-yes">6x</span>
|
|
168
|
+
<span class="cline-any cline-neutral"> </span>
|
|
169
|
+
<span class="cline-any cline-neutral"> </span>
|
|
170
|
+
<span class="cline-any cline-yes">6x</span>
|
|
171
|
+
<span class="cline-any cline-neutral"> </span>
|
|
172
|
+
<span class="cline-any cline-neutral"> </span>
|
|
173
|
+
<span class="cline-any cline-neutral"> </span>
|
|
174
|
+
<span class="cline-any cline-neutral"> </span>
|
|
175
|
+
<span class="cline-any cline-neutral"> </span>
|
|
176
|
+
<span class="cline-any cline-neutral"> </span>
|
|
177
|
+
<span class="cline-any cline-neutral"> </span>
|
|
178
|
+
<span class="cline-any cline-neutral"> </span>
|
|
179
|
+
<span class="cline-any cline-neutral"> </span>
|
|
180
|
+
<span class="cline-any cline-neutral"> </span>
|
|
181
|
+
<span class="cline-any cline-neutral"> </span>
|
|
182
|
+
<span class="cline-any cline-yes">6x</span>
|
|
183
|
+
<span class="cline-any cline-neutral"> </span>
|
|
184
|
+
<span class="cline-any cline-neutral"> </span>
|
|
185
|
+
<span class="cline-any cline-neutral"> </span>
|
|
186
|
+
<span class="cline-any cline-neutral"> </span>
|
|
187
|
+
<span class="cline-any cline-neutral"> </span>
|
|
188
|
+
<span class="cline-any cline-neutral"> </span>
|
|
189
|
+
<span class="cline-any cline-neutral"> </span>
|
|
190
|
+
<span class="cline-any cline-neutral"> </span>
|
|
191
|
+
<span class="cline-any cline-neutral"> </span>
|
|
192
|
+
<span class="cline-any cline-neutral"> </span>
|
|
193
|
+
<span class="cline-any cline-neutral"> </span>
|
|
194
|
+
<span class="cline-any cline-neutral"> </span>
|
|
195
|
+
<span class="cline-any cline-yes">6x</span>
|
|
196
|
+
<span class="cline-any cline-neutral"> </span>
|
|
197
|
+
<span class="cline-any cline-neutral"> </span>
|
|
198
|
+
<span class="cline-any cline-neutral"> </span>
|
|
199
|
+
<span class="cline-any cline-neutral"> </span>
|
|
200
|
+
<span class="cline-any cline-neutral"> </span>
|
|
201
|
+
<span class="cline-any cline-neutral"> </span>
|
|
202
|
+
<span class="cline-any cline-neutral"> </span>
|
|
203
|
+
<span class="cline-any cline-neutral"> </span>
|
|
204
|
+
<span class="cline-any cline-yes">6x</span>
|
|
205
|
+
<span class="cline-any cline-neutral"> </span>
|
|
206
|
+
<span class="cline-any cline-neutral"> </span>
|
|
207
|
+
<span class="cline-any cline-neutral"> </span>
|
|
208
|
+
<span class="cline-any cline-neutral"> </span>
|
|
209
|
+
<span class="cline-any cline-neutral"> </span>
|
|
210
|
+
<span class="cline-any cline-neutral"> </span>
|
|
211
|
+
<span class="cline-any cline-neutral"> </span>
|
|
212
|
+
<span class="cline-any cline-neutral"> </span>
|
|
213
|
+
<span class="cline-any cline-neutral"> </span>
|
|
214
|
+
<span class="cline-any cline-neutral"> </span>
|
|
215
|
+
<span class="cline-any cline-neutral"> </span>
|
|
216
|
+
<span class="cline-any cline-neutral"> </span>
|
|
217
|
+
<span class="cline-any cline-yes">6x</span>
|
|
218
|
+
<span class="cline-any cline-neutral"> </span>
|
|
219
|
+
<span class="cline-any cline-neutral"> </span>
|
|
220
|
+
<span class="cline-any cline-neutral"> </span>
|
|
221
|
+
<span class="cline-any cline-neutral"> </span>
|
|
222
|
+
<span class="cline-any cline-neutral"> </span>
|
|
223
|
+
<span class="cline-any cline-neutral"> </span>
|
|
224
|
+
<span class="cline-any cline-neutral"> </span>
|
|
225
|
+
<span class="cline-any cline-neutral"> </span>
|
|
226
|
+
<span class="cline-any cline-neutral"> </span>
|
|
227
|
+
<span class="cline-any cline-neutral"> </span>
|
|
228
|
+
<span class="cline-any cline-neutral"> </span>
|
|
229
|
+
<span class="cline-any cline-neutral"> </span>
|
|
230
|
+
<span class="cline-any cline-neutral"> </span>
|
|
231
|
+
<span class="cline-any cline-neutral"> </span>
|
|
232
|
+
<span class="cline-any cline-neutral"> </span>
|
|
233
|
+
<span class="cline-any cline-neutral"> </span>
|
|
234
|
+
<span class="cline-any cline-yes">6x</span>
|
|
235
|
+
<span class="cline-any cline-neutral"> </span>
|
|
236
|
+
<span class="cline-any cline-neutral"> </span>
|
|
237
|
+
<span class="cline-any cline-neutral"> </span>
|
|
238
|
+
<span class="cline-any cline-neutral"> </span>
|
|
239
|
+
<span class="cline-any cline-neutral"> </span>
|
|
240
|
+
<span class="cline-any cline-neutral"> </span>
|
|
241
|
+
<span class="cline-any cline-neutral"> </span>
|
|
242
|
+
<span class="cline-any cline-neutral"> </span>
|
|
243
|
+
<span class="cline-any cline-neutral"> </span>
|
|
244
|
+
<span class="cline-any cline-neutral"> </span>
|
|
245
|
+
<span class="cline-any cline-yes">9x</span>
|
|
246
|
+
<span class="cline-any cline-yes">9x</span>
|
|
247
|
+
<span class="cline-any cline-yes">9x</span>
|
|
248
|
+
<span class="cline-any cline-yes">9x</span>
|
|
249
|
+
<span class="cline-any cline-yes">9x</span>
|
|
250
|
+
<span class="cline-any cline-neutral"> </span>
|
|
251
|
+
<span class="cline-any cline-neutral"> </span>
|
|
252
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/*
|
|
253
|
+
Copyright (c) 2025 Bernier LLC
|
|
254
|
+
|
|
255
|
+
This file is licensed to the client under a limited-use license.
|
|
256
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
257
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
import { z } from 'zod';
|
|
261
|
+
|
|
262
|
+
// Requirement statuses
|
|
263
|
+
export const RequirementStatusSchema = z.enum([
|
|
264
|
+
'IDEA',
|
|
265
|
+
'PLANNED',
|
|
266
|
+
'IN_PROGRESS',
|
|
267
|
+
'COMPLETED',
|
|
268
|
+
'CANCELLED',
|
|
269
|
+
'PAUSED'
|
|
270
|
+
]);
|
|
271
|
+
|
|
272
|
+
export type RequirementStatus = z.infer<typeof RequirementStatusSchema>;
|
|
273
|
+
|
|
274
|
+
// Task statuses
|
|
275
|
+
export const TaskStatusSchema = z.enum([
|
|
276
|
+
'TODO',
|
|
277
|
+
'READY',
|
|
278
|
+
'BLOCKED',
|
|
279
|
+
'IN_PROGRESS',
|
|
280
|
+
'COMPLETED',
|
|
281
|
+
'FAILED',
|
|
282
|
+
'PAUSED'
|
|
283
|
+
]);
|
|
284
|
+
|
|
285
|
+
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
|
|
286
|
+
|
|
287
|
+
// BrainGrid Project
|
|
288
|
+
export const BrainGridProjectSchema = z.object({
|
|
289
|
+
id: z.string(),
|
|
290
|
+
name: z.string(),
|
|
291
|
+
description: z.string().optional()
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
export type BrainGridProject = z.infer<typeof BrainGridProjectSchema>;
|
|
295
|
+
|
|
296
|
+
// BrainGrid Requirement
|
|
297
|
+
export const BrainGridRequirementSchema = z.object({
|
|
298
|
+
id: z.string(),
|
|
299
|
+
projectId: z.string(),
|
|
300
|
+
title: z.string(),
|
|
301
|
+
status: RequirementStatusSchema,
|
|
302
|
+
description: z.string().optional(),
|
|
303
|
+
createdAt: z.string().optional(),
|
|
304
|
+
updatedAt: z.string().optional()
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
export type BrainGridRequirement = z.infer<typeof BrainGridRequirementSchema>;
|
|
308
|
+
|
|
309
|
+
// BrainGrid Task
|
|
310
|
+
export const BrainGridTaskSchema = z.object({
|
|
311
|
+
id: z.string(),
|
|
312
|
+
reqId: z.string(),
|
|
313
|
+
title: z.string(),
|
|
314
|
+
status: TaskStatusSchema,
|
|
315
|
+
description: z.string().optional(),
|
|
316
|
+
tags: z.array(z.string()).optional(),
|
|
317
|
+
dependencies: z.array(z.string()).optional(),
|
|
318
|
+
assignedTo: z.string().optional(),
|
|
319
|
+
createdAt: z.string().optional(),
|
|
320
|
+
updatedAt: z.string().optional(),
|
|
321
|
+
metadata: z.record(z.unknown()).optional()
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export type BrainGridTask = z.infer<typeof BrainGridTaskSchema>;
|
|
325
|
+
|
|
326
|
+
// CLI Error
|
|
327
|
+
export class BrainGridCliError extends Error {
|
|
328
|
+
public command: string;
|
|
329
|
+
public exitCode: number;
|
|
330
|
+
public stderr: string;
|
|
331
|
+
|
|
332
|
+
constructor(
|
|
333
|
+
message: string,
|
|
334
|
+
command: string,
|
|
335
|
+
exitCode: number,
|
|
336
|
+
stderr: string
|
|
337
|
+
) {
|
|
338
|
+
super(message);
|
|
339
|
+
this.name = 'BrainGridCliError';
|
|
340
|
+
this.command = command;
|
|
341
|
+
this.exitCode = exitCode;
|
|
342
|
+
this.stderr = stderr;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
</pre></td></tr></table></pre>
|
|
346
|
+
|
|
347
|
+
<div class='push'></div><!-- for sticky footer -->
|
|
348
|
+
</div><!-- /wrapper -->
|
|
349
|
+
<div class='footer quiet pad2 space-top1 center small'>
|
|
350
|
+
Code coverage generated by
|
|
351
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
352
|
+
at 2025-11-22T01:47:59.191Z
|
|
353
|
+
</div>
|
|
354
|
+
<script src="../prettify.js"></script>
|
|
355
|
+
<script>
|
|
356
|
+
window.onload = function () {
|
|
357
|
+
prettyPrint();
|
|
358
|
+
};
|
|
359
|
+
</script>
|
|
360
|
+
<script src="../sorter.js"></script>
|
|
361
|
+
<script src="../block-navigation.js"></script>
|
|
362
|
+
</body>
|
|
363
|
+
</html>
|
|
364
|
+
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.runBrainGridCommand = runBrainGridCommand;
|
|
11
|
+
const execa_1 = require("execa");
|
|
12
|
+
const models_1 = require("./models");
|
|
13
|
+
/**
|
|
14
|
+
* Run a BrainGrid CLI command and return parsed JSON output
|
|
15
|
+
*/
|
|
16
|
+
async function runBrainGridCommand(args, options) {
|
|
17
|
+
const cliPath = process.env.BRAINGRID_CLI_PATH || 'braingrid';
|
|
18
|
+
try {
|
|
19
|
+
const result = await (0, execa_1.execa)(cliPath, args, {
|
|
20
|
+
cwd: options?.cwd,
|
|
21
|
+
env: {
|
|
22
|
+
...process.env,
|
|
23
|
+
...options?.env
|
|
24
|
+
},
|
|
25
|
+
timeout: 30000, // 30 second timeout
|
|
26
|
+
reject: false // Don't throw on non-zero exit
|
|
27
|
+
});
|
|
28
|
+
// Check for errors
|
|
29
|
+
if (result.exitCode !== 0) {
|
|
30
|
+
throw new models_1.BrainGridCliError(`BrainGrid CLI command failed: ${args.join(' ')}`, cliPath, result.exitCode, result.stderr);
|
|
31
|
+
}
|
|
32
|
+
// Try to parse JSON output
|
|
33
|
+
const stdout = result.stdout.trim();
|
|
34
|
+
if (!stdout) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
return JSON.parse(stdout);
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
// Not JSON output, return as-is
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof models_1.BrainGridCliError) {
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
// Handle execa errors
|
|
50
|
+
const execaError = error;
|
|
51
|
+
throw new models_1.BrainGridCliError(`Failed to execute BrainGrid CLI: ${execaError.message}`, cliPath, execaError.exitCode || -1, execaError.stderr || '');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createIdea = createIdea;
|
|
11
|
+
const cli_1 = require("../cli");
|
|
12
|
+
const models_1 = require("../models");
|
|
13
|
+
/**
|
|
14
|
+
* Create a new requirement (IDEA) in BrainGrid
|
|
15
|
+
*/
|
|
16
|
+
async function createIdea(prompt, projectId) {
|
|
17
|
+
const args = ['specify', prompt];
|
|
18
|
+
if (projectId) {
|
|
19
|
+
args.push('--project', projectId);
|
|
20
|
+
}
|
|
21
|
+
args.push('--format', 'json');
|
|
22
|
+
const result = await (0, cli_1.runBrainGridCommand)(args);
|
|
23
|
+
// Validate response
|
|
24
|
+
const parsed = models_1.BrainGridRequirementSchema.safeParse(result);
|
|
25
|
+
if (!parsed.success) {
|
|
26
|
+
throw new Error(`Invalid BrainGrid response: ${parsed.error.message}`);
|
|
27
|
+
}
|
|
28
|
+
return parsed.data;
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BrainGridTask } from '../models';
|
|
2
|
+
export interface CreateTaskOptions {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
tags?: string[];
|
|
6
|
+
dependencies?: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Create a task in BrainGrid under a requirement
|
|
10
|
+
*/
|
|
11
|
+
export declare function createTask(reqId: string, options: CreateTaskOptions): Promise<BrainGridTask>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createTask = createTask;
|
|
11
|
+
const cli_1 = require("../cli");
|
|
12
|
+
const models_1 = require("../models");
|
|
13
|
+
/**
|
|
14
|
+
* Create a task in BrainGrid under a requirement
|
|
15
|
+
*/
|
|
16
|
+
async function createTask(reqId, options) {
|
|
17
|
+
const args = ['task', 'create', reqId, '--title', options.title];
|
|
18
|
+
if (options.description) {
|
|
19
|
+
args.push('--description', options.description);
|
|
20
|
+
}
|
|
21
|
+
if (options.tags && options.tags.length > 0) {
|
|
22
|
+
args.push('--tags', options.tags.join(','));
|
|
23
|
+
}
|
|
24
|
+
if (options.dependencies && options.dependencies.length > 0) {
|
|
25
|
+
args.push('--dependencies', options.dependencies.join(','));
|
|
26
|
+
}
|
|
27
|
+
args.push('--format', 'json');
|
|
28
|
+
const result = await (0, cli_1.runBrainGridCommand)(args);
|
|
29
|
+
const parsed = models_1.BrainGridTaskSchema.safeParse(result);
|
|
30
|
+
if (!parsed.success) {
|
|
31
|
+
throw new Error(`Invalid BrainGrid response: ${parsed.error.message}`);
|
|
32
|
+
}
|
|
33
|
+
return parsed.data;
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.listProjects = listProjects;
|
|
11
|
+
const cli_1 = require("../cli");
|
|
12
|
+
const models_1 = require("../models");
|
|
13
|
+
const zod_1 = require("zod");
|
|
14
|
+
/**
|
|
15
|
+
* List all projects in BrainGrid
|
|
16
|
+
*/
|
|
17
|
+
async function listProjects() {
|
|
18
|
+
const result = await (0, cli_1.runBrainGridCommand)(['projects', 'list', '--format', 'json']);
|
|
19
|
+
const parsed = zod_1.z.array(models_1.BrainGridProjectSchema).safeParse(result);
|
|
20
|
+
if (!parsed.success) {
|
|
21
|
+
throw new Error(`Invalid BrainGrid response: ${parsed.error.message}`);
|
|
22
|
+
}
|
|
23
|
+
return parsed.data;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BrainGridTask, TaskStatus } from '../models';
|
|
2
|
+
export interface ListTasksOptions {
|
|
3
|
+
reqId?: string;
|
|
4
|
+
status?: TaskStatus[];
|
|
5
|
+
tags?: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* List tasks in BrainGrid with optional filters
|
|
9
|
+
*/
|
|
10
|
+
export declare function listTasks(options?: ListTasksOptions): Promise<BrainGridTask[]>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.listTasks = listTasks;
|
|
11
|
+
const cli_1 = require("../cli");
|
|
12
|
+
const models_1 = require("../models");
|
|
13
|
+
const zod_1 = require("zod");
|
|
14
|
+
/**
|
|
15
|
+
* List tasks in BrainGrid with optional filters
|
|
16
|
+
*/
|
|
17
|
+
async function listTasks(options = {}) {
|
|
18
|
+
const args = ['task', 'list'];
|
|
19
|
+
if (options.reqId) {
|
|
20
|
+
args.push('--req', options.reqId);
|
|
21
|
+
}
|
|
22
|
+
if (options.status && options.status.length > 0) {
|
|
23
|
+
args.push('--status', options.status.join(','));
|
|
24
|
+
}
|
|
25
|
+
if (options.tags && options.tags.length > 0) {
|
|
26
|
+
args.push('--tags', options.tags.join(','));
|
|
27
|
+
}
|
|
28
|
+
args.push('--format', 'json');
|
|
29
|
+
const result = await (0, cli_1.runBrainGridCommand)(args);
|
|
30
|
+
const parsed = zod_1.z.array(models_1.BrainGridTaskSchema).safeParse(result);
|
|
31
|
+
if (!parsed.success) {
|
|
32
|
+
throw new Error(`Invalid BrainGrid response: ${parsed.error.message}`);
|
|
33
|
+
}
|
|
34
|
+
return parsed.data;
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TaskStatus } from '../models';
|
|
2
|
+
export interface UpdateTaskOptions {
|
|
3
|
+
status?: TaskStatus;
|
|
4
|
+
assignedTo?: string;
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Update task status and metadata in BrainGrid
|
|
9
|
+
*/
|
|
10
|
+
export declare function updateTaskStatus(taskId: string, options: UpdateTaskOptions): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.updateTaskStatus = updateTaskStatus;
|
|
11
|
+
const cli_1 = require("../cli");
|
|
12
|
+
/**
|
|
13
|
+
* Update task status and metadata in BrainGrid
|
|
14
|
+
*/
|
|
15
|
+
async function updateTaskStatus(taskId, options) {
|
|
16
|
+
const args = ['task', 'update', taskId];
|
|
17
|
+
if (options.status) {
|
|
18
|
+
args.push('--status', options.status);
|
|
19
|
+
}
|
|
20
|
+
if (options.assignedTo) {
|
|
21
|
+
args.push('--assigned-to', options.assignedTo);
|
|
22
|
+
}
|
|
23
|
+
if (options.metadata) {
|
|
24
|
+
args.push('--metadata', JSON.stringify(options.metadata));
|
|
25
|
+
}
|
|
26
|
+
await (0, cli_1.runBrainGridCommand)(args);
|
|
27
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BrainGridProject, BrainGridRequirement, BrainGridTask, RequirementStatus, TaskStatus, BrainGridProjectSchema, BrainGridRequirementSchema, BrainGridTaskSchema, BrainGridCliError } from './models';
|
|
2
|
+
export { createIdea } from './commands/createIdea';
|
|
3
|
+
export { listProjects } from './commands/listProjects';
|
|
4
|
+
export { createTask, CreateTaskOptions } from './commands/createTask';
|
|
5
|
+
export { updateTaskStatus, UpdateTaskOptions } from './commands/updateTaskStatus';
|
|
6
|
+
export { listTasks, ListTasksOptions } from './commands/listTasks';
|