@ontrails/config 1.0.0-beta.14 → 1.0.0-beta.16
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/CHANGELOG.md +41 -0
- package/README.md +20 -28
- package/package.json +10 -2
- package/src/app-config.ts +23 -12
- package/src/compose.ts +16 -22
- package/src/{config-provision.ts → config-resource.ts} +5 -5
- package/src/define-config.ts +18 -18
- package/src/{generate → derive}/env.ts +3 -3
- package/src/{generate → derive}/example.ts +1 -1
- package/src/{generate → derive}/helpers.ts +1 -1
- package/src/derive/index.ts +3 -0
- package/src/{generate → derive}/json-schema.ts +1 -1
- package/src/{describe.ts → derive-fields.ts} +1 -1
- package/src/{explain.ts → derive-provenance.ts} +6 -6
- package/src/extensions.ts +1 -1
- package/src/index.ts +12 -19
- package/src/registry.ts +2 -2
- package/src/resolve.ts +17 -15
- package/src/trails/config-check.ts +3 -3
- package/src/trails/config-describe.ts +5 -5
- package/src/trails/config-explain.ts +13 -13
- package/src/trails/config-init.ts +10 -10
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/app-config.d.ts +0 -65
- package/dist/app-config.d.ts.map +0 -1
- package/dist/app-config.js +0 -172
- package/dist/app-config.js.map +0 -1
- package/dist/collect.d.ts +0 -11
- package/dist/collect.d.ts.map +0 -1
- package/dist/collect.js +0 -81
- package/dist/collect.js.map +0 -1
- package/dist/compose.d.ts +0 -30
- package/dist/compose.d.ts.map +0 -1
- package/dist/compose.js +0 -21
- package/dist/compose.js.map +0 -1
- package/dist/config-gate.d.ts +0 -11
- package/dist/config-gate.d.ts.map +0 -1
- package/dist/config-gate.js +0 -6
- package/dist/config-gate.js.map +0 -1
- package/dist/config-layer.d.ts +0 -11
- package/dist/config-layer.d.ts.map +0 -1
- package/dist/config-layer.js +0 -6
- package/dist/config-layer.js.map +0 -1
- package/dist/config-provision.d.ts +0 -3
- package/dist/config-provision.d.ts.map +0 -1
- package/dist/config-provision.js +0 -26
- package/dist/config-provision.js.map +0 -1
- package/dist/config-service.d.ts +0 -3
- package/dist/config-service.d.ts.map +0 -1
- package/dist/config-service.js +0 -26
- package/dist/config-service.js.map +0 -1
- package/dist/define-config.d.ts +0 -61
- package/dist/define-config.d.ts.map +0 -1
- package/dist/define-config.js +0 -90
- package/dist/define-config.js.map +0 -1
- package/dist/describe.d.ts +0 -25
- package/dist/describe.d.ts.map +0 -1
- package/dist/describe.js +0 -147
- package/dist/describe.js.map +0 -1
- package/dist/doctor.d.ts +0 -27
- package/dist/doctor.d.ts.map +0 -1
- package/dist/doctor.js +0 -131
- package/dist/doctor.js.map +0 -1
- package/dist/explain.d.ts +0 -30
- package/dist/explain.d.ts.map +0 -1
- package/dist/explain.js +0 -101
- package/dist/explain.js.map +0 -1
- package/dist/extensions.d.ts +0 -38
- package/dist/extensions.d.ts.map +0 -1
- package/dist/extensions.js +0 -35
- package/dist/extensions.js.map +0 -1
- package/dist/generate/env.d.ts +0 -15
- package/dist/generate/env.d.ts.map +0 -1
- package/dist/generate/env.js +0 -65
- package/dist/generate/env.js.map +0 -1
- package/dist/generate/example.d.ts +0 -16
- package/dist/generate/example.d.ts.map +0 -1
- package/dist/generate/example.js +0 -138
- package/dist/generate/example.js.map +0 -1
- package/dist/generate/helpers.d.ts +0 -35
- package/dist/generate/helpers.d.ts.map +0 -1
- package/dist/generate/helpers.js +0 -116
- package/dist/generate/helpers.js.map +0 -1
- package/dist/generate/index.d.ts +0 -4
- package/dist/generate/index.d.ts.map +0 -1
- package/dist/generate/index.js +0 -4
- package/dist/generate/index.js.map +0 -1
- package/dist/generate/json-schema.d.ts +0 -18
- package/dist/generate/json-schema.d.ts.map +0 -1
- package/dist/generate/json-schema.js +0 -97
- package/dist/generate/json-schema.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/merge.d.ts +0 -16
- package/dist/merge.d.ts.map +0 -1
- package/dist/merge.js +0 -34
- package/dist/merge.js.map +0 -1
- package/dist/ref.d.ts +0 -29
- package/dist/ref.d.ts.map +0 -1
- package/dist/ref.js +0 -30
- package/dist/ref.js.map +0 -1
- package/dist/registry.d.ts +0 -24
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -12
- package/dist/registry.js.map +0 -1
- package/dist/resolve.d.ts +0 -21
- package/dist/resolve.d.ts.map +0 -1
- package/dist/resolve.js +0 -177
- package/dist/resolve.js.map +0 -1
- package/dist/secret-heuristics.d.ts +0 -10
- package/dist/secret-heuristics.d.ts.map +0 -1
- package/dist/secret-heuristics.js +0 -11
- package/dist/secret-heuristics.js.map +0 -1
- package/dist/trails/config-check.d.ts +0 -11
- package/dist/trails/config-check.d.ts.map +0 -1
- package/dist/trails/config-check.js +0 -53
- package/dist/trails/config-check.js.map +0 -1
- package/dist/trails/config-describe.d.ts +0 -12
- package/dist/trails/config-describe.d.ts.map +0 -1
- package/dist/trails/config-describe.js +0 -41
- package/dist/trails/config-describe.js.map +0 -1
- package/dist/trails/config-explain.d.ts +0 -8
- package/dist/trails/config-explain.d.ts.map +0 -1
- package/dist/trails/config-explain.js +0 -74
- package/dist/trails/config-explain.js.map +0 -1
- package/dist/trails/config-init.d.ts +0 -9
- package/dist/trails/config-init.d.ts.map +0 -1
- package/dist/trails/config-init.js +0 -78
- package/dist/trails/config-init.js.map +0 -1
- package/dist/workspace.d.ts +0 -9
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -49
- package/dist/workspace.js.map +0 -1
- package/dist/zod-utils.d.ts +0 -14
- package/dist/zod-utils.d.ts.map +0 -1
- package/dist/zod-utils.js +0 -41
- package/dist/zod-utils.js.map +0 -1
- package/src/__tests__/app-config.test.ts +0 -329
- package/src/__tests__/compose.test.ts +0 -59
- package/src/__tests__/config-check.test.ts +0 -171
- package/src/__tests__/config-describe.test.ts +0 -154
- package/src/__tests__/config-explain.test.ts +0 -167
- package/src/__tests__/config-gate.test.ts +0 -53
- package/src/__tests__/config-init.test.ts +0 -210
- package/src/__tests__/config-provision.test.ts +0 -87
- package/src/__tests__/define-config.test.ts +0 -263
- package/src/__tests__/describe.test.ts +0 -158
- package/src/__tests__/doctor.test.ts +0 -172
- package/src/__tests__/explain.test.ts +0 -139
- package/src/__tests__/extensions.test.ts +0 -134
- package/src/__tests__/generate.test.ts +0 -269
- package/src/__tests__/ref.test.ts +0 -35
- package/src/__tests__/resolve.test.ts +0 -246
- package/src/__tests__/workspace.test.ts +0 -64
- package/src/config-gate.ts +0 -15
- package/src/generate/index.ts +0 -3
- package/src/workspace.ts +0 -56
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
package/dist/resolve.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config resolution engine — merges config from multiple sources through
|
|
3
|
-
* a deterministic stack: defaults → base → loadout → local → env.
|
|
4
|
-
*/
|
|
5
|
-
import { Result } from '@ontrails/core';
|
|
6
|
-
import { collectConfigMeta } from './collect.js';
|
|
7
|
-
import { deepMerge } from './merge.js';
|
|
8
|
-
import { zodDef } from './zod-utils.js';
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Env coercion helpers (defined before consumers)
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
/** Boolean string values we accept from environment variables. */
|
|
13
|
-
const BOOL_TRUE = new Set(['true', '1']);
|
|
14
|
-
const BOOL_FALSE = new Set(['false', '0']);
|
|
15
|
-
/** Primitive type names we can coerce env strings into. */
|
|
16
|
-
const PRIMITIVE_TYPES = new Set(['number', 'boolean', 'string']);
|
|
17
|
-
/** Try to advance one level through a Zod wrapper, returning the inner type or undefined. */
|
|
18
|
-
const unwrapOne = (schema) => {
|
|
19
|
-
const def = zodDef(schema);
|
|
20
|
-
return {
|
|
21
|
-
inner: def['innerType'],
|
|
22
|
-
typeName: def['type'],
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
/** Unwrap ZodDefault / ZodOptional / ZodNullable to find the base type name. */
|
|
26
|
-
const resolveBaseTypeName = (schema) => {
|
|
27
|
-
let current = schema;
|
|
28
|
-
for (let depth = 0; depth < 10; depth += 1) {
|
|
29
|
-
const { typeName, inner } = unwrapOne(current);
|
|
30
|
-
if (typeName && PRIMITIVE_TYPES.has(typeName)) {
|
|
31
|
-
return typeName;
|
|
32
|
-
}
|
|
33
|
-
if (!inner) {
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
current = inner;
|
|
37
|
-
}
|
|
38
|
-
return 'string';
|
|
39
|
-
};
|
|
40
|
-
/** Coerce a boolean env string. Returns the original string if unrecognized. */
|
|
41
|
-
const coerceBooleanEnv = (raw) => {
|
|
42
|
-
if (BOOL_TRUE.has(raw)) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
if (BOOL_FALSE.has(raw)) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
return raw;
|
|
49
|
-
};
|
|
50
|
-
/** Coerce env var lookup table keyed by base type name. */
|
|
51
|
-
const ENV_COERCERS = {
|
|
52
|
-
boolean: coerceBooleanEnv,
|
|
53
|
-
number: (raw) => {
|
|
54
|
-
const n = Number(raw);
|
|
55
|
-
return Number.isNaN(n) ? raw : n;
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
/** Coerce a string env value to the type expected by the schema field. */
|
|
59
|
-
const coerceEnvValue = (raw, schema) => {
|
|
60
|
-
const coercer = ENV_COERCERS[resolveBaseTypeName(schema)];
|
|
61
|
-
return coercer ? coercer(raw) : raw;
|
|
62
|
-
};
|
|
63
|
-
// ---------------------------------------------------------------------------
|
|
64
|
-
// Path utilities
|
|
65
|
-
// ---------------------------------------------------------------------------
|
|
66
|
-
/** Navigate one step of a nested object, creating an intermediate if needed. */
|
|
67
|
-
const navigateOrCreate = (current, key) => {
|
|
68
|
-
const next = current[key];
|
|
69
|
-
if (typeof next === 'object' && next !== null && !Array.isArray(next)) {
|
|
70
|
-
return next;
|
|
71
|
-
}
|
|
72
|
-
const nested = {};
|
|
73
|
-
current[key] = nested;
|
|
74
|
-
return nested;
|
|
75
|
-
};
|
|
76
|
-
/** Ensure a nested path exists in an object, creating intermediates as needed. */
|
|
77
|
-
const ensurePath = (obj, parts) => {
|
|
78
|
-
let current = obj;
|
|
79
|
-
for (const part of parts) {
|
|
80
|
-
current = navigateOrCreate(current, part);
|
|
81
|
-
}
|
|
82
|
-
return current;
|
|
83
|
-
};
|
|
84
|
-
/** Set a value at a dot-separated path in a plain object. */
|
|
85
|
-
const setAtPath = (obj, path, value) => {
|
|
86
|
-
const parts = path.split('.');
|
|
87
|
-
const parent = ensurePath(obj, parts.slice(0, -1));
|
|
88
|
-
parent[parts.at(-1)] = value;
|
|
89
|
-
};
|
|
90
|
-
/** Resolve one step of a Zod shape walk: find the field schema for a key. */
|
|
91
|
-
const resolveShapeStep = (current, key) => {
|
|
92
|
-
const shape = zodDef(current)['shape'];
|
|
93
|
-
return shape?.[key];
|
|
94
|
-
};
|
|
95
|
-
/** Walk a Zod schema shape to find the field at a dot-separated path. */
|
|
96
|
-
const getFieldSchema = (schema, path) => {
|
|
97
|
-
let current = schema;
|
|
98
|
-
for (const part of path.split('.')) {
|
|
99
|
-
const next = resolveShapeStep(current, part);
|
|
100
|
-
if (!next) {
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
current = next;
|
|
104
|
-
}
|
|
105
|
-
return current;
|
|
106
|
-
};
|
|
107
|
-
// ---------------------------------------------------------------------------
|
|
108
|
-
// Env overlay
|
|
109
|
-
// ---------------------------------------------------------------------------
|
|
110
|
-
/** Coerce and set a single env override into the result object. */
|
|
111
|
-
const applyOneEnvOverride = (result, schema, path, envValue) => {
|
|
112
|
-
const fieldSchema = getFieldSchema(schema, path);
|
|
113
|
-
const coerced = fieldSchema
|
|
114
|
-
? coerceEnvValue(envValue, fieldSchema)
|
|
115
|
-
: envValue;
|
|
116
|
-
setAtPath(result, path, coerced);
|
|
117
|
-
};
|
|
118
|
-
/** Resolve a single env binding: look up the var, apply if present. */
|
|
119
|
-
const resolveEnvBinding = (result, schema, path, envVar, envVars) => {
|
|
120
|
-
const envValue = envVars[envVar];
|
|
121
|
-
if (envValue !== undefined) {
|
|
122
|
-
applyOneEnvOverride(result, schema, path, envValue);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
/** Apply env var overrides based on schema metadata. */
|
|
126
|
-
const applyEnvOverrides = (merged, schema, envVars) => {
|
|
127
|
-
if (zodDef(schema)['type'] !== 'object') {
|
|
128
|
-
return merged;
|
|
129
|
-
}
|
|
130
|
-
const meta = collectConfigMeta(schema);
|
|
131
|
-
const result = deepMerge({}, merged);
|
|
132
|
-
for (const [path, fieldMeta] of meta) {
|
|
133
|
-
if (fieldMeta.env) {
|
|
134
|
-
resolveEnvBinding(result, schema, path, fieldMeta.env, envVars);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return result;
|
|
138
|
-
};
|
|
139
|
-
// ---------------------------------------------------------------------------
|
|
140
|
-
// Merge pipeline
|
|
141
|
-
// ---------------------------------------------------------------------------
|
|
142
|
-
/** Apply the layered merge: base → loadout → local overrides. */
|
|
143
|
-
const mergeLayers = (base, loadouts, loadout, localOverrides) => {
|
|
144
|
-
let merged = {};
|
|
145
|
-
if (base) {
|
|
146
|
-
merged = deepMerge(merged, base);
|
|
147
|
-
}
|
|
148
|
-
const selected = loadout && loadouts ? loadouts[loadout] : undefined;
|
|
149
|
-
if (selected) {
|
|
150
|
-
merged = deepMerge(merged, selected);
|
|
151
|
-
}
|
|
152
|
-
if (localOverrides) {
|
|
153
|
-
merged = deepMerge(merged, localOverrides);
|
|
154
|
-
}
|
|
155
|
-
return merged;
|
|
156
|
-
};
|
|
157
|
-
/** Format Zod issues into a human-readable error message. */
|
|
158
|
-
const formatValidationError = (issues) => `Config validation failed: ${issues.map((i) => `${String(i.path.join('.'))}: ${i.message}`).join(', ')}`;
|
|
159
|
-
// ---------------------------------------------------------------------------
|
|
160
|
-
// Public API
|
|
161
|
-
// ---------------------------------------------------------------------------
|
|
162
|
-
/**
|
|
163
|
-
* Resolve config through the full stack: defaults → base → loadout → local → env.
|
|
164
|
-
* Returns `Result.ok` with the validated config, or `Result.err` on validation failure.
|
|
165
|
-
*/
|
|
166
|
-
export const resolveConfig = (options) => {
|
|
167
|
-
let merged = mergeLayers(options.base, options.loadouts, options.loadout, options.localOverrides);
|
|
168
|
-
if (options.env) {
|
|
169
|
-
merged = applyEnvOverrides(merged, options.schema, options.env);
|
|
170
|
-
}
|
|
171
|
-
const parsed = options.schema.safeParse(merged);
|
|
172
|
-
if (parsed.success) {
|
|
173
|
-
return Result.ok(parsed.data);
|
|
174
|
-
}
|
|
175
|
-
return Result.err(new Error(formatValidationError(parsed.error.issues)));
|
|
176
|
-
};
|
|
177
|
-
//# sourceMappingURL=resolve.js.map
|
package/dist/resolve.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAgBxC,8EAA8E;AAC9E,kDAAkD;AAClD,8EAA8E;AAE9E,kEAAkE;AAClE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;AACzC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;AAE3C,2DAA2D;AAC3D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,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MAAM,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAkB,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Heuristic detection of secret env var names.
|
|
3
|
-
*
|
|
4
|
-
* Matches common suffixes like `_SECRET`, `_TOKEN`, `_KEY`, `_PASSWORD`,
|
|
5
|
-
* and `_CREDENTIALS` so that generated `.env.example` files and provenance
|
|
6
|
-
* output can redact likely-secret values even without explicit `secret()`.
|
|
7
|
-
*/
|
|
8
|
-
/** Return true when `envName` looks like it holds a secret value. */
|
|
9
|
-
export declare const isLikelySecret: (envName: string) => boolean;
|
|
10
|
-
//# sourceMappingURL=secret-heuristics.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secret-heuristics.d.ts","sourceRoot":"","sources":["../src/secret-heuristics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,qEAAqE;AACrE,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,OACnB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Heuristic detection of secret env var names.
|
|
3
|
-
*
|
|
4
|
-
* Matches common suffixes like `_SECRET`, `_TOKEN`, `_KEY`, `_PASSWORD`,
|
|
5
|
-
* and `_CREDENTIALS` so that generated `.env.example` files and provenance
|
|
6
|
-
* output can redact likely-secret values even without explicit `secret()`.
|
|
7
|
-
*/
|
|
8
|
-
const SECRET_PATTERN = /_SECRET$|_TOKEN$|_KEY$|_PASSWORD$|_CREDENTIALS$/i;
|
|
9
|
-
/** Return true when `envName` looks like it holds a secret value. */
|
|
10
|
-
export const isLikelySecret = (envName) => SECRET_PATTERN.test(envName);
|
|
11
|
-
//# sourceMappingURL=secret-heuristics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"secret-heuristics.js","sourceRoot":"","sources":["../src/secret-heuristics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,cAAc,GAAG,kDAAkD,CAAC;AAE1E,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAe,EAAW,EAAE,CACzD,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const configCheck: import("@ontrails/core").Trail<{
|
|
2
|
-
values: Record<string, unknown>;
|
|
3
|
-
}, {
|
|
4
|
-
diagnostics: {
|
|
5
|
-
message: string;
|
|
6
|
-
path: string;
|
|
7
|
-
status: "default" | "deprecated" | "valid" | "missing" | "invalid";
|
|
8
|
-
}[];
|
|
9
|
-
valid: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=config-check.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-check.d.ts","sourceRoot":"","sources":["../../src/trails/config-check.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,WAAW;;;;;;;;;EA0BtB,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure trail that validates config values against a schema.
|
|
3
|
-
*
|
|
4
|
-
* Returns structured diagnostics indicating which fields are valid,
|
|
5
|
-
* missing, invalid, deprecated, or using defaults.
|
|
6
|
-
*/
|
|
7
|
-
import { Result, trail } from '@ontrails/core';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { configProvision } from '../config-provision.js';
|
|
10
|
-
import { checkConfig } from '../doctor.js';
|
|
11
|
-
import { deepMerge } from '../merge.js';
|
|
12
|
-
const diagnosticSchema = z.object({
|
|
13
|
-
message: z.string(),
|
|
14
|
-
path: z.string(),
|
|
15
|
-
status: z.enum(['valid', 'missing', 'invalid', 'deprecated', 'default']),
|
|
16
|
-
});
|
|
17
|
-
const outputSchema = z.object({
|
|
18
|
-
diagnostics: z.array(diagnosticSchema),
|
|
19
|
-
valid: z.boolean(),
|
|
20
|
-
});
|
|
21
|
-
/** Merge input values on top of resolved config values. */
|
|
22
|
-
const mergeValues = (resolved, overrides) => {
|
|
23
|
-
const hasOverrides = Object.keys(overrides).length > 0;
|
|
24
|
-
return hasOverrides ? deepMerge(resolved, overrides) : resolved;
|
|
25
|
-
};
|
|
26
|
-
export const configCheck = trail('config.check', {
|
|
27
|
-
blaze: (input, ctx) => {
|
|
28
|
-
const state = configProvision.from(ctx);
|
|
29
|
-
const effective = mergeValues(state.resolved, input.values);
|
|
30
|
-
const checked = checkConfig(state.schema, effective);
|
|
31
|
-
return Result.ok({
|
|
32
|
-
diagnostics: [...checked.diagnostics],
|
|
33
|
-
valid: checked.valid,
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
examples: [
|
|
37
|
-
{
|
|
38
|
-
input: {},
|
|
39
|
-
name: 'Check current config',
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
input: z.object({
|
|
43
|
-
values: z
|
|
44
|
-
.record(z.string(), z.unknown())
|
|
45
|
-
.describe('Config values to check (merged with resolved)')
|
|
46
|
-
.default({}),
|
|
47
|
-
}),
|
|
48
|
-
intent: 'read',
|
|
49
|
-
meta: { category: 'infrastructure' },
|
|
50
|
-
output: outputSchema,
|
|
51
|
-
provisions: [configProvision],
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=config-check.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-check.js","sourceRoot":"","sources":["../../src/trails/config-check.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;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KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC,EAAE,CAAC;YACf,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;YACrC,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IACD,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,sBAAsB;SAC7B;KACF;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC;aACN,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/B,QAAQ,CAAC,+CAA+C,CAAC;aACzD,OAAO,CAAC,EAAE,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE;IACpC,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,CAAC,eAAe,CAAC;CAC9B,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const configDescribe: import("@ontrails/core").Trail<Record<string, never>, {
|
|
2
|
-
fields: {
|
|
3
|
-
path: string;
|
|
4
|
-
required: boolean;
|
|
5
|
-
type: string;
|
|
6
|
-
deprecated?: string | undefined;
|
|
7
|
-
description?: string | undefined;
|
|
8
|
-
env?: string | undefined;
|
|
9
|
-
secret?: boolean | undefined;
|
|
10
|
-
}[];
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=config-describe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-describe.d.ts","sourceRoot":"","sources":["../../src/trails/config-describe.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,cAAc;;;;;;;;;;EAiBzB,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure trail that describes all config fields in a schema.
|
|
3
|
-
*
|
|
4
|
-
* Returns a structured catalog of field definitions suitable for
|
|
5
|
-
* CLI rendering or agent inspection.
|
|
6
|
-
*/
|
|
7
|
-
import { Result, trail } from '@ontrails/core';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { configProvision } from '../config-provision.js';
|
|
10
|
-
import { describeConfig } from '../describe.js';
|
|
11
|
-
const fieldSchema = z.object({
|
|
12
|
-
deprecated: z.string().optional(),
|
|
13
|
-
description: z.string().optional(),
|
|
14
|
-
env: z.string().optional(),
|
|
15
|
-
path: z.string(),
|
|
16
|
-
required: z.boolean(),
|
|
17
|
-
secret: z.boolean().optional(),
|
|
18
|
-
type: z.string(),
|
|
19
|
-
});
|
|
20
|
-
const outputSchema = z.object({
|
|
21
|
-
fields: z.array(fieldSchema),
|
|
22
|
-
});
|
|
23
|
-
export const configDescribe = trail('config.describe', {
|
|
24
|
-
blaze: (_input, ctx) => {
|
|
25
|
-
const state = configProvision.from(ctx);
|
|
26
|
-
const fields = describeConfig(state.schema);
|
|
27
|
-
return Result.ok({ fields: [...fields] });
|
|
28
|
-
},
|
|
29
|
-
examples: [
|
|
30
|
-
{
|
|
31
|
-
input: {},
|
|
32
|
-
name: 'Describe all config fields',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
input: z.object({}),
|
|
36
|
-
intent: 'read',
|
|
37
|
-
meta: { category: 'infrastructure' },
|
|
38
|
-
output: outputSchema,
|
|
39
|
-
provisions: [configProvision],
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=config-describe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-describe.js","sourceRoot":"","sources":["../../src/trails/config-describe.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAw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AAE,CAAC,eAAe,CAAC;CAC9B,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-explain.d.ts","sourceRoot":"","sources":["../../src/trails/config-explain.ts"],"names":[],"mappings":"AAoEA,eAAO,MAAM,aAAa;;;;uBAvCG,MAAM;;EA+DjC,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure trail that exposes config provenance.
|
|
3
|
-
*
|
|
4
|
-
* Returns resolved config entries with source information so agents
|
|
5
|
-
* and operators can answer "where did this value come from?"
|
|
6
|
-
*/
|
|
7
|
-
import { Result, trail } from '@ontrails/core';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { configProvision } from '../config-provision.js';
|
|
10
|
-
import { explainConfig } from '../explain.js';
|
|
11
|
-
const provenanceEntrySchema = z.object({
|
|
12
|
-
path: z.string(),
|
|
13
|
-
redacted: z.boolean(),
|
|
14
|
-
source: z.string(),
|
|
15
|
-
value: z.unknown(),
|
|
16
|
-
});
|
|
17
|
-
const outputSchema = z.object({
|
|
18
|
-
entries: z.array(provenanceEntrySchema),
|
|
19
|
-
});
|
|
20
|
-
/** Filter provenance entries by path prefix when specified. */
|
|
21
|
-
const filterByPath = (entries, prefix) => prefix
|
|
22
|
-
? entries.filter((entry) => entry.path === prefix || entry.path.startsWith(`${prefix}.`))
|
|
23
|
-
: entries;
|
|
24
|
-
/** Build ExplainConfigOptions from ConfigState, omitting undefined source overrides. */
|
|
25
|
-
const toExplainOptions = (state) => {
|
|
26
|
-
const base = {
|
|
27
|
-
resolved: state.resolved,
|
|
28
|
-
schema: state.schema,
|
|
29
|
-
};
|
|
30
|
-
if (state.base) {
|
|
31
|
-
return { ...base, base: state.base };
|
|
32
|
-
}
|
|
33
|
-
return base;
|
|
34
|
-
};
|
|
35
|
-
/** Enrich explain options with env and source overrides from state. */
|
|
36
|
-
const enrichOptions = (state, options) => {
|
|
37
|
-
let enriched = options;
|
|
38
|
-
if (state.env) {
|
|
39
|
-
enriched = { ...enriched, env: state.env };
|
|
40
|
-
}
|
|
41
|
-
if (state.loadout) {
|
|
42
|
-
enriched = { ...enriched, loadout: state.loadout };
|
|
43
|
-
}
|
|
44
|
-
if (state.local) {
|
|
45
|
-
enriched = { ...enriched, local: state.local };
|
|
46
|
-
}
|
|
47
|
-
return enriched;
|
|
48
|
-
};
|
|
49
|
-
export const configExplain = trail('config.explain', {
|
|
50
|
-
blaze: (input, ctx) => {
|
|
51
|
-
const state = configProvision.from(ctx);
|
|
52
|
-
const options = enrichOptions(state, toExplainOptions(state));
|
|
53
|
-
const entries = explainConfig(options);
|
|
54
|
-
const filtered = filterByPath(entries, input.path);
|
|
55
|
-
return Result.ok({ entries: [...filtered] });
|
|
56
|
-
},
|
|
57
|
-
examples: [
|
|
58
|
-
{
|
|
59
|
-
input: {},
|
|
60
|
-
name: 'Explain all fields',
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
input: z.object({
|
|
64
|
-
path: z
|
|
65
|
-
.string()
|
|
66
|
-
.describe('Config field path to explain (or empty for all)')
|
|
67
|
-
.default(''),
|
|
68
|
-
}),
|
|
69
|
-
intent: 'read',
|
|
70
|
-
meta: { category: 'infrastructure' },
|
|
71
|
-
output: outputSchema,
|
|
72
|
-
provisions: [configProvision],
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=config-explain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-explain.js","sourceRoot":"","sources":["../../src/trails/config-explain.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,MAAM,qBAAqB,GAAG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
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const configInit: import("@ontrails/core").Trail<{
|
|
2
|
-
format: "toml" | "json" | "jsonc" | "yaml";
|
|
3
|
-
dir?: string | undefined;
|
|
4
|
-
}, {
|
|
5
|
-
content: string;
|
|
6
|
-
format: string;
|
|
7
|
-
writtenFiles?: string[] | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=config-init.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-init.d.ts","sourceRoot":"","sources":["../../src/trails/config-init.ts"],"names":[],"mappings":"AA+DA,eAAO,MAAM,UAAU;;;;;;;EAgCrB,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Infrastructure trail that generates an example config file.
|
|
3
|
-
*
|
|
4
|
-
* Produces TOML, JSON, JSONC, or YAML output from the registered
|
|
5
|
-
* config schema, with defaults shown and deprecated fields annotated.
|
|
6
|
-
*
|
|
7
|
-
* When `dir` is provided, also writes `.env.example` and `.schema.json`
|
|
8
|
-
* to the specified directory.
|
|
9
|
-
*/
|
|
10
|
-
import { join } from 'node:path';
|
|
11
|
-
import { mkdir } from 'node:fs/promises';
|
|
12
|
-
import { Result, trail } from '@ontrails/core';
|
|
13
|
-
import { z as zod } from 'zod';
|
|
14
|
-
import { configProvision } from '../config-provision.js';
|
|
15
|
-
import { generateEnvExample, generateExample, generateJsonSchema, } from '../generate/index.js';
|
|
16
|
-
const formatEnum = zod.enum(['toml', 'json', 'jsonc', 'yaml']);
|
|
17
|
-
const outputSchema = zod.object({
|
|
18
|
-
content: zod.string(),
|
|
19
|
-
format: zod.string(),
|
|
20
|
-
writtenFiles: zod.array(zod.string()).optional(),
|
|
21
|
-
});
|
|
22
|
-
/** Collect artifacts to write: [relativeName, content] pairs. */
|
|
23
|
-
const collectArtifacts = (schema) => {
|
|
24
|
-
const artifacts = [];
|
|
25
|
-
const envContent = generateEnvExample(schema);
|
|
26
|
-
if (envContent.length > 0) {
|
|
27
|
-
artifacts.push(['.env.example', envContent]);
|
|
28
|
-
}
|
|
29
|
-
artifacts.push([
|
|
30
|
-
'.schema.json',
|
|
31
|
-
JSON.stringify(generateJsonSchema(schema), null, 2),
|
|
32
|
-
]);
|
|
33
|
-
return artifacts;
|
|
34
|
-
};
|
|
35
|
-
/** Write generated artifacts to the target directory. */
|
|
36
|
-
const writeArtifacts = async (dir, schema) => {
|
|
37
|
-
await mkdir(dir, { recursive: true });
|
|
38
|
-
const artifacts = collectArtifacts(schema);
|
|
39
|
-
const written = [];
|
|
40
|
-
for (const [name, content] of artifacts) {
|
|
41
|
-
const fullPath = join(dir, name);
|
|
42
|
-
await Bun.write(fullPath, content);
|
|
43
|
-
written.push(fullPath);
|
|
44
|
-
}
|
|
45
|
-
return written;
|
|
46
|
-
};
|
|
47
|
-
export const configInit = trail('config.init', {
|
|
48
|
-
blaze: async (input, ctx) => {
|
|
49
|
-
const state = configProvision.from(ctx);
|
|
50
|
-
const schema = state.schema;
|
|
51
|
-
const content = generateExample(schema, input.format);
|
|
52
|
-
if (input.dir) {
|
|
53
|
-
const writtenFiles = await writeArtifacts(input.dir, schema);
|
|
54
|
-
return Result.ok({ content, format: input.format, writtenFiles });
|
|
55
|
-
}
|
|
56
|
-
return Result.ok({ content, format: input.format });
|
|
57
|
-
},
|
|
58
|
-
examples: [
|
|
59
|
-
{
|
|
60
|
-
input: {},
|
|
61
|
-
name: 'Generate TOML example',
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
input: zod.object({
|
|
65
|
-
dir: zod
|
|
66
|
-
.string()
|
|
67
|
-
.describe('Directory to write generated artifacts to')
|
|
68
|
-
.optional(),
|
|
69
|
-
format: formatEnum
|
|
70
|
-
.describe('Output format for the example config file')
|
|
71
|
-
.default('toml'),
|
|
72
|
-
}),
|
|
73
|
-
intent: 'write',
|
|
74
|
-
meta: { category: 'infrastructure' },
|
|
75
|
-
output: outputSchema,
|
|
76
|
-
provisions: [configProvision],
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=config-init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-init.js","sourceRoot":"","sources":["../../src/trails/config-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/D,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC;AAEH,iEAAiE;AACjE,MAAM,gBAAgB,GAAG,CACvB,MAA8C,EAC1B,EAAE;IACtB,MAAM,SAAS,GAAuB,EAAE,CAAC;IACzC,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,SAAS,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,SAAS,CAAC,IAAI,CAAC;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AAK,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,uBAAuB;SAC9B;KACF;IACD,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC;QAChB,GAAG,EAAE,GAAG;aACL,MAAM,EAAE;aACR,QAAQ,CAAC,2CAA2C,CAAC;aACrD,QAAQ,EAAE;QACb,MAAM,EAAE,UAAU;aACf,QAAQ,CAAC,2CAA2C,CAAC;aACrD,OAAO,CAAC,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE;IACpC,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,CAAC,eAAe,CAAC;CAC9B,CAAC,CAAC"}
|
package/dist/workspace.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure the `.trails/` workspace directory exists with proper structure.
|
|
3
|
-
*
|
|
4
|
-
* Creates `config/`, `dev/`, and `generated/` subdirectories plus a
|
|
5
|
-
* `.gitignore` that excludes local-only files. Safe to call repeatedly —
|
|
6
|
-
* existing files are never overwritten.
|
|
7
|
-
*/
|
|
8
|
-
export declare const ensureWorkspace: (root: string) => Promise<void>;
|
|
9
|
-
//# sourceMappingURL=workspace.d.ts.map
|
package/dist/workspace.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAwCA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,IAAI,CAQhE,CAAC"}
|
package/dist/workspace.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ensure the `.trails/` workspace directory exists with proper structure.
|
|
3
|
-
*
|
|
4
|
-
* Auto-creates on first framework operation. The workspace holds local
|
|
5
|
-
* config overrides, development state, and generated artifacts that
|
|
6
|
-
* should not be committed to source control.
|
|
7
|
-
*/
|
|
8
|
-
import { mkdir } from 'node:fs/promises';
|
|
9
|
-
import { join } from 'node:path';
|
|
10
|
-
const WORKSPACE_DIRS = ['config', 'dev', 'generated'];
|
|
11
|
-
const GITIGNORE_CONTENT = [
|
|
12
|
-
'# Local config overrides',
|
|
13
|
-
'config/',
|
|
14
|
-
'',
|
|
15
|
-
'# Development state',
|
|
16
|
-
'dev/',
|
|
17
|
-
'',
|
|
18
|
-
'# Generated artifacts',
|
|
19
|
-
'generated/',
|
|
20
|
-
'',
|
|
21
|
-
'# Shared Trails database',
|
|
22
|
-
'trails.db',
|
|
23
|
-
'trails.db-shm',
|
|
24
|
-
'trails.db-wal',
|
|
25
|
-
'',
|
|
26
|
-
].join('\n');
|
|
27
|
-
/**
|
|
28
|
-
* Write `.gitignore` inside the workspace directory if it does not already exist.
|
|
29
|
-
*/
|
|
30
|
-
const writeGitignoreIfMissing = async (trailsDir) => {
|
|
31
|
-
const gitignorePath = join(trailsDir, '.gitignore');
|
|
32
|
-
const file = Bun.file(gitignorePath);
|
|
33
|
-
if (!(await file.exists())) {
|
|
34
|
-
await Bun.write(gitignorePath, GITIGNORE_CONTENT);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Ensure the `.trails/` workspace directory exists with proper structure.
|
|
39
|
-
*
|
|
40
|
-
* Creates `config/`, `dev/`, and `generated/` subdirectories plus a
|
|
41
|
-
* `.gitignore` that excludes local-only files. Safe to call repeatedly —
|
|
42
|
-
* existing files are never overwritten.
|
|
43
|
-
*/
|
|
44
|
-
export const ensureWorkspace = async (root) => {
|
|
45
|
-
const trailsDir = join(root, '.trails');
|
|
46
|
-
await Promise.all(WORKSPACE_DIRS.map((d) => mkdir(join(trailsDir, d), { recursive: true })));
|
|
47
|
-
await writeGitignoreIfMissing(trailsDir);
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=workspace.js.map
|
package/dist/workspace.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAU,CAAC;AAE/D,MAAM,iBAAiB,GAAG;IACxB,0BAA0B;IAC1B,SAAS;IACT,EAAE;IACF,qBAAqB;IACrB,MAAM;IACN,EAAE;IACF,uBAAuB;IACvB,YAAY;IACZ,EAAE;IACF,0BAA0B;IAC1B,WAAW;IACX,eAAe;IACf,eAAe;IACf,EAAE;CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;GAEG;AACH,MAAM,uBAAuB,GAAG,KAAK,EAAE,SAAiB,EAAiB,EAAE;IACzE,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACrC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;QAC3B,MAAM,GAAG,CAAC,KAAK,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,IAAY,EAAiB,EAAE;IACnE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAExC,MAAM,OAAO,CAAC,GAAG,CACf,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAC1E,CAAC;IAEF,MAAM,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC3C,CAAC,CAAC"}
|
package/dist/zod-utils.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Zod introspection helpers used by config resolution, doctor,
|
|
3
|
-
* describe, explain, and collect modules.
|
|
4
|
-
*/
|
|
5
|
-
import type { z } from 'zod';
|
|
6
|
-
/** Extract the Zod def record from any ZodType. */
|
|
7
|
-
export declare const zodDef: (schema: z.ZodType) => Record<string, unknown>;
|
|
8
|
-
/** Unwrap through optional/default/nullable wrappers to find the base schema. */
|
|
9
|
-
export declare const unwrapToBase: (schema: z.ZodType) => z.ZodType;
|
|
10
|
-
/** Check if a schema is (or wraps) a ZodObject by inspecting its def. */
|
|
11
|
-
export declare const isZodObject: (schema: z.ZodType) => schema is z.ZodObject<Record<string, z.ZodType>>;
|
|
12
|
-
/** Read a value at a dot-separated path from a plain object. */
|
|
13
|
-
export declare const getAtPath: (obj: Record<string, unknown>, path: string) => unknown;
|
|
14
|
-
//# sourceMappingURL=zod-utils.d.ts.map
|
package/dist/zod-utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"zod-utils.d.ts","sourceRoot":"","sources":["../src/zod-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,mDAAmD;AACnD,eAAO,MAAM,MAAM,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CACf,CAAC;AAKnD,iFAAiF;AACjF,eAAO,MAAM,YAAY,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,CAAC,CAAC,OAclD,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,WAAW,GACtB,QAAQ,CAAC,CAAC,OAAO,KAChB,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAGjD,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,SAAS,GACpB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,MAAM,MAAM,KACX,OASF,CAAC"}
|