@girardmedia/bootspring 2.0.21 → 2.0.22

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 (147) hide show
  1. package/cli/preseed/index.js +16 -0
  2. package/cli/preseed/interactive.js +143 -0
  3. package/cli/preseed/templates.js +227 -0
  4. package/cli/seed/builders/ai-context-builder.js +85 -0
  5. package/cli/seed/builders/index.js +13 -0
  6. package/cli/seed/builders/seed-builder.js +272 -0
  7. package/cli/seed/extractors/content-extractors.js +383 -0
  8. package/cli/seed/extractors/index.js +47 -0
  9. package/cli/seed/extractors/metadata-extractors.js +167 -0
  10. package/cli/seed/extractors/section-extractor.js +54 -0
  11. package/cli/seed/extractors/stack-extractors.js +228 -0
  12. package/cli/seed/index.js +18 -0
  13. package/cli/seed/utils/folder-structure.js +84 -0
  14. package/cli/seed/utils/index.js +11 -0
  15. package/dist/cli/index.d.ts +3 -0
  16. package/dist/cli/index.js +3220 -0
  17. package/dist/cli/index.js.map +1 -0
  18. package/dist/context-McpJQa_2.d.ts +5710 -0
  19. package/dist/core/index.d.ts +635 -0
  20. package/dist/core/index.js +2593 -0
  21. package/dist/core/index.js.map +1 -0
  22. package/dist/index-QqbeEiDm.d.ts +857 -0
  23. package/dist/index-UiYCgwiH.d.ts +174 -0
  24. package/dist/index.d.ts +453 -0
  25. package/dist/index.js +44228 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/mcp/index.d.ts +1 -0
  28. package/dist/mcp/index.js +41173 -0
  29. package/dist/mcp/index.js.map +1 -0
  30. package/generators/index.ts +82 -0
  31. package/intelligence/orchestrator/config/failure-signatures.js +48 -0
  32. package/intelligence/orchestrator/config/index.js +20 -0
  33. package/intelligence/orchestrator/config/phases.js +111 -0
  34. package/intelligence/orchestrator/config/remediation.js +150 -0
  35. package/intelligence/orchestrator/config/workflows.js +168 -0
  36. package/intelligence/orchestrator/core/index.js +16 -0
  37. package/intelligence/orchestrator/core/state-manager.js +88 -0
  38. package/intelligence/orchestrator/core/telemetry.js +24 -0
  39. package/intelligence/orchestrator/index.js +17 -0
  40. package/mcp/contracts/mcp-contract.v1.json +1 -1
  41. package/package.json +16 -3
  42. package/src/cli/agent.ts +703 -0
  43. package/src/cli/analyze.ts +640 -0
  44. package/src/cli/audit.ts +707 -0
  45. package/src/cli/auth.ts +930 -0
  46. package/src/cli/billing.ts +364 -0
  47. package/src/cli/build.ts +1089 -0
  48. package/src/cli/business.ts +508 -0
  49. package/src/cli/checkpoint-utils.ts +236 -0
  50. package/src/cli/checkpoint.ts +757 -0
  51. package/src/cli/cloud-sync.ts +534 -0
  52. package/src/cli/content.ts +273 -0
  53. package/src/cli/context.ts +667 -0
  54. package/src/cli/dashboard.ts +133 -0
  55. package/src/cli/deploy.ts +704 -0
  56. package/src/cli/doctor.ts +480 -0
  57. package/src/cli/fundraise.ts +494 -0
  58. package/src/cli/generate.ts +346 -0
  59. package/src/cli/github-cmd.ts +566 -0
  60. package/src/cli/health.ts +599 -0
  61. package/src/cli/index.ts +113 -0
  62. package/src/cli/init.ts +838 -0
  63. package/src/cli/legal.ts +495 -0
  64. package/src/cli/log.ts +316 -0
  65. package/src/cli/loop.ts +1660 -0
  66. package/src/cli/manager.ts +878 -0
  67. package/src/cli/mcp.ts +275 -0
  68. package/src/cli/memory.ts +346 -0
  69. package/src/cli/metrics.ts +590 -0
  70. package/src/cli/monitor.ts +960 -0
  71. package/src/cli/mvp.ts +662 -0
  72. package/src/cli/onboard.ts +663 -0
  73. package/src/cli/orchestrator.ts +622 -0
  74. package/src/cli/plugin.ts +483 -0
  75. package/src/cli/prd.ts +671 -0
  76. package/src/cli/preseed-start.ts +1633 -0
  77. package/src/cli/preseed.ts +2434 -0
  78. package/src/cli/project.ts +526 -0
  79. package/src/cli/quality.ts +885 -0
  80. package/src/cli/security.ts +1079 -0
  81. package/src/cli/seed.ts +1224 -0
  82. package/src/cli/skill.ts +537 -0
  83. package/src/cli/suggest.ts +1225 -0
  84. package/src/cli/switch.ts +518 -0
  85. package/src/cli/task.ts +780 -0
  86. package/src/cli/telemetry.ts +172 -0
  87. package/src/cli/todo.ts +627 -0
  88. package/src/cli/types.ts +15 -0
  89. package/src/cli/update.ts +334 -0
  90. package/src/cli/visualize.ts +609 -0
  91. package/src/cli/watch.ts +895 -0
  92. package/src/cli/workspace.ts +709 -0
  93. package/src/core/action-recorder.ts +673 -0
  94. package/src/core/analyze-workflow.ts +1453 -0
  95. package/src/core/api-client.ts +1120 -0
  96. package/src/core/audit-workflow.ts +1681 -0
  97. package/src/core/auth.ts +471 -0
  98. package/src/core/build-orchestrator.ts +509 -0
  99. package/src/core/build-state.ts +621 -0
  100. package/src/core/checkpoint-engine.ts +482 -0
  101. package/src/core/config.ts +1285 -0
  102. package/src/core/context-loader.ts +694 -0
  103. package/src/core/context.ts +410 -0
  104. package/src/core/deploy-workflow.ts +1085 -0
  105. package/src/core/entitlements.ts +322 -0
  106. package/src/core/github-sync.ts +720 -0
  107. package/src/core/index.ts +981 -0
  108. package/src/core/ingest.ts +1186 -0
  109. package/src/core/metrics-engine.ts +886 -0
  110. package/src/core/mvp.ts +847 -0
  111. package/src/core/onboard-workflow.ts +1293 -0
  112. package/src/core/policies.ts +81 -0
  113. package/src/core/preseed-workflow.ts +1163 -0
  114. package/src/core/preseed.ts +1826 -0
  115. package/src/core/project-context.ts +380 -0
  116. package/src/core/project-state.ts +699 -0
  117. package/src/core/r2-sync.ts +691 -0
  118. package/src/core/scaffold.ts +1715 -0
  119. package/src/core/session.ts +286 -0
  120. package/src/core/task-extractor.ts +799 -0
  121. package/src/core/telemetry.ts +371 -0
  122. package/src/core/tier-enforcement.ts +737 -0
  123. package/src/core/utils.ts +437 -0
  124. package/src/index.ts +29 -0
  125. package/src/intelligence/agent-collab.ts +2376 -0
  126. package/src/intelligence/auto-suggest.ts +713 -0
  127. package/src/intelligence/content-gen.ts +1351 -0
  128. package/src/intelligence/cross-project.ts +1692 -0
  129. package/src/intelligence/git-memory.ts +529 -0
  130. package/src/intelligence/index.ts +318 -0
  131. package/src/intelligence/orchestrator.ts +534 -0
  132. package/src/intelligence/prd.ts +466 -0
  133. package/src/intelligence/recommendations.ts +982 -0
  134. package/src/intelligence/workflow-composer.ts +1472 -0
  135. package/src/mcp/capabilities.ts +233 -0
  136. package/src/mcp/index.ts +37 -0
  137. package/src/mcp/registry.ts +1268 -0
  138. package/src/mcp/response-formatter.ts +797 -0
  139. package/src/mcp/server.ts +240 -0
  140. package/src/types/agent.ts +69 -0
  141. package/src/types/config.ts +86 -0
  142. package/src/types/context.ts +77 -0
  143. package/src/types/index.ts +53 -0
  144. package/src/types/mcp.ts +91 -0
  145. package/src/types/skills.ts +47 -0
  146. package/src/types/workflow.ts +155 -0
  147. package/generators/index.js +0 -18
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Bootspring Content Command
3
+ * Generate and manage content (blogs, docs, release notes, etc.)
4
+ *
5
+ * @package bootspring
6
+ * @command content
7
+ */
8
+
9
+ import * as path from 'path';
10
+ import * as fs from 'fs';
11
+
12
+ // Type interfaces for JS modules
13
+ interface Colors {
14
+ reset: string;
15
+ bold: string;
16
+ dim: string;
17
+ cyan: string;
18
+ green: string;
19
+ yellow: string;
20
+ red: string;
21
+ }
22
+
23
+ interface PrintModule {
24
+ error(msg: string): void;
25
+ dim(msg: string): void;
26
+ }
27
+
28
+ interface UtilsModule {
29
+ COLORS: Colors;
30
+ print: PrintModule;
31
+ parseArgs(args: string[]): ParsedArgs;
32
+ createSpinner(text: string): Spinner;
33
+ fileExists(path: string): boolean;
34
+ writeFile(path: string, content: string): void;
35
+ }
36
+
37
+ interface ParsedArgs {
38
+ _: string[];
39
+ title?: string | undefined;
40
+ t?: string | undefined;
41
+ description?: string | undefined;
42
+ d?: string | undefined;
43
+ author?: string | undefined;
44
+ a?: string | undefined;
45
+ version?: string | undefined;
46
+ v?: string | undefined;
47
+ tags?: string | undefined;
48
+ name?: string | undefined;
49
+ n?: string | undefined;
50
+ date?: string | undefined;
51
+ output?: string | undefined;
52
+ o?: string | undefined;
53
+ }
54
+
55
+ interface Spinner {
56
+ start(): Spinner;
57
+ stop(): void;
58
+ succeed(text: string): void;
59
+ fail(text: string): void;
60
+ }
61
+
62
+ interface ContentType {
63
+ name: string;
64
+ extension: string;
65
+ directory: string;
66
+ }
67
+
68
+ interface ContentOptions {
69
+ title: string;
70
+ description: string;
71
+ author: string;
72
+ version: string;
73
+ tags: string[];
74
+ name: string;
75
+ date: string;
76
+ }
77
+
78
+ interface ContentTemplateModule {
79
+ CONTENT_TYPES: Record<string, ContentType>;
80
+ getContentType(type: string): ContentType | null;
81
+ generate(type: string, options: ContentOptions): string;
82
+ listContentTypes(): Record<string, ContentType>;
83
+ }
84
+
85
+ const utils = require('../core/utils') as UtilsModule;
86
+ const contentTemplate = require('../generators/templates/content.template') as ContentTemplateModule;
87
+
88
+ /**
89
+ * Generate content file
90
+ */
91
+ function generateContent(type: string, args: string[]): void {
92
+ const contentType = contentTemplate.getContentType(type);
93
+
94
+ if (!contentType) {
95
+ utils.print.error(`Unknown content type: ${type}`);
96
+ utils.print.dim('Available types: ' + Object.keys(contentTemplate.CONTENT_TYPES).join(', '));
97
+ return;
98
+ }
99
+
100
+ const parsedArgs = utils.parseArgs(args);
101
+
102
+ // Build options from args
103
+ const options: ContentOptions = {
104
+ title: parsedArgs.title || parsedArgs.t || '',
105
+ description: parsedArgs.description || parsedArgs.d || '',
106
+ author: parsedArgs.author || parsedArgs.a || 'Team',
107
+ version: parsedArgs.version || parsedArgs.v || '1.0.0',
108
+ tags: parsedArgs.tags ? parsedArgs.tags.split(',').map(t => t.trim()) : [],
109
+ name: parsedArgs.name || parsedArgs.n || '',
110
+ date: parsedArgs.date || new Date().toISOString().split('T')[0] || ''
111
+ };
112
+
113
+ console.log(`
114
+ ${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Bootspring Content${utils.COLORS.reset}
115
+ ${utils.COLORS.dim}Generating ${contentType.name}...${utils.COLORS.reset}
116
+ `);
117
+
118
+ const spinner = utils.createSpinner(`Creating ${contentType.name}`).start();
119
+
120
+ try {
121
+ const content = contentTemplate.generate(type, options);
122
+
123
+ // Determine output path
124
+ const filename = options.title
125
+ ? options.title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '')
126
+ : type;
127
+
128
+ const outputDir = parsedArgs.output || parsedArgs.o || contentType.directory;
129
+ const outputPath = path.join(process.cwd(), outputDir, `${filename}${contentType.extension}`);
130
+
131
+ // Create directory if needed
132
+ const dir = path.dirname(outputPath);
133
+ if (!utils.fileExists(dir)) {
134
+ fs.mkdirSync(dir, { recursive: true });
135
+ }
136
+
137
+ utils.writeFile(outputPath, content);
138
+ spinner.succeed(`Created ${contentType.name}`);
139
+
140
+ console.log(`
141
+ ${utils.COLORS.bold}File created:${utils.COLORS.reset} ${outputPath}
142
+
143
+ ${utils.COLORS.dim}Next steps:${utils.COLORS.reset}
144
+ 1. Edit the generated file with your content
145
+ 2. Run ${utils.COLORS.cyan}bootspring agent invoke content-expert${utils.COLORS.reset} for writing help
146
+ 3. Publish when ready
147
+ `);
148
+
149
+ } catch (error) {
150
+ spinner.fail(`Failed to create ${contentType.name}: ${(error as Error).message}`);
151
+ }
152
+ }
153
+
154
+ /**
155
+ * List available content types
156
+ */
157
+ function listTypes(): void {
158
+ console.log(`
159
+ ${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Bootspring Content Types${utils.COLORS.reset}
160
+ ${utils.COLORS.dim}Generate any content type with a single command${utils.COLORS.reset}
161
+ `);
162
+
163
+ const types = contentTemplate.listContentTypes();
164
+
165
+ for (const [id, type] of Object.entries(types)) {
166
+ console.log(` ${utils.COLORS.cyan}${id}${utils.COLORS.reset}`);
167
+ console.log(` ${utils.COLORS.dim}${type.name} (${type.extension})${utils.COLORS.reset}`);
168
+ console.log(` ${utils.COLORS.dim}Directory: ${type.directory}${utils.COLORS.reset}`);
169
+ console.log();
170
+ }
171
+
172
+ utils.print.dim(`${Object.keys(types).length} content types available`);
173
+ utils.print.dim('Use "bootspring content new <type> --title \'Title\'" to generate');
174
+ }
175
+
176
+ /**
177
+ * Show content help
178
+ */
179
+ function showHelp(): void {
180
+ console.log(`
181
+ ${utils.COLORS.cyan}${utils.COLORS.bold}⚡ Bootspring Content${utils.COLORS.reset}
182
+ ${utils.COLORS.dim}Generate and manage content for your project${utils.COLORS.reset}
183
+
184
+ ${utils.COLORS.bold}Usage:${utils.COLORS.reset}
185
+ bootspring content <command> [options]
186
+
187
+ ${utils.COLORS.bold}Commands:${utils.COLORS.reset}
188
+ ${utils.COLORS.cyan}new${utils.COLORS.reset} <type> Generate new content from template
189
+ ${utils.COLORS.cyan}types${utils.COLORS.reset} List available content types
190
+ ${utils.COLORS.cyan}help${utils.COLORS.reset} Show this help
191
+
192
+ ${utils.COLORS.bold}Content Types:${utils.COLORS.reset}
193
+ ${utils.COLORS.cyan}blog-post${utils.COLORS.reset} Blog article template
194
+ ${utils.COLORS.cyan}release-notes${utils.COLORS.reset} Version release notes
195
+ ${utils.COLORS.cyan}documentation${utils.COLORS.reset} Documentation page (MDX)
196
+ ${utils.COLORS.cyan}changelog${utils.COLORS.reset} Changelog entry
197
+ ${utils.COLORS.cyan}readme${utils.COLORS.reset} README file
198
+ ${utils.COLORS.cyan}api-doc${utils.COLORS.reset} API endpoint documentation
199
+ ${utils.COLORS.cyan}tutorial${utils.COLORS.reset} Step-by-step tutorial
200
+
201
+ ${utils.COLORS.bold}Options:${utils.COLORS.reset}
202
+ ${utils.COLORS.cyan}--title, -t${utils.COLORS.reset} Content title
203
+ ${utils.COLORS.cyan}--description, -d${utils.COLORS.reset} Brief description
204
+ ${utils.COLORS.cyan}--author, -a${utils.COLORS.reset} Author name
205
+ ${utils.COLORS.cyan}--tags${utils.COLORS.reset} Comma-separated tags
206
+ ${utils.COLORS.cyan}--version, -v${utils.COLORS.reset} Version number (for releases)
207
+ ${utils.COLORS.cyan}--output, -o${utils.COLORS.reset} Output directory
208
+
209
+ ${utils.COLORS.bold}Examples:${utils.COLORS.reset}
210
+ ${utils.COLORS.dim}# Create a blog post${utils.COLORS.reset}
211
+ bootspring content new blog-post --title "Getting Started with Bootspring"
212
+
213
+ ${utils.COLORS.dim}# Generate release notes${utils.COLORS.reset}
214
+ bootspring content new release-notes --version 1.2.0
215
+
216
+ ${utils.COLORS.dim}# Create API documentation${utils.COLORS.reset}
217
+ bootspring content new api-doc --title "Create User"
218
+
219
+ ${utils.COLORS.dim}# Generate a tutorial${utils.COLORS.reset}
220
+ bootspring content new tutorial --title "Building Your First App"
221
+
222
+ ${utils.COLORS.bold}Workflow:${utils.COLORS.reset}
223
+ 1. Generate content: ${utils.COLORS.cyan}bootspring content new blog-post --title "My Post"${utils.COLORS.reset}
224
+ 2. Get writing help: ${utils.COLORS.cyan}bootspring agent invoke content-expert${utils.COLORS.reset}
225
+ 3. Publish when ready
226
+ `);
227
+ }
228
+
229
+ /**
230
+ * Run content command
231
+ */
232
+ export async function run(args: string[]): Promise<void> {
233
+ const subcommand = args[0] || 'help';
234
+ const subargs = args.slice(1);
235
+
236
+ switch (subcommand) {
237
+ case 'new':
238
+ case 'create':
239
+ case 'generate':
240
+ case 'gen':
241
+ if (!subargs[0]) {
242
+ utils.print.error('Please specify a content type');
243
+ utils.print.dim('Usage: bootspring content new <type> [options]');
244
+ utils.print.dim('Run "bootspring content types" to see available types');
245
+ return;
246
+ }
247
+ generateContent(subargs[0], subargs.slice(1));
248
+ break;
249
+
250
+ case 'types':
251
+ case 'list':
252
+ case 'ls':
253
+ listTypes();
254
+ break;
255
+
256
+ case 'help':
257
+ case '-h':
258
+ case '--help':
259
+ showHelp();
260
+ break;
261
+
262
+ default:
263
+ // Check if it's a content type shortcut
264
+ if (contentTemplate.getContentType(subcommand)) {
265
+ generateContent(subcommand, subargs);
266
+ } else {
267
+ utils.print.error(`Unknown subcommand: ${subcommand}`);
268
+ showHelp();
269
+ }
270
+ }
271
+ }
272
+
273
+ export { generateContent, listTypes };