@contentrain/mcp 0.3.1 → 1.0.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 +1 -1
- package/README.md +147 -238
- package/dist/apply-manager-CaTuu7Lj.mjs +751 -0
- package/dist/apply-manager-CaTuu7Lj.mjs.map +1 -0
- package/dist/astro-parser-RofKmKQi.mjs +166 -0
- package/dist/astro-parser-RofKmKQi.mjs.map +1 -0
- package/dist/branch-lifecycle-DB6sgeJi.mjs +97 -0
- package/dist/branch-lifecycle-DB6sgeJi.mjs.map +1 -0
- package/dist/chunk-BEJ448es.mjs +35 -0
- package/dist/compiler-rIC4ETHv.mjs +44509 -0
- package/dist/compiler-rIC4ETHv.mjs.map +1 -0
- package/dist/compiler-sfc.cjs-BbD04rn_.mjs +50279 -0
- package/dist/compiler-sfc.cjs-BbD04rn_.mjs.map +1 -0
- package/dist/config-CPlhDwsv.mjs +27 -0
- package/dist/config-CPlhDwsv.mjs.map +1 -0
- package/dist/context-yh3cuw5N.mjs +46 -0
- package/dist/context-yh3cuw5N.mjs.map +1 -0
- package/dist/core/apply-manager.d.mts +144 -0
- package/dist/core/apply-manager.d.mts.map +1 -0
- package/dist/core/apply-manager.mjs +6 -0
- package/dist/core/config.d.mts +8 -0
- package/dist/core/config.d.mts.map +1 -0
- package/dist/core/config.mjs +2 -0
- package/dist/core/content-manager.d.mts +53 -0
- package/dist/core/content-manager.d.mts.map +1 -0
- package/dist/core/content-manager.mjs +2 -0
- package/dist/core/context.d.mts +13 -0
- package/dist/core/context.d.mts.map +1 -0
- package/dist/core/context.mjs +3 -0
- package/dist/core/graph-builder.d.mts +12 -0
- package/dist/core/graph-builder.d.mts.map +1 -0
- package/dist/core/graph-builder.mjs +2 -0
- package/dist/core/meta-manager.d.mts +14 -0
- package/dist/core/meta-manager.d.mts.map +1 -0
- package/dist/core/meta-manager.mjs +2 -0
- package/dist/core/model-manager.d.mts +44 -0
- package/dist/core/model-manager.d.mts.map +1 -0
- package/dist/core/model-manager.mjs +2 -0
- package/dist/core/scan-config.d.mts +24 -0
- package/dist/core/scan-config.d.mts.map +1 -0
- package/dist/core/scan-config.mjs +2 -0
- package/dist/core/scanner.d.mts +25 -0
- package/dist/core/scanner.d.mts.map +1 -0
- package/dist/core/scanner.mjs +3 -0
- package/dist/core/validator.d.mts +23 -0
- package/dist/core/validator.d.mts.map +1 -0
- package/dist/core/validator.mjs +3 -0
- package/dist/detect-C8XmJ4S6.mjs +362 -0
- package/dist/detect-C8XmJ4S6.mjs.map +1 -0
- package/dist/fs-BbuGnVcG.mjs +52 -0
- package/dist/fs-BbuGnVcG.mjs.map +1 -0
- package/dist/git/branch-lifecycle.d.mts +28 -0
- package/dist/git/branch-lifecycle.d.mts.map +1 -0
- package/dist/git/branch-lifecycle.mjs +2 -0
- package/dist/git/transaction.d.mts +25 -0
- package/dist/git/transaction.d.mts.map +1 -0
- package/dist/git/transaction.mjs +4 -0
- package/dist/graph-builder-fPrDDwnu.mjs +162 -0
- package/dist/graph-builder-fPrDDwnu.mjs.map +1 -0
- package/dist/id-BdD4HvMY.mjs +12 -0
- package/dist/id-BdD4HvMY.mjs.map +1 -0
- package/dist/index.d.mts +1 -359
- package/dist/index.mjs +15 -2161
- package/dist/index.mjs.map +1 -1
- package/dist/meta-manager-CECrfsKm.mjs +53 -0
- package/dist/meta-manager-CECrfsKm.mjs.map +1 -0
- package/dist/model-manager-BcWWu5l2.mjs +963 -0
- package/dist/model-manager-BcWWu5l2.mjs.map +1 -0
- package/dist/node-Cbq5eR5i.mjs +300 -0
- package/dist/node-Cbq5eR5i.mjs.map +1 -0
- package/dist/scan-config-AJGxCdNd.mjs +159 -0
- package/dist/scan-config-AJGxCdNd.mjs.map +1 -0
- package/dist/scanner-BdTiv8sw.mjs +619 -0
- package/dist/scanner-BdTiv8sw.mjs.map +1 -0
- package/dist/serializer-Dueih-i2.mjs +33 -0
- package/dist/serializer-Dueih-i2.mjs.map +1 -0
- package/dist/server-CTcDpxwW.mjs +1861 -0
- package/dist/server-CTcDpxwW.mjs.map +1 -0
- package/dist/server.d.mts +7 -0
- package/dist/server.d.mts.map +1 -0
- package/dist/server.mjs +11 -0
- package/dist/source-map-generator-DpO-ejrt.mjs +893 -0
- package/dist/source-map-generator-DpO-ejrt.mjs.map +1 -0
- package/dist/svelte-parser-COTNG92w.mjs +225 -0
- package/dist/svelte-parser-COTNG92w.mjs.map +1 -0
- package/dist/templates/index.d.mts +8 -0
- package/dist/templates/index.d.mts.map +1 -0
- package/dist/templates/index.mjs +2 -0
- package/dist/templates-3HWi-PTu.mjs +824 -0
- package/dist/templates-3HWi-PTu.mjs.map +1 -0
- package/dist/transaction-BsECnmL5.mjs +128 -0
- package/dist/transaction-BsECnmL5.mjs.map +1 -0
- package/dist/tsx-parser-Bf8Firrq.mjs +2 -0
- package/dist/tsx-parser-CYVyBWjn.mjs +234 -0
- package/dist/tsx-parser-CYVyBWjn.mjs.map +1 -0
- package/dist/util/detect.d.mts +20 -0
- package/dist/util/detect.d.mts.map +1 -0
- package/dist/util/detect.mjs +2 -0
- package/dist/util/fs.d.mts +12 -0
- package/dist/util/fs.d.mts.map +1 -0
- package/dist/util/fs.mjs +2 -0
- package/dist/util/id.d.mts +6 -0
- package/dist/util/id.d.mts.map +1 -0
- package/dist/util/id.mjs +2 -0
- package/dist/util/serializer.d.mts +14 -0
- package/dist/util/serializer.d.mts.map +1 -0
- package/dist/util/serializer.mjs +2 -0
- package/dist/validator-ku84AyFr.mjs +755 -0
- package/dist/validator-ku84AyFr.mjs.map +1 -0
- package/dist/vue-parser-CjS4YAoQ.mjs +225 -0
- package/dist/vue-parser-CjS4YAoQ.mjs.map +1 -0
- package/package.json +107 -43
- package/dist/fs-D83-Ii_y.mjs +0 -75
- package/dist/fs-D83-Ii_y.mjs.map +0 -1
- package/dist/index.d.mts.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { a as readJson, t as contentrainDir } from "./fs-BbuGnVcG.mjs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
//#region src/core/config.ts
|
|
4
|
+
async function readConfig(projectRoot) {
|
|
5
|
+
const raw = await readJson(join(contentrainDir(projectRoot), "config.json"));
|
|
6
|
+
if (!raw) return null;
|
|
7
|
+
return {
|
|
8
|
+
version: raw.version ?? 1,
|
|
9
|
+
stack: raw.stack ?? "other",
|
|
10
|
+
workflow: raw.workflow ?? "auto-merge",
|
|
11
|
+
locales: {
|
|
12
|
+
default: raw.locales?.default ?? "en",
|
|
13
|
+
supported: raw.locales?.supported ?? [raw.locales?.default ?? "en"]
|
|
14
|
+
},
|
|
15
|
+
domains: raw.domains ?? [],
|
|
16
|
+
repository: raw.repository,
|
|
17
|
+
assets_path: raw.assets_path,
|
|
18
|
+
branchRetention: raw.branchRetention
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
async function readVocabulary(projectRoot) {
|
|
22
|
+
return readJson(join(contentrainDir(projectRoot), "vocabulary.json"));
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { readVocabulary as n, readConfig as t };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=config-CPlhDwsv.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CPlhDwsv.mjs","names":[],"sources":["../src/core/config.ts"],"sourcesContent":["import type { ContentrainConfig, Vocabulary } from '@contentrain/types'\nimport { join } from 'node:path'\nimport { contentrainDir, readJson } from '../util/fs.js'\n\nexport async function readConfig(projectRoot: string): Promise<ContentrainConfig | null> {\n const raw = await readJson<Partial<ContentrainConfig>>(join(contentrainDir(projectRoot), 'config.json'))\n if (!raw) return null\n\n // Normalize with safe defaults\n return {\n version: raw.version ?? 1,\n stack: raw.stack ?? 'other',\n workflow: raw.workflow ?? 'auto-merge',\n locales: {\n default: raw.locales?.default ?? 'en',\n supported: raw.locales?.supported ?? [raw.locales?.default ?? 'en'],\n },\n domains: raw.domains ?? [],\n repository: raw.repository,\n assets_path: raw.assets_path,\n branchRetention: raw.branchRetention,\n }\n}\n\nexport async function readVocabulary(projectRoot: string): Promise<Vocabulary | null> {\n return readJson<Vocabulary>(join(contentrainDir(projectRoot), 'vocabulary.json'))\n}\n"],"mappings":";;;AAIA,eAAsB,WAAW,aAAwD;CACvF,MAAM,MAAM,MAAM,SAAqC,KAAK,eAAe,YAAY,EAAE,cAAc,CAAC;AACxG,KAAI,CAAC,IAAK,QAAO;AAGjB,QAAO;EACL,SAAS,IAAI,WAAW;EACxB,OAAO,IAAI,SAAS;EACpB,UAAU,IAAI,YAAY;EAC1B,SAAS;GACP,SAAS,IAAI,SAAS,WAAW;GACjC,WAAW,IAAI,SAAS,aAAa,CAAC,IAAI,SAAS,WAAW,KAAK;GACpE;EACD,SAAS,IAAI,WAAW,EAAE;EAC1B,YAAY,IAAI;EAChB,aAAa,IAAI;EACjB,iBAAiB,IAAI;EACtB;;AAGH,eAAsB,eAAe,aAAiD;AACpF,QAAO,SAAqB,KAAK,eAAe,YAAY,EAAE,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { a as readJson, s as writeJson, t as contentrainDir } from "./fs-BbuGnVcG.mjs";
|
|
2
|
+
import { t as readConfig } from "./config-CPlhDwsv.mjs";
|
|
3
|
+
import { o as listModels, r as countEntries, s as readModel } from "./model-manager-BcWWu5l2.mjs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
//#region src/core/context.ts
|
|
6
|
+
async function readContext(projectRoot) {
|
|
7
|
+
return readJson(join(contentrainDir(projectRoot), "context.json"));
|
|
8
|
+
}
|
|
9
|
+
async function writeContext(projectRoot, operation) {
|
|
10
|
+
const models = await listModels(projectRoot);
|
|
11
|
+
const config = await readConfig(projectRoot);
|
|
12
|
+
const locales = config?.locales.supported ?? ["en"];
|
|
13
|
+
let totalEntries = null;
|
|
14
|
+
try {
|
|
15
|
+
let count = 0;
|
|
16
|
+
const fullModels = await Promise.all(models.map((m) => readModel(projectRoot, m.id)));
|
|
17
|
+
const counts = await Promise.all(fullModels.filter((m) => m !== null).map((m) => countEntries(projectRoot, m)));
|
|
18
|
+
for (const c of counts) count += c.total;
|
|
19
|
+
totalEntries = count;
|
|
20
|
+
} catch {
|
|
21
|
+
totalEntries = null;
|
|
22
|
+
}
|
|
23
|
+
const source = process.env["CONTENTRAIN_SOURCE"] === "mcp-studio" ? "mcp-studio" : "mcp-local";
|
|
24
|
+
const context = {
|
|
25
|
+
version: "1",
|
|
26
|
+
lastOperation: {
|
|
27
|
+
tool: operation.tool,
|
|
28
|
+
model: operation.model,
|
|
29
|
+
locale: operation.locale ?? config?.locales.default ?? "en",
|
|
30
|
+
entries: operation.entries,
|
|
31
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
|
+
source
|
|
33
|
+
},
|
|
34
|
+
stats: {
|
|
35
|
+
models: models.length,
|
|
36
|
+
entries: totalEntries,
|
|
37
|
+
locales,
|
|
38
|
+
lastSync: (/* @__PURE__ */ new Date()).toISOString()
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
await writeJson(join(contentrainDir(projectRoot), "context.json"), context);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { writeContext as n, readContext as t };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=context-yh3cuw5N.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-yh3cuw5N.mjs","names":[],"sources":["../src/core/context.ts"],"sourcesContent":["import type { ContextJson, ContextSource } from '@contentrain/types'\nimport { join } from 'node:path'\nimport { contentrainDir, readJson, writeJson } from '../util/fs.js'\nimport { listModels, readModel, countEntries } from './model-manager.js'\nimport { readConfig } from './config.js'\n\nexport async function readContext(projectRoot: string): Promise<ContextJson | null> {\n return readJson<ContextJson>(join(contentrainDir(projectRoot), 'context.json'))\n}\n\nexport async function writeContext(\n projectRoot: string,\n operation: { tool: string; model: string; locale?: string; entries?: string[] },\n): Promise<void> {\n const models = await listModels(projectRoot)\n const config = await readConfig(projectRoot)\n const locales = config?.locales.supported ?? ['en']\n\n // Calculate real entry count across all models\n let totalEntries: number | null = null\n try {\n let count = 0\n const fullModels = await Promise.all(\n models.map(m => readModel(projectRoot, m.id)),\n )\n const counts = await Promise.all(\n fullModels\n .filter((m): m is NonNullable<typeof m> => m !== null)\n .map(m => countEntries(projectRoot, m)),\n )\n for (const c of counts) {\n count += c.total\n }\n totalEntries = count\n } catch {\n // If counting fails, signal unknown rather than zero\n totalEntries = null\n }\n\n const source: ContextSource = process.env['CONTENTRAIN_SOURCE'] === 'mcp-studio'\n ? 'mcp-studio'\n : 'mcp-local'\n\n const context: ContextJson = {\n version: '1',\n lastOperation: {\n tool: operation.tool,\n model: operation.model,\n locale: operation.locale ?? config?.locales.default ?? 'en',\n entries: operation.entries,\n timestamp: new Date().toISOString(),\n source,\n },\n stats: {\n models: models.length,\n entries: totalEntries as number,\n locales,\n lastSync: new Date().toISOString(),\n },\n }\n\n await writeJson(join(contentrainDir(projectRoot), 'context.json'), context)\n}\n"],"mappings":";;;;;AAMA,eAAsB,YAAY,aAAkD;AAClF,QAAO,SAAsB,KAAK,eAAe,YAAY,EAAE,eAAe,CAAC;;AAGjF,eAAsB,aACpB,aACA,WACe;CACf,MAAM,SAAS,MAAM,WAAW,YAAY;CAC5C,MAAM,SAAS,MAAM,WAAW,YAAY;CAC5C,MAAM,UAAU,QAAQ,QAAQ,aAAa,CAAC,KAAK;CAGnD,IAAI,eAA8B;AAClC,KAAI;EACF,IAAI,QAAQ;EACZ,MAAM,aAAa,MAAM,QAAQ,IAC/B,OAAO,KAAI,MAAK,UAAU,aAAa,EAAE,GAAG,CAAC,CAC9C;EACD,MAAM,SAAS,MAAM,QAAQ,IAC3B,WACG,QAAQ,MAAkC,MAAM,KAAK,CACrD,KAAI,MAAK,aAAa,aAAa,EAAE,CAAC,CAC1C;AACD,OAAK,MAAM,KAAK,OACd,UAAS,EAAE;AAEb,iBAAe;SACT;AAEN,iBAAe;;CAGjB,MAAM,SAAwB,QAAQ,IAAI,0BAA0B,eAChE,eACA;CAEJ,MAAM,UAAuB;EAC3B,SAAS;EACT,eAAe;GACb,MAAM,UAAU;GAChB,OAAO,UAAU;GACjB,QAAQ,UAAU,UAAU,QAAQ,QAAQ,WAAW;GACvD,SAAS,UAAU;GACnB,4BAAW,IAAI,MAAM,EAAC,aAAa;GACnC;GACD;EACD,OAAO;GACL,QAAQ,OAAO;GACf,SAAS;GACT;GACA,2BAAU,IAAI,MAAM,EAAC,aAAa;GACnC;EACF;AAED,OAAM,UAAU,KAAK,eAAe,YAAY,EAAE,eAAe,EAAE,QAAQ"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { FieldDef } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/apply-manager.d.ts
|
|
4
|
+
interface ExtractionEntry {
|
|
5
|
+
model: string;
|
|
6
|
+
kind: 'singleton' | 'collection' | 'dictionary' | 'document';
|
|
7
|
+
domain: string;
|
|
8
|
+
i18n?: boolean;
|
|
9
|
+
fields?: Record<string, FieldDef>;
|
|
10
|
+
entries: Array<{
|
|
11
|
+
locale?: string;
|
|
12
|
+
slug?: string;
|
|
13
|
+
data: Record<string, unknown>;
|
|
14
|
+
source?: {
|
|
15
|
+
file: string;
|
|
16
|
+
line: number;
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
sources?: Array<{
|
|
20
|
+
file: string;
|
|
21
|
+
line: number;
|
|
22
|
+
key: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
interface ExtractionInput {
|
|
28
|
+
extractions: ExtractionEntry[];
|
|
29
|
+
dry_run?: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface ExtractionPreview {
|
|
32
|
+
models_to_create: string[];
|
|
33
|
+
models_to_update: string[];
|
|
34
|
+
total_entries: number;
|
|
35
|
+
content_files: string[];
|
|
36
|
+
}
|
|
37
|
+
interface ExtractionResult {
|
|
38
|
+
dry_run: boolean;
|
|
39
|
+
preview?: ExtractionPreview;
|
|
40
|
+
error?: string;
|
|
41
|
+
validation_errors?: string[];
|
|
42
|
+
results?: {
|
|
43
|
+
models_created: string[];
|
|
44
|
+
models_updated: string[];
|
|
45
|
+
entries_written: number;
|
|
46
|
+
source_map: Array<{
|
|
47
|
+
model: string;
|
|
48
|
+
locale: string;
|
|
49
|
+
value: string;
|
|
50
|
+
file: string;
|
|
51
|
+
line: number;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
git?: {
|
|
55
|
+
branch: string;
|
|
56
|
+
action: string;
|
|
57
|
+
commit: string;
|
|
58
|
+
};
|
|
59
|
+
context_updated?: boolean;
|
|
60
|
+
next_steps: string[];
|
|
61
|
+
}
|
|
62
|
+
interface PatchEntry {
|
|
63
|
+
file: string;
|
|
64
|
+
line: number;
|
|
65
|
+
old_value: string;
|
|
66
|
+
new_expression: string;
|
|
67
|
+
import_statement?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ReuseInput {
|
|
70
|
+
scope: {
|
|
71
|
+
model?: string;
|
|
72
|
+
domain?: string;
|
|
73
|
+
};
|
|
74
|
+
patches: PatchEntry[];
|
|
75
|
+
dry_run?: boolean;
|
|
76
|
+
}
|
|
77
|
+
interface SyntaxError {
|
|
78
|
+
file: string;
|
|
79
|
+
error: string;
|
|
80
|
+
}
|
|
81
|
+
interface ReuseResult {
|
|
82
|
+
dry_run: boolean;
|
|
83
|
+
error?: string;
|
|
84
|
+
scope_warnings?: string[];
|
|
85
|
+
preview?: {
|
|
86
|
+
files_to_modify: string[];
|
|
87
|
+
patches_count: number;
|
|
88
|
+
imports_to_add: number;
|
|
89
|
+
};
|
|
90
|
+
results?: {
|
|
91
|
+
files_modified: string[];
|
|
92
|
+
patches_applied: number;
|
|
93
|
+
patches_skipped: Array<{
|
|
94
|
+
file: string;
|
|
95
|
+
line: number;
|
|
96
|
+
reason: string;
|
|
97
|
+
}>;
|
|
98
|
+
imports_added: number;
|
|
99
|
+
framework_warnings?: Array<{
|
|
100
|
+
file: string;
|
|
101
|
+
warning: string;
|
|
102
|
+
}>;
|
|
103
|
+
syntax_errors?: SyntaxError[];
|
|
104
|
+
};
|
|
105
|
+
git?: {
|
|
106
|
+
branch: string;
|
|
107
|
+
action: string;
|
|
108
|
+
commit: string;
|
|
109
|
+
};
|
|
110
|
+
next_steps: string[];
|
|
111
|
+
}
|
|
112
|
+
/** File extensions allowed for patching — scannable source files only */
|
|
113
|
+
declare const PATCHABLE_EXTENSIONS: Set<string>;
|
|
114
|
+
type FileFramework = 'vue' | 'svelte' | 'jsx' | 'astro' | 'script';
|
|
115
|
+
declare function detectFileFramework(filePath: string): FileFramework;
|
|
116
|
+
/**
|
|
117
|
+
* Validate that a replacement expression uses the correct template syntax
|
|
118
|
+
* for the target file's framework. Returns a warning string or null.
|
|
119
|
+
*/
|
|
120
|
+
declare function validateFrameworkExpression(filePath: string, newExpression: string, context: 'tag_text' | 'other'): string | null;
|
|
121
|
+
/**
|
|
122
|
+
* Validate that a patch file path is safe and within allowed scope.
|
|
123
|
+
* Returns an error message or null if valid.
|
|
124
|
+
*/
|
|
125
|
+
declare function validatePatchPath(filePath: string): string | null;
|
|
126
|
+
/**
|
|
127
|
+
* Perform a basic syntax check on a patched file.
|
|
128
|
+
* Returns an error message or null if syntax appears valid.
|
|
129
|
+
*/
|
|
130
|
+
declare function checkSyntax(filePath: string, content: string): string | null;
|
|
131
|
+
declare function applyExtract(projectRoot: string, input: ExtractionInput): Promise<ExtractionResult>;
|
|
132
|
+
declare function applyReuse(projectRoot: string, input: ReuseInput): Promise<ReuseResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Replace old_value with new_expression in a single line.
|
|
135
|
+
* Matches the string literal (quoted or unquoted tag text).
|
|
136
|
+
* Returns the modified line, or null if not found.
|
|
137
|
+
*
|
|
138
|
+
* Guardrail #4: Safer patch matching — word boundary awareness and
|
|
139
|
+
* ambiguity rejection for plain text fallback.
|
|
140
|
+
*/
|
|
141
|
+
declare function replaceInLine(line: string, oldValue: string, newExpression: string): string | null;
|
|
142
|
+
//#endregion
|
|
143
|
+
export { ExtractionEntry, ExtractionInput, ExtractionPreview, ExtractionResult, FileFramework, PATCHABLE_EXTENSIONS, PatchEntry, ReuseInput, ReuseResult, SyntaxError, applyExtract, applyReuse, checkSyntax, detectFileFramework, replaceInLine, validateFrameworkExpression, validatePatchPath };
|
|
144
|
+
//# sourceMappingURL=apply-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-manager.d.mts","names":[],"sources":["../../src/core/apply-manager.ts"],"mappings":";;;UAYiB,eAAA;EACf,KAAA;EACA,IAAA;EACA,MAAA;EACA,IAAA;EACA,MAAA,GAAS,MAAA,SAAe,QAAA;EACxB,OAAA,EAAS,KAAA;IACP,MAAA;IACA,IAAA;IACA,IAAA,EAAM,MAAA;IACN,MAAA;MAAW,IAAA;MAAc,IAAA;MAAc,KAAA;IAAA;IACvC,OAAA,GAAU,KAAA;MAAQ,IAAA;MAAc,IAAA;MAAc,GAAA;MAAa,KAAA;IAAA;EAAA;AAAA;AAAA,UAI9C,eAAA;EACf,WAAA,EAAa,eAAA;EACb,OAAA;AAAA;AAAA,UAGe,iBAAA;EACf,gBAAA;EACA,gBAAA;EACA,aAAA;EACA,aAAA;AAAA;AAAA,UAGe,gBAAA;EACf,OAAA;EACA,OAAA,GAAU,iBAAA;EACV,KAAA;EACA,iBAAA;EACA,OAAA;IACE,cAAA;IACA,cAAA;IACA,eAAA;IACA,UAAA,EAAY,KAAA;MAAQ,KAAA;MAAe,MAAA;MAAgB,KAAA;MAAe,IAAA;MAAc,IAAA;IAAA;EAAA;EAElF,GAAA;IAAQ,MAAA;IAAgB,MAAA;IAAgB,MAAA;EAAA;EACxC,eAAA;EACA,UAAA;AAAA;AAAA,UAGe,UAAA;EACf,IAAA;EACA,IAAA;EACA,SAAA;EACA,cAAA;EACA,gBAAA;AAAA;AAAA,UAGe,UAAA;EACf,KAAA;IAAS,KAAA;IAAgB,MAAA;EAAA;EACzB,OAAA,EAAS,UAAA;EACT,OAAA;AAAA;AAAA,UAGe,WAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,UAGe,WAAA;EACf,OAAA;EACA,KAAA;EACA,cAAA;EACA,OAAA;IACE,eAAA;IACA,aAAA;IACA,cAAA;EAAA;EAEF,OAAA;IACE,cAAA;IACA,eAAA;IACA,eAAA,EAAiB,KAAA;MAAQ,IAAA;MAAc,IAAA;MAAc,MAAA;IAAA;IACrD,aAAA;IACA,kBAAA,GAAqB,KAAA;MAAQ,IAAA;MAAc,OAAA;IAAA;IAC3C,aAAA,GAAgB,WAAA;EAAA;EAElB,GAAA;IAAQ,MAAA;IAAgB,MAAA;IAAgB,MAAA;EAAA;EACxC,UAAA;AAAA;;cAQW,oBAAA,EAAoB,GAAA;AAAA,KAWrB,aAAA;AAAA,iBAEI,mBAAA,CAAoB,QAAA,WAAmB,aAAA;AAvCvD;;;;AAAA,iBA0DgB,2BAAA,CACd,QAAA,UACA,aAAA,UACA,OAAA;;;;;iBAyCc,iBAAA,CAAkB,QAAA;;;;;iBAoClB,WAAA,CAAY,QAAA,UAAkB,OAAA;AAAA,iBA8JxB,YAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,GACN,OAAA,CAAQ,gBAAA;AAAA,iBAiRW,UAAA,CACpB,WAAA,UACA,KAAA,EAAO,UAAA,GACN,OAAA,CAAQ,WAAA;;;;;;;;;iBAmYK,aAAA,CAAc,IAAA,UAAc,QAAA,UAAkB,aAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "../model-manager-BcWWu5l2.mjs";
|
|
2
|
+
import "../context-yh3cuw5N.mjs";
|
|
3
|
+
import "../branch-lifecycle-DB6sgeJi.mjs";
|
|
4
|
+
import "../transaction-BsECnmL5.mjs";
|
|
5
|
+
import { a as detectFileFramework, c as validatePatchPath, i as checkSyntax, n as applyExtract, o as replaceInLine, r as applyReuse, s as validateFrameworkExpression, t as PATCHABLE_EXTENSIONS } from "../apply-manager-CaTuu7Lj.mjs";
|
|
6
|
+
export { PATCHABLE_EXTENSIONS, applyExtract, applyReuse, checkSyntax, detectFileFramework, replaceInLine, validateFrameworkExpression, validatePatchPath };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContentrainConfig, Vocabulary } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/config.d.ts
|
|
4
|
+
declare function readConfig(projectRoot: string): Promise<ContentrainConfig | null>;
|
|
5
|
+
declare function readVocabulary(projectRoot: string): Promise<Vocabulary | null>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { readConfig, readVocabulary };
|
|
8
|
+
//# sourceMappingURL=config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../../src/core/config.ts"],"mappings":";;;iBAIsB,UAAA,CAAW,WAAA,WAAsB,OAAA,CAAQ,iBAAA;AAAA,iBAoBzC,cAAA,CAAe,WAAA,WAAsB,OAAA,CAAQ,UAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ContentrainConfig, LocaleStrategy, ModelDefinition } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/content-manager.d.ts
|
|
4
|
+
declare function validateSlug(slug: string): string | null;
|
|
5
|
+
declare function validateEntryId(id: string): string | null;
|
|
6
|
+
declare function validateLocale(locale: string, config: ContentrainConfig): string | null;
|
|
7
|
+
declare function parseFrontmatter(content: string): {
|
|
8
|
+
frontmatter: Record<string, unknown>;
|
|
9
|
+
body: string;
|
|
10
|
+
};
|
|
11
|
+
declare function serializeFrontmatter(data: Record<string, unknown>, body: string): string;
|
|
12
|
+
declare function resolveContentDir(projectRoot: string, model: ModelDefinition): string;
|
|
13
|
+
declare function resolveLocaleStrategy(model: ModelDefinition): LocaleStrategy;
|
|
14
|
+
/** Build the file path for a JSON content file (singleton/collection/dictionary) */
|
|
15
|
+
declare function resolveJsonFilePath(dir: string, model: ModelDefinition, locale: string): string;
|
|
16
|
+
/** Build the file path for a markdown document */
|
|
17
|
+
declare function resolveMdFilePath(dir: string, model: ModelDefinition, locale: string, slug: string): string;
|
|
18
|
+
interface ContentEntry {
|
|
19
|
+
id?: string;
|
|
20
|
+
slug?: string;
|
|
21
|
+
locale?: string;
|
|
22
|
+
data: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
interface WriteResult {
|
|
25
|
+
action: 'created' | 'updated';
|
|
26
|
+
id?: string;
|
|
27
|
+
slug?: string;
|
|
28
|
+
locale: string;
|
|
29
|
+
}
|
|
30
|
+
interface DeleteOpts {
|
|
31
|
+
id?: string;
|
|
32
|
+
slug?: string;
|
|
33
|
+
locale?: string;
|
|
34
|
+
keys?: string[];
|
|
35
|
+
}
|
|
36
|
+
interface ListOpts {
|
|
37
|
+
locale?: string;
|
|
38
|
+
filter?: Record<string, unknown>;
|
|
39
|
+
resolve?: boolean;
|
|
40
|
+
limit?: number;
|
|
41
|
+
offset?: number;
|
|
42
|
+
}
|
|
43
|
+
declare function writeContent(projectRoot: string, model: ModelDefinition, entries: ContentEntry[], config: ContentrainConfig): Promise<WriteResult[]>;
|
|
44
|
+
declare function deleteContent(projectRoot: string, model: ModelDefinition, opts: DeleteOpts): Promise<string[]>;
|
|
45
|
+
declare function listContent(projectRoot: string, model: ModelDefinition, opts: ListOpts, config: ContentrainConfig): Promise<unknown>;
|
|
46
|
+
declare function readContent(projectRoot: string, model: ModelDefinition, opts: {
|
|
47
|
+
locale: string;
|
|
48
|
+
entryId?: string;
|
|
49
|
+
slug?: string;
|
|
50
|
+
}): Promise<unknown>;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { ContentEntry, DeleteOpts, ListOpts, WriteResult, deleteContent, listContent, parseFrontmatter, readContent, resolveContentDir, resolveJsonFilePath, resolveLocaleStrategy, resolveMdFilePath, serializeFrontmatter, validateEntryId, validateLocale, validateSlug, writeContent };
|
|
53
|
+
//# sourceMappingURL=content-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-manager.d.mts","names":[],"sources":["../../src/core/content-manager.ts"],"mappings":";;;iBAcgB,YAAA,CAAa,IAAA;AAAA,iBAOb,eAAA,CAAgB,EAAA;AAAA,iBAKhB,cAAA,CAAe,MAAA,UAAgB,MAAA,EAAQ,iBAAA;AAAA,iBAUvC,gBAAA,CAAiB,OAAA;EAAoB,WAAA,EAAa,MAAA;EAAyB,IAAA;AAAA;AAAA,iBAuE3E,oBAAA,CAAqB,IAAA,EAAM,MAAA,mBAAyB,IAAA;AAAA,iBAsEpD,iBAAA,CAAkB,WAAA,UAAqB,KAAA,EAAO,eAAA;AAAA,iBAO9C,qBAAA,CAAsB,KAAA,EAAO,eAAA,GAAkB,cAAA;;iBAK/C,mBAAA,CAAoB,GAAA,UAAa,KAAA,EAAO,eAAA,EAAiB,MAAA;AAnKzE;AAAA,iBAiLgB,iBAAA,CAAkB,GAAA,UAAa,KAAA,EAAO,eAAA,EAAiB,MAAA,UAAgB,IAAA;AAAA,UAetE,YAAA;EACf,EAAA;EACA,IAAA;EACA,MAAA;EACA,IAAA,EAAM,MAAA;AAAA;AAAA,UAGS,WAAA;EACf,MAAA;EACA,EAAA;EACA,IAAA;EACA,MAAA;AAAA;AAAA,UAGe,UAAA;EACf,EAAA;EACA,IAAA;EACA,MAAA;EACA,IAAA;AAAA;AAAA,UAGe,QAAA;EACf,MAAA;EACA,MAAA,GAAS,MAAA;EACT,OAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,iBAsBoB,YAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,OAAA,EAAS,YAAA,IACT,MAAA,EAAQ,iBAAA,GACP,OAAA,CAAQ,WAAA;AAAA,iBAyGW,aAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,IAAA,EAAM,UAAA,GACL,OAAA;AAAA,iBAiHmB,WAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,IAAA,EAAM,QAAA,EACN,MAAA,EAAQ,iBAAA,GACP,OAAA;AAAA,iBAyHmB,WAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,IAAA;EAAQ,MAAA;EAAgB,OAAA;EAAkB,IAAA;AAAA,IACzC,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { S as writeContent, _ as resolveMdFilePath, b as validateLocale, d as listContent, f as parseFrontmatter, g as resolveLocaleStrategy, h as resolveJsonFilePath, m as resolveContentDir, p as readContent, u as deleteContent, v as serializeFrontmatter, x as validateSlug, y as validateEntryId } from "../model-manager-BcWWu5l2.mjs";
|
|
2
|
+
export { deleteContent, listContent, parseFrontmatter, readContent, resolveContentDir, resolveJsonFilePath, resolveLocaleStrategy, resolveMdFilePath, serializeFrontmatter, validateEntryId, validateLocale, validateSlug, writeContent };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContextJson } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/context.d.ts
|
|
4
|
+
declare function readContext(projectRoot: string): Promise<ContextJson | null>;
|
|
5
|
+
declare function writeContext(projectRoot: string, operation: {
|
|
6
|
+
tool: string;
|
|
7
|
+
model: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
entries?: string[];
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { readContext, writeContext };
|
|
13
|
+
//# sourceMappingURL=context.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.mts","names":[],"sources":["../../src/core/context.ts"],"mappings":";;;iBAMsB,WAAA,CAAY,WAAA,WAAsB,OAAA,CAAQ,WAAA;AAAA,iBAI1C,YAAA,CACpB,WAAA,UACA,SAAA;EAAa,IAAA;EAAc,KAAA;EAAe,MAAA;EAAiB,OAAA;AAAA,IAC1D,OAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProjectGraph } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/graph-builder.d.ts
|
|
4
|
+
interface BuildGraphOptions {
|
|
5
|
+
paths?: string[];
|
|
6
|
+
include?: string[];
|
|
7
|
+
exclude?: string[];
|
|
8
|
+
}
|
|
9
|
+
declare function buildGraph(projectRoot: string, options?: BuildGraphOptions): Promise<ProjectGraph>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { BuildGraphOptions, buildGraph };
|
|
12
|
+
//# sourceMappingURL=graph-builder.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-builder.d.mts","names":[],"sources":["../../src/core/graph-builder.ts"],"mappings":";;;UAUiB,iBAAA;EACf,KAAA;EACA,OAAA;EACA,OAAA;AAAA;AAAA,iBAyJoB,UAAA,CACpB,WAAA,UACA,OAAA,GAAU,iBAAA,GACT,OAAA,CAAQ,YAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EntryMeta, ModelDefinition } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/meta-manager.d.ts
|
|
4
|
+
interface MetaOpts {
|
|
5
|
+
locale?: string;
|
|
6
|
+
entryId?: string;
|
|
7
|
+
slug?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function readMeta(projectRoot: string, model: ModelDefinition, opts: MetaOpts): Promise<EntryMeta | Record<string, EntryMeta> | null>;
|
|
10
|
+
declare function writeMeta(projectRoot: string, model: ModelDefinition, opts: MetaOpts, meta: EntryMeta): Promise<void>;
|
|
11
|
+
declare function deleteMeta(projectRoot: string, model: ModelDefinition, opts: MetaOpts): Promise<void>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { deleteMeta, readMeta, writeMeta };
|
|
14
|
+
//# sourceMappingURL=meta-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-manager.d.mts","names":[],"sources":["../../src/core/meta-manager.ts"],"mappings":";;;UAKU,QAAA;EACR,MAAA;EACA,OAAA;EACA,IAAA;AAAA;AAAA,iBAaoB,QAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,IAAA,EAAM,QAAA,GACL,OAAA,CAAQ,SAAA,GAAY,MAAA,SAAe,SAAA;AAAA,iBAIhB,SAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,IAAA,EAAM,QAAA,EACN,IAAA,EAAM,SAAA,GACL,OAAA;AAAA,iBAYmB,UAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,EACP,IAAA,EAAM,QAAA,GACL,OAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ModelDefinition } from "@contentrain/types";
|
|
3
|
+
|
|
4
|
+
//#region src/core/model-manager.d.ts
|
|
5
|
+
interface ModelSummary {
|
|
6
|
+
id: string;
|
|
7
|
+
kind: ModelDefinition['kind'];
|
|
8
|
+
domain: string;
|
|
9
|
+
i18n: boolean;
|
|
10
|
+
fields: number;
|
|
11
|
+
}
|
|
12
|
+
declare function listModels(projectRoot: string): Promise<ModelSummary[]>;
|
|
13
|
+
declare function readModel(projectRoot: string, modelId: string): Promise<ModelDefinition | null>;
|
|
14
|
+
declare function countEntries(projectRoot: string, model: ModelDefinition): Promise<{
|
|
15
|
+
total: number;
|
|
16
|
+
locales: Record<string, number>;
|
|
17
|
+
}>;
|
|
18
|
+
declare function writeModel(projectRoot: string, model: ModelDefinition): Promise<void>;
|
|
19
|
+
declare function deleteModel(projectRoot: string, modelId: string): Promise<string[]>;
|
|
20
|
+
interface ModelReference {
|
|
21
|
+
model: string;
|
|
22
|
+
field: string;
|
|
23
|
+
type: 'relation' | 'relations';
|
|
24
|
+
}
|
|
25
|
+
declare function checkReferences(projectRoot: string, modelId: string): Promise<ModelReference[]>;
|
|
26
|
+
declare const FIELD_TYPE_ENUM: readonly ["string", "text", "email", "url", "slug", "color", "phone", "code", "icon", "markdown", "richtext", "number", "integer", "decimal", "percent", "rating", "boolean", "date", "datetime", "image", "video", "file", "relation", "relations", "select", "array", "object"];
|
|
27
|
+
/**
|
|
28
|
+
* Shared Zod schema for field definitions.
|
|
29
|
+
* Used by both model_save and normalize extract for full parity.
|
|
30
|
+
*/
|
|
31
|
+
declare const fieldDefZodSchema: z.ZodType<Record<string, unknown>>;
|
|
32
|
+
/**
|
|
33
|
+
* Validate a model definition before writing.
|
|
34
|
+
* Returns array of error messages (empty = valid).
|
|
35
|
+
* Used by both model_save tool and normalize extract.
|
|
36
|
+
*/
|
|
37
|
+
declare function validateModelDefinition(input: {
|
|
38
|
+
id: string;
|
|
39
|
+
kind: string;
|
|
40
|
+
fields?: Record<string, unknown>;
|
|
41
|
+
}): string[];
|
|
42
|
+
//#endregion
|
|
43
|
+
export { FIELD_TYPE_ENUM, ModelReference, ModelSummary, checkReferences, countEntries, deleteModel, fieldDefZodSchema, listModels, readModel, validateModelDefinition, writeModel };
|
|
44
|
+
//# sourceMappingURL=model-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-manager.d.mts","names":[],"sources":["../../src/core/model-manager.ts"],"mappings":";;;;UAOiB,YAAA;EACf,EAAA;EACA,IAAA,EAAM,eAAA;EACN,MAAA;EACA,IAAA;EACA,MAAA;AAAA;AAAA,iBAGoB,UAAA,CAAW,WAAA,WAAsB,OAAA,CAAQ,YAAA;AAAA,iBAqBzC,SAAA,CAAU,WAAA,UAAqB,OAAA,WAAkB,OAAA,CAAQ,eAAA;AAAA,iBA6IzD,YAAA,CACpB,WAAA,UACA,KAAA,EAAO,eAAA,GACN,OAAA;EAAU,KAAA;EAAe,OAAA,EAAS,MAAA;AAAA;AAAA,iBA2Hf,UAAA,CAAW,WAAA,UAAqB,KAAA,EAAO,eAAA,GAAkB,OAAA;AAAA,iBASzD,WAAA,CAAY,WAAA,UAAqB,OAAA,WAAkB,OAAA;AAAA,UA+BxD,cAAA;EACf,KAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,iBAGoB,eAAA,CAAgB,WAAA,UAAqB,OAAA,WAAkB,OAAA,CAAQ,cAAA;AAAA,cA0BxE,eAAA;;AAnVb;;;cAiWa,iBAAA,EAAmB,CAAA,CAAE,OAAA,CAAQ,MAAA;;;;;;iBAiC1B,uBAAA,CAAwB,KAAA;EAAS,EAAA;EAAY,IAAA;EAAc,MAAA,GAAS,MAAA;AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as fieldDefZodSchema, c as validateModelDefinition, i as deleteModel, l as writeModel, n as checkReferences, o as listModels, r as countEntries, s as readModel, t as FIELD_TYPE_ENUM } from "../model-manager-BcWWu5l2.mjs";
|
|
2
|
+
export { FIELD_TYPE_ENUM, checkReferences, countEntries, deleteModel, fieldDefZodSchema, listModels, readModel, validateModelDefinition, writeModel };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/core/scan-config.d.ts
|
|
2
|
+
/** File extensions to scan across all JS/TS ecosystem projects */
|
|
3
|
+
declare const SCAN_EXTENSIONS: Set<string>;
|
|
4
|
+
/** Directory names to always exclude from scanning */
|
|
5
|
+
declare const SCAN_IGNORE_DIRS: Set<string>;
|
|
6
|
+
/** Max files per scan operation */
|
|
7
|
+
declare const MAX_SCAN_FILES = 500;
|
|
8
|
+
/** Classify a file into page/component/layout/other based on path heuristics */
|
|
9
|
+
declare function classifyFile(relPath: string): 'page' | 'component' | 'layout' | 'other';
|
|
10
|
+
/** Auto-detect which source directories exist in the project */
|
|
11
|
+
declare function autoDetectSourceDirs(projectRoot: string): Promise<string[]>;
|
|
12
|
+
interface DiscoverFilesOptions {
|
|
13
|
+
paths?: string[];
|
|
14
|
+
include?: string[];
|
|
15
|
+
exclude?: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Discover source files matching scan criteria.
|
|
19
|
+
* Returns relative paths (relative to projectRoot).
|
|
20
|
+
*/
|
|
21
|
+
declare function discoverFiles(projectRoot: string, options?: DiscoverFilesOptions): Promise<string[]>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { DiscoverFilesOptions, MAX_SCAN_FILES, SCAN_EXTENSIONS, SCAN_IGNORE_DIRS, autoDetectSourceDirs, classifyFile, discoverFiles };
|
|
24
|
+
//# sourceMappingURL=scan-config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-config.d.mts","names":[],"sources":["../../src/core/scan-config.ts"],"mappings":";;cAOa,eAAA,EAAe,GAAA;;cAKf,gBAAA,EAAgB,GAAA;;cAgBhB,cAAA;AAhBb;AAAA,iBA4DgB,YAAA,CAAa,OAAA;;iBAyCP,oBAAA,CAAqB,WAAA,WAAsB,OAAA;AAAA,UAYhD,oBAAA;EACf,KAAA;EACA,OAAA;EACA,OAAA;AAAA;;AAxDF;;;iBA+DsB,aAAA,CACpB,WAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as classifyFile, i as autoDetectSourceDirs, n as SCAN_EXTENSIONS, o as discoverFiles, r as SCAN_IGNORE_DIRS, t as MAX_SCAN_FILES } from "../scan-config-AJGxCdNd.mjs";
|
|
2
|
+
export { MAX_SCAN_FILES, SCAN_EXTENSIONS, SCAN_IGNORE_DIRS, autoDetectSourceDirs, classifyFile, discoverFiles };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ScanCandidatesResult, ScanSummaryResult } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/scanner.d.ts
|
|
4
|
+
interface ScanOptions {
|
|
5
|
+
paths?: string[];
|
|
6
|
+
include?: string[];
|
|
7
|
+
exclude?: string[];
|
|
8
|
+
limit?: number;
|
|
9
|
+
offset?: number;
|
|
10
|
+
min_length?: number;
|
|
11
|
+
max_length?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Determines if a string is non-content (technical) and should be filtered out.
|
|
15
|
+
* Pure function — no side effects, no semantic decisions.
|
|
16
|
+
* Conservative: if in doubt, returns false (keeps the string).
|
|
17
|
+
*
|
|
18
|
+
* @deprecated Kept for backward compatibility. Scanner v2 uses structural pre-filter instead.
|
|
19
|
+
*/
|
|
20
|
+
declare function isNonContent(value: string, lineContext: string, minLength?: number, maxLength?: number): boolean;
|
|
21
|
+
declare function scanCandidates(projectRoot: string, options?: ScanOptions): Promise<ScanCandidatesResult>;
|
|
22
|
+
declare function scanSummary(projectRoot: string, options?: ScanOptions): Promise<ScanSummaryResult>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { ScanOptions, isNonContent, scanCandidates, scanSummary };
|
|
25
|
+
//# sourceMappingURL=scanner.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.mts","names":[],"sources":["../../src/core/scanner.ts"],"mappings":";;;UAkBiB,WAAA;EACf,KAAA;EACA,OAAA;EACA,OAAA;EACA,KAAA;EACA,MAAA;EACA,UAAA;EACA,UAAA;AAAA;;;;;;;AAmEF;iBAAgB,YAAA,CAAa,KAAA,UAAe,WAAA,UAAqB,SAAA,WAAwC,SAAA;AAAA,iBA0GnF,cAAA,CACpB,WAAA,UACA,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,oBAAA;AAAA,iBAmFW,WAAA,CACpB,WAAA,UACA,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,iBAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ValidationError } from "@contentrain/types";
|
|
2
|
+
|
|
3
|
+
//#region src/core/validator.d.ts
|
|
4
|
+
interface ValidateOptions {
|
|
5
|
+
model?: string;
|
|
6
|
+
fix?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ValidateResult {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
summary: {
|
|
11
|
+
errors: number;
|
|
12
|
+
warnings: number;
|
|
13
|
+
notices: number;
|
|
14
|
+
models_checked: number;
|
|
15
|
+
entries_checked: number;
|
|
16
|
+
};
|
|
17
|
+
issues: ValidationError[];
|
|
18
|
+
fixed: number;
|
|
19
|
+
}
|
|
20
|
+
declare function validateProject(projectRoot: string, options?: ValidateOptions): Promise<ValidateResult>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ValidateOptions, ValidateResult, validateProject };
|
|
23
|
+
//# sourceMappingURL=validator.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.d.mts","names":[],"sources":["../../src/core/validator.ts"],"mappings":";;;UAWiB,eAAA;EACf,KAAA;EACA,GAAA;AAAA;AAAA,UAGe,cAAA;EACf,KAAA;EACA,OAAA;IACE,MAAA;IACA,QAAA;IACA,OAAA;IACA,cAAA;IACA,eAAA;EAAA;EAEF,MAAA,EAAQ,eAAA;EACR,KAAA;AAAA;AAAA,iBA48BoB,eAAA,CACpB,WAAA,UACA,OAAA,GAAU,eAAA,GACT,OAAA,CAAQ,cAAA"}
|