@mergesignal/shared 0.6.0 → 0.7.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/assessmentLabels.d.ts +1 -1
- package/dist/assessmentLabels.d.ts.map +1 -1
- package/dist/assessmentPresentationUtils.d.ts +6 -0
- package/dist/assessmentPresentationUtils.d.ts.map +1 -0
- package/dist/assessmentPresentationUtils.js +17 -0
- package/dist/assessmentProjection.d.ts +2 -2
- package/dist/assessmentProjection.d.ts.map +1 -1
- package/dist/assessmentProjection.js +42 -13
- package/dist/deriveScanNarrative.d.ts.map +1 -1
- package/dist/deriveScanNarrative.js +20 -1
- package/dist/deriveScanNarrative.test.js +13 -0
- package/dist/engineWireRegression.test.js +1 -1
- package/dist/fixtures/assessmentFixtures.d.ts +2 -1
- package/dist/fixtures/assessmentFixtures.d.ts.map +1 -1
- package/dist/fixtures/assessmentFixtures.js +78 -23
- package/dist/fixtures/assessmentScopeFixtures.d.ts +17 -0
- package/dist/fixtures/assessmentScopeFixtures.d.ts.map +1 -0
- package/dist/fixtures/assessmentScopeFixtures.js +42 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/presentation/buildGitHubCheckRunOutput.test.js +16 -41
- package/dist/presentation/compose/narrativeChannels.js +1 -1
- package/dist/presentation/dto/assessmentPresentationFields.d.ts +1 -2
- package/dist/presentation/dto/assessmentPresentationFields.d.ts.map +1 -1
- package/dist/presentation/orchestration/buildScanPresentationBundle.d.ts.map +1 -1
- package/dist/presentation/orchestration/buildScanPresentationBundle.js +12 -5
- package/dist/presentation/orchestration/buildScanPresentationBundle.test.d.ts +2 -0
- package/dist/presentation/orchestration/buildScanPresentationBundle.test.d.ts.map +1 -0
- package/dist/presentation/orchestration/buildScanPresentationBundle.test.js +99 -0
- package/dist/presentation/orchestration/scanPresentationBundle.d.ts +1 -1
- package/dist/presentation/orchestration/scanPresentationBundle.d.ts.map +1 -1
- package/dist/presentation/presentation.test.js +1 -1
- package/dist/presentation/presentationPersonas.test.js +0 -5
- package/dist/presentation/profile/buildProfileFromAssessment.d.ts +1 -1
- package/dist/presentation/profile/buildProfileFromAssessment.d.ts.map +1 -1
- package/dist/presentation/profile/buildProfileFromAssessment.js +13 -2
- package/dist/presentation/surfaceParity.test.js +73 -5
- package/dist/repoIntelligenceSchema.d.ts +3 -3
- package/dist/scanResultSchema.d.ts +53 -4
- package/dist/scanResultSchema.d.ts.map +1 -1
- package/dist/scanResultSchema.js +1 -1
- package/dist/scanResultSchema.test.js +26 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -2
- package/dist/assessmentSchema.d.ts +0 -155
- package/dist/assessmentSchema.d.ts.map +0 -1
- package/dist/assessmentSchema.js +0 -110
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assessment Contract — mirrored from mergesignal-engine/packages/analysis-engine/src/assessment/types.ts
|
|
3
|
-
* Bump {@link ASSESSMENT_ABI} when this schema changes incompatibly.
|
|
4
|
-
*/
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
export declare const ASSESSMENT_ABI: "1";
|
|
7
|
-
export declare const ASSESSMENT_POSTURES: readonly ["safe", "needs_review", "risky"];
|
|
8
|
-
export type AssessmentPosture = (typeof ASSESSMENT_POSTURES)[number];
|
|
9
|
-
export declare const ASSESSMENT_CONFIDENCES: readonly ["low", "medium", "high"];
|
|
10
|
-
export type AssessmentConfidence = (typeof ASSESSMENT_CONFIDENCES)[number];
|
|
11
|
-
export declare const CHANGE_CLASSES: readonly ["tooling_maintenance", "test_infra", "runtime_patch", "runtime_upgrade", "security_advisory", "breaking_change", "ecosystem_unknown", "bulk_mixed", "removal"];
|
|
12
|
-
export type ChangeClass = (typeof CHANGE_CLASSES)[number];
|
|
13
|
-
export declare const MERGE_CONCERN_KINDS: readonly ["confirmed_runtime_usage", "security_finding", "breaking_or_major", "behavioral_change", "ecosystem_risk", "insufficient_evidence", "graph_baseline_only"];
|
|
14
|
-
export type MergeConcernKind = (typeof MERGE_CONCERN_KINDS)[number];
|
|
15
|
-
export declare const NARRATIVE_INTENSITIES: readonly ["minimal", "standard", "elevated"];
|
|
16
|
-
export type NarrativeIntensity = (typeof NARRATIVE_INTENSITIES)[number];
|
|
17
|
-
export declare const REACH_VISIBILITIES: readonly ["hidden", "contextual", "prominent"];
|
|
18
|
-
export type ReachVisibility = (typeof REACH_VISIBILITIES)[number];
|
|
19
|
-
export declare const VERIFICATION_INTENSITIES: readonly ["none", "advisory", "required"];
|
|
20
|
-
export type VerificationIntensity = (typeof VERIFICATION_INTENSITIES)[number];
|
|
21
|
-
export declare const INSIGHT_EMISSION_FLOORS: readonly ["none", "explain_only", "full"];
|
|
22
|
-
export type InsightEmissionFloor = (typeof INSIGHT_EMISSION_FLOORS)[number];
|
|
23
|
-
export declare const ASSESSMENT_REPORT_MODES: readonly ["lightweight_pr_graph_baseline", "high_signal_pr"];
|
|
24
|
-
export type AssessmentReportMode = (typeof ASSESSMENT_REPORT_MODES)[number];
|
|
25
|
-
declare const assessmentConcernSchema: z.ZodObject<{
|
|
26
|
-
kind: z.ZodEnum<{
|
|
27
|
-
confirmed_runtime_usage: "confirmed_runtime_usage";
|
|
28
|
-
security_finding: "security_finding";
|
|
29
|
-
breaking_or_major: "breaking_or_major";
|
|
30
|
-
behavioral_change: "behavioral_change";
|
|
31
|
-
ecosystem_risk: "ecosystem_risk";
|
|
32
|
-
insufficient_evidence: "insufficient_evidence";
|
|
33
|
-
graph_baseline_only: "graph_baseline_only";
|
|
34
|
-
}>;
|
|
35
|
-
rank: z.ZodNumber;
|
|
36
|
-
packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
-
evidenceRefs: z.ZodArray<z.ZodString>;
|
|
38
|
-
}, z.core.$strip>;
|
|
39
|
-
declare const assessmentPresentationWireSchema: z.ZodObject<{
|
|
40
|
-
narrativeIntensity: z.ZodEnum<{
|
|
41
|
-
minimal: "minimal";
|
|
42
|
-
standard: "standard";
|
|
43
|
-
elevated: "elevated";
|
|
44
|
-
}>;
|
|
45
|
-
reachVisibility: z.ZodEnum<{
|
|
46
|
-
hidden: "hidden";
|
|
47
|
-
contextual: "contextual";
|
|
48
|
-
prominent: "prominent";
|
|
49
|
-
}>;
|
|
50
|
-
verificationIntensity: z.ZodEnum<{
|
|
51
|
-
none: "none";
|
|
52
|
-
advisory: "advisory";
|
|
53
|
-
required: "required";
|
|
54
|
-
}>;
|
|
55
|
-
insightEmissionFloor: z.ZodEnum<{
|
|
56
|
-
none: "none";
|
|
57
|
-
explain_only: "explain_only";
|
|
58
|
-
full: "full";
|
|
59
|
-
}>;
|
|
60
|
-
reportMode: z.ZodEnum<{
|
|
61
|
-
lightweight_pr_graph_baseline: "lightweight_pr_graph_baseline";
|
|
62
|
-
high_signal_pr: "high_signal_pr";
|
|
63
|
-
}>;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
export declare const assessmentSchema: z.ZodObject<{
|
|
66
|
-
posture: z.ZodEnum<{
|
|
67
|
-
safe: "safe";
|
|
68
|
-
needs_review: "needs_review";
|
|
69
|
-
risky: "risky";
|
|
70
|
-
}>;
|
|
71
|
-
confidence: z.ZodEnum<{
|
|
72
|
-
low: "low";
|
|
73
|
-
medium: "medium";
|
|
74
|
-
high: "high";
|
|
75
|
-
}>;
|
|
76
|
-
primaryConcern: z.ZodNullable<z.ZodEnum<{
|
|
77
|
-
confirmed_runtime_usage: "confirmed_runtime_usage";
|
|
78
|
-
security_finding: "security_finding";
|
|
79
|
-
breaking_or_major: "breaking_or_major";
|
|
80
|
-
behavioral_change: "behavioral_change";
|
|
81
|
-
ecosystem_risk: "ecosystem_risk";
|
|
82
|
-
insufficient_evidence: "insufficient_evidence";
|
|
83
|
-
graph_baseline_only: "graph_baseline_only";
|
|
84
|
-
}>>;
|
|
85
|
-
concerns: z.ZodArray<z.ZodObject<{
|
|
86
|
-
kind: z.ZodEnum<{
|
|
87
|
-
confirmed_runtime_usage: "confirmed_runtime_usage";
|
|
88
|
-
security_finding: "security_finding";
|
|
89
|
-
breaking_or_major: "breaking_or_major";
|
|
90
|
-
behavioral_change: "behavioral_change";
|
|
91
|
-
ecosystem_risk: "ecosystem_risk";
|
|
92
|
-
insufficient_evidence: "insufficient_evidence";
|
|
93
|
-
graph_baseline_only: "graph_baseline_only";
|
|
94
|
-
}>;
|
|
95
|
-
rank: z.ZodNumber;
|
|
96
|
-
packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
97
|
-
evidenceRefs: z.ZodArray<z.ZodString>;
|
|
98
|
-
}, z.core.$strip>>;
|
|
99
|
-
factors: z.ZodArray<z.ZodString>;
|
|
100
|
-
changeClasses: z.ZodArray<z.ZodEnum<{
|
|
101
|
-
tooling_maintenance: "tooling_maintenance";
|
|
102
|
-
test_infra: "test_infra";
|
|
103
|
-
runtime_patch: "runtime_patch";
|
|
104
|
-
runtime_upgrade: "runtime_upgrade";
|
|
105
|
-
security_advisory: "security_advisory";
|
|
106
|
-
breaking_change: "breaking_change";
|
|
107
|
-
ecosystem_unknown: "ecosystem_unknown";
|
|
108
|
-
bulk_mixed: "bulk_mixed";
|
|
109
|
-
removal: "removal";
|
|
110
|
-
}>>;
|
|
111
|
-
presentation: z.ZodObject<{
|
|
112
|
-
narrativeIntensity: z.ZodEnum<{
|
|
113
|
-
minimal: "minimal";
|
|
114
|
-
standard: "standard";
|
|
115
|
-
elevated: "elevated";
|
|
116
|
-
}>;
|
|
117
|
-
reachVisibility: z.ZodEnum<{
|
|
118
|
-
hidden: "hidden";
|
|
119
|
-
contextual: "contextual";
|
|
120
|
-
prominent: "prominent";
|
|
121
|
-
}>;
|
|
122
|
-
verificationIntensity: z.ZodEnum<{
|
|
123
|
-
none: "none";
|
|
124
|
-
advisory: "advisory";
|
|
125
|
-
required: "required";
|
|
126
|
-
}>;
|
|
127
|
-
insightEmissionFloor: z.ZodEnum<{
|
|
128
|
-
none: "none";
|
|
129
|
-
explain_only: "explain_only";
|
|
130
|
-
full: "full";
|
|
131
|
-
}>;
|
|
132
|
-
reportMode: z.ZodEnum<{
|
|
133
|
-
lightweight_pr_graph_baseline: "lightweight_pr_graph_baseline";
|
|
134
|
-
high_signal_pr: "high_signal_pr";
|
|
135
|
-
}>;
|
|
136
|
-
}, z.core.$strip>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
export type AssessmentConcern = z.infer<typeof assessmentConcernSchema>;
|
|
139
|
-
export type AssessmentPresentationWire = z.infer<typeof assessmentPresentationWireSchema>;
|
|
140
|
-
/** Public presentation subset — excludes engine policy fields. */
|
|
141
|
-
export type AssessmentPresentationPublic = Pick<AssessmentPresentationWire, "narrativeIntensity" | "reachVisibility" | "verificationIntensity" | "reportMode">;
|
|
142
|
-
export type Assessment = z.infer<typeof assessmentSchema>;
|
|
143
|
-
export declare function toPublicPresentation(wire: AssessmentPresentationWire): AssessmentPresentationPublic;
|
|
144
|
-
export declare function parseAssessmentOrThrow(data: unknown): Assessment;
|
|
145
|
-
export declare function safeParseAssessment(data: unknown): {
|
|
146
|
-
ok: true;
|
|
147
|
-
value: Assessment;
|
|
148
|
-
} | {
|
|
149
|
-
ok: false;
|
|
150
|
-
issues: string[];
|
|
151
|
-
};
|
|
152
|
-
/** Map engine narrative intensity to presentation density (formatting only). */
|
|
153
|
-
export declare function narrativeIntensityToDensity(intensity: NarrativeIntensity): "minimal" | "standard" | "rich";
|
|
154
|
-
export {};
|
|
155
|
-
//# sourceMappingURL=assessmentSchema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assessmentSchema.d.ts","sourceRoot":"","sources":["../src/assessmentSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,EAAG,GAAY,CAAC;AAE3C,eAAO,MAAM,mBAAmB,4CAA6C,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,eAAO,MAAM,sBAAsB,oCAAqC,CAAC;AACzE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,eAAO,MAAM,cAAc,0KAUjB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,sKAQtB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,qBAAqB,8CAIxB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,kBAAkB,gDAIrB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,eAAO,MAAM,wBAAwB,2CAI3B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,eAAO,MAAM,uBAAuB,2CAI1B,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,eAAO,MAAM,uBAAuB,8DAG1B,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;iBAK3B,CAAC;AAEH,QAAA,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;iBAMpC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ3B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,0BAA0B,EACxB,oBAAoB,GACpB,iBAAiB,GACjB,uBAAuB,GACvB,YAAY,CACf,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,0BAA0B,GAC/B,4BAA4B,CAO9B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CAShE;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,GACZ;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAWnE;AAED,gFAAgF;AAChF,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,kBAAkB,GAC5B,SAAS,GAAG,UAAU,GAAG,MAAM,CAIjC"}
|
package/dist/assessmentSchema.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assessment Contract — mirrored from mergesignal-engine/packages/analysis-engine/src/assessment/types.ts
|
|
3
|
-
* Bump {@link ASSESSMENT_ABI} when this schema changes incompatibly.
|
|
4
|
-
*/
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
export const ASSESSMENT_ABI = "1";
|
|
7
|
-
export const ASSESSMENT_POSTURES = ["safe", "needs_review", "risky"];
|
|
8
|
-
export const ASSESSMENT_CONFIDENCES = ["low", "medium", "high"];
|
|
9
|
-
export const CHANGE_CLASSES = [
|
|
10
|
-
"tooling_maintenance",
|
|
11
|
-
"test_infra",
|
|
12
|
-
"runtime_patch",
|
|
13
|
-
"runtime_upgrade",
|
|
14
|
-
"security_advisory",
|
|
15
|
-
"breaking_change",
|
|
16
|
-
"ecosystem_unknown",
|
|
17
|
-
"bulk_mixed",
|
|
18
|
-
"removal",
|
|
19
|
-
];
|
|
20
|
-
export const MERGE_CONCERN_KINDS = [
|
|
21
|
-
"confirmed_runtime_usage",
|
|
22
|
-
"security_finding",
|
|
23
|
-
"breaking_or_major",
|
|
24
|
-
"behavioral_change",
|
|
25
|
-
"ecosystem_risk",
|
|
26
|
-
"insufficient_evidence",
|
|
27
|
-
"graph_baseline_only",
|
|
28
|
-
];
|
|
29
|
-
export const NARRATIVE_INTENSITIES = [
|
|
30
|
-
"minimal",
|
|
31
|
-
"standard",
|
|
32
|
-
"elevated",
|
|
33
|
-
];
|
|
34
|
-
export const REACH_VISIBILITIES = [
|
|
35
|
-
"hidden",
|
|
36
|
-
"contextual",
|
|
37
|
-
"prominent",
|
|
38
|
-
];
|
|
39
|
-
export const VERIFICATION_INTENSITIES = [
|
|
40
|
-
"none",
|
|
41
|
-
"advisory",
|
|
42
|
-
"required",
|
|
43
|
-
];
|
|
44
|
-
export const INSIGHT_EMISSION_FLOORS = [
|
|
45
|
-
"none",
|
|
46
|
-
"explain_only",
|
|
47
|
-
"full",
|
|
48
|
-
];
|
|
49
|
-
export const ASSESSMENT_REPORT_MODES = [
|
|
50
|
-
"lightweight_pr_graph_baseline",
|
|
51
|
-
"high_signal_pr",
|
|
52
|
-
];
|
|
53
|
-
const assessmentConcernSchema = z.object({
|
|
54
|
-
kind: z.enum(MERGE_CONCERN_KINDS),
|
|
55
|
-
rank: z.number().int().nonnegative(),
|
|
56
|
-
packages: z.array(z.string()).optional(),
|
|
57
|
-
evidenceRefs: z.array(z.string()),
|
|
58
|
-
});
|
|
59
|
-
const assessmentPresentationWireSchema = z.object({
|
|
60
|
-
narrativeIntensity: z.enum(NARRATIVE_INTENSITIES),
|
|
61
|
-
reachVisibility: z.enum(REACH_VISIBILITIES),
|
|
62
|
-
verificationIntensity: z.enum(VERIFICATION_INTENSITIES),
|
|
63
|
-
insightEmissionFloor: z.enum(INSIGHT_EMISSION_FLOORS),
|
|
64
|
-
reportMode: z.enum(ASSESSMENT_REPORT_MODES),
|
|
65
|
-
});
|
|
66
|
-
export const assessmentSchema = z.object({
|
|
67
|
-
posture: z.enum(ASSESSMENT_POSTURES),
|
|
68
|
-
confidence: z.enum(ASSESSMENT_CONFIDENCES),
|
|
69
|
-
primaryConcern: z.enum(MERGE_CONCERN_KINDS).nullable(),
|
|
70
|
-
concerns: z.array(assessmentConcernSchema),
|
|
71
|
-
factors: z.array(z.string()),
|
|
72
|
-
changeClasses: z.array(z.enum(CHANGE_CLASSES)),
|
|
73
|
-
presentation: assessmentPresentationWireSchema,
|
|
74
|
-
});
|
|
75
|
-
export function toPublicPresentation(wire) {
|
|
76
|
-
return {
|
|
77
|
-
narrativeIntensity: wire.narrativeIntensity,
|
|
78
|
-
reachVisibility: wire.reachVisibility,
|
|
79
|
-
verificationIntensity: wire.verificationIntensity,
|
|
80
|
-
reportMode: wire.reportMode,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
export function parseAssessmentOrThrow(data) {
|
|
84
|
-
const parsed = assessmentSchema.safeParse(data);
|
|
85
|
-
if (!parsed.success) {
|
|
86
|
-
const issues = parsed.error.issues
|
|
87
|
-
.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`)
|
|
88
|
-
.join("; ");
|
|
89
|
-
throw new Error(`assessment validation: ${issues}`);
|
|
90
|
-
}
|
|
91
|
-
return parsed.data;
|
|
92
|
-
}
|
|
93
|
-
export function safeParseAssessment(data) {
|
|
94
|
-
const parsed = assessmentSchema.safeParse(data);
|
|
95
|
-
if (!parsed.success) {
|
|
96
|
-
return {
|
|
97
|
-
ok: false,
|
|
98
|
-
issues: parsed.error.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`),
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return { ok: true, value: parsed.data };
|
|
102
|
-
}
|
|
103
|
-
/** Map engine narrative intensity to presentation density (formatting only). */
|
|
104
|
-
export function narrativeIntensityToDensity(intensity) {
|
|
105
|
-
if (intensity === "minimal")
|
|
106
|
-
return "minimal";
|
|
107
|
-
if (intensity === "elevated")
|
|
108
|
-
return "rich";
|
|
109
|
-
return "standard";
|
|
110
|
-
}
|