@openpkg-ts/spec 0.9.0 → 0.10.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/dist/index.d.ts CHANGED
@@ -303,6 +303,15 @@ type SpecGenerationInfo = {
303
303
  resolvedExternalTypes: boolean;
304
304
  /** Maximum type depth used for nested type resolution */
305
305
  maxTypeDepth?: number;
306
+ /** Schema extraction method and metadata */
307
+ schemaExtraction?: {
308
+ /** How schemas were extracted */
309
+ method: "standard-json-schema" | "static-ast" | "hybrid";
310
+ /** Number of schemas extracted via Standard Schema runtime */
311
+ runtimeCount?: number;
312
+ /** Vendors detected (e.g., ['zod', 'valibot']) */
313
+ vendors?: string[];
314
+ };
306
315
  };
307
316
  /** Environment information during generation */
308
317
  environment: {
@@ -392,6 +401,63 @@ declare function diffSpec(oldSpec: SpecWithDocs, newSpec: SpecWithDocs): SpecDif
392
401
  * @returns Categorized breaking changes sorted by severity (high first)
393
402
  */
394
403
  declare function categorizeBreakingChanges(breaking: string[], oldSpec: SpecWithDocs, newSpec: SpecWithDocs, memberChanges?: MemberChangeInfo[]): CategorizedBreaking[];
404
+ /**
405
+ * Semver version bump type.
406
+ */
407
+ type SemverBump = "major" | "minor" | "patch" | "none";
408
+ /**
409
+ * Semver recommendation result.
410
+ */
411
+ interface SemverRecommendation {
412
+ /** Recommended version bump */
413
+ bump: SemverBump;
414
+ /** Reason for the recommendation */
415
+ reason: string;
416
+ /** Count of breaking changes */
417
+ breakingCount: number;
418
+ /** Count of non-breaking additions */
419
+ additionCount: number;
420
+ /** Whether only docs changed */
421
+ docsOnlyChanges: boolean;
422
+ }
423
+ /**
424
+ * Recommend a semver version bump based on spec diff.
425
+ *
426
+ * - MAJOR: Any breaking changes (removals or signature changes)
427
+ * - MINOR: New exports/types added (non-breaking)
428
+ * - PATCH: Documentation-only changes
429
+ * - NONE: No changes
430
+ *
431
+ * @param diff - The spec diff result
432
+ * @returns Semver recommendation with reason
433
+ *
434
+ * @example
435
+ * ```typescript
436
+ * import { diffSpec, recommendSemverBump } from '@openpkg-ts/spec';
437
+ *
438
+ * const diff = diffSpec(oldSpec, newSpec);
439
+ * const recommendation = recommendSemverBump(diff);
440
+ *
441
+ * console.log(`Recommended: ${recommendation.bump}`);
442
+ * console.log(`Reason: ${recommendation.reason}`);
443
+ * ```
444
+ */
445
+ declare function recommendSemverBump(diff: SpecDiff): SemverRecommendation;
446
+ /**
447
+ * Calculate the next version number based on current version and recommended bump.
448
+ *
449
+ * @param currentVersion - Current version string (e.g., "1.2.3")
450
+ * @param bump - Recommended bump type
451
+ * @returns Next version string
452
+ *
453
+ * @example
454
+ * ```typescript
455
+ * calculateNextVersion('1.2.3', 'major'); // '2.0.0'
456
+ * calculateNextVersion('1.2.3', 'minor'); // '1.3.0'
457
+ * calculateNextVersion('1.2.3', 'patch'); // '1.2.4'
458
+ * ```
459
+ */
460
+ declare function calculateNextVersion(currentVersion: string, bump: SemverBump): string;
395
461
  declare function normalize(spec: OpenPkg): OpenPkg;
396
462
  /** Supported schema versions */
397
463
  type SchemaVersion = "0.1.0" | "0.2.0" | "0.3.0" | "latest";
@@ -429,4 +495,4 @@ declare function assertSpec(spec: unknown, version?: SchemaVersion): asserts spe
429
495
  * @returns Array of validation errors (empty if valid)
430
496
  */
431
497
  declare function getValidationErrors(spec: unknown, version?: SchemaVersion): SpecError[];
432
- export { validateSpec, normalize, getValidationErrors, diffSpec, dereference, categorizeBreakingChanges, assertSpec, SpecVisibility, SpecTypeParameter, SpecTypeKind, SpecTypeAliasKind, SpecType, SpecThrows, SpecTag, SpecSource, SpecSignatureReturn, SpecSignatureParameter, SpecSignature, SpecSchemaRef, SpecSchemaPrimitive, SpecSchemaGeneric, SpecSchemaFallback, SpecSchemaComposite, SpecSchemaCombinator, SpecSchema, SpecRelationType, SpecRelation, SpecMember, SpecMappedType, SpecGenerationInfo, SpecExtension, SpecExportKind, SpecExport, SpecExampleLanguage, SpecExample, SpecDocsMetadata, SpecDocDrift, SpecDiff, SpecDecorator, SpecConditionalType, SCHEMA_VERSION, SCHEMA_URL, OpenPkgVersion, OpenPkgMeta, OpenPkg, MemberChangeInfo, JSON_SCHEMA_DRAFT, GenerationIssueSeverity, GenerationIssue, EntryPointDetectionMethod, DriftType, DriftCategory, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, CategorizedBreaking, BreakingSeverity };
498
+ export { validateSpec, recommendSemverBump, normalize, getValidationErrors, diffSpec, dereference, categorizeBreakingChanges, calculateNextVersion, assertSpec, SpecVisibility, SpecTypeParameter, SpecTypeKind, SpecTypeAliasKind, SpecType, SpecThrows, SpecTag, SpecSource, SpecSignatureReturn, SpecSignatureParameter, SpecSignature, SpecSchemaRef, SpecSchemaPrimitive, SpecSchemaGeneric, SpecSchemaFallback, SpecSchemaComposite, SpecSchemaCombinator, SpecSchema, SpecRelationType, SpecRelation, SpecMember, SpecMappedType, SpecGenerationInfo, SpecExtension, SpecExportKind, SpecExport, SpecExampleLanguage, SpecExample, SpecDocsMetadata, SpecDocDrift, SpecDiff, SpecDecorator, SpecConditionalType, SemverRecommendation, SemverBump, SCHEMA_VERSION, SCHEMA_URL, OpenPkgVersion, OpenPkgMeta, OpenPkg, MemberChangeInfo, JSON_SCHEMA_DRAFT, GenerationIssueSeverity, GenerationIssue, EntryPointDetectionMethod, DriftType, DriftCategory, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, CategorizedBreaking, BreakingSeverity };
package/dist/index.js CHANGED
@@ -282,6 +282,72 @@ function categorizeBreakingChanges(breaking, oldSpec, newSpec, memberChanges) {
282
282
  const severityOrder = { high: 0, medium: 1, low: 2 };
283
283
  return categorized.sort((a, b) => severityOrder[a.severity] - severityOrder[b.severity]);
284
284
  }
285
+ function recommendSemverBump(diff) {
286
+ const breakingCount = diff.breaking.length;
287
+ const additionCount = diff.nonBreaking.length;
288
+ const docsOnlyCount = diff.docsOnly.length;
289
+ if (breakingCount > 0) {
290
+ return {
291
+ bump: "major",
292
+ reason: `${breakingCount} breaking change${breakingCount === 1 ? "" : "s"} detected`,
293
+ breakingCount,
294
+ additionCount,
295
+ docsOnlyChanges: false
296
+ };
297
+ }
298
+ if (additionCount > 0) {
299
+ return {
300
+ bump: "minor",
301
+ reason: `${additionCount} new export${additionCount === 1 ? "" : "s"} added`,
302
+ breakingCount: 0,
303
+ additionCount,
304
+ docsOnlyChanges: false
305
+ };
306
+ }
307
+ if (docsOnlyCount > 0) {
308
+ return {
309
+ bump: "patch",
310
+ reason: `${docsOnlyCount} documentation-only change${docsOnlyCount === 1 ? "" : "s"}`,
311
+ breakingCount: 0,
312
+ additionCount: 0,
313
+ docsOnlyChanges: true
314
+ };
315
+ }
316
+ return {
317
+ bump: "none",
318
+ reason: "No changes detected",
319
+ breakingCount: 0,
320
+ additionCount: 0,
321
+ docsOnlyChanges: false
322
+ };
323
+ }
324
+ function calculateNextVersion(currentVersion, bump) {
325
+ if (bump === "none") {
326
+ return currentVersion;
327
+ }
328
+ const normalized = currentVersion.replace(/^v/, "");
329
+ const match = normalized.match(/^(\d+)\.(\d+)\.(\d+)/);
330
+ if (!match) {
331
+ return currentVersion;
332
+ }
333
+ let [, major, minor, patch] = match.map(Number);
334
+ switch (bump) {
335
+ case "major":
336
+ major++;
337
+ minor = 0;
338
+ patch = 0;
339
+ break;
340
+ case "minor":
341
+ minor++;
342
+ patch = 0;
343
+ break;
344
+ case "patch":
345
+ patch++;
346
+ break;
347
+ }
348
+ const prefix = currentVersion.startsWith("v") ? "v" : "";
349
+ return `${prefix}${major}.${minor}.${patch}`;
350
+ }
285
351
  // src/normalize.ts
286
352
  var DEFAULT_ECOSYSTEM = "js/ts";
287
353
  var arrayFieldsByExport = ["signatures", "members", "examples", "tags"];
@@ -1141,9 +1207,17 @@ var openpkg_schema_default3 = {
1141
1207
  $ref: "#/$defs/typeDef"
1142
1208
  }
1143
1209
  },
1144
- docs: {
1145
- $ref: "#/$defs/docsMetadata",
1146
- description: "Aggregate documentation coverage metadata"
1210
+ examples: {
1211
+ type: "array",
1212
+ description: "Package-level usage examples",
1213
+ items: {
1214
+ $ref: "#/$defs/example"
1215
+ }
1216
+ },
1217
+ extensions: {
1218
+ type: "object",
1219
+ description: "Custom extension data",
1220
+ additionalProperties: true
1147
1221
  },
1148
1222
  generation: {
1149
1223
  $ref: "#/$defs/generationInfo",
@@ -1213,7 +1287,12 @@ var openpkg_schema_default3 = {
1213
1287
  analysis: {
1214
1288
  type: "object",
1215
1289
  description: "Details about the analysis process",
1216
- required: ["entryPoint", "entryPointSource", "isDeclarationOnly", "resolvedExternalTypes"],
1290
+ required: [
1291
+ "entryPoint",
1292
+ "entryPointSource",
1293
+ "isDeclarationOnly",
1294
+ "resolvedExternalTypes"
1295
+ ],
1217
1296
  properties: {
1218
1297
  entryPoint: {
1219
1298
  type: "string",
@@ -1233,6 +1312,27 @@ var openpkg_schema_default3 = {
1233
1312
  maxTypeDepth: {
1234
1313
  type: "integer",
1235
1314
  description: "Maximum type depth used for nested type resolution"
1315
+ },
1316
+ schemaExtraction: {
1317
+ type: "object",
1318
+ description: "Schema extraction method and metadata",
1319
+ properties: {
1320
+ method: {
1321
+ type: "string",
1322
+ description: "How schemas were extracted",
1323
+ enum: ["standard-json-schema", "static-ast", "hybrid"]
1324
+ },
1325
+ runtimeCount: {
1326
+ type: "integer",
1327
+ description: "Number of schemas extracted via Standard Schema runtime"
1328
+ },
1329
+ vendors: {
1330
+ type: "array",
1331
+ description: "Vendors detected (e.g., ['zod', 'valibot'])",
1332
+ items: { type: "string" }
1333
+ }
1334
+ },
1335
+ additionalProperties: false
1236
1336
  }
1237
1337
  },
1238
1338
  additionalProperties: false
@@ -1387,7 +1487,9 @@ var openpkg_schema_default3 = {
1387
1487
  "interface",
1388
1488
  "type",
1389
1489
  "enum",
1490
+ "module",
1390
1491
  "namespace",
1492
+ "reference",
1391
1493
  "external"
1392
1494
  ]
1393
1495
  },
@@ -1416,7 +1518,7 @@ var openpkg_schema_default3 = {
1416
1518
  members: {
1417
1519
  type: "array",
1418
1520
  description: "Class/interface/enum members",
1419
- items: { type: "object" }
1521
+ items: { $ref: "#/$defs/member" }
1420
1522
  },
1421
1523
  extends: {
1422
1524
  type: "string",
@@ -1437,6 +1539,24 @@ var openpkg_schema_default3 = {
1437
1539
  source: {
1438
1540
  $ref: "#/$defs/sourceLocation"
1439
1541
  },
1542
+ deprecated: {
1543
+ type: "boolean",
1544
+ description: "Whether this export is deprecated"
1545
+ },
1546
+ flags: {
1547
+ type: "object",
1548
+ description: "Export flags (readonly, abstract, etc.)",
1549
+ additionalProperties: true
1550
+ },
1551
+ schema: {
1552
+ $ref: "#/$defs/schema",
1553
+ description: "Inline schema for the export"
1554
+ },
1555
+ typeParameters: {
1556
+ type: "array",
1557
+ description: "Generic type parameters",
1558
+ items: { $ref: "#/$defs/typeParameter" }
1559
+ },
1440
1560
  docs: {
1441
1561
  $ref: "#/$defs/docsMetadata",
1442
1562
  description: "Documentation coverage metadata for this export"
@@ -1526,7 +1646,7 @@ var openpkg_schema_default3 = {
1526
1646
  members: {
1527
1647
  type: "array",
1528
1648
  description: "Members for classes/interfaces/enums",
1529
- items: { type: "object" }
1649
+ items: { $ref: "#/$defs/member" }
1530
1650
  },
1531
1651
  extends: {
1532
1652
  type: "string",
@@ -1547,6 +1667,10 @@ var openpkg_schema_default3 = {
1547
1667
  source: {
1548
1668
  $ref: "#/$defs/sourceLocation"
1549
1669
  },
1670
+ rawComments: {
1671
+ type: "string",
1672
+ description: "Raw JSDoc/TSDoc comment text"
1673
+ },
1550
1674
  typeAliasKind: {
1551
1675
  $ref: "#/$defs/typeAliasKind",
1552
1676
  description: "Kind of type alias"
@@ -1667,7 +1791,7 @@ var openpkg_schema_default3 = {
1667
1791
  },
1668
1792
  parameter: {
1669
1793
  type: "object",
1670
- required: ["name", "required"],
1794
+ required: ["name"],
1671
1795
  properties: {
1672
1796
  name: {
1673
1797
  type: "string",
@@ -1710,6 +1834,26 @@ var openpkg_schema_default3 = {
1710
1834
  }
1711
1835
  }
1712
1836
  },
1837
+ schemaType: {
1838
+ type: "string",
1839
+ description: "Explicit type enum aligned with TypeScript type system",
1840
+ enum: [
1841
+ "string",
1842
+ "number",
1843
+ "boolean",
1844
+ "integer",
1845
+ "null",
1846
+ "undefined",
1847
+ "any",
1848
+ "unknown",
1849
+ "never",
1850
+ "void",
1851
+ "array",
1852
+ "tuple",
1853
+ "object",
1854
+ "function"
1855
+ ]
1856
+ },
1713
1857
  schema: {
1714
1858
  description: "Flexible JSON Schema for type representation",
1715
1859
  oneOf: [
@@ -1722,6 +1866,11 @@ var openpkg_schema_default3 = {
1722
1866
  format: { type: "string" },
1723
1867
  enum: { type: "array" },
1724
1868
  items: { $ref: "#/$defs/schema" },
1869
+ prefixedItems: {
1870
+ type: "array",
1871
+ items: { $ref: "#/$defs/schema" },
1872
+ description: "Tuple element schemas (draft-2020-12)"
1873
+ },
1725
1874
  properties: {
1726
1875
  type: "object",
1727
1876
  additionalProperties: { $ref: "#/$defs/schema" }
@@ -1742,14 +1891,13 @@ var openpkg_schema_default3 = {
1742
1891
  description: { type: "string" },
1743
1892
  minItems: { type: "integer" },
1744
1893
  maxItems: { type: "integer" },
1745
- signatures: { type: "array" }
1894
+ signatures: { type: "array", items: { $ref: "#/$defs/signature" } }
1746
1895
  }
1747
1896
  }
1748
1897
  ]
1749
1898
  },
1750
1899
  sourceLocation: {
1751
1900
  type: "object",
1752
- required: ["file", "line"],
1753
1901
  properties: {
1754
1902
  file: {
1755
1903
  type: "string",
@@ -1759,6 +1907,10 @@ var openpkg_schema_default3 = {
1759
1907
  type: "integer",
1760
1908
  description: "Line number in source file",
1761
1909
  minimum: 1
1910
+ },
1911
+ url: {
1912
+ type: "string",
1913
+ description: "URL to source (e.g., GitHub permalink)"
1762
1914
  }
1763
1915
  }
1764
1916
  },
@@ -1901,6 +2053,56 @@ var openpkg_schema_default3 = {
1901
2053
  }
1902
2054
  ]
1903
2055
  },
2056
+ visibility: {
2057
+ type: "string",
2058
+ description: "Visibility modifier for class members",
2059
+ enum: ["public", "protected", "private"]
2060
+ },
2061
+ member: {
2062
+ type: "object",
2063
+ description: "Class/interface/enum member definition",
2064
+ properties: {
2065
+ id: {
2066
+ type: "string",
2067
+ description: "Unique identifier for the member"
2068
+ },
2069
+ name: {
2070
+ type: "string",
2071
+ description: "Member name"
2072
+ },
2073
+ kind: {
2074
+ type: "string",
2075
+ description: "Kind of member (e.g., 'property', 'method', 'constructor')"
2076
+ },
2077
+ description: {
2078
+ type: "string",
2079
+ description: "JSDoc/TSDoc description"
2080
+ },
2081
+ visibility: {
2082
+ $ref: "#/$defs/visibility"
2083
+ },
2084
+ tags: {
2085
+ type: "array",
2086
+ items: { $ref: "#/$defs/tag" }
2087
+ },
2088
+ flags: {
2089
+ type: "object",
2090
+ description: "Member flags (static, readonly, abstract, etc.)",
2091
+ additionalProperties: true
2092
+ },
2093
+ schema: {
2094
+ $ref: "#/$defs/schema"
2095
+ },
2096
+ signatures: {
2097
+ type: "array",
2098
+ items: { $ref: "#/$defs/signature" }
2099
+ },
2100
+ decorators: {
2101
+ type: "array",
2102
+ items: { $ref: "#/$defs/decorator" }
2103
+ }
2104
+ }
2105
+ },
1904
2106
  relationType: {
1905
2107
  type: "string",
1906
2108
  description: "Type of relationship between exports",
@@ -1988,11 +2190,13 @@ function getValidationErrors(spec, version = "latest") {
1988
2190
  }
1989
2191
  export {
1990
2192
  validateSpec,
2193
+ recommendSemverBump,
1991
2194
  normalize,
1992
2195
  getValidationErrors,
1993
2196
  diffSpec,
1994
2197
  dereference,
1995
2198
  categorizeBreakingChanges,
2199
+ calculateNextVersion,
1996
2200
  assertSpec,
1997
2201
  SCHEMA_VERSION,
1998
2202
  SCHEMA_URL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/spec",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Shared schema, validation, and diff utilities for OpenPkg specs",
5
5
  "keywords": [
6
6
  "openpkg",
@@ -62,9 +62,17 @@
62
62
  "$ref": "#/$defs/typeDef"
63
63
  }
64
64
  },
65
- "docs": {
66
- "$ref": "#/$defs/docsMetadata",
67
- "description": "Aggregate documentation coverage metadata"
65
+ "examples": {
66
+ "type": "array",
67
+ "description": "Package-level usage examples",
68
+ "items": {
69
+ "$ref": "#/$defs/example"
70
+ }
71
+ },
72
+ "extensions": {
73
+ "type": "object",
74
+ "description": "Custom extension data",
75
+ "additionalProperties": true
68
76
  },
69
77
  "generation": {
70
78
  "$ref": "#/$defs/generationInfo",
@@ -134,7 +142,12 @@
134
142
  "analysis": {
135
143
  "type": "object",
136
144
  "description": "Details about the analysis process",
137
- "required": ["entryPoint", "entryPointSource", "isDeclarationOnly", "resolvedExternalTypes"],
145
+ "required": [
146
+ "entryPoint",
147
+ "entryPointSource",
148
+ "isDeclarationOnly",
149
+ "resolvedExternalTypes"
150
+ ],
138
151
  "properties": {
139
152
  "entryPoint": {
140
153
  "type": "string",
@@ -154,6 +167,27 @@
154
167
  "maxTypeDepth": {
155
168
  "type": "integer",
156
169
  "description": "Maximum type depth used for nested type resolution"
170
+ },
171
+ "schemaExtraction": {
172
+ "type": "object",
173
+ "description": "Schema extraction method and metadata",
174
+ "properties": {
175
+ "method": {
176
+ "type": "string",
177
+ "description": "How schemas were extracted",
178
+ "enum": ["standard-json-schema", "static-ast", "hybrid"]
179
+ },
180
+ "runtimeCount": {
181
+ "type": "integer",
182
+ "description": "Number of schemas extracted via Standard Schema runtime"
183
+ },
184
+ "vendors": {
185
+ "type": "array",
186
+ "description": "Vendors detected (e.g., ['zod', 'valibot'])",
187
+ "items": { "type": "string" }
188
+ }
189
+ },
190
+ "additionalProperties": false
157
191
  }
158
192
  },
159
193
  "additionalProperties": false
@@ -308,7 +342,9 @@
308
342
  "interface",
309
343
  "type",
310
344
  "enum",
345
+ "module",
311
346
  "namespace",
347
+ "reference",
312
348
  "external"
313
349
  ]
314
350
  },
@@ -337,7 +373,7 @@
337
373
  "members": {
338
374
  "type": "array",
339
375
  "description": "Class/interface/enum members",
340
- "items": { "type": "object" }
376
+ "items": { "$ref": "#/$defs/member" }
341
377
  },
342
378
  "extends": {
343
379
  "type": "string",
@@ -358,6 +394,24 @@
358
394
  "source": {
359
395
  "$ref": "#/$defs/sourceLocation"
360
396
  },
397
+ "deprecated": {
398
+ "type": "boolean",
399
+ "description": "Whether this export is deprecated"
400
+ },
401
+ "flags": {
402
+ "type": "object",
403
+ "description": "Export flags (readonly, abstract, etc.)",
404
+ "additionalProperties": true
405
+ },
406
+ "schema": {
407
+ "$ref": "#/$defs/schema",
408
+ "description": "Inline schema for the export"
409
+ },
410
+ "typeParameters": {
411
+ "type": "array",
412
+ "description": "Generic type parameters",
413
+ "items": { "$ref": "#/$defs/typeParameter" }
414
+ },
361
415
  "docs": {
362
416
  "$ref": "#/$defs/docsMetadata",
363
417
  "description": "Documentation coverage metadata for this export"
@@ -447,7 +501,7 @@
447
501
  "members": {
448
502
  "type": "array",
449
503
  "description": "Members for classes/interfaces/enums",
450
- "items": { "type": "object" }
504
+ "items": { "$ref": "#/$defs/member" }
451
505
  },
452
506
  "extends": {
453
507
  "type": "string",
@@ -468,6 +522,10 @@
468
522
  "source": {
469
523
  "$ref": "#/$defs/sourceLocation"
470
524
  },
525
+ "rawComments": {
526
+ "type": "string",
527
+ "description": "Raw JSDoc/TSDoc comment text"
528
+ },
471
529
  "typeAliasKind": {
472
530
  "$ref": "#/$defs/typeAliasKind",
473
531
  "description": "Kind of type alias"
@@ -588,7 +646,7 @@
588
646
  },
589
647
  "parameter": {
590
648
  "type": "object",
591
- "required": ["name", "required"],
649
+ "required": ["name"],
592
650
  "properties": {
593
651
  "name": {
594
652
  "type": "string",
@@ -631,6 +689,26 @@
631
689
  }
632
690
  }
633
691
  },
692
+ "schemaType": {
693
+ "type": "string",
694
+ "description": "Explicit type enum aligned with TypeScript type system",
695
+ "enum": [
696
+ "string",
697
+ "number",
698
+ "boolean",
699
+ "integer",
700
+ "null",
701
+ "undefined",
702
+ "any",
703
+ "unknown",
704
+ "never",
705
+ "void",
706
+ "array",
707
+ "tuple",
708
+ "object",
709
+ "function"
710
+ ]
711
+ },
634
712
  "schema": {
635
713
  "description": "Flexible JSON Schema for type representation",
636
714
  "oneOf": [
@@ -643,6 +721,11 @@
643
721
  "format": { "type": "string" },
644
722
  "enum": { "type": "array" },
645
723
  "items": { "$ref": "#/$defs/schema" },
724
+ "prefixedItems": {
725
+ "type": "array",
726
+ "items": { "$ref": "#/$defs/schema" },
727
+ "description": "Tuple element schemas (draft-2020-12)"
728
+ },
646
729
  "properties": {
647
730
  "type": "object",
648
731
  "additionalProperties": { "$ref": "#/$defs/schema" }
@@ -663,14 +746,13 @@
663
746
  "description": { "type": "string" },
664
747
  "minItems": { "type": "integer" },
665
748
  "maxItems": { "type": "integer" },
666
- "signatures": { "type": "array" }
749
+ "signatures": { "type": "array", "items": { "$ref": "#/$defs/signature" } }
667
750
  }
668
751
  }
669
752
  ]
670
753
  },
671
754
  "sourceLocation": {
672
755
  "type": "object",
673
- "required": ["file", "line"],
674
756
  "properties": {
675
757
  "file": {
676
758
  "type": "string",
@@ -680,6 +762,10 @@
680
762
  "type": "integer",
681
763
  "description": "Line number in source file",
682
764
  "minimum": 1
765
+ },
766
+ "url": {
767
+ "type": "string",
768
+ "description": "URL to source (e.g., GitHub permalink)"
683
769
  }
684
770
  }
685
771
  },
@@ -822,6 +908,56 @@
822
908
  }
823
909
  ]
824
910
  },
911
+ "visibility": {
912
+ "type": "string",
913
+ "description": "Visibility modifier for class members",
914
+ "enum": ["public", "protected", "private"]
915
+ },
916
+ "member": {
917
+ "type": "object",
918
+ "description": "Class/interface/enum member definition",
919
+ "properties": {
920
+ "id": {
921
+ "type": "string",
922
+ "description": "Unique identifier for the member"
923
+ },
924
+ "name": {
925
+ "type": "string",
926
+ "description": "Member name"
927
+ },
928
+ "kind": {
929
+ "type": "string",
930
+ "description": "Kind of member (e.g., 'property', 'method', 'constructor')"
931
+ },
932
+ "description": {
933
+ "type": "string",
934
+ "description": "JSDoc/TSDoc description"
935
+ },
936
+ "visibility": {
937
+ "$ref": "#/$defs/visibility"
938
+ },
939
+ "tags": {
940
+ "type": "array",
941
+ "items": { "$ref": "#/$defs/tag" }
942
+ },
943
+ "flags": {
944
+ "type": "object",
945
+ "description": "Member flags (static, readonly, abstract, etc.)",
946
+ "additionalProperties": true
947
+ },
948
+ "schema": {
949
+ "$ref": "#/$defs/schema"
950
+ },
951
+ "signatures": {
952
+ "type": "array",
953
+ "items": { "$ref": "#/$defs/signature" }
954
+ },
955
+ "decorators": {
956
+ "type": "array",
957
+ "items": { "$ref": "#/$defs/decorator" }
958
+ }
959
+ }
960
+ },
825
961
  "relationType": {
826
962
  "type": "string",
827
963
  "description": "Type of relationship between exports",