startup-builder 0.1.0 → 0.2.0

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/dist/index.d.ts CHANGED
@@ -1,122 +1,448 @@
1
- import * as landing_page from 'landing-page';
2
- export { landing } from 'landing-page';
3
- import * as startup_names from 'startup-names';
4
- export { startup as names } from 'startup-names';
5
- import * as storybrand from 'storybrand';
6
- export { story } from 'storybrand';
7
- import * as jobs_to_be_done from 'jobs-to-be-done';
8
- export { jtbd } from 'jobs-to-be-done';
9
- import * as ideal_customer_profile from 'ideal-customer-profile';
10
- export { icp } from 'ideal-customer-profile';
11
- import * as lean_canvas from 'lean-canvas';
12
- export { canvas } from 'lean-canvas';
13
- import * as foundation_sprint from 'foundation-sprint';
14
- export { sprint } from 'foundation-sprint';
1
+ import * as xstate from 'xstate';
2
+ import { AnyActorRef } from 'xstate';
15
3
 
16
- /**
17
- * Complete startup package returned by builder.create()
18
- */
19
- interface StartupPackage {
20
- foundation: any;
21
- canvas: any;
22
- icp: any;
23
- jtbd: any;
24
- story: any;
25
- name: any;
26
- landing: any;
4
+ interface StartupBuilderContext {
5
+ startupId: string;
6
+ ideaId: string;
7
+ sprintId: string;
8
+ icpCount: number;
9
+ competitorCount: number;
10
+ leanCanvasCount: number;
11
+ hypothesisCount: number;
12
+ positioningSet: boolean;
13
+ differentiatorCount: number;
14
+ storyBrandCount: number;
15
+ serviceCount: number;
16
+ agentCount: number;
17
+ domainCount: number;
18
+ pageCount: number;
19
+ servicesBuilderRef?: AnyActorRef;
20
+ siteBuilderRef?: AnyActorRef;
21
+ salesBuilderRef?: AnyActorRef;
22
+ result?: 'validated' | 'invalidated' | 'inconclusive';
23
+ skipReason?: string;
27
24
  }
28
- /**
29
- * Founder information used to personalize the startup
30
- */
31
- interface FounderInfo {
32
- capabilities?: string[];
33
- insight?: string;
34
- motivation?: string;
35
- founderNames?: string[];
25
+ type StartupBuilderEvent = {
26
+ type: 'ARTIFACT_CREATED';
27
+ collection: string;
28
+ count: number;
29
+ } | {
30
+ type: 'ADVANCE';
31
+ } | {
32
+ type: 'SKIP';
33
+ reason: string;
34
+ } | {
35
+ type: 'SERVICES_COMPLETE';
36
+ } | {
37
+ type: 'SITE_COMPLETE';
38
+ } | {
39
+ type: 'SALES_COMPLETE';
40
+ result: 'validated' | 'invalidated' | 'inconclusive';
41
+ } | {
42
+ type: 'PIVOT';
43
+ reason: string;
44
+ } | {
45
+ type: 'ARCHIVE';
46
+ reason: string;
47
+ };
48
+ declare const startupBuilderMachine: xstate.StateMachine<StartupBuilderContext, {
49
+ type: "ARTIFACT_CREATED";
50
+ collection: string;
51
+ count: number;
52
+ } | {
53
+ type: "ADVANCE";
54
+ } | {
55
+ type: "SKIP";
56
+ reason: string;
57
+ } | {
58
+ type: "SERVICES_COMPLETE";
59
+ } | {
60
+ type: "SITE_COMPLETE";
61
+ } | {
62
+ type: "SALES_COMPLETE";
63
+ result: "validated" | "invalidated" | "inconclusive";
64
+ } | {
65
+ type: "PIVOT";
66
+ reason: string;
67
+ } | {
68
+ type: "ARCHIVE";
69
+ reason: string;
70
+ }, {}, never, {
71
+ type: "recordSkip";
72
+ params: xstate.NonReducibleUnknown;
73
+ } | {
74
+ type: "updateArtifactCount";
75
+ params: xstate.NonReducibleUnknown;
76
+ } | {
77
+ type: "setPositioning";
78
+ params: xstate.NonReducibleUnknown;
79
+ } | {
80
+ type: "setResult";
81
+ params: xstate.NonReducibleUnknown;
82
+ }, {
83
+ type: "hasResearchArtifacts";
84
+ params: unknown;
85
+ } | {
86
+ type: "hasCanvasArtifacts";
87
+ params: unknown;
88
+ } | {
89
+ type: "hasPositioningArtifacts";
90
+ params: unknown;
91
+ } | {
92
+ type: "hasMessagingArtifacts";
93
+ params: unknown;
94
+ } | {
95
+ type: "hasServicesComplete";
96
+ params: unknown;
97
+ } | {
98
+ type: "hasTeamArtifacts";
99
+ params: unknown;
100
+ } | {
101
+ type: "hasSiteComplete";
102
+ params: unknown;
103
+ } | {
104
+ type: "isSkipping";
105
+ params: unknown;
106
+ }, never, "complete" | "research" | "canvas" | "positioning" | "messaging" | "services" | "team" | "site" | "sales", string, {
107
+ startupId: string;
108
+ ideaId: string;
109
+ sprintId: string;
110
+ }, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
111
+ id: "startup-builder";
112
+ states: {
113
+ readonly research: {};
114
+ readonly canvas: {};
115
+ readonly positioning: {};
116
+ readonly messaging: {};
117
+ readonly services: {};
118
+ readonly team: {};
119
+ readonly site: {};
120
+ readonly sales: {};
121
+ readonly complete: {};
122
+ };
123
+ }>;
124
+
125
+ interface ServicesBuilderContext {
126
+ startupId: string;
127
+ hasStoryBrand: boolean;
128
+ deliveryModel?: 'saas' | 'iaas' | 'paas' | 'services-as-software';
129
+ serviceCount: number;
130
+ pricingSet: boolean;
131
+ productCount: number;
132
+ activationComplete: boolean;
36
133
  }
37
- /**
38
- * Options for creating a startup
39
- */
40
- interface CreateOptions {
41
- idea: string;
42
- founder?: FounderInfo;
43
- industry?: string;
44
- tone?: 'professional' | 'playful' | 'modern' | 'traditional';
134
+ type ServicesBuilderEvent = {
135
+ type: 'ARTIFACT_CREATED';
136
+ collection: string;
137
+ count: number;
138
+ } | {
139
+ type: 'MODEL_SELECTED';
140
+ model: ServicesBuilderContext['deliveryModel'];
141
+ } | {
142
+ type: 'PRICING_SET';
143
+ } | {
144
+ type: 'ACTIVATION_COMPLETE';
145
+ } | {
146
+ type: 'ADVANCE';
147
+ } | {
148
+ type: 'SKIP';
149
+ reason: string;
150
+ };
151
+ declare const servicesBuilderMachine: xstate.StateMachine<ServicesBuilderContext, {
152
+ type: "ARTIFACT_CREATED";
153
+ collection: string;
154
+ count: number;
155
+ } | {
156
+ type: "MODEL_SELECTED";
157
+ model: ServicesBuilderContext["deliveryModel"];
158
+ } | {
159
+ type: "PRICING_SET";
160
+ } | {
161
+ type: "ACTIVATION_COMPLETE";
162
+ } | {
163
+ type: "ADVANCE";
164
+ } | {
165
+ type: "SKIP";
166
+ reason: string;
167
+ }, {}, never, {
168
+ type: "updateArtifactCount";
169
+ params: xstate.NonReducibleUnknown;
170
+ } | {
171
+ type: "setModel";
172
+ params: xstate.NonReducibleUnknown;
173
+ } | {
174
+ type: "setPricing";
175
+ params: xstate.NonReducibleUnknown;
176
+ }, {
177
+ type: "needsMessaging";
178
+ params: unknown;
179
+ } | {
180
+ type: "hasMessaging";
181
+ params: unknown;
182
+ } | {
183
+ type: "hasModel";
184
+ params: unknown;
185
+ } | {
186
+ type: "hasServices";
187
+ params: unknown;
188
+ } | {
189
+ type: "hasPricing";
190
+ params: unknown;
191
+ } | {
192
+ type: "hasProducts";
193
+ params: unknown;
194
+ }, never, "complete" | "messaging" | "model" | "checkPrerequisites" | "definition" | "pricing" | "packaging" | "activation", string, {
195
+ startupId: string;
196
+ hasStoryBrand: boolean;
197
+ }, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
198
+ id: "services-builder";
199
+ states: {
200
+ readonly checkPrerequisites: {};
201
+ readonly messaging: {};
202
+ readonly model: {};
203
+ readonly definition: {};
204
+ readonly pricing: {};
205
+ readonly packaging: {};
206
+ readonly activation: {};
207
+ readonly complete: {};
208
+ };
209
+ }>;
210
+
211
+ interface SiteBuilderContext {
212
+ startupId: string;
213
+ hasStoryBrand: boolean;
214
+ hasServices: boolean;
215
+ pageCount: number;
216
+ pagesWithContent: number;
217
+ domainCount: number;
218
+ designApproved: boolean;
219
+ published: boolean;
220
+ }
221
+ type SiteBuilderEvent = {
222
+ type: 'ARTIFACT_CREATED';
223
+ collection: string;
224
+ count: number;
225
+ } | {
226
+ type: 'CONTENT_COMPLETE';
227
+ pagesWithContent: number;
228
+ } | {
229
+ type: 'DESIGN_APPROVED';
230
+ } | {
231
+ type: 'PUBLISHED';
232
+ } | {
233
+ type: 'ADVANCE';
234
+ } | {
235
+ type: 'SKIP';
236
+ reason: string;
237
+ };
238
+ declare const siteBuilderMachine: xstate.StateMachine<SiteBuilderContext, {
239
+ type: "ARTIFACT_CREATED";
240
+ collection: string;
241
+ count: number;
242
+ } | {
243
+ type: "CONTENT_COMPLETE";
244
+ pagesWithContent: number;
245
+ } | {
246
+ type: "DESIGN_APPROVED";
247
+ } | {
248
+ type: "PUBLISHED";
249
+ } | {
250
+ type: "ADVANCE";
251
+ } | {
252
+ type: "SKIP";
253
+ reason: string;
254
+ }, {}, never, {
255
+ type: "updateArtifactCount";
256
+ params: xstate.NonReducibleUnknown;
257
+ } | {
258
+ type: "setContentComplete";
259
+ params: xstate.NonReducibleUnknown;
260
+ } | {
261
+ type: "setDesignApproved";
262
+ params: xstate.NonReducibleUnknown;
263
+ } | {
264
+ type: "setPublished";
265
+ params: xstate.NonReducibleUnknown;
266
+ }, {
267
+ type: "needsMessaging";
268
+ params: unknown;
269
+ } | {
270
+ type: "needsServices";
271
+ params: unknown;
272
+ } | {
273
+ type: "hasPrerequisites";
274
+ params: unknown;
275
+ } | {
276
+ type: "hasPages";
277
+ params: unknown;
278
+ } | {
279
+ type: "hasContent";
280
+ params: unknown;
281
+ } | {
282
+ type: "hasDesign";
283
+ params: unknown;
284
+ } | {
285
+ type: "hasDomain";
286
+ params: unknown;
287
+ }, never, "complete" | "messaging" | "checkPrerequisites" | "servicesPrereq" | "structure" | "content" | "design" | "publish", string, {
288
+ startupId: string;
289
+ hasStoryBrand: boolean;
290
+ hasServices: boolean;
291
+ }, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
292
+ id: "site-builder";
293
+ states: {
294
+ readonly checkPrerequisites: {};
295
+ readonly messaging: {};
296
+ readonly servicesPrereq: {};
297
+ readonly structure: {};
298
+ readonly content: {};
299
+ readonly design: {};
300
+ readonly publish: {};
301
+ readonly complete: {};
302
+ };
303
+ }>;
304
+
305
+ interface SalesBuilderContext {
306
+ startupId: string;
307
+ experimentId?: string;
308
+ hasSite: boolean;
309
+ hasDomain: boolean;
310
+ channels: {
311
+ paidAds: {
312
+ ready: boolean;
313
+ reason?: string;
314
+ };
315
+ coldOutbound: {
316
+ ready: boolean;
317
+ reason?: string;
318
+ };
319
+ contentSocial: {
320
+ ready: boolean;
321
+ reason?: string;
322
+ };
323
+ blog: {
324
+ ready: boolean;
325
+ };
326
+ };
327
+ campaignCount: number;
328
+ sequenceCount: number;
329
+ postCount: number;
330
+ hasExperiment: boolean;
331
+ hasMetrics: boolean;
332
+ }
333
+ type SalesBuilderEvent = {
334
+ type: 'ARTIFACT_CREATED';
335
+ collection: string;
336
+ count: number;
337
+ } | {
338
+ type: 'EXPERIMENT_CREATED';
339
+ experimentId: string;
340
+ } | {
341
+ type: 'METRICS_COLLECTED';
342
+ } | {
343
+ type: 'ADVANCE';
344
+ } | {
345
+ type: 'SKIP';
346
+ reason: string;
347
+ };
348
+ declare const salesBuilderMachine: xstate.StateMachine<SalesBuilderContext, {
349
+ type: "ARTIFACT_CREATED";
350
+ collection: string;
351
+ count: number;
352
+ } | {
353
+ type: "EXPERIMENT_CREATED";
354
+ experimentId: string;
355
+ } | {
356
+ type: "METRICS_COLLECTED";
357
+ } | {
358
+ type: "ADVANCE";
359
+ } | {
360
+ type: "SKIP";
361
+ reason: string;
362
+ }, {}, never, {
363
+ type: "updateArtifactCount";
364
+ params: xstate.NonReducibleUnknown;
365
+ } | {
366
+ type: "setExperiment";
367
+ params: xstate.NonReducibleUnknown;
368
+ } | {
369
+ type: "setMetrics";
370
+ params: xstate.NonReducibleUnknown;
371
+ }, {
372
+ type: "needsSite";
373
+ params: unknown;
374
+ } | {
375
+ type: "hasSite";
376
+ params: unknown;
377
+ } | {
378
+ type: "hasActiveChannel";
379
+ params: unknown;
380
+ } | {
381
+ type: "hasMetrics";
382
+ params: unknown;
383
+ }, never, "complete" | "checkPrerequisites" | "sitePrereq" | "launch" | "measure", string, {
384
+ startupId: string;
385
+ hasSite: boolean;
386
+ hasDomain: boolean;
387
+ }, xstate.NonReducibleUnknown, xstate.EventObject, xstate.MetaObject, {
388
+ id: "sales-builder";
389
+ states: {
390
+ readonly checkPrerequisites: {};
391
+ readonly sitePrereq: {};
392
+ readonly launch: {};
393
+ readonly measure: {};
394
+ readonly complete: {};
395
+ };
396
+ }>;
397
+
398
+ interface ArtifactCounts {
399
+ icpCount: number;
400
+ competitorCount: number;
401
+ leanCanvasCount: number;
402
+ hypothesisCount: number;
403
+ positioningSet: boolean;
404
+ differentiatorCount: number;
405
+ storyBrandCount: number;
406
+ serviceCount: number;
407
+ agentCount: number;
408
+ domainCount: number;
409
+ pageCount: number;
45
410
  }
46
411
  /**
47
- * Options for deploying a startup
412
+ * Fetch artifact counts for a given startup from the API.
413
+ * Uses `limit=0` to get only `totalDocs` without transferring documents.
48
414
  */
49
- interface DeployOptions {
50
- domain?: string;
415
+ declare function fetchArtifactCounts(startupId: string, apiBaseUrl: string, apiKey?: string): Promise<ArtifactCounts>;
416
+
417
+ interface ProgressEntry {
418
+ state: string;
419
+ label: string;
420
+ status: 'complete' | 'current' | 'pending';
421
+ }
422
+ interface NextCommand {
423
+ name: string;
424
+ collection: string;
425
+ operation: string;
426
+ command: string;
427
+ schema: Record<string, unknown>;
428
+ description: string;
51
429
  }
52
430
  /**
53
- * Deploy result
431
+ * Query the API for artifact counts, determine current state,
432
+ * and return the reconciled state name plus the artifact counts.
54
433
  */
55
- interface DeployResult {
56
- landing: string;
57
- dashboard?: string;
58
- }
434
+ declare function reconcileState(startupId: string, apiBaseUrl: string, apiKey?: string): Promise<{
435
+ currentState: string;
436
+ counts: ArtifactCounts;
437
+ }>;
59
438
  /**
60
- * Main builder API
439
+ * Return progress entries for every state in the machine.
61
440
  */
62
- declare const builder: {
63
- /**
64
- * Create complete startup foundation from idea
65
- *
66
- * @example
67
- * ```typescript
68
- * const startup = await builder.create({
69
- * idea: 'AI code review for engineering teams',
70
- * founder: {
71
- * capabilities: ['ML expertise', 'DevTools experience'],
72
- * insight: 'Code review is the biggest bottleneck',
73
- * motivation: 'Hated waiting for reviews'
74
- * }
75
- * })
76
- * ```
77
- */
78
- create(options: CreateOptions): Promise<StartupPackage>;
79
- /**
80
- * Run foundation sprint
81
- */
82
- foundation(idea: string, founder?: FounderInfo): Promise<foundation_sprint.Foundation>;
83
- /**
84
- * Generate lean canvas
85
- */
86
- canvas(input: string | any): Promise<lean_canvas.LeanCanvas>;
87
- /**
88
- * Generate ideal customer profile
89
- */
90
- icp(input: string | any): Promise<ideal_customer_profile.GenerateResult>;
91
- /**
92
- * Generate jobs to be done
93
- */
94
- jtbd(input: string | any): Promise<jobs_to_be_done.DiscoverResult>;
95
- /**
96
- * Generate story brand messaging
97
- */
98
- story(input: string | any, customerProfile?: any): Promise<storybrand.StoryBrandScript>;
99
- /**
100
- * Generate startup name
101
- */
102
- name(input: string | any, options?: any): Promise<startup_names.GenerateResult>;
103
- /**
104
- * Generate landing page
105
- */
106
- landing(name: any, brandStory?: any): Promise<landing_page.LandingPageOutput>;
107
- /**
108
- * Deploy startup to web
109
- */
110
- deploy(startup: StartupPackage, options?: DeployOptions): Promise<DeployResult>;
111
- };
441
+ declare function getProgress(currentState: string): ProgressEntry[];
112
442
  /**
113
- * Build complete startup from idea (convenience function)
114
- *
115
- * @example
116
- * ```typescript
117
- * const startup = await buildStartup('AI code review for teams')
118
- * ```
443
+ * Extract the `meta.commands` from the machine definition for the given state
444
+ * and fill in the startup ID to produce ready-to-run CLI commands.
119
445
  */
120
- declare function buildStartup(idea: string, founder?: FounderInfo): Promise<StartupPackage>;
446
+ declare function getNextCommands(currentState: string, startupId: string): NextCommand[];
121
447
 
122
- export { type CreateOptions, type DeployOptions, type DeployResult, type FounderInfo, type StartupPackage, buildStartup, builder };
448
+ export { type ArtifactCounts, type SalesBuilderContext, type SalesBuilderEvent, type ServicesBuilderContext, type ServicesBuilderEvent, type SiteBuilderContext, type SiteBuilderEvent, type StartupBuilderContext, type StartupBuilderEvent, fetchArtifactCounts, getNextCommands, getProgress, reconcileState, salesBuilderMachine, servicesBuilderMachine, siteBuilderMachine, startupBuilderMachine };
package/dist/index.js CHANGED
@@ -1,22 +1,20 @@
1
1
  import {
2
- buildStartup,
3
- builder,
4
- canvas,
5
- icp,
6
- jtbd,
7
- landing,
8
- sprint,
9
- startup,
10
- story
11
- } from "./chunk-DTWFVPYU.js";
2
+ fetchArtifactCounts,
3
+ getNextCommands,
4
+ getProgress,
5
+ reconcileState,
6
+ salesBuilderMachine,
7
+ servicesBuilderMachine,
8
+ siteBuilderMachine,
9
+ startupBuilderMachine
10
+ } from "./chunk-NWM7TYW6.js";
12
11
  export {
13
- buildStartup,
14
- builder,
15
- canvas,
16
- icp,
17
- jtbd,
18
- landing,
19
- startup as names,
20
- sprint,
21
- story
12
+ fetchArtifactCounts,
13
+ getNextCommands,
14
+ getProgress,
15
+ reconcileState,
16
+ salesBuilderMachine,
17
+ servicesBuilderMachine,
18
+ siteBuilderMachine,
19
+ startupBuilderMachine
22
20
  };
package/package.json CHANGED
@@ -1,55 +1,43 @@
1
1
  {
2
2
  "name": "startup-builder",
3
- "version": "0.1.0",
4
- "description": "Business-as-Code. Define your startup in minutes.",
3
+ "version": "0.2.0",
4
+ "description": "State-machine-driven startup builder — orchestrates the full Foundation Sprint sequence",
5
+ "license": "MIT",
5
6
  "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "bin": {
10
- "startup-builder": "./dist/cli.js"
11
- },
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
12
9
  "exports": {
13
10
  ".": {
14
11
  "import": "./dist/index.js",
15
12
  "types": "./dist/index.d.ts"
16
13
  }
17
14
  },
15
+ "bin": {
16
+ "startup-builder": "dist/cli.js"
17
+ },
18
18
  "files": [
19
19
  "dist"
20
20
  ],
21
21
  "scripts": {
22
- "build": "tsup src/index.ts src/cli.ts --format esm --dts --clean",
23
- "dev": "tsup src/index.ts src/cli.ts --format esm --dts --watch",
24
- "typecheck": "tsc --noEmit"
22
+ "build": "tsup",
23
+ "dev": "tsup --watch",
24
+ "check-types": "tsc --noEmit",
25
+ "test": "vitest run",
26
+ "clean": "rm -rf dist .turbo"
25
27
  },
26
- "keywords": [
27
- "startup",
28
- "builder",
29
- "business",
30
- "lean-canvas",
31
- "mvp"
32
- ],
33
- "author": "Startups.Studio",
34
- "license": "MIT",
35
28
  "dependencies": {
36
- "api.sb": "workspace:*",
37
- "db.sb": "workspace:*",
38
- "foundation-sprint": "workspace:*",
39
- "lean-canvas": "workspace:*",
40
- "ideal-customer-profile": "workspace:*",
41
- "jobs-to-be-done": "workspace:*",
42
- "storybrand": "workspace:*",
43
- "startup-names": "workspace:*",
44
- "landing-page": "workspace:*",
45
- "commander": "^12.0.0",
46
- "picocolors": "^1.1.0",
47
- "prompts": "^2.4.2"
29
+ "xstate": "^5",
30
+ "startups.studio": "0.6.0",
31
+ "commander": "^12.1.0",
32
+ "picocolors": "^1.1.0"
48
33
  },
49
34
  "devDependencies": {
50
- "@types/node": "^22.0.0",
51
- "@types/prompts": "^2.4.9",
52
- "tsup": "^8.0.0",
53
- "typescript": "^5.5.0"
35
+ "@startups-studio/typescript-config": "0.0.0",
36
+ "tsup": "^8",
37
+ "typescript": "^5",
38
+ "@types/node": "^22"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
54
42
  }
55
43
  }