@girardmedia/bootspring 2.0.21 → 2.0.23

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.
Files changed (159) hide show
  1. package/bin/bootspring.js +5 -0
  2. package/cli/org.js +474 -0
  3. package/cli/preseed/index.js +16 -0
  4. package/cli/preseed/interactive.js +143 -0
  5. package/cli/preseed/templates.js +227 -0
  6. package/cli/preseed.js +9 -301
  7. package/cli/seed/builders/ai-context-builder.js +85 -0
  8. package/cli/seed/builders/index.js +13 -0
  9. package/cli/seed/builders/seed-builder.js +272 -0
  10. package/cli/seed/extractors/content-extractors.js +383 -0
  11. package/cli/seed/extractors/index.js +47 -0
  12. package/cli/seed/extractors/metadata-extractors.js +167 -0
  13. package/cli/seed/extractors/section-extractor.js +54 -0
  14. package/cli/seed/extractors/stack-extractors.js +228 -0
  15. package/cli/seed/index.js +18 -0
  16. package/cli/seed/utils/folder-structure.js +84 -0
  17. package/cli/seed/utils/index.js +11 -0
  18. package/cli/seed.js +23 -1074
  19. package/core/api-client.js +77 -0
  20. package/core/entitlements.js +36 -0
  21. package/core/organizations.js +223 -0
  22. package/core/policies.js +51 -6
  23. package/core/policy-matrix.js +303 -0
  24. package/core/project-context.js +1 -0
  25. package/dist/cli/index.d.ts +3 -0
  26. package/dist/cli/index.js +3220 -0
  27. package/dist/cli/index.js.map +1 -0
  28. package/dist/context-McpJQa_2.d.ts +5710 -0
  29. package/dist/core/index.d.ts +635 -0
  30. package/dist/core/index.js +2593 -0
  31. package/dist/core/index.js.map +1 -0
  32. package/dist/index-QqbeEiDm.d.ts +857 -0
  33. package/dist/index-UiYCgwiH.d.ts +174 -0
  34. package/dist/index.d.ts +453 -0
  35. package/dist/index.js +44228 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/mcp/index.d.ts +1 -0
  38. package/dist/mcp/index.js +41173 -0
  39. package/dist/mcp/index.js.map +1 -0
  40. package/generators/index.ts +82 -0
  41. package/intelligence/orchestrator/config/failure-signatures.js +48 -0
  42. package/intelligence/orchestrator/config/index.js +23 -0
  43. package/intelligence/orchestrator/config/pack-lifecycle.js +262 -0
  44. package/intelligence/orchestrator/config/phases.js +111 -0
  45. package/intelligence/orchestrator/config/remediation.js +150 -0
  46. package/intelligence/orchestrator/config/workflows.js +168 -0
  47. package/intelligence/orchestrator/core/index.js +16 -0
  48. package/intelligence/orchestrator/core/state-manager.js +88 -0
  49. package/intelligence/orchestrator/core/telemetry.js +24 -0
  50. package/intelligence/orchestrator/index.js +17 -0
  51. package/intelligence/orchestrator.js +17 -512
  52. package/mcp/contracts/mcp-contract.v1.json +1 -1
  53. package/package.json +16 -3
  54. package/src/cli/agent.ts +703 -0
  55. package/src/cli/analyze.ts +640 -0
  56. package/src/cli/audit.ts +707 -0
  57. package/src/cli/auth.ts +930 -0
  58. package/src/cli/billing.ts +364 -0
  59. package/src/cli/build.ts +1089 -0
  60. package/src/cli/business.ts +508 -0
  61. package/src/cli/checkpoint-utils.ts +236 -0
  62. package/src/cli/checkpoint.ts +757 -0
  63. package/src/cli/cloud-sync.ts +534 -0
  64. package/src/cli/content.ts +273 -0
  65. package/src/cli/context.ts +667 -0
  66. package/src/cli/dashboard.ts +133 -0
  67. package/src/cli/deploy.ts +704 -0
  68. package/src/cli/doctor.ts +480 -0
  69. package/src/cli/fundraise.ts +494 -0
  70. package/src/cli/generate.ts +346 -0
  71. package/src/cli/github-cmd.ts +566 -0
  72. package/src/cli/health.ts +599 -0
  73. package/src/cli/index.ts +113 -0
  74. package/src/cli/init.ts +838 -0
  75. package/src/cli/legal.ts +495 -0
  76. package/src/cli/log.ts +316 -0
  77. package/src/cli/loop.ts +1660 -0
  78. package/src/cli/manager.ts +878 -0
  79. package/src/cli/mcp.ts +275 -0
  80. package/src/cli/memory.ts +346 -0
  81. package/src/cli/metrics.ts +590 -0
  82. package/src/cli/monitor.ts +960 -0
  83. package/src/cli/mvp.ts +662 -0
  84. package/src/cli/onboard.ts +663 -0
  85. package/src/cli/orchestrator.ts +622 -0
  86. package/src/cli/plugin.ts +483 -0
  87. package/src/cli/prd.ts +671 -0
  88. package/src/cli/preseed-start.ts +1633 -0
  89. package/src/cli/preseed.ts +2434 -0
  90. package/src/cli/project.ts +526 -0
  91. package/src/cli/quality.ts +885 -0
  92. package/src/cli/security.ts +1079 -0
  93. package/src/cli/seed.ts +1224 -0
  94. package/src/cli/skill.ts +537 -0
  95. package/src/cli/suggest.ts +1225 -0
  96. package/src/cli/switch.ts +518 -0
  97. package/src/cli/task.ts +780 -0
  98. package/src/cli/telemetry.ts +172 -0
  99. package/src/cli/todo.ts +627 -0
  100. package/src/cli/types.ts +15 -0
  101. package/src/cli/update.ts +334 -0
  102. package/src/cli/visualize.ts +609 -0
  103. package/src/cli/watch.ts +895 -0
  104. package/src/cli/workspace.ts +709 -0
  105. package/src/core/action-recorder.ts +673 -0
  106. package/src/core/analyze-workflow.ts +1453 -0
  107. package/src/core/api-client.ts +1120 -0
  108. package/src/core/audit-workflow.ts +1681 -0
  109. package/src/core/auth.ts +471 -0
  110. package/src/core/build-orchestrator.ts +509 -0
  111. package/src/core/build-state.ts +621 -0
  112. package/src/core/checkpoint-engine.ts +482 -0
  113. package/src/core/config.ts +1285 -0
  114. package/src/core/context-loader.ts +694 -0
  115. package/src/core/context.ts +410 -0
  116. package/src/core/deploy-workflow.ts +1085 -0
  117. package/src/core/entitlements.ts +322 -0
  118. package/src/core/github-sync.ts +720 -0
  119. package/src/core/index.ts +981 -0
  120. package/src/core/ingest.ts +1186 -0
  121. package/src/core/metrics-engine.ts +886 -0
  122. package/src/core/mvp.ts +847 -0
  123. package/src/core/onboard-workflow.ts +1293 -0
  124. package/src/core/policies.ts +81 -0
  125. package/src/core/preseed-workflow.ts +1163 -0
  126. package/src/core/preseed.ts +1826 -0
  127. package/src/core/project-context.ts +380 -0
  128. package/src/core/project-state.ts +699 -0
  129. package/src/core/r2-sync.ts +691 -0
  130. package/src/core/scaffold.ts +1715 -0
  131. package/src/core/session.ts +286 -0
  132. package/src/core/task-extractor.ts +799 -0
  133. package/src/core/telemetry.ts +371 -0
  134. package/src/core/tier-enforcement.ts +737 -0
  135. package/src/core/utils.ts +437 -0
  136. package/src/index.ts +29 -0
  137. package/src/intelligence/agent-collab.ts +2376 -0
  138. package/src/intelligence/auto-suggest.ts +713 -0
  139. package/src/intelligence/content-gen.ts +1351 -0
  140. package/src/intelligence/cross-project.ts +1692 -0
  141. package/src/intelligence/git-memory.ts +529 -0
  142. package/src/intelligence/index.ts +318 -0
  143. package/src/intelligence/orchestrator.ts +534 -0
  144. package/src/intelligence/prd.ts +466 -0
  145. package/src/intelligence/recommendations.ts +982 -0
  146. package/src/intelligence/workflow-composer.ts +1472 -0
  147. package/src/mcp/capabilities.ts +233 -0
  148. package/src/mcp/index.ts +37 -0
  149. package/src/mcp/registry.ts +1268 -0
  150. package/src/mcp/response-formatter.ts +797 -0
  151. package/src/mcp/server.ts +240 -0
  152. package/src/types/agent.ts +69 -0
  153. package/src/types/config.ts +86 -0
  154. package/src/types/context.ts +77 -0
  155. package/src/types/index.ts +53 -0
  156. package/src/types/mcp.ts +91 -0
  157. package/src/types/skills.ts +47 -0
  158. package/src/types/workflow.ts +155 -0
  159. package/generators/index.js +0 -18
package/src/cli/log.ts ADDED
@@ -0,0 +1,316 @@
1
+ /**
2
+ * Bootspring Log Command
3
+ * View and manage action logs
4
+ *
5
+ * Commands:
6
+ * list List recent actions
7
+ * search <query> Search action logs
8
+ * show <filename> View a specific log
9
+ * export Export logs to a directory
10
+ * clear Clear old logs
11
+ *
12
+ * @package bootspring
13
+ * @module cli/log
14
+ */
15
+
16
+ // Import JS modules with type interfaces
17
+ interface LogEntry {
18
+ type: string;
19
+ timestamp: string;
20
+ agent?: string;
21
+ title?: string;
22
+ filename: string;
23
+ }
24
+
25
+ interface SearchResult {
26
+ type: string;
27
+ file: string;
28
+ matches?: Array<{
29
+ line: number;
30
+ preview: string;
31
+ }>;
32
+ }
33
+
34
+ interface LogDetails {
35
+ type: string;
36
+ relativePath: string;
37
+ content: string;
38
+ metadata?: {
39
+ size: number;
40
+ modifiedRelative: string;
41
+ };
42
+ }
43
+
44
+ interface ActionRecorderModule {
45
+ list(options: { type?: string | undefined; limit?: number | undefined }): LogEntry[];
46
+ search(query: string, options: { limit?: number | undefined }): SearchResult[];
47
+ get(filename: string): LogDetails | null;
48
+ exportLogs(outputDir: string): { count: number; outputDir: string };
49
+ clearOld(options: { olderThanDays: number }): { deleted: number };
50
+ }
51
+
52
+ interface ParsedArgs {
53
+ _: string[];
54
+ type?: string;
55
+ limit?: string;
56
+ output?: string;
57
+ o?: string;
58
+ days?: string;
59
+ force?: boolean;
60
+ f?: boolean;
61
+ }
62
+
63
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
64
+ const actionRecorder = require('../../core/action-recorder') as ActionRecorderModule;
65
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
66
+ const utils = require('../../core/utils') as typeof import('../core/utils');
67
+
68
+ /**
69
+ * Run log command
70
+ */
71
+ export async function run(args: string[]): Promise<void> {
72
+ const parsedArgs = utils.parseArgs(args) as ParsedArgs;
73
+ const subcommand = parsedArgs._[0] || 'list';
74
+ const subArgs = args.slice(1);
75
+
76
+ switch (subcommand) {
77
+ case 'list':
78
+ case 'ls':
79
+ listLogs(parsedArgs);
80
+ return;
81
+ case 'search':
82
+ case 'find':
83
+ searchLogs(subArgs);
84
+ return;
85
+ case 'show':
86
+ case 'get':
87
+ case 'view':
88
+ showLog(subArgs);
89
+ return;
90
+ case 'export':
91
+ exportLogs(parsedArgs);
92
+ return;
93
+ case 'clear':
94
+ case 'clean':
95
+ clearLogs(parsedArgs);
96
+ return;
97
+ case 'help':
98
+ case '-h':
99
+ case '--help':
100
+ showHelp();
101
+ return;
102
+ default:
103
+ utils.print.error(`Unknown subcommand: ${subcommand}`);
104
+ showHelp();
105
+ }
106
+ }
107
+
108
+ /**
109
+ * List recent action logs
110
+ */
111
+ function listLogs(args: ParsedArgs): void {
112
+ utils.print.header('Action Logs');
113
+
114
+ const type = args.type;
115
+ const limit = args.limit ? parseInt(args.limit, 10) : 20;
116
+
117
+ const logs = actionRecorder.list({ type, limit });
118
+
119
+ if (logs.length === 0) {
120
+ utils.print.info('No action logs found');
121
+ utils.print.dim('Actions are automatically recorded when you use bootspring');
122
+ return;
123
+ }
124
+
125
+ // Group by type
126
+ const grouped: Record<string, LogEntry[]> = {};
127
+ for (const log of logs) {
128
+ if (!grouped[log.type]) {
129
+ grouped[log.type] = [];
130
+ }
131
+ const group = grouped[log.type];
132
+ if (group) {
133
+ group.push(log);
134
+ }
135
+ }
136
+
137
+ for (const [logType, entries] of Object.entries(grouped)) {
138
+ console.log(`\n${utils.COLORS.bold}${logType}${utils.COLORS.reset} (${entries.length})`);
139
+
140
+ for (const entry of entries) {
141
+ const time = new Date(entry.timestamp).toLocaleString();
142
+ const agent = entry.agent ? ` [${entry.agent}]` : '';
143
+ const title = entry.title || entry.filename;
144
+
145
+ console.log(` ${utils.COLORS.dim}${time}${utils.COLORS.reset}${agent} ${title}`);
146
+ }
147
+ }
148
+
149
+ console.log(`\n${utils.COLORS.dim}Total: ${logs.length} entries${utils.COLORS.reset}`);
150
+ }
151
+
152
+ /**
153
+ * Search action logs
154
+ */
155
+ function searchLogs(args: string[]): void {
156
+ const parsedArgs = utils.parseArgs(args) as ParsedArgs;
157
+ const query = parsedArgs._[0];
158
+
159
+ if (!query) {
160
+ utils.print.error('Please specify a search query');
161
+ utils.print.dim('Example: bootspring log search "authentication"');
162
+ return;
163
+ }
164
+
165
+ utils.print.header(`Searching logs for: ${query}`);
166
+
167
+ const limit = parsedArgs.limit ? parseInt(parsedArgs.limit, 10) : 20;
168
+ const results = actionRecorder.search(query, { limit });
169
+
170
+ if (results.length === 0) {
171
+ utils.print.warning('No results found');
172
+ return;
173
+ }
174
+
175
+ console.log(`${utils.COLORS.dim}Found ${results.length} result(s)${utils.COLORS.reset}\n`);
176
+
177
+ for (const result of results) {
178
+ console.log(`${utils.COLORS.bold}${result.type}${utils.COLORS.reset}: ${result.file}`);
179
+
180
+ if (result.matches) {
181
+ for (const match of result.matches) {
182
+ console.log(` ${utils.COLORS.dim}L${match.line}:${utils.COLORS.reset} ${highlightMatch(match.preview, query)}`);
183
+ }
184
+ }
185
+ console.log('');
186
+ }
187
+ }
188
+
189
+ /**
190
+ * Show a specific log entry
191
+ */
192
+ function showLog(args: string[]): void {
193
+ const parsedArgs = utils.parseArgs(args) as ParsedArgs;
194
+ const filename = parsedArgs._[0];
195
+
196
+ if (!filename) {
197
+ utils.print.error('Please specify a log filename');
198
+ utils.print.dim('Example: bootspring log show 2026-02-16-12-30-00-agent.md');
199
+ return;
200
+ }
201
+
202
+ const log = actionRecorder.get(filename);
203
+
204
+ if (!log) {
205
+ utils.print.error(`Log not found: ${filename}`);
206
+ return;
207
+ }
208
+
209
+ utils.print.header(`Log: ${filename}`);
210
+ console.log(`${utils.COLORS.dim}Type: ${log.type} | Path: ${log.relativePath}${utils.COLORS.reset}\n`);
211
+
212
+ if (log.metadata) {
213
+ console.log(`${utils.COLORS.dim}Size: ${formatSize(log.metadata.size)} | Modified: ${log.metadata.modifiedRelative}${utils.COLORS.reset}\n`);
214
+ }
215
+
216
+ console.log(log.content);
217
+ }
218
+
219
+ /**
220
+ * Export logs to a directory
221
+ */
222
+ function exportLogs(args: ParsedArgs): void {
223
+ const outputDir = args.output || args.o || './bootspring-logs-export';
224
+
225
+ const spinner = utils.createSpinner('Exporting logs...').start();
226
+
227
+ try {
228
+ const result = actionRecorder.exportLogs(outputDir);
229
+ spinner.succeed(`Exported ${result.count} logs to ${result.outputDir}`);
230
+ } catch (error) {
231
+ spinner.fail(`Export failed: ${(error as Error).message}`);
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Clear old logs
237
+ */
238
+ function clearLogs(args: ParsedArgs): void {
239
+ const days = args.days ? parseInt(args.days, 10) : 30;
240
+ const force = args.force || args.f;
241
+
242
+ if (!force) {
243
+ utils.print.warning(`This will delete logs older than ${days} days`);
244
+ utils.print.dim('Use --force to confirm');
245
+ return;
246
+ }
247
+
248
+ const spinner = utils.createSpinner('Clearing old logs...').start();
249
+
250
+ try {
251
+ const result = actionRecorder.clearOld({ olderThanDays: days });
252
+ spinner.succeed(`Deleted ${result.deleted} old log entries`);
253
+ } catch (error) {
254
+ spinner.fail(`Clear failed: ${(error as Error).message}`);
255
+ }
256
+ }
257
+
258
+ /**
259
+ * Show help
260
+ */
261
+ function showHelp(): void {
262
+ console.log(`
263
+ ${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Bootspring Log${utils.COLORS.reset}
264
+ ${utils.COLORS.dim}View and manage action logs${utils.COLORS.reset}
265
+
266
+ ${utils.COLORS.bold}Usage:${utils.COLORS.reset}
267
+ bootspring log <command> [options]
268
+
269
+ ${utils.COLORS.bold}Commands:${utils.COLORS.reset}
270
+ ${utils.COLORS.cyan}list${utils.COLORS.reset} List recent actions (default)
271
+ ${utils.COLORS.cyan}search <query>${utils.COLORS.reset} Search action logs
272
+ ${utils.COLORS.cyan}show <filename>${utils.COLORS.reset} View a specific log
273
+ ${utils.COLORS.cyan}export${utils.COLORS.reset} Export logs to a directory
274
+ ${utils.COLORS.cyan}clear${utils.COLORS.reset} Clear old logs
275
+
276
+ ${utils.COLORS.bold}Options:${utils.COLORS.reset}
277
+ --type=<type> Filter by log type (agent, code, decision, fix, business, meeting)
278
+ --limit=<n> Limit results (default: 20)
279
+ --output=<dir> Export output directory
280
+ --days=<n> Clear logs older than N days (default: 30)
281
+ --force Confirm destructive actions
282
+
283
+ ${utils.COLORS.bold}Log Types:${utils.COLORS.reset}
284
+ agent Agent invocation logs
285
+ code Code generation logs
286
+ decision Decision records
287
+ fix Bug fix documentation
288
+ business Business action logs
289
+ meeting Meeting notes
290
+
291
+ ${utils.COLORS.bold}Examples:${utils.COLORS.reset}
292
+ bootspring log
293
+ bootspring log list --type=agent
294
+ bootspring log search "authentication"
295
+ bootspring log show 2026-02-16-agent-frontend.md
296
+ bootspring log export --output=./logs
297
+ bootspring log clear --days=60 --force
298
+ `);
299
+ }
300
+
301
+ /**
302
+ * Format file size
303
+ */
304
+ function formatSize(bytes: number): string {
305
+ if (bytes < 1024) return `${bytes}B`;
306
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
307
+ return `${(bytes / 1024 / 1024).toFixed(1)}MB`;
308
+ }
309
+
310
+ /**
311
+ * Highlight search match in text
312
+ */
313
+ function highlightMatch(text: string, query: string): string {
314
+ const regex = new RegExp(`(${query})`, 'gi');
315
+ return text.replace(regex, `${utils.COLORS.yellow}$1${utils.COLORS.reset}`);
316
+ }