@beehexa/hexasync-template-validate 2608.15.1 → 2608.20.18
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/package.json +6 -6
- package/dist/index.d.ts +0 -39
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -39
- package/dist/index.js.map +0 -1
- package/dist/validate/agentAnswers.d.ts +0 -48
- package/dist/validate/agentAnswers.d.ts.map +0 -1
- package/dist/validate/agentAnswers.js +0 -84
- package/dist/validate/agentAnswers.js.map +0 -1
- package/dist/validate/agentTools.d.ts +0 -37
- package/dist/validate/agentTools.d.ts.map +0 -1
- package/dist/validate/agentTools.js +0 -141
- package/dist/validate/agentTools.js.map +0 -1
- package/dist/validate/buildValidationModel.d.ts +0 -31
- package/dist/validate/buildValidationModel.d.ts.map +0 -1
- package/dist/validate/buildValidationModel.js +0 -68
- package/dist/validate/buildValidationModel.js.map +0 -1
- package/dist/validate/context.d.ts +0 -108
- package/dist/validate/context.d.ts.map +0 -1
- package/dist/validate/context.js +0 -95
- package/dist/validate/context.js.map +0 -1
- package/dist/validate/contextFromGraph.d.ts +0 -68
- package/dist/validate/contextFromGraph.d.ts.map +0 -1
- package/dist/validate/contextFromGraph.js +0 -81
- package/dist/validate/contextFromGraph.js.map +0 -1
- package/dist/validate/harvestPullerTaskIds.d.ts +0 -60
- package/dist/validate/harvestPullerTaskIds.d.ts.map +0 -1
- package/dist/validate/harvestPullerTaskIds.js +0 -116
- package/dist/validate/harvestPullerTaskIds.js.map +0 -1
- package/dist/validate/model.d.ts +0 -14
- package/dist/validate/model.d.ts.map +0 -1
- package/dist/validate/model.js +0 -97
- package/dist/validate/model.js.map +0 -1
- package/dist/validate/registry.d.ts +0 -24
- package/dist/validate/registry.d.ts.map +0 -1
- package/dist/validate/registry.js +0 -101
- package/dist/validate/registry.js.map +0 -1
- package/dist/validate/retrieve.d.ts +0 -125
- package/dist/validate/retrieve.d.ts.map +0 -1
- package/dist/validate/retrieve.js +0 -272
- package/dist/validate/retrieve.js.map +0 -1
- package/dist/validate/rule.d.ts +0 -18
- package/dist/validate/rule.d.ts.map +0 -1
- package/dist/validate/rule.js +0 -2
- package/dist/validate/rule.js.map +0 -1
- package/dist/validate/ruleCatalog.d.ts +0 -22
- package/dist/validate/ruleCatalog.d.ts.map +0 -1
- package/dist/validate/ruleCatalog.js +0 -473
- package/dist/validate/ruleCatalog.js.map +0 -1
- package/dist/validate/rules/apiShape.d.ts +0 -51
- package/dist/validate/rules/apiShape.d.ts.map +0 -1
- package/dist/validate/rules/apiShape.js +0 -150
- package/dist/validate/rules/apiShape.js.map +0 -1
- package/dist/validate/rules/arguments.d.ts +0 -3
- package/dist/validate/rules/arguments.d.ts.map +0 -1
- package/dist/validate/rules/arguments.js +0 -301
- package/dist/validate/rules/arguments.js.map +0 -1
- package/dist/validate/rules/connectorIdentity.d.ts +0 -3
- package/dist/validate/rules/connectorIdentity.d.ts.map +0 -1
- package/dist/validate/rules/connectorIdentity.js +0 -347
- package/dist/validate/rules/connectorIdentity.js.map +0 -1
- package/dist/validate/rules/context.d.ts +0 -42
- package/dist/validate/rules/context.d.ts.map +0 -1
- package/dist/validate/rules/context.js +0 -92
- package/dist/validate/rules/context.js.map +0 -1
- package/dist/validate/rules/dependencyIntegrity.d.ts +0 -60
- package/dist/validate/rules/dependencyIntegrity.d.ts.map +0 -1
- package/dist/validate/rules/dependencyIntegrity.js +0 -296
- package/dist/validate/rules/dependencyIntegrity.js.map +0 -1
- package/dist/validate/rules/duplicates.d.ts +0 -27
- package/dist/validate/rules/duplicates.d.ts.map +0 -1
- package/dist/validate/rules/duplicates.js +0 -337
- package/dist/validate/rules/duplicates.js.map +0 -1
- package/dist/validate/rules/flow.d.ts +0 -57
- package/dist/validate/rules/flow.d.ts.map +0 -1
- package/dist/validate/rules/flow.js +0 -714
- package/dist/validate/rules/flow.js.map +0 -1
- package/dist/validate/rules/overwriteLoss.d.ts +0 -23
- package/dist/validate/rules/overwriteLoss.d.ts.map +0 -1
- package/dist/validate/rules/overwriteLoss.js +0 -40
- package/dist/validate/rules/overwriteLoss.js.map +0 -1
- package/dist/validate/rules/pullerKind.d.ts +0 -3
- package/dist/validate/rules/pullerKind.d.ts.map +0 -1
- package/dist/validate/rules/pullerKind.js +0 -92
- package/dist/validate/rules/pullerKind.js.map +0 -1
- package/dist/validate/rules/reference.d.ts +0 -44
- package/dist/validate/rules/reference.d.ts.map +0 -1
- package/dist/validate/rules/reference.js +0 -405
- package/dist/validate/rules/reference.js.map +0 -1
- package/dist/validate/rules/referenceKind.d.ts +0 -25
- package/dist/validate/rules/referenceKind.d.ts.map +0 -1
- package/dist/validate/rules/referenceKind.js +0 -235
- package/dist/validate/rules/referenceKind.js.map +0 -1
- package/dist/validate/rules/retiredType.d.ts +0 -149
- package/dist/validate/rules/retiredType.d.ts.map +0 -1
- package/dist/validate/rules/retiredType.js +0 -235
- package/dist/validate/rules/retiredType.js.map +0 -1
- package/dist/validate/rules/stepData.d.ts +0 -122
- package/dist/validate/rules/stepData.d.ts.map +0 -1
- package/dist/validate/rules/stepData.js +0 -249
- package/dist/validate/rules/stepData.js.map +0 -1
- package/dist/validate/rules/stepIterations.d.ts +0 -49
- package/dist/validate/rules/stepIterations.d.ts.map +0 -1
- package/dist/validate/rules/stepIterations.js +0 -156
- package/dist/validate/rules/stepIterations.js.map +0 -1
- package/dist/validate/rules/tables.d.ts +0 -8
- package/dist/validate/rules/tables.d.ts.map +0 -1
- package/dist/validate/rules/tables.js +0 -116
- package/dist/validate/rules/tables.js.map +0 -1
- package/dist/validate/rules/variableDrift.d.ts +0 -63
- package/dist/validate/rules/variableDrift.d.ts.map +0 -1
- package/dist/validate/rules/variableDrift.js +0 -132
- package/dist/validate/rules/variableDrift.js.map +0 -1
- package/dist/validate/rules/variables.d.ts +0 -12
- package/dist/validate/rules/variables.d.ts.map +0 -1
- package/dist/validate/rules/variables.js +0 -207
- package/dist/validate/rules/variables.js.map +0 -1
- package/dist/validate/sourceLocator.d.ts +0 -32
- package/dist/validate/sourceLocator.d.ts.map +0 -1
- package/dist/validate/sourceLocator.js +0 -166
- package/dist/validate/sourceLocator.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beehexa/hexasync-template-validate",
|
|
3
|
-
"version": "2608.
|
|
3
|
+
"version": "2608.20.18",
|
|
4
4
|
"description": "Validation rules over composed projects.",
|
|
5
5
|
"license": "SEE LICENSE IN ../../LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"build": "tsc -p tsconfig.build.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@beehexa/hexasync-template-compose": "2608.
|
|
24
|
-
"@beehexa/hexasync-template-context": "2608.
|
|
25
|
-
"@beehexa/hexasync-template-model": "2608.
|
|
26
|
-
"@beehexa/hexasync-template-ports": "2608.
|
|
27
|
-
"@beehexa/hexasync-template-report-model": "2608.
|
|
23
|
+
"@beehexa/hexasync-template-compose": "2608.20.18",
|
|
24
|
+
"@beehexa/hexasync-template-context": "2608.20.18",
|
|
25
|
+
"@beehexa/hexasync-template-model": "2608.20.18",
|
|
26
|
+
"@beehexa/hexasync-template-ports": "2608.20.18",
|
|
27
|
+
"@beehexa/hexasync-template-report-model": "2608.20.18",
|
|
28
28
|
"yaml": "^2.8.0"
|
|
29
29
|
},
|
|
30
30
|
"hexasync": {
|
package/dist/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Profile-quality validation (AD-4, core).
|
|
3
|
-
*
|
|
4
|
-
* Moved here from `apps/cli/src/commands/compose/validate` in Story 1.2. Nothing in it reads a
|
|
5
|
-
* filesystem: `attachSnippets` is handed the already-prefetched source text, so the same rules
|
|
6
|
-
* run in CI, in the CLI and in an editor with unsaved buffers.
|
|
7
|
-
*
|
|
8
|
-
* The individual rules are exported alongside the registry because each is tested directly —
|
|
9
|
-
* a rule is where the profile semantics actually live, and testing only through `runValidation`
|
|
10
|
-
* would make a broken rule look like a broken registry.
|
|
11
|
-
*/
|
|
12
|
-
export * from './validate/context.js';
|
|
13
|
-
export * from './validate/contextFromGraph.js';
|
|
14
|
-
export * from './validate/rule.js';
|
|
15
|
-
export * from './validate/registry.js';
|
|
16
|
-
export * from './validate/model.js';
|
|
17
|
-
export { buildValidationModel } from './validate/buildValidationModel.js';
|
|
18
|
-
export * from './validate/sourceLocator.js';
|
|
19
|
-
export * from './validate/ruleCatalog.js';
|
|
20
|
-
export * from './validate/harvestPullerTaskIds.js';
|
|
21
|
-
export * from './validate/rules/duplicates.js';
|
|
22
|
-
export * from './validate/rules/flow.js';
|
|
23
|
-
export * from './validate/rules/pullerKind.js';
|
|
24
|
-
export * from './validate/rules/reference.js';
|
|
25
|
-
export * from './validate/rules/referenceKind.js';
|
|
26
|
-
export * from './validate/rules/retiredType.js';
|
|
27
|
-
export * from './validate/agentTools.js';
|
|
28
|
-
export * from './validate/agentAnswers.js';
|
|
29
|
-
export * from './validate/retrieve.js';
|
|
30
|
-
export * from './validate/rules/stepData.js';
|
|
31
|
-
export * from './validate/rules/tables.js';
|
|
32
|
-
export * from './validate/rules/dependencyIntegrity.js';
|
|
33
|
-
export * from './validate/rules/overwriteLoss.js';
|
|
34
|
-
export * from './validate/rules/variableDrift.js';
|
|
35
|
-
export * from './validate/rules/variables.js';
|
|
36
|
-
export * from './validate/rules/context.js';
|
|
37
|
-
export * from './validate/rules/stepIterations.js';
|
|
38
|
-
export * from './validate/rules/apiShape.js';
|
|
39
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Profile-quality validation (AD-4, core).
|
|
3
|
-
*
|
|
4
|
-
* Moved here from `apps/cli/src/commands/compose/validate` in Story 1.2. Nothing in it reads a
|
|
5
|
-
* filesystem: `attachSnippets` is handed the already-prefetched source text, so the same rules
|
|
6
|
-
* run in CI, in the CLI and in an editor with unsaved buffers.
|
|
7
|
-
*
|
|
8
|
-
* The individual rules are exported alongside the registry because each is tested directly —
|
|
9
|
-
* a rule is where the profile semantics actually live, and testing only through `runValidation`
|
|
10
|
-
* would make a broken rule look like a broken registry.
|
|
11
|
-
*/
|
|
12
|
-
export * from './validate/context.js';
|
|
13
|
-
export * from './validate/contextFromGraph.js';
|
|
14
|
-
export * from './validate/rule.js';
|
|
15
|
-
export * from './validate/registry.js';
|
|
16
|
-
export * from './validate/model.js';
|
|
17
|
-
export { buildValidationModel } from './validate/buildValidationModel.js';
|
|
18
|
-
export * from './validate/sourceLocator.js';
|
|
19
|
-
export * from './validate/ruleCatalog.js';
|
|
20
|
-
export * from './validate/harvestPullerTaskIds.js';
|
|
21
|
-
export * from './validate/rules/duplicates.js';
|
|
22
|
-
export * from './validate/rules/flow.js';
|
|
23
|
-
export * from './validate/rules/pullerKind.js';
|
|
24
|
-
export * from './validate/rules/reference.js';
|
|
25
|
-
export * from './validate/rules/referenceKind.js';
|
|
26
|
-
export * from './validate/rules/retiredType.js';
|
|
27
|
-
export * from './validate/agentTools.js';
|
|
28
|
-
export * from './validate/agentAnswers.js';
|
|
29
|
-
export * from './validate/retrieve.js';
|
|
30
|
-
export * from './validate/rules/stepData.js';
|
|
31
|
-
export * from './validate/rules/tables.js';
|
|
32
|
-
export * from './validate/rules/dependencyIntegrity.js';
|
|
33
|
-
export * from './validate/rules/overwriteLoss.js';
|
|
34
|
-
export * from './validate/rules/variableDrift.js';
|
|
35
|
-
export * from './validate/rules/variables.js';
|
|
36
|
-
export * from './validate/rules/context.js';
|
|
37
|
-
export * from './validate/rules/stepIterations.js';
|
|
38
|
-
export * from './validate/rules/apiShape.js';
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type SubjectAnswer } from './retrieve.js';
|
|
2
|
-
/**
|
|
3
|
-
* The shaping every agent surface was doing for itself.
|
|
4
|
-
*
|
|
5
|
-
* ⛔ Story 7.6 AC-4 — *"the adapter computes nothing the shared model does not already compute"* — was recorded
|
|
6
|
-
* PARTIAL by the epic review, and it was right: three computations existed twice, in the MCP server and in the VS Code
|
|
7
|
-
* adapter, and had already drifted. The orientation slice omitted the validate-before-done clause on one surface; the
|
|
8
|
-
* connector listing ignored the `full` argument it advertised on both; the contracts→text mapping was written twice
|
|
9
|
-
* with different wording.
|
|
10
|
-
*
|
|
11
|
-
* Two copies of a computation is two answers to the same question, which is the exact thing this epic exists to stop.
|
|
12
|
-
* Each surface still owns its own FILESYSTEM — the CLI reads with `node:fs`, the extension through
|
|
13
|
-
* `vscode.workspace.fs`, and that difference is real (AD-3, and the browser host has no `fs` at all). What they share
|
|
14
|
-
* is what happens to the text afterwards, which is all of it.
|
|
15
|
-
*/
|
|
16
|
-
/** Appended to orientation on every surface: the one instruction the index itself should not carry. */
|
|
17
|
-
export declare const VALIDATE_BEFORE_DONE: string;
|
|
18
|
-
export declare const NOT_INSTALLED_ANSWER: string;
|
|
19
|
-
/** How much of the installed index may be quoted back. An excerpt that needs more than this is not an excerpt. */
|
|
20
|
-
export declare const ORIENTATION_CEILING = 4000;
|
|
21
|
-
/**
|
|
22
|
-
* The opening of the agent index, plus the clause about validating.
|
|
23
|
-
*
|
|
24
|
-
* ⛔ `undefined` where the heading is missing, rather than the whole file. That branch used to mean *"no
|
|
25
|
-
* `## Collections` heading, so return everything"*, and on the MCP server the result reaches the `instructions` field
|
|
26
|
-
* a client splices into a system prompt — a hostile index turned a 480 KB file into a 400 KB reply carrying its first
|
|
27
|
-
* line as an instruction. The surface is generated and always has the heading, so its absence is a malformed index.
|
|
28
|
-
*/
|
|
29
|
-
export declare function orientationOpening(index: string): string | undefined;
|
|
30
|
-
/** What a step type accepts, as an agent should read it — one entry per installed contract. */
|
|
31
|
-
export declare function typeAnswers(contracts: Record<string, {
|
|
32
|
-
fields?: Record<string, string>;
|
|
33
|
-
note?: string;
|
|
34
|
-
}>): Map<string, string>;
|
|
35
|
-
/**
|
|
36
|
-
* Every supported connector, or one by code.
|
|
37
|
-
*
|
|
38
|
-
* ⚠️ Bounded, and it honours `full` — the listing branch on both surfaces advertised that argument and ignored it,
|
|
39
|
-
* with no ceiling at all: a 4,000-row catalogue produced a 353,886-byte answer.
|
|
40
|
-
*/
|
|
41
|
-
export declare function connectorAnswer(catalog: readonly {
|
|
42
|
-
systemCode?: string;
|
|
43
|
-
name?: string;
|
|
44
|
-
}[], options?: {
|
|
45
|
-
code?: string;
|
|
46
|
-
full?: boolean;
|
|
47
|
-
}): SubjectAnswer;
|
|
48
|
-
//# sourceMappingURL=agentAnswers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agentAnswers.d.ts","sourceRoot":"","sources":["../../src/validate/agentAnswers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAErE;;;;;;;;;;;;;GAaG;AAEH,uGAAuG;AACvG,eAAO,MAAM,oBAAoB,QAI2D,CAAC;AAE7F,eAAO,MAAM,oBAAoB,QAGU,CAAC;AAE5C,kHAAkH;AAClH,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AAEzC;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIpE;AAED,+FAA+F;AAC/F,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC5E,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAC1D,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9C,aAAa,CAsBf"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { explainConnector } from './retrieve.js';
|
|
2
|
-
/**
|
|
3
|
-
* The shaping every agent surface was doing for itself.
|
|
4
|
-
*
|
|
5
|
-
* ⛔ Story 7.6 AC-4 — *"the adapter computes nothing the shared model does not already compute"* — was recorded
|
|
6
|
-
* PARTIAL by the epic review, and it was right: three computations existed twice, in the MCP server and in the VS Code
|
|
7
|
-
* adapter, and had already drifted. The orientation slice omitted the validate-before-done clause on one surface; the
|
|
8
|
-
* connector listing ignored the `full` argument it advertised on both; the contracts→text mapping was written twice
|
|
9
|
-
* with different wording.
|
|
10
|
-
*
|
|
11
|
-
* Two copies of a computation is two answers to the same question, which is the exact thing this epic exists to stop.
|
|
12
|
-
* Each surface still owns its own FILESYSTEM — the CLI reads with `node:fs`, the extension through
|
|
13
|
-
* `vscode.workspace.fs`, and that difference is real (AD-3, and the browser host has no `fs` at all). What they share
|
|
14
|
-
* is what happens to the text afterwards, which is all of it.
|
|
15
|
-
*/
|
|
16
|
-
/** Appended to orientation on every surface: the one instruction the index itself should not carry. */
|
|
17
|
-
export const VALIDATE_BEFORE_DONE = '## Before you say you are done\n\n' +
|
|
18
|
-
'Run `hexasync compose <project>` and read the report. A template that composes is not the same as a template that ' +
|
|
19
|
-
'is correct, and the report names the authored file and line for every finding. Fix, re-validate, and only then ' +
|
|
20
|
-
'report success — an unvalidated claim is the one failure an agent cannot see for itself.';
|
|
21
|
-
export const NOT_INSTALLED_ANSWER = 'The HexaSync knowledge surface is not installed in this workspace. Run **HexaSync: Install IntelliSense** (or ' +
|
|
22
|
-
'`hexasync intellisense install`) first — and do not guess at identifiers meanwhile: an invented id resolves to ' +
|
|
23
|
-
'nothing at run time and fails silently.';
|
|
24
|
-
/** How much of the installed index may be quoted back. An excerpt that needs more than this is not an excerpt. */
|
|
25
|
-
export const ORIENTATION_CEILING = 4_000;
|
|
26
|
-
/**
|
|
27
|
-
* The opening of the agent index, plus the clause about validating.
|
|
28
|
-
*
|
|
29
|
-
* ⛔ `undefined` where the heading is missing, rather than the whole file. That branch used to mean *"no
|
|
30
|
-
* `## Collections` heading, so return everything"*, and on the MCP server the result reaches the `instructions` field
|
|
31
|
-
* a client splices into a system prompt — a hostile index turned a 480 KB file into a 400 KB reply carrying its first
|
|
32
|
-
* line as an instruction. The surface is generated and always has the heading, so its absence is a malformed index.
|
|
33
|
-
*/
|
|
34
|
-
export function orientationOpening(index) {
|
|
35
|
-
const end = index.indexOf('\n## Collections');
|
|
36
|
-
if (end === -1)
|
|
37
|
-
return undefined;
|
|
38
|
-
return `${index.slice(0, end).trim().slice(0, ORIENTATION_CEILING)}\n\n${VALIDATE_BEFORE_DONE}`;
|
|
39
|
-
}
|
|
40
|
-
/** What a step type accepts, as an agent should read it — one entry per installed contract. */
|
|
41
|
-
export function typeAnswers(contracts) {
|
|
42
|
-
return new Map(Object.entries(contracts).map(([type, contract]) => [
|
|
43
|
-
type,
|
|
44
|
-
[
|
|
45
|
-
`A **${type}** step accepts: ${Object.keys(contract.fields ?? {})
|
|
46
|
-
.map((field) => `\`${field}\``)
|
|
47
|
-
.join(', ')}.`,
|
|
48
|
-
...Object.entries(contract.fields ?? {}).map(([field, text]) => `\`${field}\` — ${text}`),
|
|
49
|
-
contract.note ?? '',
|
|
50
|
-
]
|
|
51
|
-
.filter(Boolean)
|
|
52
|
-
.join(' '),
|
|
53
|
-
]));
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Every supported connector, or one by code.
|
|
57
|
-
*
|
|
58
|
-
* ⚠️ Bounded, and it honours `full` — the listing branch on both surfaces advertised that argument and ignored it,
|
|
59
|
-
* with no ceiling at all: a 4,000-row catalogue produced a 353,886-byte answer.
|
|
60
|
-
*/
|
|
61
|
-
export function connectorAnswer(catalog, options = {}) {
|
|
62
|
-
if (options.code !== undefined) {
|
|
63
|
-
return explainConnector(options.code, catalog, {
|
|
64
|
-
full: options.full === true,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
const PAGE = 40;
|
|
68
|
-
const supported = catalog.filter((row) => row.systemCode);
|
|
69
|
-
const shown = options.full === true ? supported : supported.slice(0, PAGE);
|
|
70
|
-
return {
|
|
71
|
-
id: 'connectors',
|
|
72
|
-
found: true,
|
|
73
|
-
title: `${supported.length} connectors`,
|
|
74
|
-
text: shown
|
|
75
|
-
.map((row) => `- \`${row.systemCode}\` — ${row.name ?? ''}`)
|
|
76
|
-
.join('\n'),
|
|
77
|
-
...(shown.length < supported.length
|
|
78
|
-
? {
|
|
79
|
-
more: `Showing ${shown.length} of ${supported.length}. Ask again with \`full: true\` for the rest.`,
|
|
80
|
-
}
|
|
81
|
-
: {}),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=agentAnswers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"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AS,CAAC,MAAM,+CAA+C;aACpG;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The agent tool set — ONE definition, registered by every surface (Story 7.6).
|
|
3
|
-
*
|
|
4
|
-
* ⛔ Story 7.6 AC-1 requires that an editor-hosted agent sees *"the same tool set, by name and behaviour, as the local
|
|
5
|
-
* server offers"*. Two lists cannot satisfy that: they satisfy it on the day they are written and drift afterwards,
|
|
6
|
-
* which is the failure this feature has found four times over. So the names, descriptions and argument shapes live
|
|
7
|
-
* here, and both the MCP server and the extension register FROM this list.
|
|
8
|
-
*
|
|
9
|
-
* ### It carries no implementation
|
|
10
|
-
*
|
|
11
|
-
* Each entry names the retrieval function it stands for. The functions are Story 6.5's, already pure and already
|
|
12
|
-
* shared; a handler here would be a third place answering a question that already has one. AC-4 — *"it computes
|
|
13
|
-
* nothing the shared model does not already compute"* — is then true by construction rather than by review.
|
|
14
|
-
*/
|
|
15
|
-
/** One argument a tool accepts. Deliberately minimal: every surface can express this. */
|
|
16
|
-
export interface AgentToolArg {
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly type: 'string' | 'boolean' | 'string[]';
|
|
19
|
-
readonly required: boolean;
|
|
20
|
-
readonly description: string;
|
|
21
|
-
}
|
|
22
|
-
export interface AgentTool {
|
|
23
|
-
/** The name every surface must use. PS-5 makes this public surface — renaming one is a breaking change. */
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly title: string;
|
|
26
|
-
readonly description: string;
|
|
27
|
-
readonly args: readonly AgentToolArg[];
|
|
28
|
-
/**
|
|
29
|
-
* Which shared function answers it — the contract, not a handler.
|
|
30
|
-
*
|
|
31
|
-
* `orientation` and `validate` are answered by the host (each knows its own filesystem); the rest map to a
|
|
32
|
-
* `retrieve.ts` export by name, so a surface that registers one and calls something else is visibly wrong.
|
|
33
|
-
*/
|
|
34
|
-
readonly answeredBy: 'orientation' | 'explainRule' | 'explainType' | 'explainConnector' | 'searchExamples' | 'validateProject' | 'positionAnswer';
|
|
35
|
-
}
|
|
36
|
-
export declare const AGENT_TOOLS: readonly AgentTool[];
|
|
37
|
-
//# sourceMappingURL=agentTools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agentTools.d.ts","sourceRoot":"","sources":["../../src/validate/agentTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,yFAAyF;AACzF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,2GAA2G;IAC3G,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EACf,aAAa,GACb,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,CAAC;CACtB;AASD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EA8H3C,CAAC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The agent tool set — ONE definition, registered by every surface (Story 7.6).
|
|
3
|
-
*
|
|
4
|
-
* ⛔ Story 7.6 AC-1 requires that an editor-hosted agent sees *"the same tool set, by name and behaviour, as the local
|
|
5
|
-
* server offers"*. Two lists cannot satisfy that: they satisfy it on the day they are written and drift afterwards,
|
|
6
|
-
* which is the failure this feature has found four times over. So the names, descriptions and argument shapes live
|
|
7
|
-
* here, and both the MCP server and the extension register FROM this list.
|
|
8
|
-
*
|
|
9
|
-
* ### It carries no implementation
|
|
10
|
-
*
|
|
11
|
-
* Each entry names the retrieval function it stands for. The functions are Story 6.5's, already pure and already
|
|
12
|
-
* shared; a handler here would be a third place answering a question that already has one. AC-4 — *"it computes
|
|
13
|
-
* nothing the shared model does not already compute"* — is then true by construction rather than by review.
|
|
14
|
-
*/
|
|
15
|
-
const full = {
|
|
16
|
-
name: 'full',
|
|
17
|
-
type: 'boolean',
|
|
18
|
-
required: false,
|
|
19
|
-
description: 'Return the whole entry instead of the bounded answer.',
|
|
20
|
-
};
|
|
21
|
-
export const AGENT_TOOLS = [
|
|
22
|
-
{
|
|
23
|
-
name: 'hexasync_orientation',
|
|
24
|
-
title: 'What a HexaSync template is',
|
|
25
|
-
description: 'Start here. What a template is, the two runtimes that must never be mixed, the rule against inventing an ' +
|
|
26
|
-
'identity, and the requirement to validate before claiming done.',
|
|
27
|
-
args: [],
|
|
28
|
-
answeredBy: 'orientation',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'hexasync_explain_rule',
|
|
32
|
-
title: 'Explain one validation rule',
|
|
33
|
-
description: 'What a rule id means and what it costs you.',
|
|
34
|
-
args: [
|
|
35
|
-
{
|
|
36
|
-
name: 'id',
|
|
37
|
-
type: 'string',
|
|
38
|
-
required: true,
|
|
39
|
-
description: 'A rule id, e.g. STEP-1.',
|
|
40
|
-
},
|
|
41
|
-
full,
|
|
42
|
-
],
|
|
43
|
-
answeredBy: 'explainRule',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'hexasync_explain_type',
|
|
47
|
-
title: 'Describe a step, transformation or validation type',
|
|
48
|
-
description: 'What a type accepts, from the contract installed in this project.',
|
|
49
|
-
args: [
|
|
50
|
-
{
|
|
51
|
-
name: 'name',
|
|
52
|
-
type: 'string',
|
|
53
|
-
required: true,
|
|
54
|
-
description: 'A type name, e.g. SQL.',
|
|
55
|
-
},
|
|
56
|
-
full,
|
|
57
|
-
],
|
|
58
|
-
answeredBy: 'explainType',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'hexasync_list_connectors',
|
|
62
|
-
title: 'Which systems have a connector',
|
|
63
|
-
description: 'One connector by code, or every supported code when none is given. A system with no connector is a request, ' +
|
|
64
|
-
'not a configuration.',
|
|
65
|
-
args: [
|
|
66
|
-
{
|
|
67
|
-
name: 'code',
|
|
68
|
-
type: 'string',
|
|
69
|
-
required: false,
|
|
70
|
-
description: 'A connector code, e.g. shopify-public-app.',
|
|
71
|
-
},
|
|
72
|
-
full,
|
|
73
|
-
],
|
|
74
|
-
answeredBy: 'explainConnector',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'hexasync_search_examples',
|
|
78
|
-
title: 'Find a working example by facet',
|
|
79
|
-
description: 'Search by kind, feature, connector or entity. ⚠️ A connector query may be blind — the answer says so.',
|
|
80
|
-
args: [
|
|
81
|
-
{
|
|
82
|
-
name: 'kind',
|
|
83
|
-
type: 'string',
|
|
84
|
-
required: false,
|
|
85
|
-
description: 'project, component, template or demo.',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'feature',
|
|
89
|
-
type: 'string',
|
|
90
|
-
required: false,
|
|
91
|
-
description: 'pull, push, webhook, metrics, tables, startup.',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'connector',
|
|
95
|
-
type: 'string',
|
|
96
|
-
required: false,
|
|
97
|
-
description: 'A connector code.',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'entity',
|
|
101
|
-
type: 'string',
|
|
102
|
-
required: false,
|
|
103
|
-
description: 'Part of an entity name, e.g. orders.',
|
|
104
|
-
},
|
|
105
|
-
full,
|
|
106
|
-
],
|
|
107
|
-
answeredBy: 'searchExamples',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'hexasync_validate',
|
|
111
|
-
title: 'Validate this project',
|
|
112
|
-
description: 'Runs the same rules the composition report runs, and returns both a readable summary and a machine-readable ' +
|
|
113
|
-
'finding list.',
|
|
114
|
-
args: [
|
|
115
|
-
{
|
|
116
|
-
name: 'changedFiles',
|
|
117
|
-
type: 'string[]',
|
|
118
|
-
required: false,
|
|
119
|
-
description: 'Narrow the findings to the files you just edited.',
|
|
120
|
-
},
|
|
121
|
-
full,
|
|
122
|
-
],
|
|
123
|
-
answeredBy: 'validateProject',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: 'hexasync_explain_position',
|
|
127
|
-
title: 'What is legal at this caret',
|
|
128
|
-
description: 'The five authoring positions carry five different alphabets. Ask which roots a position actually has before ' +
|
|
129
|
-
'writing an expression — `{{ item.sku }}` is right in a pusher step and silently wrong in a transformation.',
|
|
130
|
-
args: [
|
|
131
|
-
{
|
|
132
|
-
name: 'position',
|
|
133
|
-
type: 'string',
|
|
134
|
-
required: true,
|
|
135
|
-
description: 'One of: legacy-puller-step, new-kind-puller-step, pusher-step, transformation-expression, validation-field.',
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
answeredBy: 'positionAnswer',
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
//# sourceMappingURL=agentTools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agentTools.js","sourceRoot":"","sources":["../../src/validate/agentTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgCH,MAAM,IAAI,GAAiB;IACzB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,KAAK;IACf,WAAW,EAAE,uDAAuD;CACrE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C;QACE,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,2GAA2G;YAC3G,iEAAiE;QACnE,IAAI,EAAE,EAAE;QACR,UA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K;gBACf,WAAW,EAAE,mBAAmB;aACjC;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,sCAAsC;aACpD;YACD,IAAI;SACL;QACD,UAAU,EAAE,gBAAgB;KAC7B;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EACT,8GAA8G;YAC9G,eAAe;QACjB,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,mDAAmD;aACjE;YACD,IAAI;SACL;QACD,UAAU,EAAE,iBAAiB;KAC9B;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,8GAA8G;YAC9G,4GAA4G;QAC9G,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,WAAW,EACT,6GAA6G;aAChH;SACF;QACD,UAAU,EAAE,gBAAgB;KAC7B;CACF,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type Tracer } from '@beehexa/hexasync-template-compose';
|
|
2
|
-
import { type LibraryVariables } from './context.js';
|
|
3
|
-
import type { OverwriteRecord } from '@beehexa/hexasync-template-report-model';
|
|
4
|
-
export declare function buildValidationModel(input: {
|
|
5
|
-
projectTitle: string;
|
|
6
|
-
/** Pre-substitution form — rule ids and tracer ids are both token-form. */
|
|
7
|
-
tokenForm: any;
|
|
8
|
-
/** Post-substitution, key-sorted form — what actually ships. */
|
|
9
|
-
output: any;
|
|
10
|
-
variables: Record<string, unknown>;
|
|
11
|
-
raw: boolean;
|
|
12
|
-
projects: {
|
|
13
|
-
project: string;
|
|
14
|
-
generation: number;
|
|
15
|
-
weight: number;
|
|
16
|
-
componentPath: string;
|
|
17
|
-
}[];
|
|
18
|
-
reportDir: string;
|
|
19
|
-
componentPath: string;
|
|
20
|
-
rootMainYml: string;
|
|
21
|
-
tracer: Tracer;
|
|
22
|
-
/** The compose pass's prefetched file text — what snippets are cut from. */
|
|
23
|
-
sources: ReadonlyMap<string, string>;
|
|
24
|
-
/** From the resolver: files whose variables can never substitute (Story 1.9 AC 2). */
|
|
25
|
-
unadmittedVariableFiles?: string[];
|
|
26
|
-
/** Libraries this project borrows files from (Story 1.8). */
|
|
27
|
-
libraryVariables?: readonly LibraryVariables[];
|
|
28
|
-
overwrites?: readonly OverwriteRecord[];
|
|
29
|
-
relative: (from: string, to: string) => string;
|
|
30
|
-
}): import("@beehexa/hexasync-template-report-model").ValidationReportModel;
|
|
31
|
-
//# sourceMappingURL=buildValidationModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildValidationModel.d.ts","sourceRoot":"","sources":["../../src/validate/buildValidationModel.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,MAAM,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAA2B,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAK/E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,SAAS,EAAE,GAAG,CAAC;IACf,gEAAgE;IAChE,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,sFAAsF;IACtF,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAChD,2EAkDA"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Produce the validation report MODEL, and render nothing (Story 1.7 AC 2).
|
|
3
|
-
*
|
|
4
|
-
* A caller that wants to show findings in a Problems panel needs the model and nothing else;
|
|
5
|
-
* making it reachable only by way of a Markdown renderer would force an editor to render a
|
|
6
|
-
* document and parse it back. Rendering lives in `@beehexa/hexasync-template-report-render`, which is
|
|
7
|
-
* an adapter precisely because Markdown and HTML are output formats, not domain facts.
|
|
8
|
-
*
|
|
9
|
-
* Everything here is pure: the source text arrives already prefetched by the compose pass, so
|
|
10
|
-
* this reads nothing.
|
|
11
|
-
*/
|
|
12
|
-
import { parse } from 'yaml';
|
|
13
|
-
import { joinUri } from '@beehexa/hexasync-template-model';
|
|
14
|
-
import { DIRECTIVE_KEYS, } from '@beehexa/hexasync-template-compose';
|
|
15
|
-
import { createValidationContext } from './context.js';
|
|
16
|
-
import { runValidation } from './registry.js';
|
|
17
|
-
import { buildValidationReportModel } from './model.js';
|
|
18
|
-
import { attachSnippets } from './sourceLocator.js';
|
|
19
|
-
export function buildValidationModel(input) {
|
|
20
|
-
const rootMainPath = joinUri(input.componentPath, 'main.yaml');
|
|
21
|
-
// Map components authored INLINE in the root main.yaml back to it. They are the merge base,
|
|
22
|
-
// so the tracer never emits an event for them and their snippets would otherwise be lost.
|
|
23
|
-
// Components living in partials are already covered by tracer events.
|
|
24
|
-
const rootSources = new Map();
|
|
25
|
-
try {
|
|
26
|
-
const rc = parse(input.rootMainYml, { keepSourceTokens: true });
|
|
27
|
-
for (const [key, val] of Object.entries(rc ?? {})) {
|
|
28
|
-
if (DIRECTIVE_KEYS.has(key))
|
|
29
|
-
continue;
|
|
30
|
-
if (Array.isArray(val)) {
|
|
31
|
-
for (const item of val) {
|
|
32
|
-
if (!item || typeof item !== 'object')
|
|
33
|
-
continue;
|
|
34
|
-
const raw = 'id' in item ? item.id : 'key' in item ? item.key : undefined;
|
|
35
|
-
if (raw == null)
|
|
36
|
-
continue;
|
|
37
|
-
rootSources.set(JSON.stringify([key, String(raw)]), rootMainPath);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else if (val && typeof val === 'object') {
|
|
41
|
-
// Map collections are keyed by their own map key rather than an id field.
|
|
42
|
-
for (const mk of Object.keys(val))
|
|
43
|
-
rootSources.set(JSON.stringify([key, mk]), rootMainPath);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// Best-effort seeding; its absence only costs inline-main snippets, never a finding.
|
|
49
|
-
}
|
|
50
|
-
const ctx = createValidationContext({
|
|
51
|
-
projectTitle: input.projectTitle,
|
|
52
|
-
tokenForm: input.tokenForm,
|
|
53
|
-
outputForm: input.output,
|
|
54
|
-
variables: input.variables,
|
|
55
|
-
raw: input.raw,
|
|
56
|
-
projects: input.projects,
|
|
57
|
-
reportDir: input.reportDir,
|
|
58
|
-
rootMainPath,
|
|
59
|
-
tracer: input.tracer,
|
|
60
|
-
relative: input.relative,
|
|
61
|
-
extraSources: rootSources,
|
|
62
|
-
unadmittedVariableFiles: input.unadmittedVariableFiles,
|
|
63
|
-
libraryVariables: input.libraryVariables,
|
|
64
|
-
overwrites: input.overwrites,
|
|
65
|
-
});
|
|
66
|
-
return buildValidationReportModel(attachSnippets(runValidation(ctx), ctx, input.sources), ctx);
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=buildValidationModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildValidationModel.js","sourceRoot":"","sources":["../../src/validate/buildValidationModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EACL,cAAc,GAEf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAyB,MAAM,cAAc,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,UAAU,oBAAoB,CAAC,KA0BpC;IACC,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAE/D,4FAA4F;IAC5F,0FAA0F;IAC1F,sEAAsE;IACtE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAQ,CAAC;QACvE,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YAClD,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,SAAS;YACtC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;oBACvB,I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