@agent-teams/docs-protocol 0.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/CHANGELOG.md +7 -0
- package/LICENSE +201 -0
- package/README.md +92 -0
- package/dist/adapters/adoption-input.d.ts +9 -0
- package/dist/adapters/adoption-input.d.ts.map +1 -0
- package/dist/adapters/adoption-input.js +72 -0
- package/dist/adapters/adoption-input.js.map +1 -0
- package/dist/adapters/adoption-package-identity.d.ts +7 -0
- package/dist/adapters/adoption-package-identity.d.ts.map +1 -0
- package/dist/adapters/adoption-package-identity.js +69 -0
- package/dist/adapters/adoption-package-identity.js.map +1 -0
- package/dist/adapters/docs-command-envelope-schema-validator.d.ts +2 -0
- package/dist/adapters/docs-command-envelope-schema-validator.d.ts.map +1 -0
- package/dist/adapters/docs-command-envelope-schema-validator.js +24 -0
- package/dist/adapters/docs-command-envelope-schema-validator.js.map +1 -0
- package/dist/adapters/docs-profile-schema-validator.d.ts +2 -0
- package/dist/adapters/docs-profile-schema-validator.d.ts.map +1 -0
- package/dist/adapters/docs-profile-schema-validator.js +28 -0
- package/dist/adapters/docs-profile-schema-validator.js.map +1 -0
- package/dist/adapters/foundation-docs-port.d.ts +12 -0
- package/dist/adapters/foundation-docs-port.d.ts.map +1 -0
- package/dist/adapters/foundation-docs-port.js +108 -0
- package/dist/adapters/foundation-docs-port.js.map +1 -0
- package/dist/adapters/node-adoption-inspector.d.ts +5 -0
- package/dist/adapters/node-adoption-inspector.d.ts.map +1 -0
- package/dist/adapters/node-adoption-inspector.js +102 -0
- package/dist/adapters/node-adoption-inspector.js.map +1 -0
- package/dist/adapters/node-code-anchor-matcher.d.ts +5 -0
- package/dist/adapters/node-code-anchor-matcher.d.ts.map +1 -0
- package/dist/adapters/node-code-anchor-matcher.js +65 -0
- package/dist/adapters/node-code-anchor-matcher.js.map +1 -0
- package/dist/adapters/node-profile-reader.d.ts +9 -0
- package/dist/adapters/node-profile-reader.d.ts.map +1 -0
- package/dist/adapters/node-profile-reader.js +118 -0
- package/dist/adapters/node-profile-reader.js.map +1 -0
- package/dist/application/authority-handshake.d.ts +14 -0
- package/dist/application/authority-handshake.d.ts.map +1 -0
- package/dist/application/authority-handshake.js +15 -0
- package/dist/application/authority-handshake.js.map +1 -0
- package/dist/application/docs-new-completion.d.ts +33 -0
- package/dist/application/docs-new-completion.d.ts.map +1 -0
- package/dist/application/docs-new-completion.js +226 -0
- package/dist/application/docs-new-completion.js.map +1 -0
- package/dist/application/docs-protocol.d.ts +168 -0
- package/dist/application/docs-protocol.d.ts.map +1 -0
- package/dist/application/docs-protocol.js +450 -0
- package/dist/application/docs-protocol.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -0
- package/dist/composition/cli.d.ts +4 -0
- package/dist/composition/cli.d.ts.map +1 -0
- package/dist/composition/cli.js +436 -0
- package/dist/composition/cli.js.map +1 -0
- package/dist/composition/node-docs-api.d.ts +148 -0
- package/dist/composition/node-docs-api.d.ts.map +1 -0
- package/dist/composition/node-docs-api.js +38 -0
- package/dist/composition/node-docs-api.js.map +1 -0
- package/dist/domain/document-semantics.d.ts +7 -0
- package/dist/domain/document-semantics.d.ts.map +1 -0
- package/dist/domain/document-semantics.js +146 -0
- package/dist/domain/document-semantics.js.map +1 -0
- package/dist/domain/model.d.ts +285 -0
- package/dist/domain/model.d.ts.map +1 -0
- package/dist/domain/model.js +3 -0
- package/dist/domain/model.js.map +1 -0
- package/dist/domain/profile-policy.d.ts +7 -0
- package/dist/domain/profile-policy.d.ts.map +1 -0
- package/dist/domain/profile-policy.js +109 -0
- package/dist/domain/profile-policy.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/qualification/index.d.ts +23 -0
- package/dist/qualification/index.d.ts.map +1 -0
- package/dist/qualification/index.js +462 -0
- package/dist/qualification/index.js.map +1 -0
- package/package.json +64 -0
- package/schemas/docs-protocol/v1.schema.json +12 -0
- package/schemas/docs-protocol-command-envelope/v1.schema.json +239 -0
- package/schemas/docs-protocol-profile/v1.schema.json +46 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { normalizeCodeAnchors, normalizeDocumentIds } from "../domain/document-semantics.js";
|
|
2
|
+
import { DocsProfileError } from "../domain/profile-policy.js";
|
|
3
|
+
import { catalogMatchesExpectedPostimage } from "./authority-handshake.js";
|
|
4
|
+
const BINARY = (left, right) => Buffer.compare(Buffer.from(left), Buffer.from(right));
|
|
5
|
+
const BLOCKER_STATUSES = new Set(["deferred", "open"]);
|
|
6
|
+
const MAX_DIAGNOSTICS = 256;
|
|
7
|
+
const MAX_CORPUS_ANCHOR_PATTERNS = 1_024;
|
|
8
|
+
const MAX_CORPUS_ANCHOR_OCCURRENCES = 4_096;
|
|
9
|
+
export function boundedDiagnostics(diagnostics) {
|
|
10
|
+
if (diagnostics.length <= MAX_DIAGNOSTICS) {
|
|
11
|
+
return Object.freeze([...diagnostics]);
|
|
12
|
+
}
|
|
13
|
+
return Object.freeze([
|
|
14
|
+
...diagnostics.slice(0, MAX_DIAGNOSTICS - 1),
|
|
15
|
+
{
|
|
16
|
+
ruleId: "docs.diagnostics.overflow",
|
|
17
|
+
severity: "error",
|
|
18
|
+
phase: "authority",
|
|
19
|
+
subject: "docs.diagnostics",
|
|
20
|
+
message: `Diagnostics exceeded the deterministic ${MAX_DIAGNOSTICS}-item output budget; additional findings were omitted.`
|
|
21
|
+
}
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
export function inspectRecapturedAnchors(anchors, matchedPatterns) {
|
|
25
|
+
const matched = new Set(matchedPatterns);
|
|
26
|
+
const missing = anchors.filter(({ pattern }) => !matched.has(pattern));
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
diagnostics: Object.freeze(missing.map(({ enforcement, pattern }) => ({
|
|
29
|
+
ruleId: enforcement === "required" ? "docs.code-anchor.required-stale" : "docs.code-anchor.advisory-unmatched",
|
|
30
|
+
severity: enforcement === "required" ? "error" : "warning",
|
|
31
|
+
phase: "authority",
|
|
32
|
+
subject: pattern,
|
|
33
|
+
message: enforcement === "required"
|
|
34
|
+
? `Required code anchor ${pattern} no longer matches a current regular file.`
|
|
35
|
+
: `Advisory code anchor ${pattern} does not match a current regular file.`
|
|
36
|
+
}))),
|
|
37
|
+
requiredMissing: missing.some(({ enforcement }) => enforcement === "required")
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export function mergeDiagnostics(...groups) {
|
|
41
|
+
const seen = new Set();
|
|
42
|
+
const merged = [];
|
|
43
|
+
for (const diagnostic of groups.flat()) {
|
|
44
|
+
const identity = `${diagnostic.ruleId}\0${diagnostic.severity}\0${diagnostic.phase}\0${diagnostic.subject}\0${diagnostic.message}`;
|
|
45
|
+
if (!seen.has(identity)) {
|
|
46
|
+
seen.add(identity);
|
|
47
|
+
merged.push(diagnostic);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return Object.freeze(merged);
|
|
51
|
+
}
|
|
52
|
+
function metadataStrings(value, subject) {
|
|
53
|
+
if (value === undefined) {
|
|
54
|
+
return Object.freeze([]);
|
|
55
|
+
}
|
|
56
|
+
if (!Array.isArray(value) || !value.every((entry) => typeof entry === "string")) {
|
|
57
|
+
throw new DocsProfileError(`${subject} must be an array of document IDs.`);
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
function semanticDiagnostic(subject, message) {
|
|
62
|
+
return { ruleId: "docs.metadata.common-semantics", severity: "error", phase: "authority", subject, message };
|
|
63
|
+
}
|
|
64
|
+
function inspectDocumentSemantics(document, byId) {
|
|
65
|
+
const related = normalizeDocumentIds(metadataStrings(document.metadata["related"], `${document.id}.related`), `${document.id}.related`);
|
|
66
|
+
const blockedBy = normalizeDocumentIds(metadataStrings(document.metadata["blocked_by"], `${document.id}.blocked_by`), `${document.id}.blocked_by`);
|
|
67
|
+
if (related.includes(document.id) || blockedBy.includes(document.id)) {
|
|
68
|
+
throw new DocsProfileError("A document cannot reference itself.");
|
|
69
|
+
}
|
|
70
|
+
for (const id of related) {
|
|
71
|
+
if (!byId.has(id)) {
|
|
72
|
+
throw new DocsProfileError(`Related document ${id} does not exist.`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (const id of blockedBy) {
|
|
76
|
+
if (!related.includes(id)) {
|
|
77
|
+
throw new DocsProfileError(`Blocker ${id} must also appear in related.`);
|
|
78
|
+
}
|
|
79
|
+
const blocker = byId.get(id);
|
|
80
|
+
if (blocker === undefined || blocker.type !== "open-decision" || !BLOCKER_STATUSES.has(blocker.status)) {
|
|
81
|
+
throw new DocsProfileError(`Blocker ${id} must be an open-decision with open or deferred status.`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if ((document.status === "accepted" || document.status === "active") && blockedBy.length > 0) {
|
|
85
|
+
throw new DocsProfileError(`Document status ${document.status} cannot retain blockers.`);
|
|
86
|
+
}
|
|
87
|
+
const anchorsValue = document.metadata["code_anchors"];
|
|
88
|
+
return anchorsValue === undefined
|
|
89
|
+
? []
|
|
90
|
+
: Array.isArray(anchorsValue)
|
|
91
|
+
? normalizeCodeAnchors(anchorsValue)
|
|
92
|
+
: (() => { throw new DocsProfileError("code_anchors must be an array."); })();
|
|
93
|
+
}
|
|
94
|
+
export async function inspectCorpusSemantics(input) {
|
|
95
|
+
const diagnostics = [];
|
|
96
|
+
let diagnosticsOverflowed = false;
|
|
97
|
+
const pushDiagnostic = (diagnostic) => {
|
|
98
|
+
if (diagnostics.length < MAX_DIAGNOSTICS - 1) {
|
|
99
|
+
diagnostics.push(diagnostic);
|
|
100
|
+
}
|
|
101
|
+
else if (!diagnosticsOverflowed) {
|
|
102
|
+
diagnosticsOverflowed = true;
|
|
103
|
+
diagnostics.push({ ruleId: "docs.diagnostics.overflow", severity: "error", phase: "authority", subject: "docs.check", message: `Diagnostics exceeded the deterministic ${MAX_DIAGNOSTICS}-item output budget; additional findings were omitted.` });
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const byId = new Map(input.catalog.documents.map((document) => [document.id, document]));
|
|
107
|
+
const anchorOwners = new Map();
|
|
108
|
+
let anchorOccurrences = 0;
|
|
109
|
+
let anchorBudgetExceeded = false;
|
|
110
|
+
for (const document of input.catalog.documents) {
|
|
111
|
+
try {
|
|
112
|
+
const anchors = inspectDocumentSemantics(document, byId);
|
|
113
|
+
for (const { enforcement, pattern } of anchors) {
|
|
114
|
+
if (anchorOccurrences >= MAX_CORPUS_ANCHOR_OCCURRENCES || (!anchorOwners.has(pattern) && anchorOwners.size >= MAX_CORPUS_ANCHOR_PATTERNS)) {
|
|
115
|
+
anchorBudgetExceeded = true;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
anchorOccurrences += 1;
|
|
119
|
+
const owners = anchorOwners.get(pattern) ?? [];
|
|
120
|
+
owners.push({ enforcement, id: document.id });
|
|
121
|
+
anchorOwners.set(pattern, owners);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
pushDiagnostic(semanticDiagnostic(document.repositoryPath, error instanceof Error ? error.message : "Common metadata semantics are invalid."));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (anchorBudgetExceeded) {
|
|
129
|
+
pushDiagnostic({ ruleId: "docs.code-anchor.corpus-budget-exceeded", severity: "error", phase: "authority", subject: "code_anchors", message: `Code anchors exceed the global corpus budget of ${MAX_CORPUS_ANCHOR_PATTERNS} unique patterns or ${MAX_CORPUS_ANCHOR_OCCURRENCES} occurrences.` });
|
|
130
|
+
}
|
|
131
|
+
const patterns = [...anchorOwners.keys()].toSorted(BINARY);
|
|
132
|
+
const matched = await input.anchors.matchedPatterns({ consumerRoot: input.consumerRoot, patterns, ...(input.signal === undefined ? {} : { signal: input.signal }) });
|
|
133
|
+
for (const pattern of patterns) {
|
|
134
|
+
if (!matched.includes(pattern)) {
|
|
135
|
+
for (const { enforcement, id } of anchorOwners.get(pattern) ?? []) {
|
|
136
|
+
pushDiagnostic({ ...semanticDiagnostic(id, `Code anchor ${pattern} does not match a current regular file.`), ruleId: enforcement === "required" ? "docs.code-anchor.required-unmatched" : "docs.code-anchor.advisory-unmatched", severity: enforcement === "required" ? "error" : "warning" });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return Object.freeze(diagnostics);
|
|
141
|
+
}
|
|
142
|
+
export async function completeDocsNewApply(input) {
|
|
143
|
+
if (input.receipt.outcome !== "applied" && input.receipt.outcome !== "already-applied") {
|
|
144
|
+
return { diagnostics: input.diagnostics, outcome: input.outcome };
|
|
145
|
+
}
|
|
146
|
+
let matchedAfterPublication;
|
|
147
|
+
try {
|
|
148
|
+
matchedAfterPublication = await input.anchors.matchedPatterns({
|
|
149
|
+
consumerRoot: input.consumerRoot,
|
|
150
|
+
patterns: input.codeAnchors.map(({ pattern }) => pattern),
|
|
151
|
+
...(input.signal === undefined ? {} : { signal: input.signal })
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
return {
|
|
156
|
+
diagnostics: [...input.diagnostics, {
|
|
157
|
+
ruleId: "docs.code-anchor.post-publication-inspection-failed",
|
|
158
|
+
severity: "error",
|
|
159
|
+
phase: "authority",
|
|
160
|
+
subject: input.plan.destination,
|
|
161
|
+
message: `Published document code-anchor authority could not be verified; manual reconciliation is required: ${error instanceof Error ? error.message : "unknown inspection failure"}`
|
|
162
|
+
}],
|
|
163
|
+
outcome: "recovery-required",
|
|
164
|
+
writeState: "published-recovery-required"
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const matched = new Set(matchedAfterPublication);
|
|
168
|
+
const missing = input.codeAnchors.filter(({ pattern }) => !matched.has(pattern));
|
|
169
|
+
const diagnostics = [...input.diagnostics];
|
|
170
|
+
for (const { enforcement, pattern } of missing) {
|
|
171
|
+
const diagnostic = {
|
|
172
|
+
ruleId: enforcement === "required" ? "docs.code-anchor.required-stale-after-publication" : "docs.code-anchor.advisory-unmatched",
|
|
173
|
+
severity: enforcement === "required" ? "error" : "warning",
|
|
174
|
+
phase: "authority",
|
|
175
|
+
subject: pattern,
|
|
176
|
+
message: enforcement === "required"
|
|
177
|
+
? `Required code anchor ${pattern} no longer matches after publication; the published document requires manual reconciliation.`
|
|
178
|
+
: `Advisory code anchor ${pattern} does not match a current regular file.`
|
|
179
|
+
};
|
|
180
|
+
if (!diagnostics.some((entry) => entry.ruleId === diagnostic.ruleId && entry.subject === diagnostic.subject && entry.message === diagnostic.message)) {
|
|
181
|
+
diagnostics.push(diagnostic);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (missing.some(({ enforcement }) => enforcement === "required")) {
|
|
185
|
+
return {
|
|
186
|
+
diagnostics,
|
|
187
|
+
outcome: "recovery-required",
|
|
188
|
+
writeState: "published-recovery-required"
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
let catalog;
|
|
192
|
+
try {
|
|
193
|
+
catalog = await input.foundation.buildCatalog({
|
|
194
|
+
consumerRoot: input.consumerRoot,
|
|
195
|
+
profilePath: input.profilePath,
|
|
196
|
+
...(input.signal === undefined ? {} : { signal: input.signal })
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
return {
|
|
201
|
+
diagnostics: [...diagnostics, {
|
|
202
|
+
ruleId: "docs.new.catalog-postimage-unavailable",
|
|
203
|
+
severity: "error",
|
|
204
|
+
phase: "apply",
|
|
205
|
+
subject: input.plan.destination,
|
|
206
|
+
message: `Published document catalog postimage could not be verified; manual reconciliation is required: ${error instanceof Error ? error.message : "unknown catalog failure"}`
|
|
207
|
+
}],
|
|
208
|
+
outcome: "recovery-required",
|
|
209
|
+
writeState: "published-recovery-required"
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (!catalogMatchesExpectedPostimage(input.plan, catalog)) {
|
|
213
|
+
return {
|
|
214
|
+
diagnostics: [...diagnostics, {
|
|
215
|
+
ruleId: "docs.new.catalog-postimage-mismatch",
|
|
216
|
+
severity: "error",
|
|
217
|
+
phase: "apply",
|
|
218
|
+
subject: input.plan.destination,
|
|
219
|
+
message: "Published document catalog does not match the Plan expected postimage; no reachability action was issued."
|
|
220
|
+
}],
|
|
221
|
+
outcome: "execution-failure"
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return { diagnostics, outcome: "success", reachability: input.reachability };
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=docs-new-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-new-completion.js","sourceRoot":"","sources":["../../src/application/docs-new-completion.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAE3E,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9G,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AACvD,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,0BAA0B,GAAG,KAAK,CAAC;AACzC,MAAM,6BAA6B,GAAG,KAAK,CAAC;AAE5C,MAAM,UAAU,kBAAkB,CAAC,WAAsC;IACvE,IAAI,WAAW,CAAC,MAAM,IAAI,eAAe,EAAE,CAAC;QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;IA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OL_ID, DOCS_PROTOCOL_VERSION, type DocsExecution, type DocsFindQuery, type DocsNewResult, type DocsNewRequest, type DocsProfileReader, type CodeAnchorMatcher, type DocsAdoptionInspector, type FoundationDocsPort } from "../domain/model.js";
|
|
2
|
+
export declare class DocsProtocol {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(input: {
|
|
5
|
+
readonly adoption: DocsAdoptionInspector;
|
|
6
|
+
readonly anchors: CodeAnchorMatcher;
|
|
7
|
+
readonly foundation: FoundationDocsPort;
|
|
8
|
+
readonly profiles: DocsProfileReader;
|
|
9
|
+
});
|
|
10
|
+
info(input: {
|
|
11
|
+
readonly consumerRoot: string;
|
|
12
|
+
readonly profilePath: string;
|
|
13
|
+
readonly signal?: AbortSignal;
|
|
14
|
+
}): Promise<DocsExecution<Readonly<{
|
|
15
|
+
kind: "info";
|
|
16
|
+
projectId: string;
|
|
17
|
+
protocol: {
|
|
18
|
+
readonly id: typeof DOCS_PROTOCOL_ID;
|
|
19
|
+
readonly version: typeof DOCS_PROTOCOL_VERSION;
|
|
20
|
+
};
|
|
21
|
+
foundationProfile: {
|
|
22
|
+
readonly metadataSidecarPolicy: "foundation-profile-v2-strict-merge";
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly schemaVersion: 2;
|
|
25
|
+
};
|
|
26
|
+
agentWorkflow: {
|
|
27
|
+
readonly skillPath: string;
|
|
28
|
+
};
|
|
29
|
+
metadataSchemaPath: string;
|
|
30
|
+
metadataSidecar: {
|
|
31
|
+
readonly kind: "none";
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: "path-metadata-map";
|
|
34
|
+
readonly path: string;
|
|
35
|
+
};
|
|
36
|
+
ownerIds: readonly string[];
|
|
37
|
+
types: readonly import("../domain/model.js").DocsTypeProfile[];
|
|
38
|
+
semanticValidatorIds: readonly string[];
|
|
39
|
+
}>>>;
|
|
40
|
+
find(input: {
|
|
41
|
+
readonly consumerRoot: string;
|
|
42
|
+
readonly profilePath: string;
|
|
43
|
+
readonly query: DocsFindQuery;
|
|
44
|
+
readonly signal?: AbortSignal;
|
|
45
|
+
}): Promise<DocsExecution<Readonly<{
|
|
46
|
+
kind: "find";
|
|
47
|
+
matches: number;
|
|
48
|
+
documents: readonly import("../domain/model.js").DocsFindDocument[];
|
|
49
|
+
}>>>;
|
|
50
|
+
newDocument(request: DocsNewRequest): Promise<DocsExecution<DocsNewResult>>;
|
|
51
|
+
doctor(input: {
|
|
52
|
+
readonly consumerRoot: string;
|
|
53
|
+
readonly profilePath: string;
|
|
54
|
+
readonly signal?: AbortSignal;
|
|
55
|
+
}): Promise<DocsExecution<Readonly<{
|
|
56
|
+
kind: "doctor";
|
|
57
|
+
protocol: Readonly<{
|
|
58
|
+
id: "agent-teams.docs-protocol";
|
|
59
|
+
version: 1;
|
|
60
|
+
}>;
|
|
61
|
+
projectId?: string;
|
|
62
|
+
environment: {
|
|
63
|
+
readonly installedFoundationVersion: string;
|
|
64
|
+
readonly installedFoundationBuildIdentity: string;
|
|
65
|
+
readonly filesystem: {
|
|
66
|
+
readonly basis: "platform-contract";
|
|
67
|
+
readonly strictDirectoryDurability: "platform-supported" | "platform-unsupported";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
transaction: Readonly<{
|
|
71
|
+
state: "idle";
|
|
72
|
+
}> | Readonly<{
|
|
73
|
+
state: "recoverable";
|
|
74
|
+
transactionKind: "document";
|
|
75
|
+
recovery: Readonly<{
|
|
76
|
+
commandId: "docs.recover";
|
|
77
|
+
args: Readonly<{
|
|
78
|
+
exactFoundationBuildIdentity: string;
|
|
79
|
+
exactFoundationVersion: string;
|
|
80
|
+
}>;
|
|
81
|
+
}>;
|
|
82
|
+
}> | Readonly<{
|
|
83
|
+
state: "manual-recovery-required";
|
|
84
|
+
transactionKind?: "corrupt" | "document" | "local-mode" | "scaffold" | "transition-residue" | "unknown" | "version-mismatch";
|
|
85
|
+
reason: string;
|
|
86
|
+
recovery?: {
|
|
87
|
+
readonly commandId: "detach" | "docs-recover" | "scaffold-recover";
|
|
88
|
+
readonly args: Readonly<Record<string, string>>;
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
91
|
+
}>>>;
|
|
92
|
+
recover(input: {
|
|
93
|
+
readonly consumerRoot: string;
|
|
94
|
+
readonly profilePath: string;
|
|
95
|
+
readonly signal?: AbortSignal;
|
|
96
|
+
}): Promise<DocsExecution<Readonly<{
|
|
97
|
+
kind: "recover";
|
|
98
|
+
transactionState: "no-pending-transaction";
|
|
99
|
+
writeState: "unchanged";
|
|
100
|
+
}>> | DocsExecution<Readonly<{
|
|
101
|
+
kind: "recover";
|
|
102
|
+
transactionState: "manual-required";
|
|
103
|
+
writeState: "unknown";
|
|
104
|
+
transaction: Readonly<{
|
|
105
|
+
state: "idle";
|
|
106
|
+
}> | Readonly<{
|
|
107
|
+
state: "recoverable";
|
|
108
|
+
transactionKind: "document";
|
|
109
|
+
recovery: Readonly<{
|
|
110
|
+
commandId: "docs.recover";
|
|
111
|
+
args: Readonly<{
|
|
112
|
+
exactFoundationBuildIdentity: string;
|
|
113
|
+
exactFoundationVersion: string;
|
|
114
|
+
}>;
|
|
115
|
+
}>;
|
|
116
|
+
}> | Readonly<{
|
|
117
|
+
state: "manual-recovery-required";
|
|
118
|
+
transactionKind?: "corrupt" | "document" | "local-mode" | "scaffold" | "transition-residue" | "unknown" | "version-mismatch";
|
|
119
|
+
reason: string;
|
|
120
|
+
recovery?: {
|
|
121
|
+
readonly commandId: "detach" | "docs-recover" | "scaffold-recover";
|
|
122
|
+
readonly args: Readonly<Record<string, string>>;
|
|
123
|
+
};
|
|
124
|
+
}>;
|
|
125
|
+
}>> | DocsExecution<Readonly<{
|
|
126
|
+
kind: "recover";
|
|
127
|
+
transactionState: "recovered" | "recovery-required";
|
|
128
|
+
writeState: "committed" | "published-recovery-required" | "unchanged" | "unknown";
|
|
129
|
+
receiptDigest: `sha256:${string}`;
|
|
130
|
+
receipt: Readonly<{
|
|
131
|
+
outcome: import("@agent-teams/engineering-foundation/document-authoring").DocumentReceiptOutcome;
|
|
132
|
+
commit: Readonly<{
|
|
133
|
+
state: "committed" | "manual-recovery-required" | "not-published" | "recovery-required";
|
|
134
|
+
publication: "none" | "preexisting-exact" | "published" | "unknown";
|
|
135
|
+
recoverability: "not-required" | "preserved-for-recovery";
|
|
136
|
+
}>;
|
|
137
|
+
directoryMaterialization?: {
|
|
138
|
+
readonly state: "none-created" | "created-and-retained" | "preserved-unknown";
|
|
139
|
+
readonly plannedDirectories: readonly string[];
|
|
140
|
+
readonly observedCreatedDirectories: readonly string[];
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
}>>>;
|
|
144
|
+
check(input: {
|
|
145
|
+
readonly consumerRoot: string;
|
|
146
|
+
readonly profilePath: string;
|
|
147
|
+
readonly signal?: AbortSignal;
|
|
148
|
+
}): Promise<DocsExecution<Readonly<{
|
|
149
|
+
kind: "check";
|
|
150
|
+
projectId: string;
|
|
151
|
+
catalogStatus: "complete" | "partial";
|
|
152
|
+
documents: number;
|
|
153
|
+
foundationProfile: {
|
|
154
|
+
readonly metadataSidecarPolicy: "foundation-profile-v2-strict-merge";
|
|
155
|
+
readonly path: string;
|
|
156
|
+
readonly schemaVersion: 2;
|
|
157
|
+
};
|
|
158
|
+
metadataSidecar: {
|
|
159
|
+
readonly kind: "none";
|
|
160
|
+
} | {
|
|
161
|
+
readonly kind: "path-metadata-map";
|
|
162
|
+
readonly path: string;
|
|
163
|
+
};
|
|
164
|
+
semanticValidatorIds: readonly string[];
|
|
165
|
+
valid: boolean;
|
|
166
|
+
}>>>;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=docs-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-protocol.d.ts","sourceRoot":"","sources":["../../src/application/docs-protocol.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAKrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aA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