@lucern/pack-host 1.0.29 → 1.0.30
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/contracts.d.ts +35 -35
- package/dist/contracts.js.map +1 -1
- package/dist/dependencyResolution.d.ts +3 -3
- package/dist/dependencyResolution.js +83 -59
- package/dist/dependencyResolution.js.map +1 -1
- package/dist/domain-pack/authoring.core.d.ts +82 -82
- package/dist/domain-pack/authoring.core.js +7 -6
- package/dist/domain-pack/authoring.core.js.map +1 -1
- package/dist/domain-pack/authoring.js +400 -281
- package/dist/domain-pack/authoring.js.map +1 -1
- package/dist/domain-pack/authoring.validation.js +400 -281
- package/dist/domain-pack/authoring.validation.js.map +1 -1
- package/dist/domain-pack/contracts.d.ts +95 -95
- package/dist/domain-pack/contracts.js.map +1 -1
- package/dist/domain-pack/index.js +416 -285
- package/dist/domain-pack/index.js.map +1 -1
- package/dist/domain-pack/ontology/software-entities-v1.d.ts +7 -7
- package/dist/domain-pack/ontology/software-entities-v1.js.map +1 -1
- package/dist/domain-pack/packs/developer-reasoning.js +7 -1
- package/dist/domain-pack/packs/developer-reasoning.js.map +1 -1
- package/dist/domain-pack/packs/engineering-accelerator.js.map +1 -1
- package/dist/domain-pack/packs/index.js +333 -239
- package/dist/domain-pack/packs/index.js.map +1 -1
- package/dist/domain-pack/shaping.d.ts +15 -15
- package/dist/domain-pack/shaping.js +326 -238
- package/dist/domain-pack/shaping.js.map +1 -1
- package/dist/domain-pack/validation.d.ts +6 -6
- package/dist/domain-pack/validation.js +318 -236
- package/dist/domain-pack/validation.js.map +1 -1
- package/dist/domain-pack.js +416 -285
- package/dist/domain-pack.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3793 -3643
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +9 -9
- package/dist/lifecycle.js.map +1 -1
- package/dist/manifestValidation.d.ts +9 -9
- package/dist/manifestValidation.js.map +1 -1
- package/dist/manifests/chat-v1.js.map +1 -1
- package/dist/manifests/deals-v1.js +1 -6
- package/dist/manifests/deals-v1.js.map +1 -1
- package/dist/manifests/decisions-v1.js.map +1 -1
- package/dist/manifests/documents-v1.js.map +1 -1
- package/dist/manifests/epistemic-algorithms-v1.js.map +1 -1
- package/dist/manifests/graph-visualization-v1.js.map +1 -1
- package/dist/manifests/index.js +1 -6
- package/dist/manifests/index.js.map +1 -1
- package/dist/manifests/news-v1.js.map +1 -1
- package/dist/manifests/philosophy-mode-v1.js.map +1 -1
- package/dist/manifests/sprints-v1.js.map +1 -1
- package/dist/manifests/task-management-v1.js.map +1 -1
- package/dist/manifests/team-analysis-v1.js.map +1 -1
- package/dist/manifests/themes-v1.js.map +1 -1
- package/dist/manifests/user-profiles-v1.js.map +1 -1
- package/dist/manifests.js +1 -6
- package/dist/manifests.js.map +1 -1
- package/dist/namespacePolicy.d.ts +6 -6
- package/dist/namespacePolicy.js.map +1 -1
- package/dist/proof-attestation.json +1 -1
- package/dist/registry.js +84 -65
- package/dist/registry.js.map +1 -1
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +83 -59
- package/dist/runtime.js.map +1 -1
- package/dist/serviceContracts.d.ts +4 -4
- package/dist/serviceContracts.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,167 +14,167 @@
|
|
|
14
14
|
* All fields are internal until RS-5+ external authoring certification.
|
|
15
15
|
*/
|
|
16
16
|
type OntologyProvisionMode = "bind" | "seed" | "extend";
|
|
17
|
-
|
|
17
|
+
interface OntologyBinding {
|
|
18
18
|
ontologyId: string;
|
|
19
|
-
versionConstraint: string;
|
|
20
|
-
required: boolean;
|
|
21
19
|
provisionMode?: OntologyProvisionMode;
|
|
22
|
-
|
|
23
|
-
requiredEntityTypes?: string[];
|
|
20
|
+
required: boolean;
|
|
24
21
|
requiredEdgeTypes?: string[];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
requiredEntityTypes?: string[];
|
|
23
|
+
seedRef?: string;
|
|
24
|
+
versionConstraint: string;
|
|
25
|
+
}
|
|
26
|
+
interface TopicRoot {
|
|
29
27
|
description: string;
|
|
30
|
-
ontologyId?: string;
|
|
31
|
-
};
|
|
32
|
-
type WorkflowStep = {
|
|
33
|
-
stepId: string;
|
|
34
28
|
name: string;
|
|
29
|
+
ontologyId?: string;
|
|
30
|
+
slug: string;
|
|
31
|
+
}
|
|
32
|
+
interface WorkflowStep {
|
|
35
33
|
description: string;
|
|
36
|
-
requiredRoles: string[];
|
|
37
|
-
produces?: string[];
|
|
38
34
|
gateId?: string;
|
|
39
|
-
};
|
|
40
|
-
type WorkflowTemplate = {
|
|
41
|
-
workflowId: string;
|
|
42
35
|
name: string;
|
|
36
|
+
produces?: string[];
|
|
37
|
+
requiredRoles: string[];
|
|
38
|
+
stepId: string;
|
|
39
|
+
}
|
|
40
|
+
interface WorkflowTemplate {
|
|
43
41
|
description: string;
|
|
44
|
-
steps: WorkflowStep[];
|
|
45
|
-
requiredArtifacts: string[];
|
|
46
42
|
gateCheckpoints: string[];
|
|
47
|
-
|
|
43
|
+
name: string;
|
|
44
|
+
requiredArtifacts: string[];
|
|
45
|
+
steps: WorkflowStep[];
|
|
46
|
+
workflowId: string;
|
|
47
|
+
}
|
|
48
48
|
type GateCriterionOperator = "gte" | "lte" | "eq" | "gt" | "lt";
|
|
49
|
-
|
|
49
|
+
interface GateCriterion {
|
|
50
50
|
criterionId: string;
|
|
51
51
|
description: string;
|
|
52
52
|
metric: string;
|
|
53
|
-
threshold?: number;
|
|
54
53
|
operator?: GateCriterionOperator;
|
|
55
|
-
|
|
54
|
+
threshold?: number;
|
|
55
|
+
}
|
|
56
56
|
type GateSeverity = "blocking" | "warning" | "informational";
|
|
57
|
-
|
|
57
|
+
interface GateSchema {
|
|
58
|
+
criteria: GateCriterion[];
|
|
59
|
+
description: string;
|
|
58
60
|
gateId: string;
|
|
59
61
|
name: string;
|
|
60
|
-
description: string;
|
|
61
|
-
criteria: GateCriterion[];
|
|
62
62
|
severity: GateSeverity;
|
|
63
|
-
}
|
|
64
|
-
|
|
63
|
+
}
|
|
64
|
+
interface ArtifactSchema {
|
|
65
65
|
artifactId: string;
|
|
66
|
-
name: string;
|
|
67
|
-
description: string;
|
|
68
|
-
stage: string;
|
|
69
66
|
contentSchema: Record<string, unknown>;
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
type ReasoningRole = {
|
|
73
|
-
roleId: string;
|
|
67
|
+
description: string;
|
|
74
68
|
name: string;
|
|
69
|
+
requiredFields: string[];
|
|
70
|
+
stage: string;
|
|
71
|
+
}
|
|
72
|
+
interface ReasoningRole {
|
|
75
73
|
description: string;
|
|
76
|
-
perspective: string;
|
|
77
|
-
optimizesFor: string;
|
|
78
74
|
mayBlock: boolean;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
name: string;
|
|
76
|
+
optimizesFor: string;
|
|
77
|
+
perspective: string;
|
|
78
|
+
roleId: string;
|
|
79
|
+
}
|
|
80
|
+
interface InquiryShapingQuestionTemplate {
|
|
83
81
|
priority?: "critical" | "high" | "medium" | "low";
|
|
82
|
+
questionType: "validation" | "falsification" | "assumption_probe" | "counterfactual" | "scope" | "comparison" | "mechanism" | "general";
|
|
84
83
|
template: string;
|
|
85
|
-
whenObjectiveIncludes?: string[];
|
|
86
|
-
};
|
|
87
|
-
type InquiryShapingTaskTemplate = {
|
|
88
84
|
templateId: string;
|
|
89
|
-
|
|
85
|
+
whenObjectiveIncludes?: string[];
|
|
86
|
+
}
|
|
87
|
+
interface InquiryShapingTaskTemplate {
|
|
90
88
|
description?: string;
|
|
91
|
-
taskType?: "general" | "find_evidence" | "verify_claim" | "research" | "review" | "interview" | "analysis" | "track_metrics";
|
|
92
89
|
priority?: "urgent" | "high" | "medium" | "low";
|
|
90
|
+
taskType?: "general" | "find_evidence" | "verify_claim" | "research" | "review" | "interview" | "analysis" | "track_metrics";
|
|
91
|
+
templateId: string;
|
|
92
|
+
title: string;
|
|
93
93
|
whenObjectiveIncludes?: string[];
|
|
94
94
|
whenQuestionTypes?: string[];
|
|
95
|
-
}
|
|
96
|
-
|
|
95
|
+
}
|
|
96
|
+
interface InquiryShapingFrameworkHint {
|
|
97
|
+
boost?: number;
|
|
97
98
|
frameworkName: string;
|
|
99
|
+
reason?: string;
|
|
98
100
|
whenObjectiveIncludes?: string[];
|
|
99
101
|
whenQuestionTypes?: string[];
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
type InquiryShapingConfig = {
|
|
102
|
+
}
|
|
103
|
+
interface InquiryShapingConfig {
|
|
104
|
+
frameworkHints?: InquiryShapingFrameworkHint[];
|
|
104
105
|
questionTemplates?: InquiryShapingQuestionTemplate[];
|
|
105
106
|
taskTemplates?: InquiryShapingTaskTemplate[];
|
|
106
|
-
|
|
107
|
-
};
|
|
107
|
+
}
|
|
108
108
|
type RuntimeTarget = "claude-code" | "codex" | "hybrid" | "portable";
|
|
109
109
|
type PromptSource = "langfuse" | "file";
|
|
110
110
|
type PromptChannel = "bootstrap" | "workflow" | "analysis" | "review" | "tool";
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
interface PromptBinding {
|
|
112
|
+
channel: PromptChannel;
|
|
113
113
|
description: string;
|
|
114
|
-
source: PromptSource;
|
|
115
|
-
ref: string;
|
|
116
114
|
fallbackRef?: string;
|
|
117
|
-
|
|
115
|
+
promptId: string;
|
|
116
|
+
ref: string;
|
|
118
117
|
required: boolean;
|
|
119
118
|
runtimeTargets?: RuntimeTarget[];
|
|
120
|
-
|
|
119
|
+
source: PromptSource;
|
|
120
|
+
}
|
|
121
121
|
type ToolKind = "mcp" | "cli" | "script" | "hook" | "ai-tool";
|
|
122
|
-
|
|
123
|
-
toolId: string;
|
|
122
|
+
interface ToolBinding {
|
|
124
123
|
description: string;
|
|
125
|
-
kind: ToolKind;
|
|
126
124
|
entrypoint: string;
|
|
125
|
+
kind: ToolKind;
|
|
127
126
|
required: boolean;
|
|
128
127
|
runtimeTargets?: RuntimeTarget[];
|
|
129
|
-
|
|
128
|
+
toolId: string;
|
|
129
|
+
}
|
|
130
130
|
type SetupAssetKind = "instruction" | "settings" | "hook" | "skill" | "agent" | "manifest" | "template" | "inbox" | "script" | "ui";
|
|
131
|
-
|
|
131
|
+
interface SetupAsset {
|
|
132
132
|
assetId: string;
|
|
133
|
-
kind: SetupAssetKind;
|
|
134
133
|
description: string;
|
|
134
|
+
kind: SetupAssetKind;
|
|
135
135
|
path: string;
|
|
136
136
|
required: boolean;
|
|
137
137
|
runtimeTargets?: RuntimeTarget[];
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
slug: string;
|
|
141
|
-
name: string;
|
|
138
|
+
}
|
|
139
|
+
interface TopicTemplate {
|
|
142
140
|
description: string;
|
|
143
|
-
parentSlug?: string;
|
|
144
|
-
ontologyId?: string;
|
|
145
|
-
};
|
|
146
|
-
type InstallProfile = {
|
|
147
|
-
profileId: string;
|
|
148
141
|
name: string;
|
|
142
|
+
ontologyId?: string;
|
|
143
|
+
parentSlug?: string;
|
|
144
|
+
slug: string;
|
|
145
|
+
}
|
|
146
|
+
interface InstallProfile {
|
|
147
|
+
assetIds: string[];
|
|
148
|
+
defaultTopicSlugs: string[];
|
|
149
149
|
description: string;
|
|
150
|
-
|
|
150
|
+
name: string;
|
|
151
|
+
profileId: string;
|
|
151
152
|
promptIds: string[];
|
|
153
|
+
runtimeTarget: RuntimeTarget;
|
|
152
154
|
toolIds: string[];
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
type OperatingSystemLayer = {
|
|
155
|
+
}
|
|
156
|
+
interface OperatingSystemLayer {
|
|
157
|
+
installProfiles?: InstallProfile[];
|
|
157
158
|
prompts?: PromptBinding[];
|
|
158
|
-
tools?: ToolBinding[];
|
|
159
159
|
setupAssets?: SetupAsset[];
|
|
160
|
+
tools?: ToolBinding[];
|
|
160
161
|
topicTemplates?: TopicTemplate[];
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
}
|
|
163
|
+
interface DomainPack {
|
|
164
|
+
appPackKeys?: string[];
|
|
165
|
+
artifacts: ArtifactSchema[];
|
|
166
|
+
gates: GateSchema[];
|
|
167
|
+
inquiryShaping?: InquiryShapingConfig;
|
|
168
|
+
methodologyPackId?: string;
|
|
165
169
|
name: string;
|
|
166
|
-
version: string;
|
|
167
170
|
ontologyBindings: OntologyBinding[];
|
|
171
|
+
operatingSystem?: OperatingSystemLayer;
|
|
172
|
+
packId: string;
|
|
173
|
+
roles: ReasoningRole[];
|
|
168
174
|
topicRoots: TopicRoot[];
|
|
175
|
+
version: string;
|
|
169
176
|
workflows: WorkflowTemplate[];
|
|
170
|
-
|
|
171
|
-
artifacts: ArtifactSchema[];
|
|
172
|
-
roles: ReasoningRole[];
|
|
173
|
-
inquiryShaping?: InquiryShapingConfig;
|
|
174
|
-
operatingSystem?: OperatingSystemLayer;
|
|
175
|
-
appPackKeys?: string[];
|
|
176
|
-
methodologyPackId?: string;
|
|
177
|
-
};
|
|
177
|
+
}
|
|
178
178
|
type DomainPackInput = Omit<DomainPack, "appPackKeys"> & {
|
|
179
179
|
appPackKeys?: string[];
|
|
180
180
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/domain-pack/contracts.ts"],"names":[],"mappings":";AAoSA,SAAS,cAAc,MAAA,EAA4B;AACjD,EAAA,OAAO,KAAA,CAAM,IAAA;AAAA,IACX,IAAI,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,CAAC,MAAM,CAAA,CAAE,IAAA,EAAM,CAAA,CAAE,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,MAAA,GAAS,CAAC,CAAC;AAAA,GACjE;AACF;AAMA,SAAS,wBACP,MAAA,EAC6B;AAC7B,EAAA,OAAO,MAAA,GAAU,aAAA,CAAc,MAAM,CAAA,GAAwB,MAAA;AAC/D;AAEA,SAAS,yBAAyB,OAAA,EAA2C;AAC3E,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xC,iBAAA,EAAmB,aAAA,CAAc,OAAA,CAAQ,iBAAiB;AAAA,KAC5D,CAAE;AAAA,GACJ;AACF;AAEO,SAAS,iBAAiB,KAAA,EAAoC;AACnE,EAAA,OAAO;AAAA,IACL,GAAG,KAAA;AAAA,IACH,gBAAA,EAAkB,KAAA,CAAM,gBAAA,CAAiB,GAAA,CAAI,wBAAwB,CAAA;AAAA,IACrE,aAAa,KAAA,CAAM,WAAA,GACf,aAAA,CAAc,KAAA,CAAM,WAAW,CAAA,GAC/B,MAAA;AAAA,IACJ,eAAA,EAAiB,wBAAA,CAAyB,KAAA,CAAM,eAAe,CAAA;AAAA,IAC/D,SAAA,EAAW,KAAA,CAAM,SAAA,CAAU,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,MACrC,GAAG,CAAA;AAAA,MACH,iBAAA,EAAmB,aAAA,CAAc,CAAA,CAAE,iBAAiB,CAAA;AAAA,MACpD,eAAA,EAAiB,aAAA,CAAc,CAAA,CAAE,eAAe,CAAA;AAAA,MAChD,KAAA,EAAO,CAAA,CAAE,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,QACzB,GAAG,CAAA;AAAA,QACH,aAAA,EAAe,aAAA,CAAc,CAAA,CAAE,aAAa,CAAA;AAAA,QAC5C,UAAU,CAAA,CAAE,QAAA,GAAW,aAAA,CAAc,CAAA,CAAE,QAAQ,CAAA,GAAI;AAAA,OACrD,CAAE;AAAA,KACJ,CAAE;AAAA,GACJ;AACF","file":"contracts.js","sourcesContent":["/**\n * Domain Pack Contracts\n *\n * A DomainPack is a self-contained reasoning context bundle that defines\n * how reasoning works in a specific domain. It binds ontology versions,\n * defines topic structure, declares workflow templates, gate schemas,\n * artifact schemas, and reasoning roles.\n *\n * This is the THIRD pack type in Lucern's architecture:\n * - AppPackManifest: UI routes, surfaces, policy profiles (app-level)\n * - MethodologyPack: Agent workflow phases, gates, enforcement (process-level)\n * - DomainPack: Reasoning domain context (domain-level)\n *\n * All fields are internal until RS-5+ external authoring certification.\n */\n\n// ---------------------------------------------------------------------------\n// Ontology Binding — ties a pack to specific ontology versions\n// ---------------------------------------------------------------------------\n\nexport type OntologyProvisionMode = \"bind\" | \"seed\" | \"extend\";\n\nexport type OntologyBinding = {\n ontologyId: string;\n versionConstraint: string; // semver range, e.g., \"^1.0.0\"\n required: boolean;\n provisionMode?: OntologyProvisionMode;\n seedRef?: string;\n requiredEntityTypes?: string[];\n requiredEdgeTypes?: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Topic Root — defines the domain's top-level topic tree structure\n// ---------------------------------------------------------------------------\n\nexport type TopicRoot = {\n slug: string;\n name: string;\n description: string;\n ontologyId?: string; // which ontology governs this root\n};\n\n// ---------------------------------------------------------------------------\n// Workflow Template — shape of a workflow (not execution logic)\n// ---------------------------------------------------------------------------\n\nexport type WorkflowStep = {\n stepId: string;\n name: string;\n description: string;\n requiredRoles: string[]; // roleId references\n produces?: string[]; // artifactId references\n gateId?: string; // gate checked after this step\n};\n\nexport type WorkflowTemplate = {\n workflowId: string;\n name: string;\n description: string;\n steps: WorkflowStep[];\n requiredArtifacts: string[]; // artifactId references\n gateCheckpoints: string[]; // gateId references\n};\n\n// ---------------------------------------------------------------------------\n// Gate Schema — declarative description of what must be true\n// ---------------------------------------------------------------------------\n\nexport type GateCriterionOperator = \"gte\" | \"lte\" | \"eq\" | \"gt\" | \"lt\";\n\nexport type GateCriterion = {\n criterionId: string;\n description: string;\n metric: string;\n threshold?: number;\n operator?: GateCriterionOperator;\n};\n\nexport type GateSeverity = \"blocking\" | \"warning\" | \"informational\";\n\nexport type GateSchema = {\n gateId: string;\n name: string;\n description: string;\n criteria: GateCriterion[];\n severity: GateSeverity;\n};\n\n// ---------------------------------------------------------------------------\n// Artifact Schema — what artifacts workflows produce\n// ---------------------------------------------------------------------------\n\nexport type ArtifactSchema = {\n artifactId: string;\n name: string;\n description: string;\n stage: string; // workflow step that produces this\n contentSchema: Record<string, unknown>; // JSON Schema for content\n requiredFields: string[];\n};\n\n// ---------------------------------------------------------------------------\n// Reasoning Role — epistemic actors in the domain\n// ---------------------------------------------------------------------------\n\nexport type ReasoningRole = {\n roleId: string;\n name: string;\n description: string;\n perspective: string;\n optimizesFor: string;\n mayBlock: boolean; // Epistemic Invariant #13: agents may block progress\n};\n\n// ---------------------------------------------------------------------------\n// Inquiry Shaping — pack-level hooks for RS-3 auto-shaping\n// ---------------------------------------------------------------------------\n\nexport type InquiryShapingQuestionTemplate = {\n templateId: string;\n questionType:\n | \"validation\"\n | \"falsification\"\n | \"assumption_probe\"\n | \"counterfactual\"\n | \"scope\"\n | \"comparison\"\n | \"mechanism\"\n | \"general\";\n priority?: \"critical\" | \"high\" | \"medium\" | \"low\";\n template: string; // Supports {{objective}} and {{hypothesis}}\n whenObjectiveIncludes?: string[];\n};\n\nexport type InquiryShapingTaskTemplate = {\n templateId: string;\n title: string; // Supports {{objective}} and {{hypothesis}}\n description?: string; // Supports {{objective}} and {{hypothesis}}\n taskType?:\n | \"general\"\n | \"find_evidence\"\n | \"verify_claim\"\n | \"research\"\n | \"review\"\n | \"interview\"\n | \"analysis\"\n | \"track_metrics\";\n priority?: \"urgent\" | \"high\" | \"medium\" | \"low\";\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n};\n\nexport type InquiryShapingFrameworkHint = {\n frameworkName: string;\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n boost?: number;\n reason?: string;\n};\n\nexport type InquiryShapingConfig = {\n questionTemplates?: InquiryShapingQuestionTemplate[];\n taskTemplates?: InquiryShapingTaskTemplate[];\n frameworkHints?: InquiryShapingFrameworkHint[];\n};\n\n// ---------------------------------------------------------------------------\n// Operating System Layer — prompts, tools, topic bootstrap, install surfaces\n// ---------------------------------------------------------------------------\n\nexport type RuntimeTarget = \"claude-code\" | \"codex\" | \"hybrid\" | \"portable\";\n\nexport type PromptSource = \"langfuse\" | \"file\";\nexport type PromptChannel =\n | \"bootstrap\"\n | \"workflow\"\n | \"analysis\"\n | \"review\"\n | \"tool\";\n\nexport type PromptBinding = {\n promptId: string;\n description: string;\n source: PromptSource;\n ref: string;\n fallbackRef?: string;\n channel: PromptChannel;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n};\n\nexport type ToolKind = \"mcp\" | \"cli\" | \"script\" | \"hook\" | \"ai-tool\";\n\nexport type ToolBinding = {\n toolId: string;\n description: string;\n kind: ToolKind;\n entrypoint: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n};\n\nexport type SetupAssetKind =\n | \"instruction\"\n | \"settings\"\n | \"hook\"\n | \"skill\"\n | \"agent\"\n | \"manifest\"\n | \"template\"\n | \"inbox\"\n | \"script\"\n | \"ui\";\n\nexport type SetupAsset = {\n assetId: string;\n kind: SetupAssetKind;\n description: string;\n path: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n};\n\nexport type TopicTemplate = {\n slug: string;\n name: string;\n description: string;\n parentSlug?: string;\n ontologyId?: string;\n};\n\nexport type InstallProfile = {\n profileId: string;\n name: string;\n description: string;\n runtimeTarget: RuntimeTarget;\n promptIds: string[];\n toolIds: string[];\n assetIds: string[];\n defaultTopicSlugs: string[];\n};\n\nexport type OperatingSystemLayer = {\n prompts?: PromptBinding[];\n tools?: ToolBinding[];\n setupAssets?: SetupAsset[];\n topicTemplates?: TopicTemplate[];\n installProfiles?: InstallProfile[];\n};\n\n// ---------------------------------------------------------------------------\n// Domain Pack — the top-level contract\n// ---------------------------------------------------------------------------\n\nexport type DomainPack = {\n // Identity\n packId: string;\n name: string;\n version: string; // semver\n\n // Scope\n ontologyBindings: OntologyBinding[];\n topicRoots: TopicRoot[];\n\n // Workflow Templates\n workflows: WorkflowTemplate[];\n\n // Gate Schemas\n gates: GateSchema[];\n\n // Artifact Schemas\n artifacts: ArtifactSchema[];\n\n // Reasoning Roles\n roles: ReasoningRole[];\n\n // Inquiry shaping hooks\n inquiryShaping?: InquiryShapingConfig;\n\n // Runtime/install packaging layer\n operatingSystem?: OperatingSystemLayer;\n\n // Composition — optional references to other pack types\n appPackKeys?: string[]; // AppPackManifest keys this domain uses\n methodologyPackId?: string; // MethodologyPack for agent behavior\n};\n\n// ---------------------------------------------------------------------------\n// Builder helper — normalizes arrays and validates basic structure\n// ---------------------------------------------------------------------------\n\nfunction dedupeStrings(values: string[]): string[] {\n return Array.from(\n new Set(values.map((v) => v.trim()).filter((v) => v.length > 0))\n );\n}\n\nexport type DomainPackInput = Omit<DomainPack, \"appPackKeys\"> & {\n appPackKeys?: string[];\n};\n\nfunction normalizeRuntimeTargets(\n values: RuntimeTarget[] | undefined\n): RuntimeTarget[] | undefined {\n return values ? (dedupeStrings(values) as RuntimeTarget[]) : undefined;\n}\n\nfunction normalizeOntologyBinding(binding: OntologyBinding): OntologyBinding {\n return {\n ...binding,\n requiredEntityTypes: binding.requiredEntityTypes\n ? dedupeStrings(binding.requiredEntityTypes)\n : undefined,\n requiredEdgeTypes: binding.requiredEdgeTypes\n ? dedupeStrings(binding.requiredEdgeTypes)\n : undefined,\n };\n}\n\nfunction normalizeOperatingSystem(\n layer: OperatingSystemLayer | undefined\n): OperatingSystemLayer | undefined {\n if (!layer) {\n return;\n }\n\n return {\n prompts: layer.prompts?.map((prompt) => ({\n ...prompt,\n runtimeTargets: normalizeRuntimeTargets(prompt.runtimeTargets),\n })),\n tools: layer.tools?.map((tool) => ({\n ...tool,\n runtimeTargets: normalizeRuntimeTargets(tool.runtimeTargets),\n })),\n setupAssets: layer.setupAssets?.map((asset) => ({\n ...asset,\n runtimeTargets: normalizeRuntimeTargets(asset.runtimeTargets),\n })),\n topicTemplates: layer.topicTemplates,\n installProfiles: layer.installProfiles?.map((profile) => ({\n ...profile,\n promptIds: dedupeStrings(profile.promptIds),\n toolIds: dedupeStrings(profile.toolIds),\n assetIds: dedupeStrings(profile.assetIds),\n defaultTopicSlugs: dedupeStrings(profile.defaultTopicSlugs),\n })),\n };\n}\n\nexport function defineDomainPack(input: DomainPackInput): DomainPack {\n return {\n ...input,\n ontologyBindings: input.ontologyBindings.map(normalizeOntologyBinding),\n appPackKeys: input.appPackKeys\n ? dedupeStrings(input.appPackKeys)\n : undefined,\n operatingSystem: normalizeOperatingSystem(input.operatingSystem),\n workflows: input.workflows.map((w) => ({\n ...w,\n requiredArtifacts: dedupeStrings(w.requiredArtifacts),\n gateCheckpoints: dedupeStrings(w.gateCheckpoints),\n steps: w.steps.map((s) => ({\n ...s,\n requiredRoles: dedupeStrings(s.requiredRoles),\n produces: s.produces ? dedupeStrings(s.produces) : undefined,\n })),\n })),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/domain-pack/contracts.ts"],"names":[],"mappings":";AAmSA,SAAS,cAAc,MAAA,EAA4B;AACjD,EAAA,OAAO,KAAA,CAAM,IAAA;AAAA,IACX,IAAI,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,CAAC,MAAM,CAAA,CAAE,IAAA,EAAM,CAAA,CAAE,OAAO,CAAC,CAAA,KAAM,CAAA,CAAE,MAAA,GAAS,CAAC,CAAC;AAAA,GACjE;AACF;AAMA,SAAS,wBACP,MAAA,EAC6B;AAC7B,EAAA,OAAO,MAAA,GAAU,aAAA,CAAc,MAAM,CAAA,GAAwB,MAAA;AAC/D;AAEA,SAAS,yBAAyB,OAAA,EAA2C;AAC3E,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,qBAAqB,OAAA,CAAQ,mBAAA,GACzB,aAAA,CAAc,OAAA,CAAQ,mBAAmB,CAAA,GACzC,MAAA;AAAA,IACJ,mBAAmB,OAAA,CAAQ,iBAAA,GACvB,aAAA,CAAc,OAAA,CAAQ,iBAAiB,CAAA,GACvC;AAAA,GACN;AACF;AAEA,SAAS,yBACP,KAAA,EACkC;AAClC,EAAA,IAAI,CAAC,KAAA,EAAO;AACV,IAAA;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA,CAAM,OAAA,EAAS,GAAA,CAAI,CAAC,MAAA,MAAY;AAAA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AM,SAAA,CAAU,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,MACrC,GAAG,CAAA;AAAA,MACH,iBAAA,EAAmB,aAAA,CAAc,CAAA,CAAE,iBAAiB,CAAA;AAAA,MACpD,eAAA,EAAiB,aAAA,CAAc,CAAA,CAAE,eAAe,CAAA;AAAA,MAChD,KAAA,EAAO,CAAA,CAAE,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,QACzB,GAAG,CAAA;AAAA,QACH,aAAA,EAAe,aAAA,CAAc,CAAA,CAAE,aAAa,CAAA;AAAA,QAC5C,UAAU,CAAA,CAAE,QAAA,GAAW,aAAA,CAAc,CAAA,CAAE,QAAQ,CAAA,GAAI;AAAA,OACrD,CAAE;AAAA,KACJ,CAAE;AAAA,GACJ;AACF","file":"contracts.js","sourcesContent":["/**\n * Domain Pack Contracts\n *\n * A DomainPack is a self-contained reasoning context bundle that defines\n * how reasoning works in a specific domain. It binds ontology versions,\n * defines topic structure, declares workflow templates, gate schemas,\n * artifact schemas, and reasoning roles.\n *\n * This is the THIRD pack type in Lucern's architecture:\n * - AppPackManifest: UI routes, surfaces, policy profiles (app-level)\n * - MethodologyPack: Agent workflow phases, gates, enforcement (process-level)\n * - DomainPack: Reasoning domain context (domain-level)\n *\n * All fields are internal until RS-5+ external authoring certification.\n */\n\n// ---------------------------------------------------------------------------\n// Ontology Binding — ties a pack to specific ontology versions\n// ---------------------------------------------------------------------------\n\nexport type OntologyProvisionMode = \"bind\" | \"seed\" | \"extend\";\n\nexport interface OntologyBinding {\n ontologyId: string;\n provisionMode?: OntologyProvisionMode;\n required: boolean;\n requiredEdgeTypes?: string[];\n requiredEntityTypes?: string[];\n seedRef?: string;\n versionConstraint: string; // semver range, e.g., \"^1.0.0\"\n}\n\n// ---------------------------------------------------------------------------\n// Topic Root — defines the domain's top-level topic tree structure\n// ---------------------------------------------------------------------------\n\nexport interface TopicRoot {\n description: string;\n name: string;\n ontologyId?: string; // which ontology governs this root\n slug: string;\n}\n\n// ---------------------------------------------------------------------------\n// Workflow Template — shape of a workflow (not execution logic)\n// ---------------------------------------------------------------------------\n\nexport interface WorkflowStep {\n description: string;\n gateId?: string; // gate checked after this step\n name: string;\n produces?: string[]; // artifactId references\n requiredRoles: string[]; // roleId references\n stepId: string;\n}\n\nexport interface WorkflowTemplate {\n description: string;\n gateCheckpoints: string[]; // gateId references\n name: string;\n requiredArtifacts: string[]; // artifactId references\n steps: WorkflowStep[];\n workflowId: string;\n}\n\n// ---------------------------------------------------------------------------\n// Gate Schema — declarative description of what must be true\n// ---------------------------------------------------------------------------\n\nexport type GateCriterionOperator = \"gte\" | \"lte\" | \"eq\" | \"gt\" | \"lt\";\n\nexport interface GateCriterion {\n criterionId: string;\n description: string;\n metric: string;\n operator?: GateCriterionOperator;\n threshold?: number;\n}\n\nexport type GateSeverity = \"blocking\" | \"warning\" | \"informational\";\n\nexport interface GateSchema {\n criteria: GateCriterion[];\n description: string;\n gateId: string;\n name: string;\n severity: GateSeverity;\n}\n\n// ---------------------------------------------------------------------------\n// Artifact Schema — what artifacts workflows produce\n// ---------------------------------------------------------------------------\n\nexport interface ArtifactSchema {\n artifactId: string;\n contentSchema: Record<string, unknown>; // JSON Schema for content\n description: string;\n name: string;\n requiredFields: string[];\n stage: string; // workflow step that produces this\n}\n\n// ---------------------------------------------------------------------------\n// Reasoning Role — epistemic actors in the domain\n// ---------------------------------------------------------------------------\n\nexport interface ReasoningRole {\n description: string;\n mayBlock: boolean; // Epistemic Invariant #13: agents may block progress\n name: string;\n optimizesFor: string;\n perspective: string;\n roleId: string;\n}\n\n// ---------------------------------------------------------------------------\n// Inquiry Shaping — pack-level hooks for RS-3 auto-shaping\n// ---------------------------------------------------------------------------\n\nexport interface InquiryShapingQuestionTemplate {\n priority?: \"critical\" | \"high\" | \"medium\" | \"low\";\n questionType:\n | \"validation\"\n | \"falsification\"\n | \"assumption_probe\"\n | \"counterfactual\"\n | \"scope\"\n | \"comparison\"\n | \"mechanism\"\n | \"general\";\n template: string; // Supports {{objective}} and {{hypothesis}}\n templateId: string;\n whenObjectiveIncludes?: string[];\n}\n\nexport interface InquiryShapingTaskTemplate {\n description?: string; // Supports {{objective}} and {{hypothesis}}\n priority?: \"urgent\" | \"high\" | \"medium\" | \"low\";\n taskType?:\n | \"general\"\n | \"find_evidence\"\n | \"verify_claim\"\n | \"research\"\n | \"review\"\n | \"interview\"\n | \"analysis\"\n | \"track_metrics\";\n templateId: string;\n title: string; // Supports {{objective}} and {{hypothesis}}\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n}\n\nexport interface InquiryShapingFrameworkHint {\n boost?: number;\n frameworkName: string;\n reason?: string;\n whenObjectiveIncludes?: string[];\n whenQuestionTypes?: string[];\n}\n\nexport interface InquiryShapingConfig {\n frameworkHints?: InquiryShapingFrameworkHint[];\n questionTemplates?: InquiryShapingQuestionTemplate[];\n taskTemplates?: InquiryShapingTaskTemplate[];\n}\n\n// ---------------------------------------------------------------------------\n// Operating System Layer — prompts, tools, topic bootstrap, install surfaces\n// ---------------------------------------------------------------------------\n\nexport type RuntimeTarget = \"claude-code\" | \"codex\" | \"hybrid\" | \"portable\";\n\nexport type PromptSource = \"langfuse\" | \"file\";\nexport type PromptChannel =\n | \"bootstrap\"\n | \"workflow\"\n | \"analysis\"\n | \"review\"\n | \"tool\";\n\nexport interface PromptBinding {\n channel: PromptChannel;\n description: string;\n fallbackRef?: string;\n promptId: string;\n ref: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n source: PromptSource;\n}\n\nexport type ToolKind = \"mcp\" | \"cli\" | \"script\" | \"hook\" | \"ai-tool\";\n\nexport interface ToolBinding {\n description: string;\n entrypoint: string;\n kind: ToolKind;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n toolId: string;\n}\n\nexport type SetupAssetKind =\n | \"instruction\"\n | \"settings\"\n | \"hook\"\n | \"skill\"\n | \"agent\"\n | \"manifest\"\n | \"template\"\n | \"inbox\"\n | \"script\"\n | \"ui\";\n\nexport interface SetupAsset {\n assetId: string;\n description: string;\n kind: SetupAssetKind;\n path: string;\n required: boolean;\n runtimeTargets?: RuntimeTarget[];\n}\n\nexport interface TopicTemplate {\n description: string;\n name: string;\n ontologyId?: string;\n parentSlug?: string;\n slug: string;\n}\n\nexport interface InstallProfile {\n assetIds: string[];\n defaultTopicSlugs: string[];\n description: string;\n name: string;\n profileId: string;\n promptIds: string[];\n runtimeTarget: RuntimeTarget;\n toolIds: string[];\n}\n\nexport interface OperatingSystemLayer {\n installProfiles?: InstallProfile[];\n prompts?: PromptBinding[];\n setupAssets?: SetupAsset[];\n tools?: ToolBinding[];\n topicTemplates?: TopicTemplate[];\n}\n\n// ---------------------------------------------------------------------------\n// Domain Pack — the top-level contract\n// ---------------------------------------------------------------------------\n\nexport interface DomainPack {\n // Composition — optional references to other pack types\n appPackKeys?: string[]; // AppPackManifest keys this domain uses\n\n // Artifact Schemas\n artifacts: ArtifactSchema[];\n\n // Gate Schemas\n gates: GateSchema[];\n\n // Inquiry shaping hooks\n inquiryShaping?: InquiryShapingConfig;\n methodologyPackId?: string; // MethodologyPack for agent behavior\n name: string;\n\n // Scope\n ontologyBindings: OntologyBinding[];\n\n // Runtime/install packaging layer\n operatingSystem?: OperatingSystemLayer;\n // Identity\n packId: string;\n\n // Reasoning Roles\n roles: ReasoningRole[];\n topicRoots: TopicRoot[];\n version: string; // semver\n\n // Workflow Templates\n workflows: WorkflowTemplate[];\n}\n\n// ---------------------------------------------------------------------------\n// Builder helper — normalizes arrays and validates basic structure\n// ---------------------------------------------------------------------------\n\nfunction dedupeStrings(values: string[]): string[] {\n return Array.from(\n new Set(values.map((v) => v.trim()).filter((v) => v.length > 0))\n );\n}\n\nexport type DomainPackInput = Omit<DomainPack, \"appPackKeys\"> & {\n appPackKeys?: string[];\n};\n\nfunction normalizeRuntimeTargets(\n values: RuntimeTarget[] | undefined\n): RuntimeTarget[] | undefined {\n return values ? (dedupeStrings(values) as RuntimeTarget[]) : undefined;\n}\n\nfunction normalizeOntologyBinding(binding: OntologyBinding): OntologyBinding {\n return {\n ...binding,\n requiredEntityTypes: binding.requiredEntityTypes\n ? dedupeStrings(binding.requiredEntityTypes)\n : undefined,\n requiredEdgeTypes: binding.requiredEdgeTypes\n ? dedupeStrings(binding.requiredEdgeTypes)\n : undefined,\n };\n}\n\nfunction normalizeOperatingSystem(\n layer: OperatingSystemLayer | undefined\n): OperatingSystemLayer | undefined {\n if (!layer) {\n return;\n }\n\n return {\n prompts: layer.prompts?.map((prompt) => ({\n ...prompt,\n runtimeTargets: normalizeRuntimeTargets(prompt.runtimeTargets),\n })),\n tools: layer.tools?.map((tool) => ({\n ...tool,\n runtimeTargets: normalizeRuntimeTargets(tool.runtimeTargets),\n })),\n setupAssets: layer.setupAssets?.map((asset) => ({\n ...asset,\n runtimeTargets: normalizeRuntimeTargets(asset.runtimeTargets),\n })),\n topicTemplates: layer.topicTemplates,\n installProfiles: layer.installProfiles?.map((profile) => ({\n ...profile,\n promptIds: dedupeStrings(profile.promptIds),\n toolIds: dedupeStrings(profile.toolIds),\n assetIds: dedupeStrings(profile.assetIds),\n defaultTopicSlugs: dedupeStrings(profile.defaultTopicSlugs),\n })),\n };\n}\n\nexport function defineDomainPack(input: DomainPackInput): DomainPack {\n return {\n ...input,\n ontologyBindings: input.ontologyBindings.map(normalizeOntologyBinding),\n appPackKeys: input.appPackKeys\n ? dedupeStrings(input.appPackKeys)\n : undefined,\n operatingSystem: normalizeOperatingSystem(input.operatingSystem),\n workflows: input.workflows.map((w) => ({\n ...w,\n requiredArtifacts: dedupeStrings(w.requiredArtifacts),\n gateCheckpoints: dedupeStrings(w.gateCheckpoints),\n steps: w.steps.map((s) => ({\n ...s,\n requiredRoles: dedupeStrings(s.requiredRoles),\n produces: s.produces ? dedupeStrings(s.produces) : undefined,\n })),\n })),\n };\n}\n"]}
|