@contractspec/bundle.lifecycle-managed 3.7.6 → 3.7.7
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/README.md +45 -44
- package/dist/browser/index.js +130 -130
- package/dist/index.d.ts +2 -2
- package/dist/index.js +130 -130
- package/dist/node/index.js +130 -130
- package/dist/services/assessment-service.d.ts +2 -2
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
1
|
# @contractspec/bundle.lifecycle-managed
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
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).
|
|
7
|
-
|
|
8
|
-
## Modules
|
|
9
|
-
|
|
10
|
-
- `LifecycleAssessmentService` – orchestrates detection, scoring, guidance, metrics, and managed events.
|
|
11
|
-
- `LifecycleAdvisorAgent` – AI spec definition for conversational lifecycle coaching.
|
|
12
|
-
- `LifecycleEventBridge` – helper to broadcast stage changes + assessment telemetry.
|
|
13
|
-
- REST handlers – HTTP-friendly adapters for serving assessments + playbooks.
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
import { LifecycleAssessmentService, createLifecycleHandlers } from '@contractspec/bundle.lifecycle-managed';
|
|
19
|
-
|
|
20
|
-
const service = new LifecycleAssessmentService({
|
|
21
|
-
tenantId: 'tenant_123',
|
|
22
|
-
collectorOptions: {
|
|
23
|
-
analyticsAdapter,
|
|
24
|
-
questionnaireAdapter,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const handlers = createLifecycleHandlers(service);
|
|
29
|
-
|
|
30
|
-
app.post('/lifecycle/assessments', handlers.runAssessment);
|
|
31
|
-
app.get('/lifecycle/playbooks/:stage', handlers.getPlaybook);
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
The bundle stays framework-agnostic: you can mount the handlers on Elysia, Express, Next.js routes, or background jobs.*** End Patch
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
3
|
+
Website: https://contractspec.io
|
|
47
4
|
|
|
5
|
+
**Lifecycle management bundle with analytics and AI advisor.**
|
|
48
6
|
|
|
7
|
+
## What It Provides
|
|
49
8
|
|
|
9
|
+
- **Layer**: bundle.
|
|
10
|
+
- **Consumers**: `examples/lifecycle-cli`.
|
|
11
|
+
- `src/services/` contains business logic services and workflows.
|
|
12
|
+
- Related ContractSpec packages include `@contractspec/lib.ai-agent`, `@contractspec/lib.analytics`, `@contractspec/lib.lifecycle`, `@contractspec/lib.observability`, `@contractspec/module.lifecycle-advisor`, `@contractspec/module.lifecycle-core`, ...
|
|
13
|
+
- `src/services/` contains business logic services and workflows.
|
|
50
14
|
|
|
15
|
+
## Installation
|
|
51
16
|
|
|
17
|
+
`npm install @contractspec/bundle.lifecycle-managed`
|
|
52
18
|
|
|
19
|
+
or
|
|
53
20
|
|
|
21
|
+
`bun add @contractspec/bundle.lifecycle-managed`
|
|
54
22
|
|
|
23
|
+
## Usage
|
|
55
24
|
|
|
25
|
+
Import the root entrypoint from `@contractspec/bundle.lifecycle-managed`, or choose a documented subpath when you only need one part of the package surface.
|
|
56
26
|
|
|
27
|
+
## Architecture
|
|
57
28
|
|
|
29
|
+
- `src/services/` -- assessment service (lifecycle evaluation logic).
|
|
30
|
+
- `src/agents/` -- AI lifecycle advisor agent.
|
|
31
|
+
- `src/events/` -- lifecycle domain events.
|
|
32
|
+
- `src/api/` -- REST handler adapters.
|
|
33
|
+
- `src/__tests__/` -- unit tests.
|
|
34
|
+
- `src/index.ts` is the root public barrel and package entrypoint.
|
|
58
35
|
|
|
36
|
+
## Public Entry Points
|
|
59
37
|
|
|
38
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
60
39
|
|
|
40
|
+
## Local Commands
|
|
61
41
|
|
|
42
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
43
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
44
|
+
- `bun run test` — bun test
|
|
45
|
+
- `bun run lint` — bun lint:fix
|
|
46
|
+
- `bun run lint:check` — biome check .
|
|
47
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
48
|
+
- `bun run typecheck` — tsc --noEmit
|
|
49
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
50
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
51
|
+
- `bun run clean` — rimraf dist .turbo
|
|
52
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
53
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
54
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
62
55
|
|
|
56
|
+
## Recent Updates
|
|
63
57
|
|
|
58
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
59
|
+
- Resolve lint, build, and type errors across nine packages.
|
|
60
|
+
- Add first-class transport, auth, versioning, and BYOK support across all integrations.
|
|
64
61
|
|
|
62
|
+
## Notes
|
|
65
63
|
|
|
64
|
+
- Depends on six workspace packages (`lib.ai-agent`, `lib.analytics`, `lib.lifecycle`, `lib.observability`, `module.lifecycle-advisor`, `module.lifecycle-core`); changes to those APIs propagate here.
|
|
65
|
+
- Events must remain serializable for cross-service consumption.
|
|
66
|
+
- Keep REST handlers thin; domain logic belongs in services.
|
package/dist/browser/index.js
CHANGED
|
@@ -1,133 +1,3 @@
|
|
|
1
|
-
// src/services/assessment-service.ts
|
|
2
|
-
import {
|
|
3
|
-
ProductPhase,
|
|
4
|
-
CompanyPhase,
|
|
5
|
-
CapitalPhase
|
|
6
|
-
} from "@contractspec/lib.lifecycle";
|
|
7
|
-
import {
|
|
8
|
-
LifecycleOrchestrator,
|
|
9
|
-
StageSignalCollector,
|
|
10
|
-
StageScorer,
|
|
11
|
-
LifecycleMilestonePlanner
|
|
12
|
-
} from "@contractspec/module.lifecycle-core";
|
|
13
|
-
import {
|
|
14
|
-
LifecycleRecommendationEngine,
|
|
15
|
-
ContractSpecLibraryRecommender,
|
|
16
|
-
LifecycleCeremonyDesigner
|
|
17
|
-
} from "@contractspec/module.lifecycle-advisor";
|
|
18
|
-
import {
|
|
19
|
-
LifecycleKpiPipeline
|
|
20
|
-
} from "@contractspec/lib.observability";
|
|
21
|
-
|
|
22
|
-
class LifecycleAssessmentService {
|
|
23
|
-
orchestrator;
|
|
24
|
-
recommendationEngine;
|
|
25
|
-
libraryRecommender;
|
|
26
|
-
ceremonyDesigner;
|
|
27
|
-
pipeline;
|
|
28
|
-
eventBridge;
|
|
29
|
-
constructor(options) {
|
|
30
|
-
const collector = new StageSignalCollector(options.collector);
|
|
31
|
-
const scorer = new StageScorer;
|
|
32
|
-
const milestonePlanner = new LifecycleMilestonePlanner;
|
|
33
|
-
this.orchestrator = new LifecycleOrchestrator({
|
|
34
|
-
collector,
|
|
35
|
-
scorer,
|
|
36
|
-
milestonePlanner
|
|
37
|
-
});
|
|
38
|
-
this.recommendationEngine = options.recommendationEngine ?? new LifecycleRecommendationEngine;
|
|
39
|
-
this.libraryRecommender = options.libraryRecommender ?? new ContractSpecLibraryRecommender;
|
|
40
|
-
this.ceremonyDesigner = options.ceremonyDesigner ?? new LifecycleCeremonyDesigner;
|
|
41
|
-
this.pipeline = options.pipeline ?? new LifecycleKpiPipeline;
|
|
42
|
-
this.eventBridge = options.eventBridge;
|
|
43
|
-
if (options.onPipelineEvent) {
|
|
44
|
-
this.pipeline.on(options.onPipelineEvent);
|
|
45
|
-
}
|
|
46
|
-
if (this.eventBridge) {
|
|
47
|
-
this.pipeline.on((event) => this.eventBridge?.forward(event));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async runAssessment(request) {
|
|
51
|
-
const assessment = await this.orchestrator.run(request);
|
|
52
|
-
const upcoming = this.orchestrator.getUpcomingMilestones(assessment.stage, request.completedMilestones);
|
|
53
|
-
this.pipeline.recordAssessment(assessment, request.tenantId);
|
|
54
|
-
const recommendation = this.recommendationEngine.generate(assessment, {
|
|
55
|
-
upcomingMilestones: upcoming
|
|
56
|
-
});
|
|
57
|
-
const libraries = this.libraryRecommender.recommend(assessment.stage);
|
|
58
|
-
const ceremony = this.ceremonyDesigner.design(assessment.stage);
|
|
59
|
-
return {
|
|
60
|
-
assessment,
|
|
61
|
-
recommendation,
|
|
62
|
-
libraries,
|
|
63
|
-
ceremony
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
getStagePlaybook(stage) {
|
|
67
|
-
const recommendation = this.recommendationEngine.generate({
|
|
68
|
-
stage,
|
|
69
|
-
confidence: 1,
|
|
70
|
-
axes: {
|
|
71
|
-
product: ProductPhase.Mvp,
|
|
72
|
-
company: CompanyPhase.TinyTeam,
|
|
73
|
-
capital: CapitalPhase.Seed
|
|
74
|
-
},
|
|
75
|
-
signals: [],
|
|
76
|
-
gaps: [],
|
|
77
|
-
focusAreas: [],
|
|
78
|
-
scorecard: [],
|
|
79
|
-
generatedAt: new Date().toISOString()
|
|
80
|
-
}, { upcomingMilestones: this.orchestrator.getUpcomingMilestones(stage) });
|
|
81
|
-
return {
|
|
82
|
-
recommendation,
|
|
83
|
-
libraries: this.libraryRecommender.recommend(stage),
|
|
84
|
-
ceremony: this.ceremonyDesigner.design(stage)
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// src/events/lifecycle-events.ts
|
|
89
|
-
import { lifecycleEventNames } from "@contractspec/lib.analytics";
|
|
90
|
-
|
|
91
|
-
class LifecycleEventBridge {
|
|
92
|
-
publisher;
|
|
93
|
-
constructor(publisher) {
|
|
94
|
-
this.publisher = publisher;
|
|
95
|
-
}
|
|
96
|
-
forward(event) {
|
|
97
|
-
if (!this.publisher)
|
|
98
|
-
return;
|
|
99
|
-
switch (event.type) {
|
|
100
|
-
case "assessment.recorded":
|
|
101
|
-
this.publisher({
|
|
102
|
-
name: lifecycleEventNames.assessmentRun,
|
|
103
|
-
properties: {
|
|
104
|
-
tenantId: event.payload.tenantId,
|
|
105
|
-
stage: event.payload.stage
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
break;
|
|
109
|
-
case "stage.changed":
|
|
110
|
-
this.publisher({
|
|
111
|
-
name: lifecycleEventNames.stageChanged,
|
|
112
|
-
properties: {
|
|
113
|
-
tenantId: event.payload.tenantId,
|
|
114
|
-
previousStage: event.payload.previousStage,
|
|
115
|
-
nextStage: event.payload.nextStage
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
break;
|
|
119
|
-
case "confidence.low":
|
|
120
|
-
this.publisher({
|
|
121
|
-
name: `${lifecycleEventNames.assessmentRun}.low_confidence`,
|
|
122
|
-
properties: {
|
|
123
|
-
tenantId: event.payload.tenantId,
|
|
124
|
-
confidence: event.payload.confidence
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
1
|
// src/agents/lifecycle-advisor-agent.ts
|
|
132
2
|
import { defineAgent } from "@contractspec/lib.ai-agent/spec";
|
|
133
3
|
var LifecycleAdvisorAgent = defineAgent({
|
|
@@ -209,6 +79,136 @@ var createLifecycleHandlers = (service) => ({
|
|
|
209
79
|
return { status: 200, body: result };
|
|
210
80
|
}
|
|
211
81
|
});
|
|
82
|
+
// src/events/lifecycle-events.ts
|
|
83
|
+
import { lifecycleEventNames } from "@contractspec/lib.analytics";
|
|
84
|
+
|
|
85
|
+
class LifecycleEventBridge {
|
|
86
|
+
publisher;
|
|
87
|
+
constructor(publisher) {
|
|
88
|
+
this.publisher = publisher;
|
|
89
|
+
}
|
|
90
|
+
forward(event) {
|
|
91
|
+
if (!this.publisher)
|
|
92
|
+
return;
|
|
93
|
+
switch (event.type) {
|
|
94
|
+
case "assessment.recorded":
|
|
95
|
+
this.publisher({
|
|
96
|
+
name: lifecycleEventNames.assessmentRun,
|
|
97
|
+
properties: {
|
|
98
|
+
tenantId: event.payload.tenantId,
|
|
99
|
+
stage: event.payload.stage
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
break;
|
|
103
|
+
case "stage.changed":
|
|
104
|
+
this.publisher({
|
|
105
|
+
name: lifecycleEventNames.stageChanged,
|
|
106
|
+
properties: {
|
|
107
|
+
tenantId: event.payload.tenantId,
|
|
108
|
+
previousStage: event.payload.previousStage,
|
|
109
|
+
nextStage: event.payload.nextStage
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
break;
|
|
113
|
+
case "confidence.low":
|
|
114
|
+
this.publisher({
|
|
115
|
+
name: `${lifecycleEventNames.assessmentRun}.low_confidence`,
|
|
116
|
+
properties: {
|
|
117
|
+
tenantId: event.payload.tenantId,
|
|
118
|
+
confidence: event.payload.confidence
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// src/services/assessment-service.ts
|
|
126
|
+
import {
|
|
127
|
+
CapitalPhase,
|
|
128
|
+
CompanyPhase,
|
|
129
|
+
ProductPhase
|
|
130
|
+
} from "@contractspec/lib.lifecycle";
|
|
131
|
+
import {
|
|
132
|
+
LifecycleKpiPipeline
|
|
133
|
+
} from "@contractspec/lib.observability";
|
|
134
|
+
import {
|
|
135
|
+
ContractSpecLibraryRecommender,
|
|
136
|
+
LifecycleCeremonyDesigner,
|
|
137
|
+
LifecycleRecommendationEngine
|
|
138
|
+
} from "@contractspec/module.lifecycle-advisor";
|
|
139
|
+
import {
|
|
140
|
+
LifecycleMilestonePlanner,
|
|
141
|
+
LifecycleOrchestrator,
|
|
142
|
+
StageScorer,
|
|
143
|
+
StageSignalCollector
|
|
144
|
+
} from "@contractspec/module.lifecycle-core";
|
|
145
|
+
|
|
146
|
+
class LifecycleAssessmentService {
|
|
147
|
+
orchestrator;
|
|
148
|
+
recommendationEngine;
|
|
149
|
+
libraryRecommender;
|
|
150
|
+
ceremonyDesigner;
|
|
151
|
+
pipeline;
|
|
152
|
+
eventBridge;
|
|
153
|
+
constructor(options) {
|
|
154
|
+
const collector = new StageSignalCollector(options.collector);
|
|
155
|
+
const scorer = new StageScorer;
|
|
156
|
+
const milestonePlanner = new LifecycleMilestonePlanner;
|
|
157
|
+
this.orchestrator = new LifecycleOrchestrator({
|
|
158
|
+
collector,
|
|
159
|
+
scorer,
|
|
160
|
+
milestonePlanner
|
|
161
|
+
});
|
|
162
|
+
this.recommendationEngine = options.recommendationEngine ?? new LifecycleRecommendationEngine;
|
|
163
|
+
this.libraryRecommender = options.libraryRecommender ?? new ContractSpecLibraryRecommender;
|
|
164
|
+
this.ceremonyDesigner = options.ceremonyDesigner ?? new LifecycleCeremonyDesigner;
|
|
165
|
+
this.pipeline = options.pipeline ?? new LifecycleKpiPipeline;
|
|
166
|
+
this.eventBridge = options.eventBridge;
|
|
167
|
+
if (options.onPipelineEvent) {
|
|
168
|
+
this.pipeline.on(options.onPipelineEvent);
|
|
169
|
+
}
|
|
170
|
+
if (this.eventBridge) {
|
|
171
|
+
this.pipeline.on((event) => this.eventBridge?.forward(event));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async runAssessment(request) {
|
|
175
|
+
const assessment = await this.orchestrator.run(request);
|
|
176
|
+
const upcoming = this.orchestrator.getUpcomingMilestones(assessment.stage, request.completedMilestones);
|
|
177
|
+
this.pipeline.recordAssessment(assessment, request.tenantId);
|
|
178
|
+
const recommendation = this.recommendationEngine.generate(assessment, {
|
|
179
|
+
upcomingMilestones: upcoming
|
|
180
|
+
});
|
|
181
|
+
const libraries = this.libraryRecommender.recommend(assessment.stage);
|
|
182
|
+
const ceremony = this.ceremonyDesigner.design(assessment.stage);
|
|
183
|
+
return {
|
|
184
|
+
assessment,
|
|
185
|
+
recommendation,
|
|
186
|
+
libraries,
|
|
187
|
+
ceremony
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
getStagePlaybook(stage) {
|
|
191
|
+
const recommendation = this.recommendationEngine.generate({
|
|
192
|
+
stage,
|
|
193
|
+
confidence: 1,
|
|
194
|
+
axes: {
|
|
195
|
+
product: ProductPhase.Mvp,
|
|
196
|
+
company: CompanyPhase.TinyTeam,
|
|
197
|
+
capital: CapitalPhase.Seed
|
|
198
|
+
},
|
|
199
|
+
signals: [],
|
|
200
|
+
gaps: [],
|
|
201
|
+
focusAreas: [],
|
|
202
|
+
scorecard: [],
|
|
203
|
+
generatedAt: new Date().toISOString()
|
|
204
|
+
}, { upcomingMilestones: this.orchestrator.getUpcomingMilestones(stage) });
|
|
205
|
+
return {
|
|
206
|
+
recommendation,
|
|
207
|
+
libraries: this.libraryRecommender.recommend(stage),
|
|
208
|
+
ceremony: this.ceremonyDesigner.design(stage)
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
212
|
export {
|
|
213
213
|
createLifecycleHandlers,
|
|
214
214
|
LifecycleEventBridge,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './services/assessment-service';
|
|
2
|
-
export * from './events/lifecycle-events';
|
|
3
1
|
export * from './agents/lifecycle-advisor-agent';
|
|
4
2
|
export * from './api/rest-handlers';
|
|
3
|
+
export * from './events/lifecycle-events';
|
|
4
|
+
export * from './services/assessment-service';
|
package/dist/index.js
CHANGED
|
@@ -1,134 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// src/services/assessment-service.ts
|
|
3
|
-
import {
|
|
4
|
-
ProductPhase,
|
|
5
|
-
CompanyPhase,
|
|
6
|
-
CapitalPhase
|
|
7
|
-
} from "@contractspec/lib.lifecycle";
|
|
8
|
-
import {
|
|
9
|
-
LifecycleOrchestrator,
|
|
10
|
-
StageSignalCollector,
|
|
11
|
-
StageScorer,
|
|
12
|
-
LifecycleMilestonePlanner
|
|
13
|
-
} from "@contractspec/module.lifecycle-core";
|
|
14
|
-
import {
|
|
15
|
-
LifecycleRecommendationEngine,
|
|
16
|
-
ContractSpecLibraryRecommender,
|
|
17
|
-
LifecycleCeremonyDesigner
|
|
18
|
-
} from "@contractspec/module.lifecycle-advisor";
|
|
19
|
-
import {
|
|
20
|
-
LifecycleKpiPipeline
|
|
21
|
-
} from "@contractspec/lib.observability";
|
|
22
|
-
|
|
23
|
-
class LifecycleAssessmentService {
|
|
24
|
-
orchestrator;
|
|
25
|
-
recommendationEngine;
|
|
26
|
-
libraryRecommender;
|
|
27
|
-
ceremonyDesigner;
|
|
28
|
-
pipeline;
|
|
29
|
-
eventBridge;
|
|
30
|
-
constructor(options) {
|
|
31
|
-
const collector = new StageSignalCollector(options.collector);
|
|
32
|
-
const scorer = new StageScorer;
|
|
33
|
-
const milestonePlanner = new LifecycleMilestonePlanner;
|
|
34
|
-
this.orchestrator = new LifecycleOrchestrator({
|
|
35
|
-
collector,
|
|
36
|
-
scorer,
|
|
37
|
-
milestonePlanner
|
|
38
|
-
});
|
|
39
|
-
this.recommendationEngine = options.recommendationEngine ?? new LifecycleRecommendationEngine;
|
|
40
|
-
this.libraryRecommender = options.libraryRecommender ?? new ContractSpecLibraryRecommender;
|
|
41
|
-
this.ceremonyDesigner = options.ceremonyDesigner ?? new LifecycleCeremonyDesigner;
|
|
42
|
-
this.pipeline = options.pipeline ?? new LifecycleKpiPipeline;
|
|
43
|
-
this.eventBridge = options.eventBridge;
|
|
44
|
-
if (options.onPipelineEvent) {
|
|
45
|
-
this.pipeline.on(options.onPipelineEvent);
|
|
46
|
-
}
|
|
47
|
-
if (this.eventBridge) {
|
|
48
|
-
this.pipeline.on((event) => this.eventBridge?.forward(event));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async runAssessment(request) {
|
|
52
|
-
const assessment = await this.orchestrator.run(request);
|
|
53
|
-
const upcoming = this.orchestrator.getUpcomingMilestones(assessment.stage, request.completedMilestones);
|
|
54
|
-
this.pipeline.recordAssessment(assessment, request.tenantId);
|
|
55
|
-
const recommendation = this.recommendationEngine.generate(assessment, {
|
|
56
|
-
upcomingMilestones: upcoming
|
|
57
|
-
});
|
|
58
|
-
const libraries = this.libraryRecommender.recommend(assessment.stage);
|
|
59
|
-
const ceremony = this.ceremonyDesigner.design(assessment.stage);
|
|
60
|
-
return {
|
|
61
|
-
assessment,
|
|
62
|
-
recommendation,
|
|
63
|
-
libraries,
|
|
64
|
-
ceremony
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
getStagePlaybook(stage) {
|
|
68
|
-
const recommendation = this.recommendationEngine.generate({
|
|
69
|
-
stage,
|
|
70
|
-
confidence: 1,
|
|
71
|
-
axes: {
|
|
72
|
-
product: ProductPhase.Mvp,
|
|
73
|
-
company: CompanyPhase.TinyTeam,
|
|
74
|
-
capital: CapitalPhase.Seed
|
|
75
|
-
},
|
|
76
|
-
signals: [],
|
|
77
|
-
gaps: [],
|
|
78
|
-
focusAreas: [],
|
|
79
|
-
scorecard: [],
|
|
80
|
-
generatedAt: new Date().toISOString()
|
|
81
|
-
}, { upcomingMilestones: this.orchestrator.getUpcomingMilestones(stage) });
|
|
82
|
-
return {
|
|
83
|
-
recommendation,
|
|
84
|
-
libraries: this.libraryRecommender.recommend(stage),
|
|
85
|
-
ceremony: this.ceremonyDesigner.design(stage)
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// src/events/lifecycle-events.ts
|
|
90
|
-
import { lifecycleEventNames } from "@contractspec/lib.analytics";
|
|
91
|
-
|
|
92
|
-
class LifecycleEventBridge {
|
|
93
|
-
publisher;
|
|
94
|
-
constructor(publisher) {
|
|
95
|
-
this.publisher = publisher;
|
|
96
|
-
}
|
|
97
|
-
forward(event) {
|
|
98
|
-
if (!this.publisher)
|
|
99
|
-
return;
|
|
100
|
-
switch (event.type) {
|
|
101
|
-
case "assessment.recorded":
|
|
102
|
-
this.publisher({
|
|
103
|
-
name: lifecycleEventNames.assessmentRun,
|
|
104
|
-
properties: {
|
|
105
|
-
tenantId: event.payload.tenantId,
|
|
106
|
-
stage: event.payload.stage
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
break;
|
|
110
|
-
case "stage.changed":
|
|
111
|
-
this.publisher({
|
|
112
|
-
name: lifecycleEventNames.stageChanged,
|
|
113
|
-
properties: {
|
|
114
|
-
tenantId: event.payload.tenantId,
|
|
115
|
-
previousStage: event.payload.previousStage,
|
|
116
|
-
nextStage: event.payload.nextStage
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
break;
|
|
120
|
-
case "confidence.low":
|
|
121
|
-
this.publisher({
|
|
122
|
-
name: `${lifecycleEventNames.assessmentRun}.low_confidence`,
|
|
123
|
-
properties: {
|
|
124
|
-
tenantId: event.payload.tenantId,
|
|
125
|
-
confidence: event.payload.confidence
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
2
|
// src/agents/lifecycle-advisor-agent.ts
|
|
133
3
|
import { defineAgent } from "@contractspec/lib.ai-agent/spec";
|
|
134
4
|
var LifecycleAdvisorAgent = defineAgent({
|
|
@@ -210,6 +80,136 @@ var createLifecycleHandlers = (service) => ({
|
|
|
210
80
|
return { status: 200, body: result };
|
|
211
81
|
}
|
|
212
82
|
});
|
|
83
|
+
// src/events/lifecycle-events.ts
|
|
84
|
+
import { lifecycleEventNames } from "@contractspec/lib.analytics";
|
|
85
|
+
|
|
86
|
+
class LifecycleEventBridge {
|
|
87
|
+
publisher;
|
|
88
|
+
constructor(publisher) {
|
|
89
|
+
this.publisher = publisher;
|
|
90
|
+
}
|
|
91
|
+
forward(event) {
|
|
92
|
+
if (!this.publisher)
|
|
93
|
+
return;
|
|
94
|
+
switch (event.type) {
|
|
95
|
+
case "assessment.recorded":
|
|
96
|
+
this.publisher({
|
|
97
|
+
name: lifecycleEventNames.assessmentRun,
|
|
98
|
+
properties: {
|
|
99
|
+
tenantId: event.payload.tenantId,
|
|
100
|
+
stage: event.payload.stage
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
break;
|
|
104
|
+
case "stage.changed":
|
|
105
|
+
this.publisher({
|
|
106
|
+
name: lifecycleEventNames.stageChanged,
|
|
107
|
+
properties: {
|
|
108
|
+
tenantId: event.payload.tenantId,
|
|
109
|
+
previousStage: event.payload.previousStage,
|
|
110
|
+
nextStage: event.payload.nextStage
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
break;
|
|
114
|
+
case "confidence.low":
|
|
115
|
+
this.publisher({
|
|
116
|
+
name: `${lifecycleEventNames.assessmentRun}.low_confidence`,
|
|
117
|
+
properties: {
|
|
118
|
+
tenantId: event.payload.tenantId,
|
|
119
|
+
confidence: event.payload.confidence
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// src/services/assessment-service.ts
|
|
127
|
+
import {
|
|
128
|
+
CapitalPhase,
|
|
129
|
+
CompanyPhase,
|
|
130
|
+
ProductPhase
|
|
131
|
+
} from "@contractspec/lib.lifecycle";
|
|
132
|
+
import {
|
|
133
|
+
LifecycleKpiPipeline
|
|
134
|
+
} from "@contractspec/lib.observability";
|
|
135
|
+
import {
|
|
136
|
+
ContractSpecLibraryRecommender,
|
|
137
|
+
LifecycleCeremonyDesigner,
|
|
138
|
+
LifecycleRecommendationEngine
|
|
139
|
+
} from "@contractspec/module.lifecycle-advisor";
|
|
140
|
+
import {
|
|
141
|
+
LifecycleMilestonePlanner,
|
|
142
|
+
LifecycleOrchestrator,
|
|
143
|
+
StageScorer,
|
|
144
|
+
StageSignalCollector
|
|
145
|
+
} from "@contractspec/module.lifecycle-core";
|
|
146
|
+
|
|
147
|
+
class LifecycleAssessmentService {
|
|
148
|
+
orchestrator;
|
|
149
|
+
recommendationEngine;
|
|
150
|
+
libraryRecommender;
|
|
151
|
+
ceremonyDesigner;
|
|
152
|
+
pipeline;
|
|
153
|
+
eventBridge;
|
|
154
|
+
constructor(options) {
|
|
155
|
+
const collector = new StageSignalCollector(options.collector);
|
|
156
|
+
const scorer = new StageScorer;
|
|
157
|
+
const milestonePlanner = new LifecycleMilestonePlanner;
|
|
158
|
+
this.orchestrator = new LifecycleOrchestrator({
|
|
159
|
+
collector,
|
|
160
|
+
scorer,
|
|
161
|
+
milestonePlanner
|
|
162
|
+
});
|
|
163
|
+
this.recommendationEngine = options.recommendationEngine ?? new LifecycleRecommendationEngine;
|
|
164
|
+
this.libraryRecommender = options.libraryRecommender ?? new ContractSpecLibraryRecommender;
|
|
165
|
+
this.ceremonyDesigner = options.ceremonyDesigner ?? new LifecycleCeremonyDesigner;
|
|
166
|
+
this.pipeline = options.pipeline ?? new LifecycleKpiPipeline;
|
|
167
|
+
this.eventBridge = options.eventBridge;
|
|
168
|
+
if (options.onPipelineEvent) {
|
|
169
|
+
this.pipeline.on(options.onPipelineEvent);
|
|
170
|
+
}
|
|
171
|
+
if (this.eventBridge) {
|
|
172
|
+
this.pipeline.on((event) => this.eventBridge?.forward(event));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async runAssessment(request) {
|
|
176
|
+
const assessment = await this.orchestrator.run(request);
|
|
177
|
+
const upcoming = this.orchestrator.getUpcomingMilestones(assessment.stage, request.completedMilestones);
|
|
178
|
+
this.pipeline.recordAssessment(assessment, request.tenantId);
|
|
179
|
+
const recommendation = this.recommendationEngine.generate(assessment, {
|
|
180
|
+
upcomingMilestones: upcoming
|
|
181
|
+
});
|
|
182
|
+
const libraries = this.libraryRecommender.recommend(assessment.stage);
|
|
183
|
+
const ceremony = this.ceremonyDesigner.design(assessment.stage);
|
|
184
|
+
return {
|
|
185
|
+
assessment,
|
|
186
|
+
recommendation,
|
|
187
|
+
libraries,
|
|
188
|
+
ceremony
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
getStagePlaybook(stage) {
|
|
192
|
+
const recommendation = this.recommendationEngine.generate({
|
|
193
|
+
stage,
|
|
194
|
+
confidence: 1,
|
|
195
|
+
axes: {
|
|
196
|
+
product: ProductPhase.Mvp,
|
|
197
|
+
company: CompanyPhase.TinyTeam,
|
|
198
|
+
capital: CapitalPhase.Seed
|
|
199
|
+
},
|
|
200
|
+
signals: [],
|
|
201
|
+
gaps: [],
|
|
202
|
+
focusAreas: [],
|
|
203
|
+
scorecard: [],
|
|
204
|
+
generatedAt: new Date().toISOString()
|
|
205
|
+
}, { upcomingMilestones: this.orchestrator.getUpcomingMilestones(stage) });
|
|
206
|
+
return {
|
|
207
|
+
recommendation,
|
|
208
|
+
libraries: this.libraryRecommender.recommend(stage),
|
|
209
|
+
ceremony: this.ceremonyDesigner.design(stage)
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
213
|
export {
|
|
214
214
|
createLifecycleHandlers,
|
|
215
215
|
LifecycleEventBridge,
|
package/dist/node/index.js
CHANGED
|
@@ -1,133 +1,3 @@
|
|
|
1
|
-
// src/services/assessment-service.ts
|
|
2
|
-
import {
|
|
3
|
-
ProductPhase,
|
|
4
|
-
CompanyPhase,
|
|
5
|
-
CapitalPhase
|
|
6
|
-
} from "@contractspec/lib.lifecycle";
|
|
7
|
-
import {
|
|
8
|
-
LifecycleOrchestrator,
|
|
9
|
-
StageSignalCollector,
|
|
10
|
-
StageScorer,
|
|
11
|
-
LifecycleMilestonePlanner
|
|
12
|
-
} from "@contractspec/module.lifecycle-core";
|
|
13
|
-
import {
|
|
14
|
-
LifecycleRecommendationEngine,
|
|
15
|
-
ContractSpecLibraryRecommender,
|
|
16
|
-
LifecycleCeremonyDesigner
|
|
17
|
-
} from "@contractspec/module.lifecycle-advisor";
|
|
18
|
-
import {
|
|
19
|
-
LifecycleKpiPipeline
|
|
20
|
-
} from "@contractspec/lib.observability";
|
|
21
|
-
|
|
22
|
-
class LifecycleAssessmentService {
|
|
23
|
-
orchestrator;
|
|
24
|
-
recommendationEngine;
|
|
25
|
-
libraryRecommender;
|
|
26
|
-
ceremonyDesigner;
|
|
27
|
-
pipeline;
|
|
28
|
-
eventBridge;
|
|
29
|
-
constructor(options) {
|
|
30
|
-
const collector = new StageSignalCollector(options.collector);
|
|
31
|
-
const scorer = new StageScorer;
|
|
32
|
-
const milestonePlanner = new LifecycleMilestonePlanner;
|
|
33
|
-
this.orchestrator = new LifecycleOrchestrator({
|
|
34
|
-
collector,
|
|
35
|
-
scorer,
|
|
36
|
-
milestonePlanner
|
|
37
|
-
});
|
|
38
|
-
this.recommendationEngine = options.recommendationEngine ?? new LifecycleRecommendationEngine;
|
|
39
|
-
this.libraryRecommender = options.libraryRecommender ?? new ContractSpecLibraryRecommender;
|
|
40
|
-
this.ceremonyDesigner = options.ceremonyDesigner ?? new LifecycleCeremonyDesigner;
|
|
41
|
-
this.pipeline = options.pipeline ?? new LifecycleKpiPipeline;
|
|
42
|
-
this.eventBridge = options.eventBridge;
|
|
43
|
-
if (options.onPipelineEvent) {
|
|
44
|
-
this.pipeline.on(options.onPipelineEvent);
|
|
45
|
-
}
|
|
46
|
-
if (this.eventBridge) {
|
|
47
|
-
this.pipeline.on((event) => this.eventBridge?.forward(event));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async runAssessment(request) {
|
|
51
|
-
const assessment = await this.orchestrator.run(request);
|
|
52
|
-
const upcoming = this.orchestrator.getUpcomingMilestones(assessment.stage, request.completedMilestones);
|
|
53
|
-
this.pipeline.recordAssessment(assessment, request.tenantId);
|
|
54
|
-
const recommendation = this.recommendationEngine.generate(assessment, {
|
|
55
|
-
upcomingMilestones: upcoming
|
|
56
|
-
});
|
|
57
|
-
const libraries = this.libraryRecommender.recommend(assessment.stage);
|
|
58
|
-
const ceremony = this.ceremonyDesigner.design(assessment.stage);
|
|
59
|
-
return {
|
|
60
|
-
assessment,
|
|
61
|
-
recommendation,
|
|
62
|
-
libraries,
|
|
63
|
-
ceremony
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
getStagePlaybook(stage) {
|
|
67
|
-
const recommendation = this.recommendationEngine.generate({
|
|
68
|
-
stage,
|
|
69
|
-
confidence: 1,
|
|
70
|
-
axes: {
|
|
71
|
-
product: ProductPhase.Mvp,
|
|
72
|
-
company: CompanyPhase.TinyTeam,
|
|
73
|
-
capital: CapitalPhase.Seed
|
|
74
|
-
},
|
|
75
|
-
signals: [],
|
|
76
|
-
gaps: [],
|
|
77
|
-
focusAreas: [],
|
|
78
|
-
scorecard: [],
|
|
79
|
-
generatedAt: new Date().toISOString()
|
|
80
|
-
}, { upcomingMilestones: this.orchestrator.getUpcomingMilestones(stage) });
|
|
81
|
-
return {
|
|
82
|
-
recommendation,
|
|
83
|
-
libraries: this.libraryRecommender.recommend(stage),
|
|
84
|
-
ceremony: this.ceremonyDesigner.design(stage)
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// src/events/lifecycle-events.ts
|
|
89
|
-
import { lifecycleEventNames } from "@contractspec/lib.analytics";
|
|
90
|
-
|
|
91
|
-
class LifecycleEventBridge {
|
|
92
|
-
publisher;
|
|
93
|
-
constructor(publisher) {
|
|
94
|
-
this.publisher = publisher;
|
|
95
|
-
}
|
|
96
|
-
forward(event) {
|
|
97
|
-
if (!this.publisher)
|
|
98
|
-
return;
|
|
99
|
-
switch (event.type) {
|
|
100
|
-
case "assessment.recorded":
|
|
101
|
-
this.publisher({
|
|
102
|
-
name: lifecycleEventNames.assessmentRun,
|
|
103
|
-
properties: {
|
|
104
|
-
tenantId: event.payload.tenantId,
|
|
105
|
-
stage: event.payload.stage
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
break;
|
|
109
|
-
case "stage.changed":
|
|
110
|
-
this.publisher({
|
|
111
|
-
name: lifecycleEventNames.stageChanged,
|
|
112
|
-
properties: {
|
|
113
|
-
tenantId: event.payload.tenantId,
|
|
114
|
-
previousStage: event.payload.previousStage,
|
|
115
|
-
nextStage: event.payload.nextStage
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
break;
|
|
119
|
-
case "confidence.low":
|
|
120
|
-
this.publisher({
|
|
121
|
-
name: `${lifecycleEventNames.assessmentRun}.low_confidence`,
|
|
122
|
-
properties: {
|
|
123
|
-
tenantId: event.payload.tenantId,
|
|
124
|
-
confidence: event.payload.confidence
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
1
|
// src/agents/lifecycle-advisor-agent.ts
|
|
132
2
|
import { defineAgent } from "@contractspec/lib.ai-agent/spec";
|
|
133
3
|
var LifecycleAdvisorAgent = defineAgent({
|
|
@@ -209,6 +79,136 @@ var createLifecycleHandlers = (service) => ({
|
|
|
209
79
|
return { status: 200, body: result };
|
|
210
80
|
}
|
|
211
81
|
});
|
|
82
|
+
// src/events/lifecycle-events.ts
|
|
83
|
+
import { lifecycleEventNames } from "@contractspec/lib.analytics";
|
|
84
|
+
|
|
85
|
+
class LifecycleEventBridge {
|
|
86
|
+
publisher;
|
|
87
|
+
constructor(publisher) {
|
|
88
|
+
this.publisher = publisher;
|
|
89
|
+
}
|
|
90
|
+
forward(event) {
|
|
91
|
+
if (!this.publisher)
|
|
92
|
+
return;
|
|
93
|
+
switch (event.type) {
|
|
94
|
+
case "assessment.recorded":
|
|
95
|
+
this.publisher({
|
|
96
|
+
name: lifecycleEventNames.assessmentRun,
|
|
97
|
+
properties: {
|
|
98
|
+
tenantId: event.payload.tenantId,
|
|
99
|
+
stage: event.payload.stage
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
break;
|
|
103
|
+
case "stage.changed":
|
|
104
|
+
this.publisher({
|
|
105
|
+
name: lifecycleEventNames.stageChanged,
|
|
106
|
+
properties: {
|
|
107
|
+
tenantId: event.payload.tenantId,
|
|
108
|
+
previousStage: event.payload.previousStage,
|
|
109
|
+
nextStage: event.payload.nextStage
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
break;
|
|
113
|
+
case "confidence.low":
|
|
114
|
+
this.publisher({
|
|
115
|
+
name: `${lifecycleEventNames.assessmentRun}.low_confidence`,
|
|
116
|
+
properties: {
|
|
117
|
+
tenantId: event.payload.tenantId,
|
|
118
|
+
confidence: event.payload.confidence
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// src/services/assessment-service.ts
|
|
126
|
+
import {
|
|
127
|
+
CapitalPhase,
|
|
128
|
+
CompanyPhase,
|
|
129
|
+
ProductPhase
|
|
130
|
+
} from "@contractspec/lib.lifecycle";
|
|
131
|
+
import {
|
|
132
|
+
LifecycleKpiPipeline
|
|
133
|
+
} from "@contractspec/lib.observability";
|
|
134
|
+
import {
|
|
135
|
+
ContractSpecLibraryRecommender,
|
|
136
|
+
LifecycleCeremonyDesigner,
|
|
137
|
+
LifecycleRecommendationEngine
|
|
138
|
+
} from "@contractspec/module.lifecycle-advisor";
|
|
139
|
+
import {
|
|
140
|
+
LifecycleMilestonePlanner,
|
|
141
|
+
LifecycleOrchestrator,
|
|
142
|
+
StageScorer,
|
|
143
|
+
StageSignalCollector
|
|
144
|
+
} from "@contractspec/module.lifecycle-core";
|
|
145
|
+
|
|
146
|
+
class LifecycleAssessmentService {
|
|
147
|
+
orchestrator;
|
|
148
|
+
recommendationEngine;
|
|
149
|
+
libraryRecommender;
|
|
150
|
+
ceremonyDesigner;
|
|
151
|
+
pipeline;
|
|
152
|
+
eventBridge;
|
|
153
|
+
constructor(options) {
|
|
154
|
+
const collector = new StageSignalCollector(options.collector);
|
|
155
|
+
const scorer = new StageScorer;
|
|
156
|
+
const milestonePlanner = new LifecycleMilestonePlanner;
|
|
157
|
+
this.orchestrator = new LifecycleOrchestrator({
|
|
158
|
+
collector,
|
|
159
|
+
scorer,
|
|
160
|
+
milestonePlanner
|
|
161
|
+
});
|
|
162
|
+
this.recommendationEngine = options.recommendationEngine ?? new LifecycleRecommendationEngine;
|
|
163
|
+
this.libraryRecommender = options.libraryRecommender ?? new ContractSpecLibraryRecommender;
|
|
164
|
+
this.ceremonyDesigner = options.ceremonyDesigner ?? new LifecycleCeremonyDesigner;
|
|
165
|
+
this.pipeline = options.pipeline ?? new LifecycleKpiPipeline;
|
|
166
|
+
this.eventBridge = options.eventBridge;
|
|
167
|
+
if (options.onPipelineEvent) {
|
|
168
|
+
this.pipeline.on(options.onPipelineEvent);
|
|
169
|
+
}
|
|
170
|
+
if (this.eventBridge) {
|
|
171
|
+
this.pipeline.on((event) => this.eventBridge?.forward(event));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async runAssessment(request) {
|
|
175
|
+
const assessment = await this.orchestrator.run(request);
|
|
176
|
+
const upcoming = this.orchestrator.getUpcomingMilestones(assessment.stage, request.completedMilestones);
|
|
177
|
+
this.pipeline.recordAssessment(assessment, request.tenantId);
|
|
178
|
+
const recommendation = this.recommendationEngine.generate(assessment, {
|
|
179
|
+
upcomingMilestones: upcoming
|
|
180
|
+
});
|
|
181
|
+
const libraries = this.libraryRecommender.recommend(assessment.stage);
|
|
182
|
+
const ceremony = this.ceremonyDesigner.design(assessment.stage);
|
|
183
|
+
return {
|
|
184
|
+
assessment,
|
|
185
|
+
recommendation,
|
|
186
|
+
libraries,
|
|
187
|
+
ceremony
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
getStagePlaybook(stage) {
|
|
191
|
+
const recommendation = this.recommendationEngine.generate({
|
|
192
|
+
stage,
|
|
193
|
+
confidence: 1,
|
|
194
|
+
axes: {
|
|
195
|
+
product: ProductPhase.Mvp,
|
|
196
|
+
company: CompanyPhase.TinyTeam,
|
|
197
|
+
capital: CapitalPhase.Seed
|
|
198
|
+
},
|
|
199
|
+
signals: [],
|
|
200
|
+
gaps: [],
|
|
201
|
+
focusAreas: [],
|
|
202
|
+
scorecard: [],
|
|
203
|
+
generatedAt: new Date().toISOString()
|
|
204
|
+
}, { upcomingMilestones: this.orchestrator.getUpcomingMilestones(stage) });
|
|
205
|
+
return {
|
|
206
|
+
recommendation,
|
|
207
|
+
libraries: this.libraryRecommender.recommend(stage),
|
|
208
|
+
ceremony: this.ceremonyDesigner.design(stage)
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
212
|
export {
|
|
213
213
|
createLifecycleHandlers,
|
|
214
214
|
LifecycleEventBridge,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LifecycleAssessment, LifecycleAssessmentInput, LifecycleRecommendation, LifecycleStage } from '@contractspec/lib.lifecycle';
|
|
2
|
-
import { type StageSignalCollectorOptions } from '@contractspec/module.lifecycle-core';
|
|
3
|
-
import { LifecycleRecommendationEngine, ContractSpecLibraryRecommender, LifecycleCeremonyDesigner } from '@contractspec/module.lifecycle-advisor';
|
|
4
2
|
import { LifecycleKpiPipeline, type LifecyclePipelineEvent } from '@contractspec/lib.observability';
|
|
3
|
+
import { ContractSpecLibraryRecommender, LifecycleCeremonyDesigner, LifecycleRecommendationEngine } from '@contractspec/module.lifecycle-advisor';
|
|
4
|
+
import { type StageSignalCollectorOptions } from '@contractspec/module.lifecycle-core';
|
|
5
5
|
import { LifecycleEventBridge } from '../events/lifecycle-events';
|
|
6
6
|
export interface LifecycleAssessmentRequest extends LifecycleAssessmentInput {
|
|
7
7
|
tenantId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.lifecycle-managed",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"description": "Lifecycle management bundle with analytics and AI advisor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"dev": "contractspec-bun-build dev",
|
|
26
26
|
"clean": "rimraf dist .turbo",
|
|
27
27
|
"lint": "bun lint:fix",
|
|
28
|
-
"lint:fix": "
|
|
29
|
-
"lint:check": "
|
|
28
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
29
|
+
"lint:check": "biome check .",
|
|
30
30
|
"test": "bun test",
|
|
31
31
|
"prebuild": "contractspec-bun-build prebuild",
|
|
32
32
|
"typecheck": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@contractspec/lib.ai-agent": "7.0.
|
|
36
|
-
"@contractspec/lib.analytics": "3.7.
|
|
37
|
-
"@contractspec/lib.lifecycle": "3.7.
|
|
38
|
-
"@contractspec/lib.observability": "3.7.
|
|
39
|
-
"@contractspec/module.lifecycle-advisor": "3.7.
|
|
40
|
-
"@contractspec/module.lifecycle-core": "3.7.
|
|
35
|
+
"@contractspec/lib.ai-agent": "7.0.7",
|
|
36
|
+
"@contractspec/lib.analytics": "3.7.7",
|
|
37
|
+
"@contractspec/lib.lifecycle": "3.7.7",
|
|
38
|
+
"@contractspec/lib.observability": "3.7.7",
|
|
39
|
+
"@contractspec/module.lifecycle-advisor": "3.7.7",
|
|
40
|
+
"@contractspec/module.lifecycle-core": "3.7.7"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@contractspec/tool.typescript": "3.7.6",
|