@intentius/behold 0.32.0 → 0.33.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/AGENTS.md +64 -3133
- package/README.md +17 -6
- package/dist/chant-KLLNQOCK.js +117 -0
- package/dist/choudoufu-chant-read-MJ6DK23L.js +36 -0
- package/dist/chunk-26K6QLVB.js +157 -0
- package/dist/chunk-4IETG5U7.js +267 -0
- package/dist/chunk-7DQDWJI5.js +46 -0
- package/dist/chunk-ANJ33KX4.js +78 -0
- package/dist/chunk-C7OMVDI5.js +124 -0
- package/dist/chunk-GG3SLEYM.js +30297 -0
- package/dist/chunk-GMCRBXPQ.js +15578 -0
- package/dist/chunk-IMX6PXXA.js +1019 -0
- package/dist/chunk-JHLNY324.js +232 -0
- package/dist/chunk-JJPU2DXX.js +54 -0
- package/dist/chunk-KUHU6T4P.js +2820 -0
- package/dist/chunk-OY4EF7ZO.js +5651 -0
- package/dist/chunk-XKWCGNT2.js +8139 -0
- package/dist/chunk-YO233FHU.js +136 -0
- package/dist/cli.js +859 -77499
- package/dist/config-XKQQ4ORG.js +69 -0
- package/dist/config-run-4IMSAYPX.js +418 -0
- package/dist/declaration-5NE7H5UD.js +6867 -0
- package/dist/index.js +99 -0
- package/dist/main-4PGA5RJS.js +2509 -0
- package/dist/mcp-W2CHVEPI.js +753 -0
- package/dist/object-store-H77QSRIZ.js +1033 -0
- package/dist/src-54PT4UC5.js +1189 -0
- package/dist/tree-W23HE2EZ.js +17 -0
- package/example-choudoufu-estate/chant.workspace.json +1 -1
- package/example-terraform-estate/README.md +2 -2
- package/example-terraform-estate/chant.workspace.json +1 -1
- package/example-three-cloud/chant.workspace.json +2 -2
- package/example-three-cloud/package-lock.json +32 -515
- package/example-three-cloud/package.json +5 -5
- package/package.json +18 -16
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// node_modules/@intentius/chant/dist/lexicon-module.js
|
|
2
|
+
import { dirname as dirname3, isAbsolute, join as join2, relative, resolve, sep as sep3 } from "node:path";
|
|
3
|
+
|
|
4
|
+
// node_modules/@intentius/chant/dist/ts-loader.js
|
|
5
|
+
import { existsSync as existsSync2, readFileSync, realpathSync } from "node:fs";
|
|
6
|
+
import * as nodeModule from "node:module";
|
|
7
|
+
import { dirname as dirname2, join, sep as sep2 } from "node:path";
|
|
8
|
+
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "node:url";
|
|
9
|
+
|
|
10
|
+
// node_modules/@intentius/chant/dist/module-source.js
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
import { dirname, sep } from "node:path";
|
|
13
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
14
|
+
var DIST = `${sep}dist${sep}`;
|
|
15
|
+
function sourcePathOf(path) {
|
|
16
|
+
if (!/\.[cm]?js$/.test(path))
|
|
17
|
+
return path;
|
|
18
|
+
const at = path.lastIndexOf(DIST);
|
|
19
|
+
if (at < 0)
|
|
20
|
+
return path;
|
|
21
|
+
return path.slice(0, at) + `${sep}src${sep}` + path.slice(at + DIST.length);
|
|
22
|
+
}
|
|
23
|
+
function moduleSourceDir(moduleUrl) {
|
|
24
|
+
const path = fileURLToPath(moduleUrl);
|
|
25
|
+
const source = dirname(sourcePathOf(path));
|
|
26
|
+
return source === dirname(path) || existsSync(source) ? source : dirname(path);
|
|
27
|
+
}
|
|
28
|
+
function isTypeScriptModule(pathOrUrl) {
|
|
29
|
+
const path = pathOrUrl.replace(/[?#].*$/, "");
|
|
30
|
+
return /\.(?:[cm]?ts|tsx)$/.test(path) && !/\.d\.[cm]?ts$/.test(path);
|
|
31
|
+
}
|
|
32
|
+
function resolvesDevelopment() {
|
|
33
|
+
if (isTypeScriptModule(import.meta.url))
|
|
34
|
+
return true;
|
|
35
|
+
if (typeof process === "undefined")
|
|
36
|
+
return false;
|
|
37
|
+
const flags = [...process.execArgv, ...(process.env.NODE_OPTIONS ?? "").split(/\s+/)];
|
|
38
|
+
return flags.some((flag, i) => flag === "--conditions=@intentius/chant-source" || flag === "-C=@intentius/chant-source" || (flag === "--conditions" || flag === "-C") && flags[i + 1] === "@intentius/chant-source");
|
|
39
|
+
}
|
|
40
|
+
var SOURCE_EXPORT_CONDITIONS = resolvesDevelopment() ? ["@intentius/chant-source"] : [];
|
|
41
|
+
|
|
42
|
+
// node_modules/@intentius/chant/dist/optional-peer.js
|
|
43
|
+
import { createRequire } from "node:module";
|
|
44
|
+
var INSTALL = {
|
|
45
|
+
esbuild: "npm i -D esbuild",
|
|
46
|
+
tsx: "npm i -D tsx"
|
|
47
|
+
};
|
|
48
|
+
function isMissing(err, name) {
|
|
49
|
+
const code = err?.code;
|
|
50
|
+
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND")
|
|
51
|
+
return false;
|
|
52
|
+
return String(err.message).split("\n")[0].includes(`'${name}`);
|
|
53
|
+
}
|
|
54
|
+
function missingPeerError(name, neededFor) {
|
|
55
|
+
return new Error(`chant needs ${name} to ${neededFor}; install it with: ${INSTALL[name]}`);
|
|
56
|
+
}
|
|
57
|
+
async function importOptionalPeer(name, neededFor, load) {
|
|
58
|
+
try {
|
|
59
|
+
return await load();
|
|
60
|
+
} catch (err) {
|
|
61
|
+
if (isMissing(err, name))
|
|
62
|
+
throw missingPeerError(name, neededFor);
|
|
63
|
+
throw err;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function requireOptionalPeer(name, specifier, neededFor, from) {
|
|
67
|
+
try {
|
|
68
|
+
return createRequire(from)(specifier);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
if (isMissing(err, name))
|
|
71
|
+
throw missingPeerError(name, neededFor);
|
|
72
|
+
throw err;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// node_modules/@intentius/chant/dist/ts-loader.js
|
|
77
|
+
var { registerHooks } = nodeModule;
|
|
78
|
+
var STATE = /* @__PURE__ */ Symbol.for("chant.compiledCli");
|
|
79
|
+
function compiledState() {
|
|
80
|
+
return globalThis[STATE];
|
|
81
|
+
}
|
|
82
|
+
function chantPackageSourceTarget(specifier, parentPath) {
|
|
83
|
+
const match = /^(@intentius\/chant(?:-[a-z0-9-]+)?)(\/.*)?$/.exec(specifier);
|
|
84
|
+
if (!match)
|
|
85
|
+
return void 0;
|
|
86
|
+
const subpath = match[2] ? `.${match[2]}` : ".";
|
|
87
|
+
let dir = dirname2(parentPath);
|
|
88
|
+
for (; ; ) {
|
|
89
|
+
const pkgDir = join(dir, "node_modules", match[1]);
|
|
90
|
+
const manifest = join(pkgDir, "package.json");
|
|
91
|
+
if (existsSync2(manifest)) {
|
|
92
|
+
let exportsField;
|
|
93
|
+
try {
|
|
94
|
+
exportsField = JSON.parse(readFileSync(manifest, "utf-8")).exports;
|
|
95
|
+
} catch {
|
|
96
|
+
return void 0;
|
|
97
|
+
}
|
|
98
|
+
if (!exportsField || typeof exportsField !== "object")
|
|
99
|
+
return void 0;
|
|
100
|
+
const map = exportsField;
|
|
101
|
+
let entry = map[subpath];
|
|
102
|
+
let star;
|
|
103
|
+
if (entry === void 0) {
|
|
104
|
+
let best = "";
|
|
105
|
+
for (const key of Object.keys(map)) {
|
|
106
|
+
const at = key.indexOf("*");
|
|
107
|
+
if (at < 0 || key.indexOf("*", at + 1) >= 0)
|
|
108
|
+
continue;
|
|
109
|
+
const prefix = key.slice(0, at);
|
|
110
|
+
const suffix = key.slice(at + 1);
|
|
111
|
+
if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix) || subpath.length < key.length || prefix.length <= best.length)
|
|
112
|
+
continue;
|
|
113
|
+
best = prefix;
|
|
114
|
+
entry = map[key];
|
|
115
|
+
star = subpath.slice(prefix.length, subpath.length - suffix.length);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const sourceTarget = entry && typeof entry === "object" ? entry["@intentius/chant-source"] : void 0;
|
|
119
|
+
if (typeof sourceTarget !== "string")
|
|
120
|
+
return void 0;
|
|
121
|
+
const target = join(pkgDir, star === void 0 ? sourceTarget : sourceTarget.split("*").join(star));
|
|
122
|
+
return existsSync2(target) ? realpathSync(target) : void 0;
|
|
123
|
+
}
|
|
124
|
+
const parent = dirname2(dir);
|
|
125
|
+
if (parent === dir)
|
|
126
|
+
return void 0;
|
|
127
|
+
dir = parent;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function ensureTypeScriptLoader() {
|
|
131
|
+
const state = compiledState();
|
|
132
|
+
if (!state)
|
|
133
|
+
return false;
|
|
134
|
+
if (state.tsx)
|
|
135
|
+
return true;
|
|
136
|
+
const load = (specifier) => requireOptionalPeer("tsx", specifier, "run TypeScript", import.meta.url);
|
|
137
|
+
load("tsx/cjs/api").register();
|
|
138
|
+
load("tsx/esm/api").register();
|
|
139
|
+
state.tsx = true;
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
function chantSourceDir(moduleUrl) {
|
|
143
|
+
const source = moduleSourceDir(moduleUrl);
|
|
144
|
+
return existsSync2(source) ? source : dirname2(fileURLToPath2(moduleUrl));
|
|
145
|
+
}
|
|
146
|
+
function chantModule(path) {
|
|
147
|
+
return existsSync2(path) ? path : path.replace(/\.ts$/, ".js");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// node_modules/@intentius/chant/dist/module-interop.js
|
|
151
|
+
function esModuleNamespace(namespace) {
|
|
152
|
+
if (namespace === null || typeof namespace !== "object" || !("default" in namespace))
|
|
153
|
+
return namespace;
|
|
154
|
+
const exported = namespace.default;
|
|
155
|
+
if (!isCommonJsEsModule(exported))
|
|
156
|
+
return namespace;
|
|
157
|
+
const unwrapped = {};
|
|
158
|
+
for (const key of Object.keys(exported)) {
|
|
159
|
+
if (key !== "__esModule")
|
|
160
|
+
unwrapped[key] = exported[key];
|
|
161
|
+
}
|
|
162
|
+
return unwrapped;
|
|
163
|
+
}
|
|
164
|
+
function isCommonJsEsModule(value) {
|
|
165
|
+
return value !== null && (typeof value === "object" || typeof value === "function") && value.__esModule === true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// node_modules/@intentius/chant/dist/lexicon-module.js
|
|
169
|
+
function lexiconDeclarationName(entry) {
|
|
170
|
+
return typeof entry === "string" ? entry : entry.name;
|
|
171
|
+
}
|
|
172
|
+
function lexiconNames(entries) {
|
|
173
|
+
return entries?.map(lexiconDeclarationName);
|
|
174
|
+
}
|
|
175
|
+
var modulePaths = /* @__PURE__ */ new Map();
|
|
176
|
+
var moduleRoots = /* @__PURE__ */ new Map();
|
|
177
|
+
function isWithin(path, dir) {
|
|
178
|
+
const rel = relative(dir, path);
|
|
179
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute(rel);
|
|
180
|
+
}
|
|
181
|
+
function pathLexiconRoot(entry, baseDir, sourceDir = ".") {
|
|
182
|
+
const modulePath = isAbsolute(entry.module) ? entry.module : resolve(baseDir, entry.module);
|
|
183
|
+
const declared = entry.root !== void 0;
|
|
184
|
+
const candidate = declared ? isAbsolute(entry.root) ? resolve(entry.root) : resolve(baseDir, entry.root) : dirname3(modulePath);
|
|
185
|
+
const project = resolve(baseDir);
|
|
186
|
+
const source = resolve(baseDir, sourceDir);
|
|
187
|
+
let problem;
|
|
188
|
+
if (!isWithin(candidate, project))
|
|
189
|
+
problem = `${candidate} is outside the project (${project})`;
|
|
190
|
+
else if (isWithin(source, candidate))
|
|
191
|
+
problem = `${candidate} contains the project's source directory (${source})`;
|
|
192
|
+
else if (!isWithin(modulePath, candidate))
|
|
193
|
+
problem = `the module ${modulePath} is not inside ${candidate}`;
|
|
194
|
+
if (problem === void 0)
|
|
195
|
+
return { root: candidate };
|
|
196
|
+
return declared ? { problem } : {};
|
|
197
|
+
}
|
|
198
|
+
function registerLexiconDeclarations(entries, baseDir, sourceDir) {
|
|
199
|
+
const recorded = {};
|
|
200
|
+
for (const entry of entries ?? []) {
|
|
201
|
+
if (typeof entry === "string") {
|
|
202
|
+
modulePaths.delete(entry);
|
|
203
|
+
moduleRoots.delete(entry);
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
const path = declaredModulePath(entry, baseDir);
|
|
207
|
+
modulePaths.set(entry.name, path);
|
|
208
|
+
recorded[entry.name] = path;
|
|
209
|
+
const { root } = pathLexiconRoot(entry, baseDir, sourceDir);
|
|
210
|
+
if (root === void 0)
|
|
211
|
+
moduleRoots.delete(entry.name);
|
|
212
|
+
else
|
|
213
|
+
moduleRoots.set(entry.name, root);
|
|
214
|
+
}
|
|
215
|
+
return recorded;
|
|
216
|
+
}
|
|
217
|
+
function declaredModulePath(entry, baseDir) {
|
|
218
|
+
return isAbsolute(entry.module) ? entry.module : resolve(baseDir, entry.module);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export {
|
|
222
|
+
SOURCE_EXPORT_CONDITIONS,
|
|
223
|
+
importOptionalPeer,
|
|
224
|
+
chantPackageSourceTarget,
|
|
225
|
+
ensureTypeScriptLoader,
|
|
226
|
+
chantSourceDir,
|
|
227
|
+
chantModule,
|
|
228
|
+
esModuleNamespace,
|
|
229
|
+
lexiconNames,
|
|
230
|
+
pathLexiconRoot,
|
|
231
|
+
registerLexiconDeclarations
|
|
232
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// node_modules/@intentius/chant/dist/project-root.js
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { dirname, join, resolve } from "path";
|
|
4
|
+
function findProjectConfig(startDir) {
|
|
5
|
+
const resolvedStart = resolve(startDir);
|
|
6
|
+
let dir = resolvedStart;
|
|
7
|
+
for (; ; ) {
|
|
8
|
+
const tsPath = join(dir, "chant.config.ts");
|
|
9
|
+
if (existsSync(tsPath))
|
|
10
|
+
return { dir, configPath: tsPath };
|
|
11
|
+
const jsonPath = join(dir, "chant.config.json");
|
|
12
|
+
if (existsSync(jsonPath))
|
|
13
|
+
return { dir, configPath: jsonPath };
|
|
14
|
+
if (existsSync(join(dir, ".git")) || existsSync(join(dir, "package.json"))) {
|
|
15
|
+
return { dir };
|
|
16
|
+
}
|
|
17
|
+
const parent = dirname(dir);
|
|
18
|
+
if (parent === dir) {
|
|
19
|
+
return { dir: resolvedStart };
|
|
20
|
+
}
|
|
21
|
+
dir = parent;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
var WORKSPACE_DECLARATION_FILES = ["chant.workspace.json", "chant.workspace.jsonc"];
|
|
25
|
+
function findWorkspaceRoot(startDir) {
|
|
26
|
+
const start = resolve(startDir);
|
|
27
|
+
let top;
|
|
28
|
+
for (let dir = start; ; dir = dirname(dir)) {
|
|
29
|
+
if (existsSync(join(dir, ".git"))) {
|
|
30
|
+
top = dir;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (dirname(dir) === dir)
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
for (let dir = start; ; dir = dirname(dir)) {
|
|
37
|
+
const [json, jsonc] = WORKSPACE_DECLARATION_FILES.map((name) => join(dir, name));
|
|
38
|
+
const hasJson = existsSync(json);
|
|
39
|
+
const hasJsonc = existsSync(jsonc);
|
|
40
|
+
if (hasJson && hasJsonc)
|
|
41
|
+
return { dir, file: json, conflicting: jsonc };
|
|
42
|
+
if (hasJson)
|
|
43
|
+
return { dir, file: json };
|
|
44
|
+
if (hasJsonc)
|
|
45
|
+
return { dir, file: jsonc };
|
|
46
|
+
if (top === void 0 || dir === top || dirname(dir) === dir)
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
findProjectConfig,
|
|
53
|
+
findWorkspaceRoot
|
|
54
|
+
};
|