@agent-teams/docs-protocol 0.1.0-rc.1 → 0.1.0-rc.4
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 +26 -0
- package/README.md +34 -5
- package/assets/catalog.json +1 -0
- package/assets/docs-protocol.yml +14 -0
- package/assets/transition-catalog.json +1 -0
- package/dist/composition/cli.d.ts.map +1 -1
- package/dist/composition/cli.js +9 -1
- package/dist/composition/cli.js.map +1 -1
- package/dist/consumer-integration/adapters/agents-route-adapter-v1.d.ts +15 -0
- package/dist/consumer-integration/adapters/agents-route-adapter-v1.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/agents-route-adapter-v1.js +96 -0
- package/dist/consumer-integration/adapters/agents-route-adapter-v1.js.map +1 -0
- package/dist/consumer-integration/adapters/bounded-repository-topology.d.ts +8 -0
- package/dist/consumer-integration/adapters/bounded-repository-topology.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/bounded-repository-topology.js +80 -0
- package/dist/consumer-integration/adapters/bounded-repository-topology.js.map +1 -0
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts +3 -0
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js +43 -0
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js.map +1 -0
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.d.ts +14 -0
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.js +404 -0
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.js.map +1 -0
- package/dist/consumer-integration/adapters/package-consumer-asset-catalog.d.ts +3 -0
- package/dist/consumer-integration/adapters/package-consumer-asset-catalog.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/package-consumer-asset-catalog.js +152 -0
- package/dist/consumer-integration/adapters/package-consumer-asset-catalog.js.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.d.ts +3 -0
- package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.js +37 -0
- package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.js.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.d.ts +16 -0
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.js +155 -0
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.js.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.d.ts +8 -0
- package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.js +160 -0
- package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.js.map +1 -0
- package/dist/consumer-integration/application/policies/consumer-integration-assets.d.ts +57 -0
- package/dist/consumer-integration/application/policies/consumer-integration-assets.d.ts.map +1 -0
- package/dist/consumer-integration/application/policies/consumer-integration-assets.js +151 -0
- package/dist/consumer-integration/application/policies/consumer-integration-assets.js.map +1 -0
- package/dist/consumer-integration/application/policies/consumer-integration-authority-guards.d.ts +4 -0
- package/dist/consumer-integration/application/policies/consumer-integration-authority-guards.d.ts.map +1 -0
- package/dist/consumer-integration/application/policies/consumer-integration-authority-guards.js +23 -0
- package/dist/consumer-integration/application/policies/consumer-integration-authority-guards.js.map +1 -0
- package/dist/consumer-integration/application/policies/consumer-integration-desired-state.d.ts +4 -0
- package/dist/consumer-integration/application/policies/consumer-integration-desired-state.d.ts.map +1 -0
- package/dist/consumer-integration/application/policies/consumer-integration-desired-state.js +153 -0
- package/dist/consumer-integration/application/policies/consumer-integration-desired-state.js.map +1 -0
- package/dist/consumer-integration/application/use-cases/plan-consumer-integration.d.ts +18 -0
- package/dist/consumer-integration/application/use-cases/plan-consumer-integration.d.ts.map +1 -0
- package/dist/consumer-integration/application/use-cases/plan-consumer-integration.js +537 -0
- package/dist/consumer-integration/application/use-cases/plan-consumer-integration.js.map +1 -0
- package/dist/consumer-integration/composition/consumer-integration-cli.d.ts +3 -0
- package/dist/consumer-integration/composition/consumer-integration-cli.d.ts.map +1 -0
- package/dist/consumer-integration/composition/consumer-integration-cli.js +223 -0
- package/dist/consumer-integration/composition/consumer-integration-cli.js.map +1 -0
- package/dist/consumer-integration/composition/node-consumer-integration.d.ts +28 -0
- package/dist/consumer-integration/composition/node-consumer-integration.d.ts.map +1 -0
- package/dist/consumer-integration/composition/node-consumer-integration.js +138 -0
- package/dist/consumer-integration/composition/node-consumer-integration.js.map +1 -0
- package/dist/consumer-integration/domain/model.d.ts +105 -0
- package/dist/consumer-integration/domain/model.d.ts.map +1 -0
- package/dist/consumer-integration/domain/model.js +2 -0
- package/dist/consumer-integration/domain/model.js.map +1 -0
- package/dist/consumer-integration/generated/canonical-assets.d.ts +3 -0
- package/dist/consumer-integration/generated/canonical-assets.d.ts.map +1 -0
- package/dist/consumer-integration/generated/canonical-assets.js +4 -0
- package/dist/consumer-integration/generated/canonical-assets.js.map +1 -0
- package/dist/consumer-integration/index.d.ts +11 -0
- package/dist/consumer-integration/index.d.ts.map +1 -0
- package/dist/consumer-integration/index.js +7 -0
- package/dist/consumer-integration/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +13 -3
- package/schemas/docs-consumer-integration-execution/v1.schema.json +29 -0
- package/schemas/docs-consumer-integration-plan/v1.schema.json +63 -0
- package/schemas/docs-consumer-integration-profile/v1.schema.json +110 -0
- package/schemas/docs-consumer-managed-state/v1.schema.json +99 -0
- package/schemas/qualified-docs-cohort/v1.schema.json +96 -0
- package/skills/docs/SKILL.md +28 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { applyConsumerIntegration, checkConsumerIntegration, planNodeConsumerIntegration, recoverConsumerIntegration } from "./node-consumer-integration.js";
|
|
2
|
+
import { assertConsumerIntegrationExecutionSchema } from "../adapters/consumer-integration-schema-validator.js";
|
|
3
|
+
class ConsumerCliInputError extends Error {
|
|
4
|
+
code = "DOCS_CONSUMER_CLI_INVALID";
|
|
5
|
+
}
|
|
6
|
+
const COHORT_ID = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/u;
|
|
7
|
+
const SHA256 = /^sha256:[0-9a-f]{64}$/u;
|
|
8
|
+
const MAXIMUM_ARGUMENT_LENGTH = 4096;
|
|
9
|
+
const MAXIMUM_ARGUMENTS = 32;
|
|
10
|
+
class Arguments {
|
|
11
|
+
#values;
|
|
12
|
+
#used = new Set();
|
|
13
|
+
constructor(values) {
|
|
14
|
+
this.#values = [...values];
|
|
15
|
+
}
|
|
16
|
+
flag(name) {
|
|
17
|
+
const indexes = this.#values.flatMap((value, index) => value === name ? [index] : []);
|
|
18
|
+
if (indexes.length > 1) {
|
|
19
|
+
throw new ConsumerCliInputError(`${name} may be supplied only once.`);
|
|
20
|
+
}
|
|
21
|
+
if (indexes[0] !== undefined) {
|
|
22
|
+
this.#used.add(indexes[0]);
|
|
23
|
+
}
|
|
24
|
+
return indexes.length === 1;
|
|
25
|
+
}
|
|
26
|
+
one(name, required = false) {
|
|
27
|
+
const indexes = this.#values.flatMap((value, index) => value === name ? [index] : []);
|
|
28
|
+
if (indexes.length > 1) {
|
|
29
|
+
throw new ConsumerCliInputError(`${name} may be supplied only once.`);
|
|
30
|
+
}
|
|
31
|
+
const index = indexes[0];
|
|
32
|
+
if (index === undefined) {
|
|
33
|
+
if (required) {
|
|
34
|
+
throw new ConsumerCliInputError(`${name} is required.`);
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const value = this.#values[index + 1];
|
|
39
|
+
if (value === undefined || value.startsWith("--")) {
|
|
40
|
+
throw new ConsumerCliInputError(`${name} requires a value.`);
|
|
41
|
+
}
|
|
42
|
+
if (value.length > MAXIMUM_ARGUMENT_LENGTH || value.includes("\u0000")) {
|
|
43
|
+
throw new ConsumerCliInputError(`${name} contains an invalid or overlong value.`);
|
|
44
|
+
}
|
|
45
|
+
this.#used.add(index);
|
|
46
|
+
this.#used.add(index + 1);
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
assertConsumed() {
|
|
50
|
+
const unknown = this.#values.filter((_value, index) => !this.#used.has(index));
|
|
51
|
+
if (unknown.length > 0) {
|
|
52
|
+
throw new ConsumerCliInputError(`Unknown consumer arguments: ${unknown.join(" ")}.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function failure(command, error) {
|
|
57
|
+
const candidateCode = typeof error === "object" && error !== null && "code" in error &&
|
|
58
|
+
typeof error.code === "string" ? error.code : "DOCS_CONSUMER_EXECUTION_FAILURE";
|
|
59
|
+
const code = /^(?:DOCS_|KNOWN_)[A-Z0-9_]{1,122}$/u.test(candidateCode)
|
|
60
|
+
? candidateCode
|
|
61
|
+
: "DOCS_CONSUMER_EXECUTION_FAILURE";
|
|
62
|
+
const commandId = ["apply", "check", "plan", "recover"].includes(command)
|
|
63
|
+
? `consumer.${command}`
|
|
64
|
+
: "consumer.check";
|
|
65
|
+
const rawMessage = error instanceof Error ? error.message : "Consumer integration failed.";
|
|
66
|
+
const safeMessage = [...rawMessage
|
|
67
|
+
.replace(/(?:[A-Za-z]:\\|\/(?:Users|home|tmp|private|var|Volumes)\/)[^\s'"`]+/gu, "<local-path>")
|
|
68
|
+
].map((character) => {
|
|
69
|
+
const codePoint = character.codePointAt(0) ?? 0;
|
|
70
|
+
return (codePoint < 32 && ![9, 10, 13].includes(codePoint)) || codePoint === 127
|
|
71
|
+
? "?"
|
|
72
|
+
: character;
|
|
73
|
+
}).join("")
|
|
74
|
+
.slice(0, 4096);
|
|
75
|
+
return {
|
|
76
|
+
schemaVersion: 1,
|
|
77
|
+
command: commandId,
|
|
78
|
+
outcome: "blocked",
|
|
79
|
+
issues: [{
|
|
80
|
+
code,
|
|
81
|
+
severity: "error",
|
|
82
|
+
subject: command.slice(0, 2048),
|
|
83
|
+
message: safeMessage
|
|
84
|
+
}]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function human(execution) {
|
|
88
|
+
const lines = [`${execution.command}: ${execution.outcome}`];
|
|
89
|
+
if (execution.plan !== undefined) {
|
|
90
|
+
lines.push(`Cohort: ${execution.plan.cohortId}`);
|
|
91
|
+
lines.push(`Plan: ${execution.plan.planDigest}`);
|
|
92
|
+
for (const asset of execution.plan.assets) {
|
|
93
|
+
const current = asset.currentDigest === undefined ? "absent" : asset.currentDigest;
|
|
94
|
+
lines.push(`${asset.action.padEnd(7)} ${asset.path} (${asset.ownership}, ${asset.state})`);
|
|
95
|
+
if (asset.action !== "none") {
|
|
96
|
+
lines.push(` ${current} -> ${asset.expectedDigest}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (execution.receipt !== undefined) {
|
|
101
|
+
lines.push(`Receipt: ${execution.receipt.receiptDigest}`);
|
|
102
|
+
}
|
|
103
|
+
for (const issue of execution.issues) {
|
|
104
|
+
lines.push(`${issue.severity.toUpperCase()} ${issue.code} [${issue.subject}]: ${issue.message}`);
|
|
105
|
+
lines.push(issue.code === "DOCS_CONSUMER_STALE_PLAN"
|
|
106
|
+
? "Next: run consumer plan again and review the new digest."
|
|
107
|
+
: issue.code.includes("RECOVERY") || issue.code.startsWith("KNOWN_FILE")
|
|
108
|
+
? "Next: run consumer recover, then repeat check and plan."
|
|
109
|
+
: "Next: fix the reported authority or conflict, then repeat check and plan.");
|
|
110
|
+
}
|
|
111
|
+
return `${lines.join("\n")}\n`;
|
|
112
|
+
}
|
|
113
|
+
function exitCode(execution) {
|
|
114
|
+
if (["applied", "current", "recovered"].includes(execution.outcome)) {
|
|
115
|
+
return 0;
|
|
116
|
+
}
|
|
117
|
+
if (execution.outcome === "change-required") {
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
const codes = new Set(execution.issues.map(({ code }) => code));
|
|
121
|
+
if (codes.has("DOCS_CONSUMER_CLI_INVALID")) {
|
|
122
|
+
return 2;
|
|
123
|
+
}
|
|
124
|
+
return codes.has("DOCS_CONSUMER_EXECUTION_FAILURE") ? 3 : 1;
|
|
125
|
+
}
|
|
126
|
+
function assertBoundedArgv(argv) {
|
|
127
|
+
if (argv.length > MAXIMUM_ARGUMENTS || argv.some((value) => typeof value !== "string" || value.length > MAXIMUM_ARGUMENT_LENGTH || value.includes("\u0000"))) {
|
|
128
|
+
throw new ConsumerCliInputError("Consumer arguments are invalid or exceed the bounded CLI contract.");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export function consumerIntegrationHelp() {
|
|
132
|
+
return `Usage: agent-teams-docs consumer <command> [options]
|
|
133
|
+
|
|
134
|
+
Commands:
|
|
135
|
+
check Verify the selected Cohort without writing
|
|
136
|
+
plan --to COHORT Print a deterministic, write-free semantic plan
|
|
137
|
+
apply --expect SHA256 Rebuild and apply the reviewed plan through Foundation
|
|
138
|
+
recover Recover the Foundation transaction (profile not read)
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
--consumer PATH Git repository root (default: .)
|
|
142
|
+
--integration-profile PATH V1 fixed integration profile path
|
|
143
|
+
--json Emit one bounded versioned JSON envelope
|
|
144
|
+
--help Show this help
|
|
145
|
+
`;
|
|
146
|
+
}
|
|
147
|
+
// oxlint-disable-next-line complexity -- the bounded command router keeps all CLI variants in one envelope boundary.
|
|
148
|
+
export async function runConsumerIntegrationCli(argv) {
|
|
149
|
+
let command = "";
|
|
150
|
+
let jsonRequested = false;
|
|
151
|
+
let execution;
|
|
152
|
+
try {
|
|
153
|
+
assertBoundedArgv(argv);
|
|
154
|
+
command = argv[0] ?? "";
|
|
155
|
+
jsonRequested = argv.includes("--json");
|
|
156
|
+
if (command === "help" || command === "--help" || argv[1] === "--help") {
|
|
157
|
+
const helpArgs = new Arguments(argv.slice(1));
|
|
158
|
+
if (argv[1] === "--help") {
|
|
159
|
+
helpArgs.flag("--help");
|
|
160
|
+
}
|
|
161
|
+
helpArgs.assertConsumed();
|
|
162
|
+
process.stdout.write(consumerIntegrationHelp());
|
|
163
|
+
return 0;
|
|
164
|
+
}
|
|
165
|
+
const args = new Arguments(argv.slice(1));
|
|
166
|
+
args.flag("--json");
|
|
167
|
+
const consumerRoot = args.one("--consumer") ?? ".";
|
|
168
|
+
const integrationProfilePath = args.one("--integration-profile");
|
|
169
|
+
if (command === "check") {
|
|
170
|
+
args.assertConsumed();
|
|
171
|
+
execution = await checkConsumerIntegration({
|
|
172
|
+
consumerRoot,
|
|
173
|
+
...(integrationProfilePath === undefined ? {} : { integrationProfilePath })
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
else if (command === "plan") {
|
|
177
|
+
const to = args.one("--to", true);
|
|
178
|
+
if (!COHORT_ID.test(to)) {
|
|
179
|
+
throw new ConsumerCliInputError("--to must be one exact Cohort ID.");
|
|
180
|
+
}
|
|
181
|
+
args.assertConsumed();
|
|
182
|
+
execution = await planNodeConsumerIntegration({
|
|
183
|
+
consumerRoot,
|
|
184
|
+
to,
|
|
185
|
+
...(integrationProfilePath === undefined ? {} : { integrationProfilePath })
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
else if (command === "apply") {
|
|
189
|
+
const expect = args.one("--expect", true);
|
|
190
|
+
if (!SHA256.test(expect)) {
|
|
191
|
+
throw new ConsumerCliInputError("--expect must be one sha256 Plan digest.");
|
|
192
|
+
}
|
|
193
|
+
args.assertConsumed();
|
|
194
|
+
execution = await applyConsumerIntegration({
|
|
195
|
+
consumerRoot,
|
|
196
|
+
expect,
|
|
197
|
+
...(integrationProfilePath === undefined ? {} : { integrationProfilePath })
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
else if (command === "recover") {
|
|
201
|
+
if (integrationProfilePath !== undefined) {
|
|
202
|
+
throw new ConsumerCliInputError("consumer recover does not read an integration profile.");
|
|
203
|
+
}
|
|
204
|
+
args.assertConsumed();
|
|
205
|
+
execution = await recoverConsumerIntegration({ consumerRoot });
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
throw new ConsumerCliInputError("Expected consumer command: check, plan, apply, or recover.");
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
execution = failure(command || "check", error);
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
await assertConsumerIntegrationExecutionSchema(execution);
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
execution = failure(command || "check", error);
|
|
219
|
+
}
|
|
220
|
+
process.stdout.write(jsonRequested ? `${JSON.stringify(execution)}\n` : human(execution));
|
|
221
|
+
return exitCode(execution);
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=consumer-integration-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer-integration-cli.js","sourceRoot":"","sources":["../../../src/consumer-integration/composition/consumer-integration-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAE3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,wCAAwC,EAAE,MAAM,sDAAsD,CAAC;AAEhH,MAAM,qBAAsB,SAAQ,KAAK;IAC9B,IAAI,GAAG,2BAA2B,CAAC;CAC7C;AAED,MAAM,SAAS,GAAG,iCAAiC,CAAC;AACpD,MAAM,MAAM,GAAG,wBAAwB,CAAC;AACxC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,SAAS;IACJ,OAAO,CAAW;IAClB,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,YAAmB,MAAyB;QAC1C,IAAI,CAAC,OAAO,GAAG,CA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AAC,CAAC;QACL,CAAC;aAAM,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACjC,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;gBACzC,MAAM,IAAI,qBAAqB,CAAC,wDAAwD,CAAC,CAAC;YAC5F,CAAC;YACD,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,SAAS,GAAG,MAAM,0BAA0B,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,qBAAqB,CAAC,4DAA4D,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,SAAS,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,CAAC;QACH,MAAM,wCAAwC,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,SAAS,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1F,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type KnownFileTransactionReceiptV1 } from "@agent-teams/engineering-foundation/mutation";
|
|
2
|
+
import type { ConsumerIntegrationIssue, ConsumerIntegrationPlanV1 } from "../domain/model.js";
|
|
3
|
+
export interface ConsumerIntegrationExecutionV1 {
|
|
4
|
+
readonly schemaVersion: 1;
|
|
5
|
+
readonly command: "consumer.apply" | "consumer.check" | "consumer.plan" | "consumer.recover";
|
|
6
|
+
readonly outcome: "applied" | "blocked" | "change-required" | "current" | "recovered";
|
|
7
|
+
readonly issues: readonly ConsumerIntegrationIssue[];
|
|
8
|
+
readonly plan?: ConsumerIntegrationPlanV1;
|
|
9
|
+
readonly receipt?: KnownFileTransactionReceiptV1;
|
|
10
|
+
}
|
|
11
|
+
export declare function checkConsumerIntegration(options: {
|
|
12
|
+
readonly consumerRoot: string;
|
|
13
|
+
readonly integrationProfilePath?: string;
|
|
14
|
+
}): Promise<ConsumerIntegrationExecutionV1>;
|
|
15
|
+
export declare function planNodeConsumerIntegration(options: {
|
|
16
|
+
readonly consumerRoot: string;
|
|
17
|
+
readonly integrationProfilePath?: string;
|
|
18
|
+
readonly to: string;
|
|
19
|
+
}): Promise<ConsumerIntegrationExecutionV1>;
|
|
20
|
+
export declare function applyConsumerIntegration(options: {
|
|
21
|
+
readonly consumerRoot: string;
|
|
22
|
+
readonly expect: string;
|
|
23
|
+
readonly integrationProfilePath?: string;
|
|
24
|
+
}): Promise<ConsumerIntegrationExecutionV1>;
|
|
25
|
+
export declare function recoverConsumerIntegration(options: {
|
|
26
|
+
readonly consumerRoot: string;
|
|
27
|
+
}): Promise<ConsumerIntegrationExecutionV1>;
|
|
28
|
+
//# sourceMappingURL=node-consumer-integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-consumer-integration.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/composition/node-consumer-integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,6BAA6B,EACnC,MAAM,8CAA8C,CAAC;AAKtD,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,eAAe,GAAG,kBAAkB,CAAC;IAC7F,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS,GAAG,WAAW,CAAC;IACtF,QAAQ,CAAC,MAAM,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,yBAAyB,CAAC;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,6BAA6B,CAAC;CAClD;AA8CD,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAC1C,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAW1C;AAED,wBAAsB,2BAA2B,CAAC,OAAO,EAAE;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAyB1C;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAC1C,GAAG,OAAO,CAAC,8BAA8B,CAAC,CA2C1C;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE;IACxD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAW1C"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { applyKnownFileTransaction, inspectKnownFileTransactionBarrier, recoverKnownFileTransaction } from "@agent-teams/engineering-foundation/mutation";
|
|
2
|
+
import { readConsumerIntegrationInput } from "../adapters/node-consumer-integration-repository.js";
|
|
3
|
+
import { loadPackageConsumerAssetCatalog } from "../adapters/package-consumer-asset-catalog.js";
|
|
4
|
+
import { compileConsumerIntegration } from "../application/use-cases/plan-consumer-integration.js";
|
|
5
|
+
async function compile(options) {
|
|
6
|
+
const input = await readConsumerIntegrationInput(options);
|
|
7
|
+
const assetCatalog = await loadPackageConsumerAssetCatalog();
|
|
8
|
+
const compiled = compileConsumerIntegration({
|
|
9
|
+
desired: input.desired,
|
|
10
|
+
snapshot: input.snapshot,
|
|
11
|
+
assetCatalog
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
root: input.root,
|
|
15
|
+
...compiled
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
async function recoveryIssue(consumerRoot) {
|
|
19
|
+
const inspection = await inspectKnownFileTransactionBarrier({ consumerRoot });
|
|
20
|
+
if (inspection.state === "idle") {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze({
|
|
24
|
+
code: inspection.code,
|
|
25
|
+
severity: "error",
|
|
26
|
+
subject: "foundation-transaction",
|
|
27
|
+
message: inspection.message
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function blockedExecution(command, issue) {
|
|
31
|
+
return Object.freeze({
|
|
32
|
+
schemaVersion: 1,
|
|
33
|
+
command,
|
|
34
|
+
outcome: "blocked",
|
|
35
|
+
issues: Object.freeze([issue])
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export async function checkConsumerIntegration(options) {
|
|
39
|
+
const issue = await recoveryIssue(options.consumerRoot);
|
|
40
|
+
if (issue !== undefined) {
|
|
41
|
+
return blockedExecution("consumer.check", issue);
|
|
42
|
+
}
|
|
43
|
+
const { plan } = await compile(options);
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
schemaVersion: 1,
|
|
46
|
+
command: "consumer.check",
|
|
47
|
+
outcome: plan.outcome,
|
|
48
|
+
issues: plan.issues,
|
|
49
|
+
plan
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export async function planNodeConsumerIntegration(options) {
|
|
53
|
+
const issue = await recoveryIssue(options.consumerRoot);
|
|
54
|
+
if (issue !== undefined) {
|
|
55
|
+
return blockedExecution("consumer.plan", issue);
|
|
56
|
+
}
|
|
57
|
+
const { plan } = await compile(options);
|
|
58
|
+
if (plan.cohortId !== options.to) {
|
|
59
|
+
return Object.freeze({
|
|
60
|
+
schemaVersion: 1,
|
|
61
|
+
command: "consumer.plan",
|
|
62
|
+
outcome: "blocked",
|
|
63
|
+
issues: Object.freeze([{
|
|
64
|
+
code: "DOCS_CONSUMER_TARGET_COHORT_MISMATCH",
|
|
65
|
+
severity: "error",
|
|
66
|
+
subject: options.to,
|
|
67
|
+
message: `Integration profile selects ${plan.cohortId}, not requested cohort ${options.to}.`
|
|
68
|
+
}]),
|
|
69
|
+
plan
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return Object.freeze({
|
|
73
|
+
schemaVersion: 1,
|
|
74
|
+
command: "consumer.plan",
|
|
75
|
+
outcome: plan.outcome,
|
|
76
|
+
issues: plan.issues,
|
|
77
|
+
plan
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export async function applyConsumerIntegration(options) {
|
|
81
|
+
const issue = await recoveryIssue(options.consumerRoot);
|
|
82
|
+
if (issue !== undefined) {
|
|
83
|
+
return blockedExecution("consumer.apply", issue);
|
|
84
|
+
}
|
|
85
|
+
const { root, plan, mutationPlan } = await compile(options);
|
|
86
|
+
if (plan.planDigest !== options.expect) {
|
|
87
|
+
return Object.freeze({
|
|
88
|
+
schemaVersion: 1,
|
|
89
|
+
command: "consumer.apply",
|
|
90
|
+
outcome: "blocked",
|
|
91
|
+
issues: Object.freeze([{
|
|
92
|
+
code: "DOCS_CONSUMER_STALE_PLAN",
|
|
93
|
+
severity: "error",
|
|
94
|
+
subject: "--expect",
|
|
95
|
+
message: `Expected ${options.expect}, but fresh Plan digest is ${plan.planDigest}.`
|
|
96
|
+
}]),
|
|
97
|
+
plan
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (plan.outcome === "blocked" || mutationPlan === undefined) {
|
|
101
|
+
return Object.freeze({
|
|
102
|
+
schemaVersion: 1,
|
|
103
|
+
command: "consumer.apply",
|
|
104
|
+
outcome: "blocked",
|
|
105
|
+
issues: plan.issues,
|
|
106
|
+
plan
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const receipt = await applyKnownFileTransaction({
|
|
110
|
+
consumerRoot: root,
|
|
111
|
+
plan: mutationPlan
|
|
112
|
+
});
|
|
113
|
+
const after = await compile(options);
|
|
114
|
+
if (after.plan.outcome !== "current") {
|
|
115
|
+
throw new Error("Consumer integration postimage verification did not converge to current.");
|
|
116
|
+
}
|
|
117
|
+
return Object.freeze({
|
|
118
|
+
schemaVersion: 1,
|
|
119
|
+
command: "consumer.apply",
|
|
120
|
+
outcome: receipt.outcome === "applied" ? "applied" : "current",
|
|
121
|
+
issues: Object.freeze([]),
|
|
122
|
+
plan: after.plan,
|
|
123
|
+
receipt
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export async function recoverConsumerIntegration(options) {
|
|
127
|
+
const receipt = await recoverKnownFileTransaction({
|
|
128
|
+
consumerRoot: options.consumerRoot
|
|
129
|
+
});
|
|
130
|
+
return Object.freeze({
|
|
131
|
+
schemaVersion: 1,
|
|
132
|
+
command: "consumer.recover",
|
|
133
|
+
outcome: "recovered",
|
|
134
|
+
issues: Object.freeze([]),
|
|
135
|
+
receipt
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=node-consumer-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-consumer-integration.js","sourceRoot":"","sources":["../../../src/consumer-integration/composition/node-consumer-integration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,EAE5B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AACnG,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;A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AK,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;IAC9F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,gBAAgB;QACzB,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC9D,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,OAEhD;IACC,MAAM,OAAO,GAAG,MAAM,2BAA2B,CAAC;QAChD,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export type ConsumerIntegrationDigest = `sha256:${string}`;
|
|
2
|
+
export interface QualifiedDocsCohortV1 {
|
|
3
|
+
readonly schemaVersion: 1;
|
|
4
|
+
readonly cohortId: string;
|
|
5
|
+
readonly channel: "rc" | "stable";
|
|
6
|
+
readonly recordDigest: ConsumerIntegrationDigest;
|
|
7
|
+
readonly qualificationEventDigest: ConsumerIntegrationDigest;
|
|
8
|
+
readonly lifecycleState: "QUALIFIED" | "CANARY" | "RECOMMENDED";
|
|
9
|
+
readonly eligibleAfter: string;
|
|
10
|
+
readonly upgradeFrom: readonly string[];
|
|
11
|
+
readonly rollbackTo: readonly string[];
|
|
12
|
+
readonly canaryRepositoryIds: readonly string[];
|
|
13
|
+
readonly packages: {
|
|
14
|
+
readonly docsProtocol: {
|
|
15
|
+
readonly version: string;
|
|
16
|
+
readonly integrity: `sha512-${string}`;
|
|
17
|
+
};
|
|
18
|
+
readonly engineeringFoundation: {
|
|
19
|
+
readonly version: string;
|
|
20
|
+
readonly integrity: `sha512-${string}`;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly workflow: {
|
|
24
|
+
readonly repository: string;
|
|
25
|
+
readonly path: string;
|
|
26
|
+
readonly revision: string;
|
|
27
|
+
readonly blobSha: string;
|
|
28
|
+
};
|
|
29
|
+
readonly assets: {
|
|
30
|
+
readonly skillDigest: ConsumerIntegrationDigest;
|
|
31
|
+
readonly callerWorkflowDigest: ConsumerIntegrationDigest;
|
|
32
|
+
readonly assetCatalogDigest: ConsumerIntegrationDigest;
|
|
33
|
+
readonly transitionCatalogDigest: ConsumerIntegrationDigest;
|
|
34
|
+
};
|
|
35
|
+
readonly schemas: {
|
|
36
|
+
readonly consumerIntegration: 1;
|
|
37
|
+
readonly managedState: 1;
|
|
38
|
+
readonly docsProtocol: 1;
|
|
39
|
+
};
|
|
40
|
+
readonly runtime: {
|
|
41
|
+
readonly node: ">=24.18.0 <25";
|
|
42
|
+
readonly pnpm: ">=11.17.0 <12";
|
|
43
|
+
readonly runtimeClosureDigest: ConsumerIntegrationDigest;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Immutable Cohort evidence that may be committed in a consumer repository. */
|
|
47
|
+
export type QualifiedDocsCohortBindingV1 = Omit<QualifiedDocsCohortV1, "canaryRepositoryIds" | "lifecycleState">;
|
|
48
|
+
export interface ConsumerIntegrationDesiredStateV1 {
|
|
49
|
+
readonly schemaVersion: 1;
|
|
50
|
+
readonly repository: {
|
|
51
|
+
readonly provider: "github";
|
|
52
|
+
readonly id: string;
|
|
53
|
+
readonly nameWithOwner: string;
|
|
54
|
+
};
|
|
55
|
+
readonly integrationRoot: ".";
|
|
56
|
+
readonly packageManager: "pnpm";
|
|
57
|
+
readonly profilePath: string;
|
|
58
|
+
readonly skillPath: string;
|
|
59
|
+
readonly callerWorkflowPath: string;
|
|
60
|
+
readonly managedStatePath: string;
|
|
61
|
+
readonly governedDocsRoots?: readonly string[];
|
|
62
|
+
readonly cohort: QualifiedDocsCohortBindingV1;
|
|
63
|
+
}
|
|
64
|
+
export type ConsumerIntegrationFileObservation = {
|
|
65
|
+
readonly state: "absent";
|
|
66
|
+
} | {
|
|
67
|
+
readonly state: "file";
|
|
68
|
+
readonly bytes: Uint8Array;
|
|
69
|
+
readonly mode: number;
|
|
70
|
+
};
|
|
71
|
+
export interface ConsumerIntegrationSnapshot {
|
|
72
|
+
readonly integrationProfile: ConsumerIntegrationFileObservation;
|
|
73
|
+
readonly lockfile: ConsumerIntegrationFileObservation;
|
|
74
|
+
readonly packageManifest: ConsumerIntegrationFileObservation;
|
|
75
|
+
readonly agents: ConsumerIntegrationFileObservation;
|
|
76
|
+
readonly skill: ConsumerIntegrationFileObservation;
|
|
77
|
+
readonly callerWorkflow: ConsumerIntegrationFileObservation;
|
|
78
|
+
readonly managedState: ConsumerIntegrationFileObservation;
|
|
79
|
+
}
|
|
80
|
+
export type ConsumerIntegrationAssetState = "absent" | "exact-current" | "known-prior" | "partial-adoption" | "outdated-cohort" | "unknown-modified" | "conflict" | "unsupported";
|
|
81
|
+
export interface ConsumerIntegrationIssue {
|
|
82
|
+
readonly code: string;
|
|
83
|
+
readonly severity: "error" | "warning";
|
|
84
|
+
readonly subject: string;
|
|
85
|
+
readonly message: string;
|
|
86
|
+
}
|
|
87
|
+
export interface ConsumerIntegrationAssetPlan {
|
|
88
|
+
readonly id: "agents-route" | "caller-workflow" | "managed-state" | "package-manifest" | "skill";
|
|
89
|
+
readonly path: string;
|
|
90
|
+
readonly ownership: "full-bytes" | "partial-fields" | "managed-block";
|
|
91
|
+
readonly state: ConsumerIntegrationAssetState;
|
|
92
|
+
readonly currentDigest?: ConsumerIntegrationDigest;
|
|
93
|
+
readonly expectedDigest: ConsumerIntegrationDigest;
|
|
94
|
+
readonly action: "create" | "none" | "replace" | "blocked";
|
|
95
|
+
}
|
|
96
|
+
export interface ConsumerIntegrationPlanV1 {
|
|
97
|
+
readonly schemaVersion: 1;
|
|
98
|
+
readonly cohortId: string;
|
|
99
|
+
readonly repository: ConsumerIntegrationDesiredStateV1["repository"];
|
|
100
|
+
readonly planDigest: ConsumerIntegrationDigest;
|
|
101
|
+
readonly outcome: "blocked" | "change-required" | "current";
|
|
102
|
+
readonly assets: readonly ConsumerIntegrationAssetPlan[];
|
|
103
|
+
readonly issues: readonly ConsumerIntegrationIssue[];
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/domain/model.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG,UAAU,MAAM,EAAE,CAAC;AAE3D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,QAAQ,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;IACjD,QAAQ,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAC7D,QAAQ,CAAC,cAAc,EAAE,WAAW,GAAG,QAAQ,GAAG,aAAa,CAAC;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAA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BAAwB,EAAE,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/consumer-integration/domain/model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const GENERATED_DOCS_SKILL = "---\nname: docs-authoring\ndescription: Use when creating, changing, reorganizing, or reviewing governed documentation in this repository.\n---\n\n# Documentation Authoring\n\nProtocol: `agent-teams.docs-protocol/v1`.\n\n## Required workflow\n\n- Read the current types, owners, placement, metadata, and index policy with `pnpm docs:info`.\n- Search first with `pnpm docs:find -- --text query`.\n- Reuse or relate existing authority instead of creating a competing source.\n- Preview with `pnpm docs:new -- --type TYPE --id ID --title TITLE --owner OWNER --summary SUMMARY --dry-run`.\n- Review the exact destination, metadata, relations, anchors, and diagnostics.\n- Apply with `pnpm docs:new -- --type TYPE --id ID --title TITLE --owner OWNER --summary SUMMARY --apply` after review.\n- Manually update the reported index/link exactly when reachability requires it.\n- Finish with `pnpm docs:check` after the index is current.\n\n## Rules\n\n- Never invent owners, types, statuses, paths, or metadata outside `docs:info`.\n- If dependencies are absent, use only `pnpm install --frozen-lockfile`; never use npx, dlx, or latest tags.\n- Keep preview and apply inputs identical.\n- Stop when recovery is required; use `pnpm docs:doctor` before `pnpm docs:recover`.\n- Resolve required anchors and blockers before apply.\n- Do not bypass repository scripts or hand-edit transaction evidence.\n";
|
|
2
|
+
export declare const GENERATED_CALLER_WORKFLOW_TEMPLATE = "name: Documentation Protocol\n\non:\n pull_request:\n merge_group:\n push:\n\npermissions:\n contents: read\n id-token: write\n\njobs:\n docs-protocol:\n uses: {{REUSABLE_WORKFLOW_REPOSITORY}}/{{REUSABLE_WORKFLOW_PATH}}@{{REUSABLE_WORKFLOW_REVISION}}\n";
|
|
3
|
+
//# sourceMappingURL=canonical-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-assets.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/generated/canonical-assets.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oBAAoB,o3CAAo3C,CAAC;AACt5C,eAAO,MAAM,kCAAkC,0QAA0Q,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Generated by scripts/generate-consumer-assets.mjs. Do not edit by hand.
|
|
2
|
+
export const GENERATED_DOCS_SKILL = "---\nname: docs-authoring\ndescription: Use when creating, changing, reorganizing, or reviewing governed documentation in this repository.\n---\n\n# Documentation Authoring\n\nProtocol: `agent-teams.docs-protocol/v1`.\n\n## Required workflow\n\n- Read the current types, owners, placement, metadata, and index policy with `pnpm docs:info`.\n- Search first with `pnpm docs:find -- --text query`.\n- Reuse or relate existing authority instead of creating a competing source.\n- Preview with `pnpm docs:new -- --type TYPE --id ID --title TITLE --owner OWNER --summary SUMMARY --dry-run`.\n- Review the exact destination, metadata, relations, anchors, and diagnostics.\n- Apply with `pnpm docs:new -- --type TYPE --id ID --title TITLE --owner OWNER --summary SUMMARY --apply` after review.\n- Manually update the reported index/link exactly when reachability requires it.\n- Finish with `pnpm docs:check` after the index is current.\n\n## Rules\n\n- Never invent owners, types, statuses, paths, or metadata outside `docs:info`.\n- If dependencies are absent, use only `pnpm install --frozen-lockfile`; never use npx, dlx, or latest tags.\n- Keep preview and apply inputs identical.\n- Stop when recovery is required; use `pnpm docs:doctor` before `pnpm docs:recover`.\n- Resolve required anchors and blockers before apply.\n- Do not bypass repository scripts or hand-edit transaction evidence.\n";
|
|
3
|
+
export const GENERATED_CALLER_WORKFLOW_TEMPLATE = "name: Documentation Protocol\n\non:\n pull_request:\n merge_group:\n push:\n\npermissions:\n contents: read\n id-token: write\n\njobs:\n docs-protocol:\n uses: {{REUSABLE_WORKFLOW_REPOSITORY}}/{{REUSABLE_WORKFLOW_PATH}}@{{REUSABLE_WORKFLOW_REVISION}}\n";
|
|
4
|
+
//# sourceMappingURL=canonical-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-assets.js","sourceRoot":"","sources":["../../../src/consumer-integration/generated/canonical-assets.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,i3CAAi3C,CAAC;AACt5C,MAAM,CAAC,MAAM,kCAAkC,GAAG,uQAAuQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { CANONICAL_DOCS_SKILL, BOOTSTRAP_KNOWN_PRIOR_CALLER_WORKFLOWS, canonicalCallerWorkflow, canonicalDocsScriptsDigest, canonicalDocsScripts, canonicalManagedRoute, canonicalManagedState, describeCanonicalConsumerAssets } from "./application/policies/consumer-integration-assets.js";
|
|
2
|
+
export { planConsumerIntegration } from "./application/use-cases/plan-consumer-integration.js";
|
|
3
|
+
export { planAgentsRouteV1 } from "./adapters/agents-route-adapter-v1.js";
|
|
4
|
+
export type { AgentsRoutePlanV1 } from "./adapters/agents-route-adapter-v1.js";
|
|
5
|
+
export { planPnpmManifestV1 } from "./adapters/pnpm-manifest-adapter-v1.js";
|
|
6
|
+
export type { PnpmManifestPlanV1 } from "./adapters/pnpm-manifest-adapter-v1.js";
|
|
7
|
+
export { applyConsumerIntegration, checkConsumerIntegration, planNodeConsumerIntegration, recoverConsumerIntegration } from "./composition/node-consumer-integration.js";
|
|
8
|
+
export type { ConsumerIntegrationExecutionV1 } from "./composition/node-consumer-integration.js";
|
|
9
|
+
export { ConsumerIntegrationNodeError, readConsumerIntegrationInput } from "./adapters/node-consumer-integration-repository.js";
|
|
10
|
+
export type { ConsumerIntegrationAssetPlan, ConsumerIntegrationAssetState, ConsumerIntegrationDesiredStateV1, ConsumerIntegrationDigest, ConsumerIntegrationFileObservation, ConsumerIntegrationIssue, ConsumerIntegrationPlanV1, ConsumerIntegrationSnapshot, QualifiedDocsCohortBindingV1, QualifiedDocsCohortV1 } from "./domain/model.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/consumer-integration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACtC,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,YAAY,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,4CAA4C,CAAC;AACpD,YAAY,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AACjG,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,oDAAoD,CAAC;AAC5D,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kCAAkC,EAClC,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CANONICAL_DOCS_SKILL, BOOTSTRAP_KNOWN_PRIOR_CALLER_WORKFLOWS, canonicalCallerWorkflow, canonicalDocsScriptsDigest, canonicalDocsScripts, canonicalManagedRoute, canonicalManagedState, describeCanonicalConsumerAssets } from "./application/policies/consumer-integration-assets.js";
|
|
2
|
+
export { planConsumerIntegration } from "./application/use-cases/plan-consumer-integration.js";
|
|
3
|
+
export { planAgentsRouteV1 } from "./adapters/agents-route-adapter-v1.js";
|
|
4
|
+
export { planPnpmManifestV1 } from "./adapters/pnpm-manifest-adapter-v1.js";
|
|
5
|
+
export { applyConsumerIntegration, checkConsumerIntegration, planNodeConsumerIntegration, recoverConsumerIntegration } from "./composition/node-consumer-integration.js";
|
|
6
|
+
export { ConsumerIntegrationNodeError, readConsumerIntegrationInput } from "./adapters/node-consumer-integration-repository.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/consumer-integration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACtC,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,oDAAoD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { renderDocsHuman, runDocsCli } from "./composition/cli.js";
|
|
|
2
2
|
export { docsCheck, docsDoctor, docsFind, docsInfo, docsNew, docsRecover } from "./composition/node-docs-api.js";
|
|
3
3
|
export type { DocsConsumerRequest } from "./composition/node-docs-api.js";
|
|
4
4
|
export { DOCS_PROTOCOL_ID, DOCS_PROTOCOL_VERSION } from "./domain/model.js";
|
|
5
|
+
export * as consumerIntegration from "./consumer-integration/index.js";
|
|
5
6
|
export type { DocsCommand, DocsCommandEnvelope, DocsCommandOutcome, DocsCodeAnchor, DocsDiagnostic, DocsExecution, DocsFindDocument, DocsFindQuery, DocsNewResult, DocsNewRequest, DocsProtocolProfile, DocsTypeProfile, ReachabilityAction } from "./domain/model.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EACnB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAC;AACvE,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EACnB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { renderDocsHuman, runDocsCli } from "./composition/cli.js";
|
|
2
2
|
export { docsCheck, docsDoctor, docsFind, docsInfo, docsNew, docsRecover } from "./composition/node-docs-api.js";
|
|
3
3
|
export { DOCS_PROTOCOL_ID, DOCS_PROTOCOL_VERSION } from "./domain/model.js";
|
|
4
|
+
export * as consumerIntegration from "./consumer-integration/index.js";
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACZ,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACZ,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,mBAAmB,MAAM,iCAAiC,CAAC"}
|