@agent-teams/docs-protocol 0.2.0 → 0.3.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 +8 -0
- package/README.md +19 -7
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts +1 -0
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts.map +1 -1
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js +4 -1
- package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js.map +1 -1
- package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.d.ts +10 -0
- package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.js +110 -0
- package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.js.map +1 -0
- package/dist/consumer-integration/adapters/github-cohort-authority-reader.d.ts +21 -0
- package/dist/consumer-integration/adapters/github-cohort-authority-reader.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/github-cohort-authority-reader.js +215 -0
- package/dist/consumer-integration/adapters/github-cohort-authority-reader.js.map +1 -0
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.d.ts.map +1 -1
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.js +17 -92
- package/dist/consumer-integration/adapters/node-consumer-integration-repository.js.map +1 -1
- package/dist/consumer-integration/adapters/node-consumer-repository-files.d.ts +11 -0
- package/dist/consumer-integration/adapters/node-consumer-repository-files.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/node-consumer-repository-files.js +81 -0
- package/dist/consumer-integration/adapters/node-consumer-repository-files.js.map +1 -0
- package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.d.ts +19 -0
- package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.d.ts.map +1 -0
- package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.js +298 -0
- package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.js.map +1 -0
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.d.ts +4 -0
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.d.ts.map +1 -1
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.js +32 -1
- package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.js.map +1 -1
- package/dist/consumer-integration/application/model/consumer-upgrade-execution.d.ts +18 -0
- package/dist/consumer-integration/application/model/consumer-upgrade-execution.d.ts.map +1 -0
- package/dist/consumer-integration/application/model/consumer-upgrade-execution.js +2 -0
- package/dist/consumer-integration/application/model/consumer-upgrade-execution.js.map +1 -0
- package/dist/consumer-integration/application/ports/consumer-upgrade.d.ts +28 -0
- package/dist/consumer-integration/application/ports/consumer-upgrade.d.ts.map +1 -0
- package/dist/consumer-integration/application/ports/consumer-upgrade.js +2 -0
- package/dist/consumer-integration/application/ports/consumer-upgrade.js.map +1 -0
- package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.d.ts +13 -0
- package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.d.ts.map +1 -0
- package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.js +134 -0
- package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.js.map +1 -0
- package/dist/consumer-integration/composition/consumer-integration-cli.d.ts.map +1 -1
- package/dist/consumer-integration/composition/consumer-integration-cli.js +50 -15
- package/dist/consumer-integration/composition/consumer-integration-cli.js.map +1 -1
- package/dist/consumer-integration/composition/node-consumer-integration.d.ts +6 -0
- package/dist/consumer-integration/composition/node-consumer-integration.d.ts.map +1 -1
- package/dist/consumer-integration/composition/node-consumer-integration.js +14 -0
- package/dist/consumer-integration/composition/node-consumer-integration.js.map +1 -1
- package/dist/consumer-integration/domain/model.d.ts +6 -0
- package/dist/consumer-integration/domain/model.d.ts.map +1 -1
- package/dist/consumer-integration/index.d.ts +3 -2
- package/dist/consumer-integration/index.d.ts.map +1 -1
- package/dist/consumer-integration/index.js +1 -1
- package/dist/consumer-integration/index.js.map +1 -1
- package/package.json +2 -1
- package/schemas/docs-consumer-upgrade-execution/v1.schema.json +44 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @agent-teams/docs-protocol
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#205](https://github.com/agent-teams-ai/engineering-foundation/pull/205) [`9a47f0d`](https://github.com/agent-teams-ai/engineering-foundation/commit/9a47f0d7d15e1b3829eb7260b54f59f267cd641d) Thanks [@777genius](https://github.com/777genius)! - Add a protected one-command Qualified Cohort upgrade that stages authority,
|
|
8
|
+
exact package pins, pnpm lockfile generation, target CLI convergence, atomic
|
|
9
|
+
publication, offline activation, and exact rollback.
|
|
10
|
+
|
|
3
11
|
## 0.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -87,11 +87,25 @@ namespace and the committed
|
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
89
|
agent-teams-docs consumer check --json
|
|
90
|
+
agent-teams-docs consumer upgrade --to docs-YYYY-MM-DD-N --json
|
|
90
91
|
agent-teams-docs consumer plan --to docs-YYYY-MM-DD-N --json
|
|
91
92
|
agent-teams-docs consumer apply --expect sha256:EXACT_PLAN_DIGEST --json
|
|
92
93
|
agent-teams-docs consumer recover --json
|
|
93
94
|
```
|
|
94
95
|
|
|
96
|
+
`upgrade` is the normal Cohort migration. It resolves current protected
|
|
97
|
+
`.github` authority, projects the Cohort and two exact package pins, generates
|
|
98
|
+
the lockfile with pnpm in a disposable Git copy, and proves the installed target
|
|
99
|
+
CLI before Foundation publishes the closed postimage set. The real activation
|
|
100
|
+
is a frozen offline install plus read-only check; a failure restores the exact
|
|
101
|
+
source files and package set.
|
|
102
|
+
|
|
103
|
+
The command requires a clean Git HEAD, an idle Foundation transaction, and a
|
|
104
|
+
source Cohort that already passes `consumer check`. It preserves consumer-owned
|
|
105
|
+
profile fields and arbitrary manifest/workspace content. `eligibleAfter` is
|
|
106
|
+
evidence, not a local wait gate. `--authority-revision` may assert freshness but
|
|
107
|
+
must equal current protected main.
|
|
108
|
+
|
|
95
109
|
`check` and `plan` are write-free and offline. `apply` recompiles the Plan,
|
|
96
110
|
requires its exact digest, and delegates all writes to Foundation's recoverable
|
|
97
111
|
known-file transaction. The integration never edits a lockfile, documentation
|
|
@@ -102,13 +116,11 @@ Other package managers and mixed lockfiles fail closed. Windows supports check
|
|
|
102
116
|
and plan; apply and recovery refuse until strict directory durability has a
|
|
103
117
|
separate qualification.
|
|
104
118
|
|
|
105
|
-
|
|
106
|
-
`
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
installed CLI for `consumer plan` and `consumer apply`. Replacing the installed
|
|
111
|
-
build while its journal is active is unsupported and must fail the upgrade.
|
|
119
|
+
If source check reports recovery, run the current build's
|
|
120
|
+
`consumer recover --json` first. Replacing the installed build while its journal
|
|
121
|
+
is active remains unsupported and fails the upgrade. The lower-level
|
|
122
|
+
`plan`/`apply` path remains available for diagnosis and managed-asset repair;
|
|
123
|
+
it is no longer a prerequisite for Cohort authority, pins, or lockfile updates.
|
|
112
124
|
|
|
113
125
|
## Consumer qualification
|
|
114
126
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function assertConsumerIntegrationProfileSchema(value: unknown): Promise<void>;
|
|
2
2
|
export declare function assertConsumerIntegrationExecutionSchema(value: unknown): Promise<void>;
|
|
3
|
+
export declare function assertConsumerUpgradeExecutionSchema(value: unknown): Promise<void>;
|
|
3
4
|
//# sourceMappingURL=consumer-integration-schema-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumer-integration-schema-validator.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/consumer-integration-schema-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consumer-integration-schema-validator.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/consumer-integration-schema-validator.ts"],"names":[],"mappings":"AAoDA,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpF;AAED,wBAAgB,wCAAwC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtF;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAElF"}
|
|
@@ -8,7 +8,7 @@ async function validator(id) {
|
|
|
8
8
|
}
|
|
9
9
|
const loading = (async () => {
|
|
10
10
|
const ajv = new Ajv2020({ allErrors: true, strict: true });
|
|
11
|
-
if (id === "docs-consumer-integration-execution") {
|
|
11
|
+
if (id === "docs-consumer-integration-execution" || id === "docs-consumer-upgrade-execution") {
|
|
12
12
|
const [plan, mutationReceipt] = await Promise.all([
|
|
13
13
|
readFile(new URL("../../../schemas/docs-consumer-integration-plan/v1.schema.json", import.meta.url), "utf8"),
|
|
14
14
|
readFile(new URL("../../../../engineering-foundation/schemas/known-file-transaction-receipt/v1.schema.json", import.meta.url), "utf8")
|
|
@@ -45,4 +45,7 @@ export function assertConsumerIntegrationProfileSchema(value) {
|
|
|
45
45
|
export function assertConsumerIntegrationExecutionSchema(value) {
|
|
46
46
|
return assertSchema("docs-consumer-integration-execution", value);
|
|
47
47
|
}
|
|
48
|
+
export function assertConsumerUpgradeExecutionSchema(value) {
|
|
49
|
+
return assertSchema("docs-consumer-upgrade-execution", value);
|
|
50
|
+
}
|
|
48
51
|
//# sourceMappingURL=consumer-integration-schema-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumer-integration-schema-validator.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/consumer-integration-schema-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAyB,MAAM,kBAAkB,CAAC;AAElE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAqC,CAAC;AAEhE,KAAK,UAAU,SAAS,CACtB,
|
|
1
|
+
{"version":3,"file":"consumer-integration-schema-validator.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/consumer-integration-schema-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAyB,MAAM,kBAAkB,CAAC;AAElE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAqC,CAAC;AAEhE,KAAK,UAAU,SAAS,CACtB,EAC4E;IAE5E,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAAA,OAAO,QAAQ,CAAC;IAAA,CAAC;IAC9C,MAAM,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;QAC1B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,IAAI,EAAE,KAAK,qCAAqC,IAAI,EAAE,KAAK,iCAAiC,EAAE,CAAC;YAC7F,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChD,QAAQ,CAAC,IAAI,GAAG,CACd,gEAAgE,EAChE,OAAO,IAAI,CAAC,GAAG,CAChB,EAAE,MAAM,CAAC;gBACV,QAAQ,CAAC,IAAI,GAAG,CACd,0FAA0F,EAC1F,OAAO,IAAI,CAAC,GAAG,CAChB,EAAE,MAAM,CAAC;aACX,CAAC,CAAC;YACH,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAW,CAAC,CAAC;YAC1C,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,C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KAAK,IAAI,IAAI,eAAe,IAAI,KAAK;QACrF,CAAC,CAAE,KAA8C,CAAC,aAAa;QAC/D,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;AAC3H,CAAC;AAED,MAAM,UAAU,wCAAwC,CAAC,KAAc;IACrE,OAAO,YAAY,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,oCAAoC,CAAC,KAAc;IACjE,OAAO,YAAY,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { QualifiedDocsCohortBindingV1 } from "../domain/model.js";
|
|
2
|
+
export declare function projectConsumerIntegrationProfileV1(input: {
|
|
3
|
+
readonly bytes: Uint8Array;
|
|
4
|
+
readonly cohort: QualifiedDocsCohortBindingV1;
|
|
5
|
+
}): Promise<Uint8Array>;
|
|
6
|
+
export declare function projectPnpmWorkspaceCohortExclusionsV1(input: {
|
|
7
|
+
readonly bytes: Uint8Array;
|
|
8
|
+
readonly cohort: QualifiedDocsCohortBindingV1;
|
|
9
|
+
}): Uint8Array;
|
|
10
|
+
//# sourceMappingURL=consumer-upgrade-file-projectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer-upgrade-file-projectors.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/consumer-upgrade-file-projectors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAmC5B,wBAAsB,mCAAmC,CAAC,KAAK,EAAE;IAC/D,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;CAC/C,GAAG,OAAO,CAAC,UAAU,CAAC,CAWtB;AA+BD,wBAAgB,sCAAsC,CAAC,KAAK,EAAE;IAC5D,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;CAC/C,GAAG,UAAU,CAwCb"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { applyEdits, modify } from "jsonc-parser";
|
|
2
|
+
import { isMap, isScalar, isSeq, parseDocument } from "yaml";
|
|
3
|
+
import { assertConsumerIntegrationProfileSchema } from "./consumer-integration-schema-validator.js";
|
|
4
|
+
import { ConsumerIntegrationNodeError } from "./consumer-integration-node-error.js";
|
|
5
|
+
import { parseJsonRecord } from "./strict-json-record.js";
|
|
6
|
+
const DOCS_PACKAGE = "@agent-teams/docs-protocol";
|
|
7
|
+
const FOUNDATION_PACKAGE = "@agent-teams/engineering-foundation";
|
|
8
|
+
function decode(bytes, subject) {
|
|
9
|
+
try {
|
|
10
|
+
const source = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
11
|
+
if (source.startsWith("\uFEFF") || source.includes("\u0000")) {
|
|
12
|
+
throw new TypeError(`${subject} contains a BOM or NUL byte.`);
|
|
13
|
+
}
|
|
14
|
+
return source;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_UPGRADE_INPUT_INVALID", `${subject} must be strict UTF-8 without a BOM or NUL bytes.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function formatting(source) {
|
|
21
|
+
const eol = source.includes("\r\n") ? "\r\n" : "\n";
|
|
22
|
+
const indent = source.match(/\n([\t ]+)"/u)?.[1] ?? " ";
|
|
23
|
+
return {
|
|
24
|
+
eol,
|
|
25
|
+
insertSpaces: !indent.includes("\t"),
|
|
26
|
+
tabSize: indent.includes("\t") ? 1 : indent.length
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export async function projectConsumerIntegrationProfileV1(input) {
|
|
30
|
+
const source = decode(input.bytes, "Consumer integration profile");
|
|
31
|
+
const profile = parseJsonRecord(source);
|
|
32
|
+
await assertConsumerIntegrationProfileSchema(profile);
|
|
33
|
+
const edits = modify(source, ["cohort"], input.cohort, {
|
|
34
|
+
formattingOptions: formatting(source)
|
|
35
|
+
});
|
|
36
|
+
if (edits.length === 0) {
|
|
37
|
+
return Buffer.from(source, "utf8");
|
|
38
|
+
}
|
|
39
|
+
const postimage = applyEdits(source, edits);
|
|
40
|
+
await assertConsumerIntegrationProfileSchema(parseJsonRecord(postimage));
|
|
41
|
+
return Buffer.from(postimage, "utf8");
|
|
42
|
+
}
|
|
43
|
+
function managedPackageName(value) {
|
|
44
|
+
if (value === DOCS_PACKAGE || value.startsWith(`${DOCS_PACKAGE}@`)) {
|
|
45
|
+
return DOCS_PACKAGE;
|
|
46
|
+
}
|
|
47
|
+
if (value === FOUNDATION_PACKAGE || value.startsWith(`${FOUNDATION_PACKAGE}@`)) {
|
|
48
|
+
return FOUNDATION_PACKAGE;
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
function exactExclusions(cohort) {
|
|
53
|
+
return new Map([
|
|
54
|
+
[FOUNDATION_PACKAGE, `${FOUNDATION_PACKAGE}@${cohort.packages.engineeringFoundation.version}`],
|
|
55
|
+
[DOCS_PACKAGE, `${DOCS_PACKAGE}@${cohort.packages.docsProtocol.version}`]
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
function scalarItems(sequence) {
|
|
59
|
+
const items = [];
|
|
60
|
+
for (const item of sequence.items) {
|
|
61
|
+
if (!isScalar(item) || typeof item.value !== "string") {
|
|
62
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_WORKSPACE_INVALID", "pnpm minimumReleaseAgeExclude entries must be strings.");
|
|
63
|
+
}
|
|
64
|
+
items.push(item);
|
|
65
|
+
}
|
|
66
|
+
return items;
|
|
67
|
+
}
|
|
68
|
+
export function projectPnpmWorkspaceCohortExclusionsV1(input) {
|
|
69
|
+
const source = decode(input.bytes, "pnpm-workspace.yaml");
|
|
70
|
+
const document = parseDocument(source, { uniqueKeys: true });
|
|
71
|
+
if (document.errors.length > 0 || !isMap(document.contents)) {
|
|
72
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_WORKSPACE_INVALID", "pnpm-workspace.yaml must be one duplicate-free YAML mapping.");
|
|
73
|
+
}
|
|
74
|
+
const current = document.get("minimumReleaseAgeExclude", true);
|
|
75
|
+
const hasAgePolicy = document.has("minimumReleaseAge") ||
|
|
76
|
+
document.get("minimumReleaseAgeStrict") === true;
|
|
77
|
+
if (current === undefined && !hasAgePolicy) {
|
|
78
|
+
return Buffer.from(source, "utf8");
|
|
79
|
+
}
|
|
80
|
+
if (current !== undefined && !isSeq(current)) {
|
|
81
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_WORKSPACE_INVALID", "pnpm minimumReleaseAgeExclude must be one sequence.");
|
|
82
|
+
}
|
|
83
|
+
const sequence = current ?? document.createNode([]);
|
|
84
|
+
if (!isSeq(sequence)) {
|
|
85
|
+
throw new Error("unreachable");
|
|
86
|
+
}
|
|
87
|
+
if (current === undefined) {
|
|
88
|
+
document.set("minimumReleaseAgeExclude", sequence);
|
|
89
|
+
}
|
|
90
|
+
const expected = exactExclusions(input.cohort);
|
|
91
|
+
const seen = new Set();
|
|
92
|
+
for (const item of scalarItems(sequence)) {
|
|
93
|
+
const packageName = managedPackageName(item.value);
|
|
94
|
+
if (packageName === undefined) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (seen.has(packageName)) {
|
|
98
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_WORKSPACE_INVALID", `pnpm minimumReleaseAgeExclude contains duplicate ${packageName} authority.`);
|
|
99
|
+
}
|
|
100
|
+
seen.add(packageName);
|
|
101
|
+
item.value = expected.get(packageName);
|
|
102
|
+
}
|
|
103
|
+
for (const packageName of [FOUNDATION_PACKAGE, DOCS_PACKAGE]) {
|
|
104
|
+
if (!seen.has(packageName)) {
|
|
105
|
+
sequence.add(expected.get(packageName));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return Buffer.from(String(document), "utf8");
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=consumer-upgrade-file-projectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer-upgrade-file-projectors.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/consumer-upgrade-file-projectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAA6B,MAAM,MAAM,CAAC;AAKxF,OAAO,EACL,sCAAsC,EACvC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,YAAY,GAAG,4BAA4B,CAAC;AAClD,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AAEjE,SAAS,MAAM,CAAC,KAAiB,EAAE,OAAe;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7D,MAAM,IAAI,SAAS,CAAC,GAAG,OAAO,8BAA8B,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,4BAA4B,CACpC,qCAAqC,EACrC,GAAG,OAAO,mDAAmD,CAC9D,CAAC;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G,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAAA,SAAS;QAAA,CAAC;QAC1C,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,4BAA4B,CACpC,iCAAiC,EACjC,oDAAoD,WAAW,aAAa,CAC7E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC;IAC1C,CAAC;IACD,KAAK,MAAM,WAAW,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAE,CAAC;QAC7D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAAA,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC,CAAC;QAAA,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ConsumerUpgradeAuthorityReader } from "../application/ports/consumer-upgrade.js";
|
|
2
|
+
import type { ConsumerIntegrationDesiredStateV1, ConsumerUpgradeAuthorityV1 } from "../domain/model.js";
|
|
3
|
+
type AuthorityFetch = (input: string | URL | globalThis.Request, init?: RequestInit) => Promise<Response>;
|
|
4
|
+
export declare function projectQualifiedCohortAuthority(input: {
|
|
5
|
+
readonly cohortId: string;
|
|
6
|
+
readonly registry: Record<string, unknown>;
|
|
7
|
+
readonly repository: ConsumerIntegrationDesiredStateV1["repository"];
|
|
8
|
+
readonly revision: string;
|
|
9
|
+
}): ConsumerUpgradeAuthorityV1;
|
|
10
|
+
export declare class GitHubCohortAuthorityReader implements ConsumerUpgradeAuthorityReader {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(fetcher?: AuthorityFetch);
|
|
13
|
+
read(options: {
|
|
14
|
+
readonly cohortId: string;
|
|
15
|
+
readonly repository: ConsumerIntegrationDesiredStateV1["repository"];
|
|
16
|
+
readonly revision?: string;
|
|
17
|
+
}): Promise<ConsumerUpgradeAuthorityV1>;
|
|
18
|
+
}
|
|
19
|
+
export declare const githubCohortAuthorityReader: ConsumerUpgradeAuthorityReader;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=github-cohort-authority-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-cohort-authority-reader.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/github-cohort-authority-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC/B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,iCAAiC,EACjC,0BAA0B,EAE3B,MAAM,oBAAoB,CAAC;AAkB5B,KAAK,cAAc,GAAG,CACpB,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,UAAU,CAAC,OAAO,EACxC,IAAI,CAAC,EAAE,WAAW,KACf,OAAO,CAAC,QAAQ,CAAC,CAAC;AA+OvB,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,iCAAiC,CAAC,YAAY,CAAC,CAAC;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,GAAG,0BAA0B,CAsB7B;AAED,qBAAa,2BAA4B,YAAW,8BAA8B;;IAGhF,YAAmB,OAAO,GAAE,cAAiC,EAE5D;IAEY,IAAI,CAAC,OAAO,EAAE;QACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,UAAU,EAAE,iCAAiC,CAAC,YAAY,CAAC,CAAC;QACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAgBtC;CACF;AAED,eAAO,MAAM,2BAA2B,EAAE,8BACQ,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { assertQualifiedDocsCohortBindingV1 } from "../application/policies/consumer-integration-desired-state.js";
|
|
2
|
+
import { ConsumerIntegrationNodeError } from "./consumer-integration-node-error.js";
|
|
3
|
+
import { parseJsonRecord } from "./strict-json-record.js";
|
|
4
|
+
const AUTHORITY_REPOSITORY = "agent-teams-ai/.github";
|
|
5
|
+
const AUTHORITY_PATH = "governance/docs-qualified-cohorts.json";
|
|
6
|
+
const AUTHORITY_API = `https://api.github.com/repos/${AUTHORITY_REPOSITORY}`;
|
|
7
|
+
const AUTHORITY_RAW = `https://raw.githubusercontent.com/${AUTHORITY_REPOSITORY}`;
|
|
8
|
+
const GIT_SHA = /^(?!0{40}$)[0-9a-f]{40}$/u;
|
|
9
|
+
const MAXIMUM_AUTHORITY_BYTES = 8 * 1024 * 1024;
|
|
10
|
+
const MANAGED_PACKAGES = [
|
|
11
|
+
"@agent-teams/docs-protocol",
|
|
12
|
+
"@agent-teams/engineering-foundation"
|
|
13
|
+
];
|
|
14
|
+
function record(value, subject) {
|
|
15
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) ||
|
|
16
|
+
Object.getPrototypeOf(value) !== Object.prototype) {
|
|
17
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${subject} must be one plain object.`);
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
function array(value, subject) {
|
|
22
|
+
if (!Array.isArray(value) || value.length > 4096) {
|
|
23
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${subject} must be one bounded array.`);
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function string(value, subject) {
|
|
28
|
+
if (typeof value !== "string" || value.length === 0 || value.length > 4096 ||
|
|
29
|
+
value.includes("\u0000")) {
|
|
30
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${subject} must be one bounded string.`);
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
async function responseBytes(response, subject) {
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_UNAVAILABLE", `${subject} returned HTTP ${response.status}.`);
|
|
37
|
+
}
|
|
38
|
+
const declared = Number(response.headers.get("content-length") ?? "0");
|
|
39
|
+
if (Number.isFinite(declared) && declared > MAXIMUM_AUTHORITY_BYTES) {
|
|
40
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${subject} exceeds the authority size limit.`);
|
|
41
|
+
}
|
|
42
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
43
|
+
if (bytes.byteLength === 0 || bytes.byteLength > MAXIMUM_AUTHORITY_BYTES) {
|
|
44
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${subject} has invalid or overlong bytes.`);
|
|
45
|
+
}
|
|
46
|
+
return bytes;
|
|
47
|
+
}
|
|
48
|
+
function timeoutSignal() {
|
|
49
|
+
return AbortSignal.timeout(20_000);
|
|
50
|
+
}
|
|
51
|
+
async function resolveAuthorityRevision(fetcher) {
|
|
52
|
+
const bytes = await responseBytes(await fetcher(`${AUTHORITY_API}/commits/main`, {
|
|
53
|
+
headers: { Accept: "application/vnd.github+json", "User-Agent": "agent-teams-docs" },
|
|
54
|
+
redirect: "error",
|
|
55
|
+
signal: timeoutSignal()
|
|
56
|
+
}), "Central authority revision");
|
|
57
|
+
const response = parseJsonRecord(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
58
|
+
const revision = response["sha"];
|
|
59
|
+
if (typeof revision !== "string" || !GIT_SHA.test(revision)) {
|
|
60
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", "Central authority did not resolve one exact Git revision.");
|
|
61
|
+
}
|
|
62
|
+
return revision;
|
|
63
|
+
}
|
|
64
|
+
async function readAuthorityRegistry(fetcher, revision) {
|
|
65
|
+
const bytes = await responseBytes(await fetcher(`${AUTHORITY_RAW}/${revision}/${AUTHORITY_PATH}`, {
|
|
66
|
+
headers: { Accept: "application/json", "User-Agent": "agent-teams-docs" },
|
|
67
|
+
redirect: "error",
|
|
68
|
+
signal: timeoutSignal()
|
|
69
|
+
}), "Central Cohort registry");
|
|
70
|
+
try {
|
|
71
|
+
return parseJsonRecord(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", "Central Cohort registry is not strict duplicate-free UTF-8 JSON.", { cause: error });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function selectedLifecycleState(events, cohortId) {
|
|
78
|
+
const selected = events.map((value) => record(value, "Cohort lifecycle event"))
|
|
79
|
+
.filter((event) => event["cohort_id"] === cohortId)
|
|
80
|
+
.map((event) => {
|
|
81
|
+
const sequence = event["sequence"];
|
|
82
|
+
if (!Number.isSafeInteger(sequence) || Number(sequence) < 1) {
|
|
83
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${cohortId} has an invalid lifecycle sequence.`);
|
|
84
|
+
}
|
|
85
|
+
return { event, sequence: Number(sequence) };
|
|
86
|
+
})
|
|
87
|
+
.toSorted((left, right) => left.sequence - right.sequence);
|
|
88
|
+
if (new Set(selected.map(({ sequence }) => sequence)).size !== selected.length) {
|
|
89
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${cohortId} has duplicate lifecycle sequences.`);
|
|
90
|
+
}
|
|
91
|
+
const qualification = selected.filter(({ event }) => event["state"] === "QUALIFIED");
|
|
92
|
+
const last = selected.at(-1);
|
|
93
|
+
if (qualification.length !== 1 || last === undefined) {
|
|
94
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", `${cohortId} does not have one immutable QUALIFIED lifecycle event.`);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
qualificationEventDigest: string(qualification[0].event["event_digest"], "QUALIFIED event digest"),
|
|
98
|
+
state: string(last.event["state"], "Current Cohort lifecycle state")
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function assertSelectable(source, state, repository) {
|
|
102
|
+
if (state === "RECOMMENDED") {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const canaries = array(source["canary_repositories"], "Cohort canary repositories")
|
|
106
|
+
.map((entry) => record(entry, "Cohort canary repository"));
|
|
107
|
+
if (["QUALIFIED", "CANARY"].includes(state) && canaries.some((entry) => String(entry["repository_id"]) === repository.id)) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_NOT_SELECTABLE", `${String(source["cohort_id"])} is ${state} and is not selectable for repository ${repository.id}.`);
|
|
111
|
+
}
|
|
112
|
+
function packageProjection(source) {
|
|
113
|
+
const entries = array(source["packages"], "Cohort packages")
|
|
114
|
+
.map((value) => record(value, "Cohort package"));
|
|
115
|
+
const packageByName = new Map(entries.map((entry) => [entry["name"], entry]));
|
|
116
|
+
if (entries.length !== MANAGED_PACKAGES.length ||
|
|
117
|
+
packageByName.size !== MANAGED_PACKAGES.length ||
|
|
118
|
+
MANAGED_PACKAGES.some((name) => !packageByName.has(name))) {
|
|
119
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_INVALID", "Qualified Cohort must select exactly the two managed packages.");
|
|
120
|
+
}
|
|
121
|
+
const docs = packageByName.get(MANAGED_PACKAGES[0]);
|
|
122
|
+
const foundation = packageByName.get(MANAGED_PACKAGES[1]);
|
|
123
|
+
return {
|
|
124
|
+
docsProtocol: {
|
|
125
|
+
version: string(docs["version"], "Docs Protocol version"),
|
|
126
|
+
integrity: string(docs["integrity"], "Docs Protocol integrity")
|
|
127
|
+
},
|
|
128
|
+
engineeringFoundation: {
|
|
129
|
+
version: string(foundation["version"], "Foundation version"),
|
|
130
|
+
integrity: string(foundation["integrity"], "Foundation integrity")
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function cohortProjection(source, qualificationEventDigest) {
|
|
135
|
+
const workflow = record(source["reusable_workflow"], "Cohort reusable workflow");
|
|
136
|
+
const assets = record(source["assets"], "Cohort assets");
|
|
137
|
+
const skill = record(assets["skill"], "Cohort Skill asset");
|
|
138
|
+
const caller = record(assets["caller_workflow"], "Cohort caller workflow asset");
|
|
139
|
+
const assetCatalog = record(assets["asset_catalog"], "Cohort asset catalog");
|
|
140
|
+
const transitionCatalog = record(assets["transition_catalog"], "Cohort transition catalog");
|
|
141
|
+
const runtime = record(source["runtime"], "Cohort runtime");
|
|
142
|
+
const runtimeClosure = record(source["runtime_closure"], "Cohort runtime closure");
|
|
143
|
+
const schemas = record(source["schemas"], "Cohort schemas");
|
|
144
|
+
const projection = {
|
|
145
|
+
schemaVersion: 1,
|
|
146
|
+
cohortId: string(source["cohort_id"], "Cohort ID"),
|
|
147
|
+
channel: string(source["channel"], "Cohort channel"),
|
|
148
|
+
recordDigest: string(source["record_digest"], "Cohort record digest"),
|
|
149
|
+
qualificationEventDigest,
|
|
150
|
+
eligibleAfter: string(source["eligible_after"], "Cohort eligibility timestamp"),
|
|
151
|
+
upgradeFrom: array(source["upgrade_from"], "Cohort upgrade origins").map((entry) => string(entry, "Cohort upgrade origin")),
|
|
152
|
+
rollbackTo: array(source["rollback_to"], "Cohort rollback targets").map((entry) => string(entry, "Cohort rollback target")),
|
|
153
|
+
packages: packageProjection(source),
|
|
154
|
+
workflow: {
|
|
155
|
+
repository: string(workflow["repository"], "Workflow repository"),
|
|
156
|
+
path: string(workflow["path"], "Workflow path"),
|
|
157
|
+
revision: string(workflow["revision"], "Workflow revision"),
|
|
158
|
+
blobSha: string(workflow["blob_sha"], "Workflow blob SHA")
|
|
159
|
+
},
|
|
160
|
+
assets: {
|
|
161
|
+
skillDigest: string(skill["digest"], "Skill digest"),
|
|
162
|
+
callerWorkflowDigest: string(caller["rendered_digest"], "Caller workflow digest"),
|
|
163
|
+
assetCatalogDigest: string(assetCatalog["digest"], "Asset catalog digest"),
|
|
164
|
+
transitionCatalogDigest: string(transitionCatalog["digest"], "Transition catalog digest")
|
|
165
|
+
},
|
|
166
|
+
schemas: {
|
|
167
|
+
consumerIntegration: schemas["consumer_integration"],
|
|
168
|
+
managedState: schemas["managed_state"],
|
|
169
|
+
docsProtocol: schemas["docs_protocol"]
|
|
170
|
+
},
|
|
171
|
+
runtime: {
|
|
172
|
+
node: string(runtime["node"], "Node runtime"),
|
|
173
|
+
pnpm: string(runtime["pnpm"], "pnpm runtime"),
|
|
174
|
+
runtimeClosureDigest: string(runtimeClosure["digest"], "Runtime closure digest")
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
assertQualifiedDocsCohortBindingV1(projection);
|
|
178
|
+
return Object.freeze(projection);
|
|
179
|
+
}
|
|
180
|
+
export function projectQualifiedCohortAuthority(input) {
|
|
181
|
+
const matches = array(input.registry["cohorts"], "Qualified Cohorts")
|
|
182
|
+
.map((value) => record(value, "Qualified Cohort"))
|
|
183
|
+
.filter((cohort) => cohort["cohort_id"] === input.cohortId);
|
|
184
|
+
if (matches.length !== 1) {
|
|
185
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_UNKNOWN", `${input.cohortId} is not one exact central Cohort.`);
|
|
186
|
+
}
|
|
187
|
+
const source = matches[0];
|
|
188
|
+
const lifecycle = selectedLifecycleState(array(input.registry["events"], "Cohort lifecycle events"), input.cohortId);
|
|
189
|
+
assertSelectable(source, lifecycle.state, input.repository);
|
|
190
|
+
return Object.freeze({
|
|
191
|
+
repository: AUTHORITY_REPOSITORY,
|
|
192
|
+
path: AUTHORITY_PATH,
|
|
193
|
+
revision: input.revision,
|
|
194
|
+
cohort: cohortProjection(source, lifecycle.qualificationEventDigest)
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
export class GitHubCohortAuthorityReader {
|
|
198
|
+
#fetcher;
|
|
199
|
+
constructor(fetcher = globalThis.fetch) {
|
|
200
|
+
this.#fetcher = fetcher;
|
|
201
|
+
}
|
|
202
|
+
async read(options) {
|
|
203
|
+
if (options.revision !== undefined && !GIT_SHA.test(options.revision)) {
|
|
204
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_REVISION_INVALID", "Authority revision must be one nonzero lowercase Git SHA.");
|
|
205
|
+
}
|
|
206
|
+
const revision = await resolveAuthorityRevision(this.#fetcher);
|
|
207
|
+
if (options.revision !== undefined && options.revision !== revision) {
|
|
208
|
+
throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_AUTHORITY_REVISION_STALE", "Requested authority revision is not the current protected main revision.");
|
|
209
|
+
}
|
|
210
|
+
const registry = await readAuthorityRegistry(this.#fetcher, revision);
|
|
211
|
+
return projectQualifiedCohortAuthority({ ...options, registry, revision });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export const githubCohortAuthorityReader = Object.freeze(new GitHubCohortAuthorityReader());
|
|
215
|
+
//# sourceMappingURL=github-cohort-authority-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-cohort-authority-reader.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/github-cohort-authority-reader.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,kCAAkC,EACnC,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE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,CAAiB;IAElC,YAAmB,OAAO,GAAmB,UAAU,CAAC,KAAK;QAC3D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAIjB;QACC,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtE,MAAM,IAAI,4BAA4B,CACpC,0CAA0C,EAC1C,2DAA2D,CAC5D,CAAC;QACJ,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACpE,MAAM,IAAI,4BAA4B,CACpC,wCAAwC,EACxC,0EAA0E,CAC3E,CAAC;QACJ,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACtE,OAAO,+BAA+B,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAED,MAAM,CAAC,MAAM,2BAA2B,GACtC,MAAM,CAAC,MAAM,CAAC,IAAI,2BAA2B,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-consumer-integration-repository.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/node-consumer-integration-repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-consumer-integration-repository.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/node-consumer-integration-repository.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iCAAiC,EAEjC,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,8BAA8B,EAC/B,MAAM,wDAAwD,CAAC;AAiChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AA4MpF,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAC1C,GAAG,OAAO,CAAC;IACV,QAAQ,CAAC,OAAO,EAAE,iCAAiC,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;CAChD,CAAC,CAsED;AAED,eAAO,MAAM,kCAAkC,EAAE,8BACM,CAAC"}
|