@lssm/module.lifecycle-core 0.0.0-canary-20251217083314 → 0.0.0-canary-20251219202229
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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/__tests__/stage-scorer.test.d.ts +2 -0
- package/dist/__tests__/stage-scorer.test.d.ts.map +1 -0
- package/dist/adapters/analytics-adapter.d.ts +8 -11
- package/dist/adapters/analytics-adapter.d.ts.map +1 -0
- package/dist/adapters/intent-adapter.d.ts +6 -9
- package/dist/adapters/intent-adapter.d.ts.map +1 -0
- package/dist/adapters/questionnaire-adapter.d.ts +8 -11
- package/dist/adapters/questionnaire-adapter.d.ts.map +1 -0
- package/dist/collectors/signal-collector.d.ts +18 -21
- package/dist/collectors/signal-collector.d.ts.map +1 -0
- package/dist/index.d.ts +8 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -6
- package/dist/orchestrator/lifecycle-orchestrator.d.ts +17 -19
- package/dist/orchestrator/lifecycle-orchestrator.d.ts.map +1 -0
- package/dist/planning/milestone-planner.d.ts +6 -9
- package/dist/planning/milestone-planner.d.ts.map +1 -0
- package/dist/scoring/stage-scorer.d.ts +19 -19
- package/dist/scoring/stage-scorer.d.ts.map +1 -0
- package/package.json +10 -9
- package/dist/collectors/signal-collector.js +0 -65
- package/dist/data/milestones-catalog.js +0 -73
- package/dist/data/stage-weights.js +0 -169
- package/dist/libs/lifecycle/dist/index.js +0 -5
- package/dist/libs/lifecycle/dist/types/axes.js +0 -28
- package/dist/libs/lifecycle/dist/types/milestones.js +0 -1
- package/dist/libs/lifecycle/dist/types/signals.js +0 -1
- package/dist/libs/lifecycle/dist/types/stages.js +0 -151
- package/dist/libs/lifecycle/dist/utils/formatters.js +0 -1
- package/dist/orchestrator/lifecycle-orchestrator.js +0 -53
- package/dist/planning/milestone-planner.js +0 -16
- package/dist/scoring/stage-scorer.js +0 -64
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
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage-scorer.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/stage-scorer.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { LifecycleAxes, LifecycleMetricSnapshot, LifecycleSignal } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
signals?: LifecycleSignal[];
|
|
7
|
-
axes?: Partial<LifecycleAxes>;
|
|
1
|
+
import type { LifecycleAxes, LifecycleMetricSnapshot, LifecycleSignal } from '@lssm/lib.lifecycle';
|
|
2
|
+
export interface AnalyticsAdapterResult {
|
|
3
|
+
metrics?: LifecycleMetricSnapshot;
|
|
4
|
+
signals?: LifecycleSignal[];
|
|
5
|
+
axes?: Partial<LifecycleAxes>;
|
|
8
6
|
}
|
|
9
|
-
interface AnalyticsAdapter {
|
|
10
|
-
|
|
7
|
+
export interface AnalyticsAdapter {
|
|
8
|
+
fetch(): Promise<AnalyticsAdapterResult>;
|
|
11
9
|
}
|
|
12
|
-
//#
|
|
13
|
-
export { AnalyticsAdapter, AnalyticsAdapterResult };
|
|
10
|
+
//# sourceMappingURL=analytics-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/analytics-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAC1C"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { LifecycleSignal } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface IntentAdapterResult {
|
|
5
|
-
signals?: LifecycleSignal[];
|
|
1
|
+
import type { LifecycleSignal } from '@lssm/lib.lifecycle';
|
|
2
|
+
export interface IntentAdapterResult {
|
|
3
|
+
signals?: LifecycleSignal[];
|
|
6
4
|
}
|
|
7
|
-
interface IntentAdapter {
|
|
8
|
-
|
|
5
|
+
export interface IntentAdapter {
|
|
6
|
+
fetch(): Promise<IntentAdapterResult>;
|
|
9
7
|
}
|
|
10
|
-
//#
|
|
11
|
-
export { IntentAdapter, IntentAdapterResult };
|
|
8
|
+
//# sourceMappingURL=intent-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/intent-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACvC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { LifecycleAxes, LifecycleSignal } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
signals?: LifecycleSignal[];
|
|
7
|
-
answers?: Record<string, unknown>;
|
|
1
|
+
import type { LifecycleAxes, LifecycleSignal } from '@lssm/lib.lifecycle';
|
|
2
|
+
export interface QuestionnaireAdapterResult {
|
|
3
|
+
axes?: Partial<LifecycleAxes>;
|
|
4
|
+
signals?: LifecycleSignal[];
|
|
5
|
+
answers?: Record<string, unknown>;
|
|
8
6
|
}
|
|
9
|
-
interface QuestionnaireAdapter {
|
|
10
|
-
|
|
7
|
+
export interface QuestionnaireAdapter {
|
|
8
|
+
fetch(): Promise<QuestionnaireAdapterResult>;
|
|
11
9
|
}
|
|
12
|
-
//#
|
|
13
|
-
export { QuestionnaireAdapter, QuestionnaireAdapterResult };
|
|
10
|
+
//# sourceMappingURL=questionnaire-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"questionnaire-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/questionnaire-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE1E,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAAC;CAC9C"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
questionnaireAdapter?: QuestionnaireAdapter;
|
|
10
|
-
intentAdapter?: IntentAdapter;
|
|
1
|
+
import type { LifecycleAssessmentInput, LifecycleAxes, LifecycleMetricSnapshot, LifecycleSignal } from '@lssm/lib.lifecycle';
|
|
2
|
+
import type { AnalyticsAdapter } from '../adapters/analytics-adapter';
|
|
3
|
+
import type { QuestionnaireAdapter } from '../adapters/questionnaire-adapter';
|
|
4
|
+
import type { IntentAdapter } from '../adapters/intent-adapter';
|
|
5
|
+
export interface StageSignalCollectorOptions {
|
|
6
|
+
analyticsAdapter?: AnalyticsAdapter;
|
|
7
|
+
questionnaireAdapter?: QuestionnaireAdapter;
|
|
8
|
+
intentAdapter?: IntentAdapter;
|
|
11
9
|
}
|
|
12
|
-
interface StageSignalCollectorResult {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export interface StageSignalCollectorResult {
|
|
11
|
+
axes: LifecycleAxes;
|
|
12
|
+
metrics: LifecycleMetricSnapshot;
|
|
13
|
+
signals: LifecycleSignal[];
|
|
14
|
+
questionnaireAnswers?: Record<string, unknown>;
|
|
17
15
|
}
|
|
18
|
-
declare class StageSignalCollector {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export declare class StageSignalCollector {
|
|
17
|
+
private readonly options;
|
|
18
|
+
constructor(options: StageSignalCollectorOptions);
|
|
19
|
+
collect(input?: LifecycleAssessmentInput): Promise<StageSignalCollectorResult>;
|
|
22
20
|
}
|
|
23
|
-
//#
|
|
24
|
-
export { StageSignalCollector, StageSignalCollectorOptions, StageSignalCollectorResult };
|
|
21
|
+
//# sourceMappingURL=signal-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal-collector.d.ts","sourceRoot":"","sources":["../../src/collectors/signal-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQhE,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChD;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;gBAE1C,OAAO,EAAE,2BAA2B;IAI1C,OAAO,CACX,KAAK,GAAE,wBAA6B,GACnC,OAAO,CAAC,0BAA0B,CAAC;CA6CvC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export * from './collectors/signal-collector';
|
|
2
|
+
export * from './adapters/analytics-adapter';
|
|
3
|
+
export * from './adapters/questionnaire-adapter';
|
|
4
|
+
export * from './adapters/intent-adapter';
|
|
5
|
+
export * from './scoring/stage-scorer';
|
|
6
|
+
export * from './orchestrator/lifecycle-orchestrator';
|
|
7
|
+
export * from './planning/milestone-planner';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { StageScorer } from "./scoring/stage-scorer.js";
|
|
3
|
-
import { LifecycleMilestonePlanner } from "./planning/milestone-planner.js";
|
|
4
|
-
import { LifecycleOrchestrator } from "./orchestrator/lifecycle-orchestrator.js";
|
|
5
|
-
|
|
6
|
-
export { LifecycleMilestonePlanner, LifecycleOrchestrator, StageScorer, StageSignalCollector };
|
|
1
|
+
var r=function(e){return e[e.Exploration=0]="Exploration",e[e.ProblemSolutionFit=1]="ProblemSolutionFit",e[e.MvpEarlyTraction=2]="MvpEarlyTraction",e[e.ProductMarketFit=3]="ProductMarketFit",e[e.GrowthScaleUp=4]="GrowthScaleUp",e[e.ExpansionPlatform=5]="ExpansionPlatform",e[e.MaturityRenewal=6]="MaturityRenewal",e}({}),g=[r.Exploration,r.ProblemSolutionFit,r.MvpEarlyTraction,r.ProductMarketFit,r.GrowthScaleUp,r.ExpansionPlatform,r.MaturityRenewal],p={[r.Exploration]:{id:r.Exploration,order:0,slug:"exploration",name:"Exploration / Ideation",question:"Is there a problem worth my time?",signals:["20+ discovery interviews","Clear problem statement","Named ICP"],traps:["Branding before discovery","Premature tooling decisions"],focusAreas:["Customer discovery","Problem definition","Segment clarity"]},[r.ProblemSolutionFit]:{id:r.ProblemSolutionFit,order:1,slug:"problem-solution-fit",name:"Problem–Solution Fit",question:"Do people care enough about this solution?",signals:["Prototype reuse","Referral energy","Pre-pay interest"],traps:["“Market is huge” without users","Skipping qualitative loops"],focusAreas:["Solution hypothesis","Value messaging","Feedback capture"]},[r.MvpEarlyTraction]:{id:r.MvpEarlyTraction,order:2,slug:"mvp-early-traction",name:"MVP & Early Traction",question:"Can we get real usage and learn fast?",signals:["20–50 named active users","Weekly releases","Noisy feedback"],traps:["Overbuilt infra for 10 users","Undefined retention metric"],focusAreas:["Activation","Cohort tracking","Feedback rituals"]},[r.ProductMarketFit]:{id:r.ProductMarketFit,order:3,slug:"product-market-fit",name:"Product–Market Fit",question:"Is this pulling us forward?",signals:["Retention without heroics","Organic word-of-mouth","Value stories"],traps:["Hero growth that does not scale","Ignoring churn signals"],focusAreas:["Retention","Reliability","ICP clarity"]},[r.GrowthScaleUp]:{id:r.GrowthScaleUp,order:4,slug:"growth-scale-up",name:"Growth / Scale-up",question:"Can we grow this repeatably?",signals:["Predictable channels","Specialized hires","Unit economics on track"],traps:["Paid spend masking retention gaps","Infra debt blocking launches"],focusAreas:["Ops systems","Growth loops","Reliability engineering"]},[r.ExpansionPlatform]:{id:r.ExpansionPlatform,order:5,slug:"expansion-platform",name:"Expansion / Platform",question:"What is the next growth curve?",signals:["Stable core metrics","Partner/API demand","Ecosystem pull"],traps:["Platform theater before wedge is solid"],focusAreas:["Partnerships","APIs","New market validation"]},[r.MaturityRenewal]:{id:r.MaturityRenewal,order:6,slug:"maturity-renewal",name:"Maturity / Renewal",question:"Optimize, reinvent, or sunset?",signals:["Margin focus","Portfolio bets","Narrative refresh"],traps:["Assuming past success is enough"],focusAreas:["Cost optimization","Reinvention bets","Sunset planning"]}};var u=function(e){return e.Sketch="Sketch",e.Prototype="Prototype",e.Mvp="MVP",e.V1="V1",e.Ecosystem="Ecosystem",e}({}),f=function(e){return e.Solo="Solo",e.TinyTeam="TinyTeam",e.FunctionalOrg="FunctionalOrg",e.MultiTeam="MultiTeam",e.Bureaucratic="Bureaucratic",e}({}),w=function(e){return e.Bootstrapped="Bootstrapped",e.PreSeed="PreSeed",e.Seed="Seed",e.SeriesAorB="SeriesAorB",e.LateStage="LateStage",e}({});var M={product:u.Sketch,company:f.Solo,capital:w.Bootstrapped};class v{options;constructor(e){this.options=e}async collect(e={}){let t={...M,...e.axes??{}},i=[],n=[...e.signals??[]],s={...e.questionnaireAnswers??{}};if(e.metrics)i.push(e.metrics);if(this.options.analyticsAdapter){let o=await this.options.analyticsAdapter.fetch();if(o.axes)Object.assign(t,o.axes);if(o.metrics)i.push(o.metrics);if(o.signals)n.push(...o.signals)}if(this.options.questionnaireAdapter){let o=await this.options.questionnaireAdapter.fetch();if(o.axes)Object.assign(t,o.axes);if(o.signals)n.push(...o.signals);Object.assign(s,o.answers)}if(this.options.intentAdapter){let o=await this.options.intentAdapter.fetch();if(o.signals)n.push(...o.signals)}let l=I(i);return{axes:t,metrics:l,signals:q(n),questionnaireAnswers:Object.keys(s).length?s:void 0}}}var I=(e)=>e.reduce((t,i)=>{return Object.entries(i??{}).forEach(([n,s])=>{if(s!==void 0&&s!==null)t[n]=s}),t},{}),q=(e)=>{let t=new Set;return e.filter((i)=>{if(!i.id)return!0;if(t.has(i.id))return!1;return t.add(i.id),!0})};var y={Exploration:{base:0.35,metrics:{activeUsers:{weight:-0.3,direction:"lte",threshold:5},customerCount:{weight:-0.2,direction:"lte",threshold:3},teamSize:{weight:-0.1,direction:"lte",threshold:3}},signalKinds:{qualitative:0.4,metric:0.1}},ProblemSolutionFit:{base:0.4,metrics:{activeUsers:{weight:0.2,direction:"gte",threshold:5},customerCount:{weight:0.2,direction:"gte",threshold:3}},signalKinds:{qualitative:0.3,event:0.1}},MvpEarlyTraction:{base:0.45,metrics:{activeUsers:{weight:0.25,direction:"gte",threshold:25},weeklyActiveUsers:{weight:0.25,direction:"gte",threshold:20},retentionRate:{weight:0.2,direction:"gte",threshold:0.25}},signalKinds:{metric:0.15,event:0.1}},ProductMarketFit:{base:0.5,metrics:{retentionRate:{weight:0.35,direction:"gte",threshold:0.45},monthlyRecurringRevenue:{weight:0.25,direction:"gte",threshold:1e4},customerCount:{weight:0.2,direction:"gte",threshold:30}},signalKinds:{metric:0.15,event:0.1}},GrowthScaleUp:{base:0.55,metrics:{retentionRate:{weight:0.2,direction:"gte",threshold:0.55},monthlyRecurringRevenue:{weight:0.3,direction:"gte",threshold:50000},teamSize:{weight:0.15,direction:"gte",threshold:15}},signalKinds:{event:0.2,metric:0.15}},ExpansionPlatform:{base:0.6,metrics:{monthlyRecurringRevenue:{weight:0.35,direction:"gte",threshold:150000},customerCount:{weight:0.2,direction:"gte",threshold:100},teamSize:{weight:0.15,direction:"gte",threshold:40}},signalKinds:{event:0.2,milestone:0.1}},MaturityRenewal:{base:0.6,metrics:{monthlyRecurringRevenue:{weight:0.25,direction:"gte",threshold:250000},teamSize:{weight:0.15,direction:"gte",threshold:80},burnMultiple:{weight:0.2,direction:"lte",threshold:1.5}},signalKinds:{event:0.2,milestone:0.15}}};var k=y;class S{weights;constructor(e=k){this.weights=e}score(e){let t=D(e.signals);return Object.values(r).filter(Q).map((n)=>{let s=r[n],l=this.weights[s]??{base:0.5},o=l.base??0.5,h=0,x=Object.keys(l.metrics??{}).length+Object.keys(l.signalKinds??{}).length||1,m=[];if(l.metrics)Object.entries(l.metrics).forEach(([d,c])=>{let a=e.metrics[d];if(a===void 0||a===null)return;if(z(a,c))o+=c.weight,h+=1,m.push(`metric:${d}`);else o+=c.weight*0.25});if(l.signalKinds)Object.entries(l.signalKinds).forEach(([d,c])=>{if((t[d]??0)>0&&typeof c==="number")o+=c,h+=1,m.push(`signal:${d}`)});o=A(o,0,1.25);let R=A(h/x,0.1,1);return{stage:n,score:o,confidence:R,supportingSignals:m}}).sort((n,s)=>{if(s.score===n.score)return s.confidence-n.confidence;return s.score-n.score})}}var z=(e,t)=>{if((t.direction??"gte")==="gte")return e>=t.threshold;return e<=t.threshold},A=(e,t,i)=>Math.min(Math.max(e,t),i),D=(e)=>e.reduce((t,i)=>{let n=i.kind??"unknown";return t[n]=(t[n]??0)+(i.weight??1),t},{}),Q=(e)=>typeof e==="number"&&(e in p);class U{collector;scorer;planner;constructor(e){this.collector=e.collector,this.scorer=e.scorer,this.planner=e.milestonePlanner}async run(e){let t=await this.collector.collect(e),i=this.scorer.score({metrics:t.metrics,signals:t.signals}),n=i[0]??j(),s=p[n.stage];return{stage:n.stage,confidence:n.confidence,axes:t.axes,signals:t.signals,metrics:K(t.metrics),gaps:s.focusAreas.slice(0,3),focusAreas:s.focusAreas,scorecard:i,generatedAt:new Date().toISOString()}}getUpcomingMilestones(e,t=[],i=5){if(!this.planner)return[];return this.planner.getUpcoming(e,t,i)}}var j=()=>({stage:r.Exploration,score:0.3,confidence:0.3,supportingSignals:[]}),K=(e)=>Object.entries(e??{}).reduce((t,[i,n])=>{if(typeof n==="number")t[i]=n;return t},{});var b=[{id:"stage0-problem-statement",stage:0,category:"product",title:"Write the pain statement",description:"Capture the clearest description of the top problem in the customer’s own words.",priority:1,actionItems:["Interview at least 5 ideal customers","Synthesize quotes into a one-page brief"]},{id:"stage1-prototype-loop",stage:1,category:"product",title:"Prototype feedback loop",description:"Ship a clickable prototype and gather 3 rounds of feedback.",priority:2,actionItems:["Create a low-fidelity prototype","Schedule standing feedback calls"]},{id:"stage2-activation",stage:2,category:"operations",title:"Activation checklist",description:"Define the minimum steps required for a new user to succeed.",priority:1,actionItems:["Document onboarding flow","Instrument activation analytics"]},{id:"stage3-retention-narrative",stage:3,category:"product",title:"Retention narrative",description:"Create the before/after story that proves why users stay.",priority:2,actionItems:["Interview 3 retained users","Publish a one-pager with concrete metrics"]},{id:"stage4-growth-loop",stage:4,category:"growth",title:"Install a growth loop",description:"Stand up a repeatable acquisition → activation → referral motion.",priority:1,actionItems:["Define loop metrics","Assign owners for each stage","Review weekly"]},{id:"stage5-platform-blueprint",stage:5,category:"product",title:"Platform blueprint",description:"Align on APIs, integrations, and governance for partners.",priority:2,actionItems:["Create integration scoring rubric","Publish partner onboarding checklist"]},{id:"stage6-renewal-ops",stage:6,category:"operations",title:"Renewal operating rhythm",description:"Decide whether to optimize, reinvest, or sunset each major surface.",priority:1,actionItems:["Hold quarterly renewal review","Document reinvestment bets"]}];class X{milestones;constructor(e){this.milestones=e??b}getUpcoming(e,t=[],i=5){let n=new Set(t);return this.milestones.filter((s)=>s.stage===e&&!n.has(s.id)).sort((s,l)=>s.priority-l.priority).slice(0,i)}}export{v as StageSignalCollector,S as StageScorer,U as LifecycleOrchestrator,X as LifecycleMilestonePlanner};
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
milestonePlanner?: LifecycleMilestonePlanner;
|
|
1
|
+
import type { LifecycleAssessment, LifecycleAssessmentInput, LifecycleMilestone } from '@lssm/lib.lifecycle';
|
|
2
|
+
import { LifecycleStage } from '@lssm/lib.lifecycle';
|
|
3
|
+
import { StageSignalCollector } from '../collectors/signal-collector';
|
|
4
|
+
import { StageScorer } from '../scoring/stage-scorer';
|
|
5
|
+
import { LifecycleMilestonePlanner } from '../planning/milestone-planner';
|
|
6
|
+
export interface LifecycleOrchestratorOptions {
|
|
7
|
+
collector: StageSignalCollector;
|
|
8
|
+
scorer: StageScorer;
|
|
9
|
+
milestonePlanner?: LifecycleMilestonePlanner;
|
|
11
10
|
}
|
|
12
|
-
declare class LifecycleOrchestrator {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
export declare class LifecycleOrchestrator {
|
|
12
|
+
private readonly collector;
|
|
13
|
+
private readonly scorer;
|
|
14
|
+
private readonly planner?;
|
|
15
|
+
constructor(options: LifecycleOrchestratorOptions);
|
|
16
|
+
run(input?: LifecycleAssessmentInput): Promise<LifecycleAssessment>;
|
|
17
|
+
getUpcomingMilestones(stage: LifecycleStage, completedMilestoneIds?: string[], limit?: number): LifecycleMilestone[];
|
|
19
18
|
}
|
|
20
|
-
//#
|
|
21
|
-
export { LifecycleOrchestrator, LifecycleOrchestratorOptions };
|
|
19
|
+
//# sourceMappingURL=lifecycle-orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-orchestrator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/lifecycle-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAwB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,oBAAoB,CAAC;IAChC,MAAM,EAAE,WAAW,CAAC;IACpB,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;CAC9C;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAA4B;gBAEzC,OAAO,EAAE,4BAA4B;IAM3C,GAAG,CAAC,KAAK,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAsBzE,qBAAqB,CACnB,KAAK,EAAE,cAAc,EACrB,qBAAqB,GAAE,MAAM,EAAO,EACpC,KAAK,SAAI,GACR,kBAAkB,EAAE;CAIxB"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { LifecycleMilestone, LifecycleStage } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(customCatalog?: LifecycleMilestone[]);
|
|
7
|
-
getUpcoming(stage: LifecycleStage, completedIds?: string[], limit?: number): LifecycleMilestone[];
|
|
1
|
+
import type { LifecycleMilestone, LifecycleStage } from '@lssm/lib.lifecycle';
|
|
2
|
+
export declare class LifecycleMilestonePlanner {
|
|
3
|
+
private readonly milestones;
|
|
4
|
+
constructor(customCatalog?: LifecycleMilestone[]);
|
|
5
|
+
getUpcoming(stage: LifecycleStage, completedIds?: string[], limit?: number): LifecycleMilestone[];
|
|
8
6
|
}
|
|
9
|
-
//#
|
|
10
|
-
export { LifecycleMilestonePlanner };
|
|
7
|
+
//# sourceMappingURL=milestone-planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milestone-planner.d.ts","sourceRoot":"","sources":["../../src/planning/milestone-planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG9E,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;gBAEtC,aAAa,CAAC,EAAE,kBAAkB,EAAE;IAIhD,WAAW,CACT,KAAK,EAAE,cAAc,EACrB,YAAY,GAAE,MAAM,EAAO,EAC3B,KAAK,SAAI,GACR,kBAAkB,EAAE;CAUxB"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { LifecycleMetricSnapshot, LifecycleScore, LifecycleSignal } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { LifecycleMetricSnapshot, LifecycleScore, LifecycleSignal } from '@lssm/lib.lifecycle';
|
|
2
|
+
type NumericMetricKey = Extract<{
|
|
3
|
+
[Key in keyof LifecycleMetricSnapshot]: LifecycleMetricSnapshot[Key] extends number | undefined ? Key : never;
|
|
4
|
+
}[keyof LifecycleMetricSnapshot], string>;
|
|
5
5
|
interface MetricWeightConfig {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
weight: number;
|
|
7
|
+
threshold: number;
|
|
8
|
+
direction?: 'gte' | 'lte';
|
|
9
9
|
}
|
|
10
10
|
interface StageWeightConfig {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
base: number;
|
|
12
|
+
metrics?: Partial<Record<NumericMetricKey, MetricWeightConfig>>;
|
|
13
|
+
signalKinds?: Partial<Record<string, number>>;
|
|
14
14
|
}
|
|
15
15
|
type StageWeights = Record<string, StageWeightConfig>;
|
|
16
|
-
interface StageScoreInput {
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export interface StageScoreInput {
|
|
17
|
+
metrics: LifecycleMetricSnapshot;
|
|
18
|
+
signals: LifecycleSignal[];
|
|
19
19
|
}
|
|
20
|
-
declare class StageScorer {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export declare class StageScorer {
|
|
21
|
+
private readonly weights;
|
|
22
|
+
constructor(weights?: StageWeights);
|
|
23
|
+
score(input: StageScoreInput): LifecycleScore[];
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=stage-scorer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage-scorer.d.ts","sourceRoot":"","sources":["../../src/scoring/stage-scorer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,cAAc,EACd,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAI7B,KAAK,gBAAgB,GAAG,OAAO,CAC7B;KACG,GAAG,IAAI,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,GAAG,CAAC,SAChE,MAAM,GACN,SAAS,GACT,GAAG,GACH,KAAK;CACV,CAAC,MAAM,uBAAuB,CAAC,EAChC,MAAM,CACP,CAAC;AAEF,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAC3B;AAED,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/C;AAED,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAItD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,uBAAuB,CAAC;IACjC,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE3B,OAAO,GAAE,YAA8B;IAInD,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,EAAE;CA4DhD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/module.lifecycle-core",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251219202229",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
15
15
|
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
16
|
-
"build": "bun build:
|
|
17
|
-
"build:bundle": "
|
|
18
|
-
"build:types": "tsc --
|
|
16
|
+
"build": "bun build:types && bun build:bundle",
|
|
17
|
+
"build:bundle": "bun build ./src/index.ts --outfile ./dist/index.js --minify",
|
|
18
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
19
19
|
"dev": "bun build:bundle --watch",
|
|
20
20
|
"clean": "rimraf dist .turbo",
|
|
21
21
|
"lint": "bun lint:fix",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"test": "bun run"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lssm/lib.lifecycle": "0.0.0-canary-
|
|
27
|
+
"@lssm/lib.lifecycle": "0.0.0-canary-20251219202229"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
31
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
32
|
-
"tsdown": "^0.
|
|
30
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251219202229",
|
|
31
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251219202229",
|
|
32
|
+
"tsdown": "^0.18.1",
|
|
33
33
|
"typescript": "^5.9.3"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
@@ -42,5 +42,6 @@
|
|
|
42
42
|
".": "./dist/index.js",
|
|
43
43
|
"./*": "./*"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
|
+
"license": "MIT"
|
|
46
47
|
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { CapitalPhase, CompanyPhase, ProductPhase } from "../libs/lifecycle/dist/types/axes.js";
|
|
2
|
-
import "../libs/lifecycle/dist/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/collectors/signal-collector.ts
|
|
5
|
-
const DEFAULT_AXES = {
|
|
6
|
-
product: ProductPhase.Sketch,
|
|
7
|
-
company: CompanyPhase.Solo,
|
|
8
|
-
capital: CapitalPhase.Bootstrapped
|
|
9
|
-
};
|
|
10
|
-
var StageSignalCollector = class {
|
|
11
|
-
options;
|
|
12
|
-
constructor(options) {
|
|
13
|
-
this.options = options;
|
|
14
|
-
}
|
|
15
|
-
async collect(input = {}) {
|
|
16
|
-
const axes = {
|
|
17
|
-
...DEFAULT_AXES,
|
|
18
|
-
...input.axes ?? {}
|
|
19
|
-
};
|
|
20
|
-
const metricsSnapshots = [];
|
|
21
|
-
const aggregatedSignals = [...input.signals ?? []];
|
|
22
|
-
const questionnaireAnswers = { ...input.questionnaireAnswers ?? {} };
|
|
23
|
-
if (input.metrics) metricsSnapshots.push(input.metrics);
|
|
24
|
-
if (this.options.analyticsAdapter) {
|
|
25
|
-
const result = await this.options.analyticsAdapter.fetch();
|
|
26
|
-
if (result.axes) Object.assign(axes, result.axes);
|
|
27
|
-
if (result.metrics) metricsSnapshots.push(result.metrics);
|
|
28
|
-
if (result.signals) aggregatedSignals.push(...result.signals);
|
|
29
|
-
}
|
|
30
|
-
if (this.options.questionnaireAdapter) {
|
|
31
|
-
const result = await this.options.questionnaireAdapter.fetch();
|
|
32
|
-
if (result.axes) Object.assign(axes, result.axes);
|
|
33
|
-
if (result.signals) aggregatedSignals.push(...result.signals);
|
|
34
|
-
Object.assign(questionnaireAnswers, result.answers);
|
|
35
|
-
}
|
|
36
|
-
if (this.options.intentAdapter) {
|
|
37
|
-
const result = await this.options.intentAdapter.fetch();
|
|
38
|
-
if (result.signals) aggregatedSignals.push(...result.signals);
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
axes,
|
|
42
|
-
metrics: mergeMetricSnapshots(metricsSnapshots),
|
|
43
|
-
signals: dedupeSignals(aggregatedSignals),
|
|
44
|
-
questionnaireAnswers: Object.keys(questionnaireAnswers).length ? questionnaireAnswers : void 0
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const mergeMetricSnapshots = (snapshots) => snapshots.reduce((acc, snapshot) => {
|
|
49
|
-
Object.entries(snapshot ?? {}).forEach(([key, value]) => {
|
|
50
|
-
if (value !== void 0 && value !== null) acc[key] = value;
|
|
51
|
-
});
|
|
52
|
-
return acc;
|
|
53
|
-
}, {});
|
|
54
|
-
const dedupeSignals = (signals) => {
|
|
55
|
-
const seen = /* @__PURE__ */ new Set();
|
|
56
|
-
return signals.filter((signal) => {
|
|
57
|
-
if (!signal.id) return true;
|
|
58
|
-
if (seen.has(signal.id)) return false;
|
|
59
|
-
seen.add(signal.id);
|
|
60
|
-
return true;
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
//#endregion
|
|
65
|
-
export { StageSignalCollector };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
//#region src/data/milestones-catalog.json
|
|
2
|
-
var milestones_catalog_default = [
|
|
3
|
-
{
|
|
4
|
-
"id": "stage0-problem-statement",
|
|
5
|
-
"stage": 0,
|
|
6
|
-
"category": "product",
|
|
7
|
-
"title": "Write the pain statement",
|
|
8
|
-
"description": "Capture the clearest description of the top problem in the customer’s own words.",
|
|
9
|
-
"priority": 1,
|
|
10
|
-
"actionItems": ["Interview at least 5 ideal customers", "Synthesize quotes into a one-page brief"]
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "stage1-prototype-loop",
|
|
14
|
-
"stage": 1,
|
|
15
|
-
"category": "product",
|
|
16
|
-
"title": "Prototype feedback loop",
|
|
17
|
-
"description": "Ship a clickable prototype and gather 3 rounds of feedback.",
|
|
18
|
-
"priority": 2,
|
|
19
|
-
"actionItems": ["Create a low-fidelity prototype", "Schedule standing feedback calls"]
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "stage2-activation",
|
|
23
|
-
"stage": 2,
|
|
24
|
-
"category": "operations",
|
|
25
|
-
"title": "Activation checklist",
|
|
26
|
-
"description": "Define the minimum steps required for a new user to succeed.",
|
|
27
|
-
"priority": 1,
|
|
28
|
-
"actionItems": ["Document onboarding flow", "Instrument activation analytics"]
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": "stage3-retention-narrative",
|
|
32
|
-
"stage": 3,
|
|
33
|
-
"category": "product",
|
|
34
|
-
"title": "Retention narrative",
|
|
35
|
-
"description": "Create the before/after story that proves why users stay.",
|
|
36
|
-
"priority": 2,
|
|
37
|
-
"actionItems": ["Interview 3 retained users", "Publish a one-pager with concrete metrics"]
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "stage4-growth-loop",
|
|
41
|
-
"stage": 4,
|
|
42
|
-
"category": "growth",
|
|
43
|
-
"title": "Install a growth loop",
|
|
44
|
-
"description": "Stand up a repeatable acquisition → activation → referral motion.",
|
|
45
|
-
"priority": 1,
|
|
46
|
-
"actionItems": [
|
|
47
|
-
"Define loop metrics",
|
|
48
|
-
"Assign owners for each stage",
|
|
49
|
-
"Review weekly"
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"id": "stage5-platform-blueprint",
|
|
54
|
-
"stage": 5,
|
|
55
|
-
"category": "product",
|
|
56
|
-
"title": "Platform blueprint",
|
|
57
|
-
"description": "Align on APIs, integrations, and governance for partners.",
|
|
58
|
-
"priority": 2,
|
|
59
|
-
"actionItems": ["Create integration scoring rubric", "Publish partner onboarding checklist"]
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"id": "stage6-renewal-ops",
|
|
63
|
-
"stage": 6,
|
|
64
|
-
"category": "operations",
|
|
65
|
-
"title": "Renewal operating rhythm",
|
|
66
|
-
"description": "Decide whether to optimize, reinvest, or sunset each major surface.",
|
|
67
|
-
"priority": 1,
|
|
68
|
-
"actionItems": ["Hold quarterly renewal review", "Document reinvestment bets"]
|
|
69
|
-
}
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
export { milestones_catalog_default as default };
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
//#region src/data/stage-weights.json
|
|
2
|
-
var stage_weights_default = {
|
|
3
|
-
Exploration: {
|
|
4
|
-
"base": .35,
|
|
5
|
-
"metrics": {
|
|
6
|
-
"activeUsers": {
|
|
7
|
-
"weight": -.3,
|
|
8
|
-
"direction": "lte",
|
|
9
|
-
"threshold": 5
|
|
10
|
-
},
|
|
11
|
-
"customerCount": {
|
|
12
|
-
"weight": -.2,
|
|
13
|
-
"direction": "lte",
|
|
14
|
-
"threshold": 3
|
|
15
|
-
},
|
|
16
|
-
"teamSize": {
|
|
17
|
-
"weight": -.1,
|
|
18
|
-
"direction": "lte",
|
|
19
|
-
"threshold": 3
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"signalKinds": {
|
|
23
|
-
"qualitative": .4,
|
|
24
|
-
"metric": .1
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
ProblemSolutionFit: {
|
|
28
|
-
"base": .4,
|
|
29
|
-
"metrics": {
|
|
30
|
-
"activeUsers": {
|
|
31
|
-
"weight": .2,
|
|
32
|
-
"direction": "gte",
|
|
33
|
-
"threshold": 5
|
|
34
|
-
},
|
|
35
|
-
"customerCount": {
|
|
36
|
-
"weight": .2,
|
|
37
|
-
"direction": "gte",
|
|
38
|
-
"threshold": 3
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"signalKinds": {
|
|
42
|
-
"qualitative": .3,
|
|
43
|
-
"event": .1
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
MvpEarlyTraction: {
|
|
47
|
-
"base": .45,
|
|
48
|
-
"metrics": {
|
|
49
|
-
"activeUsers": {
|
|
50
|
-
"weight": .25,
|
|
51
|
-
"direction": "gte",
|
|
52
|
-
"threshold": 25
|
|
53
|
-
},
|
|
54
|
-
"weeklyActiveUsers": {
|
|
55
|
-
"weight": .25,
|
|
56
|
-
"direction": "gte",
|
|
57
|
-
"threshold": 20
|
|
58
|
-
},
|
|
59
|
-
"retentionRate": {
|
|
60
|
-
"weight": .2,
|
|
61
|
-
"direction": "gte",
|
|
62
|
-
"threshold": .25
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"signalKinds": {
|
|
66
|
-
"metric": .15,
|
|
67
|
-
"event": .1
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
ProductMarketFit: {
|
|
71
|
-
"base": .5,
|
|
72
|
-
"metrics": {
|
|
73
|
-
"retentionRate": {
|
|
74
|
-
"weight": .35,
|
|
75
|
-
"direction": "gte",
|
|
76
|
-
"threshold": .45
|
|
77
|
-
},
|
|
78
|
-
"monthlyRecurringRevenue": {
|
|
79
|
-
"weight": .25,
|
|
80
|
-
"direction": "gte",
|
|
81
|
-
"threshold": 1e4
|
|
82
|
-
},
|
|
83
|
-
"customerCount": {
|
|
84
|
-
"weight": .2,
|
|
85
|
-
"direction": "gte",
|
|
86
|
-
"threshold": 30
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"signalKinds": {
|
|
90
|
-
"metric": .15,
|
|
91
|
-
"event": .1
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
GrowthScaleUp: {
|
|
95
|
-
"base": .55,
|
|
96
|
-
"metrics": {
|
|
97
|
-
"retentionRate": {
|
|
98
|
-
"weight": .2,
|
|
99
|
-
"direction": "gte",
|
|
100
|
-
"threshold": .55
|
|
101
|
-
},
|
|
102
|
-
"monthlyRecurringRevenue": {
|
|
103
|
-
"weight": .3,
|
|
104
|
-
"direction": "gte",
|
|
105
|
-
"threshold": 5e4
|
|
106
|
-
},
|
|
107
|
-
"teamSize": {
|
|
108
|
-
"weight": .15,
|
|
109
|
-
"direction": "gte",
|
|
110
|
-
"threshold": 15
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"signalKinds": {
|
|
114
|
-
"event": .2,
|
|
115
|
-
"metric": .15
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
ExpansionPlatform: {
|
|
119
|
-
"base": .6,
|
|
120
|
-
"metrics": {
|
|
121
|
-
"monthlyRecurringRevenue": {
|
|
122
|
-
"weight": .35,
|
|
123
|
-
"direction": "gte",
|
|
124
|
-
"threshold": 15e4
|
|
125
|
-
},
|
|
126
|
-
"customerCount": {
|
|
127
|
-
"weight": .2,
|
|
128
|
-
"direction": "gte",
|
|
129
|
-
"threshold": 100
|
|
130
|
-
},
|
|
131
|
-
"teamSize": {
|
|
132
|
-
"weight": .15,
|
|
133
|
-
"direction": "gte",
|
|
134
|
-
"threshold": 40
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"signalKinds": {
|
|
138
|
-
"event": .2,
|
|
139
|
-
"milestone": .1
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
MaturityRenewal: {
|
|
143
|
-
"base": .6,
|
|
144
|
-
"metrics": {
|
|
145
|
-
"monthlyRecurringRevenue": {
|
|
146
|
-
"weight": .25,
|
|
147
|
-
"direction": "gte",
|
|
148
|
-
"threshold": 25e4
|
|
149
|
-
},
|
|
150
|
-
"teamSize": {
|
|
151
|
-
"weight": .15,
|
|
152
|
-
"direction": "gte",
|
|
153
|
-
"threshold": 80
|
|
154
|
-
},
|
|
155
|
-
"burnMultiple": {
|
|
156
|
-
"weight": .2,
|
|
157
|
-
"direction": "lte",
|
|
158
|
-
"threshold": 1.5
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"signalKinds": {
|
|
162
|
-
"event": .2,
|
|
163
|
-
"milestone": .15
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
//#endregion
|
|
169
|
-
export { stage_weights_default as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//#region ../../libs/lifecycle/dist/types/axes.js
|
|
2
|
-
let ProductPhase = /* @__PURE__ */ function(ProductPhase$1) {
|
|
3
|
-
ProductPhase$1["Sketch"] = "Sketch";
|
|
4
|
-
ProductPhase$1["Prototype"] = "Prototype";
|
|
5
|
-
ProductPhase$1["Mvp"] = "MVP";
|
|
6
|
-
ProductPhase$1["V1"] = "V1";
|
|
7
|
-
ProductPhase$1["Ecosystem"] = "Ecosystem";
|
|
8
|
-
return ProductPhase$1;
|
|
9
|
-
}({});
|
|
10
|
-
let CompanyPhase = /* @__PURE__ */ function(CompanyPhase$1) {
|
|
11
|
-
CompanyPhase$1["Solo"] = "Solo";
|
|
12
|
-
CompanyPhase$1["TinyTeam"] = "TinyTeam";
|
|
13
|
-
CompanyPhase$1["FunctionalOrg"] = "FunctionalOrg";
|
|
14
|
-
CompanyPhase$1["MultiTeam"] = "MultiTeam";
|
|
15
|
-
CompanyPhase$1["Bureaucratic"] = "Bureaucratic";
|
|
16
|
-
return CompanyPhase$1;
|
|
17
|
-
}({});
|
|
18
|
-
let CapitalPhase = /* @__PURE__ */ function(CapitalPhase$1) {
|
|
19
|
-
CapitalPhase$1["Bootstrapped"] = "Bootstrapped";
|
|
20
|
-
CapitalPhase$1["PreSeed"] = "PreSeed";
|
|
21
|
-
CapitalPhase$1["Seed"] = "Seed";
|
|
22
|
-
CapitalPhase$1["SeriesAorB"] = "SeriesAorB";
|
|
23
|
-
CapitalPhase$1["LateStage"] = "LateStage";
|
|
24
|
-
return CapitalPhase$1;
|
|
25
|
-
}({});
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { CapitalPhase, CompanyPhase, ProductPhase };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./stages.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./stages.js";
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
//#region ../../libs/lifecycle/dist/types/stages.js
|
|
2
|
-
let LifecycleStage = /* @__PURE__ */ function(LifecycleStage$1) {
|
|
3
|
-
LifecycleStage$1[LifecycleStage$1["Exploration"] = 0] = "Exploration";
|
|
4
|
-
LifecycleStage$1[LifecycleStage$1["ProblemSolutionFit"] = 1] = "ProblemSolutionFit";
|
|
5
|
-
LifecycleStage$1[LifecycleStage$1["MvpEarlyTraction"] = 2] = "MvpEarlyTraction";
|
|
6
|
-
LifecycleStage$1[LifecycleStage$1["ProductMarketFit"] = 3] = "ProductMarketFit";
|
|
7
|
-
LifecycleStage$1[LifecycleStage$1["GrowthScaleUp"] = 4] = "GrowthScaleUp";
|
|
8
|
-
LifecycleStage$1[LifecycleStage$1["ExpansionPlatform"] = 5] = "ExpansionPlatform";
|
|
9
|
-
LifecycleStage$1[LifecycleStage$1["MaturityRenewal"] = 6] = "MaturityRenewal";
|
|
10
|
-
return LifecycleStage$1;
|
|
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
|
-
|
|
150
|
-
//#endregion
|
|
151
|
-
export { LIFECYCLE_STAGE_META, LifecycleStage };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../types/stages.js";
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { LIFECYCLE_STAGE_META, LifecycleStage } from "../libs/lifecycle/dist/types/stages.js";
|
|
2
|
-
import "../libs/lifecycle/dist/index.js";
|
|
3
|
-
import "../collectors/signal-collector.js";
|
|
4
|
-
import "../scoring/stage-scorer.js";
|
|
5
|
-
|
|
6
|
-
//#region src/orchestrator/lifecycle-orchestrator.ts
|
|
7
|
-
var LifecycleOrchestrator = class {
|
|
8
|
-
collector;
|
|
9
|
-
scorer;
|
|
10
|
-
planner;
|
|
11
|
-
constructor(options) {
|
|
12
|
-
this.collector = options.collector;
|
|
13
|
-
this.scorer = options.scorer;
|
|
14
|
-
this.planner = options.milestonePlanner;
|
|
15
|
-
}
|
|
16
|
-
async run(input) {
|
|
17
|
-
const collected = await this.collector.collect(input);
|
|
18
|
-
const scorecard = this.scorer.score({
|
|
19
|
-
metrics: collected.metrics,
|
|
20
|
-
signals: collected.signals
|
|
21
|
-
});
|
|
22
|
-
const top = scorecard[0] ?? fallbackScore();
|
|
23
|
-
const meta = LIFECYCLE_STAGE_META[top.stage];
|
|
24
|
-
return {
|
|
25
|
-
stage: top.stage,
|
|
26
|
-
confidence: top.confidence,
|
|
27
|
-
axes: collected.axes,
|
|
28
|
-
signals: collected.signals,
|
|
29
|
-
metrics: toMetricRecord(collected.metrics),
|
|
30
|
-
gaps: meta.focusAreas.slice(0, 3),
|
|
31
|
-
focusAreas: meta.focusAreas,
|
|
32
|
-
scorecard,
|
|
33
|
-
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
getUpcomingMilestones(stage, completedMilestoneIds = [], limit = 5) {
|
|
37
|
-
if (!this.planner) return [];
|
|
38
|
-
return this.planner.getUpcoming(stage, completedMilestoneIds, limit);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const fallbackScore = () => ({
|
|
42
|
-
stage: LifecycleStage.Exploration,
|
|
43
|
-
score: .3,
|
|
44
|
-
confidence: .3,
|
|
45
|
-
supportingSignals: []
|
|
46
|
-
});
|
|
47
|
-
const toMetricRecord = (snapshot) => Object.entries(snapshot ?? {}).reduce((acc, [key, value]) => {
|
|
48
|
-
if (typeof value === "number") acc[key] = value;
|
|
49
|
-
return acc;
|
|
50
|
-
}, {});
|
|
51
|
-
|
|
52
|
-
//#endregion
|
|
53
|
-
export { LifecycleOrchestrator };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import milestones_catalog_default from "../data/milestones-catalog.js";
|
|
2
|
-
|
|
3
|
-
//#region src/planning/milestone-planner.ts
|
|
4
|
-
var LifecycleMilestonePlanner = class {
|
|
5
|
-
milestones;
|
|
6
|
-
constructor(customCatalog) {
|
|
7
|
-
this.milestones = customCatalog ?? milestones_catalog_default;
|
|
8
|
-
}
|
|
9
|
-
getUpcoming(stage, completedIds = [], limit = 5) {
|
|
10
|
-
const completedSet = new Set(completedIds);
|
|
11
|
-
return this.milestones.filter((milestone) => milestone.stage === stage && !completedSet.has(milestone.id)).sort((a, b) => a.priority - b.priority).slice(0, limit);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { LifecycleMilestonePlanner };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { LIFECYCLE_STAGE_META, LifecycleStage } from "../libs/lifecycle/dist/types/stages.js";
|
|
2
|
-
import "../libs/lifecycle/dist/index.js";
|
|
3
|
-
import stage_weights_default from "../data/stage-weights.js";
|
|
4
|
-
|
|
5
|
-
//#region src/scoring/stage-scorer.ts
|
|
6
|
-
const DEFAULT_WEIGHTS = stage_weights_default;
|
|
7
|
-
var StageScorer = class {
|
|
8
|
-
weights;
|
|
9
|
-
constructor(weights = DEFAULT_WEIGHTS) {
|
|
10
|
-
this.weights = weights;
|
|
11
|
-
}
|
|
12
|
-
score(input) {
|
|
13
|
-
const kindStrength = evaluateSignalKinds(input.signals);
|
|
14
|
-
return Object.values(LifecycleStage).filter(isStageValue).map((stage) => {
|
|
15
|
-
const stageName = LifecycleStage[stage];
|
|
16
|
-
const config = this.weights[stageName] ?? { base: .5 };
|
|
17
|
-
let score = config.base ?? .5;
|
|
18
|
-
let contributions = 0;
|
|
19
|
-
const totalPossible = Object.keys(config.metrics ?? {}).length + Object.keys(config.signalKinds ?? {}).length || 1;
|
|
20
|
-
const supportingSignals = [];
|
|
21
|
-
if (config.metrics) Object.entries(config.metrics).forEach(([metricKey, metricConfig]) => {
|
|
22
|
-
const value = input.metrics[metricKey];
|
|
23
|
-
if (value === void 0 || value === null) return;
|
|
24
|
-
if (passesThreshold(value, metricConfig)) {
|
|
25
|
-
score += metricConfig.weight;
|
|
26
|
-
contributions += 1;
|
|
27
|
-
supportingSignals.push(`metric:${metricKey}`);
|
|
28
|
-
} else score += metricConfig.weight * .25;
|
|
29
|
-
});
|
|
30
|
-
if (config.signalKinds) Object.entries(config.signalKinds).forEach(([kind, weight]) => {
|
|
31
|
-
if ((kindStrength[kind] ?? 0) > 0 && typeof weight === "number") {
|
|
32
|
-
score += weight;
|
|
33
|
-
contributions += 1;
|
|
34
|
-
supportingSignals.push(`signal:${kind}`);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
score = clamp(score, 0, 1.25);
|
|
38
|
-
const confidence = clamp(contributions / totalPossible, .1, 1);
|
|
39
|
-
return {
|
|
40
|
-
stage,
|
|
41
|
-
score,
|
|
42
|
-
confidence,
|
|
43
|
-
supportingSignals
|
|
44
|
-
};
|
|
45
|
-
}).sort((a, b) => {
|
|
46
|
-
if (b.score === a.score) return b.confidence - a.confidence;
|
|
47
|
-
return b.score - a.score;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const passesThreshold = (value, config) => {
|
|
52
|
-
if ((config.direction ?? "gte") === "gte") return value >= config.threshold;
|
|
53
|
-
return value <= config.threshold;
|
|
54
|
-
};
|
|
55
|
-
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
56
|
-
const evaluateSignalKinds = (signals) => signals.reduce((acc, signal) => {
|
|
57
|
-
const key = signal.kind ?? "unknown";
|
|
58
|
-
acc[key] = (acc[key] ?? 0) + (signal.weight ?? 1);
|
|
59
|
-
return acc;
|
|
60
|
-
}, {});
|
|
61
|
-
const isStageValue = (value) => typeof value === "number" && value in LIFECYCLE_STAGE_META;
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
export { StageScorer };
|