@contractspec/module.lifecycle-core 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +6 -2
- package/dist/i18n/catalogs/en.d.ts +6 -0
- package/dist/i18n/catalogs/es.d.ts +6 -0
- package/dist/i18n/catalogs/fr.d.ts +6 -0
- package/dist/i18n/catalogs/index.d.ts +8 -0
- package/dist/i18n/i18n.test.d.ts +1 -0
- package/dist/i18n/index.d.ts +14 -0
- package/dist/i18n/keys.d.ts +72 -0
- package/dist/i18n/locale.d.ts +8 -0
- package/dist/i18n/messages.d.ts +14 -0
- package/dist/index.js +6 -2
- package/dist/node/index.js +6 -2
- package/dist/orchestrator/lifecycle-orchestrator.d.ts +3 -0
- package/package.json +5 -4
package/dist/browser/index.js
CHANGED
|
@@ -269,17 +269,20 @@ var isStageValue = (value) => typeof value === "number" && (value in LIFECYCLE_S
|
|
|
269
269
|
// src/orchestrator/lifecycle-orchestrator.ts
|
|
270
270
|
import {
|
|
271
271
|
LIFECYCLE_STAGE_META as LIFECYCLE_STAGE_META2,
|
|
272
|
-
LifecycleStage as LifecycleStage2
|
|
272
|
+
LifecycleStage as LifecycleStage2,
|
|
273
|
+
getLocalizedStageMeta
|
|
273
274
|
} from "@contractspec/lib.lifecycle";
|
|
274
275
|
|
|
275
276
|
class LifecycleOrchestrator {
|
|
276
277
|
collector;
|
|
277
278
|
scorer;
|
|
278
279
|
planner;
|
|
280
|
+
locale;
|
|
279
281
|
constructor(options) {
|
|
280
282
|
this.collector = options.collector;
|
|
281
283
|
this.scorer = options.scorer;
|
|
282
284
|
this.planner = options.milestonePlanner;
|
|
285
|
+
this.locale = options.locale;
|
|
283
286
|
}
|
|
284
287
|
async run(input) {
|
|
285
288
|
const collected = await this.collector.collect(input);
|
|
@@ -288,7 +291,8 @@ class LifecycleOrchestrator {
|
|
|
288
291
|
signals: collected.signals
|
|
289
292
|
});
|
|
290
293
|
const top = scorecard[0] ?? fallbackScore();
|
|
291
|
-
const
|
|
294
|
+
const stageMeta = this.locale ? getLocalizedStageMeta(this.locale) : LIFECYCLE_STAGE_META2;
|
|
295
|
+
const meta = stageMeta[top.stage];
|
|
292
296
|
return {
|
|
293
297
|
stage: top.stage,
|
|
294
298
|
confidence: top.confidence,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization (i18n) module for @contractspec/module.lifecycle-core.
|
|
3
|
+
*
|
|
4
|
+
* @module i18n
|
|
5
|
+
*/
|
|
6
|
+
export { createLifecycleCoreI18n, getDefaultI18n, resetI18nRegistry, } from './messages';
|
|
7
|
+
export type { LifecycleCoreI18n } from './messages';
|
|
8
|
+
export { resolveLocale, isSupportedLocale, DEFAULT_LOCALE, SUPPORTED_LOCALES, } from './locale';
|
|
9
|
+
export type { SupportedLocale } from './locale';
|
|
10
|
+
export { I18N_KEYS, MILESTONE_KEYS } from './keys';
|
|
11
|
+
export type { LifecycleCoreMessageKey } from './keys';
|
|
12
|
+
export { enMessages } from './catalogs/en';
|
|
13
|
+
export { frMessages } from './catalogs/fr';
|
|
14
|
+
export { esMessages } from './catalogs/es';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed message keys for the lifecycle-core i18n system.
|
|
3
|
+
*
|
|
4
|
+
* All translatable strings in the module are referenced by these keys.
|
|
5
|
+
* Organized by domain: milestone (titles, descriptions, action items).
|
|
6
|
+
*
|
|
7
|
+
* @module i18n/keys
|
|
8
|
+
*/
|
|
9
|
+
export declare const MILESTONE_KEYS: {
|
|
10
|
+
readonly 'milestone.stage0ProblemStatement.title': "milestone.stage0ProblemStatement.title";
|
|
11
|
+
readonly 'milestone.stage0ProblemStatement.description': "milestone.stage0ProblemStatement.description";
|
|
12
|
+
readonly 'milestone.stage0ProblemStatement.action.0': "milestone.stage0ProblemStatement.action.0";
|
|
13
|
+
readonly 'milestone.stage0ProblemStatement.action.1': "milestone.stage0ProblemStatement.action.1";
|
|
14
|
+
readonly 'milestone.stage1PrototypeLoop.title': "milestone.stage1PrototypeLoop.title";
|
|
15
|
+
readonly 'milestone.stage1PrototypeLoop.description': "milestone.stage1PrototypeLoop.description";
|
|
16
|
+
readonly 'milestone.stage1PrototypeLoop.action.0': "milestone.stage1PrototypeLoop.action.0";
|
|
17
|
+
readonly 'milestone.stage1PrototypeLoop.action.1': "milestone.stage1PrototypeLoop.action.1";
|
|
18
|
+
readonly 'milestone.stage2Activation.title': "milestone.stage2Activation.title";
|
|
19
|
+
readonly 'milestone.stage2Activation.description': "milestone.stage2Activation.description";
|
|
20
|
+
readonly 'milestone.stage2Activation.action.0': "milestone.stage2Activation.action.0";
|
|
21
|
+
readonly 'milestone.stage2Activation.action.1': "milestone.stage2Activation.action.1";
|
|
22
|
+
readonly 'milestone.stage3RetentionNarrative.title': "milestone.stage3RetentionNarrative.title";
|
|
23
|
+
readonly 'milestone.stage3RetentionNarrative.description': "milestone.stage3RetentionNarrative.description";
|
|
24
|
+
readonly 'milestone.stage3RetentionNarrative.action.0': "milestone.stage3RetentionNarrative.action.0";
|
|
25
|
+
readonly 'milestone.stage3RetentionNarrative.action.1': "milestone.stage3RetentionNarrative.action.1";
|
|
26
|
+
readonly 'milestone.stage4GrowthLoop.title': "milestone.stage4GrowthLoop.title";
|
|
27
|
+
readonly 'milestone.stage4GrowthLoop.description': "milestone.stage4GrowthLoop.description";
|
|
28
|
+
readonly 'milestone.stage4GrowthLoop.action.0': "milestone.stage4GrowthLoop.action.0";
|
|
29
|
+
readonly 'milestone.stage4GrowthLoop.action.1': "milestone.stage4GrowthLoop.action.1";
|
|
30
|
+
readonly 'milestone.stage4GrowthLoop.action.2': "milestone.stage4GrowthLoop.action.2";
|
|
31
|
+
readonly 'milestone.stage5PlatformBlueprint.title': "milestone.stage5PlatformBlueprint.title";
|
|
32
|
+
readonly 'milestone.stage5PlatformBlueprint.description': "milestone.stage5PlatformBlueprint.description";
|
|
33
|
+
readonly 'milestone.stage5PlatformBlueprint.action.0': "milestone.stage5PlatformBlueprint.action.0";
|
|
34
|
+
readonly 'milestone.stage5PlatformBlueprint.action.1': "milestone.stage5PlatformBlueprint.action.1";
|
|
35
|
+
readonly 'milestone.stage6RenewalOps.title': "milestone.stage6RenewalOps.title";
|
|
36
|
+
readonly 'milestone.stage6RenewalOps.description': "milestone.stage6RenewalOps.description";
|
|
37
|
+
readonly 'milestone.stage6RenewalOps.action.0': "milestone.stage6RenewalOps.action.0";
|
|
38
|
+
readonly 'milestone.stage6RenewalOps.action.1': "milestone.stage6RenewalOps.action.1";
|
|
39
|
+
};
|
|
40
|
+
export declare const I18N_KEYS: {
|
|
41
|
+
readonly 'milestone.stage0ProblemStatement.title': "milestone.stage0ProblemStatement.title";
|
|
42
|
+
readonly 'milestone.stage0ProblemStatement.description': "milestone.stage0ProblemStatement.description";
|
|
43
|
+
readonly 'milestone.stage0ProblemStatement.action.0': "milestone.stage0ProblemStatement.action.0";
|
|
44
|
+
readonly 'milestone.stage0ProblemStatement.action.1': "milestone.stage0ProblemStatement.action.1";
|
|
45
|
+
readonly 'milestone.stage1PrototypeLoop.title': "milestone.stage1PrototypeLoop.title";
|
|
46
|
+
readonly 'milestone.stage1PrototypeLoop.description': "milestone.stage1PrototypeLoop.description";
|
|
47
|
+
readonly 'milestone.stage1PrototypeLoop.action.0': "milestone.stage1PrototypeLoop.action.0";
|
|
48
|
+
readonly 'milestone.stage1PrototypeLoop.action.1': "milestone.stage1PrototypeLoop.action.1";
|
|
49
|
+
readonly 'milestone.stage2Activation.title': "milestone.stage2Activation.title";
|
|
50
|
+
readonly 'milestone.stage2Activation.description': "milestone.stage2Activation.description";
|
|
51
|
+
readonly 'milestone.stage2Activation.action.0': "milestone.stage2Activation.action.0";
|
|
52
|
+
readonly 'milestone.stage2Activation.action.1': "milestone.stage2Activation.action.1";
|
|
53
|
+
readonly 'milestone.stage3RetentionNarrative.title': "milestone.stage3RetentionNarrative.title";
|
|
54
|
+
readonly 'milestone.stage3RetentionNarrative.description': "milestone.stage3RetentionNarrative.description";
|
|
55
|
+
readonly 'milestone.stage3RetentionNarrative.action.0': "milestone.stage3RetentionNarrative.action.0";
|
|
56
|
+
readonly 'milestone.stage3RetentionNarrative.action.1': "milestone.stage3RetentionNarrative.action.1";
|
|
57
|
+
readonly 'milestone.stage4GrowthLoop.title': "milestone.stage4GrowthLoop.title";
|
|
58
|
+
readonly 'milestone.stage4GrowthLoop.description': "milestone.stage4GrowthLoop.description";
|
|
59
|
+
readonly 'milestone.stage4GrowthLoop.action.0': "milestone.stage4GrowthLoop.action.0";
|
|
60
|
+
readonly 'milestone.stage4GrowthLoop.action.1': "milestone.stage4GrowthLoop.action.1";
|
|
61
|
+
readonly 'milestone.stage4GrowthLoop.action.2': "milestone.stage4GrowthLoop.action.2";
|
|
62
|
+
readonly 'milestone.stage5PlatformBlueprint.title': "milestone.stage5PlatformBlueprint.title";
|
|
63
|
+
readonly 'milestone.stage5PlatformBlueprint.description': "milestone.stage5PlatformBlueprint.description";
|
|
64
|
+
readonly 'milestone.stage5PlatformBlueprint.action.0': "milestone.stage5PlatformBlueprint.action.0";
|
|
65
|
+
readonly 'milestone.stage5PlatformBlueprint.action.1': "milestone.stage5PlatformBlueprint.action.1";
|
|
66
|
+
readonly 'milestone.stage6RenewalOps.title': "milestone.stage6RenewalOps.title";
|
|
67
|
+
readonly 'milestone.stage6RenewalOps.description': "milestone.stage6RenewalOps.description";
|
|
68
|
+
readonly 'milestone.stage6RenewalOps.action.0': "milestone.stage6RenewalOps.action.0";
|
|
69
|
+
readonly 'milestone.stage6RenewalOps.action.1': "milestone.stage6RenewalOps.action.1";
|
|
70
|
+
};
|
|
71
|
+
/** Union type of all valid lifecycle-core i18n keys */
|
|
72
|
+
export type LifecycleCoreMessageKey = keyof typeof I18N_KEYS;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale utilities for the lifecycle-core package.
|
|
3
|
+
*
|
|
4
|
+
* Re-exported from the shared i18n factory in contracts-spec.
|
|
5
|
+
*
|
|
6
|
+
* @module i18n/locale
|
|
7
|
+
*/
|
|
8
|
+
export { DEFAULT_LOCALE, SUPPORTED_LOCALES, resolveLocale, isSupportedLocale, type SupportedLocale, } from '@contractspec/lib.contracts-spec/translations';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation helper for the lifecycle-core package.
|
|
3
|
+
* @module i18n/messages
|
|
4
|
+
*/
|
|
5
|
+
import { type I18nInstance } from '@contractspec/lib.contracts-spec/translations';
|
|
6
|
+
import type { LifecycleCoreMessageKey } from './keys';
|
|
7
|
+
/** I18n instance type for the lifecycle-core package. */
|
|
8
|
+
export type LifecycleCoreI18n = I18nInstance<LifecycleCoreMessageKey>;
|
|
9
|
+
/** Create an i18n instance for a given locale. */
|
|
10
|
+
export declare const createLifecycleCoreI18n: (optionsLocale?: string, runtimeLocale?: string) => I18nInstance<"milestone.stage0ProblemStatement.title" | "milestone.stage0ProblemStatement.description" | "milestone.stage0ProblemStatement.action.0" | "milestone.stage0ProblemStatement.action.1" | "milestone.stage1PrototypeLoop.title" | "milestone.stage1PrototypeLoop.description" | "milestone.stage1PrototypeLoop.action.0" | "milestone.stage1PrototypeLoop.action.1" | "milestone.stage2Activation.title" | "milestone.stage2Activation.description" | "milestone.stage2Activation.action.0" | "milestone.stage2Activation.action.1" | "milestone.stage3RetentionNarrative.title" | "milestone.stage3RetentionNarrative.description" | "milestone.stage3RetentionNarrative.action.0" | "milestone.stage3RetentionNarrative.action.1" | "milestone.stage4GrowthLoop.title" | "milestone.stage4GrowthLoop.description" | "milestone.stage4GrowthLoop.action.0" | "milestone.stage4GrowthLoop.action.1" | "milestone.stage4GrowthLoop.action.2" | "milestone.stage5PlatformBlueprint.title" | "milestone.stage5PlatformBlueprint.description" | "milestone.stage5PlatformBlueprint.action.0" | "milestone.stage5PlatformBlueprint.action.1" | "milestone.stage6RenewalOps.title" | "milestone.stage6RenewalOps.description" | "milestone.stage6RenewalOps.action.0" | "milestone.stage6RenewalOps.action.1">;
|
|
11
|
+
/** Create a default (English) i18n instance. */
|
|
12
|
+
export declare const getDefaultI18n: () => I18nInstance<"milestone.stage0ProblemStatement.title" | "milestone.stage0ProblemStatement.description" | "milestone.stage0ProblemStatement.action.0" | "milestone.stage0ProblemStatement.action.1" | "milestone.stage1PrototypeLoop.title" | "milestone.stage1PrototypeLoop.description" | "milestone.stage1PrototypeLoop.action.0" | "milestone.stage1PrototypeLoop.action.1" | "milestone.stage2Activation.title" | "milestone.stage2Activation.description" | "milestone.stage2Activation.action.0" | "milestone.stage2Activation.action.1" | "milestone.stage3RetentionNarrative.title" | "milestone.stage3RetentionNarrative.description" | "milestone.stage3RetentionNarrative.action.0" | "milestone.stage3RetentionNarrative.action.1" | "milestone.stage4GrowthLoop.title" | "milestone.stage4GrowthLoop.description" | "milestone.stage4GrowthLoop.action.0" | "milestone.stage4GrowthLoop.action.1" | "milestone.stage4GrowthLoop.action.2" | "milestone.stage5PlatformBlueprint.title" | "milestone.stage5PlatformBlueprint.description" | "milestone.stage5PlatformBlueprint.action.0" | "milestone.stage5PlatformBlueprint.action.1" | "milestone.stage6RenewalOps.title" | "milestone.stage6RenewalOps.description" | "milestone.stage6RenewalOps.action.0" | "milestone.stage6RenewalOps.action.1">;
|
|
13
|
+
/** Reset the shared registry (useful for testing). @internal */
|
|
14
|
+
export declare const resetI18nRegistry: () => void;
|
package/dist/index.js
CHANGED
|
@@ -270,17 +270,20 @@ var isStageValue = (value) => typeof value === "number" && (value in LIFECYCLE_S
|
|
|
270
270
|
// src/orchestrator/lifecycle-orchestrator.ts
|
|
271
271
|
import {
|
|
272
272
|
LIFECYCLE_STAGE_META as LIFECYCLE_STAGE_META2,
|
|
273
|
-
LifecycleStage as LifecycleStage2
|
|
273
|
+
LifecycleStage as LifecycleStage2,
|
|
274
|
+
getLocalizedStageMeta
|
|
274
275
|
} from "@contractspec/lib.lifecycle";
|
|
275
276
|
|
|
276
277
|
class LifecycleOrchestrator {
|
|
277
278
|
collector;
|
|
278
279
|
scorer;
|
|
279
280
|
planner;
|
|
281
|
+
locale;
|
|
280
282
|
constructor(options) {
|
|
281
283
|
this.collector = options.collector;
|
|
282
284
|
this.scorer = options.scorer;
|
|
283
285
|
this.planner = options.milestonePlanner;
|
|
286
|
+
this.locale = options.locale;
|
|
284
287
|
}
|
|
285
288
|
async run(input) {
|
|
286
289
|
const collected = await this.collector.collect(input);
|
|
@@ -289,7 +292,8 @@ class LifecycleOrchestrator {
|
|
|
289
292
|
signals: collected.signals
|
|
290
293
|
});
|
|
291
294
|
const top = scorecard[0] ?? fallbackScore();
|
|
292
|
-
const
|
|
295
|
+
const stageMeta = this.locale ? getLocalizedStageMeta(this.locale) : LIFECYCLE_STAGE_META2;
|
|
296
|
+
const meta = stageMeta[top.stage];
|
|
293
297
|
return {
|
|
294
298
|
stage: top.stage,
|
|
295
299
|
confidence: top.confidence,
|
package/dist/node/index.js
CHANGED
|
@@ -269,17 +269,20 @@ var isStageValue = (value) => typeof value === "number" && (value in LIFECYCLE_S
|
|
|
269
269
|
// src/orchestrator/lifecycle-orchestrator.ts
|
|
270
270
|
import {
|
|
271
271
|
LIFECYCLE_STAGE_META as LIFECYCLE_STAGE_META2,
|
|
272
|
-
LifecycleStage as LifecycleStage2
|
|
272
|
+
LifecycleStage as LifecycleStage2,
|
|
273
|
+
getLocalizedStageMeta
|
|
273
274
|
} from "@contractspec/lib.lifecycle";
|
|
274
275
|
|
|
275
276
|
class LifecycleOrchestrator {
|
|
276
277
|
collector;
|
|
277
278
|
scorer;
|
|
278
279
|
planner;
|
|
280
|
+
locale;
|
|
279
281
|
constructor(options) {
|
|
280
282
|
this.collector = options.collector;
|
|
281
283
|
this.scorer = options.scorer;
|
|
282
284
|
this.planner = options.milestonePlanner;
|
|
285
|
+
this.locale = options.locale;
|
|
283
286
|
}
|
|
284
287
|
async run(input) {
|
|
285
288
|
const collected = await this.collector.collect(input);
|
|
@@ -288,7 +291,8 @@ class LifecycleOrchestrator {
|
|
|
288
291
|
signals: collected.signals
|
|
289
292
|
});
|
|
290
293
|
const top = scorecard[0] ?? fallbackScore();
|
|
291
|
-
const
|
|
294
|
+
const stageMeta = this.locale ? getLocalizedStageMeta(this.locale) : LIFECYCLE_STAGE_META2;
|
|
295
|
+
const meta = stageMeta[top.stage];
|
|
292
296
|
return {
|
|
293
297
|
stage: top.stage,
|
|
294
298
|
confidence: top.confidence,
|
|
@@ -7,11 +7,14 @@ export interface LifecycleOrchestratorOptions {
|
|
|
7
7
|
collector: StageSignalCollector;
|
|
8
8
|
scorer: StageScorer;
|
|
9
9
|
milestonePlanner?: LifecycleMilestonePlanner;
|
|
10
|
+
/** Locale for localized stage metadata */
|
|
11
|
+
locale?: string;
|
|
10
12
|
}
|
|
11
13
|
export declare class LifecycleOrchestrator {
|
|
12
14
|
private readonly collector;
|
|
13
15
|
private readonly scorer;
|
|
14
16
|
private readonly planner?;
|
|
17
|
+
private readonly locale?;
|
|
15
18
|
constructor(options: LifecycleOrchestratorOptions);
|
|
16
19
|
run(input?: LifecycleAssessmentInput): Promise<LifecycleAssessment>;
|
|
17
20
|
getUpcomingMilestones(stage: LifecycleStage, completedMilestoneIds?: string[], limit?: number): LifecycleMilestone[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/module.lifecycle-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Core lifecycle stage definitions and transitions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -33,12 +33,13 @@
|
|
|
33
33
|
"typecheck": "tsc --noEmit"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@contractspec/lib.lifecycle": "2.
|
|
36
|
+
"@contractspec/lib.lifecycle": "2.5.0",
|
|
37
|
+
"@contractspec/lib.contracts-spec": "2.5.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@contractspec/tool.typescript": "2.
|
|
40
|
+
"@contractspec/tool.typescript": "2.5.0",
|
|
40
41
|
"typescript": "^5.9.3",
|
|
41
|
-
"@contractspec/tool.bun": "2.
|
|
42
|
+
"@contractspec/tool.bun": "2.5.0"
|
|
42
43
|
},
|
|
43
44
|
"exports": {
|
|
44
45
|
".": {
|