@contractspec/lib.lifecycle 1.57.0 → 1.58.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.
@@ -1,53 +1,49 @@
1
- import { LifecycleStage } from "./stages.js";
2
- import { LifecycleAxes } from "./axes.js";
3
- import { LifecycleScore, LifecycleSignal } from "./signals.js";
4
-
5
- //#region src/types/milestones.d.ts
6
- type LifecycleMilestoneCategory = 'product' | 'company' | 'capital' | 'operations';
7
- interface LifecycleMilestone {
8
- id: string;
9
- stage: LifecycleStage;
10
- category: LifecycleMilestoneCategory;
11
- title: string;
12
- description: string;
13
- priority: number;
14
- detectionCriteria?: Record<string, unknown>;
15
- guideContent?: string;
16
- actionItems?: string[];
1
+ import { LifecycleStage } from './stages';
2
+ import type { LifecycleAxes } from './axes';
3
+ import type { LifecycleSignal, LifecycleScore } from './signals';
4
+ export type LifecycleMilestoneCategory = 'product' | 'company' | 'capital' | 'operations';
5
+ export interface LifecycleMilestone {
6
+ id: string;
7
+ stage: LifecycleStage;
8
+ category: LifecycleMilestoneCategory;
9
+ title: string;
10
+ description: string;
11
+ priority: number;
12
+ detectionCriteria?: Record<string, unknown>;
13
+ guideContent?: string;
14
+ actionItems?: string[];
17
15
  }
18
- interface LifecycleAction {
19
- id: string;
20
- stage: LifecycleStage;
21
- title: string;
22
- description: string;
23
- priority: number;
24
- estimatedImpact: 'low' | 'medium' | 'high';
25
- effortLevel: 'xs' | 's' | 'm' | 'l';
26
- category: LifecycleMilestoneCategory | 'growth' | 'ops';
27
- recommendedLibraries?: string[];
16
+ export interface LifecycleAction {
17
+ id: string;
18
+ stage: LifecycleStage;
19
+ title: string;
20
+ description: string;
21
+ priority: number;
22
+ estimatedImpact: 'low' | 'medium' | 'high';
23
+ effortLevel: 'xs' | 's' | 'm' | 'l';
24
+ category: LifecycleMilestoneCategory | 'growth' | 'ops';
25
+ recommendedLibraries?: string[];
28
26
  }
29
- interface LifecycleAssessment {
30
- stage: LifecycleStage;
31
- confidence: number;
32
- axes: LifecycleAxes;
33
- signals: LifecycleSignal[];
34
- metrics?: Record<string, number | undefined>;
35
- gaps: string[];
36
- focusAreas: string[];
37
- scorecard: LifecycleScore[];
38
- generatedAt: string;
27
+ export interface LifecycleAssessment {
28
+ stage: LifecycleStage;
29
+ confidence: number;
30
+ axes: LifecycleAxes;
31
+ signals: LifecycleSignal[];
32
+ metrics?: Record<string, number | undefined>;
33
+ gaps: string[];
34
+ focusAreas: string[];
35
+ scorecard: LifecycleScore[];
36
+ generatedAt: string;
39
37
  }
40
- interface LifecycleRecommendation {
41
- assessmentId: string;
42
- stage: LifecycleStage;
43
- actions: LifecycleAction[];
44
- upcomingMilestones: LifecycleMilestone[];
45
- ceremony?: {
46
- title: string;
47
- copy: string;
48
- cues: string[];
49
- };
38
+ export interface LifecycleRecommendation {
39
+ assessmentId: string;
40
+ stage: LifecycleStage;
41
+ actions: LifecycleAction[];
42
+ upcomingMilestones: LifecycleMilestone[];
43
+ ceremony?: {
44
+ title: string;
45
+ copy: string;
46
+ cues: string[];
47
+ };
50
48
  }
51
- //#endregion
52
- export { LifecycleAction, LifecycleAssessment, LifecycleMilestone, LifecycleMilestoneCategory, LifecycleRecommendation };
53
49
  //# sourceMappingURL=milestones.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"milestones.d.ts","names":[],"sources":["../../src/types/milestones.ts"],"mappings":";;;;;KAIY,0BAAA;AAAA,UAMK,kBAAA;EACf,EAAA;EACA,KAAA,EAAO,cAAA;EACP,QAAA,EAAU,0BAAA;EACV,KAAA;EACA,WAAA;EACA,QAAA;EACA,iBAAA,GAAoB,MAAA;EACpB,YAAA;EACA,WAAA;AAAA;AAAA,UAGe,eAAA;EACf,EAAA;EACA,KAAA,EAAO,cAAA;EACP,KAAA;EACA,WAAA;EACA,QAAA;EACA,eAAA;EACA,WAAA;EACA,QAAA,EAAU,0BAAA;EACV,oBAAA;AAAA;AAAA,UAGe,mBAAA;EACf,KAAA,EAAO,cAAA;EACP,UAAA;EACA,IAAA,EAAM,aAAA;EACN,OAAA,EAAS,eAAA;EACT,OAAA,GAAU,MAAA;EACV,IAAA;EACA,UAAA;EACA,SAAA,EAAW,cAAA;EACX,WAAA;AAAA;AAAA,UAGe,uBAAA;EACf,YAAA;EACA,KAAA,EAAO,cAAA;EACP,OAAA,EAAS,eAAA;EACT,kBAAA,EAAoB,kBAAA;EACpB,QAAA;IACE,KAAA;IACA,IAAA;IACA,IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"milestones.d.ts","sourceRoot":"","sources":["../../src/types/milestones.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,MAAM,0BAA0B,GAClC,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,CAAC;AAEjB,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,0BAA0B,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,WAAW,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACpC,QAAQ,EAAE,0BAA0B,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxD,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;CACH"}
@@ -1,44 +1,40 @@
1
- import { LifecycleStage } from "./stages.js";
2
- import { LifecycleAxes, LifecycleAxis } from "./axes.js";
3
-
4
- //#region src/types/signals.d.ts
5
- type LifecycleSignalSource = 'analytics' | 'questionnaire' | 'intent' | 'manual' | 'simulation';
6
- type LifecycleSignalKind = 'metric' | 'qualitative' | 'event' | 'milestone' | 'heuristic';
7
- interface LifecycleSignal {
8
- id: string;
9
- stageHint?: LifecycleStage;
10
- axis?: LifecycleAxis;
11
- kind: LifecycleSignalKind;
12
- source: LifecycleSignalSource;
13
- name: string;
14
- value: number | string | boolean;
15
- weight: number;
16
- confidence: number;
17
- details?: Record<string, unknown>;
18
- capturedAt: string;
1
+ import { LifecycleStage } from './stages';
2
+ import type { LifecycleAxis, LifecycleAxes } from './axes';
3
+ export type LifecycleSignalSource = 'analytics' | 'questionnaire' | 'intent' | 'manual' | 'simulation';
4
+ export type LifecycleSignalKind = 'metric' | 'qualitative' | 'event' | 'milestone' | 'heuristic';
5
+ export interface LifecycleSignal {
6
+ id: string;
7
+ stageHint?: LifecycleStage;
8
+ axis?: LifecycleAxis;
9
+ kind: LifecycleSignalKind;
10
+ source: LifecycleSignalSource;
11
+ name: string;
12
+ value: number | string | boolean;
13
+ weight: number;
14
+ confidence: number;
15
+ details?: Record<string, unknown>;
16
+ capturedAt: string;
19
17
  }
20
- interface LifecycleMetricSnapshot {
21
- activeUsers?: number;
22
- weeklyActiveUsers?: number;
23
- retentionRate?: number;
24
- monthlyRecurringRevenue?: number;
25
- customerCount?: number;
26
- teamSize?: number;
27
- burnMultiple?: number;
28
- qualitativeSupport?: string[];
18
+ export interface LifecycleMetricSnapshot {
19
+ activeUsers?: number;
20
+ weeklyActiveUsers?: number;
21
+ retentionRate?: number;
22
+ monthlyRecurringRevenue?: number;
23
+ customerCount?: number;
24
+ teamSize?: number;
25
+ burnMultiple?: number;
26
+ qualitativeSupport?: string[];
29
27
  }
30
- interface LifecycleScore {
31
- stage: LifecycleStage;
32
- score: number;
33
- confidence: number;
34
- supportingSignals: string[];
28
+ export interface LifecycleScore {
29
+ stage: LifecycleStage;
30
+ score: number;
31
+ confidence: number;
32
+ supportingSignals: string[];
35
33
  }
36
- interface LifecycleAssessmentInput {
37
- axes?: Partial<LifecycleAxes>;
38
- metrics?: LifecycleMetricSnapshot;
39
- signals?: LifecycleSignal[];
40
- questionnaireAnswers?: Record<string, unknown>;
34
+ export interface LifecycleAssessmentInput {
35
+ axes?: Partial<LifecycleAxes>;
36
+ metrics?: LifecycleMetricSnapshot;
37
+ signals?: LifecycleSignal[];
38
+ questionnaireAnswers?: Record<string, unknown>;
41
39
  }
42
- //#endregion
43
- export { LifecycleAssessmentInput, LifecycleMetricSnapshot, LifecycleScore, LifecycleSignal, LifecycleSignalKind, LifecycleSignalSource };
44
40
  //# sourceMappingURL=signals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signals.d.ts","names":[],"sources":["../../src/types/signals.ts"],"mappings":";;;;KAGY,qBAAA;AAAA,KAOA,mBAAA;AAAA,UAOK,eAAA;EACf,EAAA;EACA,SAAA,GAAY,cAAA;EACZ,IAAA,GAAO,aAAA;EACP,IAAA,EAAM,mBAAA;EACN,MAAA,EAAQ,qBAAA;EACR,IAAA;EACA,KAAA;EACA,MAAA;EACA,UAAA;EACA,OAAA,GAAU,MAAA;EACV,UAAA;AAAA;AAAA,UAGe,uBAAA;EACf,WAAA;EACA,iBAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,QAAA;EACA,YAAA;EACA,kBAAA;AAAA;AAAA,UAGe,cAAA;EACf,KAAA,EAAO,cAAA;EACP,KAAA;EACA,UAAA;EACA,iBAAA;AAAA;AAAA,UAGe,wBAAA;EACf,IAAA,GAAO,OAAA,CAAQ,aAAA;EACf,OAAA,GAAU,uBAAA;EACV,OAAA,GAAU,eAAA;EACV,oBAAA,GAAuB,MAAA;AAAA"}
1
+ {"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/types/signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE3D,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,eAAe,GACf,QAAQ,GACR,QAAQ,GACR,YAAY,CAAC;AAEjB,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,aAAa,GACb,OAAO,GACP,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD"}
@@ -1,27 +1,24 @@
1
- //#region src/types/stages.d.ts
2
- declare enum LifecycleStage {
3
- Exploration = 0,
4
- ProblemSolutionFit = 1,
5
- MvpEarlyTraction = 2,
6
- ProductMarketFit = 3,
7
- GrowthScaleUp = 4,
8
- ExpansionPlatform = 5,
9
- MaturityRenewal = 6
1
+ export declare enum LifecycleStage {
2
+ Exploration = 0,
3
+ ProblemSolutionFit = 1,
4
+ MvpEarlyTraction = 2,
5
+ ProductMarketFit = 3,
6
+ GrowthScaleUp = 4,
7
+ ExpansionPlatform = 5,
8
+ MaturityRenewal = 6
10
9
  }
11
- type LifecycleStageSlug = 'exploration' | 'problem-solution-fit' | 'mvp-early-traction' | 'product-market-fit' | 'growth-scale-up' | 'expansion-platform' | 'maturity-renewal';
12
- interface LifecycleStageMetadata {
13
- id: LifecycleStage;
14
- order: number;
15
- slug: LifecycleStageSlug;
16
- name: string;
17
- question: string;
18
- signals: string[];
19
- traps: string[];
20
- focusAreas: string[];
10
+ export type LifecycleStageSlug = 'exploration' | 'problem-solution-fit' | 'mvp-early-traction' | 'product-market-fit' | 'growth-scale-up' | 'expansion-platform' | 'maturity-renewal';
11
+ export interface LifecycleStageMetadata {
12
+ id: LifecycleStage;
13
+ order: number;
14
+ slug: LifecycleStageSlug;
15
+ name: string;
16
+ question: string;
17
+ signals: string[];
18
+ traps: string[];
19
+ focusAreas: string[];
21
20
  }
22
- declare const LIFECYCLE_STAGE_ORDER: LifecycleStage[];
23
- declare const LIFECYCLE_STAGE_META: Record<LifecycleStage, LifecycleStageMetadata>;
24
- declare const getLifecycleStageBySlug: (slug: LifecycleStageSlug) => LifecycleStage;
25
- //#endregion
26
- export { LIFECYCLE_STAGE_META, LIFECYCLE_STAGE_ORDER, LifecycleStage, LifecycleStageMetadata, LifecycleStageSlug, getLifecycleStageBySlug };
21
+ export declare const LIFECYCLE_STAGE_ORDER: LifecycleStage[];
22
+ export declare const LIFECYCLE_STAGE_META: Record<LifecycleStage, LifecycleStageMetadata>;
23
+ export declare const getLifecycleStageBySlug: (slug: LifecycleStageSlug) => LifecycleStage;
27
24
  //# sourceMappingURL=stages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stages.d.ts","names":[],"sources":["../../src/types/stages.ts"],"mappings":";aAAY,cAAA;EACV,WAAA;EACA,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,aAAA;EACA,iBAAA;EACA,eAAA;AAAA;AAAA,KAGU,kBAAA;AAAA,UASK,sBAAA;EACf,EAAA,EAAI,cAAA;EACJ,KAAA;EACA,IAAA,EAAM,kBAAA;EACN,IAAA;EACA,QAAA;EACA,OAAA;EACA,KAAA;EACA,UAAA;AAAA;AAAA,cAGW,qBAAA,EAAuB,cAAA;AAAA,cAUvB,oBAAA,EAAsB,MAAA,CACjC,cAAA,EACA,sBAAA;AAAA,cAyFW,uBAAA,GACX,IAAA,EAAM,kBAAA,KACL,cAAA"}
1
+ {"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["../../src/types/stages.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,WAAW,IAAI;IACf,kBAAkB,IAAI;IACtB,gBAAgB,IAAI;IACpB,gBAAgB,IAAI;IACpB,aAAa,IAAI;IACjB,iBAAiB,IAAI;IACrB,eAAe,IAAI;CACpB;AAED,MAAM,MAAM,kBAAkB,GAC1B,aAAa,GACb,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,cAAc,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,EAAE,cAAc,EAQjD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,cAAc,EACd,sBAAsB,CAuFvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,MAAM,kBAAkB,KACvB,cAQF,CAAC"}
@@ -1,23 +1,19 @@
1
- import { LifecycleStage } from "../types/stages.js";
2
- import { LifecycleAxes } from "../types/axes.js";
3
- import { LifecycleScore } from "../types/signals.js";
4
- import { LifecycleAssessment, LifecycleRecommendation } from "../types/milestones.js";
5
-
6
- //#region src/utils/formatters.d.ts
7
- interface StageSummary {
8
- title: string;
9
- question: string;
10
- highlights: string[];
11
- traps: string[];
12
- focusAreas: string[];
13
- axesSummary: string[];
1
+ import type { LifecycleAssessment, LifecycleRecommendation } from '../types/milestones';
2
+ import type { LifecycleAxes } from '../types/axes';
3
+ import { LifecycleStage } from '../types/stages';
4
+ import type { LifecycleScore } from '../types/signals';
5
+ export interface StageSummary {
6
+ title: string;
7
+ question: string;
8
+ highlights: string[];
9
+ traps: string[];
10
+ focusAreas: string[];
11
+ axesSummary: string[];
14
12
  }
15
- declare const formatStageSummary: (stage: LifecycleStage, assessment?: Pick<LifecycleAssessment, "axes" | "gaps">) => StageSummary;
16
- declare const summarizeAxes: (axes: LifecycleAxes) => string[];
17
- declare const rankStageCandidates: (scores: LifecycleScore[]) => LifecycleScore[];
18
- declare const createRecommendationDigest: (recommendation: LifecycleRecommendation) => string;
19
- declare const getStageLabel: (stage: LifecycleStage) => string;
20
- declare const getStageOrderIndex: (stage: LifecycleStage) => number;
21
- //#endregion
22
- export { StageSummary, createRecommendationDigest, formatStageSummary, getStageLabel, getStageOrderIndex, rankStageCandidates, summarizeAxes };
13
+ export declare const formatStageSummary: (stage: LifecycleStage, assessment?: Pick<LifecycleAssessment, "axes" | "gaps">) => StageSummary;
14
+ export declare const summarizeAxes: (axes: LifecycleAxes) => string[];
15
+ export declare const rankStageCandidates: (scores: LifecycleScore[]) => LifecycleScore[];
16
+ export declare const createRecommendationDigest: (recommendation: LifecycleRecommendation) => string;
17
+ export declare const getStageLabel: (stage: LifecycleStage) => string;
18
+ export declare const getStageOrderIndex: (stage: LifecycleStage) => number;
23
19
  //# sourceMappingURL=formatters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.d.ts","names":[],"sources":["../../src/utils/formatters.ts"],"mappings":";;;;;;UAYiB,YAAA;EACf,KAAA;EACA,QAAA;EACA,UAAA;EACA,KAAA;EACA,UAAA;EACA,WAAA;AAAA;AAAA,cAGW,kBAAA,GACX,KAAA,EAAO,cAAA,EACP,UAAA,GAAa,IAAA,CAAK,mBAAA,uBACjB,YAAA;AAAA,cAeU,aAAA,GAAiB,IAAA,EAAM,aAAA;AAAA,cAMvB,mBAAA,GACX,MAAA,EAAQ,cAAA,OACP,cAAA;AAAA,cAQU,0BAAA,GACX,cAAA,EAAgB,uBAAA;AAAA,cAWL,aAAA,GAAiB,KAAA,EAAO,cAAA;AAAA,cAGxB,kBAAA,GAAsB,KAAA,EAAO,cAAA"}
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAGL,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,kBAAkB,GAC7B,OAAO,cAAc,EACrB,aAAa,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC,KACtD,YAaF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,aAAa,KAAG,MAAM,EAIzD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,cAAc,EAAE,KACvB,cAAc,EAMb,CAAC;AAEL,eAAO,MAAM,0BAA0B,GACrC,gBAAgB,uBAAuB,KACtC,MAQF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc,KAAG,MACpB,CAAC;AAEnC,eAAO,MAAM,kBAAkB,GAAI,OAAO,cAAc,KAAG,MACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.lifecycle",
3
- "version": "1.57.0",
3
+ "version": "1.58.0",
4
4
  "description": "Contract lifecycle management primitives",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -18,32 +18,37 @@
18
18
  "scripts": {
19
19
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
20
20
  "publish:pkg:canary": "bun publish:pkg --tag canary",
21
- "build": "bun build:types && bun build:bundle",
22
- "build:bundle": "tsdown",
23
- "build:types": "tsc --noEmit",
24
- "dev": "bun build:bundle --watch",
21
+ "build": "bun run prebuild && bun run build:bundle && bun run build:types",
22
+ "build:bundle": "contractspec-bun-build transpile",
23
+ "build:types": "contractspec-bun-build types",
24
+ "dev": "contractspec-bun-build dev",
25
25
  "clean": "rimraf dist .turbo",
26
26
  "lint": "bun lint:fix",
27
27
  "lint:fix": "eslint src --fix",
28
28
  "lint:check": "eslint src",
29
- "test": "bun test"
29
+ "test": "bun test",
30
+ "prebuild": "contractspec-bun-build prebuild",
31
+ "typecheck": "tsc --noEmit"
30
32
  },
31
33
  "peerDependencies": {},
32
34
  "devDependencies": {
33
- "@contractspec/tool.tsdown": "1.57.0",
34
- "@contractspec/tool.typescript": "1.57.0",
35
- "tsdown": "^0.20.3",
36
- "typescript": "^5.9.3"
35
+ "@contractspec/tool.typescript": "1.58.0",
36
+ "typescript": "^5.9.3",
37
+ "@contractspec/tool.bun": "1.57.0"
37
38
  },
38
39
  "exports": {
39
- ".": "./dist/index.js",
40
- "./*": "./*"
40
+ ".": "./src/index.ts"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",
44
44
  "exports": {
45
- ".": "./dist/index.js",
46
- "./*": "./*"
45
+ ".": {
46
+ "types": "./dist/index.d.ts",
47
+ "bun": "./dist/index.js",
48
+ "node": "./dist/node/index.mjs",
49
+ "browser": "./dist/browser/index.js",
50
+ "default": "./dist/index.js"
51
+ }
47
52
  },
48
53
  "registry": "https://registry.npmjs.org/"
49
54
  },
@@ -1,29 +0,0 @@
1
- //#region src/types/axes.ts
2
- let ProductPhase = /* @__PURE__ */ function(ProductPhase) {
3
- ProductPhase["Sketch"] = "Sketch";
4
- ProductPhase["Prototype"] = "Prototype";
5
- ProductPhase["Mvp"] = "MVP";
6
- ProductPhase["V1"] = "V1";
7
- ProductPhase["Ecosystem"] = "Ecosystem";
8
- return ProductPhase;
9
- }({});
10
- let CompanyPhase = /* @__PURE__ */ function(CompanyPhase) {
11
- CompanyPhase["Solo"] = "Solo";
12
- CompanyPhase["TinyTeam"] = "TinyTeam";
13
- CompanyPhase["FunctionalOrg"] = "FunctionalOrg";
14
- CompanyPhase["MultiTeam"] = "MultiTeam";
15
- CompanyPhase["Bureaucratic"] = "Bureaucratic";
16
- return CompanyPhase;
17
- }({});
18
- let CapitalPhase = /* @__PURE__ */ function(CapitalPhase) {
19
- CapitalPhase["Bootstrapped"] = "Bootstrapped";
20
- CapitalPhase["PreSeed"] = "PreSeed";
21
- CapitalPhase["Seed"] = "Seed";
22
- CapitalPhase["SeriesAorB"] = "SeriesAorB";
23
- CapitalPhase["LateStage"] = "LateStage";
24
- return CapitalPhase;
25
- }({});
26
-
27
- //#endregion
28
- export { CapitalPhase, CompanyPhase, ProductPhase };
29
- //# sourceMappingURL=axes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"axes.js","names":[],"sources":["../../src/types/axes.ts"],"sourcesContent":["export enum ProductPhase {\n Sketch = 'Sketch',\n Prototype = 'Prototype',\n Mvp = 'MVP',\n V1 = 'V1',\n Ecosystem = 'Ecosystem',\n}\n\nexport enum CompanyPhase {\n Solo = 'Solo',\n TinyTeam = 'TinyTeam',\n FunctionalOrg = 'FunctionalOrg',\n MultiTeam = 'MultiTeam',\n Bureaucratic = 'Bureaucratic',\n}\n\nexport enum CapitalPhase {\n Bootstrapped = 'Bootstrapped',\n PreSeed = 'PreSeed',\n Seed = 'Seed',\n SeriesAorB = 'SeriesAorB',\n LateStage = 'LateStage',\n}\n\nexport type LifecycleAxis = 'product' | 'company' | 'capital';\n\nexport interface LifecycleAxes {\n product: ProductPhase;\n company: CompanyPhase;\n capital: CapitalPhase;\n}\n\nexport interface LifecycleAxisSnapshot {\n axis: LifecycleAxis;\n phase: ProductPhase | CompanyPhase | CapitalPhase;\n rationale?: string;\n confidence: number; // 0-1\n}\n"],"mappings":";AAAA,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA;;;AAGF,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA;;;AAGF,IAAY,sDAAL;AACL;AACA;AACA;AACA;AACA"}
@@ -1 +0,0 @@
1
- import "./stages.js";
@@ -1 +0,0 @@
1
- import "./stages.js";
@@ -1,157 +0,0 @@
1
- //#region src/types/stages.ts
2
- let LifecycleStage = /* @__PURE__ */ function(LifecycleStage) {
3
- LifecycleStage[LifecycleStage["Exploration"] = 0] = "Exploration";
4
- LifecycleStage[LifecycleStage["ProblemSolutionFit"] = 1] = "ProblemSolutionFit";
5
- LifecycleStage[LifecycleStage["MvpEarlyTraction"] = 2] = "MvpEarlyTraction";
6
- LifecycleStage[LifecycleStage["ProductMarketFit"] = 3] = "ProductMarketFit";
7
- LifecycleStage[LifecycleStage["GrowthScaleUp"] = 4] = "GrowthScaleUp";
8
- LifecycleStage[LifecycleStage["ExpansionPlatform"] = 5] = "ExpansionPlatform";
9
- LifecycleStage[LifecycleStage["MaturityRenewal"] = 6] = "MaturityRenewal";
10
- return LifecycleStage;
11
- }({});
12
- const LIFECYCLE_STAGE_ORDER = [
13
- LifecycleStage.Exploration,
14
- LifecycleStage.ProblemSolutionFit,
15
- LifecycleStage.MvpEarlyTraction,
16
- LifecycleStage.ProductMarketFit,
17
- LifecycleStage.GrowthScaleUp,
18
- LifecycleStage.ExpansionPlatform,
19
- LifecycleStage.MaturityRenewal
20
- ];
21
- const LIFECYCLE_STAGE_META = {
22
- [LifecycleStage.Exploration]: {
23
- id: LifecycleStage.Exploration,
24
- order: 0,
25
- slug: "exploration",
26
- name: "Exploration / Ideation",
27
- question: "Is there a problem worth my time?",
28
- signals: [
29
- "20+ discovery interviews",
30
- "Clear problem statement",
31
- "Named ICP"
32
- ],
33
- traps: ["Branding before discovery", "Premature tooling decisions"],
34
- focusAreas: [
35
- "Customer discovery",
36
- "Problem definition",
37
- "Segment clarity"
38
- ]
39
- },
40
- [LifecycleStage.ProblemSolutionFit]: {
41
- id: LifecycleStage.ProblemSolutionFit,
42
- order: 1,
43
- slug: "problem-solution-fit",
44
- name: "Problem–Solution Fit",
45
- question: "Do people care enough about this solution?",
46
- signals: [
47
- "Prototype reuse",
48
- "Referral energy",
49
- "Pre-pay interest"
50
- ],
51
- traps: ["“Market is huge” without users", "Skipping qualitative loops"],
52
- focusAreas: [
53
- "Solution hypothesis",
54
- "Value messaging",
55
- "Feedback capture"
56
- ]
57
- },
58
- [LifecycleStage.MvpEarlyTraction]: {
59
- id: LifecycleStage.MvpEarlyTraction,
60
- order: 2,
61
- slug: "mvp-early-traction",
62
- name: "MVP & Early Traction",
63
- question: "Can we get real usage and learn fast?",
64
- signals: [
65
- "20–50 named active users",
66
- "Weekly releases",
67
- "Noisy feedback"
68
- ],
69
- traps: ["Overbuilt infra for 10 users", "Undefined retention metric"],
70
- focusAreas: [
71
- "Activation",
72
- "Cohort tracking",
73
- "Feedback rituals"
74
- ]
75
- },
76
- [LifecycleStage.ProductMarketFit]: {
77
- id: LifecycleStage.ProductMarketFit,
78
- order: 3,
79
- slug: "product-market-fit",
80
- name: "Product–Market Fit",
81
- question: "Is this pulling us forward?",
82
- signals: [
83
- "Retention without heroics",
84
- "Organic word-of-mouth",
85
- "Value stories"
86
- ],
87
- traps: ["Hero growth that does not scale", "Ignoring churn signals"],
88
- focusAreas: [
89
- "Retention",
90
- "Reliability",
91
- "ICP clarity"
92
- ]
93
- },
94
- [LifecycleStage.GrowthScaleUp]: {
95
- id: LifecycleStage.GrowthScaleUp,
96
- order: 4,
97
- slug: "growth-scale-up",
98
- name: "Growth / Scale-up",
99
- question: "Can we grow this repeatably?",
100
- signals: [
101
- "Predictable channels",
102
- "Specialized hires",
103
- "Unit economics on track"
104
- ],
105
- traps: ["Paid spend masking retention gaps", "Infra debt blocking launches"],
106
- focusAreas: [
107
- "Ops systems",
108
- "Growth loops",
109
- "Reliability engineering"
110
- ]
111
- },
112
- [LifecycleStage.ExpansionPlatform]: {
113
- id: LifecycleStage.ExpansionPlatform,
114
- order: 5,
115
- slug: "expansion-platform",
116
- name: "Expansion / Platform",
117
- question: "What is the next growth curve?",
118
- signals: [
119
- "Stable core metrics",
120
- "Partner/API demand",
121
- "Ecosystem pull"
122
- ],
123
- traps: ["Platform theater before wedge is solid"],
124
- focusAreas: [
125
- "Partnerships",
126
- "APIs",
127
- "New market validation"
128
- ]
129
- },
130
- [LifecycleStage.MaturityRenewal]: {
131
- id: LifecycleStage.MaturityRenewal,
132
- order: 6,
133
- slug: "maturity-renewal",
134
- name: "Maturity / Renewal",
135
- question: "Optimize, reinvent, or sunset?",
136
- signals: [
137
- "Margin focus",
138
- "Portfolio bets",
139
- "Narrative refresh"
140
- ],
141
- traps: ["Assuming past success is enough"],
142
- focusAreas: [
143
- "Cost optimization",
144
- "Reinvention bets",
145
- "Sunset planning"
146
- ]
147
- }
148
- };
149
- const getLifecycleStageBySlug = (slug) => {
150
- const entry = Object.values(LIFECYCLE_STAGE_META).find((meta) => meta.slug === slug);
151
- if (!entry) throw new Error(`Unknown lifecycle stage slug: ${slug}`);
152
- return entry.id;
153
- };
154
-
155
- //#endregion
156
- export { LIFECYCLE_STAGE_META, LIFECYCLE_STAGE_ORDER, LifecycleStage, getLifecycleStageBySlug };
157
- //# sourceMappingURL=stages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stages.js","names":[],"sources":["../../src/types/stages.ts"],"sourcesContent":["export enum LifecycleStage {\n Exploration = 0,\n ProblemSolutionFit = 1,\n MvpEarlyTraction = 2,\n ProductMarketFit = 3,\n GrowthScaleUp = 4,\n ExpansionPlatform = 5,\n MaturityRenewal = 6,\n}\n\nexport type LifecycleStageSlug =\n | 'exploration'\n | 'problem-solution-fit'\n | 'mvp-early-traction'\n | 'product-market-fit'\n | 'growth-scale-up'\n | 'expansion-platform'\n | 'maturity-renewal';\n\nexport interface LifecycleStageMetadata {\n id: LifecycleStage;\n order: number;\n slug: LifecycleStageSlug;\n name: string;\n question: string;\n signals: string[];\n traps: string[];\n focusAreas: string[];\n}\n\nexport const LIFECYCLE_STAGE_ORDER: LifecycleStage[] = [\n LifecycleStage.Exploration,\n LifecycleStage.ProblemSolutionFit,\n LifecycleStage.MvpEarlyTraction,\n LifecycleStage.ProductMarketFit,\n LifecycleStage.GrowthScaleUp,\n LifecycleStage.ExpansionPlatform,\n LifecycleStage.MaturityRenewal,\n];\n\nexport const LIFECYCLE_STAGE_META: Record<\n LifecycleStage,\n LifecycleStageMetadata\n> = {\n [LifecycleStage.Exploration]: {\n id: LifecycleStage.Exploration,\n order: 0,\n slug: 'exploration',\n name: 'Exploration / Ideation',\n question: 'Is there a problem worth my time?',\n signals: [\n '20+ discovery interviews',\n 'Clear problem statement',\n 'Named ICP',\n ],\n traps: ['Branding before discovery', 'Premature tooling decisions'],\n focusAreas: ['Customer discovery', 'Problem definition', 'Segment clarity'],\n },\n [LifecycleStage.ProblemSolutionFit]: {\n id: LifecycleStage.ProblemSolutionFit,\n order: 1,\n slug: 'problem-solution-fit',\n name: 'Problem–Solution Fit',\n question: 'Do people care enough about this solution?',\n signals: ['Prototype reuse', 'Referral energy', 'Pre-pay interest'],\n traps: ['“Market is huge” without users', 'Skipping qualitative loops'],\n focusAreas: ['Solution hypothesis', 'Value messaging', 'Feedback capture'],\n },\n [LifecycleStage.MvpEarlyTraction]: {\n id: LifecycleStage.MvpEarlyTraction,\n order: 2,\n slug: 'mvp-early-traction',\n name: 'MVP & Early Traction',\n question: 'Can we get real usage and learn fast?',\n signals: ['20–50 named active users', 'Weekly releases', 'Noisy feedback'],\n traps: ['Overbuilt infra for 10 users', 'Undefined retention metric'],\n focusAreas: ['Activation', 'Cohort tracking', 'Feedback rituals'],\n },\n [LifecycleStage.ProductMarketFit]: {\n id: LifecycleStage.ProductMarketFit,\n order: 3,\n slug: 'product-market-fit',\n name: 'Product–Market Fit',\n question: 'Is this pulling us forward?',\n signals: [\n 'Retention without heroics',\n 'Organic word-of-mouth',\n 'Value stories',\n ],\n traps: ['Hero growth that does not scale', 'Ignoring churn signals'],\n focusAreas: ['Retention', 'Reliability', 'ICP clarity'],\n },\n [LifecycleStage.GrowthScaleUp]: {\n id: LifecycleStage.GrowthScaleUp,\n order: 4,\n slug: 'growth-scale-up',\n name: 'Growth / Scale-up',\n question: 'Can we grow this repeatably?',\n signals: [\n 'Predictable channels',\n 'Specialized hires',\n 'Unit economics on track',\n ],\n traps: [\n 'Paid spend masking retention gaps',\n 'Infra debt blocking launches',\n ],\n focusAreas: ['Ops systems', 'Growth loops', 'Reliability engineering'],\n },\n [LifecycleStage.ExpansionPlatform]: {\n id: LifecycleStage.ExpansionPlatform,\n order: 5,\n slug: 'expansion-platform',\n name: 'Expansion / Platform',\n question: 'What is the next growth curve?',\n signals: ['Stable core metrics', 'Partner/API demand', 'Ecosystem pull'],\n traps: ['Platform theater before wedge is solid'],\n focusAreas: ['Partnerships', 'APIs', 'New market validation'],\n },\n [LifecycleStage.MaturityRenewal]: {\n id: LifecycleStage.MaturityRenewal,\n order: 6,\n slug: 'maturity-renewal',\n name: 'Maturity / Renewal',\n question: 'Optimize, reinvent, or sunset?',\n signals: ['Margin focus', 'Portfolio bets', 'Narrative refresh'],\n traps: ['Assuming past success is enough'],\n focusAreas: ['Cost optimization', 'Reinvention bets', 'Sunset planning'],\n },\n};\n\nexport const getLifecycleStageBySlug = (\n slug: LifecycleStageSlug\n): LifecycleStage => {\n const entry = Object.values(LIFECYCLE_STAGE_META).find(\n (meta) => meta.slug === slug\n );\n if (!entry) {\n throw new Error(`Unknown lifecycle stage slug: ${slug}`);\n }\n return entry.id;\n};\n"],"mappings":";AAAA,IAAY,0DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAuBF,MAAa,wBAA0C;CACrD,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CACf,eAAe;CAChB;AAED,MAAa,uBAGT;EACD,eAAe,cAAc;EAC5B,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GACP;GACA;GACA;GACD;EACD,OAAO,CAAC,6BAA6B,8BAA8B;EACnE,YAAY;GAAC;GAAsB;GAAsB;GAAkB;EAC5E;EACA,eAAe,qBAAqB;EACnC,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GAAC;GAAmB;GAAmB;GAAmB;EACnE,OAAO,CAAC,kCAAkC,6BAA6B;EACvE,YAAY;GAAC;GAAuB;GAAmB;GAAmB;EAC3E;EACA,eAAe,mBAAmB;EACjC,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GAAC;GAA4B;GAAmB;GAAiB;EAC1E,OAAO,CAAC,gCAAgC,6BAA6B;EACrE,YAAY;GAAC;GAAc;GAAmB;GAAmB;EAClE;EACA,eAAe,mBAAmB;EACjC,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GACP;GACA;GACA;GACD;EACD,OAAO,CAAC,mCAAmC,yBAAyB;EACpE,YAAY;GAAC;GAAa;GAAe;GAAc;EACxD;EACA,eAAe,gBAAgB;EAC9B,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GACP;GACA;GACA;GACD;EACD,OAAO,CACL,qCACA,+BACD;EACD,YAAY;GAAC;GAAe;GAAgB;GAA0B;EACvE;EACA,eAAe,oBAAoB;EAClC,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GAAC;GAAuB;GAAsB;GAAiB;EACxE,OAAO,CAAC,yCAAyC;EACjD,YAAY;GAAC;GAAgB;GAAQ;GAAwB;EAC9D;EACA,eAAe,kBAAkB;EAChC,IAAI,eAAe;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,UAAU;EACV,SAAS;GAAC;GAAgB;GAAkB;GAAoB;EAChE,OAAO,CAAC,kCAAkC;EAC1C,YAAY;GAAC;GAAqB;GAAoB;GAAkB;EACzE;CACF;AAED,MAAa,2BACX,SACmB;CACnB,MAAM,QAAQ,OAAO,OAAO,qBAAqB,CAAC,MAC/C,SAAS,KAAK,SAAS,KACzB;AACD,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,iCAAiC,OAAO;AAE1D,QAAO,MAAM"}
@@ -1,37 +0,0 @@
1
- import { LIFECYCLE_STAGE_META, LIFECYCLE_STAGE_ORDER } from "../types/stages.js";
2
-
3
- //#region src/utils/formatters.ts
4
- const formatStageSummary = (stage, assessment) => {
5
- const meta = LIFECYCLE_STAGE_META[stage];
6
- const title = `Stage ${meta.order} · ${meta.name}`;
7
- const axesSummary = assessment ? summarizeAxes(assessment.axes) : [];
8
- return {
9
- title,
10
- question: meta.question,
11
- highlights: meta.signals,
12
- traps: meta.traps,
13
- focusAreas: assessment?.gaps?.length ? assessment.gaps : meta.focusAreas,
14
- axesSummary
15
- };
16
- };
17
- const summarizeAxes = (axes) => [
18
- `Product: ${axes.product}`,
19
- `Company: ${axes.company}`,
20
- `Capital: ${axes.capital}`
21
- ];
22
- const rankStageCandidates = (scores) => [...scores].sort((a, b) => {
23
- if (b.score === a.score) return b.confidence - a.confidence;
24
- return b.score - a.score;
25
- });
26
- const createRecommendationDigest = (recommendation) => {
27
- const meta = LIFECYCLE_STAGE_META[recommendation.stage];
28
- const topAction = recommendation.actions[0];
29
- const actionCopy = topAction ? `${topAction.title} (${topAction.estimatedImpact} impact)` : "Focus on upcoming milestones.";
30
- return `Next up for ${meta.name}: ${actionCopy}`;
31
- };
32
- const getStageLabel = (stage) => LIFECYCLE_STAGE_META[stage].name;
33
- const getStageOrderIndex = (stage) => LIFECYCLE_STAGE_ORDER.indexOf(stage);
34
-
35
- //#endregion
36
- export { createRecommendationDigest, formatStageSummary, getStageLabel, getStageOrderIndex, rankStageCandidates, summarizeAxes };
37
- //# sourceMappingURL=formatters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.js","names":[],"sources":["../../src/utils/formatters.ts"],"sourcesContent":["import type {\n LifecycleAssessment,\n LifecycleRecommendation,\n} from '../types/milestones';\nimport type { LifecycleAxes } from '../types/axes';\nimport {\n LIFECYCLE_STAGE_META,\n LIFECYCLE_STAGE_ORDER,\n LifecycleStage,\n} from '../types/stages';\nimport type { LifecycleScore } from '../types/signals';\n\nexport interface StageSummary {\n title: string;\n question: string;\n highlights: string[];\n traps: string[];\n focusAreas: string[];\n axesSummary: string[];\n}\n\nexport const formatStageSummary = (\n stage: LifecycleStage,\n assessment?: Pick<LifecycleAssessment, 'axes' | 'gaps'>\n): StageSummary => {\n const meta = LIFECYCLE_STAGE_META[stage];\n const title = `Stage ${meta.order} · ${meta.name}`;\n const axesSummary = assessment ? summarizeAxes(assessment.axes) : [];\n\n return {\n title,\n question: meta.question,\n highlights: meta.signals,\n traps: meta.traps,\n focusAreas: assessment?.gaps?.length ? assessment.gaps : meta.focusAreas,\n axesSummary,\n };\n};\n\nexport const summarizeAxes = (axes: LifecycleAxes): string[] => [\n `Product: ${axes.product}`,\n `Company: ${axes.company}`,\n `Capital: ${axes.capital}`,\n];\n\nexport const rankStageCandidates = (\n scores: LifecycleScore[]\n): LifecycleScore[] =>\n [...scores].sort((a, b) => {\n if (b.score === a.score) {\n return b.confidence - a.confidence;\n }\n return b.score - a.score;\n });\n\nexport const createRecommendationDigest = (\n recommendation: LifecycleRecommendation\n): string => {\n const meta = LIFECYCLE_STAGE_META[recommendation.stage];\n const topAction = recommendation.actions[0];\n const actionCopy = topAction\n ? `${topAction.title} (${topAction.estimatedImpact} impact)`\n : 'Focus on upcoming milestones.';\n\n return `Next up for ${meta.name}: ${actionCopy}`;\n};\n\nexport const getStageLabel = (stage: LifecycleStage): string =>\n LIFECYCLE_STAGE_META[stage].name;\n\nexport const getStageOrderIndex = (stage: LifecycleStage): number =>\n LIFECYCLE_STAGE_ORDER.indexOf(stage);\n"],"mappings":";;;AAqBA,MAAa,sBACX,OACA,eACiB;CACjB,MAAM,OAAO,qBAAqB;CAClC,MAAM,QAAQ,SAAS,KAAK,MAAM,KAAK,KAAK;CAC5C,MAAM,cAAc,aAAa,cAAc,WAAW,KAAK,GAAG,EAAE;AAEpE,QAAO;EACL;EACA,UAAU,KAAK;EACf,YAAY,KAAK;EACjB,OAAO,KAAK;EACZ,YAAY,YAAY,MAAM,SAAS,WAAW,OAAO,KAAK;EAC9D;EACD;;AAGH,MAAa,iBAAiB,SAAkC;CAC9D,YAAY,KAAK;CACjB,YAAY,KAAK;CACjB,YAAY,KAAK;CAClB;AAED,MAAa,uBACX,WAEA,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM;AACzB,KAAI,EAAE,UAAU,EAAE,MAChB,QAAO,EAAE,aAAa,EAAE;AAE1B,QAAO,EAAE,QAAQ,EAAE;EACnB;AAEJ,MAAa,8BACX,mBACW;CACX,MAAM,OAAO,qBAAqB,eAAe;CACjD,MAAM,YAAY,eAAe,QAAQ;CACzC,MAAM,aAAa,YACf,GAAG,UAAU,MAAM,IAAI,UAAU,gBAAgB,YACjD;AAEJ,QAAO,eAAe,KAAK,KAAK,IAAI;;AAGtC,MAAa,iBAAiB,UAC5B,qBAAqB,OAAO;AAE9B,MAAa,sBAAsB,UACjC,sBAAsB,QAAQ,MAAM"}