@contractspec/example.lifecycle-cli 0.0.0-canary-20260113170453

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.
@@ -0,0 +1,25 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/lifecycle-cli/tsdown.config.js
4
+ ℹ entry: src/demo.ts, src/example.ts, src/index.ts, src/docs/index.ts, src/docs/lifecycle-cli.docblock.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 16 files
9
+ ℹ dist/demo.js 1.54 kB │ gzip: 0.77 kB
10
+ ℹ dist/docs/lifecycle-cli.docblock.js 1.44 kB │ gzip: 0.72 kB
11
+ ℹ dist/example.js 0.97 kB │ gzip: 0.51 kB
12
+ ℹ dist/index.js 0.18 kB │ gzip: 0.12 kB
13
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
14
+ ℹ dist/demo.js.map 2.79 kB │ gzip: 1.18 kB
15
+ ℹ dist/docs/lifecycle-cli.docblock.js.map 1.93 kB │ gzip: 0.90 kB
16
+ ℹ dist/example.js.map 1.40 kB │ gzip: 0.70 kB
17
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
18
+ ℹ dist/demo.d.ts.map 0.13 kB │ gzip: 0.13 kB
19
+ ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
20
+ ℹ dist/demo.d.ts 0.16 kB │ gzip: 0.14 kB
21
+ ℹ dist/index.d.ts 0.13 kB │ gzip: 0.10 kB
22
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
23
+ ℹ dist/docs/lifecycle-cli.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
24
+ ℹ 15 files, total: 11.11 kB
25
+ ✔ Build complete in 19411ms
@@ -0,0 +1,26 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/lifecycle-cli/tsdown.config.js
6
+ ℹ entry: src/demo.ts, src/example.ts, src/index.ts, src/docs/index.ts, src/docs/lifecycle-cli.docblock.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/demo.js 1.54 kB │ gzip: 0.77 kB
11
+ ℹ dist/docs/lifecycle-cli.docblock.js 1.44 kB │ gzip: 0.72 kB
12
+ ℹ dist/example.js 0.97 kB │ gzip: 0.51 kB
13
+ ℹ dist/index.js 0.18 kB │ gzip: 0.12 kB
14
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
15
+ ℹ dist/demo.js.map 2.79 kB │ gzip: 1.18 kB
16
+ ℹ dist/docs/lifecycle-cli.docblock.js.map 1.93 kB │ gzip: 0.90 kB
17
+ ℹ dist/example.js.map 1.40 kB │ gzip: 0.70 kB
18
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
19
+ ℹ dist/demo.d.ts.map 0.13 kB │ gzip: 0.13 kB
20
+ ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
21
+ ℹ dist/demo.d.ts 0.16 kB │ gzip: 0.14 kB
22
+ ℹ dist/index.d.ts 0.13 kB │ gzip: 0.10 kB
23
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
24
+ ℹ dist/docs/lifecycle-cli.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
25
+ ℹ 15 files, total: 11.11 kB
26
+ ✔ Build complete in 21269ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,378 @@
1
+ # @contractspec/example.lifecycle-cli
2
+
3
+ ## 0.0.0-canary-20260113170453
4
+
5
+ ### Minor Changes
6
+
7
+ - caf8701: feat: add cli vibe command to run workflow
8
+ - c69b849: feat: add api web services (mcp & website)
9
+ - 42b8d78: feat: add cli `contractspec vibe` workflow to simplify usage
10
+ - fd38e85: feat: auto-fix contractspec issues
11
+
12
+ ### Patch Changes
13
+
14
+ - e7ded36: feat: improve stability (adding ts-morph)
15
+ - c231a8b: test: improve workspace stability
16
+ - Updated dependencies [e7ded36]
17
+ - Updated dependencies [caf8701]
18
+ - Updated dependencies [c69b849]
19
+ - Updated dependencies [c231a8b]
20
+ - Updated dependencies [42b8d78]
21
+ - Updated dependencies [fd38e85]
22
+ - @contractspec/bundle.lifecycle-managed@0.0.0-canary-20260113170453
23
+ - @contractspec/lib.contracts@0.0.0-canary-20260113170453
24
+ - @contractspec/lib.lifecycle@0.0.0-canary-20260113170453
25
+ - @contractspec/lib.logger@0.0.0-canary-20260113170453
26
+
27
+ ## 1.46.2
28
+
29
+ ### Patch Changes
30
+
31
+ - 7e21625: feat: library services (landing page & api)
32
+ - Updated dependencies [7e21625]
33
+ - @contractspec/bundle.lifecycle-managed@1.46.2
34
+ - @contractspec/lib.contracts@1.46.2
35
+ - @contractspec/lib.lifecycle@1.46.2
36
+ - @contractspec/lib.logger@1.46.2
37
+
38
+ ## 1.46.1
39
+
40
+ ### Patch Changes
41
+
42
+ - 2d8a72b: fix: mcp for presentation
43
+ - Updated dependencies [2d8a72b]
44
+ - @contractspec/bundle.lifecycle-managed@1.46.1
45
+ - @contractspec/lib.contracts@1.46.1
46
+ - @contractspec/lib.lifecycle@1.46.1
47
+ - @contractspec/lib.logger@1.46.1
48
+
49
+ ## 1.46.0
50
+
51
+ ### Minor Changes
52
+
53
+ - 07cb19b: feat: feat: cleaude code & opencode integrations
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [07cb19b]
58
+ - @contractspec/bundle.lifecycle-managed@1.46.0
59
+ - @contractspec/lib.contracts@1.46.0
60
+ - @contractspec/lib.lifecycle@1.46.0
61
+ - @contractspec/lib.logger@1.46.0
62
+
63
+ ## 1.45.6
64
+
65
+ ### Patch Changes
66
+
67
+ - a913074: feat: improve ai agents rules management"
68
+ - Updated dependencies [a913074]
69
+ - @contractspec/bundle.lifecycle-managed@1.45.6
70
+ - @contractspec/lib.contracts@1.45.6
71
+ - @contractspec/lib.lifecycle@1.45.6
72
+ - @contractspec/lib.logger@1.45.6
73
+
74
+ ## 1.45.5
75
+
76
+ ### Patch Changes
77
+
78
+ - 9ddd7fa: feat: improve versioning
79
+ - Updated dependencies [9ddd7fa]
80
+ - @contractspec/bundle.lifecycle-managed@1.45.5
81
+ - @contractspec/lib.contracts@1.45.5
82
+ - @contractspec/lib.lifecycle@1.45.5
83
+ - @contractspec/lib.logger@1.45.5
84
+
85
+ ## 1.45.4
86
+
87
+ ### Patch Changes
88
+
89
+ - fix: github action
90
+ - Updated dependencies
91
+ - @contractspec/bundle.lifecycle-managed@1.45.4
92
+ - @contractspec/lib.contracts@1.45.4
93
+ - @contractspec/lib.lifecycle@1.45.4
94
+ - @contractspec/lib.logger@1.45.4
95
+
96
+ ## 1.45.3
97
+
98
+ ### Patch Changes
99
+
100
+ - e74ea9e: feat: version management
101
+ - Updated dependencies [e74ea9e]
102
+ - @contractspec/bundle.lifecycle-managed@1.45.3
103
+ - @contractspec/lib.contracts@1.45.3
104
+ - @contractspec/lib.lifecycle@1.45.3
105
+ - @contractspec/lib.logger@1.45.3
106
+
107
+ ## 1.45.2
108
+
109
+ ### Patch Changes
110
+
111
+ - 39ca241: code cleaning
112
+ - Updated dependencies [39ca241]
113
+ - @contractspec/bundle.lifecycle-managed@1.45.2
114
+ - @contractspec/lib.contracts@1.45.2
115
+ - @contractspec/lib.lifecycle@1.45.2
116
+ - @contractspec/lib.logger@1.45.2
117
+
118
+ ## 1.45.1
119
+
120
+ ### Patch Changes
121
+
122
+ - feat: improve app config and examples contracts
123
+ - Updated dependencies
124
+ - @contractspec/bundle.lifecycle-managed@1.45.1
125
+ - @contractspec/lib.contracts@1.45.1
126
+ - @contractspec/lib.lifecycle@1.45.1
127
+ - @contractspec/lib.logger@1.45.1
128
+ - @contractspec/lib.schema@1.45.1
129
+
130
+ ## 1.45.0
131
+
132
+ ### Minor Changes
133
+
134
+ - e73ca1d: feat: improve app config and examples contracts
135
+ feat: Contract layers support (features, examples, app-configs)
136
+
137
+ ### New CLI Commands
138
+ - `contractspec list layers` - List all contract layers with filtering
139
+
140
+ ### Enhanced Commands
141
+ - `contractspec ci` - New `layers` check category validates features/examples/config
142
+ - `contractspec doctor` - New `layers` health checks
143
+ - `contractspec integrity` - Now shows layer statistics
144
+
145
+ ### New APIs
146
+ - `discoverLayers()` - Scan workspace for all layer files
147
+ - `scanExampleSource()` - Parse ExampleSpec from source code
148
+ - `isExampleFile()` - Check if file is an example spec
149
+
150
+ ### Patch Changes
151
+
152
+ - Updated dependencies [e73ca1d]
153
+ - @contractspec/bundle.lifecycle-managed@1.45.0
154
+ - @contractspec/lib.contracts@1.45.0
155
+ - @contractspec/lib.lifecycle@1.45.0
156
+ - @contractspec/lib.logger@1.45.0
157
+ - @contractspec/lib.schema@1.45.0
158
+
159
+ ## 1.44.1
160
+
161
+ ### Patch Changes
162
+
163
+ - 3c594fb: fix
164
+ - Updated dependencies [3c594fb]
165
+ - @contractspec/bundle.lifecycle-managed@1.44.1
166
+ - @contractspec/lib.contracts@1.44.1
167
+ - @contractspec/lib.lifecycle@1.44.1
168
+ - @contractspec/lib.logger@1.44.1
169
+ - @contractspec/lib.schema@1.44.1
170
+
171
+ ## 1.44.0
172
+
173
+ ### Minor Changes
174
+
175
+ - 5f3a868: chore: isolate branding to contractspec.io
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [5f3a868]
180
+ - @contractspec/bundle.lifecycle-managed@1.44.0
181
+ - @contractspec/lib.contracts@1.44.0
182
+ - @contractspec/lib.lifecycle@1.44.0
183
+ - @contractspec/lib.logger@1.44.0
184
+ - @contractspec/lib.schema@1.44.0
185
+
186
+ ## 1.43.4
187
+
188
+ ### Patch Changes
189
+
190
+ - 9216062: fix: cross-platform compatibility
191
+ - Updated dependencies [9216062]
192
+ - @contractspec/bundle.lifecycle-managed@1.43.4
193
+ - @contractspec/lib.contracts@1.43.4
194
+ - @contractspec/lib.lifecycle@1.43.3
195
+ - @contractspec/lib.logger@1.43.3
196
+ - @contractspec/lib.schema@1.43.3
197
+
198
+ ## 1.43.3
199
+
200
+ ### Patch Changes
201
+
202
+ - 24d9759: improve documentation
203
+ - Updated dependencies [24d9759]
204
+ - @contractspec/bundle.lifecycle-managed@1.43.3
205
+ - @contractspec/lib.contracts@1.43.3
206
+ - @contractspec/lib.lifecycle@1.43.2
207
+ - @contractspec/lib.logger@1.43.2
208
+ - @contractspec/lib.schema@1.43.2
209
+
210
+ ## 1.43.2
211
+
212
+ ### Patch Changes
213
+
214
+ - e147271: fix: improve stability
215
+ - Updated dependencies [e147271]
216
+ - @contractspec/bundle.lifecycle-managed@1.43.2
217
+ - @contractspec/lib.contracts@1.43.2
218
+ - @contractspec/lib.lifecycle@1.43.1
219
+ - @contractspec/lib.logger@1.43.1
220
+ - @contractspec/lib.schema@1.43.1
221
+
222
+ ## 1.43.1
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies [f28fdad]
227
+ - @contractspec/lib.contracts@1.43.1
228
+ - @contractspec/bundle.lifecycle-managed@1.43.1
229
+
230
+ ## 1.43.0
231
+
232
+ ### Minor Changes
233
+
234
+ - 042d072: feat: schema declaration using json schema, including zod
235
+
236
+ ### Patch Changes
237
+
238
+ - Updated dependencies [042d072]
239
+ - @contractspec/bundle.lifecycle-managed@1.43.0
240
+ - @contractspec/lib.contracts@1.43.0
241
+ - @contractspec/lib.lifecycle@1.43.0
242
+ - @contractspec/lib.logger@1.43.0
243
+ - @contractspec/lib.schema@1.43.0
244
+
245
+ ## 1.42.10
246
+
247
+ ### Patch Changes
248
+
249
+ - 1e6a0f1: fix: mcp server
250
+ - Updated dependencies [1e6a0f1]
251
+ - @contractspec/bundle.lifecycle-managed@1.42.10
252
+ - @contractspec/lib.contracts@1.42.10
253
+ - @contractspec/lib.lifecycle@1.42.10
254
+ - @contractspec/lib.logger@1.42.10
255
+ - @contractspec/lib.schema@1.42.10
256
+
257
+ ## 1.42.9
258
+
259
+ ### Patch Changes
260
+
261
+ - 9281db7: fix ModelRegistry
262
+ - Updated dependencies [9281db7]
263
+ - @contractspec/bundle.lifecycle-managed@1.42.9
264
+ - @contractspec/lib.contracts@1.42.9
265
+ - @contractspec/lib.lifecycle@1.42.9
266
+ - @contractspec/lib.logger@1.42.9
267
+ - @contractspec/lib.schema@1.42.9
268
+
269
+ ## 1.42.8
270
+
271
+ ### Patch Changes
272
+
273
+ - e07b5ac: fix
274
+ - Updated dependencies [e07b5ac]
275
+ - @contractspec/bundle.lifecycle-managed@1.42.8
276
+ - @contractspec/lib.contracts@1.42.8
277
+ - @contractspec/lib.lifecycle@1.42.8
278
+ - @contractspec/lib.logger@1.42.8
279
+ - @contractspec/lib.schema@1.42.8
280
+
281
+ ## 1.42.7
282
+
283
+ ### Patch Changes
284
+
285
+ - e9b575d: fix release
286
+ - Updated dependencies [e9b575d]
287
+ - @contractspec/bundle.lifecycle-managed@1.42.7
288
+ - @contractspec/lib.contracts@1.42.7
289
+ - @contractspec/lib.lifecycle@1.42.7
290
+ - @contractspec/lib.logger@1.42.7
291
+ - @contractspec/lib.schema@1.42.7
292
+
293
+ ## 1.42.6
294
+
295
+ ### Patch Changes
296
+
297
+ - 1500242: fix tooling
298
+ - Updated dependencies [1500242]
299
+ - @contractspec/bundle.lifecycle-managed@1.42.6
300
+ - @contractspec/lib.contracts@1.42.6
301
+ - @contractspec/lib.lifecycle@1.42.6
302
+ - @contractspec/lib.logger@1.42.6
303
+ - @contractspec/lib.schema@1.42.6
304
+
305
+ ## 1.42.5
306
+
307
+ ### Patch Changes
308
+
309
+ - 1299719: fix vscode
310
+ - Updated dependencies [1299719]
311
+ - @contractspec/bundle.lifecycle-managed@1.42.5
312
+ - @contractspec/lib.contracts@1.42.5
313
+ - @contractspec/lib.lifecycle@1.42.5
314
+ - @contractspec/lib.logger@1.42.5
315
+ - @contractspec/lib.schema@1.42.5
316
+
317
+ ## 1.42.4
318
+
319
+ ### Patch Changes
320
+
321
+ - ac28b99: fix: generate from openapi
322
+ - Updated dependencies [ac28b99]
323
+ - @contractspec/bundle.lifecycle-managed@1.42.4
324
+ - @contractspec/lib.contracts@1.42.4
325
+ - @contractspec/lib.lifecycle@1.42.4
326
+ - @contractspec/lib.logger@1.42.4
327
+ - @contractspec/lib.schema@1.42.4
328
+
329
+ ## 1.42.3
330
+
331
+ ### Patch Changes
332
+
333
+ - 3f5d015: fix(tooling): cicd
334
+ - Updated dependencies [3f5d015]
335
+ - @contractspec/bundle.lifecycle-managed@1.42.3
336
+ - @contractspec/lib.contracts@1.42.3
337
+ - @contractspec/lib.lifecycle@1.42.3
338
+ - @contractspec/lib.logger@1.42.3
339
+ - @contractspec/lib.schema@1.42.3
340
+
341
+ ## 1.42.2
342
+
343
+ ### Patch Changes
344
+
345
+ - 1f9ac4c: fix
346
+ - Updated dependencies [1f9ac4c]
347
+ - @contractspec/bundle.lifecycle-managed@1.42.2
348
+ - @contractspec/lib.contracts@1.42.2
349
+ - @contractspec/lib.lifecycle@1.42.2
350
+ - @contractspec/lib.logger@1.42.2
351
+ - @contractspec/lib.schema@1.42.2
352
+
353
+ ## 1.42.1
354
+
355
+ ### Patch Changes
356
+
357
+ - f043995: Fix release
358
+ - Updated dependencies [f043995]
359
+ - @contractspec/bundle.lifecycle-managed@1.42.1
360
+ - @contractspec/lib.contracts@1.42.1
361
+ - @contractspec/lib.lifecycle@1.42.1
362
+ - @contractspec/lib.logger@1.42.1
363
+ - @contractspec/lib.schema@1.42.1
364
+
365
+ ## 1.42.0
366
+
367
+ ### Minor Changes
368
+
369
+ - 8eefd9c: initial release
370
+
371
+ ### Patch Changes
372
+
373
+ - Updated dependencies [8eefd9c]
374
+ - @contractspec/bundle.lifecycle-managed@1.42.0
375
+ - @contractspec/lib.contracts@1.42.0
376
+ - @contractspec/lib.lifecycle@1.42.0
377
+ - @contractspec/lib.logger@1.42.0
378
+ - @contractspec/lib.schema@1.42.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ ## Lifecycle CLI Demo
2
+
3
+ Website: https://contractspec.io/
4
+
5
+
6
+ Tiny script showing how to run the lifecycle managed service from a CLI (no HTTP server required). It stitches together mock analytics + questionnaire adapters, runs an assessment, and prints the resulting recommendation/libraries.
7
+
8
+ ### Run
9
+
10
+ ```bash
11
+ bunx tsx packages/examples/lifecycle-cli/demo.ts
12
+ ```
13
+
14
+ Feel free to tweak the mock data in `demo.ts` (or `src/demo.ts`) to experiment with different lifecycle stages.
15
+
package/demo.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { runLifecycleCliDemo } from './src/demo';
2
+
3
+ void runLifecycleCliDemo().catch((error) => {
4
+ // Keep console usage limited to this demo entrypoint only.
5
+ // Prefer structured logging within the library (see src/demo.ts).
6
+ // eslint-disable-next-line no-console
7
+ console.error(error);
8
+ process.exitCode = 1;
9
+ });
10
+
11
+ /*
12
+
13
+ bun build --compile --minify-whitespace --minify-syntax --target bun --outfile server src/index.ts
14
+ */
package/dist/demo.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ //#region src/demo.d.ts
2
+ declare function runLifecycleCliDemo(): Promise<void>;
3
+ //#endregion
4
+ export { runLifecycleCliDemo };
5
+ //# sourceMappingURL=demo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo.d.ts","names":[],"sources":["../src/demo.ts"],"sourcesContent":[],"mappings":";iBAmBsB,mBAAA,CAAA,GAAuB"}
package/dist/demo.js ADDED
@@ -0,0 +1,49 @@
1
+ import { LifecycleAssessmentService, createLifecycleHandlers } from "@contractspec/bundle.lifecycle-managed";
2
+ import { CapitalPhase, CompanyPhase, ProductPhase } from "@contractspec/lib.lifecycle";
3
+ import { LogLevel, Logger } from "@contractspec/lib.logger";
4
+
5
+ //#region src/demo.ts
6
+ const logger = new Logger({
7
+ level: process.env.NODE_ENV === "production" ? LogLevel.INFO : LogLevel.DEBUG,
8
+ environment: process.env.NODE_ENV || "development",
9
+ enableColors: process.env.NODE_ENV !== "production"
10
+ });
11
+ async function runLifecycleCliDemo() {
12
+ const response = await createLifecycleHandlers(new LifecycleAssessmentService({ collector: {
13
+ analyticsAdapter: { async fetch() {
14
+ return { metrics: {
15
+ activeUsers: 32,
16
+ weeklyActiveUsers: 27,
17
+ retentionRate: .36,
18
+ monthlyRecurringRevenue: 1800,
19
+ customerCount: 22,
20
+ teamSize: 6
21
+ } };
22
+ } },
23
+ questionnaireAdapter: { async fetch() {
24
+ return {
25
+ axes: {
26
+ product: ProductPhase.Mvp,
27
+ company: CompanyPhase.TinyTeam,
28
+ capital: CapitalPhase.Seed
29
+ },
30
+ answers: {
31
+ interviewCount: 28,
32
+ primaryPain: "Manual onboarding takes 3 hours per customer."
33
+ }
34
+ };
35
+ } }
36
+ } })).runAssessment({ body: {
37
+ tenantId: "demo-tenant",
38
+ completedMilestones: ["stage0-problem-statement"]
39
+ } });
40
+ logger.info("Lifecycle assessment computed", {
41
+ assessment: response.body.assessment,
42
+ topRecommendation: response.body.recommendation.actions[0],
43
+ libraries: response.body.libraries
44
+ });
45
+ }
46
+
47
+ //#endregion
48
+ export { runLifecycleCliDemo };
49
+ //# sourceMappingURL=demo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo.js","names":[],"sources":["../src/demo.ts"],"sourcesContent":["import {\n createLifecycleHandlers,\n LifecycleAssessmentService,\n} from '@contractspec/bundle.lifecycle-managed';\nimport {\n CapitalPhase,\n CompanyPhase,\n ProductPhase,\n} from '@contractspec/lib.lifecycle';\nimport { Logger, LogLevel } from '@contractspec/lib.logger';\nimport type { LoggerConfig } from '@contractspec/lib.logger/types';\n\nconst logger = new Logger({\n level: process.env.NODE_ENV === 'production' ? LogLevel.INFO : LogLevel.DEBUG,\n environment:\n (process.env.NODE_ENV as LoggerConfig['environment']) || 'development',\n enableColors: process.env.NODE_ENV !== 'production',\n});\n\nexport async function runLifecycleCliDemo(): Promise<void> {\n const service = new LifecycleAssessmentService({\n collector: {\n analyticsAdapter: {\n async fetch() {\n return {\n metrics: {\n activeUsers: 32,\n weeklyActiveUsers: 27,\n retentionRate: 0.36,\n monthlyRecurringRevenue: 1800,\n customerCount: 22,\n teamSize: 6,\n },\n };\n },\n },\n questionnaireAdapter: {\n async fetch() {\n return {\n axes: {\n product: ProductPhase.Mvp,\n company: CompanyPhase.TinyTeam,\n capital: CapitalPhase.Seed,\n },\n answers: {\n interviewCount: 28,\n primaryPain: 'Manual onboarding takes 3 hours per customer.',\n },\n };\n },\n },\n },\n });\n\n const handlers = createLifecycleHandlers(service);\n\n const response = await handlers.runAssessment({\n body: {\n tenantId: 'demo-tenant',\n completedMilestones: ['stage0-problem-statement'],\n },\n });\n\n logger.info('Lifecycle assessment computed', {\n assessment: response.body.assessment,\n topRecommendation: response.body.recommendation.actions[0],\n libraries: response.body.libraries,\n });\n}\n"],"mappings":";;;;;AAYA,MAAM,SAAS,IAAI,OAAO;CACxB,OAAO,QAAQ,IAAI,aAAa,eAAe,SAAS,OAAO,SAAS;CACxE,aACG,QAAQ,IAAI,YAA4C;CAC3D,cAAc,QAAQ,IAAI,aAAa;CACxC,CAAC;AAEF,eAAsB,sBAAqC;CAqCzD,MAAM,WAAW,MAFA,wBAlCD,IAAI,2BAA2B,EAC7C,WAAW;EACT,kBAAkB,EAChB,MAAM,QAAQ;AACZ,UAAO,EACL,SAAS;IACP,aAAa;IACb,mBAAmB;IACnB,eAAe;IACf,yBAAyB;IACzB,eAAe;IACf,UAAU;IACX,EACF;KAEJ;EACD,sBAAsB,EACpB,MAAM,QAAQ;AACZ,UAAO;IACL,MAAM;KACJ,SAAS,aAAa;KACtB,SAAS,aAAa;KACtB,SAAS,aAAa;KACvB;IACD,SAAS;KACP,gBAAgB;KAChB,aAAa;KACd;IACF;KAEJ;EACF,EACF,CAAC,CAE+C,CAEjB,cAAc,EAC5C,MAAM;EACJ,UAAU;EACV,qBAAqB,CAAC,2BAA2B;EAClD,EACF,CAAC;AAEF,QAAO,KAAK,iCAAiC;EAC3C,YAAY,SAAS,KAAK;EAC1B,mBAAmB,SAAS,KAAK,eAAe,QAAQ;EACxD,WAAW,SAAS,KAAK;EAC1B,CAAC"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./lifecycle-cli.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,33 @@
1
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/docs/lifecycle-cli.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.lifecycle-cli",
6
+ title: "Lifecycle CLI (demo)",
7
+ summary: "Run a lifecycle assessment from a CLI using the lifecycle-managed bundle (no HTTP server required).",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/lifecycle-cli",
11
+ tags: [
12
+ "lifecycle",
13
+ "cli",
14
+ "example"
15
+ ],
16
+ body: `## What this example shows\n- How to call \`LifecycleAssessmentService\` from a Node/Bun script.\n- How to wire mock analytics + questionnaire adapters.\n\n## Run\n- Use the exported function \`runLifecycleCliDemo()\` (or call it from your own CLI wrapper).\n\n## Notes\n- Keep outputs structured; avoid \`console.log\` in production paths.\n- This example is deterministic (fixed inputs → stable output).`
17
+ }, {
18
+ id: "docs.examples.lifecycle-cli.usage",
19
+ title: "Lifecycle CLI — Usage",
20
+ summary: "How to run and tweak the lifecycle assessment demo.",
21
+ kind: "usage",
22
+ visibility: "public",
23
+ route: "/docs/examples/lifecycle-cli/usage",
24
+ tags: [
25
+ "lifecycle",
26
+ "cli",
27
+ "usage"
28
+ ],
29
+ body: `## Usage\n1) Call \`runLifecycleCliDemo()\`.\n2) Adjust the mock metrics/answers to explore stage outcomes.\n\n## Guardrails\n- Avoid PII in logs.\n- Keep adapters explicit and deterministic for reproducible demos.`
30
+ }]);
31
+
32
+ //#endregion
33
+ //# sourceMappingURL=lifecycle-cli.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-cli.docblock.js","names":[],"sources":["../../src/docs/lifecycle-cli.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.lifecycle-cli',\n title: 'Lifecycle CLI (demo)',\n summary:\n 'Run a lifecycle assessment from a CLI using the lifecycle-managed bundle (no HTTP server required).',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/lifecycle-cli',\n tags: ['lifecycle', 'cli', 'example'],\n body: `## What this example shows\\n- How to call \\`LifecycleAssessmentService\\` from a Node/Bun script.\\n- How to wire mock analytics + questionnaire adapters.\\n\\n## Run\\n- Use the exported function \\`runLifecycleCliDemo()\\` (or call it from your own CLI wrapper).\\n\\n## Notes\\n- Keep outputs structured; avoid \\`console.log\\` in production paths.\\n- This example is deterministic (fixed inputs → stable output).`,\n },\n {\n id: 'docs.examples.lifecycle-cli.usage',\n title: 'Lifecycle CLI — Usage',\n summary: 'How to run and tweak the lifecycle assessment demo.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/lifecycle-cli/usage',\n tags: ['lifecycle', 'cli', 'usage'],\n body: `## Usage\\n1) Call \\`runLifecycleCliDemo()\\`.\\n2) Adjust the mock metrics/answers to explore stage outcomes.\\n\\n## Guardrails\\n- Avoid PII in logs.\\n- Keep adapters explicit and deterministic for reproducible demos.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;AA2BA,kBAxB2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAO;EAAU;CACrC,MAAM;CACP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAO;EAAQ;CACnC,MAAM;CACP,CACF,CAEwB"}
@@ -0,0 +1,7 @@
1
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/example.d.ts
4
+ declare const example: _contractspec_lib_contracts0.ExampleSpec;
5
+ //#endregion
6
+ export { example as default };
7
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SA2BJ,4BAAA,CA3BW"}
@@ -0,0 +1,45 @@
1
+ import { defineExample } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/example.ts
4
+ const example = defineExample({
5
+ meta: {
6
+ key: "lifecycle-cli",
7
+ version: "1.0.0",
8
+ title: "Lifecycle CLI",
9
+ description: "Tiny script showing how to run the lifecycle managed service from a CLI (no HTTP server required).",
10
+ kind: "script",
11
+ visibility: "public",
12
+ stability: "experimental",
13
+ owners: ["@platform.core"],
14
+ tags: [
15
+ "lifecycle",
16
+ "cli",
17
+ "demo"
18
+ ]
19
+ },
20
+ docs: {
21
+ rootDocId: "docs.examples.lifecycle-cli",
22
+ usageDocId: "docs.examples.lifecycle-cli.usage"
23
+ },
24
+ entrypoints: {
25
+ packageName: "@contractspec/example.lifecycle-cli",
26
+ docs: "./docs"
27
+ },
28
+ surfaces: {
29
+ templates: true,
30
+ sandbox: {
31
+ enabled: true,
32
+ modes: ["markdown"]
33
+ },
34
+ studio: {
35
+ enabled: true,
36
+ installable: true
37
+ },
38
+ mcp: { enabled: true }
39
+ }
40
+ });
41
+ var example_default = example;
42
+
43
+ //#endregion
44
+ export { example_default as default };
45
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'lifecycle-cli',\n version: '1.0.0',\n title: 'Lifecycle CLI',\n description:\n 'Tiny script showing how to run the lifecycle managed service from a CLI (no HTTP server required).',\n kind: 'script',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['lifecycle', 'cli', 'demo'],\n },\n docs: {\n rootDocId: 'docs.examples.lifecycle-cli',\n usageDocId: 'docs.examples.lifecycle-cli.usage',\n },\n entrypoints: {\n packageName: '@contractspec/example.lifecycle-cli',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAa;GAAO;GAAO;EACnC;CACD,MAAM;EACJ,WAAW;EACX,YAAY;EACb;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,WAAW;GAAE;EAC/C,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
@@ -0,0 +1,3 @@
1
+ import { runLifecycleCliDemo } from "./demo.js";
2
+ import example from "./example.js";
3
+ export { example, runLifecycleCliDemo };
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { runLifecycleCliDemo } from "./demo.js";
2
+ import example_default from "./example.js";
3
+ import "./docs/index.js";
4
+
5
+ export { example_default as example, runLifecycleCliDemo };