@lssm/bundle.lifecycle-managed 0.0.0-canary-20251206160926

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +51 -0
  2. package/dist/agents/lifecycle-advisor-agent.d.ts +6 -0
  3. package/dist/agents/lifecycle-advisor-agent.js +5 -0
  4. package/dist/api/rest-handlers.d.ts +20 -0
  5. package/dist/api/rest-handlers.js +1 -0
  6. package/dist/events/lifecycle-events.d.ts +15 -0
  7. package/dist/events/lifecycle-events.js +1 -0
  8. package/dist/index.d.ts +5 -0
  9. package/dist/index.js +1 -0
  10. package/dist/libs/ai-agent/dist/agent/agent-factory.js +1 -0
  11. package/dist/libs/ai-agent/dist/agent/contract-spec-agent.js +1 -0
  12. package/dist/libs/ai-agent/dist/agent/index.js +1 -0
  13. package/dist/libs/ai-agent/dist/approval/index.js +1 -0
  14. package/dist/libs/ai-agent/dist/approval/workflow.js +1 -0
  15. package/dist/libs/ai-agent/dist/index.js +1 -0
  16. package/dist/libs/ai-agent/dist/schema/index.js +1 -0
  17. package/dist/libs/ai-agent/dist/schema/json-schema-to-zod.js +1 -0
  18. package/dist/libs/ai-agent/dist/schema/schema-output.js +1 -0
  19. package/dist/libs/ai-agent/dist/spec/spec.js +1 -0
  20. package/dist/libs/ai-agent/dist/tools/index.js +1 -0
  21. package/dist/libs/ai-agent/dist/tools/knowledge-tool.js +1 -0
  22. package/dist/libs/ai-agent/dist/tools/mcp-client.js +1 -0
  23. package/dist/libs/ai-agent/dist/tools/mcp-server.js +1 -0
  24. package/dist/libs/ai-agent/dist/tools/tool-adapter.js +1 -0
  25. package/dist/libs/analytics/dist/churn/index.js +1 -0
  26. package/dist/libs/analytics/dist/churn/predictor.js +1 -0
  27. package/dist/libs/analytics/dist/cohort/index.js +1 -0
  28. package/dist/libs/analytics/dist/cohort/tracker.js +1 -0
  29. package/dist/libs/analytics/dist/index.js +1 -0
  30. package/dist/libs/analytics/dist/lifecycle/metric-collectors.js +1 -0
  31. package/dist/libs/lifecycle/dist/index.js +1 -0
  32. package/dist/libs/lifecycle/dist/types/axes.js +1 -0
  33. package/dist/libs/lifecycle/dist/types/milestones.js +1 -0
  34. package/dist/libs/lifecycle/dist/types/signals.js +1 -0
  35. package/dist/libs/lifecycle/dist/types/stages.js +1 -0
  36. package/dist/libs/lifecycle/dist/utils/formatters.js +1 -0
  37. package/dist/libs/observability/dist/index.js +1 -0
  38. package/dist/libs/observability/dist/intent/detector.js +1 -0
  39. package/dist/libs/observability/dist/lifecycle/dist/index.js +1 -0
  40. package/dist/libs/observability/dist/lifecycle/dist/types/axes.js +1 -0
  41. package/dist/libs/observability/dist/lifecycle/dist/types/milestones.js +1 -0
  42. package/dist/libs/observability/dist/lifecycle/dist/types/signals.js +1 -0
  43. package/dist/libs/observability/dist/lifecycle/dist/types/stages.js +1 -0
  44. package/dist/libs/observability/dist/lifecycle/dist/utils/formatters.js +1 -0
  45. package/dist/libs/observability/dist/logging/index.js +1 -0
  46. package/dist/libs/observability/dist/metrics/index.js +1 -0
  47. package/dist/libs/observability/dist/pipeline/evolution-pipeline.js +1 -0
  48. package/dist/libs/observability/dist/pipeline/lifecycle-pipeline.js +1 -0
  49. package/dist/libs/observability/dist/tracing/index.js +1 -0
  50. package/dist/libs/observability/dist/tracing/middleware.js +1 -0
  51. package/dist/modules/lifecycle-advisor/dist/ceremony/ceremony-designer.js +1 -0
  52. package/dist/modules/lifecycle-advisor/dist/data/library-stage-map.js +1 -0
  53. package/dist/modules/lifecycle-advisor/dist/data/stage-playbooks.js +1 -0
  54. package/dist/modules/lifecycle-advisor/dist/index.js +1 -0
  55. package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/index.js +1 -0
  56. package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/axes.js +1 -0
  57. package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/milestones.js +1 -0
  58. package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/signals.js +1 -0
  59. package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/types/stages.js +1 -0
  60. package/dist/modules/lifecycle-advisor/dist/libs/lifecycle/dist/utils/formatters.js +1 -0
  61. package/dist/modules/lifecycle-advisor/dist/recommendations/library-recommender.js +1 -0
  62. package/dist/modules/lifecycle-advisor/dist/recommendations/recommendation-engine.js +1 -0
  63. package/dist/modules/lifecycle-core/dist/collectors/signal-collector.js +1 -0
  64. package/dist/modules/lifecycle-core/dist/data/milestones-catalog.js +1 -0
  65. package/dist/modules/lifecycle-core/dist/data/stage-weights.js +1 -0
  66. package/dist/modules/lifecycle-core/dist/index.js +1 -0
  67. package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/index.js +1 -0
  68. package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/axes.js +1 -0
  69. package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/milestones.js +1 -0
  70. package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/signals.js +1 -0
  71. package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/types/stages.js +1 -0
  72. package/dist/modules/lifecycle-core/dist/libs/lifecycle/dist/utils/formatters.js +1 -0
  73. package/dist/modules/lifecycle-core/dist/orchestrator/lifecycle-orchestrator.js +1 -0
  74. package/dist/modules/lifecycle-core/dist/planning/milestone-planner.js +1 -0
  75. package/dist/modules/lifecycle-core/dist/scoring/stage-scorer.js +1 -0
  76. package/dist/services/assessment-service.d.ts +48 -0
  77. package/dist/services/assessment-service.js +1 -0
  78. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @lssm/bundle.lifecycle-managed
2
+
3
+ Lifecycle assessment + guidance managed service for ContractSpec Studio. This bundle wires the lifecycle modules, analytics bridges, and AI advisor agent into a deployable service surface (REST, events, Studio integrations).
4
+
5
+ ## Modules
6
+
7
+ - `LifecycleAssessmentService` – orchestrates detection, scoring, guidance, metrics, and managed events.
8
+ - `LifecycleAdvisorAgent` – AI spec definition for conversational lifecycle coaching.
9
+ - `LifecycleEventBridge` – helper to broadcast stage changes + assessment telemetry.
10
+ - REST handlers – HTTP-friendly adapters for serving assessments + playbooks.
11
+
12
+ ## Usage
13
+
14
+ ```ts
15
+ import { LifecycleAssessmentService, createLifecycleHandlers } from '@lssm/bundle.lifecycle-managed';
16
+
17
+ const service = new LifecycleAssessmentService({
18
+ tenantId: 'tenant_123',
19
+ collectorOptions: {
20
+ analyticsAdapter,
21
+ questionnaireAdapter,
22
+ },
23
+ });
24
+
25
+ const handlers = createLifecycleHandlers(service);
26
+
27
+ app.post('/lifecycle/assessments', handlers.runAssessment);
28
+ app.get('/lifecycle/playbooks/:stage', handlers.getPlaybook);
29
+ ```
30
+
31
+ The bundle stays framework-agnostic: you can mount the handlers on Elysia, Express, Next.js routes, or background jobs.*** End Patch
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
@@ -0,0 +1,6 @@
1
+ import * as _lssm_lib_ai_agent0 from "@lssm/lib.ai-agent";
2
+
3
+ //#region src/agents/lifecycle-advisor-agent.d.ts
4
+ declare const LifecycleAdvisorAgent: _lssm_lib_ai_agent0.AgentSpec;
5
+ //#endregion
6
+ export { LifecycleAdvisorAgent };
@@ -0,0 +1,5 @@
1
+ import{e}from"../libs/ai-agent/dist/spec/spec.js";import"../libs/ai-agent/dist/index.js";const t=e({meta:{name:`lifecycle.advisor`,version:1,title:`Lifecycle Advisor Agent`,description:`Guides artisans through lifecycle detection, focus areas, and ceremonies.`,owners:[`team-lifecycle`],domain:`operations`,tags:[`guide`,`lifecycle`,`ops`],stability:`experimental`},description:`Guides users through lifecycle assessments, highlights gaps, and recommends actions tied to ContractSpec libraries.`,instructions:`You are the Lifecycle Advisor. Always clarify the user's current stage, confidence, and blockers before suggesting actions.
2
+ - Prioritize simple, mobile-friendly instructions.
3
+ - When in early stages, focus on learning loops, not heavy infra.
4
+ - When in later stages, emphasize repeatability, telemetry, and managed ceremonies.
5
+ - Suggest at most 3 actions at a time. Reference ContractSpec libraries or modules when relevant.`,tools:[{name:`run_assessment`,description:`Trigger a lifecycle assessment for a tenant.`,schema:{type:`object`,properties:{tenantId:{type:`string`},questionnaire:{type:`object`,additionalProperties:!0}},required:[`tenantId`]},automationSafe:!0},{name:`fetch_playbook`,description:`Retrieve stage-specific playbook (actions, ceremonies, libraries).`,schema:{type:`object`,properties:{stage:{type:`integer`,minimum:0,maximum:6,description:`Lifecycle stage number (0-6)`}},required:[`stage`]},automationSafe:!0}],memory:{maxEntries:25,ttlMinutes:120},policy:{confidence:{min:.7},escalation:{confidenceThreshold:.5,approvalWorkflow:`ops.lifecycle.escalation`},flags:[`lifecycle_advisor`]}});export{t as LifecycleAdvisorAgent};
@@ -0,0 +1,20 @@
1
+ import { LifecycleAssessmentRequest, LifecycleAssessmentService } from "../services/assessment-service.js";
2
+
3
+ //#region src/api/rest-handlers.d.ts
4
+ interface HttpRequest<TBody = unknown, TParams = Record<string, string>> {
5
+ body?: TBody;
6
+ params?: TParams;
7
+ query?: Record<string, string | undefined>;
8
+ }
9
+ interface HttpResponse<T = unknown> {
10
+ status: number;
11
+ body: T;
12
+ }
13
+ declare const createLifecycleHandlers: (service: LifecycleAssessmentService) => {
14
+ runAssessment: (req: HttpRequest<LifecycleAssessmentRequest>) => Promise<HttpResponse>;
15
+ getPlaybook: (req: HttpRequest<unknown, {
16
+ stage: string;
17
+ }>) => Promise<HttpResponse>;
18
+ };
19
+ //#endregion
20
+ export { HttpRequest, HttpResponse, createLifecycleHandlers };
@@ -0,0 +1 @@
1
+ import"../services/assessment-service.js";const e=e=>({runAssessment:async t=>{let n=t.body??{};return{status:200,body:await e.runAssessment(n)}},getPlaybook:async t=>{let n=Number(t.params?.stage??0);return{status:200,body:e.getStagePlaybook(n)}}});export{e as createLifecycleHandlers};
@@ -0,0 +1,15 @@
1
+ import { LifecyclePipelineEvent } from "@lssm/lib.observability";
2
+
3
+ //#region src/events/lifecycle-events.d.ts
4
+ interface ManagedLifecycleEvent {
5
+ name: string;
6
+ properties: Record<string, unknown>;
7
+ }
8
+ type LifecycleEventPublisher = (event: ManagedLifecycleEvent) => Promise<void> | void;
9
+ declare class LifecycleEventBridge {
10
+ private readonly publisher?;
11
+ constructor(publisher?: LifecycleEventPublisher | undefined);
12
+ forward(event: LifecyclePipelineEvent): void;
13
+ }
14
+ //#endregion
15
+ export { LifecycleEventBridge, LifecycleEventPublisher, ManagedLifecycleEvent };
@@ -0,0 +1 @@
1
+ import{n as e}from"../libs/analytics/dist/lifecycle/metric-collectors.js";import"../libs/analytics/dist/index.js";var t=class{constructor(e){this.publisher=e}forward(t){if(this.publisher)switch(t.type){case`assessment.recorded`:this.publisher({name:e.assessmentRun,properties:{tenantId:t.payload.tenantId,stage:t.payload.stage}});break;case`stage.changed`:this.publisher({name:e.stageChanged,properties:{tenantId:t.payload.tenantId,previousStage:t.payload.previousStage,nextStage:t.payload.nextStage}});break;case`confidence.low`:this.publisher({name:`${e.assessmentRun}.low_confidence`,properties:{tenantId:t.payload.tenantId,confidence:t.payload.confidence}});break}}};export{t as LifecycleEventBridge};
@@ -0,0 +1,5 @@
1
+ import { LifecycleEventBridge, LifecycleEventPublisher, ManagedLifecycleEvent } from "./events/lifecycle-events.js";
2
+ import { LifecycleAssessmentRequest, LifecycleAssessmentResponse, LifecycleAssessmentService, LifecycleAssessmentServiceOptions } from "./services/assessment-service.js";
3
+ import { LifecycleAdvisorAgent } from "./agents/lifecycle-advisor-agent.js";
4
+ import { HttpRequest, HttpResponse, createLifecycleHandlers } from "./api/rest-handlers.js";
5
+ export { HttpRequest, HttpResponse, LifecycleAdvisorAgent, LifecycleAssessmentRequest, LifecycleAssessmentResponse, LifecycleAssessmentService, LifecycleAssessmentServiceOptions, LifecycleEventBridge, LifecycleEventPublisher, ManagedLifecycleEvent, createLifecycleHandlers };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{LifecycleEventBridge as e}from"./events/lifecycle-events.js";import{LifecycleAssessmentService as t}from"./services/assessment-service.js";import{LifecycleAdvisorAgent as n}from"./agents/lifecycle-advisor-agent.js";import{createLifecycleHandlers as r}from"./api/rest-handlers.js";export{n as LifecycleAdvisorAgent,t as LifecycleAssessmentService,e as LifecycleEventBridge,r as createLifecycleHandlers};
@@ -0,0 +1 @@
1
+ import"./contract-spec-agent.js";
@@ -0,0 +1 @@
1
+ import"../tools/tool-adapter.js";import"../tools/knowledge-tool.js";import{z as e}from"zod";import"ai";e.object({tenantId:e.string().optional(),actorId:e.string().optional(),sessionId:e.string().optional(),metadata:e.record(e.string(),e.unknown()).optional()});
@@ -0,0 +1 @@
1
+ import"./contract-spec-agent.js";import"./agent-factory.js";
@@ -0,0 +1 @@
1
+ import"./workflow.js";
@@ -0,0 +1 @@
1
+ import"node:crypto";
@@ -0,0 +1 @@
1
+ import"./schema/json-schema-to-zod.js";import"./tools/tool-adapter.js";import"./tools/knowledge-tool.js";import{e}from"./spec/spec.js";import"./agent/contract-spec-agent.js";import"./agent/agent-factory.js";import"./agent/index.js";import"./tools/mcp-client.js";import"./tools/mcp-server.js";import"./tools/index.js";import"./schema/schema-output.js";import"./schema/index.js";import"./approval/workflow.js";import"./approval/index.js";import"ai";
@@ -0,0 +1 @@
1
+ import"./json-schema-to-zod.js";import"./schema-output.js";
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";
@@ -0,0 +1 @@
1
+ import"./json-schema-to-zod.js";import{z as e}from"zod";import"ai";
@@ -0,0 +1 @@
1
+ function e(e){if(!e.meta?.name)throw Error(`Agent name is required`);if(!Number.isFinite(e.meta.version))throw Error(`Agent ${e.meta.name} is missing a numeric version`);if(!e.instructions?.trim())throw Error(`Agent ${e.meta.name} requires instructions`);if(!e.tools?.length)throw Error(`Agent ${e.meta.name} must expose at least one tool`);let t=new Set;for(let n of e.tools){if(t.has(n.name))throw Error(`Agent ${e.meta.name} has duplicate tool name: ${n.name}`);t.add(n.name)}return Object.freeze(e)}export{e};
@@ -0,0 +1 @@
1
+ import"./tool-adapter.js";import"./knowledge-tool.js";import"./mcp-client.js";import"./mcp-server.js";
@@ -0,0 +1 @@
1
+ import{z as e}from"zod";import"ai";
@@ -0,0 +1 @@
1
+ import"@ai-sdk/mcp";import"@ai-sdk/mcp/mcp-stdio";
@@ -0,0 +1 @@
1
+ import"../schema/json-schema-to-zod.js";import{z as e}from"zod";import"@modelcontextprotocol/sdk/server/mcp.js";
@@ -0,0 +1 @@
1
+ import"../schema/json-schema-to-zod.js";import"ai";
@@ -0,0 +1 @@
1
+ import"./predictor.js";
@@ -0,0 +1 @@
1
+ import"dayjs";
@@ -0,0 +1 @@
1
+ import"./tracker.js";
@@ -0,0 +1 @@
1
+ import"dayjs";
@@ -0,0 +1 @@
1
+ import"./cohort/tracker.js";import"./cohort/index.js";import"./churn/predictor.js";import"./churn/index.js";import{n as e}from"./lifecycle/metric-collectors.js";
@@ -0,0 +1 @@
1
+ const e={assessmentRun:`lifecycle_assessment_run`,stageChanged:`lifecycle_stage_changed`,guidanceConsumed:`lifecycle_guidance_consumed`};export{e as n};
@@ -0,0 +1 @@
1
+ import{e,n as t}from"./types/stages.js";import{e as n,n as r,t as i}from"./types/axes.js";import"./types/signals.js";import"./types/milestones.js";import"./utils/formatters.js";
@@ -0,0 +1 @@
1
+ let e=function(e){return e.Sketch=`Sketch`,e.Prototype=`Prototype`,e.Mvp=`MVP`,e.V1=`V1`,e.Ecosystem=`Ecosystem`,e}({}),t=function(e){return e.Solo=`Solo`,e.TinyTeam=`TinyTeam`,e.FunctionalOrg=`FunctionalOrg`,e.MultiTeam=`MultiTeam`,e.Bureaucratic=`Bureaucratic`,e}({}),n=function(e){return e.Bootstrapped=`Bootstrapped`,e.PreSeed=`PreSeed`,e.Seed=`Seed`,e.SeriesAorB=`SeriesAorB`,e.LateStage=`LateStage`,e}({});export{e,n,t};
@@ -0,0 +1 @@
1
+ import"./stages.js";
@@ -0,0 +1 @@
1
+ import"./stages.js";
@@ -0,0 +1 @@
1
+ let e=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}({});e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal;const t={[e.Exploration]:{id:e.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`]},[e.ProblemSolutionFit]:{id:e.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`]},[e.MvpEarlyTraction]:{id:e.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`]},[e.ProductMarketFit]:{id:e.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`]},[e.GrowthScaleUp]:{id:e.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`]},[e.ExpansionPlatform]:{id:e.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`]},[e.MaturityRenewal]:{id:e.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`]}};export{e,t as n};
@@ -0,0 +1 @@
1
+ import"../types/stages.js";
@@ -0,0 +1 @@
1
+ import"./tracing/index.js";import{i as e,n as t,r as n,t as r}from"./metrics/index.js";import{n as i}from"./logging/index.js";import"./tracing/middleware.js";import"./intent/detector.js";import"./pipeline/evolution-pipeline.js";import{a}from"./pipeline/lifecycle-pipeline.js";
@@ -0,0 +1 @@
1
+ import"node:crypto";
@@ -0,0 +1 @@
1
+ import"./types/stages.js";import"./utils/formatters.js";import"./types/axes.js";import"./types/signals.js";import"./types/milestones.js";
@@ -0,0 +1 @@
1
+ (function(e){return e.Sketch=`Sketch`,e.Prototype=`Prototype`,e.Mvp=`MVP`,e.V1=`V1`,e.Ecosystem=`Ecosystem`,e})({}),function(e){return e.Solo=`Solo`,e.TinyTeam=`TinyTeam`,e.FunctionalOrg=`FunctionalOrg`,e.MultiTeam=`MultiTeam`,e.Bureaucratic=`Bureaucratic`,e}({}),function(e){return e.Bootstrapped=`Bootstrapped`,e.PreSeed=`PreSeed`,e.Seed=`Seed`,e.SeriesAorB=`SeriesAorB`,e.LateStage=`LateStage`,e}({});
@@ -0,0 +1 @@
1
+ import"./stages.js";
@@ -0,0 +1 @@
1
+ import"./stages.js";
@@ -0,0 +1 @@
1
+ let e=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}({});e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal;const t={[e.Exploration]:{id:e.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`]},[e.ProblemSolutionFit]:{id:e.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`]},[e.MvpEarlyTraction]:{id:e.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`]},[e.ProductMarketFit]:{id:e.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`]},[e.GrowthScaleUp]:{id:e.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`]},[e.ExpansionPlatform]:{id:e.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`]},[e.MaturityRenewal]:{id:e.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`]}};export{t as n};
@@ -0,0 +1 @@
1
+ import{n as e}from"../types/stages.js";const t=t=>e[t].name;export{t as r};
@@ -0,0 +1 @@
1
+ import{context as e,trace as t}from"@opentelemetry/api";var n=class{constructor(e){this.serviceName=e}log(n,r,i={}){let a=t.getSpan(e.active()),o=a?.spanContext().traceId,s=a?.spanContext().spanId,c={timestamp:new Date().toISOString(),service:this.serviceName,level:n,message:r,traceId:o,spanId:s,...i};console.log(JSON.stringify(c))}debug(e,t){this.log(`debug`,e,t)}info(e,t){this.log(`info`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t){this.log(`error`,e,t)}};new n(process.env.OTEL_SERVICE_NAME||`unknown-service`);export{n};
@@ -0,0 +1 @@
1
+ import{metrics as e}from"@opentelemetry/api";function t(t=`@lssm/lib.observability`){return e.getMeter(t)}function n(e,n,r){return t(r).createCounter(e,{description:n})}function r(e,n,r){return t(r).createUpDownCounter(e,{description:n})}function i(e,n,r){return t(r).createHistogram(e,{description:n})}n(`http_requests_total`,`Total HTTP requests`),i(`http_request_duration_seconds`,`HTTP request duration`),n(`operation_errors_total`,`Total operation errors`),i(`workflow_duration_seconds`,`Workflow execution duration`);export{i,n,r,t};
@@ -0,0 +1 @@
1
+ import"../intent/detector.js";import{EventEmitter as e}from"node:events";
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n}from"../metrics/index.js";import{r}from"../lifecycle/dist/utils/formatters.js";import"../lifecycle/dist/index.js";import{EventEmitter as i}from"node:events";var a=class{assessmentCounter;confidenceHistogram;stageUpDownCounter;emitter;lowConfidenceThreshold;currentStageByTenant=new Map;constructor(r={}){let a=r.meterName??`@lssm/lib.lifecycle-kpi`;this.assessmentCounter=t(`lifecycle_assessments_total`,`Total lifecycle assessments`,a),this.confidenceHistogram=e(`lifecycle_assessment_confidence`,`Lifecycle assessment confidence distribution`,a),this.stageUpDownCounter=n(`lifecycle_stage_tenants`,`Current tenants per lifecycle stage`,a),this.emitter=r.emitter??new i,this.lowConfidenceThreshold=r.lowConfidenceThreshold??.4}recordAssessment(e,t){let n={stage:r(e.stage),tenantId:t};this.assessmentCounter.add(1,n),this.confidenceHistogram.record(e.confidence,n),this.ensureStageCounters(e.stage,t),this.emitter.emit(`event`,{type:`assessment.recorded`,payload:{tenantId:t,stage:e.stage}}),e.confidence<this.lowConfidenceThreshold&&this.emitter.emit(`event`,{type:`confidence.low`,payload:{tenantId:t,confidence:e.confidence}})}on(e){this.emitter.on(`event`,e)}ensureStageCounters(e,t){if(!t)return;let n=this.currentStageByTenant.get(t);n!==e&&(n!==void 0&&this.stageUpDownCounter.add(-1,{stage:r(n),tenantId:t}),this.stageUpDownCounter.add(1,{stage:r(e),tenantId:t}),this.currentStageByTenant.set(t,e),this.emitter.emit(`event`,{type:`stage.changed`,payload:{tenantId:t,previousStage:n,nextStage:e}}))}};export{a};
@@ -0,0 +1 @@
1
+ import{context as e,trace as t}from"@opentelemetry/api";
@@ -0,0 +1 @@
1
+ import"./index.js";import"../metrics/index.js";
@@ -0,0 +1 @@
1
+ import"../libs/lifecycle/dist/index.js";import{t as e}from"../data/stage-playbooks.js";const t=new Map(e.map(e=>[e.stage,e.ceremony]));var n=class{ceremonies;constructor(e){this.ceremonies=e?.length?new Map(e.map(e=>[e.stage,e.ceremony])):t}design(e){return this.ceremonies.get(e)}};export{n};
@@ -0,0 +1 @@
1
+ var e=[{stage:0,items:[{id:`@lssm/lib.content-gen`,type:`library`,description:`Summarize interviews and synthesize IC insights.`},{id:`@lssm/lib.presentation-runtime`,type:`library`,description:`Craft low-fi storyboards without custom code.`}]},{stage:1,items:[{id:`@lssm/lib.progressive-delivery`,type:`library`,description:`Gate prototype features behind lightweight flags.`},{id:`@lssm/module.lifecycle-core`,type:`module`,description:`Capture questionnaire signals for early scoring.`}]},{stage:2,items:[{id:`@lssm/lib.analytics`,type:`library`,description:`Instrument activation paths + cohorts.`},{id:`@lssm/lib.observability`,type:`library`,description:`Collect minimum viable traces and metrics.`}]},{stage:3,items:[{id:`@lssm/lib.evolution`,type:`library`,description:`Auto-detect contract gaps and spec improvements.`},{id:`@lssm/module.lifecycle-advisor`,type:`module`,description:`Generate retention-focused guidance at scale.`}]},{stage:4,items:[{id:`@lssm/lib.growth`,type:`library`,description:`Experiment orchestration with guardrails.`},{id:`@lssm/lib.resilience`,type:`library`,description:`Stabilize infra and SLOs as teams split.`}]},{stage:5,items:[{id:`@lssm/lib.workflow-composer`,type:`library`,description:`Automate partner workflows and integrations.`},{id:`@lssm/bundle.contractspec-studio`,type:`bundle`,description:`Expose managed partner onboarding via Studio.`}]},{stage:6,items:[{id:`@lssm/lib.cost-tracking`,type:`library`,description:`Model margin scenarios and reinvestment bets.`},{id:`@lssm/lib.workflow-composer`,type:`library`,description:`Standardize renewal rituals and automation.`}]}];export{e};
@@ -0,0 +1 @@
1
+ import{e}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";var t=[{stage:e.Exploration,focusAreas:[`Discovery`,`Problem clarity`,`Persona`],actions:[{id:`stage0-interview-burst`,stage:e.Exploration,title:`Run a 5-day interview burst`,description:`Schedule at least 5 back-to-back interviews and capture raw quotes.`,priority:1,estimatedImpact:`medium`,effortLevel:`m`,category:`product`,recommendedLibraries:[`@lssm/lib.content-gen`]},{id:`stage0-problem-story`,stage:e.Exploration,title:`Write the problem story`,description:`Summarize the pain in one paragraph you can repeat to partners.`,priority:2,estimatedImpact:`low`,effortLevel:`s`,category:`product`}],ceremony:{title:`Discovery Spark`,copy:`Share the sharpest pain quote with your crew. Frame it, celebrate focus.`,cues:[`🔎`,`🗒️`]}},{stage:e.ProblemSolutionFit,focusAreas:[`Prototype`,`Feedback`,`Value proof`],actions:[{id:`stage1-demo-loop`,stage:e.ProblemSolutionFit,title:`Prototype feedback loop`,description:`Ship a low-fidelity prototype and collect 3 rounds of reactions.`,priority:1,estimatedImpact:`medium`,effortLevel:`m`,category:`product`,recommendedLibraries:[`@lssm/lib.progressive-delivery`]},{id:`stage1-referrals`,stage:e.ProblemSolutionFit,title:`Capture referral signals`,description:`Ask each tester who else should see the demo.`,priority:2,estimatedImpact:`low`,effortLevel:`s`,category:`growth`}],ceremony:{title:`Solution Resonance`,copy:`Record a short screen share telling the before/after story to your future self.`,cues:[`🎤`,`✨`]}},{stage:e.MvpEarlyTraction,focusAreas:[`Activation`,`Telemetry`,`Feedback`],actions:[{id:`stage2-activation`,stage:e.MvpEarlyTraction,title:`Define activation checklist`,description:`Document the 3 steps users must finish to get value.`,priority:1,estimatedImpact:`high`,effortLevel:`m`,category:`operations`,recommendedLibraries:[`@lssm/lib.analytics`,`@lssm/lib.observability`]},{id:`stage2-weekly-sync`,stage:e.MvpEarlyTraction,title:`Weekly user sync`,description:`Host a standing call with your 5 most active testers.`,priority:2,estimatedImpact:`medium`,effortLevel:`m`,category:`company`}],ceremony:{title:`Traction Toast`,copy:`Toast your first 20 real users—say their names, tell them why they matter.`,cues:[`🥂`,`📣`]}},{stage:e.ProductMarketFit,focusAreas:[`Retention`,`Reliability`,`Story`],actions:[{id:`stage3-retention-study`,stage:e.ProductMarketFit,title:`Run a retention study`,description:`Interview 3 retained users and publish their before/after metrics.`,priority:1,estimatedImpact:`high`,effortLevel:`m`,category:`product`,recommendedLibraries:[`@lssm/lib.evolution`]},{id:`stage3-incident-review`,stage:e.ProductMarketFit,title:`Lightweight incident review`,description:`Review the last 2 reliability hiccups and capture fixes.`,priority:2,estimatedImpact:`medium`,effortLevel:`s`,category:`operations`}],ceremony:{title:`PMF Signal Fire`,copy:`Write a letter to your future Series A self describing the pull you feel today.`,cues:[`🔥`,`📬`]}},{stage:e.GrowthScaleUp,focusAreas:[`Systems`,`Growth loops`,`Specialization`],actions:[{id:`stage4-growth-loop`,stage:e.GrowthScaleUp,title:`Codify a growth loop`,description:`Choose one loop (SEO, referrals, outbound) and document owners + inputs.`,priority:1,estimatedImpact:`high`,effortLevel:`l`,category:`growth`,recommendedLibraries:[`@lssm/lib.growth`,`@lssm/lib.resilience`]},{id:`stage4-hiring-map`,stage:e.GrowthScaleUp,title:`Create hiring map`,description:`List specialized roles you need in the next 2 quarters.`,priority:2,estimatedImpact:`medium`,effortLevel:`m`,category:`company`}],ceremony:{title:`Scale Systems`,copy:`Invite the team to map the journey from first user to repeatable machine.`,cues:[`🗺️`,`⚙️`]}},{stage:e.ExpansionPlatform,focusAreas:[`Partners`,`APIs`,`Expansion bets`],actions:[{id:`stage5-partner-brief`,stage:e.ExpansionPlatform,title:`Partner readiness brief`,description:`Document partner types, value props, and onboarding steps.`,priority:1,estimatedImpact:`high`,effortLevel:`m`,category:`product`,recommendedLibraries:[`@lssm/lib.workflow-composer`]},{id:`stage5-experiment-portfolio`,stage:e.ExpansionPlatform,title:`Expansion experiment portfolio`,description:`List the top 3 markets or product lines with owners.`,priority:2,estimatedImpact:`medium`,effortLevel:`m`,category:`growth`}],ceremony:{title:`Platform Threshold`,copy:`Host a partner circle—invite allies to share what they need from your platform.`,cues:[`🤝`,`🌐`]}},{stage:e.MaturityRenewal,focusAreas:[`Optimization`,`Renewal`,`Portfolio`],actions:[{id:`stage6-cost-review`,stage:e.MaturityRenewal,title:`Run a cost-to-value review`,description:`Audit each major surface for margin impact.`,priority:1,estimatedImpact:`high`,effortLevel:`m`,category:`operations`,recommendedLibraries:[`@lssm/lib.cost-tracking`]},{id:`stage6-renewal-bet`,stage:e.MaturityRenewal,title:`Define the renewal bet`,description:`Choose one reinvention or sunset track and set checkpoints.`,priority:2,estimatedImpact:`medium`,effortLevel:`m`,category:`product`}],ceremony:{title:`Renewal Summit`,copy:`Pause to honor what got you here, then commit publicly to the next reinvention.`,cues:[`🏔️`,`🔁`]}}];export{t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./recommendations/recommendation-engine.js";import{n as t}from"./recommendations/library-recommender.js";import{n}from"./ceremony/ceremony-designer.js";
@@ -0,0 +1 @@
1
+ import"./types/stages.js";import"./types/axes.js";import"./types/signals.js";import"./types/milestones.js";import"./utils/formatters.js";
@@ -0,0 +1 @@
1
+ (function(e){return e.Sketch=`Sketch`,e.Prototype=`Prototype`,e.Mvp=`MVP`,e.V1=`V1`,e.Ecosystem=`Ecosystem`,e})({}),function(e){return e.Solo=`Solo`,e.TinyTeam=`TinyTeam`,e.FunctionalOrg=`FunctionalOrg`,e.MultiTeam=`MultiTeam`,e.Bureaucratic=`Bureaucratic`,e}({}),function(e){return e.Bootstrapped=`Bootstrapped`,e.PreSeed=`PreSeed`,e.Seed=`Seed`,e.SeriesAorB=`SeriesAorB`,e.LateStage=`LateStage`,e}({});
@@ -0,0 +1 @@
1
+ let e=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}({});e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal;const t={[e.Exploration]:{id:e.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`]},[e.ProblemSolutionFit]:{id:e.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`]},[e.MvpEarlyTraction]:{id:e.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`]},[e.ProductMarketFit]:{id:e.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`]},[e.GrowthScaleUp]:{id:e.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`]},[e.ExpansionPlatform]:{id:e.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`]},[e.MaturityRenewal]:{id:e.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`]}};export{e,t};
@@ -0,0 +1 @@
1
+ import"../types/stages.js";
@@ -0,0 +1 @@
1
+ import"../libs/lifecycle/dist/index.js";import{e}from"../data/library-stage-map.js";const t=new Map(e.map(e=>[e.stage,e.items]));var n=class{mapping;constructor(e){this.mapping=e?.length?new Map(e.map(e=>[e.stage,e.items])):t}recommend(e,t=4){let n=this.mapping.get(e);return n?.length?n.slice(0,t):[]}};export{n};
@@ -0,0 +1 @@
1
+ import{t as e}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import{t}from"../data/stage-playbooks.js";const n=new Map(t.map(e=>[e.stage,{...e,stage:e.stage}]));var r=class{playbooks;constructor(e){this.playbooks=e?.length?new Map(e.map(e=>[e.stage,e])):n}generate(e,t={}){let n=this.playbooks.get(e.stage)??i(e.stage),r=t.limit??3,o=(n.actions??[]).slice(0,r),s=o.length>0?o:a(e,r);return{assessmentId:e.generatedAt,stage:e.stage,actions:s,upcomingMilestones:t.upcomingMilestones??[],ceremony:n.ceremony}}};const i=t=>({stage:t,actions:[],focusAreas:e[t].focusAreas}),a=(t,n)=>(t.focusAreas??e[t.stage].focusAreas).slice(0,n).map((e,n)=>({id:`fallback-${t.stage}-${n}`,stage:t.stage,title:`Advance ${e}`,description:`Identify one task that will improve "${e}" this week.`,priority:n+1,estimatedImpact:`low`,effortLevel:`s`,category:`product`}));export{r};
@@ -0,0 +1 @@
1
+ import{e,n as t,t as n}from"../libs/lifecycle/dist/types/axes.js";import"../libs/lifecycle/dist/index.js";const r={product:e.Sketch,company:n.Solo,capital:t.Bootstrapped};var i=class{options;constructor(e){this.options=e}async collect(e={}){let t={...r,...e.axes??{}},n=[],i=[...e.signals??[]],s={...e.questionnaireAnswers??{}};if(e.metrics&&n.push(e.metrics),this.options.analyticsAdapter){let e=await this.options.analyticsAdapter.fetch();e.axes&&Object.assign(t,e.axes),e.metrics&&n.push(e.metrics),e.signals&&i.push(...e.signals)}if(this.options.questionnaireAdapter){let e=await this.options.questionnaireAdapter.fetch();e.axes&&Object.assign(t,e.axes),e.signals&&i.push(...e.signals),Object.assign(s,e.answers)}if(this.options.intentAdapter){let e=await this.options.intentAdapter.fetch();e.signals&&i.push(...e.signals)}return{axes:t,metrics:a(n),signals:o(i),questionnaireAnswers:Object.keys(s).length?s:void 0}}};const a=e=>e.reduce((e,t)=>(Object.entries(t??{}).forEach(([t,n])=>{n!=null&&(e[t]=n)}),e),{}),o=e=>{let t=new Set;return e.filter(e=>e.id?t.has(e.id)?!1:(t.add(e.id),!0):!0)};export{i};
@@ -0,0 +1 @@
1
+ var e=[{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`]}];export{e};
@@ -0,0 +1 @@
1
+ var e={Exploration:{base:.35,metrics:{activeUsers:{weight:-.3,direction:`lte`,threshold:5},customerCount:{weight:-.2,direction:`lte`,threshold:3},teamSize:{weight:-.1,direction:`lte`,threshold:3}},signalKinds:{qualitative:.4,metric:.1}},ProblemSolutionFit:{base:.4,metrics:{activeUsers:{weight:.2,direction:`gte`,threshold:5},customerCount:{weight:.2,direction:`gte`,threshold:3}},signalKinds:{qualitative:.3,event:.1}},MvpEarlyTraction:{base:.45,metrics:{activeUsers:{weight:.25,direction:`gte`,threshold:25},weeklyActiveUsers:{weight:.25,direction:`gte`,threshold:20},retentionRate:{weight:.2,direction:`gte`,threshold:.25}},signalKinds:{metric:.15,event:.1}},ProductMarketFit:{base:.5,metrics:{retentionRate:{weight:.35,direction:`gte`,threshold:.45},monthlyRecurringRevenue:{weight:.25,direction:`gte`,threshold:1e4},customerCount:{weight:.2,direction:`gte`,threshold:30}},signalKinds:{metric:.15,event:.1}},GrowthScaleUp:{base:.55,metrics:{retentionRate:{weight:.2,direction:`gte`,threshold:.55},monthlyRecurringRevenue:{weight:.3,direction:`gte`,threshold:5e4},teamSize:{weight:.15,direction:`gte`,threshold:15}},signalKinds:{event:.2,metric:.15}},ExpansionPlatform:{base:.6,metrics:{monthlyRecurringRevenue:{weight:.35,direction:`gte`,threshold:15e4},customerCount:{weight:.2,direction:`gte`,threshold:100},teamSize:{weight:.15,direction:`gte`,threshold:40}},signalKinds:{event:.2,milestone:.1}},MaturityRenewal:{base:.6,metrics:{monthlyRecurringRevenue:{weight:.25,direction:`gte`,threshold:25e4},teamSize:{weight:.15,direction:`gte`,threshold:80},burnMultiple:{weight:.2,direction:`lte`,threshold:1.5}},signalKinds:{event:.2,milestone:.15}}};export{e};
@@ -0,0 +1 @@
1
+ import{i as e}from"./collectors/signal-collector.js";import{i as t}from"./scoring/stage-scorer.js";import{t as n}from"./planning/milestone-planner.js";import{n as r}from"./orchestrator/lifecycle-orchestrator.js";
@@ -0,0 +1 @@
1
+ import"./types/axes.js";import"./types/stages.js";import"./types/signals.js";import"./types/milestones.js";import"./utils/formatters.js";
@@ -0,0 +1 @@
1
+ let e=function(e){return e.Sketch=`Sketch`,e.Prototype=`Prototype`,e.Mvp=`MVP`,e.V1=`V1`,e.Ecosystem=`Ecosystem`,e}({}),t=function(e){return e.Solo=`Solo`,e.TinyTeam=`TinyTeam`,e.FunctionalOrg=`FunctionalOrg`,e.MultiTeam=`MultiTeam`,e.Bureaucratic=`Bureaucratic`,e}({}),n=function(e){return e.Bootstrapped=`Bootstrapped`,e.PreSeed=`PreSeed`,e.Seed=`Seed`,e.SeriesAorB=`SeriesAorB`,e.LateStage=`LateStage`,e}({});export{e,n,t};
@@ -0,0 +1 @@
1
+ let e=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}({});e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal;const t={[e.Exploration]:{id:e.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`]},[e.ProblemSolutionFit]:{id:e.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`]},[e.MvpEarlyTraction]:{id:e.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`]},[e.ProductMarketFit]:{id:e.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`]},[e.GrowthScaleUp]:{id:e.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`]},[e.ExpansionPlatform]:{id:e.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`]},[e.MaturityRenewal]:{id:e.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`]}};export{e,t};
@@ -0,0 +1 @@
1
+ import"../types/stages.js";
@@ -0,0 +1 @@
1
+ import{e,t}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import"../collectors/signal-collector.js";import"../scoring/stage-scorer.js";var n=class{collector;scorer;planner;constructor(e){this.collector=e.collector,this.scorer=e.scorer,this.planner=e.milestonePlanner}async run(e){let n=await this.collector.collect(e),a=this.scorer.score({metrics:n.metrics,signals:n.signals}),o=a[0]??r(),s=t[o.stage];return{stage:o.stage,confidence:o.confidence,axes:n.axes,signals:n.signals,metrics:i(n.metrics),gaps:s.focusAreas.slice(0,3),focusAreas:s.focusAreas,scorecard:a,generatedAt:new Date().toISOString()}}getUpcomingMilestones(e,t=[],n=5){return this.planner?this.planner.getUpcoming(e,t,n):[]}};const r=()=>({stage:e.Exploration,score:.3,confidence:.3,supportingSignals:[]}),i=e=>Object.entries(e??{}).reduce((e,[t,n])=>(typeof n==`number`&&(e[t]=n),e),{});export{n};
@@ -0,0 +1 @@
1
+ import{e}from"../data/milestones-catalog.js";var t=class{milestones;constructor(t){this.milestones=t??e}getUpcoming(e,t=[],n=5){let r=new Set(t);return this.milestones.filter(t=>t.stage===e&&!r.has(t.id)).sort((e,t)=>e.priority-t.priority).slice(0,n)}};export{t};
@@ -0,0 +1 @@
1
+ import{e,t}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import{e as n}from"../data/stage-weights.js";const r=n;var i=class{weights;constructor(e=r){this.weights=e}score(t){let n=s(t.signals);return Object.values(e).filter(c).map(r=>{let i=e[r],s=this.weights[i]??{base:.5},c=s.base??.5,l=0,u=Object.keys(s.metrics??{}).length+Object.keys(s.signalKinds??{}).length||1,d=[];s.metrics&&Object.entries(s.metrics).forEach(([e,n])=>{let r=t.metrics[e];r!=null&&(a(r,n)?(c+=n.weight,l+=1,d.push(`metric:${e}`)):c+=n.weight*.25)}),s.signalKinds&&Object.entries(s.signalKinds).forEach(([e,t])=>{(n[e]??0)>0&&typeof t==`number`&&(c+=t,l+=1,d.push(`signal:${e}`))}),c=o(c,0,1.25);let f=o(l/u,.1,1);return{stage:r,score:c,confidence:f,supportingSignals:d}}).sort((e,t)=>t.score===e.score?t.confidence-e.confidence:t.score-e.score)}};const a=(e,t)=>(t.direction??`gte`)===`gte`?e>=t.threshold:e<=t.threshold,o=(e,t,n)=>Math.min(Math.max(e,t),n),s=e=>e.reduce((e,t)=>{let n=t.kind??`unknown`;return e[n]=(e[n]??0)+(t.weight??1),e},{}),c=e=>typeof e==`number`&&e in t;export{i};
@@ -0,0 +1,48 @@
1
+ import { LifecycleEventBridge } from "../events/lifecycle-events.js";
2
+ import * as _lssm_module_lifecycle_advisor0 from "@lssm/module.lifecycle-advisor";
3
+ import { ContractSpecLibraryRecommender, LifecycleCeremonyDesigner, LifecycleRecommendationEngine } from "@lssm/module.lifecycle-advisor";
4
+ import { LifecycleAssessment, LifecycleAssessmentInput, LifecycleRecommendation, LifecycleStage } from "@lssm/lib.lifecycle";
5
+ import { StageSignalCollectorOptions } from "@lssm/module.lifecycle-core";
6
+ import { LifecycleKpiPipeline, LifecyclePipelineEvent } from "@lssm/lib.observability";
7
+
8
+ //#region src/services/assessment-service.d.ts
9
+ interface LifecycleAssessmentRequest extends LifecycleAssessmentInput {
10
+ tenantId?: string;
11
+ completedMilestones?: string[];
12
+ }
13
+ interface LifecycleAssessmentResponse {
14
+ assessment: LifecycleAssessment;
15
+ recommendation: LifecycleRecommendation;
16
+ libraries: ReturnType<ContractSpecLibraryRecommender['recommend']>;
17
+ ceremony?: ReturnType<LifecycleCeremonyDesigner['design']>;
18
+ }
19
+ interface LifecycleAssessmentServiceOptions {
20
+ collector: StageSignalCollectorOptions;
21
+ pipeline?: LifecycleKpiPipeline;
22
+ recommendationEngine?: LifecycleRecommendationEngine;
23
+ libraryRecommender?: ContractSpecLibraryRecommender;
24
+ ceremonyDesigner?: LifecycleCeremonyDesigner;
25
+ eventBridge?: LifecycleEventBridge;
26
+ onPipelineEvent?: (event: LifecyclePipelineEvent) => void;
27
+ }
28
+ declare class LifecycleAssessmentService {
29
+ private readonly orchestrator;
30
+ private readonly recommendationEngine;
31
+ private readonly libraryRecommender;
32
+ private readonly ceremonyDesigner;
33
+ private readonly pipeline;
34
+ private readonly eventBridge?;
35
+ constructor(options: LifecycleAssessmentServiceOptions);
36
+ runAssessment(request: LifecycleAssessmentRequest): Promise<LifecycleAssessmentResponse>;
37
+ getStagePlaybook(stage: LifecycleStage): {
38
+ recommendation: LifecycleRecommendation;
39
+ libraries: _lssm_module_lifecycle_advisor0.LibraryRecommendation[];
40
+ ceremony: {
41
+ title: string;
42
+ copy: string;
43
+ cues: string[];
44
+ } | undefined;
45
+ };
46
+ }
47
+ //#endregion
48
+ export { LifecycleAssessmentRequest, LifecycleAssessmentResponse, LifecycleAssessmentService, LifecycleAssessmentServiceOptions };
@@ -0,0 +1 @@
1
+ import{e,n as t,t as n}from"../libs/lifecycle/dist/types/axes.js";import"../libs/lifecycle/dist/index.js";import{i as r}from"../modules/lifecycle-core/dist/collectors/signal-collector.js";import{i}from"../modules/lifecycle-core/dist/scoring/stage-scorer.js";import{t as a}from"../modules/lifecycle-core/dist/planning/milestone-planner.js";import{n as o}from"../modules/lifecycle-core/dist/orchestrator/lifecycle-orchestrator.js";import"../modules/lifecycle-core/dist/index.js";import{r as s}from"../modules/lifecycle-advisor/dist/recommendations/recommendation-engine.js";import{n as c}from"../modules/lifecycle-advisor/dist/recommendations/library-recommender.js";import{n as l}from"../modules/lifecycle-advisor/dist/ceremony/ceremony-designer.js";import"../modules/lifecycle-advisor/dist/index.js";import{a as u}from"../libs/observability/dist/pipeline/lifecycle-pipeline.js";import"../libs/observability/dist/index.js";import"../events/lifecycle-events.js";var d=class{orchestrator;recommendationEngine;libraryRecommender;ceremonyDesigner;pipeline;eventBridge;constructor(e){this.orchestrator=new o({collector:new r(e.collector),scorer:new i,milestonePlanner:new a}),this.recommendationEngine=e.recommendationEngine??new s,this.libraryRecommender=e.libraryRecommender??new c,this.ceremonyDesigner=e.ceremonyDesigner??new l,this.pipeline=e.pipeline??new u,this.eventBridge=e.eventBridge,e.onPipelineEvent&&this.pipeline.on(e.onPipelineEvent),this.eventBridge&&this.pipeline.on(e=>this.eventBridge?.forward(e))}async runAssessment(e){let t=await this.orchestrator.run(e),n=this.orchestrator.getUpcomingMilestones(t.stage,e.completedMilestones);return this.pipeline.recordAssessment(t,e.tenantId),{assessment:t,recommendation:this.recommendationEngine.generate(t,{upcomingMilestones:n}),libraries:this.libraryRecommender.recommend(t.stage),ceremony:this.ceremonyDesigner.design(t.stage)}}getStagePlaybook(r){return{recommendation:this.recommendationEngine.generate({stage:r,confidence:1,axes:{product:e.Mvp,company:n.TinyTeam,capital:t.Seed},signals:[],gaps:[],focusAreas:[],scorecard:[],generatedAt:new Date().toISOString()},{upcomingMilestones:this.orchestrator.getUpcomingMilestones(r)}),libraries:this.libraryRecommender.recommend(r),ceremony:this.ceremonyDesigner.design(r)}}};export{d as LifecycleAssessmentService};
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@lssm/bundle.lifecycle-managed",
3
+ "version": "0.0.0-canary-20251206160926",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "scripts": {
13
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
14
+ "build": "bun build:bundle && bun build:types",
15
+ "build:bundle": "tsdown",
16
+ "build:types": "tsc --noEmit",
17
+ "dev": "bun build:bundle --watch",
18
+ "clean": "rimraf dist .turbo",
19
+ "lint": "bun lint:fix",
20
+ "lint:fix": "eslint src --fix",
21
+ "lint:check": "eslint src",
22
+ "test": "bun run"
23
+ },
24
+ "dependencies": {
25
+ "@lssm/lib.ai-agent": "workspace:*",
26
+ "@lssm/lib.analytics": "workspace:*",
27
+ "@lssm/lib.lifecycle": "workspace:*",
28
+ "@lssm/lib.observability": "workspace:*",
29
+ "@lssm/module.lifecycle-advisor": "workspace:*",
30
+ "@lssm/module.lifecycle-core": "workspace:*"
31
+ },
32
+ "devDependencies": {
33
+ "@lssm/tool.tsdown": "workspace:*",
34
+ "@lssm/tool.typescript": "workspace:*",
35
+ "tsdown": "^0.17.0",
36
+ "typescript": "^5.9.3"
37
+ },
38
+ "exports": {
39
+ ".": "./dist/index.js",
40
+ "./*": "./*"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public"
44
+ }
45
+ }