@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
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Policy Matrix
3
+ * Comprehensive policy definitions for org-level gates
4
+ * @package bootspring
5
+ */
6
+
7
+ /**
8
+ * Policy scopes define what can be controlled
9
+ */
10
+ const POLICY_SCOPES = {
11
+ skills: {
12
+ external: 'skills.external', // Third-party/external skills
13
+ premium: 'skills.premium', // Premium skill categories
14
+ ai: 'skills.ai', // AI-powered skills
15
+ all: 'skills.*'
16
+ },
17
+ workflows: {
18
+ parallel: 'workflows.parallel', // Parallel execution
19
+ premium: 'workflows.premium', // Premium workflow packs
20
+ custom: 'workflows.custom', // Custom workflow definitions
21
+ all: 'workflows.*'
22
+ },
23
+ agents: {
24
+ technical: 'agents.technical', // Technical experts
25
+ business: 'agents.business', // Business/legal experts
26
+ enterprise: 'agents.enterprise', // Enterprise-only agents
27
+ all: 'agents.*'
28
+ },
29
+ features: {
30
+ telemetry: 'features.telemetry', // Usage telemetry
31
+ cloudSync: 'features.cloud_sync', // Cloud synchronization
32
+ teamSharing: 'features.team_sharing', // Team context sharing
33
+ auditLogs: 'features.audit_logs', // Audit logging
34
+ apiAccess: 'features.api_access', // Direct API access
35
+ all: 'features.*'
36
+ }
37
+ };
38
+
39
+ /**
40
+ * Default policy matrix by tier
41
+ * Defines what's allowed/blocked per tier
42
+ */
43
+ const TIER_POLICY_DEFAULTS = {
44
+ free: {
45
+ allowed: [
46
+ 'skills.external',
47
+ 'agents.technical',
48
+ 'features.telemetry'
49
+ ],
50
+ blocked: [
51
+ 'skills.premium',
52
+ 'skills.ai',
53
+ 'workflows.premium',
54
+ 'workflows.parallel',
55
+ 'agents.business',
56
+ 'agents.enterprise',
57
+ 'features.cloud_sync',
58
+ 'features.team_sharing',
59
+ 'features.audit_logs'
60
+ ],
61
+ limits: {
62
+ skillsPerDay: 50,
63
+ workflowsPerDay: 10,
64
+ agentInvocationsPerDay: 20
65
+ }
66
+ },
67
+ pro: {
68
+ allowed: [
69
+ 'skills.*',
70
+ 'workflows.*',
71
+ 'agents.technical',
72
+ 'agents.business',
73
+ 'features.telemetry',
74
+ 'features.cloud_sync'
75
+ ],
76
+ blocked: [
77
+ 'agents.enterprise',
78
+ 'features.team_sharing',
79
+ 'features.audit_logs'
80
+ ],
81
+ limits: {
82
+ skillsPerDay: 500,
83
+ workflowsPerDay: 100,
84
+ agentInvocationsPerDay: 200
85
+ }
86
+ },
87
+ team: {
88
+ allowed: [
89
+ 'skills.*',
90
+ 'workflows.*',
91
+ 'agents.*',
92
+ 'features.telemetry',
93
+ 'features.cloud_sync',
94
+ 'features.team_sharing',
95
+ 'features.audit_logs'
96
+ ],
97
+ blocked: [],
98
+ limits: {
99
+ skillsPerDay: 2000,
100
+ workflowsPerDay: 500,
101
+ agentInvocationsPerDay: 1000,
102
+ teamMembers: 10
103
+ }
104
+ },
105
+ enterprise: {
106
+ allowed: ['*'],
107
+ blocked: [],
108
+ limits: {
109
+ skillsPerDay: -1, // Unlimited
110
+ workflowsPerDay: -1,
111
+ agentInvocationsPerDay: -1,
112
+ teamMembers: -1
113
+ }
114
+ }
115
+ };
116
+
117
+ /**
118
+ * Profile-specific policy overrides
119
+ * Applied on top of tier defaults
120
+ */
121
+ const PROFILE_OVERRIDES = {
122
+ startup: {
123
+ // Startup profile: permissive, fast iteration
124
+ overrides: {},
125
+ additionalBlocked: []
126
+ },
127
+ regulated: {
128
+ // Regulated profile: compliance-focused
129
+ overrides: {
130
+ requireApproval: ['workflows.custom', 'skills.external'],
131
+ auditAll: true,
132
+ dataResidency: true
133
+ },
134
+ additionalBlocked: [
135
+ 'skills.external',
136
+ 'workflows.growth-pack'
137
+ ]
138
+ },
139
+ enterprise: {
140
+ // Enterprise profile: full control
141
+ overrides: {
142
+ ssoRequired: true,
143
+ auditAll: true,
144
+ approvalWorkflow: true
145
+ },
146
+ additionalBlocked: []
147
+ }
148
+ };
149
+
150
+ /**
151
+ * Member role permissions
152
+ * What each role can do within an org
153
+ */
154
+ const ROLE_PERMISSIONS = {
155
+ owner: {
156
+ canManageOrg: true,
157
+ canManageMembers: true,
158
+ canManagePolicies: true,
159
+ canManageBilling: true,
160
+ canUseAllFeatures: true
161
+ },
162
+ admin: {
163
+ canManageOrg: false,
164
+ canManageMembers: true,
165
+ canManagePolicies: true,
166
+ canManageBilling: false,
167
+ canUseAllFeatures: true
168
+ },
169
+ member: {
170
+ canManageOrg: false,
171
+ canManageMembers: false,
172
+ canManagePolicies: false,
173
+ canManageBilling: false,
174
+ canUseAllFeatures: true
175
+ },
176
+ viewer: {
177
+ canManageOrg: false,
178
+ canManageMembers: false,
179
+ canManagePolicies: false,
180
+ canManageBilling: false,
181
+ canUseAllFeatures: false
182
+ }
183
+ };
184
+
185
+ /**
186
+ * Check if a scope matches a pattern
187
+ * @param {string} scope - Specific scope (e.g., 'skills.external')
188
+ * @param {string} pattern - Pattern to match (e.g., 'skills.*' or 'skills.external')
189
+ * @returns {boolean}
190
+ */
191
+ function matchesScope(scope, pattern) {
192
+ if (pattern === '*') return true;
193
+ if (pattern === scope) return true;
194
+ if (pattern.endsWith('.*')) {
195
+ const prefix = pattern.slice(0, -2);
196
+ return scope.startsWith(prefix + '.');
197
+ }
198
+ return false;
199
+ }
200
+
201
+ /**
202
+ * Check if a scope is allowed by policy
203
+ * @param {string} scope - Scope to check
204
+ * @param {string[]} allowed - Allowed patterns
205
+ * @param {string[]} blocked - Blocked patterns
206
+ * @returns {boolean}
207
+ */
208
+ function isScopeAllowed(scope, allowed, blocked) {
209
+ // Check blocked first (blocked takes precedence)
210
+ for (const pattern of blocked) {
211
+ if (matchesScope(scope, pattern)) {
212
+ return false;
213
+ }
214
+ }
215
+ // Check allowed
216
+ for (const pattern of allowed) {
217
+ if (matchesScope(scope, pattern)) {
218
+ return true;
219
+ }
220
+ }
221
+ return false;
222
+ }
223
+
224
+ /**
225
+ * Build effective policy for an org member
226
+ * @param {string} tier - Org tier (free/pro/team/enterprise)
227
+ * @param {string} profile - Policy profile (startup/regulated/enterprise)
228
+ * @param {object} memberOverrides - Per-member policy overrides
229
+ * @returns {object} Effective policy
230
+ */
231
+ function buildEffectivePolicy(tier, profile, memberOverrides = {}) {
232
+ const tierDefaults = TIER_POLICY_DEFAULTS[tier] || TIER_POLICY_DEFAULTS.free;
233
+ const profileOverrides = PROFILE_OVERRIDES[profile] || PROFILE_OVERRIDES.startup;
234
+
235
+ // Merge allowed/blocked lists
236
+ const allowed = [...tierDefaults.allowed];
237
+ const blocked = [
238
+ ...tierDefaults.blocked,
239
+ ...profileOverrides.additionalBlocked
240
+ ];
241
+
242
+ // Apply member overrides
243
+ if (memberOverrides.additionalAllowed) {
244
+ allowed.push(...memberOverrides.additionalAllowed);
245
+ }
246
+ if (memberOverrides.additionalBlocked) {
247
+ blocked.push(...memberOverrides.additionalBlocked);
248
+ }
249
+
250
+ return {
251
+ tier,
252
+ profile,
253
+ allowed: [...new Set(allowed)],
254
+ blocked: [...new Set(blocked)],
255
+ limits: { ...tierDefaults.limits, ...(memberOverrides.limits || {}) },
256
+ overrides: { ...profileOverrides.overrides, ...(memberOverrides.overrides || {}) }
257
+ };
258
+ }
259
+
260
+ /**
261
+ * Check access against effective policy
262
+ * @param {string} scope - Scope to check
263
+ * @param {object} policy - Effective policy
264
+ * @returns {object} Access result
265
+ */
266
+ function checkPolicyAccess(scope, policy) {
267
+ const allowed = isScopeAllowed(scope, policy.allowed, policy.blocked);
268
+
269
+ if (!allowed) {
270
+ return {
271
+ allowed: false,
272
+ code: 'policy_blocked',
273
+ scope,
274
+ reason: `Scope "${scope}" is blocked by ${policy.profile} policy`
275
+ };
276
+ }
277
+
278
+ // Check if approval is required
279
+ if (policy.overrides.requireApproval?.some(p => matchesScope(scope, p))) {
280
+ return {
281
+ allowed: true,
282
+ requiresApproval: true,
283
+ scope,
284
+ reason: `Scope "${scope}" requires approval under ${policy.profile} policy`
285
+ };
286
+ }
287
+
288
+ return {
289
+ allowed: true,
290
+ scope
291
+ };
292
+ }
293
+
294
+ module.exports = {
295
+ POLICY_SCOPES,
296
+ TIER_POLICY_DEFAULTS,
297
+ PROFILE_OVERRIDES,
298
+ ROLE_PERMISSIONS,
299
+ matchesScope,
300
+ isScopeAllowed,
301
+ buildEffectivePolicy,
302
+ checkPolicyAccess
303
+ };
@@ -36,6 +36,7 @@ const EXEMPT_COMMANDS = [
36
36
  'billing', // Billing status/info accessible without project
37
37
  'preseed', // Preseed works locally, auth enhances features
38
38
  'seed', // Seed works locally for scaffolding
39
+ 'org', // Org policy accessible without project
39
40
  ];
40
41
 
41
42
  // Sub-commands of auth that are exempt
@@ -0,0 +1,3 @@
1
+ export { S as SimpleTodoItem, T as TodoItem, d as dashboard, g as generate, a as generateClaudeMd, r as runDashboard, b as runGenerate, c as runTelemetry, e as runTodo, t as telemetry, f as todo } from '../index-UiYCgwiH.js';
2
+ import '../context-McpJQa_2.js';
3
+ import 'zod';