putitoutthere 0.0.1
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/README.md +10 -0
- package/action.yml +24 -0
- package/dist/action.d.ts +9 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/action.js +19 -0
- package/dist/action.js.map +1 -0
- package/dist/cascade.d.ts +30 -0
- package/dist/cascade.d.ts.map +1 -0
- package/dist/cascade.js +92 -0
- package/dist/cascade.js.map +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +57 -0
- package/dist/cli.js.map +1 -0
- package/dist/completeness.d.ts +34 -0
- package/dist/completeness.d.ts.map +1 -0
- package/dist/completeness.js +121 -0
- package/dist/completeness.js.map +1 -0
- package/dist/config.d.ts +132 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -0
- package/dist/git.d.ts +35 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +98 -0
- package/dist/git.js.map +1 -0
- package/dist/glob.d.ts +15 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +29 -0
- package/dist/glob.js.map +1 -0
- package/dist/handlers/crates.d.ts +8 -0
- package/dist/handlers/crates.d.ts.map +1 -0
- package/dist/handlers/crates.js +19 -0
- package/dist/handlers/crates.js.map +1 -0
- package/dist/handlers/index.d.ts +7 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +22 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/npm.d.ts +7 -0
- package/dist/handlers/npm.d.ts.map +1 -0
- package/dist/handlers/npm.js +18 -0
- package/dist/handlers/npm.js.map +1 -0
- package/dist/handlers/pypi.d.ts +6 -0
- package/dist/handlers/pypi.d.ts.map +1 -0
- package/dist/handlers/pypi.js +17 -0
- package/dist/handlers/pypi.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/log.d.ts +31 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +81 -0
- package/dist/log.js.map +1 -0
- package/dist/preflight.d.ts +30 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +55 -0
- package/dist/preflight.js.map +1 -0
- package/dist/retry.d.ts +26 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +91 -0
- package/dist/retry.js.map +1 -0
- package/dist/trailer.d.ts +26 -0
- package/dist/trailer.d.ts.map +1 -0
- package/dist/trailer.js +84 -0
- package/dist/trailer.js.map +1 -0
- package/dist/types.d.ts +73 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/dist/verbose.d.ts +47 -0
- package/dist/verbose.d.ts.map +1 -0
- package/dist/verbose.js +84 -0
- package/dist/verbose.js.map +1 -0
- package/dist/version.d.ts +27 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +51 -0
- package/dist/version.js.map +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Put It Out There
|
|
2
|
+
|
|
3
|
+
Polyglot release orchestrator for single-maintainer, LLM-authored projects
|
|
4
|
+
that publish to crates.io, PyPI, and npm from one monorepo.
|
|
5
|
+
|
|
6
|
+
> **Status.** v0 implementation in progress. See the [v0 epic](https://github.com/thekevinscott/put-it-out-there/issues/2) for the full work breakdown.
|
|
7
|
+
|
|
8
|
+
User-facing README (installation, quickstart, worked example) lands in
|
|
9
|
+
[#32](https://github.com/thekevinscott/put-it-out-there/issues/32) once
|
|
10
|
+
the CLI is functional.
|
package/action.yml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: 'Put It Out There'
|
|
2
|
+
description: 'Polyglot release orchestrator for crates.io, PyPI, and npm.'
|
|
3
|
+
author: 'Kevin Scott'
|
|
4
|
+
|
|
5
|
+
inputs:
|
|
6
|
+
command:
|
|
7
|
+
description: 'Which putitoutthere command to run: plan | publish'
|
|
8
|
+
required: true
|
|
9
|
+
dry_run:
|
|
10
|
+
description: 'If true, resolve the plan but skip all destructive operations.'
|
|
11
|
+
required: false
|
|
12
|
+
default: 'false'
|
|
13
|
+
fail_on_error:
|
|
14
|
+
description: 'If true, non-zero putitoutthere exit codes fail the step.'
|
|
15
|
+
required: false
|
|
16
|
+
default: 'true'
|
|
17
|
+
|
|
18
|
+
outputs:
|
|
19
|
+
matrix:
|
|
20
|
+
description: 'JSON matrix emitted by `putitoutthere plan`. Empty string for other commands.'
|
|
21
|
+
|
|
22
|
+
runs:
|
|
23
|
+
using: 'node20'
|
|
24
|
+
main: 'dist-action/index.js'
|
package/dist/action.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Actions wrapper. Bundled to `dist-action/index.js` via ncc.
|
|
3
|
+
*
|
|
4
|
+
* Implementation lands in #24. Scaffold here exits cleanly with a
|
|
5
|
+
* not-yet-implemented marker so `action.yml` resolves during early
|
|
6
|
+
* integration work.
|
|
7
|
+
*/
|
|
8
|
+
export declare function main(): void;
|
|
9
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,IAAI,IAAI,IAAI,CAQ3B"}
|
package/dist/action.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Actions wrapper. Bundled to `dist-action/index.js` via ncc.
|
|
3
|
+
*
|
|
4
|
+
* Implementation lands in #24. Scaffold here exits cleanly with a
|
|
5
|
+
* not-yet-implemented marker so `action.yml` resolves during early
|
|
6
|
+
* integration work.
|
|
7
|
+
*/
|
|
8
|
+
export function main() {
|
|
9
|
+
const command = process.env.INPUT_COMMAND ?? '';
|
|
10
|
+
process.stderr.write(`put-it-out-there@v0 action: command='${command}' — scaffold only; see #24 for the real wrapper.\n`);
|
|
11
|
+
// GHA outputs are appended to $GITHUB_OUTPUT when the CLI supports it;
|
|
12
|
+
// scaffold emits nothing. The action is inert until #24 lands.
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
/* v8 ignore next 3 -- entry-point guard; only reachable when invoked as a binary */
|
|
16
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
17
|
+
main();
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,IAAI;IAClB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;IAChD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,wCAAwC,OAAO,oDAAoD,CACpG,CAAC;IACF,uEAAuE;IACvE,+DAA+D;IAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,oFAAoF;AACpF,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,IAAI,EAAE,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cascade algorithm. Given a package list and the files changed since
|
|
3
|
+
* the last release, returns the packages that will release.
|
|
4
|
+
*
|
|
5
|
+
* Two passes (plan.md §11.1):
|
|
6
|
+
* 1. Direct match: every package whose `paths` globs intersect
|
|
7
|
+
* changedFiles is cascaded.
|
|
8
|
+
* 2. Transitive match: repeat until stable — any package whose
|
|
9
|
+
* `depends_on` list contains an already-cascaded package gets
|
|
10
|
+
* added.
|
|
11
|
+
*
|
|
12
|
+
* Cycle detection per §11.3: cycles in depends_on are a config error
|
|
13
|
+
* and throw loudly before cascade runs. Dangling depends_on names also
|
|
14
|
+
* throw.
|
|
15
|
+
*
|
|
16
|
+
* Output preserves the input order so downstream matrix emission is
|
|
17
|
+
* deterministic.
|
|
18
|
+
*
|
|
19
|
+
* Issue #7.
|
|
20
|
+
*/
|
|
21
|
+
import type { Package } from './config.js';
|
|
22
|
+
export declare function computeCascade(packages: readonly Package[], changedFiles: readonly string[]): Package[];
|
|
23
|
+
/**
|
|
24
|
+
* Reject cycles and dangling depends_on refs. Runs a DFS from each
|
|
25
|
+
* node with a recursion-stack (gray) set to flag back-edges. Dangling
|
|
26
|
+
* refs are caught during traversal when the target is missing from
|
|
27
|
+
* the name map.
|
|
28
|
+
*/
|
|
29
|
+
export declare function assertNoCycles(packages: readonly Package[]): void;
|
|
30
|
+
//# sourceMappingURL=cascade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascade.d.ts","sourceRoot":"","sources":["../src/cascade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,OAAO,EAAE,CA8BX;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAoCjE"}
|
package/dist/cascade.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cascade algorithm. Given a package list and the files changed since
|
|
3
|
+
* the last release, returns the packages that will release.
|
|
4
|
+
*
|
|
5
|
+
* Two passes (plan.md §11.1):
|
|
6
|
+
* 1. Direct match: every package whose `paths` globs intersect
|
|
7
|
+
* changedFiles is cascaded.
|
|
8
|
+
* 2. Transitive match: repeat until stable — any package whose
|
|
9
|
+
* `depends_on` list contains an already-cascaded package gets
|
|
10
|
+
* added.
|
|
11
|
+
*
|
|
12
|
+
* Cycle detection per §11.3: cycles in depends_on are a config error
|
|
13
|
+
* and throw loudly before cascade runs. Dangling depends_on names also
|
|
14
|
+
* throw.
|
|
15
|
+
*
|
|
16
|
+
* Output preserves the input order so downstream matrix emission is
|
|
17
|
+
* deterministic.
|
|
18
|
+
*
|
|
19
|
+
* Issue #7.
|
|
20
|
+
*/
|
|
21
|
+
import { matchesAny } from './glob.js';
|
|
22
|
+
export function computeCascade(packages, changedFiles) {
|
|
23
|
+
assertNoCycles(packages);
|
|
24
|
+
const byName = new Map();
|
|
25
|
+
for (const p of packages)
|
|
26
|
+
byName.set(p.name, p);
|
|
27
|
+
// Pass 1: direct glob matches.
|
|
28
|
+
const cascaded = new Set();
|
|
29
|
+
for (const p of packages) {
|
|
30
|
+
if (changedFiles.some((f) => matchesAny(p.paths, f))) {
|
|
31
|
+
cascaded.add(p.name);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Pass 2: transitive via depends_on, iterate to stability.
|
|
35
|
+
let changed = true;
|
|
36
|
+
while (changed) {
|
|
37
|
+
changed = false;
|
|
38
|
+
for (const p of packages) {
|
|
39
|
+
if (cascaded.has(p.name))
|
|
40
|
+
continue;
|
|
41
|
+
const deps = p.depends_on ?? [];
|
|
42
|
+
if (deps.some((d) => cascaded.has(d))) {
|
|
43
|
+
cascaded.add(p.name);
|
|
44
|
+
changed = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Preserve input order.
|
|
49
|
+
return packages.filter((p) => cascaded.has(p.name));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Reject cycles and dangling depends_on refs. Runs a DFS from each
|
|
53
|
+
* node with a recursion-stack (gray) set to flag back-edges. Dangling
|
|
54
|
+
* refs are caught during traversal when the target is missing from
|
|
55
|
+
* the name map.
|
|
56
|
+
*/
|
|
57
|
+
export function assertNoCycles(packages) {
|
|
58
|
+
const byName = new Map();
|
|
59
|
+
for (const p of packages)
|
|
60
|
+
byName.set(p.name, p);
|
|
61
|
+
const color = new Map();
|
|
62
|
+
for (const p of packages)
|
|
63
|
+
color.set(p.name, 'white');
|
|
64
|
+
const visit = (name, path) => {
|
|
65
|
+
const c = color.get(name);
|
|
66
|
+
if (c === 'black')
|
|
67
|
+
return;
|
|
68
|
+
if (c === 'gray') {
|
|
69
|
+
const cycle = [...path.slice(path.indexOf(name)), name].join(' → ');
|
|
70
|
+
throw new Error(`putitoutthere.toml: depends_on cycle: ${cycle}`);
|
|
71
|
+
}
|
|
72
|
+
color.set(name, 'gray');
|
|
73
|
+
const node = byName.get(name);
|
|
74
|
+
// `byName.get` is only undefined here when `visit` was entered with
|
|
75
|
+
// a name we iterated over packages for — that list IS the keys of
|
|
76
|
+
// byName, so this branch is unreachable under normal use. Defensive.
|
|
77
|
+
/* v8 ignore next */
|
|
78
|
+
if (!node)
|
|
79
|
+
return;
|
|
80
|
+
for (const dep of node.depends_on ?? []) {
|
|
81
|
+
if (!byName.has(dep)) {
|
|
82
|
+
throw new Error(`putitoutthere.toml: package "${name}" has unknown depends_on: "${dep}"`);
|
|
83
|
+
}
|
|
84
|
+
visit(dep, [...path, name]);
|
|
85
|
+
}
|
|
86
|
+
color.set(name, 'black');
|
|
87
|
+
};
|
|
88
|
+
for (const p of packages) {
|
|
89
|
+
visit(p.name, []);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=cascade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascade.js","sourceRoot":"","sources":["../src/cascade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,UAAU,cAAc,CAC5B,QAA4B,EAC5B,YAA+B;IAE/B,cAAc,CAAC,QAAQ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AAC;YACD,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `putitoutthere` CLI entry. Thin wrapper around the SDK.
|
|
4
|
+
*
|
|
5
|
+
* Command implementations land in #20 (init), #21 (plan), #22 (publish),
|
|
6
|
+
* #23 (doctor). This scaffold just parses the command name and prints a
|
|
7
|
+
* not-yet-implemented message, so the binary is installable today.
|
|
8
|
+
*/
|
|
9
|
+
export declare function run(argv: readonly string[]): Promise<number>;
|
|
10
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AA2BH,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAmB5D"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `putitoutthere` CLI entry. Thin wrapper around the SDK.
|
|
4
|
+
*
|
|
5
|
+
* Command implementations land in #20 (init), #21 (plan), #22 (publish),
|
|
6
|
+
* #23 (doctor). This scaffold just parses the command name and prints a
|
|
7
|
+
* not-yet-implemented message, so the binary is installable today.
|
|
8
|
+
*/
|
|
9
|
+
const COMMANDS = ['init', 'plan', 'publish', 'doctor', 'version'];
|
|
10
|
+
function isCommand(value) {
|
|
11
|
+
return COMMANDS.includes(value);
|
|
12
|
+
}
|
|
13
|
+
function printUsage() {
|
|
14
|
+
process.stderr.write([
|
|
15
|
+
'Usage: putitoutthere <command> [options]',
|
|
16
|
+
'',
|
|
17
|
+
'Commands:',
|
|
18
|
+
' init Scaffold putitoutthere.toml + workflows + AGENTS.md (#20)',
|
|
19
|
+
' plan Compute and emit the release plan (#21)',
|
|
20
|
+
' publish Execute the plan (#22)',
|
|
21
|
+
' doctor Validate config + handlers + auth (#23)',
|
|
22
|
+
' version Print CLI version',
|
|
23
|
+
'',
|
|
24
|
+
'See https://github.com/thekevinscott/put-it-out-there for docs.',
|
|
25
|
+
'',
|
|
26
|
+
].join('\n'));
|
|
27
|
+
}
|
|
28
|
+
export function run(argv) {
|
|
29
|
+
const [, , cmd, ..._rest] = argv;
|
|
30
|
+
if (cmd === undefined || cmd === '-h' || cmd === '--help') {
|
|
31
|
+
printUsage();
|
|
32
|
+
return Promise.resolve(cmd === undefined ? 1 : 0);
|
|
33
|
+
}
|
|
34
|
+
if (cmd === 'version' || cmd === '--version' || cmd === '-v') {
|
|
35
|
+
process.stdout.write('putitoutthere 0.0.0 (pre-release scaffold)\n');
|
|
36
|
+
return Promise.resolve(0);
|
|
37
|
+
}
|
|
38
|
+
if (!isCommand(cmd)) {
|
|
39
|
+
process.stderr.write(`putitoutthere: unknown command: ${cmd}\n`);
|
|
40
|
+
printUsage();
|
|
41
|
+
return Promise.resolve(1);
|
|
42
|
+
}
|
|
43
|
+
process.stderr.write(`putitoutthere: '${cmd}' is not implemented yet in this scaffold. See the v0 epic: https://github.com/thekevinscott/put-it-out-there/issues/2\n`);
|
|
44
|
+
return Promise.resolve(2);
|
|
45
|
+
}
|
|
46
|
+
// Entry point when invoked as `putitoutthere` or `node dist/cli.js`.
|
|
47
|
+
/* v8 ignore start -- entry-point guard; only reachable when invoked as a binary */
|
|
48
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
49
|
+
run(process.argv).then((code) => {
|
|
50
|
+
process.exit(code);
|
|
51
|
+
}, (err) => {
|
|
52
|
+
process.stderr.write(`putitoutthere: fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
53
|
+
process.exit(4);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/* v8 ignore stop */
|
|
57
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAG3E,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAQ,QAA8B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,UAAU;IACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB;QACE,0CAA0C;QAC1C,EAAE;QACF,WAAW;QACX,wEAAwE;QACxE,sDAAsD;QACtD,qCAAqC;QACrC,sDAAsD;QACtD,gCAAgC;QAChC,EAAE;QACF,iEAAiE;QACjE,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,IAAuB;IACzC,MAAM,CAAC,EAAE,AAAD,EAAG,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1D,UAAU,EAAE,CAAC;QACb,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,GAAG,KAAK,SAA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ify every matrix row's artifact
|
|
5
|
+
* is present and has the expected shape. A missing artifact aborts
|
|
6
|
+
* that package's release (per plan.md §13.2); other packages
|
|
7
|
+
* continue. No --allow-incomplete flag in v0: silent partial ships
|
|
8
|
+
* are exactly the class of bug this exists to prevent.
|
|
9
|
+
*
|
|
10
|
+
* This is putitoutthere's own guardrail -- it runs regardless of what
|
|
11
|
+
* the user's workflow YAML did with `needs:` chains or
|
|
12
|
+
* `fail-fast: false`.
|
|
13
|
+
*
|
|
14
|
+
* Issue #13. Plan: §13.2.
|
|
15
|
+
*/
|
|
16
|
+
import type { Kind } from './types.js';
|
|
17
|
+
export interface MatrixRow {
|
|
18
|
+
name: string;
|
|
19
|
+
kind: Kind;
|
|
20
|
+
version: string;
|
|
21
|
+
target: string;
|
|
22
|
+
artifact_name: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MissingArtifact {
|
|
25
|
+
row: MatrixRow;
|
|
26
|
+
reason: string;
|
|
27
|
+
}
|
|
28
|
+
export interface PackageCompleteness {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
missing: MissingArtifact[];
|
|
31
|
+
}
|
|
32
|
+
export declare function checkCompleteness(matrix: readonly MatrixRow[], artifactsRoot: string): Map<string, PackageCompleteness>;
|
|
33
|
+
export declare function requireCompleteness(matrix: readonly MatrixRow[], artifactsRoot: string): void;
|
|
34
|
+
//# sourceMappingURL=completeness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completeness.d.ts","sourceRoot":"","sources":["../src/completeness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,aAAa,EAAE,MAAM,GACpB,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAclC;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,aAAa,EAAE,MAAM,GACpB,IAAI,CAeN"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact completeness check.
|
|
3
|
+
*
|
|
4
|
+
* Before any publish side effect, verify every matrix row's artifact
|
|
5
|
+
* is present and has the expected shape. A missing artifact aborts
|
|
6
|
+
* that package's release (per plan.md §13.2); other packages
|
|
7
|
+
* continue. No --allow-incomplete flag in v0: silent partial ships
|
|
8
|
+
* are exactly the class of bug this exists to prevent.
|
|
9
|
+
*
|
|
10
|
+
* This is putitoutthere's own guardrail -- it runs regardless of what
|
|
11
|
+
* the user's workflow YAML did with `needs:` chains or
|
|
12
|
+
* `fail-fast: false`.
|
|
13
|
+
*
|
|
14
|
+
* Issue #13. Plan: §13.2.
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
export function checkCompleteness(matrix, artifactsRoot) {
|
|
19
|
+
const byPackage = new Map();
|
|
20
|
+
for (const row of matrix) {
|
|
21
|
+
const entry = byPackage.get(row.name) ?? { ok: true, missing: [] };
|
|
22
|
+
const reason = verifyRow(row, artifactsRoot);
|
|
23
|
+
if (reason !== null) {
|
|
24
|
+
entry.ok = false;
|
|
25
|
+
entry.missing.push({ row, reason });
|
|
26
|
+
}
|
|
27
|
+
byPackage.set(row.name, entry);
|
|
28
|
+
}
|
|
29
|
+
return byPackage;
|
|
30
|
+
}
|
|
31
|
+
export function requireCompleteness(matrix, artifactsRoot) {
|
|
32
|
+
const results = checkCompleteness(matrix, artifactsRoot);
|
|
33
|
+
const failed = [...results.entries()].filter(([, r]) => !r.ok);
|
|
34
|
+
if (failed.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
const lines = ['Artifact completeness check failed:'];
|
|
37
|
+
for (const [pkg, result] of failed) {
|
|
38
|
+
lines.push(` ${pkg}:`);
|
|
39
|
+
for (const m of result.missing) {
|
|
40
|
+
lines.push(` - target=${m.row.target} artifact=${m.row.artifact_name}: ${m.reason}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
lines.push('');
|
|
44
|
+
lines.push('No side effects performed. Fix the build and re-run.');
|
|
45
|
+
throw new Error(lines.join('\n'));
|
|
46
|
+
}
|
|
47
|
+
/* ----------------------------- internals ----------------------------- */
|
|
48
|
+
/**
|
|
49
|
+
* Returns null when the row's artifact is present and shaped correctly;
|
|
50
|
+
* otherwise a human-readable reason.
|
|
51
|
+
*/
|
|
52
|
+
function verifyRow(row, artifactsRoot) {
|
|
53
|
+
const dir = join(artifactsRoot, row.artifact_name);
|
|
54
|
+
if (!existsSync(dir)) {
|
|
55
|
+
return `missing artifact directory ${row.artifact_name}/`;
|
|
56
|
+
}
|
|
57
|
+
let files;
|
|
58
|
+
try {
|
|
59
|
+
files = listFiles(dir);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
return `cannot read ${row.artifact_name}/: ${err instanceof Error ? err.message : String(err)}`;
|
|
63
|
+
}
|
|
64
|
+
if (files.length === 0) {
|
|
65
|
+
return `empty artifact directory ${row.artifact_name}/`;
|
|
66
|
+
}
|
|
67
|
+
return verifyShape(row, files);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Recursive file listing. Wheels and sdists may sit one level deep in
|
|
71
|
+
* a `dist/` subdir depending on how the user's build writes them.
|
|
72
|
+
*/
|
|
73
|
+
function listFiles(dir) {
|
|
74
|
+
const out = [];
|
|
75
|
+
for (const entry of readdirSync(dir)) {
|
|
76
|
+
const full = join(dir, entry);
|
|
77
|
+
const st = statSync(full);
|
|
78
|
+
if (st.isDirectory()) {
|
|
79
|
+
out.push(...listFiles(full));
|
|
80
|
+
}
|
|
81
|
+
else if (st.isFile() && st.size > 0) {
|
|
82
|
+
out.push(full);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
function verifyShape(row, files) {
|
|
88
|
+
switch (row.kind) {
|
|
89
|
+
case 'crates':
|
|
90
|
+
return hasSuffix(files, '.crate')
|
|
91
|
+
? null
|
|
92
|
+
: `no .crate file in ${row.artifact_name}/`;
|
|
93
|
+
case 'pypi':
|
|
94
|
+
if (row.target === 'sdist') {
|
|
95
|
+
return hasSuffix(files, '.tar.gz')
|
|
96
|
+
? null
|
|
97
|
+
: `no .tar.gz (sdist) in ${row.artifact_name}/`;
|
|
98
|
+
}
|
|
99
|
+
return hasSuffix(files, '.whl')
|
|
100
|
+
? null
|
|
101
|
+
: `no .whl file in ${row.artifact_name}/`;
|
|
102
|
+
case 'npm':
|
|
103
|
+
// vanilla (noarch) and `main` must have package.json. Per-platform
|
|
104
|
+
// rows need any binary/bundle artifact to be meaningful; since
|
|
105
|
+
// napi + bundled-cli layouts vary, a non-empty directory is
|
|
106
|
+
// enough.
|
|
107
|
+
if (row.target === 'main' || row.target === 'noarch') {
|
|
108
|
+
return hasFile(files, 'package.json')
|
|
109
|
+
? null
|
|
110
|
+
: `no package.json in ${row.artifact_name}/`;
|
|
111
|
+
}
|
|
112
|
+
return null; // any non-empty file is acceptable for a platform package
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function hasSuffix(files, suffix) {
|
|
116
|
+
return files.some((f) => f.endsWith(suffix));
|
|
117
|
+
}
|
|
118
|
+
function hasFile(files, name) {
|
|
119
|
+
return files.some((f) => f.endsWith(`/${name}`) || f.endsWith(`\\${name}`));
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=completeness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completeness.js","sourceRoot":"","sources":["../src/completeness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC,MAAM,UAAU,iBAAiB,CAC/B,MAA4B,EAC5B,aAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,GAAG,EAA+B,CAAC;IAEzD,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACnE,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QAC7C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC;YACjB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;QACtC,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,MAA4B,EAC5B,aAAqB;IAErB,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CA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AC,aAAa,GAAG,CAAC;YACpD,CAAC;YACD,OAAO,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;gBAC7B,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,mBAAmB,GAAG,CAAC,aAAa,GAAG,CAAC;QAC9C,KAAK,KAAK;YACR,mEAAmE;YACnE,+DAA+D;YAC/D,4DAA4D;YAC5D,UAAU;YACV,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBACrD,OAAO,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC;oBACnC,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,sBAAsB,GAAG,CAAC,aAAa,GAAG,CAAC;YACjD,CAAC;YACD,OAAO,IAAI,CAAC,CAAC,0DAA0D;IAC3E,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,KAAwB,EAAE,MAAc;IACzD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,OAAO,CAAC,KAAwB,EAAE,IAAY;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `putitoutthere.toml` loader and validator.
|
|
3
|
+
*
|
|
4
|
+
* Shape per plan.md §6. Handler-specific fields per §6.4. `targets`
|
|
5
|
+
* cross-validation per §12.2: only meaningful for `maturin` / `napi` /
|
|
6
|
+
* `bundled-cli` builds.
|
|
7
|
+
*
|
|
8
|
+
* Two entry points:
|
|
9
|
+
* - `parseConfig(toml)` pure function over a TOML string; used in tests.
|
|
10
|
+
* - `loadConfig(path)` reads the file and calls parseConfig.
|
|
11
|
+
*
|
|
12
|
+
* Unknown fields are a hard error (no silent drops). Zod's `.strict()`
|
|
13
|
+
* enforces this at every level.
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
declare const PILOT: z.ZodObject<{
|
|
17
|
+
version: z.ZodLiteral<1>;
|
|
18
|
+
cadence: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
immediate: "immediate";
|
|
20
|
+
scheduled: "scheduled";
|
|
21
|
+
}>>;
|
|
22
|
+
agents_path: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
declare const CRATES_PKG: z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"crates">;
|
|
26
|
+
crate: z.ZodOptional<z.ZodString>;
|
|
27
|
+
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
target: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
path: z.ZodString;
|
|
31
|
+
paths: z.ZodArray<z.ZodString>;
|
|
32
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
33
|
+
first_version: z.ZodDefault<z.ZodString>;
|
|
34
|
+
smoke: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
declare const PYPI_PKG: z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"pypi">;
|
|
38
|
+
pypi: z.ZodOptional<z.ZodString>;
|
|
39
|
+
build: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
maturin: "maturin";
|
|
41
|
+
setuptools: "setuptools";
|
|
42
|
+
hatch: "hatch";
|
|
43
|
+
}>>;
|
|
44
|
+
wheels_artifact: z.ZodOptional<z.ZodString>;
|
|
45
|
+
targets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
path: z.ZodString;
|
|
48
|
+
paths: z.ZodArray<z.ZodString>;
|
|
49
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
50
|
+
first_version: z.ZodDefault<z.ZodString>;
|
|
51
|
+
smoke: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
declare const NPM_PKG: z.ZodObject<{
|
|
54
|
+
kind: z.ZodLiteral<"npm">;
|
|
55
|
+
npm: z.ZodOptional<z.ZodString>;
|
|
56
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
public: "public";
|
|
58
|
+
restricted: "restricted";
|
|
59
|
+
}>>;
|
|
60
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
61
|
+
build: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
napi: "napi";
|
|
63
|
+
"bundled-cli": "bundled-cli";
|
|
64
|
+
}>>;
|
|
65
|
+
targets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
path: z.ZodString;
|
|
68
|
+
paths: z.ZodArray<z.ZodString>;
|
|
69
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
70
|
+
first_version: z.ZodDefault<z.ZodString>;
|
|
71
|
+
smoke: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
declare const PACKAGE: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
kind: z.ZodLiteral<"crates">;
|
|
75
|
+
crate: z.ZodOptional<z.ZodString>;
|
|
76
|
+
features: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
target: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
path: z.ZodString;
|
|
80
|
+
paths: z.ZodArray<z.ZodString>;
|
|
81
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
82
|
+
first_version: z.ZodDefault<z.ZodString>;
|
|
83
|
+
smoke: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
kind: z.ZodLiteral<"pypi">;
|
|
86
|
+
pypi: z.ZodOptional<z.ZodString>;
|
|
87
|
+
build: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
maturin: "maturin";
|
|
89
|
+
setuptools: "setuptools";
|
|
90
|
+
hatch: "hatch";
|
|
91
|
+
}>>;
|
|
92
|
+
wheels_artifact: z.ZodOptional<z.ZodString>;
|
|
93
|
+
targets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
|
+
name: z.ZodString;
|
|
95
|
+
path: z.ZodString;
|
|
96
|
+
paths: z.ZodArray<z.ZodString>;
|
|
97
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
98
|
+
first_version: z.ZodDefault<z.ZodString>;
|
|
99
|
+
smoke: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
101
|
+
kind: z.ZodLiteral<"npm">;
|
|
102
|
+
npm: z.ZodOptional<z.ZodString>;
|
|
103
|
+
access: z.ZodOptional<z.ZodEnum<{
|
|
104
|
+
public: "public";
|
|
105
|
+
restricted: "restricted";
|
|
106
|
+
}>>;
|
|
107
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
108
|
+
build: z.ZodOptional<z.ZodEnum<{
|
|
109
|
+
napi: "napi";
|
|
110
|
+
"bundled-cli": "bundled-cli";
|
|
111
|
+
}>>;
|
|
112
|
+
targets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
name: z.ZodString;
|
|
114
|
+
path: z.ZodString;
|
|
115
|
+
paths: z.ZodArray<z.ZodString>;
|
|
116
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
117
|
+
first_version: z.ZodDefault<z.ZodString>;
|
|
118
|
+
smoke: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, z.core.$strict>], "kind">;
|
|
120
|
+
export type PilotBlock = z.infer<typeof PILOT>;
|
|
121
|
+
export type CratesPackage = z.infer<typeof CRATES_PKG>;
|
|
122
|
+
export type PypiPackage = z.infer<typeof PYPI_PKG>;
|
|
123
|
+
export type NpmPackage = z.infer<typeof NPM_PKG>;
|
|
124
|
+
export type Package = z.infer<typeof PACKAGE>;
|
|
125
|
+
export interface Config {
|
|
126
|
+
putitoutthere: PilotBlock;
|
|
127
|
+
packages: Package[];
|
|
128
|
+
}
|
|
129
|
+
export declare function parseConfig(toml: string): Config;
|
|
130
|
+
export declare function loadConfig(path: string): Config;
|
|
131
|
+
export {};
|
|
132
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,CAAC,EAAiB,MAAM,KAAK,CAAC;AAIvC,QAAA,MAAM,KAAK;;;;;;;kBAMA,CAAC;AAYZ,QAAA,MAAM,UAAU;;;;;;;;;;;kBAQL,CAAC;AAIZ,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;kBAcX,CAAC;AAIJ,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;kBAeV,CAAC;AAEJ,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAgE,CAAC;AAW9E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AACjD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,MAAM,WAAW,MAAM;IACrB,aAAa,EAAE,UAAU,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBhD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU/C"}
|