@agent-teams/engineering-foundation 0.14.0 → 0.15.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/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.d.ts +31 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.js +47 -0
- package/dist/document-authoring/adapters/node/load-validated-document-authoring-profile.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.d.ts.map +1 -1
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.js +14 -39
- package/dist/document-authoring/adapters/node/node-authoring-profile-reader.js.map +1 -1
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts +7 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js +179 -0
- package/dist/document-authoring/adapters/node/node-document-contract-validator.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts +10 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js +72 -0
- package/dist/document-authoring/adapters/node/node-document-planning-profile-reader.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.d.ts +10 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.js +164 -0
- package/dist/document-authoring/adapters/node/node-document-planning-state-reader.js.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.d.ts +10 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.d.ts.map +1 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.js +32 -0
- package/dist/document-authoring/adapters/node/node-document-template-reader.js.map +1 -0
- package/dist/document-authoring/application/model/document-planning.d.ts +171 -0
- package/dist/document-authoring/application/model/document-planning.d.ts.map +1 -0
- package/dist/document-authoring/application/model/document-planning.js +2 -0
- package/dist/document-authoring/application/model/document-planning.js.map +1 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.d.ts +14 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.js +61 -0
- package/dist/document-authoring/application/policies/document-logical-preimage.js.map +1 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.d.ts +6 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.js +9 -0
- package/dist/document-authoring/application/policies/document-planning-policy-error.js.map +1 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.d.ts +3 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.js +104 -0
- package/dist/document-authoring/application/policies/normalize-document-intent.js.map +1 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.d.ts +13 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.d.ts.map +1 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.js +154 -0
- package/dist/document-authoring/application/policies/resolve-document-authoring.js.map +1 -0
- package/dist/document-authoring/application/ports/document-contract-validator.d.ts +6 -0
- package/dist/document-authoring/application/ports/document-contract-validator.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-contract-validator.js +2 -0
- package/dist/document-authoring/application/ports/document-contract-validator.js.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.d.ts +9 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-planning-profile-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.d.ts +9 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-planning-state-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/document-template-reader.d.ts +9 -0
- package/dist/document-authoring/application/ports/document-template-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/document-template-reader.js +2 -0
- package/dist/document-authoring/application/ports/document-template-reader.js.map +1 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.d.ts +11 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.d.ts.map +1 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.js +2 -0
- package/dist/document-authoring/application/ports/documentation-catalog-reader.js.map +1 -0
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.d.ts +2 -1
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.d.ts.map +1 -1
- package/dist/document-authoring/application/use-cases/build-documentation-catalog.js.map +1 -1
- package/dist/document-authoring/application/use-cases/compile-document-plan.d.ts +6 -0
- package/dist/document-authoring/application/use-cases/compile-document-plan.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/compile-document-plan.js +156 -0
- package/dist/document-authoring/application/use-cases/compile-document-plan.js.map +1 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.d.ts +66 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.d.ts.map +1 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.js +276 -0
- package/dist/document-authoring/application/use-cases/plan-documentation-document.js.map +1 -0
- package/dist/document-authoring/document-planning-error.d.ts +6 -0
- package/dist/document-authoring/document-planning-error.d.ts.map +1 -0
- package/dist/document-authoring/document-planning-error.js +9 -0
- package/dist/document-authoring/document-planning-error.js.map +1 -0
- package/dist/document-authoring/index.d.ts +10 -0
- package/dist/document-authoring/index.d.ts.map +1 -1
- package/dist/document-authoring/index.js +72 -0
- package/dist/document-authoring/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { lstat, readdir, realpath } from "node:fs/promises";
|
|
2
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { assertNotCancelled } from "../../../cancellation.js";
|
|
4
|
+
import { ContainedFileReadError, readContainedRegularFile } from "../../../filesystem-path-safety.js";
|
|
5
|
+
import { documentRepositoryParentPath, isDocumentRepositoryPath } from "../../application/policies/document-repository-path.js";
|
|
6
|
+
import { DocumentPlanningError } from "../../document-planning-error.js";
|
|
7
|
+
const MAX_EXISTING_DESTINATION_BYTES = 1024 * 1024;
|
|
8
|
+
function hasCode(error, code) {
|
|
9
|
+
return error instanceof Error && "code" in error &&
|
|
10
|
+
error.code === code;
|
|
11
|
+
}
|
|
12
|
+
function isMissing(error) {
|
|
13
|
+
return hasCode(error, "ENOENT") || hasCode(error, "ENOTDIR");
|
|
14
|
+
}
|
|
15
|
+
function contained(root, candidate) {
|
|
16
|
+
const relation = relative(root, candidate);
|
|
17
|
+
return relation === "" ||
|
|
18
|
+
(!isAbsolute(relation) && relation !== ".." && !relation.startsWith(`..${sep}`));
|
|
19
|
+
}
|
|
20
|
+
function portableNameIdentity(name) {
|
|
21
|
+
return name.normalize("NFC").replace(/[A-Z]/gu, (character) => character.toLowerCase());
|
|
22
|
+
}
|
|
23
|
+
async function hasPortableNameCollision(parent, requestedName) {
|
|
24
|
+
const requestedIdentity = portableNameIdentity(requestedName);
|
|
25
|
+
const entries = await readdir(parent);
|
|
26
|
+
return entries.some((entry) => entry !== requestedName && portableNameIdentity(entry) === requestedIdentity);
|
|
27
|
+
}
|
|
28
|
+
function parentUnavailable(message, cause) {
|
|
29
|
+
throw new DocumentPlanningError("DOCUMENT_PLANNING_PARENT_UNAVAILABLE", message, cause === undefined ? undefined : { cause });
|
|
30
|
+
}
|
|
31
|
+
function observationUnavailable(message, cause) {
|
|
32
|
+
throw new DocumentPlanningError("DOCUMENT_PLANNING_AUTHORITY_UNAVAILABLE", message, cause === undefined ? undefined : { cause });
|
|
33
|
+
}
|
|
34
|
+
async function observeRegularDestination(input) {
|
|
35
|
+
try {
|
|
36
|
+
const bytes = await readContainedRegularFile({
|
|
37
|
+
candidate: input.candidate,
|
|
38
|
+
maxBytes: MAX_EXISTING_DESTINATION_BYTES,
|
|
39
|
+
root: input.root
|
|
40
|
+
});
|
|
41
|
+
return Object.freeze({
|
|
42
|
+
bytes: new Uint8Array(bytes),
|
|
43
|
+
state: "regular-file"
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof ContainedFileReadError &&
|
|
48
|
+
(error.failure === "invalid" || error.failure === "symlink")) {
|
|
49
|
+
return Object.freeze({ kind: "special-file", state: "conflict" });
|
|
50
|
+
}
|
|
51
|
+
if (error instanceof ContainedFileReadError) {
|
|
52
|
+
observationUnavailable(`Document destination changed or became unavailable: ${input.destination}.`, error);
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function observeRealParent(input) {
|
|
58
|
+
const lexicalRoot = resolve(input.consumerRoot);
|
|
59
|
+
let root;
|
|
60
|
+
try {
|
|
61
|
+
const rootMetadata = await lstat(lexicalRoot);
|
|
62
|
+
if (rootMetadata.isSymbolicLink() || !rootMetadata.isDirectory()) {
|
|
63
|
+
parentUnavailable("Document repository root must be a real directory.");
|
|
64
|
+
}
|
|
65
|
+
root = await realpath(lexicalRoot);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error instanceof DocumentPlanningError) {
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
parentUnavailable("Document repository root is unavailable.", error);
|
|
72
|
+
}
|
|
73
|
+
let current = root;
|
|
74
|
+
const parentSegments = input.destination.split("/").slice(0, -1);
|
|
75
|
+
for (const segment of parentSegments) {
|
|
76
|
+
assertNotCancelled(input.signal);
|
|
77
|
+
try {
|
|
78
|
+
if (await hasPortableNameCollision(current, segment)) {
|
|
79
|
+
parentUnavailable(`Document destination parent has a portable name collision: ${segment}.`);
|
|
80
|
+
}
|
|
81
|
+
const next = join(current, segment);
|
|
82
|
+
const metadata = await lstat(next);
|
|
83
|
+
if (metadata.isSymbolicLink() || !metadata.isDirectory()) {
|
|
84
|
+
parentUnavailable(`Document destination parent ancestry must contain only real directories: ${segment}.`);
|
|
85
|
+
}
|
|
86
|
+
const canonical = await realpath(next);
|
|
87
|
+
if (!contained(root, canonical)) {
|
|
88
|
+
parentUnavailable("Document destination parent escapes the repository.");
|
|
89
|
+
}
|
|
90
|
+
current = canonical;
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (error instanceof DocumentPlanningError) {
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
if (isMissing(error)) {
|
|
97
|
+
parentUnavailable("Document destination parent must already exist.", error);
|
|
98
|
+
}
|
|
99
|
+
parentUnavailable("Document destination parent cannot be observed safely.", error);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return { parent: current, root };
|
|
103
|
+
}
|
|
104
|
+
export class NodeDocumentPlanningStateReader {
|
|
105
|
+
async observe(request) {
|
|
106
|
+
assertNotCancelled(request.signal);
|
|
107
|
+
if (!isDocumentRepositoryPath(request.destination)) {
|
|
108
|
+
throw new DocumentPlanningError("DOCUMENT_PLANNING_INPUT_INVALID", "Document destination must use the portable repository-relative path grammar.");
|
|
109
|
+
}
|
|
110
|
+
const { parent, root } = await observeRealParent(request);
|
|
111
|
+
assertNotCancelled(request.signal);
|
|
112
|
+
const basename = request.destination.split("/").at(-1) ?? "";
|
|
113
|
+
let destination;
|
|
114
|
+
try {
|
|
115
|
+
if (await hasPortableNameCollision(parent, basename)) {
|
|
116
|
+
destination = Object.freeze({
|
|
117
|
+
kind: "portable-name-collision",
|
|
118
|
+
state: "conflict"
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const candidate = join(parent, basename);
|
|
123
|
+
const metadata = await lstat(candidate).catch((error) => {
|
|
124
|
+
if (isMissing(error)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
throw error;
|
|
128
|
+
});
|
|
129
|
+
if (metadata === null) {
|
|
130
|
+
destination = Object.freeze({ state: "absent" });
|
|
131
|
+
}
|
|
132
|
+
else if (metadata.isSymbolicLink() || !metadata.isFile()) {
|
|
133
|
+
destination = Object.freeze({
|
|
134
|
+
kind: metadata.isDirectory() ? "directory" : "special-file",
|
|
135
|
+
state: "conflict"
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
destination = await observeRegularDestination({
|
|
140
|
+
candidate,
|
|
141
|
+
destination: request.destination,
|
|
142
|
+
root
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error instanceof DocumentPlanningError) {
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
observationUnavailable(`Document destination cannot be observed safely: ${request.destination}.`, error);
|
|
152
|
+
}
|
|
153
|
+
assertNotCancelled(request.signal);
|
|
154
|
+
return Object.freeze({
|
|
155
|
+
destination,
|
|
156
|
+
expectedParent: Object.freeze({
|
|
157
|
+
ancestry: "real-directories",
|
|
158
|
+
path: documentRepositoryParentPath(request.destination),
|
|
159
|
+
state: "directory"
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=node-document-planning-state-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-planning-state-reader.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-planning-state-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAA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H,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;gBAC3C,MAAM,KAAK,CAAC;YACd,CAAC;YACD,sBAAsB,CACpB,mDAAmD,OAAO,CAAC,WAAW,GAAG,EACzE,KAAK,CACN,CAAC;QACJ,CAAC;QACD,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC,MAAM,CAAC;YACnB,WAAW;YACX,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC;gBAC5B,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,4BAA4B,CAAC,OAAO,CAAC,WAAW,CAAC;gBACvD,KAAK,EAAE,WAAW;aACnB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DocumentTemplateSnapshot } from "../../application/model/document-planning.js";
|
|
2
|
+
import type { DocumentTemplateReader } from "../../application/ports/document-template-reader.js";
|
|
3
|
+
export declare class NodeDocumentTemplateReader implements DocumentTemplateReader {
|
|
4
|
+
read(request: {
|
|
5
|
+
readonly consumerRoot: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
}): Promise<DocumentTemplateSnapshot>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=node-document-template-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-template-reader.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-template-reader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAOlG,qBAAa,0BAA2B,YAAW,sBAAsB;IACjE,IAAI,CAAC,OAAO,EAAE;QAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA6BpC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { assertNotCancelled } from "../../../cancellation.js";
|
|
2
|
+
import { CapabilityInputError } from "../../../capability-runtime.js";
|
|
3
|
+
import { DocumentCatalogError } from "../../document-catalog-error.js";
|
|
4
|
+
import { DocumentPlanningError } from "../../document-planning-error.js";
|
|
5
|
+
import { readDocumentAuthorityFile } from "./read-document-authority-file.js";
|
|
6
|
+
const MAX_TEMPLATE_BYTES = 256 * 1024;
|
|
7
|
+
export class NodeDocumentTemplateReader {
|
|
8
|
+
async read(request) {
|
|
9
|
+
assertNotCancelled(request.signal);
|
|
10
|
+
try {
|
|
11
|
+
const file = await readDocumentAuthorityFile({
|
|
12
|
+
consumerRoot: request.consumerRoot,
|
|
13
|
+
maxBytes: MAX_TEMPLATE_BYTES,
|
|
14
|
+
path: request.path
|
|
15
|
+
});
|
|
16
|
+
assertNotCancelled(request.signal);
|
|
17
|
+
return Object.freeze({ evidence: file.evidence, source: file.source });
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof CapabilityInputError || error instanceof DocumentPlanningError) {
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
if (error instanceof DocumentCatalogError) {
|
|
24
|
+
throw new DocumentPlanningError(error.code === "DOCUMENT_CATALOG_INPUT_INVALID"
|
|
25
|
+
? "DOCUMENT_PLANNING_INPUT_INVALID"
|
|
26
|
+
: "DOCUMENT_PLANNING_AUTHORITY_UNAVAILABLE", `Document template is unavailable or invalid: ${request.path}.`, { cause: error });
|
|
27
|
+
}
|
|
28
|
+
throw new DocumentPlanningError("DOCUMENT_PLANNING_AUTHORITY_UNAVAILABLE", `Document template is unavailable or invalid: ${request.path}.`, { cause: error });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=node-document-template-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-document-template-reader.js","sourceRoot":"","sources":["../../../../src/document-authoring/adapters/node/node-document-template-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC;AAEtC,MAAM,OAAO,0BAA0B;IACrC,KAAK,CAAC,IAAI,CAAC,OAIV;QACC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAAC;gBAC3C,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC,CAAC;YACH,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACnC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,oBAAoB,IAAI,KAAK,YAAY,qBAAqB,EAAE,CAAC;gBACpF,MAAM,KAAK,CAAC;YACd,CAAC;YACD,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;gBAC1C,MAAM,IAAI,qBAAqB,CAC7B,KAAK,CAAC,IAAI,KAAK,gCAAgC;oBAC7C,CAAC,CAAC,iCAAiC;oBACnC,CAAC,CAAC,yCAAyC,EAC7C,gDAAgD,OAAO,CAAC,IAAI,GAAG,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,qBAAqB,CAC7B,yCAAyC,EACzC,gDAAgD,OAAO,CAAC,IAAI,GAAG,EAC/D,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { DocumentAuthorityDigest, DocumentAuthorityEvidence, DocumentIdentityProjectionEntry, DocumentationCatalogSnapshot } from "./document-catalog.js";
|
|
2
|
+
export type DocumentJsonPrimitive = boolean | null | number | string;
|
|
3
|
+
export interface DocumentJsonObject {
|
|
4
|
+
readonly [key: string]: DocumentJsonValue;
|
|
5
|
+
}
|
|
6
|
+
export type DocumentJsonValue = DocumentJsonPrimitive | readonly DocumentJsonValue[] | DocumentJsonObject;
|
|
7
|
+
export interface DocumentIntent {
|
|
8
|
+
readonly schemaVersion: 1;
|
|
9
|
+
readonly type: string;
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly owner: string;
|
|
13
|
+
readonly summary: string;
|
|
14
|
+
readonly slug?: string;
|
|
15
|
+
readonly destination?: string;
|
|
16
|
+
readonly related?: readonly string[];
|
|
17
|
+
readonly additionalMetadata?: Readonly<Record<string, DocumentJsonValue>>;
|
|
18
|
+
}
|
|
19
|
+
export type DocumentIdentityStrategy = {
|
|
20
|
+
readonly kind: "explicit";
|
|
21
|
+
readonly format: "adr-four-digits" | "open-decision-three-digits";
|
|
22
|
+
} | {
|
|
23
|
+
readonly kind: "explicit";
|
|
24
|
+
readonly format: "qualified";
|
|
25
|
+
readonly grammar: {
|
|
26
|
+
readonly prefixSegments: readonly string[];
|
|
27
|
+
readonly minSuffixSegments: number;
|
|
28
|
+
readonly maxSuffixSegments: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type DocumentPlacementStrategy = {
|
|
32
|
+
readonly kind: "collection";
|
|
33
|
+
readonly directory: string;
|
|
34
|
+
readonly filename: "numeric-id-slug" | "id-slug" | "slug" | "README.md";
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: "qualified-leaf-index";
|
|
37
|
+
readonly root: string;
|
|
38
|
+
readonly requiredBasename: "README.md";
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: "explicit";
|
|
41
|
+
readonly allowedRoots: readonly string[];
|
|
42
|
+
readonly requiredSegmentsInOrder: readonly string[];
|
|
43
|
+
readonly requiredBasename: "README.md";
|
|
44
|
+
readonly minimumSegmentsBeforeRequired: number;
|
|
45
|
+
readonly minimumSegmentsAfterRequired: number;
|
|
46
|
+
};
|
|
47
|
+
export interface DocumentArtifactType {
|
|
48
|
+
readonly type: string;
|
|
49
|
+
readonly initialStatus: string;
|
|
50
|
+
readonly identity: DocumentIdentityStrategy;
|
|
51
|
+
readonly placement: DocumentPlacementStrategy;
|
|
52
|
+
readonly template: {
|
|
53
|
+
readonly kind: "fenced-markdown-body";
|
|
54
|
+
readonly path: string;
|
|
55
|
+
};
|
|
56
|
+
readonly heading: {
|
|
57
|
+
readonly kind: "id-colon-title" | "title";
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export type DocumentCatalogCollection = {
|
|
61
|
+
readonly kind: "frontmatter-readme";
|
|
62
|
+
readonly roots: readonly string[];
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: "markdown-tree";
|
|
65
|
+
readonly root: string;
|
|
66
|
+
};
|
|
67
|
+
export interface DocumentPlanningProfileSnapshot {
|
|
68
|
+
readonly artifactTypes: readonly DocumentArtifactType[];
|
|
69
|
+
readonly collections: readonly DocumentCatalogCollection[];
|
|
70
|
+
readonly evidence: DocumentAuthorityEvidence;
|
|
71
|
+
readonly excludedPrefixes: readonly string[];
|
|
72
|
+
readonly metadataSchemaPath: string;
|
|
73
|
+
readonly ownerCatalog: {
|
|
74
|
+
readonly contract: "foundation.owner-map/v1";
|
|
75
|
+
readonly path: string;
|
|
76
|
+
};
|
|
77
|
+
readonly projectId: string;
|
|
78
|
+
}
|
|
79
|
+
export interface DocumentTemplateSnapshot {
|
|
80
|
+
readonly evidence: DocumentAuthorityEvidence;
|
|
81
|
+
readonly source: string;
|
|
82
|
+
}
|
|
83
|
+
export interface DocumentCompilerIdentity {
|
|
84
|
+
readonly id: "@agent-teams/engineering-foundation";
|
|
85
|
+
readonly version: string;
|
|
86
|
+
readonly buildIdentity: DocumentAuthorityDigest;
|
|
87
|
+
}
|
|
88
|
+
type DocumentDestinationObservation = {
|
|
89
|
+
readonly state: "absent";
|
|
90
|
+
} | {
|
|
91
|
+
readonly state: "regular-file";
|
|
92
|
+
readonly bytes: Uint8Array;
|
|
93
|
+
} | {
|
|
94
|
+
readonly state: "conflict";
|
|
95
|
+
readonly kind: "directory" | "portable-name-collision" | "special-file";
|
|
96
|
+
};
|
|
97
|
+
export interface DocumentPlanningStateSnapshot {
|
|
98
|
+
readonly destination: DocumentDestinationObservation;
|
|
99
|
+
readonly expectedParent: {
|
|
100
|
+
readonly path: string;
|
|
101
|
+
readonly state: "directory";
|
|
102
|
+
readonly ancestry: "real-directories";
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface DocumentPlanDiagnostic {
|
|
106
|
+
readonly ruleId: string;
|
|
107
|
+
readonly severity: "error" | "info" | "warning";
|
|
108
|
+
readonly phase: "authority" | "input" | "planning" | "policy";
|
|
109
|
+
readonly subject: string;
|
|
110
|
+
readonly message: string;
|
|
111
|
+
}
|
|
112
|
+
export interface DocumentPlan {
|
|
113
|
+
readonly schemaVersion: 1;
|
|
114
|
+
readonly protocolVersion: 1;
|
|
115
|
+
readonly compiler: DocumentCompilerIdentity;
|
|
116
|
+
readonly projectId: string;
|
|
117
|
+
readonly intent: DocumentIntent;
|
|
118
|
+
readonly intentDigest: DocumentAuthorityDigest;
|
|
119
|
+
readonly authority: {
|
|
120
|
+
readonly profile: DocumentAuthorityEvidence;
|
|
121
|
+
readonly metadataSchema: DocumentAuthorityEvidence;
|
|
122
|
+
readonly ownerCatalog: DocumentAuthorityEvidence;
|
|
123
|
+
readonly template: DocumentAuthorityEvidence;
|
|
124
|
+
};
|
|
125
|
+
readonly selectedOwner: {
|
|
126
|
+
readonly id: string;
|
|
127
|
+
readonly membershipDigest: DocumentAuthorityDigest;
|
|
128
|
+
};
|
|
129
|
+
readonly identityProjection: {
|
|
130
|
+
readonly entryCount: number;
|
|
131
|
+
readonly digest: DocumentAuthorityDigest;
|
|
132
|
+
};
|
|
133
|
+
readonly referencedDocuments: readonly {
|
|
134
|
+
readonly id: string;
|
|
135
|
+
readonly path: string;
|
|
136
|
+
readonly projectionDigest: DocumentAuthorityDigest;
|
|
137
|
+
}[];
|
|
138
|
+
readonly destination: string;
|
|
139
|
+
readonly expectedParent: {
|
|
140
|
+
readonly path: string;
|
|
141
|
+
readonly state: "directory";
|
|
142
|
+
readonly ancestry: "real-directories";
|
|
143
|
+
};
|
|
144
|
+
readonly destinationPrecondition: {
|
|
145
|
+
readonly state: "absent";
|
|
146
|
+
};
|
|
147
|
+
readonly output: {
|
|
148
|
+
readonly digest: DocumentAuthorityDigest;
|
|
149
|
+
readonly size: number;
|
|
150
|
+
readonly mode: "0644";
|
|
151
|
+
readonly mediaType: "text/markdown; charset=utf-8";
|
|
152
|
+
readonly contentBase64: string;
|
|
153
|
+
};
|
|
154
|
+
readonly requiredAdapterCapabilities: readonly ["create-file-no-replace/v1"];
|
|
155
|
+
readonly diagnostics: readonly DocumentPlanDiagnostic[];
|
|
156
|
+
readonly planDigest: DocumentAuthorityDigest;
|
|
157
|
+
}
|
|
158
|
+
export interface DocumentPlanningCompilationInput {
|
|
159
|
+
readonly catalog: DocumentationCatalogSnapshot;
|
|
160
|
+
readonly compiler: DocumentCompilerIdentity;
|
|
161
|
+
readonly identityProjection: readonly DocumentIdentityProjectionEntry[];
|
|
162
|
+
readonly intent: DocumentIntent;
|
|
163
|
+
readonly metadataSchema: DocumentAuthorityEvidence;
|
|
164
|
+
readonly ownerCatalog: DocumentAuthorityEvidence;
|
|
165
|
+
readonly profile: DocumentPlanningProfileSnapshot;
|
|
166
|
+
readonly state: DocumentPlanningStateSnapshot;
|
|
167
|
+
readonly template: DocumentTemplateSnapshot;
|
|
168
|
+
readonly output: string;
|
|
169
|
+
}
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMappingURL=document-planning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-planning.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/model/document-planning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,yBAAyB,EACzB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AACrE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;CAC3C;AACD,MAAM,MAAM,iBAAiB,GACzB,qBAAqB,GACrB,SAAS,iBAAiB,EAAE,GAC5B,kBAAkB,CAAC;AAEvB,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAA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,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;QACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,EAAE,8BAA8B,CAAC;QACnD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,QAAQ,CAAC,2BAA2B,EAAE,SAAS,CAAC,2BAA2B,CAAC,CAAC;IAC7E,QAAQ,CAAC,WAAW,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACxD,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,+BAA+B,EAAE,CAAC;IACxE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,yBAAyB,CAAC;IACnD,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;IACjD,QAAQ,CAAC,OAAO,EAAE,+BAA+B,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,6BAA6B,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-planning.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/model/document-planning.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DocumentCatalogCollection } from "../model/document-planning.js";
|
|
2
|
+
import type { DocumentIdentityProjectionEntry, DocumentationCatalogSnapshot } from "../model/document-catalog.js";
|
|
3
|
+
export declare function isDestinationCoveredByCatalog(destination: string, collections: readonly DocumentCatalogCollection[], excludedPrefixes: readonly string[]): boolean;
|
|
4
|
+
export declare function classifyDocumentLogicalPreimage(input: {
|
|
5
|
+
readonly catalog: DocumentationCatalogSnapshot;
|
|
6
|
+
readonly destination: string;
|
|
7
|
+
readonly expectedBytes: Uint8Array;
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly observedBytes?: Uint8Array;
|
|
10
|
+
}): {
|
|
11
|
+
readonly identityProjection: readonly DocumentIdentityProjectionEntry[];
|
|
12
|
+
readonly isExactSelf: boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=document-logical-preimage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-logical-preimage.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/document-logical-preimage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,8BAA8B,CAAC;AAOtC,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,SAAS,yBAAyB,EAAE,EACjD,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAClC,OAAO,CAUT;AAqBD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,OAAO,EAAE,4BAA4B,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC;CACrC,GAAG;IACF,QAAQ,CAAC,kBAAkB,EAAE,SAAS,+BAA+B,EAAE,CAAC;IACxE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B,CA8CA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { compareBinaryStrings } from "../../../binary-string-comparator.js";
|
|
2
|
+
import { DocumentPlanningPolicyError } from "./document-planning-policy-error.js";
|
|
3
|
+
function isPrefix(prefix, path) {
|
|
4
|
+
return path === prefix || path.startsWith(`${prefix}/`);
|
|
5
|
+
}
|
|
6
|
+
export function isDestinationCoveredByCatalog(destination, collections, excludedPrefixes) {
|
|
7
|
+
if (excludedPrefixes.some((prefix) => isPrefix(prefix, destination))) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
return collections.some((collection) => collection.kind === "markdown-tree"
|
|
11
|
+
? isPrefix(collection.root, destination)
|
|
12
|
+
: destination.endsWith("/README.md") &&
|
|
13
|
+
collection.roots.some((root) => isPrefix(root, destination)));
|
|
14
|
+
}
|
|
15
|
+
function sameBytes(left, right) {
|
|
16
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
17
|
+
}
|
|
18
|
+
function portablePath(path) {
|
|
19
|
+
return path.normalize("NFC").toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
function sortedProjection(entries) {
|
|
22
|
+
return Object.freeze(entries
|
|
23
|
+
.map((entry) => Object.freeze({ id: entry.id, repositoryPath: entry.repositoryPath }))
|
|
24
|
+
.toSorted((left, right) => compareBinaryStrings(left.id, right.id) ||
|
|
25
|
+
compareBinaryStrings(left.repositoryPath, right.repositoryPath)));
|
|
26
|
+
}
|
|
27
|
+
export function classifyDocumentLogicalPreimage(input) {
|
|
28
|
+
if (input.catalog.status !== "complete") {
|
|
29
|
+
throw new DocumentPlanningPolicyError("catalog-incomplete", "Document planning requires a complete catalog.");
|
|
30
|
+
}
|
|
31
|
+
const entries = input.catalog.identityProjection;
|
|
32
|
+
const ids = new Set();
|
|
33
|
+
const paths = new Set();
|
|
34
|
+
for (const entry of entries) {
|
|
35
|
+
const path = portablePath(entry.repositoryPath);
|
|
36
|
+
if (ids.has(entry.id) || paths.has(path)) {
|
|
37
|
+
throw new DocumentPlanningPolicyError("catalog-collision", "Document catalog contains an identity or portable path collision.");
|
|
38
|
+
}
|
|
39
|
+
ids.add(entry.id);
|
|
40
|
+
paths.add(path);
|
|
41
|
+
}
|
|
42
|
+
const exactDescriptor = input.catalog.documents.filter((document) => document.id === input.id && document.repositoryPath === input.destination);
|
|
43
|
+
const exactEntry = entries.filter((entry) => entry.id === input.id && entry.repositoryPath === input.destination);
|
|
44
|
+
const isExactSelf = input.observedBytes !== undefined &&
|
|
45
|
+
sameBytes(input.observedBytes, input.expectedBytes) &&
|
|
46
|
+
exactDescriptor.length === 1 &&
|
|
47
|
+
exactEntry.length === 1;
|
|
48
|
+
const idCollision = entries.some((entry) => entry.id === input.id && !(isExactSelf && entry.repositoryPath === input.destination));
|
|
49
|
+
const pathCollision = entries.some((entry) => portablePath(entry.repositoryPath) === portablePath(input.destination) &&
|
|
50
|
+
!(isExactSelf && entry.repositoryPath === input.destination && entry.id === input.id));
|
|
51
|
+
if (idCollision || pathCollision || (input.observedBytes !== undefined && !isExactSelf)) {
|
|
52
|
+
throw new DocumentPlanningPolicyError("destination-conflict", "Document identity or destination conflicts with the logical preimage.");
|
|
53
|
+
}
|
|
54
|
+
return Object.freeze({
|
|
55
|
+
identityProjection: sortedProjection(isExactSelf
|
|
56
|
+
? entries.filter((entry) => !(entry.id === input.id && entry.repositoryPath === input.destination))
|
|
57
|
+
: entries),
|
|
58
|
+
isExactSelf
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=document-logical-preimage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-logical-preimage.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/document-logical-preimage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAQ5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,SAAS,QAAQ,CAAC,MAAc,EAAE,IAAY;IAC5C,OAAO,IAAI,KAA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AAE,KAAK,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,WAAW,CAAC,CAAC;YACnG,CAAC,CAAC,OAAO,CACZ;QACD,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type DocumentPlanningPolicyProblem = "catalog-collision" | "catalog-incomplete" | "destination-conflict" | "destination-not-covered" | "duplicate-related" | "invalid-artifact-type" | "invalid-destination" | "invalid-identity" | "invalid-intent-json" | "invalid-slug" | "missing-destination" | "missing-slug";
|
|
2
|
+
export declare class DocumentPlanningPolicyError extends Error {
|
|
3
|
+
readonly problem: DocumentPlanningPolicyProblem;
|
|
4
|
+
constructor(problem: DocumentPlanningPolicyProblem, message: string);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=document-planning-policy-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-planning-policy-error.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/document-planning-policy-error.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,6BAA6B,GACrC,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,GACtB,yBAAyB,GACzB,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,kBAAkB,GAClB,qBAAqB,GACrB,cAAc,GACd,qBAAqB,GACrB,cAAc,CAAC;AAEnB,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;IAEhD,YAAY,OAAO,EAAE,6BAA6B,EAAE,OAAO,EAAE,MAAM,EAIlE;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-planning-policy-error.js","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/document-planning-policy-error.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAC3C,OAAO,CAAgC;IAEhD,YAAY,OAAsC,EAAE,OAAe;QACjE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-document-intent.d.ts","sourceRoot":"","sources":["../../../../src/document-authoring/application/policies/normalize-document-intent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,+BAA+B,CAAC;AA4FvC,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAyB7E"}
|