Files
dependabot[bot]andVincent Koc 417beaf3a5 fix(evidence): preserve saved identities with canonicalize 5 (#8132)
chore(deps): bump canonicalize from 3.0.0 to 5.1.0

Bumps [canonicalize](https://github.com/erdtman/canonicalize) from 3.0.0 to 5.1.0.
- [Release notes](https://github.com/erdtman/canonicalize/releases)
- [Commits](https://github.com/erdtman/canonicalize/compare/v3.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: canonicalize
  dependency-version: 5.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-11-24 20:54:13 +08:00

64 lines
2.0 KiB
JavaScript

import { formatGeneratedFile } from "./format-generated-file.mjs";
import { assertSameNames, loadSources } from "./catalog-core.mjs";
import { createCliInventory } from "./catalog-cli.mjs";
import { providerCatalog, toolFamilyCatalog } from "./catalog-builders.mjs";
/** Project current runtime contracts into deterministic, machine-readable facts. */
export const createProductCatalog = async (root) => {
const sources = await loadSources(root);
const cli = createCliInventory(
sources.cliRegistry.cliCommands(sources.cli.createCli()),
);
assertSameNames(
"Primary CLI inventory",
cli.primary,
sources.catalogIdentity.CLI_COMMAND_NAMES,
);
const tools = toolFamilyCatalog(sources);
const providers = providerCatalog(sources);
const metadata = sources.packageMetadata.PACKAGE_METADATA;
return {
package: {
name: metadata.name,
version: metadata.version,
sdk: {
server: metadata.serverSdkVersion,
client: metadata.clientSdkVersion,
core: metadata.coreSdkVersion,
},
skill_version: metadata.skillVersion,
},
tools,
providers,
setup_clients: sources.supportedClients.SUPPORTED_CLIENT_DEFINITIONS.map(
({ name, displayName, format }) => ({
id: name,
display_name: displayName,
format,
configuration: format === "unsupported" ? "detect-only" : "managed",
}),
),
cli: {
primary_count: cli.primary.length,
commands: cli.primary,
aliases: cli.aliases,
},
runtime_catalog: {
counts: sources.catalogIdentity.DEFAULT_CATALOG_IDENTITY.counts,
digests: {
// Full runtime schema digests belong to server identity, not this facts projection.
providers_sha256:
sources.catalogIdentity.digestCatalogProjection(providers),
},
},
};
};
/** Stable build-generated representation of the product catalog. */
export const serializeProductCatalog = (catalog) =>
formatGeneratedFile(
"docs/public/product-catalog.json",
JSON.stringify(catalog, null, 2),
);