@untangle-code/config 0.0.0-stage → 0.1.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/LICENSE +661 -0
- package/NOTICE +90 -0
- package/README.md +262 -2
- package/THIRD_PARTY_LICENSES.md +29 -0
- package/dist/chunker-budget.d.ts +58 -0
- package/dist/chunker-budget.d.ts.map +1 -0
- package/dist/chunker-budget.js +11 -0
- package/dist/chunker-budget.js.map +1 -0
- package/dist/defaults.d.ts +50 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +179 -0
- package/dist/defaults.js.map +1 -0
- package/dist/discovery.d.ts +40 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +76 -0
- package/dist/discovery.js.map +1 -0
- package/dist/env.d.ts +37 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +100 -0
- package/dist/env.js.map +1 -0
- package/dist/hash.d.ts +37 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +52 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/load.d.ts +61 -0
- package/dist/load.d.ts.map +1 -0
- package/dist/load.js +264 -0
- package/dist/load.js.map +1 -0
- package/dist/merge.d.ts +32 -0
- package/dist/merge.d.ts.map +1 -0
- package/dist/merge.js +65 -0
- package/dist/merge.js.map +1 -0
- package/dist/migrations.d.ts +26 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +40 -0
- package/dist/migrations.js.map +1 -0
- package/dist/parse.d.ts +7 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +14 -0
- package/dist/parse.js.map +1 -0
- package/dist/paths.d.ts +14 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +37 -0
- package/dist/paths.js.map +1 -0
- package/dist/schema.d.ts +5 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +19 -0
- package/dist/schema.js.map +1 -0
- package/dist/secrets.d.ts +33 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +69 -0
- package/dist/secrets.js.map +1 -0
- package/dist/types.d.ts +323 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +20 -0
- package/dist/types.js.map +1 -0
- package/dist/user-config.d.ts +13 -0
- package/dist/user-config.d.ts.map +1 -0
- package/dist/user-config.js +34 -0
- package/dist/user-config.js.map +1 -0
- package/dist/validate.d.ts +36 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +337 -0
- package/dist/validate.js.map +1 -0
- package/package.json +65 -3
- package/schemas/config-v1.json +375 -0
- package/src/chunker-budget.ts +63 -0
- package/src/defaults.ts +207 -0
- package/src/discovery.ts +95 -0
- package/src/env.ts +141 -0
- package/src/hash.ts +71 -0
- package/src/index.ts +51 -0
- package/src/load.ts +346 -0
- package/src/merge.ts +69 -0
- package/src/migrations.ts +64 -0
- package/src/parse.ts +18 -0
- package/src/paths.ts +42 -0
- package/src/schema.ts +23 -0
- package/src/secrets.ts +78 -0
- package/src/types.ts +366 -0
- package/src/user-config.ts +48 -0
- package/src/validate.ts +430 -0
package/dist/defaults.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product defaults (spec.md §4.5 "Defaultprofil für MVP"; product.md §11).
|
|
3
|
+
*
|
|
4
|
+
* These are layer 6 (lowest priority) of spec.md §4.1's six-level layering.
|
|
5
|
+
* Every field an `EffectiveUntangleConfigV1` guarantees present is defaulted
|
|
6
|
+
* here.
|
|
7
|
+
*/
|
|
8
|
+
import { COGNITIVE_ALGORITHM_ID } from "@untangle-code/domain";
|
|
9
|
+
/**
|
|
10
|
+
* Embedding profile fields that are NOT part of `EmbeddingConfig` (spec.md
|
|
11
|
+
* §4.5 lists exactly ten fields, none of them `normalization` or
|
|
12
|
+
* `preparedTextVersion`) but ARE required inputs to
|
|
13
|
+
* `buildEmbeddingProfileId` (spec.md §5.7). Untangle decision: default
|
|
14
|
+
* normalization to "none" (no vector post-processing) and mint an explicit
|
|
15
|
+
* prepared-text format version so a future change to how document text is
|
|
16
|
+
* assembled can roll `embedding_profile_id` forward deliberately.
|
|
17
|
+
*/
|
|
18
|
+
export const DEFAULT_EMBEDDING_NORMALIZATION = "none";
|
|
19
|
+
export const PREPARED_TEXT_VERSION = "untangle-prepared-text-v1";
|
|
20
|
+
/** spec.md §4.5 "Defaultprofil für MVP" — Ollama, nomic-embed-text, 768 dims. */
|
|
21
|
+
export const DEFAULT_EMBEDDING_CONFIG = {
|
|
22
|
+
provider: "ollama",
|
|
23
|
+
mode: "auto",
|
|
24
|
+
model: "nomic-embed-text",
|
|
25
|
+
dimensions: 768,
|
|
26
|
+
contextLength: 2048,
|
|
27
|
+
queryPrefix: "search_query: ",
|
|
28
|
+
documentPrefix: "search_document: ",
|
|
29
|
+
includePath: true,
|
|
30
|
+
batchSize: 32,
|
|
31
|
+
maxConnections: 4,
|
|
32
|
+
requestTimeoutMs: 120000,
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Qdrant defaults. spec.md §4.4 defines the shape but not default values;
|
|
36
|
+
* `managed` mode with no explicit `url` matches product.md §4.1's
|
|
37
|
+
* zero-config narrative (the CLI starts a managed container and fills `url`
|
|
38
|
+
* in from that at runtime — this package only supplies the mode default).
|
|
39
|
+
*/
|
|
40
|
+
export const DEFAULT_QDRANT_CONFIG = {
|
|
41
|
+
mode: "managed",
|
|
42
|
+
collectionPrefix: "untangle_",
|
|
43
|
+
requestTimeoutMs: 30000,
|
|
44
|
+
maxRetries: 3,
|
|
45
|
+
upsertMaxPoints: 256,
|
|
46
|
+
upsertBudgetBytes: 4 * 1024 * 1024,
|
|
47
|
+
};
|
|
48
|
+
/** Embedded search for new projects; explicit legacy Qdrant layers retain their backend. */
|
|
49
|
+
export const DEFAULT_STORAGE_CONFIG = {
|
|
50
|
+
backend: "lancedb",
|
|
51
|
+
path: ".untangle/index/lancedb",
|
|
52
|
+
};
|
|
53
|
+
/** spec.md §4.6; numeric defaults are an Untangle decision, chosen conservatively. */
|
|
54
|
+
export const DEFAULT_INDEX_CONFIG = {
|
|
55
|
+
watch: true,
|
|
56
|
+
reconcileIntervalMinutes: 30,
|
|
57
|
+
maxFileSizeMb: 5,
|
|
58
|
+
maxGraphFileSizeMb: 20,
|
|
59
|
+
scanConcurrency: 8,
|
|
60
|
+
embeddingConcurrency: 4,
|
|
61
|
+
filesPerCheckpoint: 200,
|
|
62
|
+
targetChunkTokens: 900,
|
|
63
|
+
maxChunkTokens: 1500,
|
|
64
|
+
fallbackOverlapTokens: 100,
|
|
65
|
+
includeDotFiles: false,
|
|
66
|
+
indexExtensionless: false,
|
|
67
|
+
extraExtensions: [],
|
|
68
|
+
extensionLanguageMap: {},
|
|
69
|
+
};
|
|
70
|
+
/** Untangle decision (see `types.ts` `SearchConfig` doc comment). */
|
|
71
|
+
export const DEFAULT_SEARCH_CONFIG = {
|
|
72
|
+
defaultLimit: 10,
|
|
73
|
+
defaultCandidateLimit: 50,
|
|
74
|
+
maxCandidateLimit: 200,
|
|
75
|
+
diversifyByDefault: false,
|
|
76
|
+
boostWeights: {
|
|
77
|
+
exactSymbol: 0.15,
|
|
78
|
+
exactPath: 0.1,
|
|
79
|
+
repoPriority: 0.05,
|
|
80
|
+
graphProximity: 0.1,
|
|
81
|
+
recency: 0.05,
|
|
82
|
+
duplicatePenalty: 0.2,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
/** Untangle decision, values taken from architecture.md §17.4's per-query limits. */
|
|
86
|
+
export const DEFAULT_GRAPH_CONFIG = {
|
|
87
|
+
enabled: true,
|
|
88
|
+
maxTraversalDepth: 20,
|
|
89
|
+
maxTraversalNodes: 2000,
|
|
90
|
+
maxTraversalEdges: 4000,
|
|
91
|
+
maxTraversalWallTimeMs: 5000,
|
|
92
|
+
includeDynamicImports: true,
|
|
93
|
+
};
|
|
94
|
+
/** Untangle decision (see `types.ts` `ComplexityConfig` doc comment). */
|
|
95
|
+
export const DEFAULT_COMPLEXITY_CONFIG = {
|
|
96
|
+
enabled: true,
|
|
97
|
+
cognitiveAlgorithm: COGNITIVE_ALGORITHM_ID,
|
|
98
|
+
cyclomaticVariant: "both",
|
|
99
|
+
maintainabilityIndexEnabled: true,
|
|
100
|
+
};
|
|
101
|
+
/** spec.md §17.6 default risk score weights. */
|
|
102
|
+
export const DEFAULT_CHANGE_CONFIG = {
|
|
103
|
+
enabled: true,
|
|
104
|
+
riskWeights: {
|
|
105
|
+
churn: 0.25,
|
|
106
|
+
positiveCognitiveDelta: 0.2,
|
|
107
|
+
positiveCyclomaticDelta: 0.15,
|
|
108
|
+
blastRadius: 0.15,
|
|
109
|
+
graphCentrality: 0.1,
|
|
110
|
+
semanticChange: 0.1,
|
|
111
|
+
testDistance: 0.05,
|
|
112
|
+
},
|
|
113
|
+
symbolMatching: {
|
|
114
|
+
tokenSimilarityMin: 0.6,
|
|
115
|
+
enableEmbeddingSimilarity: true,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
/** spec.md §4.7 shape; MVP defaults chosen deliberately permissive (warn, not fail). */
|
|
119
|
+
export const DEFAULT_QUALITY_GATE_CONFIG = {
|
|
120
|
+
mode: "warn",
|
|
121
|
+
newCyclesAllowed: 0,
|
|
122
|
+
minimumParseQuality: "partial",
|
|
123
|
+
ignoreExistingViolations: true,
|
|
124
|
+
};
|
|
125
|
+
/** spec.md §24: "Telemetrie MUSS standardmäßig aus sein." */
|
|
126
|
+
export const DEFAULT_TELEMETRY_CONFIG = {
|
|
127
|
+
enabled: false,
|
|
128
|
+
logLevel: "info",
|
|
129
|
+
metricsExport: "none",
|
|
130
|
+
};
|
|
131
|
+
/** portfolio.md §14.4 defaults, spelled out explicitly. */
|
|
132
|
+
export const DEFAULT_PORTFOLIO_CONFIG = {
|
|
133
|
+
enabled: true,
|
|
134
|
+
includeTransitive: false,
|
|
135
|
+
conventionMinRepos: 2,
|
|
136
|
+
radar: {
|
|
137
|
+
adoptShareMin: 0.5,
|
|
138
|
+
maintainShareMin: 0.2,
|
|
139
|
+
retireAfterDays: 540,
|
|
140
|
+
},
|
|
141
|
+
blueprint: {
|
|
142
|
+
weights: {
|
|
143
|
+
adoption: 0.4,
|
|
144
|
+
recency: 0.2,
|
|
145
|
+
health: 0.25,
|
|
146
|
+
versionConsistency: 0.15,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
enrichment: {
|
|
150
|
+
enabled: false,
|
|
151
|
+
registries: [],
|
|
152
|
+
cacheTtlHours: 168,
|
|
153
|
+
timeoutMs: 10000,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
/** Current config schema version this package produces and validates against. */
|
|
157
|
+
export const CURRENT_SCHEMA_VERSION = 1;
|
|
158
|
+
/**
|
|
159
|
+
* The complete product-default layer (spec.md §4.1 layer 6, lowest
|
|
160
|
+
* priority). Every optional sub-config `EffectiveUntangleConfigV1`
|
|
161
|
+
* guarantees present is defaulted here; `repositories` and
|
|
162
|
+
* `contextArtifacts` are deliberately absent (spec.md §4.3: no universal
|
|
163
|
+
* default repository set exists).
|
|
164
|
+
*/
|
|
165
|
+
export const PRODUCT_DEFAULT_CONFIG = {
|
|
166
|
+
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
167
|
+
storage: DEFAULT_STORAGE_CONFIG,
|
|
168
|
+
qdrant: DEFAULT_QDRANT_CONFIG,
|
|
169
|
+
embeddings: DEFAULT_EMBEDDING_CONFIG,
|
|
170
|
+
index: DEFAULT_INDEX_CONFIG,
|
|
171
|
+
search: DEFAULT_SEARCH_CONFIG,
|
|
172
|
+
graph: DEFAULT_GRAPH_CONFIG,
|
|
173
|
+
complexity: DEFAULT_COMPLEXITY_CONFIG,
|
|
174
|
+
changes: DEFAULT_CHANGE_CONFIG,
|
|
175
|
+
qualityGate: DEFAULT_QUALITY_GATE_CONFIG,
|
|
176
|
+
telemetry: DEFAULT_TELEMETRY_CONFIG,
|
|
177
|
+
portfolio: DEFAULT_PORTFOLIO_CONFIG,
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAiB/D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAe,CAAC;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAAoC,CAAC;AAE1E,iFAAiF;AACjF,MAAM,CAAC,MAAM,wBAAwB,GAAoB;IACvD,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,kBAAkB;IACzB,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,gBAAgB;IAC7B,cAAc,EAAE,mBAAmB;IACnC,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,MAAM;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,WAAW;IAC7B,gBAAgB,EAAE,KAAK;IACvB,UAAU,EAAE,CAAC;IACb,eAAe,EAAE,GAAG;IACpB,iBAAiB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;CACnC,CAAC;AAEF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,yBAAyB;CAChC,CAAC;AAEF,sFAAsF;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,KAAK,EAAE,IAAI;IACX,wBAAwB,EAAE,EAAE;IAC5B,aAAa,EAAE,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C3B,MAAM,EAAE,qBAAqB;IAC7B,KAAK,EAAE,oBAAoB;IAC3B,UAAU,EAAE,yBAAyB;IACrC,OAAO,EAAE,qBAAqB;IAC9B,WAAW,EAAE,2BAA2B;IACxC,SAAS,EAAE,wBAAwB;IACnC,SAAS,EAAE,wBAAwB;CACpC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const PROJECT_CONFIG_FILE_NAME = ".untangle.json";
|
|
2
|
+
export declare const LOCAL_CONFIG_FILE_NAME = ".untangle.local.json";
|
|
3
|
+
/** Folder-contained project configuration; legacy root files retain priority. */
|
|
4
|
+
export declare const PROJECT_FOLDER_CONFIG_FILE_NAME: string;
|
|
5
|
+
/**
|
|
6
|
+
* `untangle.toml`, the file `untangle init` writes (WP-125).
|
|
7
|
+
*
|
|
8
|
+
* WP-222: it used to be invisible here. `init` wrote `untangle.toml`,
|
|
9
|
+
* discovery looked only for `.untangle.json`, and so `untangle doctor`
|
|
10
|
+
* reported "no configuration found" about a configuration that had just been
|
|
11
|
+
* written — and advised running `untangle init`, which had just run. A user
|
|
12
|
+
* following that advice loops forever. One file name known in one place ends
|
|
13
|
+
* that: whatever `init` writes is exactly what discovery finds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PROJECT_TOML_CONFIG_FILE_NAME = "untangle.toml";
|
|
16
|
+
/**
|
|
17
|
+
* Searches `startPath` and its ancestors for `fileName`, stopping after the
|
|
18
|
+
* first directory that is a repository root (has `.git`) or after the
|
|
19
|
+
* filesystem root. Returns the absolute path of the first match, or
|
|
20
|
+
* `undefined` if none is found.
|
|
21
|
+
*/
|
|
22
|
+
export declare function discoverConfigFile(startPath: string, fileName: string): string | undefined;
|
|
23
|
+
/** Result of discovering the project-level config files (spec.md §4.1, layers 3–4). */
|
|
24
|
+
export interface DiscoveredConfigFiles {
|
|
25
|
+
/** `.untangle.json`, or `.untangle/config.json` when no legacy project file exists. */
|
|
26
|
+
projectConfigPath: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* `untangle.toml`, layer 4b — the file `untangle init` writes. It sits
|
|
29
|
+
* directly BENEATH `.untangle.json`: where both exist, the JSON file wins,
|
|
30
|
+
* and `loadConfig` warns rather than picking a winner in silence.
|
|
31
|
+
*/
|
|
32
|
+
tomlConfigPath: string | undefined;
|
|
33
|
+
/** `.untangle.local.json`, layer 3 — SHOULD be gitignored (spec.md §4.1). */
|
|
34
|
+
localConfigPath: string | undefined;
|
|
35
|
+
/** Logical project directory for the folder layout, distinct from the config directory. */
|
|
36
|
+
projectRoot?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Discovers project configuration upward, without crossing a repository boundary. */
|
|
39
|
+
export declare function discoverConfigFiles(startPath: string): DiscoveredConfigFiles;
|
|
40
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AACzD,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAC7D,iFAAiF;AACjF,eAAO,MAAM,+BAA+B,QAAmC,CAAC;AAChF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,kBAAkB,CAAC;AAM7D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAuB1F;AAED,uFAAuF;AACvF,MAAM,WAAW,qBAAqB;IACpC,uFAAuF;IACvF,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;OAIG;IACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,6EAA6E;IAC7E,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB,CAa5E"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config file discovery (spec.md §4.1, §4.3 mention `.untangle.json` /
|
|
3
|
+
* `.untangle.local.json` without specifying how they are found;
|
|
4
|
+
* architecture.md §6.3 assigns "Config Discovery" to this package).
|
|
5
|
+
*
|
|
6
|
+
* Upward search from a start path, checking one directory at a time, until
|
|
7
|
+
* either the file is found, the repository root is reached (a directory
|
|
8
|
+
* containing `.git`, checked AFTER that directory's own candidate file so the
|
|
9
|
+
* repo root itself is still searched), or the filesystem root is reached.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, statSync } from "node:fs";
|
|
12
|
+
import { dirname, join, resolve } from "node:path";
|
|
13
|
+
export const PROJECT_CONFIG_FILE_NAME = ".untangle.json";
|
|
14
|
+
export const LOCAL_CONFIG_FILE_NAME = ".untangle.local.json";
|
|
15
|
+
/** Folder-contained project configuration; legacy root files retain priority. */
|
|
16
|
+
export const PROJECT_FOLDER_CONFIG_FILE_NAME = join(".untangle", "config.json");
|
|
17
|
+
/**
|
|
18
|
+
* `untangle.toml`, the file `untangle init` writes (WP-125).
|
|
19
|
+
*
|
|
20
|
+
* WP-222: it used to be invisible here. `init` wrote `untangle.toml`,
|
|
21
|
+
* discovery looked only for `.untangle.json`, and so `untangle doctor`
|
|
22
|
+
* reported "no configuration found" about a configuration that had just been
|
|
23
|
+
* written — and advised running `untangle init`, which had just run. A user
|
|
24
|
+
* following that advice loops forever. One file name known in one place ends
|
|
25
|
+
* that: whatever `init` writes is exactly what discovery finds.
|
|
26
|
+
*/
|
|
27
|
+
export const PROJECT_TOML_CONFIG_FILE_NAME = "untangle.toml";
|
|
28
|
+
function isRepoRoot(dir) {
|
|
29
|
+
return existsSync(join(dir, ".git"));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Searches `startPath` and its ancestors for `fileName`, stopping after the
|
|
33
|
+
* first directory that is a repository root (has `.git`) or after the
|
|
34
|
+
* filesystem root. Returns the absolute path of the first match, or
|
|
35
|
+
* `undefined` if none is found.
|
|
36
|
+
*/
|
|
37
|
+
export function discoverConfigFile(startPath, fileName) {
|
|
38
|
+
let dir = resolve(startPath);
|
|
39
|
+
// If startPath is a file (e.g. process.cwd() equivalent passed by mistake),
|
|
40
|
+
// callers are expected to pass a directory; we do not stat startPath itself.
|
|
41
|
+
for (;;) {
|
|
42
|
+
const candidate = join(dir, fileName);
|
|
43
|
+
if (existsSync(candidate)) {
|
|
44
|
+
try {
|
|
45
|
+
if (statSync(candidate).isFile()) {
|
|
46
|
+
return candidate;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Unreadable candidate (race, permissions): treat as not found here.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const atRepoRoot = isRepoRoot(dir);
|
|
54
|
+
const parent = dirname(dir);
|
|
55
|
+
const atFilesystemRoot = parent === dir;
|
|
56
|
+
if (atRepoRoot || atFilesystemRoot) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
dir = parent;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Discovers project configuration upward, without crossing a repository boundary. */
|
|
63
|
+
export function discoverConfigFiles(startPath) {
|
|
64
|
+
const projectConfigPath = discoverConfigFile(startPath, PROJECT_CONFIG_FILE_NAME);
|
|
65
|
+
const tomlConfigPath = discoverConfigFile(startPath, PROJECT_TOML_CONFIG_FILE_NAME);
|
|
66
|
+
const folderConfigPath = projectConfigPath === undefined && tomlConfigPath === undefined
|
|
67
|
+
? discoverConfigFile(startPath, PROJECT_FOLDER_CONFIG_FILE_NAME)
|
|
68
|
+
: undefined;
|
|
69
|
+
return {
|
|
70
|
+
projectConfigPath: projectConfigPath ?? folderConfigPath,
|
|
71
|
+
tomlConfigPath,
|
|
72
|
+
localConfigPath: discoverConfigFile(startPath, LOCAL_CONFIG_FILE_NAME),
|
|
73
|
+
...(folderConfigPath === undefined ? {} : { projectRoot: dirname(dirname(folderConfigPath)) }),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,CAAC,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AACzD,MAAM,CAAC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAC7D,iFAAiF;AACjF,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAChF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAe,CAAC;AAE7D,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,QAAgB;IACpE,IAAI,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7B,4EAA4E;IAC5E,6EAA6E;IAC7E,SAAS,CAAC;QACR,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACtC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACH,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;oBACjC,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,qEAAqE;YACvE,CAAC;QACH,CAAC;QACD,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,MAAM,gBAAgB,GAAG,MAAM,KAAK,GAAG,CAAC;QACxC,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAAC;YACnC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC;AAkBD,sFAAsF;AACtF,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC;IAClF,MAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;IACpF,MAAM,gBAAgB,GACpB,iBAAiB,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS;QAC7D,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE,+BAA+B,CAAC;QAChE,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO;QACL,iBAAiB,EAAE,iBAAiB,IAAI,gBAAgB;QACxD,cAAc;QACd,eAAe,EAAE,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,CAAC;QACtE,GAAG,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC;KAC/F,CAAC;AACJ,CAAC"}
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variable layer (spec.md §4.1 layer 2, prefix `UNTANGLE_`).
|
|
3
|
+
*
|
|
4
|
+
* spec.md does not enumerate the mapping, so this table is an explicit
|
|
5
|
+
* Untangle decision: it covers the fields most likely to be overridden
|
|
6
|
+
* outside a checked-in config file (endpoints, modes, secrets-by-reference,
|
|
7
|
+
* gate strictness, telemetry opt-in), not every leaf field of
|
|
8
|
+
* `UntangleConfigV1`. New mappings MAY be added additively; removing or
|
|
9
|
+
* renaming one is a breaking change to this package's public contract.
|
|
10
|
+
*
|
|
11
|
+
* `UNTANGLE_QDRANT_API_KEY_ENV` / `UNTANGLE_EMBEDDINGS_API_KEY_ENV` set the
|
|
12
|
+
* NAME of a further environment variable holding a secret; they never carry
|
|
13
|
+
* the secret value itself (architecture.md §23.2).
|
|
14
|
+
*/
|
|
15
|
+
import type { RawConfigLayer } from "./types.js";
|
|
16
|
+
type Parser = (raw: string) => unknown;
|
|
17
|
+
export interface EnvMappingEntry {
|
|
18
|
+
/** Environment variable name, e.g. `UNTANGLE_QDRANT_URL`. */
|
|
19
|
+
env: string;
|
|
20
|
+
/** Dotted path into `UntangleConfigV1`, e.g. `["qdrant", "url"]`. */
|
|
21
|
+
path: readonly string[];
|
|
22
|
+
parse: Parser;
|
|
23
|
+
}
|
|
24
|
+
/** The complete, documented `UNTANGLE_*` → config-path mapping table. */
|
|
25
|
+
export declare const ENV_MAPPING: readonly EnvMappingEntry[];
|
|
26
|
+
export interface EnvLayerResult {
|
|
27
|
+
layer: RawConfigLayer;
|
|
28
|
+
/** Env vars that were present but failed to parse (e.g. non-numeric `UNTANGLE_EMBEDDINGS_DIMENSIONS`). */
|
|
29
|
+
parseErrors: {
|
|
30
|
+
env: string;
|
|
31
|
+
message: string;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
/** Builds a `RawConfigLayer` from `env` using {@link ENV_MAPPING}. Unset variables are skipped. */
|
|
35
|
+
export declare function buildEnvConfigLayer(env?: NodeJS.ProcessEnv): EnvLayerResult;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,KAAK,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AA0BvC,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yEAAyE;AACzE,eAAO,MAAM,WAAW,EAAE,SAAS,eAAe,EAgDxC,CAAC;AAgBX,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,cAAc,CAAC;IACtB,0GAA0G;IAC1G,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACjD;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,cAAc,CAkBxF"}
|
package/dist/env.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const parseString = (raw) => raw;
|
|
2
|
+
const parseNumber = (raw) => {
|
|
3
|
+
const value = Number(raw);
|
|
4
|
+
if (!Number.isFinite(value)) {
|
|
5
|
+
throw new Error(`expected a finite number, got "${raw}"`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
const parseBoolean = (raw) => {
|
|
10
|
+
const normalized = raw.trim().toLowerCase();
|
|
11
|
+
if (normalized === "true" || normalized === "1") {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (normalized === "false" || normalized === "0") {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
throw new Error(`expected a boolean ("true"/"false"/"1"/"0"), got "${raw}"`);
|
|
18
|
+
};
|
|
19
|
+
const parseCsv = (raw) => raw
|
|
20
|
+
.split(",")
|
|
21
|
+
.map((entry) => entry.trim())
|
|
22
|
+
.filter((entry) => entry.length > 0);
|
|
23
|
+
/** The complete, documented `UNTANGLE_*` → config-path mapping table. */
|
|
24
|
+
export const ENV_MAPPING = [
|
|
25
|
+
{ env: "UNTANGLE_WORKSPACE_ID", path: ["workspaceId"], parse: parseString },
|
|
26
|
+
{ env: "UNTANGLE_PROJECT_ID", path: ["projectId"], parse: parseString },
|
|
27
|
+
{ env: "UNTANGLE_STORAGE_BACKEND", path: ["storage", "backend"], parse: parseString },
|
|
28
|
+
{ env: "UNTANGLE_LANCEDB_PATH", path: ["storage", "path"], parse: parseString },
|
|
29
|
+
{ env: "UNTANGLE_QDRANT_MODE", path: ["qdrant", "mode"], parse: parseString },
|
|
30
|
+
{ env: "UNTANGLE_QDRANT_URL", path: ["qdrant", "url"], parse: parseString },
|
|
31
|
+
{ env: "UNTANGLE_QDRANT_API_KEY_ENV", path: ["qdrant", "apiKeyEnv"], parse: parseString },
|
|
32
|
+
{
|
|
33
|
+
env: "UNTANGLE_QDRANT_COLLECTION_PREFIX",
|
|
34
|
+
path: ["qdrant", "collectionPrefix"],
|
|
35
|
+
parse: parseString,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
env: "UNTANGLE_QDRANT_REQUEST_TIMEOUT_MS",
|
|
39
|
+
path: ["qdrant", "requestTimeoutMs"],
|
|
40
|
+
parse: parseNumber,
|
|
41
|
+
},
|
|
42
|
+
{ env: "UNTANGLE_QDRANT_MAX_RETRIES", path: ["qdrant", "maxRetries"], parse: parseNumber },
|
|
43
|
+
{ env: "UNTANGLE_EMBEDDINGS_MODE", path: ["embeddings", "mode"], parse: parseString },
|
|
44
|
+
{ env: "UNTANGLE_EMBEDDINGS_URL", path: ["embeddings", "url"], parse: parseString },
|
|
45
|
+
{ env: "UNTANGLE_EMBEDDINGS_API_KEY_ENV", path: ["embeddings", "apiKeyEnv"], parse: parseString },
|
|
46
|
+
{ env: "UNTANGLE_EMBEDDINGS_MODEL", path: ["embeddings", "model"], parse: parseString },
|
|
47
|
+
{ env: "UNTANGLE_EMBEDDINGS_DIMENSIONS", path: ["embeddings", "dimensions"], parse: parseNumber },
|
|
48
|
+
{
|
|
49
|
+
env: "UNTANGLE_EMBEDDINGS_REQUEST_TIMEOUT_MS",
|
|
50
|
+
path: ["embeddings", "requestTimeoutMs"],
|
|
51
|
+
parse: parseNumber,
|
|
52
|
+
},
|
|
53
|
+
{ env: "UNTANGLE_INDEX_WATCH", path: ["index", "watch"], parse: parseBoolean },
|
|
54
|
+
{ env: "UNTANGLE_INDEX_MAX_FILE_SIZE_MB", path: ["index", "maxFileSizeMb"], parse: parseNumber },
|
|
55
|
+
{ env: "UNTANGLE_INDEX_EXTRA_EXTENSIONS", path: ["index", "extraExtensions"], parse: parseCsv },
|
|
56
|
+
{ env: "UNTANGLE_QUALITY_GATE_MODE", path: ["qualityGate", "mode"], parse: parseString },
|
|
57
|
+
{
|
|
58
|
+
env: "UNTANGLE_QUALITY_GATE_MINIMUM_PARSE_QUALITY",
|
|
59
|
+
path: ["qualityGate", "minimumParseQuality"],
|
|
60
|
+
parse: parseString,
|
|
61
|
+
},
|
|
62
|
+
{ env: "UNTANGLE_TELEMETRY_ENABLED", path: ["telemetry", "enabled"], parse: parseBoolean },
|
|
63
|
+
{ env: "UNTANGLE_TELEMETRY_LOG_LEVEL", path: ["telemetry", "logLevel"], parse: parseString },
|
|
64
|
+
{ env: "UNTANGLE_PORTFOLIO_ENABLED", path: ["portfolio", "enabled"], parse: parseBoolean },
|
|
65
|
+
];
|
|
66
|
+
function setAtPath(target, path, value) {
|
|
67
|
+
let cursor = target;
|
|
68
|
+
for (let i = 0; i < path.length - 1; i += 1) {
|
|
69
|
+
const key = path[i];
|
|
70
|
+
const next = cursor[key];
|
|
71
|
+
if (typeof next !== "object" || next === null || Array.isArray(next)) {
|
|
72
|
+
cursor[key] = {};
|
|
73
|
+
}
|
|
74
|
+
cursor = cursor[key];
|
|
75
|
+
}
|
|
76
|
+
const lastKey = path[path.length - 1];
|
|
77
|
+
cursor[lastKey] = value;
|
|
78
|
+
}
|
|
79
|
+
/** Builds a `RawConfigLayer` from `env` using {@link ENV_MAPPING}. Unset variables are skipped. */
|
|
80
|
+
export function buildEnvConfigLayer(env = process.env) {
|
|
81
|
+
const layer = {};
|
|
82
|
+
const parseErrors = [];
|
|
83
|
+
for (const entry of ENV_MAPPING) {
|
|
84
|
+
const raw = env[entry.env];
|
|
85
|
+
if (raw === undefined) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
setAtPath(layer, entry.path, entry.parse(raw));
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
parseErrors.push({
|
|
93
|
+
env: entry.env,
|
|
94
|
+
message: error instanceof Error ? error.message : String(error),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { layer: layer, parseErrors };
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=env.js.map
|
package/dist/env.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,GAAW,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;AACzC,MAAM,WAAW,GAAW,CAAC,GAAG,EAAE,EAAE;IAClC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AACF,MAAM,YAAY,GAAW,CAAC,GAAG,EAAE,EAAE;IACnC,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QAChD,OAAO,IAAI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G,MAAM,CAAC,GAAG,CAA4B,CAAC;IAClD,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAW,CAAC;IAChD,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AAC1B,CAAC;AAQD,mGAAmG;AACnG,MAAM,UAAU,mBAAmB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACtE,MAAM,KAAK,GAA4B,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAuC,EAAE,CAAC;IAC3D,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,SAAS;QACX,CAAC;QACD,IAAI,CAAC;YACH,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,WAAW,CAAC,IAAI,CAAC;gBACf,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAuB,EAAE,WAAW,EAAE,CAAC;AACzD,CAAC"}
|
package/dist/hash.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical effective config and embedding profile derivation
|
|
3
|
+
* (architecture.md §6.3: "kanonische Effective Config", "Embedding- und
|
|
4
|
+
* Indexprofil-Hashing"; spec.md §5.1 `workspace_id` fallback derivation;
|
|
5
|
+
* spec.md §5.7 `embedding_profile_id`).
|
|
6
|
+
*/
|
|
7
|
+
import type { EmbeddingProfile } from "@untangle-code/domain";
|
|
8
|
+
import type { EffectiveUntangleConfigV1 } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* SHA-256 of the canonical JSON of `config`. The additive storage section
|
|
11
|
+
* is excluded for Qdrant to preserve existing workspace identities; its
|
|
12
|
+
* connection remains represented by the unchanged qdrant section. Used as `buildWorkspaceId`'s
|
|
13
|
+
* `configHash` input (spec.md §5.1) when no explicit `workspaceId` is
|
|
14
|
+
* configured, and to detect effective-config drift between index runs
|
|
15
|
+
* (architecture.md §6.3, §13.4 "Generation-Commit").
|
|
16
|
+
*/
|
|
17
|
+
export declare function computeConfigHash(config: unknown): string;
|
|
18
|
+
/**
|
|
19
|
+
* Assembles the `EmbeddingProfile` (domain, spec.md §5.7's eight mandatory
|
|
20
|
+
* fields) from an effective config's `embeddings` section and derives
|
|
21
|
+
* `embedding_profile_id` via `buildEmbeddingProfileId`.
|
|
22
|
+
*
|
|
23
|
+
* `normalization` and `preparedTextVersion` are not part of `EmbeddingConfig`
|
|
24
|
+
* (spec.md §4.5 does not list them); they default to this package's fixed
|
|
25
|
+
* constants (`defaults.ts`) unless overridden here — e.g. a future config
|
|
26
|
+
* revision that exposes them per-project.
|
|
27
|
+
*/
|
|
28
|
+
export declare function deriveEmbeddingProfile(config: Pick<EffectiveUntangleConfigV1, "embeddings">, overrides?: {
|
|
29
|
+
normalization?: string;
|
|
30
|
+
preparedTextVersion?: string;
|
|
31
|
+
}): EmbeddingProfile;
|
|
32
|
+
/** Convenience: `buildEmbeddingProfileId(deriveEmbeddingProfile(config, overrides))`. */
|
|
33
|
+
export declare function deriveEmbeddingProfileId(config: Pick<EffectiveUntangleConfigV1, "embeddings">, overrides?: {
|
|
34
|
+
normalization?: string;
|
|
35
|
+
preparedTextVersion?: string;
|
|
36
|
+
}): string;
|
|
37
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAgBzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,IAAI,CAAC,yBAAyB,EAAE,YAAY,CAAC,EACrD,SAAS,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAAO,GACvE,gBAAgB,CAWlB;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,yBAAyB,EAAE,YAAY,CAAC,EACrD,SAAS,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAAE,GACnE,MAAM,CAER"}
|
package/dist/hash.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { buildEmbeddingProfileId, canonicalJson, sha256Hex } from "@untangle-code/domain";
|
|
2
|
+
import { DEFAULT_EMBEDDING_NORMALIZATION, PREPARED_TEXT_VERSION } from "./defaults.js";
|
|
3
|
+
/**
|
|
4
|
+
* SHA-256 of the canonical JSON of `config`. The additive storage section
|
|
5
|
+
* is excluded for Qdrant to preserve existing workspace identities; its
|
|
6
|
+
* connection remains represented by the unchanged qdrant section. Used as `buildWorkspaceId`'s
|
|
7
|
+
* `configHash` input (spec.md §5.1) when no explicit `workspaceId` is
|
|
8
|
+
* configured, and to detect effective-config drift between index runs
|
|
9
|
+
* (architecture.md §6.3, §13.4 "Generation-Commit").
|
|
10
|
+
*/
|
|
11
|
+
export function computeConfigHash(config) {
|
|
12
|
+
if (typeof config === "object" && config !== null && !Array.isArray(config)) {
|
|
13
|
+
const record = config;
|
|
14
|
+
const storage = record["storage"];
|
|
15
|
+
if (typeof storage === "object" &&
|
|
16
|
+
storage !== null &&
|
|
17
|
+
"backend" in storage &&
|
|
18
|
+
storage.backend === "qdrant") {
|
|
19
|
+
const legacyConfig = { ...record };
|
|
20
|
+
delete legacyConfig["storage"];
|
|
21
|
+
return sha256Hex(canonicalJson(legacyConfig));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return sha256Hex(canonicalJson(config));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Assembles the `EmbeddingProfile` (domain, spec.md §5.7's eight mandatory
|
|
28
|
+
* fields) from an effective config's `embeddings` section and derives
|
|
29
|
+
* `embedding_profile_id` via `buildEmbeddingProfileId`.
|
|
30
|
+
*
|
|
31
|
+
* `normalization` and `preparedTextVersion` are not part of `EmbeddingConfig`
|
|
32
|
+
* (spec.md §4.5 does not list them); they default to this package's fixed
|
|
33
|
+
* constants (`defaults.ts`) unless overridden here — e.g. a future config
|
|
34
|
+
* revision that exposes them per-project.
|
|
35
|
+
*/
|
|
36
|
+
export function deriveEmbeddingProfile(config, overrides = {}) {
|
|
37
|
+
return {
|
|
38
|
+
provider: config.embeddings.provider,
|
|
39
|
+
model: config.embeddings.model,
|
|
40
|
+
dimensions: config.embeddings.dimensions,
|
|
41
|
+
queryPrefix: config.embeddings.queryPrefix,
|
|
42
|
+
documentPrefix: config.embeddings.documentPrefix,
|
|
43
|
+
includePath: config.embeddings.includePath,
|
|
44
|
+
normalization: overrides.normalization ?? DEFAULT_EMBEDDING_NORMALIZATION,
|
|
45
|
+
preparedTextVersion: overrides.preparedTextVersion ?? PREPARED_TEXT_VERSION,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** Convenience: `buildEmbeddingProfileId(deriveEmbeddingProfile(config, overrides))`. */
|
|
49
|
+
export function deriveEmbeddingProfileId(config, overrides) {
|
|
50
|
+
return buildEmbeddingProfileId(deriveEmbeddingProfile(config, overrides));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=hash.js.map
|
package/dist/hash.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGvF;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC/C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5E,MAAM,MAAM,GAAG,MAAiC,CAAC;QACjD,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;QAClC,IACE,OAAO,OAAO,KAAK,QAAQ;YAC3B,OAAO,KAAK,IAAI;YAChB,SAAS,IAAI,OAAO;YACpB,OAAO,CAAC,OAAO,KAAK,QAAQ,EAC5B,CAAC;YACD,MAAM,YAAY,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;YACnC,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;YAC/B,OAAO,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAqD,EACrD,YAAsE,EAAE;IAExE,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ;QACpC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK;QAC9B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU;QACxC,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW;QAC1C,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC,cAAc;QAChD,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW;QAC1C,aAAa,EAAE,SAAS,CAAC,aAAa,IAAI,+BAA+B;QACzE,mBAAmB,EAAE,SAAS,CAAC,mBAAmB,IAAI,qBAAqB;KAC5E,CAAC;AACJ,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CACtC,MAAqD,EACrD,SAAoE;IAEpE,OAAO,uBAAuB,CAAC,sBAAsB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @untangle-code/config — Untangle configuration: types, discovery,
|
|
3
|
+
* layering, JSON Schema, secret redaction, canonical hashing and migration.
|
|
4
|
+
*
|
|
5
|
+
* This module is the ONLY public export of the package.
|
|
6
|
+
*/
|
|
7
|
+
export * from "./types.js";
|
|
8
|
+
export * from "./defaults.js";
|
|
9
|
+
export * from "./schema.js";
|
|
10
|
+
export * from "./discovery.js";
|
|
11
|
+
export * from "./user-config.js";
|
|
12
|
+
export * from "./env.js";
|
|
13
|
+
export * from "./merge.js";
|
|
14
|
+
export * from "./paths.js";
|
|
15
|
+
export * from "./secrets.js";
|
|
16
|
+
export * from "./hash.js";
|
|
17
|
+
export * from "./validate.js";
|
|
18
|
+
export * from "./migrations.js";
|
|
19
|
+
export * from "./load.js";
|
|
20
|
+
export * from "./parse.js";
|
|
21
|
+
export * from "./chunker-budget.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,eAAe,CAAC;AAG9B,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,UAAU,CAAC;AAGzB,cAAc,YAAY,CAAC;AAG3B,cAAc,YAAY,CAAC;AAG3B,cAAc,cAAc,CAAC;AAG7B,cAAc,WAAW,CAAC;AAG1B,cAAc,eAAe,CAAC;AAG9B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,WAAW,CAAC;AAG1B,cAAc,YAAY,CAAC;AAG3B,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @untangle-code/config — Untangle configuration: types, discovery,
|
|
3
|
+
* layering, JSON Schema, secret redaction, canonical hashing and migration.
|
|
4
|
+
*
|
|
5
|
+
* This module is the ONLY public export of the package.
|
|
6
|
+
*/
|
|
7
|
+
// Configuration types (spec.md §4.2-4.8; portfolio.md §14.4)
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
// Product defaults (spec.md §4.5; product.md §11)
|
|
10
|
+
export * from "./defaults.js";
|
|
11
|
+
// JSON Schema (Draft 2020-12)
|
|
12
|
+
export * from "./schema.js";
|
|
13
|
+
// Config file discovery (spec.md §4.1)
|
|
14
|
+
export * from "./discovery.js";
|
|
15
|
+
// OS user config directory (spec.md §4.1 layer 5)
|
|
16
|
+
export * from "./user-config.js";
|
|
17
|
+
// Environment variable layer (spec.md §4.1 layer 2)
|
|
18
|
+
export * from "./env.js";
|
|
19
|
+
// Deep merge with array-replace semantics (spec.md §4.1)
|
|
20
|
+
export * from "./merge.js";
|
|
21
|
+
// Path resolution relative to the config file (spec.md §4.3)
|
|
22
|
+
export * from "./paths.js";
|
|
23
|
+
// Secret references and redaction (spec.md §4.4/§4.5, §24; architecture.md §23.2)
|
|
24
|
+
export * from "./secrets.js";
|
|
25
|
+
// Canonical effective config hash and embedding profile derivation (architecture.md §6.3)
|
|
26
|
+
export * from "./hash.js";
|
|
27
|
+
// Validation (spec.md §4.8)
|
|
28
|
+
export * from "./validate.js";
|
|
29
|
+
// Migration scaffold for future schemaVersion jumps (architecture.md §6.3)
|
|
30
|
+
export * from "./migrations.js";
|
|
31
|
+
// Top-level orchestration
|
|
32
|
+
export * from "./load.js";
|
|
33
|
+
// Parse an existing document without loading defaults or environment layers.
|
|
34
|
+
export * from "./parse.js";
|
|
35
|
+
// IndexConfig -> chunker token-budget wiring (spec.md §4.6)
|
|
36
|
+
export * from "./chunker-budget.js";
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6DAA6D;AAC7D,cAAc,YAAY,CAAC;AAE3B,kDAAkD;AAClD,cAAc,eAAe,CAAC;AAE9B,8BAA8B;AAC9B,cAAc,aAAa,CAAC;AAE5B,uCAAuC;AACvC,cAAc,gBAAgB,CAAC;AAE/B,kDAAkD;AAClD,cAAc,kBAAkB,CAAC;AAEjC,oDAAoD;AACpD,cAAc,UAAU,CAAC;AAEzB,yDAAyD;AACzD,cAAc,YAAY,CAAC;AAE3B,6DAA6D;AAC7D,cAAc,YAAY,CAAC;AAE3B,kFAAkF;AAClF,cAAc,cAAc,CAAC;AAE7B,0FAA0F;AAC1F,cAAc,WAAW,CAAC;AAE1B,4BAA4B;AAC5B,cAAc,eAAe,CAAC;AAE9B,2EAA2E;AAC3E,cAAc,iBAAiB,CAAC;AAEhC,0BAA0B;AAC1B,cAAc,WAAW,CAAC;AAE1B,6EAA6E;AAC7E,cAAc,YAAY,CAAC;AAE3B,4DAA4D;AAC5D,cAAc,qBAAqB,CAAC"}
|