@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.
- package/cli/preseed/index.js +16 -0
- package/cli/preseed/interactive.js +143 -0
- package/cli/preseed/templates.js +227 -0
- package/cli/seed/builders/ai-context-builder.js +85 -0
- package/cli/seed/builders/index.js +13 -0
- package/cli/seed/builders/seed-builder.js +272 -0
- package/cli/seed/extractors/content-extractors.js +383 -0
- package/cli/seed/extractors/index.js +47 -0
- package/cli/seed/extractors/metadata-extractors.js +167 -0
- package/cli/seed/extractors/section-extractor.js +54 -0
- package/cli/seed/extractors/stack-extractors.js +228 -0
- package/cli/seed/index.js +18 -0
- package/cli/seed/utils/folder-structure.js +84 -0
- package/cli/seed/utils/index.js +11 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +3220 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/context-McpJQa_2.d.ts +5710 -0
- package/dist/core/index.d.ts +635 -0
- package/dist/core/index.js +2593 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index-QqbeEiDm.d.ts +857 -0
- package/dist/index-UiYCgwiH.d.ts +174 -0
- package/dist/index.d.ts +453 -0
- package/dist/index.js +44228 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.js +41173 -0
- package/dist/mcp/index.js.map +1 -0
- package/generators/index.ts +82 -0
- package/intelligence/orchestrator/config/failure-signatures.js +48 -0
- package/intelligence/orchestrator/config/index.js +20 -0
- package/intelligence/orchestrator/config/phases.js +111 -0
- package/intelligence/orchestrator/config/remediation.js +150 -0
- package/intelligence/orchestrator/config/workflows.js +168 -0
- package/intelligence/orchestrator/core/index.js +16 -0
- package/intelligence/orchestrator/core/state-manager.js +88 -0
- package/intelligence/orchestrator/core/telemetry.js +24 -0
- package/intelligence/orchestrator/index.js +17 -0
- package/mcp/contracts/mcp-contract.v1.json +1 -1
- package/package.json +16 -3
- package/src/cli/agent.ts +703 -0
- package/src/cli/analyze.ts +640 -0
- package/src/cli/audit.ts +707 -0
- package/src/cli/auth.ts +930 -0
- package/src/cli/billing.ts +364 -0
- package/src/cli/build.ts +1089 -0
- package/src/cli/business.ts +508 -0
- package/src/cli/checkpoint-utils.ts +236 -0
- package/src/cli/checkpoint.ts +757 -0
- package/src/cli/cloud-sync.ts +534 -0
- package/src/cli/content.ts +273 -0
- package/src/cli/context.ts +667 -0
- package/src/cli/dashboard.ts +133 -0
- package/src/cli/deploy.ts +704 -0
- package/src/cli/doctor.ts +480 -0
- package/src/cli/fundraise.ts +494 -0
- package/src/cli/generate.ts +346 -0
- package/src/cli/github-cmd.ts +566 -0
- package/src/cli/health.ts +599 -0
- package/src/cli/index.ts +113 -0
- package/src/cli/init.ts +838 -0
- package/src/cli/legal.ts +495 -0
- package/src/cli/log.ts +316 -0
- package/src/cli/loop.ts +1660 -0
- package/src/cli/manager.ts +878 -0
- package/src/cli/mcp.ts +275 -0
- package/src/cli/memory.ts +346 -0
- package/src/cli/metrics.ts +590 -0
- package/src/cli/monitor.ts +960 -0
- package/src/cli/mvp.ts +662 -0
- package/src/cli/onboard.ts +663 -0
- package/src/cli/orchestrator.ts +622 -0
- package/src/cli/plugin.ts +483 -0
- package/src/cli/prd.ts +671 -0
- package/src/cli/preseed-start.ts +1633 -0
- package/src/cli/preseed.ts +2434 -0
- package/src/cli/project.ts +526 -0
- package/src/cli/quality.ts +885 -0
- package/src/cli/security.ts +1079 -0
- package/src/cli/seed.ts +1224 -0
- package/src/cli/skill.ts +537 -0
- package/src/cli/suggest.ts +1225 -0
- package/src/cli/switch.ts +518 -0
- package/src/cli/task.ts +780 -0
- package/src/cli/telemetry.ts +172 -0
- package/src/cli/todo.ts +627 -0
- package/src/cli/types.ts +15 -0
- package/src/cli/update.ts +334 -0
- package/src/cli/visualize.ts +609 -0
- package/src/cli/watch.ts +895 -0
- package/src/cli/workspace.ts +709 -0
- package/src/core/action-recorder.ts +673 -0
- package/src/core/analyze-workflow.ts +1453 -0
- package/src/core/api-client.ts +1120 -0
- package/src/core/audit-workflow.ts +1681 -0
- package/src/core/auth.ts +471 -0
- package/src/core/build-orchestrator.ts +509 -0
- package/src/core/build-state.ts +621 -0
- package/src/core/checkpoint-engine.ts +482 -0
- package/src/core/config.ts +1285 -0
- package/src/core/context-loader.ts +694 -0
- package/src/core/context.ts +410 -0
- package/src/core/deploy-workflow.ts +1085 -0
- package/src/core/entitlements.ts +322 -0
- package/src/core/github-sync.ts +720 -0
- package/src/core/index.ts +981 -0
- package/src/core/ingest.ts +1186 -0
- package/src/core/metrics-engine.ts +886 -0
- package/src/core/mvp.ts +847 -0
- package/src/core/onboard-workflow.ts +1293 -0
- package/src/core/policies.ts +81 -0
- package/src/core/preseed-workflow.ts +1163 -0
- package/src/core/preseed.ts +1826 -0
- package/src/core/project-context.ts +380 -0
- package/src/core/project-state.ts +699 -0
- package/src/core/r2-sync.ts +691 -0
- package/src/core/scaffold.ts +1715 -0
- package/src/core/session.ts +286 -0
- package/src/core/task-extractor.ts +799 -0
- package/src/core/telemetry.ts +371 -0
- package/src/core/tier-enforcement.ts +737 -0
- package/src/core/utils.ts +437 -0
- package/src/index.ts +29 -0
- package/src/intelligence/agent-collab.ts +2376 -0
- package/src/intelligence/auto-suggest.ts +713 -0
- package/src/intelligence/content-gen.ts +1351 -0
- package/src/intelligence/cross-project.ts +1692 -0
- package/src/intelligence/git-memory.ts +529 -0
- package/src/intelligence/index.ts +318 -0
- package/src/intelligence/orchestrator.ts +534 -0
- package/src/intelligence/prd.ts +466 -0
- package/src/intelligence/recommendations.ts +982 -0
- package/src/intelligence/workflow-composer.ts +1472 -0
- package/src/mcp/capabilities.ts +233 -0
- package/src/mcp/index.ts +37 -0
- package/src/mcp/registry.ts +1268 -0
- package/src/mcp/response-formatter.ts +797 -0
- package/src/mcp/server.ts +240 -0
- package/src/types/agent.ts +69 -0
- package/src/types/config.ts +86 -0
- package/src/types/context.ts +77 -0
- package/src/types/index.ts +53 -0
- package/src/types/mcp.ts +91 -0
- package/src/types/skills.ts +47 -0
- package/src/types/workflow.ts +155 -0
- package/generators/index.js +0 -18
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bootspring Checkpoint Utilities
|
|
3
|
+
* Shared utilities for checkpoint scanning and syncing
|
|
4
|
+
*
|
|
5
|
+
* @package bootspring
|
|
6
|
+
* @module cli/checkpoint-utils
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as fs from 'fs';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
|
|
12
|
+
// Type interfaces for JS modules
|
|
13
|
+
interface Config {
|
|
14
|
+
_projectRoot: string;
|
|
15
|
+
apiBase?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ConfigModule {
|
|
19
|
+
load(): Config;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface AuthModule {
|
|
23
|
+
getApiKey(): string | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SessionModule {
|
|
27
|
+
getCurrentProject(): { id: string } | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface ProjectState {
|
|
31
|
+
content?: Record<string, unknown> | undefined;
|
|
32
|
+
business?: Record<string, unknown> | undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface ProjectStateModule {
|
|
36
|
+
loadState(projectRoot: string): ProjectState | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface GitHubSyncMetadata {
|
|
40
|
+
connected?: boolean | undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface GitHubSyncModule {
|
|
44
|
+
loadGitHubSyncMetadata(projectRoot: string): GitHubSyncMetadata | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface RawMetrics {
|
|
48
|
+
categories?: {
|
|
49
|
+
docs?: { average?: number | undefined } | undefined;
|
|
50
|
+
security?: { average?: number | undefined } | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
metrics?: {
|
|
53
|
+
test_coverage?: { score?: number | undefined } | undefined;
|
|
54
|
+
commit_frequency?: { score?: number | undefined } | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface MetricsEngineModule {
|
|
59
|
+
collectMetrics(projectRoot: string, options?: { quiet?: boolean }): Promise<RawMetrics>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface FileScanEntry {
|
|
63
|
+
exists: boolean;
|
|
64
|
+
size: number;
|
|
65
|
+
content?: string | undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface PushResult {
|
|
69
|
+
success: boolean;
|
|
70
|
+
reason?: string | undefined;
|
|
71
|
+
projectType?: string | undefined;
|
|
72
|
+
progress?: {
|
|
73
|
+
completed?: number | undefined;
|
|
74
|
+
total?: number | undefined;
|
|
75
|
+
percentage?: number | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
healthScore?: number | undefined;
|
|
78
|
+
lastSyncAt?: string | undefined;
|
|
79
|
+
healthBreakdown?: Record<string, number> | undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface PushOptions {
|
|
83
|
+
quiet?: boolean | undefined;
|
|
84
|
+
autoSync?: boolean | undefined;
|
|
85
|
+
skipMetrics?: boolean | undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const config = require('../core/config') as ConfigModule;
|
|
89
|
+
const auth = require('../core/auth') as AuthModule;
|
|
90
|
+
const session = require('../core/session') as SessionModule;
|
|
91
|
+
const projectState = require('../core/project-state') as ProjectStateModule;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Scan files for checkpoint evaluation
|
|
95
|
+
* Returns raw file data - server determines what checkpoints are complete
|
|
96
|
+
*/
|
|
97
|
+
export function scanFilesForCheckpoints(projectRoot: string): Record<string, FileScanEntry> {
|
|
98
|
+
const fileScan: Record<string, FileScanEntry> = {};
|
|
99
|
+
|
|
100
|
+
// List of files to scan (paths are relative to project root)
|
|
101
|
+
const filesToScan = [
|
|
102
|
+
'planning/PROJECT_STATE.json',
|
|
103
|
+
'planning/PRD.md',
|
|
104
|
+
'planning/TECHNICAL_SPEC.md',
|
|
105
|
+
'planning/ARCHITECTURE.md',
|
|
106
|
+
'planning/DATABASE_SCHEMA.md',
|
|
107
|
+
'planning/API_CONTRACTS.md',
|
|
108
|
+
'planning/TEST_PLAN.md',
|
|
109
|
+
'planning/DEPLOYMENT.md',
|
|
110
|
+
'planning/CONTENT_STRATEGY.md',
|
|
111
|
+
'planning/EDITORIAL_CALENDAR.md',
|
|
112
|
+
'planning/STYLE_GUIDE.md',
|
|
113
|
+
'planning/SEO_PLAN.md',
|
|
114
|
+
'planning/BUSINESS_PLAN.md',
|
|
115
|
+
'planning/MARKET_ANALYSIS.md',
|
|
116
|
+
'planning/COMPETITOR_ANALYSIS.md',
|
|
117
|
+
'planning/FINANCIAL_MODEL.md',
|
|
118
|
+
'planning/PITCH_DECK.md',
|
|
119
|
+
'planning/INVESTOR_LIST.md'
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
for (const relativePath of filesToScan) {
|
|
123
|
+
const fullPath = path.join(projectRoot, relativePath);
|
|
124
|
+
try {
|
|
125
|
+
if (fs.existsSync(fullPath)) {
|
|
126
|
+
const stats = fs.statSync(fullPath);
|
|
127
|
+
const content = fs.readFileSync(fullPath, 'utf-8');
|
|
128
|
+
fileScan[relativePath] = {
|
|
129
|
+
exists: true,
|
|
130
|
+
size: stats.size,
|
|
131
|
+
// Only include content for files that need pattern matching
|
|
132
|
+
...(relativePath === 'planning/DEPLOYMENT.md' && { content })
|
|
133
|
+
};
|
|
134
|
+
} else {
|
|
135
|
+
fileScan[relativePath] = { exists: false, size: 0 };
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
fileScan[relativePath] = { exists: false, size: 0 };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return fileScan;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Push checkpoints to dashboard
|
|
147
|
+
* Sends raw file scan data - server evaluates checkpoints and calculates scores
|
|
148
|
+
*/
|
|
149
|
+
export async function pushCheckpointsToServer(projectRoot: string, options: PushOptions = {}): Promise<PushResult> {
|
|
150
|
+
const apiKey = auth.getApiKey();
|
|
151
|
+
|
|
152
|
+
if (!apiKey) {
|
|
153
|
+
if (!options.quiet) {
|
|
154
|
+
throw new Error('Not authenticated. Run: bootspring auth login');
|
|
155
|
+
}
|
|
156
|
+
return { success: false, reason: 'not_authenticated' };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Get project ID from session
|
|
160
|
+
const currentProject = session.getCurrentProject();
|
|
161
|
+
const projectId = currentProject?.id;
|
|
162
|
+
|
|
163
|
+
if (!projectId) {
|
|
164
|
+
if (!options.quiet) {
|
|
165
|
+
throw new Error('No project selected. Run: bootspring switch <project>');
|
|
166
|
+
}
|
|
167
|
+
return { success: false, reason: 'no_project' };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Scan files - raw data only, no evaluation
|
|
171
|
+
const fileScan = scanFilesForCheckpoints(projectRoot);
|
|
172
|
+
|
|
173
|
+
// Load local state for config values
|
|
174
|
+
const state = projectState.loadState(projectRoot) || {};
|
|
175
|
+
const configValues = {
|
|
176
|
+
content: state.content || {},
|
|
177
|
+
business: state.business || {}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// Check github connection
|
|
181
|
+
const githubSync = require('../core/github-sync') as GitHubSyncModule;
|
|
182
|
+
const githubMeta = githubSync.loadGitHubSyncMetadata(projectRoot);
|
|
183
|
+
const githubConnected = githubMeta?.connected || false;
|
|
184
|
+
|
|
185
|
+
// Get raw scores from local collectors (server will weight them)
|
|
186
|
+
let documentationScore: number | undefined;
|
|
187
|
+
let securityScore: number | undefined;
|
|
188
|
+
let testCoverage: number | undefined;
|
|
189
|
+
let githubActivity: number | undefined;
|
|
190
|
+
|
|
191
|
+
if (!options.skipMetrics) {
|
|
192
|
+
try {
|
|
193
|
+
const metricsEngine = require('../core/metrics-engine') as MetricsEngineModule;
|
|
194
|
+
const rawMetrics = await metricsEngine.collectMetrics(projectRoot, { quiet: true });
|
|
195
|
+
documentationScore = rawMetrics.categories?.docs?.average;
|
|
196
|
+
securityScore = rawMetrics.categories?.security?.average;
|
|
197
|
+
testCoverage = rawMetrics.metrics?.test_coverage?.score;
|
|
198
|
+
githubActivity = rawMetrics.metrics?.commit_frequency?.score;
|
|
199
|
+
} catch {
|
|
200
|
+
// Metrics collection is optional
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Send raw data to server for evaluation
|
|
205
|
+
const cfg = config.load();
|
|
206
|
+
const apiBase = cfg.apiBase || 'https://bootspring.com';
|
|
207
|
+
const response = await fetch(`${apiBase}/api/projects/${projectId}/checkpoints/evaluate`, {
|
|
208
|
+
method: 'POST',
|
|
209
|
+
headers: {
|
|
210
|
+
'Content-Type': 'application/json',
|
|
211
|
+
'x-api-key': apiKey
|
|
212
|
+
},
|
|
213
|
+
body: JSON.stringify({
|
|
214
|
+
fileScan,
|
|
215
|
+
configValues,
|
|
216
|
+
githubConnected,
|
|
217
|
+
githubActivity,
|
|
218
|
+
documentationScore,
|
|
219
|
+
securityScore,
|
|
220
|
+
testCoverage,
|
|
221
|
+
autoSync: options.autoSync || false
|
|
222
|
+
}),
|
|
223
|
+
redirect: 'follow'
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
if (!response.ok) {
|
|
227
|
+
const error = await response.json().catch(() => ({})) as { error?: string };
|
|
228
|
+
throw new Error(error.error || `HTTP ${response.status}`);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const result = await response.json() as PushResult;
|
|
232
|
+
return {
|
|
233
|
+
...result,
|
|
234
|
+
success: true
|
|
235
|
+
};
|
|
236
|
+
}
|