@open-agent-toolkit/cli 0.2.30 → 0.2.31
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/assets/bundle-metadata.json +1 -1
- package/assets/docs/cli-utilities/configuration.md +41 -0
- package/assets/docs/contributing/code.md +19 -7
- package/assets/docs/contributing/explainer-kit-verification.md +9 -1
- package/assets/docs/contributing/skills.md +9 -0
- package/assets/docs/workflows/skills/explainer-kit-providers.md +16 -5
- package/assets/docs/workflows/skills/explainer-kit.md +98 -38
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/explainer-kit/SKILL.md +33 -8
- package/assets/skills/explainer-kit/briefs/project-recap.md +25 -7
- package/assets/skills/explainer-kit/recipes/project-recap.v2.json +72 -0
- package/assets/skills/explainer-kit/references/contracts.md +49 -17
- package/assets/skills/explainer-kit/references/destination-contract.md +141 -25
- package/assets/skills/explainer-kit/references/extension-contract.md +19 -10
- package/assets/skills/explainer-kit/references/visual-authoring.md +24 -0
- package/assets/skills/explainer-kit/references/visual-review.md +19 -5
- package/assets/skills/explainer-kit/schemas/author-request.v3.schema.json +241 -0
- package/assets/skills/explainer-kit/schemas/publish-receipt.v2.schema.json +215 -0
- package/assets/skills/explainer-kit/schemas/publish-request.v2.schema.json +34 -0
- package/assets/skills/explainer-kit/schemas/run-request.schema.json +4 -1
- package/assets/skills/explainer-kit/schemas/terminal-evidence.v1.schema.json +81 -0
- package/assets/skills/explainer-kit/schemas/visual-review-evidence.v1.schema.json +66 -0
- package/assets/skills/explainer-kit/scripts/lib/catalog.mjs +109 -3
- package/assets/skills/explainer-kit/scripts/lib/contracts.mjs +550 -17
- package/assets/skills/explainer-kit/scripts/lib/durability.mjs +90 -8
- package/assets/skills/explainer-kit/scripts/lib/fs-safe.mjs +5 -0
- package/assets/skills/explainer-kit/scripts/lib/internal-references.mjs +538 -0
- package/assets/skills/explainer-kit/scripts/lib/package-coverage.mjs +129 -11
- package/assets/skills/explainer-kit/scripts/lib/publication-policy.mjs +54 -0
- package/assets/skills/explainer-kit/scripts/lib/recipes.mjs +2 -1
- package/assets/skills/explainer-kit/scripts/lib/records.mjs +139 -22
- package/assets/skills/explainer-kit/scripts/lib/s3-roots.mjs +353 -0
- package/assets/skills/explainer-kit/scripts/lib/s3-static.mjs +237 -107
- package/assets/skills/explainer-kit/scripts/lib/set-plan.mjs +1 -0
- package/assets/skills/explainer-kit/scripts/lib/terminal-evidence.mjs +157 -0
- package/assets/skills/explainer-kit/scripts/lib/visual-review.mjs +26 -6
- package/assets/skills/explainer-kit/scripts/run.mjs +1006 -144
- package/assets/skills/oat-explainer-kit/SKILL.md +16 -3
- package/assets/skills/oat-explainer-kit/references/config-contract.md +13 -8
- package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +50 -6
- package/assets/skills/oat-explainer-kit/references/migration.md +2 -1
- package/assets/skills/oat-explainer-kit/references/visual-review-callback.md +11 -0
- package/assets/skills/oat-explainer-kit/scripts/bind-project-sources.mjs +37 -15
- package/assets/skills/oat-explainer-kit/scripts/check-terminal-outcome.mjs +83 -0
- package/assets/skills/oat-explainer-kit/scripts/derive-destination.mjs +91 -0
- package/assets/skills/oat-explainer-kit/scripts/finalize-tracked-run.mjs +66 -10
- package/assets/skills/oat-explainer-kit/scripts/resolve-config.mjs +60 -21
- package/assets/skills/oat-explainer-kit/scripts/resolve-paths.mjs +52 -8
- package/assets/skills/oat-explainer-kit/scripts/run.mjs +271 -36
- package/assets/skills/oat-project-autonomous/references/gate-inventory.md +2 -2
- package/assets/skills/oat-project-complete/SKILL.md +19 -3
- package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +2 -2
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +8 -0
- package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +2 -2
- package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +2 -2
- package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +2 -2
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +18 -0
- package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
- package/dist/commands/project/archive/archive-utils.js +57 -7
- package/dist/commands/project/archive/explainer-terminal-evidence.d.ts +29 -0
- package/dist/commands/project/archive/explainer-terminal-evidence.d.ts.map +1 -0
- package/dist/commands/project/archive/explainer-terminal-evidence.js +37 -0
- package/dist/config/oat-config.d.ts +2 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +4 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +1 -0
- package/package.json +2 -2
- /package/assets/skills/explainer-kit/recipes/{project-recap.json → project-recap.v1.json} +0 -0
- /package/assets/skills/explainer-kit/schemas/{publish-receipt.schema.json → publish-receipt.v1.schema.json} +0 -0
- /package/assets/skills/explainer-kit/schemas/{publish-request.schema.json → publish-request.v1.schema.json} +0 -0
|
@@ -1,6 +1,85 @@
|
|
|
1
1
|
import { canonicalStringify, validateContract } from './contracts.mjs';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Bumped to v2 when the root `publicVerification` marker was added below.
|
|
5
|
+
*
|
|
6
|
+
* The catalog is serialized, hashed, and recorded as an auxiliary artifact in
|
|
7
|
+
* the publish receipt, so adding a root key changes the bytes. Released
|
|
8
|
+
* `0.2.30` emits the v1 shape, which has no such key: leaving both shapes under
|
|
9
|
+
* one version string would put two different wire formats behind one identifier
|
|
10
|
+
* for anyone parsing `catalog.json` by declared version.
|
|
11
|
+
*
|
|
12
|
+
* There is deliberately no v1 read path. Unlike `publish-request/v1` and
|
|
13
|
+
* `publish-receipt/v1`, which are retained because a v1 record can still be
|
|
14
|
+
* replayed, the catalog is regenerate-only and never reconstructed from a v1
|
|
15
|
+
* receipt: every rebuild site short-circuits on a non-v2 receipt
|
|
16
|
+
* (`durability.mjs` verifyPublishEvidence, `run.mjs` publicationValidationContext,
|
|
17
|
+
* and the normative `private-wrapper.mjs` example), and `0.2.30` emits
|
|
18
|
+
* `publish-receipt/v1` only. Accepting v1 here would be unreachable code. If a
|
|
19
|
+
* future reader ever does replay a v1-era catalog, it must reconstruct that
|
|
20
|
+
* shape explicitly rather than relaxing this constant.
|
|
21
|
+
*/
|
|
22
|
+
const CATALOG_SCHEMA_VERSION = 'explainer-kit.initiative-catalog/v2';
|
|
23
|
+
|
|
24
|
+
export const PUBLIC_VERIFICATION_REQUIRED = 'required';
|
|
25
|
+
export const PUBLIC_VERIFICATION_SKIPPED_BY_POLICY = 'skipped-by-policy';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Single source of truth for public-verification state.
|
|
29
|
+
*
|
|
30
|
+
* The catalog is built, serialized and hashed *before* the first upload and long
|
|
31
|
+
* before any per-artifact public verification runs, so it can never carry a
|
|
32
|
+
* verification *outcome*: writing one would either require re-uploading the
|
|
33
|
+
* catalog or invalidate the hash the receipt records for it. It therefore
|
|
34
|
+
* carries verification *policy* only, and the authoritative outcome stays in the
|
|
35
|
+
* run's publish receipt, which the catalog's `runId` identifies.
|
|
36
|
+
*
|
|
37
|
+
* Both the catalog marker and the receipt's skipped status are derived from this
|
|
38
|
+
* one result so the two cannot drift apart.
|
|
39
|
+
*/
|
|
40
|
+
export function resolvePublicVerificationPolicy(publicAccess) {
|
|
41
|
+
return publicAccess === 'protected'
|
|
42
|
+
? {
|
|
43
|
+
publicAccess: 'protected',
|
|
44
|
+
catalogMarker: PUBLIC_VERIFICATION_SKIPPED_BY_POLICY,
|
|
45
|
+
verifyPublicly: false,
|
|
46
|
+
receiptSkipStatus: 'skipped-protected',
|
|
47
|
+
}
|
|
48
|
+
: {
|
|
49
|
+
publicAccess: 'public',
|
|
50
|
+
catalogMarker: PUBLIC_VERIFICATION_REQUIRED,
|
|
51
|
+
verifyPublicly: true,
|
|
52
|
+
receiptSkipStatus: 'skipped-protected',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The public-access policy must be stated explicitly, never defaulted.
|
|
58
|
+
*
|
|
59
|
+
* It selects the catalog's `publicVerification` marker, which is part of the
|
|
60
|
+
* serialized bytes and therefore of the catalog hash the receipt records. An
|
|
61
|
+
* options bag that silently defaulted to the permissive `public` branch is what
|
|
62
|
+
* let four call sites omit it and still produce a plausible-looking catalog:
|
|
63
|
+
* the connector published `skipped-by-policy` for a `protected` run while the
|
|
64
|
+
* durability verifier rebuilt `required`, so the hashes diverged and no
|
|
65
|
+
* `protected` publication could ever be recorded durable.
|
|
66
|
+
*
|
|
67
|
+
* Passing `{ publicAccess: undefined }` is allowed and means `public` — that is
|
|
68
|
+
* the correct reading for `publish-request/v1` and `publish-receipt/v1`, which
|
|
69
|
+
* have no such field. Omitting the key entirely is a programming error.
|
|
70
|
+
*/
|
|
71
|
+
function requiredPublicAccess(options, caller) {
|
|
72
|
+
if (
|
|
73
|
+
options === null ||
|
|
74
|
+
typeof options !== 'object' ||
|
|
75
|
+
!('publicAccess' in options)
|
|
76
|
+
) {
|
|
77
|
+
throw new TypeError(
|
|
78
|
+
`${caller} requires an explicit { publicAccess } policy: it selects the catalog's publicVerification marker and therefore its hash. Pass { publicAccess: undefined } for v1 records, which are public by definition.`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return options.publicAccess;
|
|
82
|
+
}
|
|
4
83
|
|
|
5
84
|
export function initiativeCatalogPath(slug) {
|
|
6
85
|
if (typeof slug !== 'string' || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(slug)) {
|
|
@@ -9,7 +88,8 @@ export function initiativeCatalogPath(slug) {
|
|
|
9
88
|
return `site/initiatives/${slug}/catalog.json`;
|
|
10
89
|
}
|
|
11
90
|
|
|
12
|
-
export function catalogFromManifest(manifest, publicBaseUrl) {
|
|
91
|
+
export function catalogFromManifest(manifest, publicBaseUrl, options) {
|
|
92
|
+
const publicAccess = requiredPublicAccess(options, 'catalogFromManifest');
|
|
13
93
|
const validation = validateContract('manifest', manifest);
|
|
14
94
|
if (!validation.valid) {
|
|
15
95
|
throw new TypeError(
|
|
@@ -45,12 +125,24 @@ export function catalogFromManifest(manifest, publicBaseUrl) {
|
|
|
45
125
|
slug: manifest.slug,
|
|
46
126
|
recipe: structuredClone(manifest.recipe),
|
|
47
127
|
createdAt: manifest.createdAt,
|
|
128
|
+
// Policy, never outcome. See resolvePublicVerificationPolicy.
|
|
129
|
+
publicVerification:
|
|
130
|
+
resolvePublicVerificationPolicy(publicAccess).catalogMarker,
|
|
48
131
|
artifacts,
|
|
49
132
|
sourceBacklinks: structuredClone(manifest.source.backlinks ?? []),
|
|
50
133
|
};
|
|
51
134
|
}
|
|
52
135
|
|
|
53
|
-
export function validateInitiativeCatalog(
|
|
136
|
+
export function validateInitiativeCatalog(
|
|
137
|
+
catalog,
|
|
138
|
+
manifest,
|
|
139
|
+
publicBaseUrl,
|
|
140
|
+
options,
|
|
141
|
+
) {
|
|
142
|
+
const publicAccess = requiredPublicAccess(
|
|
143
|
+
options,
|
|
144
|
+
'validateInitiativeCatalog',
|
|
145
|
+
);
|
|
54
146
|
const errors = [];
|
|
55
147
|
let normalizedPublicBaseUrl;
|
|
56
148
|
try {
|
|
@@ -83,6 +175,7 @@ export function validateInitiativeCatalog(catalog, manifest, publicBaseUrl) {
|
|
|
83
175
|
'slug',
|
|
84
176
|
'recipe',
|
|
85
177
|
'createdAt',
|
|
178
|
+
'publicVerification',
|
|
86
179
|
'artifacts',
|
|
87
180
|
'sourceBacklinks',
|
|
88
181
|
]);
|
|
@@ -110,6 +203,19 @@ export function validateInitiativeCatalog(catalog, manifest, publicBaseUrl) {
|
|
|
110
203
|
);
|
|
111
204
|
}
|
|
112
205
|
}
|
|
206
|
+
// Derived from the same resolver the receipt status comes from, so a catalog
|
|
207
|
+
// that disagrees with the run's resolved verification policy is rejected.
|
|
208
|
+
const expectedPublicVerification =
|
|
209
|
+
resolvePublicVerificationPolicy(publicAccess).catalogMarker;
|
|
210
|
+
if (catalog.publicVerification !== expectedPublicVerification) {
|
|
211
|
+
add(
|
|
212
|
+
errors,
|
|
213
|
+
'$.publicVerification',
|
|
214
|
+
'catalog-verification-policy',
|
|
215
|
+
`Catalog publicVerification must be ${expectedPublicVerification} for this run's public access policy.`,
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
113
219
|
if (
|
|
114
220
|
canonicalStringify(catalog.recipe) !== canonicalStringify(manifest?.recipe)
|
|
115
221
|
) {
|