@thanh01.pmt/domain-kit 0.4.0 → 0.6.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/README.md +682 -168
- package/dist/assembly/index.d.cts +2 -2
- package/dist/assembly/index.d.ts +2 -2
- package/dist/{chunk-HILSUZOF.mjs → chunk-2OGNQUXC.mjs} +171 -31
- package/dist/chunk-2OGNQUXC.mjs.map +1 -0
- package/dist/{chunk-LZQLLAYP.mjs → chunk-5OMSYKQP.mjs} +43 -23
- package/dist/chunk-5OMSYKQP.mjs.map +1 -0
- package/dist/{chunk-BL5NBKPH.mjs → chunk-67GXK3ZE.mjs} +18 -8
- package/dist/chunk-67GXK3ZE.mjs.map +1 -0
- package/dist/{chunk-PKUEOSZ3.mjs → chunk-CGNXGVHV.mjs} +46 -4
- package/dist/chunk-CGNXGVHV.mjs.map +1 -0
- package/dist/{chunk-VCPIWJ7R.mjs → chunk-ERDTHXQA.mjs} +21 -3
- package/dist/chunk-ERDTHXQA.mjs.map +1 -0
- package/dist/chunk-OYSZQVPY.mjs +10 -0
- package/dist/chunk-OYSZQVPY.mjs.map +1 -0
- package/dist/{chunk-QJF4QCBJ.mjs → chunk-WKTH3JPA.mjs} +202 -36
- package/dist/chunk-WKTH3JPA.mjs.map +1 -0
- package/dist/{conceptEscalator-YfMKIKCZ.d.ts → conceptEscalator-BCsw0ys_.d.ts} +10 -1
- package/dist/{conceptEscalator-ltRLtPhf.d.cts → conceptEscalator-DPrs4PwC.d.cts} +10 -1
- package/dist/concepts/index.d.cts +1 -1
- package/dist/concepts/index.d.ts +1 -1
- package/dist/{curriculumFeedSchema-B66H3gEV.d.ts → curriculumFeedSchema-DYayelAA.d.cts} +212 -1
- package/dist/{curriculumFeedSchema-B66H3gEV.d.cts → curriculumFeedSchema-DYayelAA.d.ts} +212 -1
- package/dist/detector/index.cjs +21 -6
- package/dist/detector/index.cjs.map +1 -1
- package/dist/detector/index.mjs +2 -1
- package/dist/feed/index.cjs +243 -33
- package/dist/feed/index.cjs.map +1 -1
- package/dist/feed/index.d.cts +32 -2
- package/dist/feed/index.d.ts +32 -2
- package/dist/feed/index.mjs +2 -2
- package/dist/graph/index.cjs +163 -28
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +14 -5
- package/dist/graph/index.d.ts +14 -5
- package/dist/graph/index.mjs +2 -1
- package/dist/{hybridGraphPipeline-DXQDbBEj.d.ts → hybridGraphPipeline-9dRKJj7r.d.ts} +6 -2
- package/dist/{hybridGraphPipeline-dT-bio-3.d.cts → hybridGraphPipeline-CocfYe4d.d.cts} +6 -2
- package/dist/{hybridGraphSchema-nrUeSwpU.d.ts → hybridGraphSchema-C37qxdTM.d.cts} +16 -3
- package/dist/{hybridGraphSchema-nrUeSwpU.d.cts → hybridGraphSchema-C37qxdTM.d.ts} +16 -3
- package/dist/index.cjs +3742 -3362
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +7 -6
- package/dist/llmClient-CX5uUiQ1.d.cts +60 -0
- package/dist/llmClient-CX5uUiQ1.d.ts +60 -0
- package/dist/pipeline/index.cjs +1556 -1202
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +13 -5
- package/dist/pipeline/index.d.ts +13 -5
- package/dist/pipeline/index.mjs +6 -5
- package/dist/schemas/index.cjs +64 -2
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +2 -2
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-BL5NBKPH.mjs.map +0 -1
- package/dist/chunk-HILSUZOF.mjs.map +0 -1
- package/dist/chunk-LZQLLAYP.mjs.map +0 -1
- package/dist/chunk-PKUEOSZ3.mjs.map +0 -1
- package/dist/chunk-QJF4QCBJ.mjs.map +0 -1
- package/dist/chunk-VCPIWJ7R.mjs.map +0 -1
- package/dist/curriculumFeedEmitter-6IK6PFDH.mjs +0 -4
- package/dist/curriculumFeedEmitter-6IK6PFDH.mjs.map +0 -1
- package/dist/llmClient-ysPhLjcH.d.cts +0 -16
- package/dist/llmClient-ysPhLjcH.d.ts +0 -16
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { u as ProjectGraph } from '../projectGraphSchema-DnD7orZV.cjs';
|
|
2
2
|
import { K as Keyword } from '../keywordExtractor-BxlGRMHC.cjs';
|
|
3
|
-
import { H as Hallucination, K as KnowledgeGraphPipelineOptions, f as KnowledgeGraphVerificationReport, j as HybridGraphPipelineOptions } from '../hybridGraphPipeline-
|
|
4
|
-
import { C as ConceptMapping } from '../conceptEscalator-
|
|
3
|
+
import { H as Hallucination, K as KnowledgeGraphPipelineOptions, f as KnowledgeGraphVerificationReport, j as HybridGraphPipelineOptions } from '../hybridGraphPipeline-CocfYe4d.cjs';
|
|
4
|
+
import { C as ConceptMapping } from '../conceptEscalator-DPrs4PwC.cjs';
|
|
5
5
|
import { ResolveConceptsResult } from '../concepts/index.cjs';
|
|
6
6
|
import { AssembledRoadmap } from '../assembly/index.cjs';
|
|
7
|
-
import { L as LlmClientConfig } from '../llmClient-
|
|
7
|
+
import { L as LlmClientConfig, b as LlmCallRecord } from '../llmClient-CX5uUiQ1.cjs';
|
|
8
8
|
import { P as ParsedSyllabus } from '../syllabusParser-MSX1fEzW.cjs';
|
|
9
|
-
import { g as KnowledgeGraph, j as HybridGraph } from '../hybridGraphSchema-
|
|
10
|
-
import {
|
|
9
|
+
import { g as KnowledgeGraph, j as HybridGraph } from '../hybridGraphSchema-C37qxdTM.cjs';
|
|
10
|
+
import { k as CurriculumFeed } from '../curriculumFeedSchema-DYayelAA.cjs';
|
|
11
11
|
import { D as DetectDomainProfileOptions } from '../domainProfileDetector-bzugdQmS.cjs';
|
|
12
12
|
import { c as DomainProfile, g as GraphType } from '../domainProfileSchema-CwT3Ffsw.cjs';
|
|
13
13
|
import 'zod';
|
|
@@ -41,6 +41,8 @@ interface PipelineResult {
|
|
|
41
41
|
hallucinations: Hallucination[];
|
|
42
42
|
keywords: Keyword[];
|
|
43
43
|
featureConcepts: Map<string, ConceptMapping[]>;
|
|
44
|
+
/** Which providers served this graph, and whether any call fell over. */
|
|
45
|
+
provenance: LlmCallRecord[];
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Run the full project graph generation pipeline.
|
|
@@ -119,6 +121,12 @@ interface DomainPipelineResult {
|
|
|
119
121
|
knowledgeResult?: KnowledgePipelineResult;
|
|
120
122
|
hybridResult?: HybridPipelineResult;
|
|
121
123
|
warnings: string[];
|
|
124
|
+
/** Present only when the AUTO-detected learning mode could not run and the router ran a weaker pipeline instead. An explicit forcedLearningMode request fails closed instead of downgrading. */
|
|
125
|
+
modeDowngrade?: {
|
|
126
|
+
from: GraphType;
|
|
127
|
+
to: GraphType;
|
|
128
|
+
reason: string;
|
|
129
|
+
};
|
|
122
130
|
}
|
|
123
131
|
/**
|
|
124
132
|
* Route and execute the appropriate domain pipeline based on input context.
|
package/dist/pipeline/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { u as ProjectGraph } from '../projectGraphSchema-DnD7orZV.js';
|
|
2
2
|
import { K as Keyword } from '../keywordExtractor-DU5XRN8-.js';
|
|
3
|
-
import { H as Hallucination, K as KnowledgeGraphPipelineOptions, f as KnowledgeGraphVerificationReport, j as HybridGraphPipelineOptions } from '../hybridGraphPipeline-
|
|
4
|
-
import { C as ConceptMapping } from '../conceptEscalator-
|
|
3
|
+
import { H as Hallucination, K as KnowledgeGraphPipelineOptions, f as KnowledgeGraphVerificationReport, j as HybridGraphPipelineOptions } from '../hybridGraphPipeline-9dRKJj7r.js';
|
|
4
|
+
import { C as ConceptMapping } from '../conceptEscalator-BCsw0ys_.js';
|
|
5
5
|
import { ResolveConceptsResult } from '../concepts/index.js';
|
|
6
6
|
import { AssembledRoadmap } from '../assembly/index.js';
|
|
7
|
-
import { L as LlmClientConfig } from '../llmClient-
|
|
7
|
+
import { L as LlmClientConfig, b as LlmCallRecord } from '../llmClient-CX5uUiQ1.js';
|
|
8
8
|
import { P as ParsedSyllabus } from '../syllabusParser-MSX1fEzW.js';
|
|
9
|
-
import { g as KnowledgeGraph, j as HybridGraph } from '../hybridGraphSchema-
|
|
10
|
-
import {
|
|
9
|
+
import { g as KnowledgeGraph, j as HybridGraph } from '../hybridGraphSchema-C37qxdTM.js';
|
|
10
|
+
import { k as CurriculumFeed } from '../curriculumFeedSchema-DYayelAA.js';
|
|
11
11
|
import { D as DetectDomainProfileOptions } from '../domainProfileDetector-DHb1T0zB.js';
|
|
12
12
|
import { c as DomainProfile, g as GraphType } from '../domainProfileSchema-CwT3Ffsw.js';
|
|
13
13
|
import 'zod';
|
|
@@ -41,6 +41,8 @@ interface PipelineResult {
|
|
|
41
41
|
hallucinations: Hallucination[];
|
|
42
42
|
keywords: Keyword[];
|
|
43
43
|
featureConcepts: Map<string, ConceptMapping[]>;
|
|
44
|
+
/** Which providers served this graph, and whether any call fell over. */
|
|
45
|
+
provenance: LlmCallRecord[];
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Run the full project graph generation pipeline.
|
|
@@ -119,6 +121,12 @@ interface DomainPipelineResult {
|
|
|
119
121
|
knowledgeResult?: KnowledgePipelineResult;
|
|
120
122
|
hybridResult?: HybridPipelineResult;
|
|
121
123
|
warnings: string[];
|
|
124
|
+
/** Present only when the AUTO-detected learning mode could not run and the router ran a weaker pipeline instead. An explicit forcedLearningMode request fails closed instead of downgrading. */
|
|
125
|
+
modeDowngrade?: {
|
|
126
|
+
from: GraphType;
|
|
127
|
+
to: GraphType;
|
|
128
|
+
reason: string;
|
|
129
|
+
};
|
|
122
130
|
}
|
|
123
131
|
/**
|
|
124
132
|
* Route and execute the appropriate domain pipeline based on input context.
|
package/dist/pipeline/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { runDomainPipeline, runHybridGraphPipeline, runKnowledgeGraphPipeline, runProjectGraphPipeline } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { runDomainPipeline, runHybridGraphPipeline, runKnowledgeGraphPipeline, runProjectGraphPipeline } from '../chunk-5OMSYKQP.mjs';
|
|
2
|
+
import '../chunk-WKTH3JPA.mjs';
|
|
3
|
+
import '../chunk-CGNXGVHV.mjs';
|
|
4
4
|
import '../chunk-DRVOV5ZD.mjs';
|
|
5
5
|
import '../chunk-XMHKWHVK.mjs';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-67GXK3ZE.mjs';
|
|
7
|
+
import '../chunk-2OGNQUXC.mjs';
|
|
8
8
|
import '../chunk-T4Y2DE2W.mjs';
|
|
9
|
+
import '../chunk-OYSZQVPY.mjs';
|
|
9
10
|
import '../chunk-KNDBODUQ.mjs';
|
|
10
11
|
import '../chunk-ONQHJ4OH.mjs';
|
|
11
12
|
//# sourceMappingURL=index.mjs.map
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -477,9 +477,27 @@ var HybridGraphSchema = zod.z.object({
|
|
|
477
477
|
phases: zod.z.array(DevelopmentPhaseSchema).optional().default([]),
|
|
478
478
|
// Metadata
|
|
479
479
|
description: zod.z.string().optional().default(""),
|
|
480
|
+
// ── Minute totals (HG-1, 2026-10-05) ────────────────────────────────────
|
|
481
|
+
// These three used to sit side by side with near-identical names and NO
|
|
482
|
+
// documentation. Two measured DIFFERENT quantities, which is why the field
|
|
483
|
+
// below was renamed: it does not measure "the total". Read before trusting
|
|
484
|
+
// any of them.
|
|
485
|
+
/** Minutes of PRODUCT work: sum over every feature step. */
|
|
480
486
|
total_project_minutes: zod.z.number().optional().default(0),
|
|
487
|
+
/** Minutes of CONCEPT work: sum over EVERY concept in the graph. */
|
|
481
488
|
total_concept_minutes: zod.z.number().optional().default(0),
|
|
482
|
-
|
|
489
|
+
/**
|
|
490
|
+
* Renamed from `estimated_total_minutes` (2026-10-05) — the old name read
|
|
491
|
+
* like "the course total" but the number is narrower:
|
|
492
|
+
* total_project_minutes + (minutes of concepts that HAVE a feature link)
|
|
493
|
+
* unlinked concepts are deliberately excluded, and per concept the MAXIMUM
|
|
494
|
+
* link estimate wins, not the sum. Expect this to sit well BELOW
|
|
495
|
+
* total_project_minutes + total_concept_minutes.
|
|
496
|
+
*
|
|
497
|
+
* The figure the phase planner actually commits to is
|
|
498
|
+
* total_project_minutes + total_concept_minutes (see decomposePhases).
|
|
499
|
+
*/
|
|
500
|
+
linked_prereq_minutes: zod.z.number().optional().default(0)
|
|
483
501
|
});
|
|
484
502
|
var InputTypeSchema = zod.z.enum([
|
|
485
503
|
"repository",
|
|
@@ -606,6 +624,23 @@ var FeedNodeSchema = zod.z.object({
|
|
|
606
624
|
reason: zod.z.string().default("")
|
|
607
625
|
})).optional(),
|
|
608
626
|
is_core: zod.z.boolean().default(false),
|
|
627
|
+
/**
|
|
628
|
+
* Prerequisite concept ids this node needs that NO node in this feed provides —
|
|
629
|
+
* i.e. the learner must already know them before starting. Previously these were
|
|
630
|
+
* silently dropped (knowledge path) or crashed emission (both hybrid paths), so a
|
|
631
|
+
* course silently lost its entry requirements. Kept on the node so the mapping
|
|
632
|
+
* "concept X needs prior knowledge Y" survives; a course-level roll-up is derivable.
|
|
633
|
+
*/
|
|
634
|
+
external_prerequisites: zod.z.array(zod.z.string()).default([]),
|
|
635
|
+
// Depth layer text (optional, additive — old feeds validate unchanged).
|
|
636
|
+
// Carries the ULO/CIO/SIO authored text from the KnowledgeGraph concept
|
|
637
|
+
// so downstream consumers (KX generator) can inject depth-appropriate
|
|
638
|
+
// material into their prompts without a second LLM call.
|
|
639
|
+
depth_context: zod.z.object({
|
|
640
|
+
ulo: zod.z.string().default(""),
|
|
641
|
+
cio: zod.z.string().default(""),
|
|
642
|
+
sio: zod.z.array(zod.z.string()).default([])
|
|
643
|
+
}).optional(),
|
|
609
644
|
// Progressive-completion bookkeeping (feed v2, additive):
|
|
610
645
|
// phase_id = development phase that introduces/uses this node;
|
|
611
646
|
// introduce_aspect = how the phase teaches a concept node (first intro, advanced
|
|
@@ -632,12 +667,28 @@ var FeedPhaseSchema = zod.z.object({
|
|
|
632
667
|
product_completion: zod.z.string().min(1),
|
|
633
668
|
node_ids: zod.z.array(zod.z.string()).min(1)
|
|
634
669
|
});
|
|
670
|
+
var FeedDiagnosticSchema = zod.z.object({
|
|
671
|
+
code: zod.z.string().min(1),
|
|
672
|
+
severity: zod.z.enum(["info", "warning", "error"]),
|
|
673
|
+
message: zod.z.string(),
|
|
674
|
+
node_ids: zod.z.array(zod.z.string()).default([])
|
|
675
|
+
});
|
|
676
|
+
var FeedProvenanceSchema = zod.z.object({
|
|
677
|
+
providers: zod.z.array(zod.z.string()).default([]),
|
|
678
|
+
models: zod.z.array(zod.z.string()).default([]),
|
|
679
|
+
calls: zod.z.number().int().nonnegative().default(0),
|
|
680
|
+
failed_calls: zod.z.number().int().nonnegative().default(0),
|
|
681
|
+
degraded: zod.z.boolean().default(false)
|
|
682
|
+
});
|
|
635
683
|
var CurriculumFeedSchema = zod.z.object({
|
|
636
684
|
schema_version: zod.z.literal(2),
|
|
637
685
|
source: zod.z.object({
|
|
638
686
|
graph_type: zod.z.enum(["project_graph", "knowledge_graph", "hybrid_graph"]),
|
|
687
|
+
/** DERIVED from diagnostics — do not write to it directly. */
|
|
639
688
|
warnings: zod.z.array(zod.z.string()).default([]),
|
|
640
|
-
hallucination_count: zod.z.number().int().nonnegative().default(0)
|
|
689
|
+
hallucination_count: zod.z.number().int().nonnegative().default(0),
|
|
690
|
+
diagnostics: zod.z.array(FeedDiagnosticSchema).default([]),
|
|
691
|
+
provenance: FeedProvenanceSchema.optional()
|
|
641
692
|
}),
|
|
642
693
|
learning_nodes: zod.z.array(FeedNodeSchema).min(1, "curriculum feed must contain at least one learning node"),
|
|
643
694
|
dependency_edges: zod.z.array(FeedEdgeSchema).default([]),
|
|
@@ -670,6 +721,15 @@ function validateCurriculumFeed(feed) {
|
|
|
670
721
|
}
|
|
671
722
|
const phaseIds = parsed.phases.map((p) => p.id);
|
|
672
723
|
if (new Set(phaseIds).size !== phaseIds.length) throw new Error("curriculum feed contains duplicate phase ids");
|
|
724
|
+
const phaseOrders = parsed.phases.map((p) => p.order);
|
|
725
|
+
if (new Set(phaseOrders).size !== phaseOrders.length) {
|
|
726
|
+
throw new Error("curriculum feed contains duplicate phase orders: " + phaseOrders.join(", "));
|
|
727
|
+
}
|
|
728
|
+
for (let i = 1; i < phaseOrders.length; i++) {
|
|
729
|
+
if (phaseOrders[i] <= phaseOrders[i - 1]) {
|
|
730
|
+
throw new Error("curriculum feed phase orders are not ascending: " + phaseOrders.join(", "));
|
|
731
|
+
}
|
|
732
|
+
}
|
|
673
733
|
if (parsed.phases.length > 0) {
|
|
674
734
|
const phaseIndexOf = /* @__PURE__ */ new Map();
|
|
675
735
|
parsed.phases.forEach((p, i) => {
|
|
@@ -708,11 +768,13 @@ exports.ExperienceComponentSchema = ExperienceComponentSchema;
|
|
|
708
768
|
exports.ExperienceSchema = ExperienceSchema;
|
|
709
769
|
exports.ExperimentProcedureSchema = ExperimentProcedureSchema;
|
|
710
770
|
exports.FeatureSchema = FeatureSchema;
|
|
771
|
+
exports.FeedDiagnosticSchema = FeedDiagnosticSchema;
|
|
711
772
|
exports.FeedEdgeSchema = FeedEdgeSchema;
|
|
712
773
|
exports.FeedGroupingSchema = FeedGroupingSchema;
|
|
713
774
|
exports.FeedKeywordsSchema = FeedKeywordsSchema;
|
|
714
775
|
exports.FeedNodeSchema = FeedNodeSchema;
|
|
715
776
|
exports.FeedPhaseSchema = FeedPhaseSchema;
|
|
777
|
+
exports.FeedProvenanceSchema = FeedProvenanceSchema;
|
|
716
778
|
exports.FeedScaffoldCandidateSchema = FeedScaffoldCandidateSchema;
|
|
717
779
|
exports.GrammarRuleSchema = GrammarRuleSchema;
|
|
718
780
|
exports.GraphTypeSchema = GraphTypeSchema;
|