@roostorg/types 1.1.1 → 2.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@roostorg/types",
3
3
  "type": "module",
4
- "version": "1.1.1",
4
+ "version": "2.0.0",
5
5
  "description": "Shared types across Coop services",
6
6
  "module": "transpiled/index.js",
7
7
  "typings": "./transpiled/index.d.ts",
@@ -10,6 +10,11 @@
10
10
  "prepublishOnly": "npm run build",
11
11
  "test": "npm run build && node --test transpiled/test_scripts/"
12
12
  },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/roostorg/coop",
16
+ "directory": "types"
17
+ },
13
18
  "author": "Roostorg",
14
19
  "files": [
15
20
  "transpiled"
@@ -31,7 +31,7 @@ export type ModelCardSubsection = Readonly<{
31
31
  * Either subsections (with bold sub-headings) or top-level fields, or both.
32
32
  */
33
33
  export type ModelCardSection = Readonly<{
34
- /** Stable id for the section (e.g. "modelDetails", "trainingData"). */
34
+ /** Stable id for the section (e.g. "trainingData", "biasAndLimitations"). */
35
35
  id: string;
36
36
  /** Display title (e.g. "Model Details"). */
37
37
  title: string;
@@ -62,10 +62,10 @@ export type ModelCard = Readonly<{
62
62
  * Section ids that every integration's model card must include.
63
63
  * Use assertModelCardHasRequiredSections() to validate at runtime.
64
64
  */
65
- export declare const REQUIRED_MODEL_CARD_SECTION_IDS: readonly ["modelDetails", "technicalIntegration"];
65
+ export declare const REQUIRED_MODEL_CARD_SECTION_IDS: readonly ["trainingData", "policyAndTaxonomy", "annotationMethodology", "performanceBenchmarks", "biasAndLimitations", "implementationGuidance", "relevantLinks"];
66
66
  /**
67
- * Asserts that a model card has at least the required sections (basic information
68
- * and technical integration). Call when registering integration manifests.
67
+ * Asserts that a model card has at least the required sections.
68
+ * Call when registering integration manifests.
69
69
  * @throws Error if any required section id is missing
70
70
  */
71
71
  export declare function assertModelCardHasRequiredSections(card: ModelCard): void;
@@ -116,10 +116,9 @@ export type IntegrationManifest = Readonly<{
116
116
  signalTypeIds?: readonly string[];
117
117
  /**
118
118
  * Model card: structured metadata (model name, version, sections) for the UI.
119
- * When present, the integration detail page renders it. Built-in integrations
120
- * should always provide a model card with at least sections "modelDetails" and
121
- * "technicalIntegration"; use assertModelCardHasRequiredSections() when
122
- * registering.
119
+ * When present, the integration detail page renders it. Integrations must
120
+ * include all sections listed in REQUIRED_MODEL_CARD_SECTION_IDS; use
121
+ * assertModelCardHasRequiredSections() when registering.
123
122
  */
124
123
  modelCard?: ModelCard;
125
124
  /**
@@ -133,6 +132,8 @@ export type IntegrationManifest = Readonly<{
133
132
  * If you provide logoPath and logoWithBackgroundPath, the server will serve the files at
134
133
  * GET /api/v1/integration-logos/:integrationId and GET /api/v1/integration-logos/:integrationId/with-background
135
134
  * and set logoUrl and logoWithBackgroundUrl accordingly.
135
+ * Usage: logoUrl/logoPath = plain logo (no background), used on the integrations page;
136
+ * logoWithBackgroundUrl/logoWithBackgroundPath = logo with background, used in signal modals.
136
137
  * If you provide logoUrl and logoWithBackgroundUrl, the server will use those URLs directly.
137
138
  * Prefered size: ~180x180px for logoUrl and ~120x120px for logoWithBackgroundUrl.
138
139
  * Prefer a square or horizontal logo that scales well.
@@ -13,20 +13,24 @@
13
13
  * Use assertModelCardHasRequiredSections() to validate at runtime.
14
14
  */
15
15
  export const REQUIRED_MODEL_CARD_SECTION_IDS = [
16
- 'modelDetails',
17
- 'technicalIntegration',
16
+ 'trainingData',
17
+ 'policyAndTaxonomy',
18
+ 'annotationMethodology',
19
+ 'performanceBenchmarks',
20
+ 'biasAndLimitations',
21
+ 'implementationGuidance',
22
+ 'relevantLinks',
18
23
  ];
19
24
  /**
20
- * Asserts that a model card has at least the required sections (basic information
21
- * and technical integration). Call when registering integration manifests.
25
+ * Asserts that a model card has at least the required sections.
26
+ * Call when registering integration manifests.
22
27
  * @throws Error if any required section id is missing
23
28
  */
24
29
  export function assertModelCardHasRequiredSections(card) {
25
30
  const sectionIds = new Set((card.sections ?? []).map((s) => s.id));
26
- for (const requiredId of REQUIRED_MODEL_CARD_SECTION_IDS) {
27
- if (!sectionIds.has(requiredId)) {
28
- throw new Error(`Model card must include a section with id "${requiredId}" (e.g. Basic Information / Model Details and Technical Integration).`);
29
- }
31
+ const missing = REQUIRED_MODEL_CARD_SECTION_IDS.filter((id) => !sectionIds.has(id));
32
+ if (missing.length > 0) {
33
+ throw new Error(`Model card is missing required section(s): ${missing.map((id) => `"${id}"`).join(', ')}.`);
30
34
  }
31
35
  }
32
36
  /**