@driftsys/markspec 0.6.0 → 0.6.2

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.
Files changed (109) hide show
  1. package/esm/lint/mod.d.ts +2 -0
  2. package/esm/lint/mod.d.ts.map +1 -1
  3. package/esm/lint/mod.js +1 -0
  4. package/esm/lint/rules/xref.d.ts +32 -5
  5. package/esm/lint/rules/xref.d.ts.map +1 -1
  6. package/esm/lint/rules/xref.js +40 -0
  7. package/esm/lint/runner.d.ts.map +1 -1
  8. package/esm/lint/runner.js +6 -2
  9. package/esm/lint/score_text.d.ts +67 -0
  10. package/esm/lint/score_text.d.ts.map +1 -0
  11. package/esm/lint/score_text.js +74 -0
  12. package/esm/lock/compare.d.ts +34 -0
  13. package/esm/lock/compare.d.ts.map +1 -0
  14. package/esm/lock/compare.js +64 -0
  15. package/esm/lock/mod.d.ts +2 -1
  16. package/esm/lock/mod.d.ts.map +1 -1
  17. package/esm/lock/mod.js +1 -0
  18. package/esm/lock/model.d.ts +13 -0
  19. package/esm/lock/model.d.ts.map +1 -1
  20. package/esm/lock/parser.d.ts +3 -0
  21. package/esm/lock/parser.d.ts.map +1 -1
  22. package/esm/lock/parser.js +37 -1
  23. package/esm/lock/serializer.d.ts.map +1 -1
  24. package/esm/lock/serializer.js +4 -0
  25. package/esm/mod.d.ts +7 -3
  26. package/esm/mod.d.ts.map +1 -1
  27. package/esm/mod.js +6 -2
  28. package/esm/parser/grammars.d.ts.map +1 -1
  29. package/esm/parser/grammars.js +8 -2
  30. package/esm/parser/markdown.js +11 -21
  31. package/esm/profile/display_id.d.ts +60 -0
  32. package/esm/profile/display_id.d.ts.map +1 -0
  33. package/esm/profile/display_id.js +80 -0
  34. package/esm/profile/mod.d.ts +3 -0
  35. package/esm/profile/mod.d.ts.map +1 -1
  36. package/esm/profile/mod.js +2 -0
  37. package/esm/profile/trace_targets.d.ts +43 -0
  38. package/esm/profile/trace_targets.d.ts.map +1 -0
  39. package/esm/profile/trace_targets.js +74 -0
  40. package/esm/self_upgrade/compare.d.ts +19 -0
  41. package/esm/self_upgrade/compare.d.ts.map +1 -0
  42. package/esm/self_upgrade/compare.js +35 -0
  43. package/esm/self_upgrade/manifest.d.ts +21 -0
  44. package/esm/self_upgrade/manifest.d.ts.map +1 -0
  45. package/esm/self_upgrade/manifest.js +27 -0
  46. package/esm/self_upgrade/mod.d.ts +12 -0
  47. package/esm/self_upgrade/mod.d.ts.map +1 -0
  48. package/esm/self_upgrade/mod.js +11 -0
  49. package/esm/self_upgrade/pm_detect.d.ts +27 -0
  50. package/esm/self_upgrade/pm_detect.d.ts.map +1 -0
  51. package/esm/self_upgrade/pm_detect.js +55 -0
  52. package/esm/self_upgrade/target.d.ts +25 -0
  53. package/esm/self_upgrade/target.d.ts.map +1 -0
  54. package/esm/self_upgrade/target.js +34 -0
  55. package/package.json +1 -1
  56. package/script/lint/mod.d.ts +2 -0
  57. package/script/lint/mod.d.ts.map +1 -1
  58. package/script/lint/mod.js +3 -1
  59. package/script/lint/rules/xref.d.ts +32 -5
  60. package/script/lint/rules/xref.d.ts.map +1 -1
  61. package/script/lint/rules/xref.js +42 -0
  62. package/script/lint/runner.d.ts.map +1 -1
  63. package/script/lint/runner.js +5 -1
  64. package/script/lint/score_text.d.ts +67 -0
  65. package/script/lint/score_text.d.ts.map +1 -0
  66. package/script/lint/score_text.js +77 -0
  67. package/script/lock/compare.d.ts +34 -0
  68. package/script/lock/compare.d.ts.map +1 -0
  69. package/script/lock/compare.js +67 -0
  70. package/script/lock/mod.d.ts +2 -1
  71. package/script/lock/mod.d.ts.map +1 -1
  72. package/script/lock/mod.js +3 -1
  73. package/script/lock/model.d.ts +13 -0
  74. package/script/lock/model.d.ts.map +1 -1
  75. package/script/lock/parser.d.ts +3 -0
  76. package/script/lock/parser.d.ts.map +1 -1
  77. package/script/lock/parser.js +37 -1
  78. package/script/lock/serializer.d.ts.map +1 -1
  79. package/script/lock/serializer.js +4 -0
  80. package/script/mod.d.ts +7 -3
  81. package/script/mod.d.ts.map +1 -1
  82. package/script/mod.js +82 -63
  83. package/script/parser/grammars.d.ts.map +1 -1
  84. package/script/parser/grammars.js +8 -2
  85. package/script/parser/markdown.js +11 -21
  86. package/script/profile/display_id.d.ts +60 -0
  87. package/script/profile/display_id.d.ts.map +1 -0
  88. package/script/profile/display_id.js +86 -0
  89. package/script/profile/mod.d.ts +3 -0
  90. package/script/profile/mod.d.ts.map +1 -1
  91. package/script/profile/mod.js +10 -1
  92. package/script/profile/trace_targets.d.ts +43 -0
  93. package/script/profile/trace_targets.d.ts.map +1 -0
  94. package/script/profile/trace_targets.js +79 -0
  95. package/script/self_upgrade/compare.d.ts +19 -0
  96. package/script/self_upgrade/compare.d.ts.map +1 -0
  97. package/script/self_upgrade/compare.js +38 -0
  98. package/script/self_upgrade/manifest.d.ts +21 -0
  99. package/script/self_upgrade/manifest.d.ts.map +1 -0
  100. package/script/self_upgrade/manifest.js +31 -0
  101. package/script/self_upgrade/mod.d.ts +12 -0
  102. package/script/self_upgrade/mod.d.ts.map +1 -0
  103. package/script/self_upgrade/mod.js +20 -0
  104. package/script/self_upgrade/pm_detect.d.ts +27 -0
  105. package/script/self_upgrade/pm_detect.d.ts.map +1 -0
  106. package/script/self_upgrade/pm_detect.js +58 -0
  107. package/script/self_upgrade/target.d.ts +25 -0
  108. package/script/self_upgrade/target.d.ts.map +1 -0
  109. package/script/self_upgrade/target.js +38 -0
@@ -9,11 +9,21 @@
9
9
  * - MSL-L001 — malformed TOML or missing required field
10
10
  * - MSL-L002 — lockfile schema is newer than this binary supports
11
11
  * - MSL-L003 — lockfile schema is unrecognised (< 1)
12
+ * - MSL-L030 — `[meta.toolchain].min-version` is malformed
13
+ * - MSL-L031 — `[meta.toolchain].min-version` is not a string
14
+ * - MSL-L032 — `meta.toolchain` is a scalar instead of a table
12
15
  */
13
16
  Object.defineProperty(exports, "__esModule", { value: true });
14
17
  exports.parseLockfile = parseLockfile;
15
18
  const toml_1 = require("@std/toml");
16
19
  const model_js_1 = require("./model.js");
20
+ /**
21
+ * Strict MAJOR.MINOR grammar for `[meta.toolchain].min-version`. Exactly
22
+ * two components, no leading zeros (except `0` itself), no `v` prefix,
23
+ * no operator. See spec 2026-05-27-markspec-lock-toolchain-minversion.
24
+ * Must stay in sync with FLOOR_RE in `./compare.ts`.
25
+ */
26
+ const MIN_VERSION_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
17
27
  /**
18
28
  * Parse a `markspec.lock` document. Returns the model when valid, or a
19
29
  * single `MSL-L###` diagnostic when not. Schema-validation errors are
@@ -49,6 +59,30 @@ function parseLockfile(toml) {
49
59
  if (typeof markspecSchema !== "number") {
50
60
  return diag("MSL-L001", "Missing [meta].markspec-schema");
51
61
  }
62
+ // [meta.toolchain] — optional minimum CLI version floor (slice B).
63
+ // Validates strictly: malformed values are rejected with single-shot
64
+ // diagnostics; unknown sub-keys are silently ignored for forward-compat.
65
+ let toolchain;
66
+ const toolchainRaw = meta.toolchain;
67
+ if (toolchainRaw !== undefined) {
68
+ if (typeof toolchainRaw !== "object" || toolchainRaw === null ||
69
+ Array.isArray(toolchainRaw)) {
70
+ return diag("MSL-L032", "[meta.toolchain] must be a table");
71
+ }
72
+ const tc = toolchainRaw;
73
+ const rawMinVersion = tc["min-version"];
74
+ if (rawMinVersion !== undefined) {
75
+ if (typeof rawMinVersion !== "string") {
76
+ return diag("MSL-L031", "[meta.toolchain].min-version must be a string");
77
+ }
78
+ if (!MIN_VERSION_RE.test(rawMinVersion)) {
79
+ return diag("MSL-L030", `[meta.toolchain].min-version is malformed: ` +
80
+ `${JSON.stringify(rawMinVersion)} ` +
81
+ `(expected MAJOR.MINOR like "0.6")`);
82
+ }
83
+ toolchain = { minVersion: rawMinVersion };
84
+ }
85
+ }
52
86
  const upstreams = [];
53
87
  const upstreamRoot = raw.upstream;
54
88
  if (upstreamRoot) {
@@ -160,7 +194,9 @@ function parseLockfile(toml) {
160
194
  }
161
195
  const lockfile = {
162
196
  schema,
163
- meta: { markspecSchema, lockedAt },
197
+ meta: toolchain
198
+ ? { markspecSchema, lockedAt, toolchain }
199
+ : { markspecSchema, lockedAt },
164
200
  upstreams,
165
201
  boundEntries,
166
202
  generatedCache: { edgesHash, edgesCount },
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/lock/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,YAAY,CAAC;AAMpB,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,CAwFtD"}
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/lock/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,YAAY,CAAC;AAMpB,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,CA4FtD"}
@@ -20,6 +20,10 @@ function serializeLockfile(lf) {
20
20
  parts.push("[meta]\n");
21
21
  parts.push(`markspec-schema = ${lf.meta.markspecSchema}\n`);
22
22
  parts.push(`locked-at = ${tomlString(lf.meta.lockedAt)}\n`);
23
+ if (lf.meta.toolchain !== undefined) {
24
+ parts.push("\n[meta.toolchain]\n");
25
+ parts.push(`min-version = ${tomlString(lf.meta.toolchain.minVersion)}\n`);
26
+ }
23
27
  const refs = lf.upstreams
24
28
  .filter((u) => u.kind === "reference")
25
29
  .slice()
package/script/mod.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * from core/mod.ts, never from internal paths.
9
9
  */
10
10
  import "./_dnt.polyfills.js";
11
- export declare const VERSION = "0.6.0";
11
+ export declare const VERSION = "0.6.2";
12
12
  export declare const CORE_SCHEMA_VERSION = 1;
13
13
  export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, DEFAULT_PROJECT_CONFIG, KNOWN_LINK_KINDS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, REFHUB_URL, } from "./model/mod.js";
14
14
  export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, Severity, SourceLocation, Ulid, } from "./model/mod.js";
@@ -24,6 +24,9 @@ export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit
24
24
  export type { AppendFile, CacheLocation, GitCacheKeyInput, LoadChainOptions, LoadChainResult, LoadProfileForCommandResult, MergeResult, ParseManifestResult, ResolvedProfileSource, ResolveGitOptions, RunGit, RunGitResult, } from "./profile/mod.js";
25
25
  export { buildEffectiveDisciplineRegistry } from "./profile/mod.js";
26
26
  export { inferDisciplineMode, resolveDisciplineMode } from "./profile/mod.js";
27
+ export { formatDisplayId, highestDisplayIdNumber, padDisplayIdNumber, parseDisplayIdPattern, } from "./profile/mod.js";
28
+ export type { DisplayIdPatternShape } from "./profile/mod.js";
29
+ export { entryMatchesTargets, filterEntriesByTraceTargets, targetsForRelation, } from "./profile/mod.js";
27
30
  export { buildProfileIntrospection } from "./profile/mod.js";
28
31
  export type { AttributeDetail, ConventionDetail, LabelConcernDetail, ProfileElementDetail, ProfileElementKind, ProfileElementRef, ProfileIntrospection, ProfileOverview, ProvenancedDescription, RelationDetail, TypeDetail, } from "./profile/mod.js";
29
32
  export { detectCaptions, detectDirectives, detectInlineRefs, isSupportedExtension, loadGrammar, parse, parseFile, parseSource, } from "./parser/mod.js";
@@ -43,8 +46,9 @@ export type { ReportFormat, ReportKind, ReportOptions, } from "./reporter/mod.js
43
46
  export { ANTI_PATTERN_NOTE, computeScoreRollup, isProseScope, runLint, } from "./lint/mod.js";
44
47
  export type { EntryScore, LintDiagnostic, LintOptions, LintResult, RuleContribution, ScoreRollup, } from "./lint/mod.js";
45
48
  export * as typl from "./typl/mod.js";
46
- export { canonicalEdgeJson, checkDrift, extractEdgeQuads, hashCanonicalEdges, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
47
- export type { BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, EdgeQuad, FetchUrl, GeneratedCache, LockedAttributes, Lockfile, LockfileMeta, ParseLockfileResult, ReadFile as LockReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, Upstream, UpstreamProfile, UpstreamReference, UpstreamRegistry, } from "./lock/mod.js";
49
+ export { canonicalEdgeJson, checkDrift, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveRegistries, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, } from "./lock/mod.js";
50
+ export type { BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, EdgeQuad, FetchUrl, GeneratedCache, LockedAttributes, Lockfile, LockfileMeta, LockfileToolchain, ParseLockfileResult, ReadFile as LockReadFile, ResolvedBoundEntry, ResolvedProfile, ResolvedReference, ResolvedRegistry, ResolvedUpstreams, ResolveUpstreamsOptions, Upstream, UpstreamProfile, UpstreamReference, UpstreamRegistry, } from "./lock/mod.js";
48
51
  export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
49
52
  export type { AttributeMapping, BoundEntryStatus, ConflictPolicy, Direction as SyncDirection, Mapping, ParseMappingResult, RemoteState, SyncLogEntry, } from "./sync/mod.js";
53
+ export { type Arch as SelfUpgradeArch, classifyInstallPath, type ClassifyResult as SelfUpgradeClassifyResult, compareVersions, type Comparison, detectTarget, type InstallSource, type Os as SelfUpgradeOs, parseSha256Line, type Platform as SelfUpgradePlatform, platformFromBuild, type ReleaseAssets, releaseAssets, type Target as SelfUpgradeTarget, } from "./self_upgrade/mod.js";
50
54
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,IAAI,GACL,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA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AgB,EAChB,cAAc,EACd,SAAS,IAAI,aAAa,EAC1B,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAGrC,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,IAAI,GACL,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd,WAAW,EAC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AY,EACZ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,SAAS,IAAI,aAAa,EAC1B,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,IAAI,IAAI,eAAe,EAC5B,mBAAmB,EACnB,KAAK,cAAc,IAAI,yBAAyB,EAChD,eAAe,EACf,KAAK,UAAU,EACf,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,EAAE,IAAI,aAAa,EACxB,eAAe,EACf,KAAK,QAAQ,IAAI,mBAAmB,EACpC,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,MAAM,IAAI,iBAAiB,GACjC,MAAM,uBAAuB,CAAC"}
package/script/mod.js CHANGED
@@ -33,8 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.format = exports.parseSource = exports.parseFile = exports.parse = exports.loadGrammar = exports.isSupportedExtension = exports.detectInlineRefs = exports.detectDirectives = exports.detectCaptions = exports.buildProfileIntrospection = exports.resolveDisciplineMode = exports.inferDisciplineMode = exports.buildEffectiveDisciplineRegistry = exports.resolveLocalSpecifier = exports.resolveGitSpecifier = exports.resolveEntryColor = exports.parseManifest = exports.mergeChain = exports.loadProfileForCommand = exports.loadChain = exports.ensureCacheGitignored = exports.defaultRunGit = exports.defaultAppendFile = exports.computeCacheLocation = exports.computeCacheKey = exports.readMarkspecYaml = exports.parseMarkspecYaml = exports.MARKSPEC_YAML_FILENAME = exports.addProfileSpecifier = exports.parseProjectConfig = exports.loadConfig = exports.discoverProjectRoot = exports.render = exports.normalizeBodyAst = exports.astEquivalent = exports.REFHUB_URL = exports.PALETTE_HUES = exports.MIXED_DISCIPLINE = exports.makeUlid = exports.makeDisplayId = exports.KNOWN_LINK_KINDS = exports.DEFAULT_PROJECT_CONFIG = exports.CORE_KINDS = exports.CORE_DISCIPLINE_REGISTRY = exports.ConfigError = exports.CORE_SCHEMA_VERSION = exports.VERSION = void 0;
37
- exports.validateMappings = exports.parseMapping = exports.parseLogLine = exports.inferLockedAttributes = exports.encodeLogLine = exports.aggregateStatusByState = exports.sha256String = exports.sha256Bytes = exports.serializeLockfile = exports.resolveUpstreams = exports.resolveRegistries = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.parseLockfile = exports.LOCKFILE_SCHEMA_VERSION = exports.hashCanonicalEdges = exports.extractEdgeQuads = exports.checkDrift = exports.canonicalEdgeJson = exports.typl = exports.runLint = exports.isProseScope = exports.computeScoreRollup = exports.ANTI_PATTERN_NOTE = exports.report = exports.indexToJson = exports.buildEntriesNdjson = exports.buildEdgesNdjson = exports.buildManifest = exports.serializeCompileResult = exports.generateInverses = exports.compile = exports.validateValue = exports.validateTraceabilityForEntry = exports.validateListingDocuments = exports.validateAttributesForEntry = exports.validate = exports.suppressDeclaredAttrR010 = exports.runPipeline = exports.normalizeListValues = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.effectiveScope = void 0;
36
+ exports.loadGrammar = exports.isSupportedExtension = exports.detectInlineRefs = exports.detectDirectives = exports.detectCaptions = exports.buildProfileIntrospection = exports.targetsForRelation = exports.filterEntriesByTraceTargets = exports.entryMatchesTargets = exports.parseDisplayIdPattern = exports.padDisplayIdNumber = exports.highestDisplayIdNumber = exports.formatDisplayId = exports.resolveDisciplineMode = exports.inferDisciplineMode = exports.buildEffectiveDisciplineRegistry = exports.resolveLocalSpecifier = exports.resolveGitSpecifier = exports.resolveEntryColor = exports.parseManifest = exports.mergeChain = exports.loadProfileForCommand = exports.loadChain = exports.ensureCacheGitignored = exports.defaultRunGit = exports.defaultAppendFile = exports.computeCacheLocation = exports.computeCacheKey = exports.readMarkspecYaml = exports.parseMarkspecYaml = exports.MARKSPEC_YAML_FILENAME = exports.addProfileSpecifier = exports.parseProjectConfig = exports.loadConfig = exports.discoverProjectRoot = exports.render = exports.normalizeBodyAst = exports.astEquivalent = exports.REFHUB_URL = exports.PALETTE_HUES = exports.MIXED_DISCIPLINE = exports.makeUlid = exports.makeDisplayId = exports.KNOWN_LINK_KINDS = exports.DEFAULT_PROJECT_CONFIG = exports.CORE_KINDS = exports.CORE_DISCIPLINE_REGISTRY = exports.ConfigError = exports.CORE_SCHEMA_VERSION = exports.VERSION = void 0;
37
+ exports.parseLogLine = exports.inferLockedAttributes = exports.encodeLogLine = exports.aggregateStatusByState = exports.sha256String = exports.sha256Bytes = exports.serializeLockfile = exports.resolveUpstreams = exports.resolveRegistries = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.parseLockfile = exports.LOCKFILE_SCHEMA_VERSION = exports.isBelowFloor = exports.hashCanonicalEdges = exports.extractEdgeQuads = exports.checkDrift = exports.canonicalEdgeJson = exports.typl = exports.runLint = exports.isProseScope = exports.computeScoreRollup = exports.ANTI_PATTERN_NOTE = exports.report = exports.indexToJson = exports.buildEntriesNdjson = exports.buildEdgesNdjson = exports.buildManifest = exports.serializeCompileResult = exports.generateInverses = exports.compile = exports.validateValue = exports.validateTraceabilityForEntry = exports.validateListingDocuments = exports.validateAttributesForEntry = exports.validate = exports.suppressDeclaredAttrR010 = exports.runPipeline = exports.normalizeListValues = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.format = exports.parseSource = exports.parseFile = exports.parse = void 0;
38
+ exports.releaseAssets = exports.platformFromBuild = exports.parseSha256Line = exports.detectTarget = exports.compareVersions = exports.classifyInstallPath = exports.validateMappings = exports.parseMapping = void 0;
38
39
  /**
39
40
  * @module core
40
41
  *
@@ -45,7 +46,7 @@ exports.validateMappings = exports.parseMapping = exports.parseLogLine = exports
45
46
  * from core/mod.ts, never from internal paths.
46
47
  */
47
48
  require("./_dnt.polyfills.js");
48
- exports.VERSION = "0.6.0";
49
+ exports.VERSION = "0.6.2";
49
50
  exports.CORE_SCHEMA_VERSION = 1;
50
51
  // Model types
51
52
  var mod_js_1 = require("./model/mod.js");
@@ -98,41 +99,50 @@ Object.defineProperty(exports, "inferDisciplineMode", { enumerable: true, get: f
98
99
  Object.defineProperty(exports, "resolveDisciplineMode", { enumerable: true, get: function () { return mod_js_5.resolveDisciplineMode; } });
99
100
  // DisciplineMode type already re-exported via Task 2.
100
101
  var mod_js_6 = require("./profile/mod.js");
101
- Object.defineProperty(exports, "buildProfileIntrospection", { enumerable: true, get: function () { return mod_js_6.buildProfileIntrospection; } });
102
+ Object.defineProperty(exports, "formatDisplayId", { enumerable: true, get: function () { return mod_js_6.formatDisplayId; } });
103
+ Object.defineProperty(exports, "highestDisplayIdNumber", { enumerable: true, get: function () { return mod_js_6.highestDisplayIdNumber; } });
104
+ Object.defineProperty(exports, "padDisplayIdNumber", { enumerable: true, get: function () { return mod_js_6.padDisplayIdNumber; } });
105
+ Object.defineProperty(exports, "parseDisplayIdPattern", { enumerable: true, get: function () { return mod_js_6.parseDisplayIdPattern; } });
106
+ var mod_js_7 = require("./profile/mod.js");
107
+ Object.defineProperty(exports, "entryMatchesTargets", { enumerable: true, get: function () { return mod_js_7.entryMatchesTargets; } });
108
+ Object.defineProperty(exports, "filterEntriesByTraceTargets", { enumerable: true, get: function () { return mod_js_7.filterEntriesByTraceTargets; } });
109
+ Object.defineProperty(exports, "targetsForRelation", { enumerable: true, get: function () { return mod_js_7.targetsForRelation; } });
110
+ var mod_js_8 = require("./profile/mod.js");
111
+ Object.defineProperty(exports, "buildProfileIntrospection", { enumerable: true, get: function () { return mod_js_8.buildProfileIntrospection; } });
102
112
  // Parser
103
- var mod_js_7 = require("./parser/mod.js");
104
- Object.defineProperty(exports, "detectCaptions", { enumerable: true, get: function () { return mod_js_7.detectCaptions; } });
105
- Object.defineProperty(exports, "detectDirectives", { enumerable: true, get: function () { return mod_js_7.detectDirectives; } });
106
- Object.defineProperty(exports, "detectInlineRefs", { enumerable: true, get: function () { return mod_js_7.detectInlineRefs; } });
107
- Object.defineProperty(exports, "isSupportedExtension", { enumerable: true, get: function () { return mod_js_7.isSupportedExtension; } });
108
- Object.defineProperty(exports, "loadGrammar", { enumerable: true, get: function () { return mod_js_7.loadGrammar; } });
109
- Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return mod_js_7.parse; } });
110
- Object.defineProperty(exports, "parseFile", { enumerable: true, get: function () { return mod_js_7.parseFile; } });
111
- Object.defineProperty(exports, "parseSource", { enumerable: true, get: function () { return mod_js_7.parseSource; } });
113
+ var mod_js_9 = require("./parser/mod.js");
114
+ Object.defineProperty(exports, "detectCaptions", { enumerable: true, get: function () { return mod_js_9.detectCaptions; } });
115
+ Object.defineProperty(exports, "detectDirectives", { enumerable: true, get: function () { return mod_js_9.detectDirectives; } });
116
+ Object.defineProperty(exports, "detectInlineRefs", { enumerable: true, get: function () { return mod_js_9.detectInlineRefs; } });
117
+ Object.defineProperty(exports, "isSupportedExtension", { enumerable: true, get: function () { return mod_js_9.isSupportedExtension; } });
118
+ Object.defineProperty(exports, "loadGrammar", { enumerable: true, get: function () { return mod_js_9.loadGrammar; } });
119
+ Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return mod_js_9.parse; } });
120
+ Object.defineProperty(exports, "parseFile", { enumerable: true, get: function () { return mod_js_9.parseFile; } });
121
+ Object.defineProperty(exports, "parseSource", { enumerable: true, get: function () { return mod_js_9.parseSource; } });
112
122
  // Formatter
113
- var mod_js_8 = require("./formatter/mod.js");
114
- Object.defineProperty(exports, "format", { enumerable: true, get: function () { return mod_js_8.format; } });
123
+ var mod_js_10 = require("./formatter/mod.js");
124
+ Object.defineProperty(exports, "format", { enumerable: true, get: function () { return mod_js_10.format; } });
115
125
  // Validator
116
- var mod_js_9 = require("./validator/mod.js");
117
- Object.defineProperty(exports, "classifyEntriesStage", { enumerable: true, get: function () { return mod_js_9.classifyEntriesStage; } });
118
- Object.defineProperty(exports, "classifyEntry", { enumerable: true, get: function () { return mod_js_9.classifyEntry; } });
119
- Object.defineProperty(exports, "compileDisplayIdPattern", { enumerable: true, get: function () { return mod_js_9.compileDisplayIdPattern; } });
120
- Object.defineProperty(exports, "effectiveScope", { enumerable: true, get: function () { return mod_js_9.effectiveScope; } });
121
- Object.defineProperty(exports, "effectiveTraceRules", { enumerable: true, get: function () { return mod_js_9.effectiveTraceRules; } });
122
- Object.defineProperty(exports, "matchesAnyTarget", { enumerable: true, get: function () { return mod_js_9.matchesAnyTarget; } });
123
- Object.defineProperty(exports, "normalizeListValues", { enumerable: true, get: function () { return mod_js_9.normalizeListValues; } });
124
- Object.defineProperty(exports, "runPipeline", { enumerable: true, get: function () { return mod_js_9.runPipeline; } });
125
- Object.defineProperty(exports, "suppressDeclaredAttrR010", { enumerable: true, get: function () { return mod_js_9.suppressDeclaredAttrR010; } });
126
- Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return mod_js_9.validate; } });
127
- Object.defineProperty(exports, "validateAttributesForEntry", { enumerable: true, get: function () { return mod_js_9.validateAttributesForEntry; } });
128
- Object.defineProperty(exports, "validateListingDocuments", { enumerable: true, get: function () { return mod_js_9.validateListingDocuments; } });
129
- Object.defineProperty(exports, "validateTraceabilityForEntry", { enumerable: true, get: function () { return mod_js_9.validateTraceabilityForEntry; } });
130
- Object.defineProperty(exports, "validateValue", { enumerable: true, get: function () { return mod_js_9.validateValue; } });
126
+ var mod_js_11 = require("./validator/mod.js");
127
+ Object.defineProperty(exports, "classifyEntriesStage", { enumerable: true, get: function () { return mod_js_11.classifyEntriesStage; } });
128
+ Object.defineProperty(exports, "classifyEntry", { enumerable: true, get: function () { return mod_js_11.classifyEntry; } });
129
+ Object.defineProperty(exports, "compileDisplayIdPattern", { enumerable: true, get: function () { return mod_js_11.compileDisplayIdPattern; } });
130
+ Object.defineProperty(exports, "effectiveScope", { enumerable: true, get: function () { return mod_js_11.effectiveScope; } });
131
+ Object.defineProperty(exports, "effectiveTraceRules", { enumerable: true, get: function () { return mod_js_11.effectiveTraceRules; } });
132
+ Object.defineProperty(exports, "matchesAnyTarget", { enumerable: true, get: function () { return mod_js_11.matchesAnyTarget; } });
133
+ Object.defineProperty(exports, "normalizeListValues", { enumerable: true, get: function () { return mod_js_11.normalizeListValues; } });
134
+ Object.defineProperty(exports, "runPipeline", { enumerable: true, get: function () { return mod_js_11.runPipeline; } });
135
+ Object.defineProperty(exports, "suppressDeclaredAttrR010", { enumerable: true, get: function () { return mod_js_11.suppressDeclaredAttrR010; } });
136
+ Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return mod_js_11.validate; } });
137
+ Object.defineProperty(exports, "validateAttributesForEntry", { enumerable: true, get: function () { return mod_js_11.validateAttributesForEntry; } });
138
+ Object.defineProperty(exports, "validateListingDocuments", { enumerable: true, get: function () { return mod_js_11.validateListingDocuments; } });
139
+ Object.defineProperty(exports, "validateTraceabilityForEntry", { enumerable: true, get: function () { return mod_js_11.validateTraceabilityForEntry; } });
140
+ Object.defineProperty(exports, "validateValue", { enumerable: true, get: function () { return mod_js_11.validateValue; } });
131
141
  // Compiler
132
- var mod_js_10 = require("./compiler/mod.js");
133
- Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return mod_js_10.compile; } });
134
- Object.defineProperty(exports, "generateInverses", { enumerable: true, get: function () { return mod_js_10.generateInverses; } });
135
- Object.defineProperty(exports, "serializeCompileResult", { enumerable: true, get: function () { return mod_js_10.serializeCompileResult; } });
142
+ var mod_js_12 = require("./compiler/mod.js");
143
+ Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return mod_js_12.compile; } });
144
+ Object.defineProperty(exports, "generateInverses", { enumerable: true, get: function () { return mod_js_12.generateInverses; } });
145
+ Object.defineProperty(exports, "serializeCompileResult", { enumerable: true, get: function () { return mod_js_12.serializeCompileResult; } });
136
146
  var manifest_js_1 = require("./compiler/manifest.js");
137
147
  Object.defineProperty(exports, "buildManifest", { enumerable: true, get: function () { return manifest_js_1.buildManifest; } });
138
148
  var ndjson_writer_js_1 = require("./compiler/ndjson_writer.js");
@@ -140,36 +150,45 @@ Object.defineProperty(exports, "buildEdgesNdjson", { enumerable: true, get: func
140
150
  Object.defineProperty(exports, "buildEntriesNdjson", { enumerable: true, get: function () { return ndjson_writer_js_1.buildEntriesNdjson; } });
141
151
  Object.defineProperty(exports, "indexToJson", { enumerable: true, get: function () { return ndjson_writer_js_1.indexToJson; } });
142
152
  // Reporter
143
- var mod_js_11 = require("./reporter/mod.js");
144
- Object.defineProperty(exports, "report", { enumerable: true, get: function () { return mod_js_11.report; } });
153
+ var mod_js_13 = require("./reporter/mod.js");
154
+ Object.defineProperty(exports, "report", { enumerable: true, get: function () { return mod_js_13.report; } });
145
155
  // Lint (prose-analysis)
146
- var mod_js_12 = require("./lint/mod.js");
147
- Object.defineProperty(exports, "ANTI_PATTERN_NOTE", { enumerable: true, get: function () { return mod_js_12.ANTI_PATTERN_NOTE; } });
148
- Object.defineProperty(exports, "computeScoreRollup", { enumerable: true, get: function () { return mod_js_12.computeScoreRollup; } });
149
- Object.defineProperty(exports, "isProseScope", { enumerable: true, get: function () { return mod_js_12.isProseScope; } });
150
- Object.defineProperty(exports, "runLint", { enumerable: true, get: function () { return mod_js_12.runLint; } });
156
+ var mod_js_14 = require("./lint/mod.js");
157
+ Object.defineProperty(exports, "ANTI_PATTERN_NOTE", { enumerable: true, get: function () { return mod_js_14.ANTI_PATTERN_NOTE; } });
158
+ Object.defineProperty(exports, "computeScoreRollup", { enumerable: true, get: function () { return mod_js_14.computeScoreRollup; } });
159
+ Object.defineProperty(exports, "isProseScope", { enumerable: true, get: function () { return mod_js_14.isProseScope; } });
160
+ Object.defineProperty(exports, "runLint", { enumerable: true, get: function () { return mod_js_14.runLint; } });
151
161
  exports.typl = __importStar(require("./typl/mod.js"));
152
162
  // ── Lockfile (ADR-022) ───────────────────────────────────────────────────
153
- var mod_js_13 = require("./lock/mod.js");
154
- Object.defineProperty(exports, "canonicalEdgeJson", { enumerable: true, get: function () { return mod_js_13.canonicalEdgeJson; } });
155
- Object.defineProperty(exports, "checkDrift", { enumerable: true, get: function () { return mod_js_13.checkDrift; } });
156
- Object.defineProperty(exports, "extractEdgeQuads", { enumerable: true, get: function () { return mod_js_13.extractEdgeQuads; } });
157
- Object.defineProperty(exports, "hashCanonicalEdges", { enumerable: true, get: function () { return mod_js_13.hashCanonicalEdges; } });
158
- Object.defineProperty(exports, "LOCKFILE_SCHEMA_VERSION", { enumerable: true, get: function () { return mod_js_13.LOCKFILE_SCHEMA_VERSION; } });
159
- Object.defineProperty(exports, "parseLockfile", { enumerable: true, get: function () { return mod_js_13.parseLockfile; } });
160
- Object.defineProperty(exports, "resolveBoundEntries", { enumerable: true, get: function () { return mod_js_13.resolveBoundEntries; } });
161
- Object.defineProperty(exports, "resolveProfileChain", { enumerable: true, get: function () { return mod_js_13.resolveProfileChain; } });
162
- Object.defineProperty(exports, "resolveReferences", { enumerable: true, get: function () { return mod_js_13.resolveReferences; } });
163
- Object.defineProperty(exports, "resolveRegistries", { enumerable: true, get: function () { return mod_js_13.resolveRegistries; } });
164
- Object.defineProperty(exports, "resolveUpstreams", { enumerable: true, get: function () { return mod_js_13.resolveUpstreams; } });
165
- Object.defineProperty(exports, "serializeLockfile", { enumerable: true, get: function () { return mod_js_13.serializeLockfile; } });
166
- Object.defineProperty(exports, "sha256Bytes", { enumerable: true, get: function () { return mod_js_13.sha256Bytes; } });
167
- Object.defineProperty(exports, "sha256String", { enumerable: true, get: function () { return mod_js_13.sha256String; } });
163
+ var mod_js_15 = require("./lock/mod.js");
164
+ Object.defineProperty(exports, "canonicalEdgeJson", { enumerable: true, get: function () { return mod_js_15.canonicalEdgeJson; } });
165
+ Object.defineProperty(exports, "checkDrift", { enumerable: true, get: function () { return mod_js_15.checkDrift; } });
166
+ Object.defineProperty(exports, "extractEdgeQuads", { enumerable: true, get: function () { return mod_js_15.extractEdgeQuads; } });
167
+ Object.defineProperty(exports, "hashCanonicalEdges", { enumerable: true, get: function () { return mod_js_15.hashCanonicalEdges; } });
168
+ Object.defineProperty(exports, "isBelowFloor", { enumerable: true, get: function () { return mod_js_15.isBelowFloor; } });
169
+ Object.defineProperty(exports, "LOCKFILE_SCHEMA_VERSION", { enumerable: true, get: function () { return mod_js_15.LOCKFILE_SCHEMA_VERSION; } });
170
+ Object.defineProperty(exports, "parseLockfile", { enumerable: true, get: function () { return mod_js_15.parseLockfile; } });
171
+ Object.defineProperty(exports, "resolveBoundEntries", { enumerable: true, get: function () { return mod_js_15.resolveBoundEntries; } });
172
+ Object.defineProperty(exports, "resolveProfileChain", { enumerable: true, get: function () { return mod_js_15.resolveProfileChain; } });
173
+ Object.defineProperty(exports, "resolveReferences", { enumerable: true, get: function () { return mod_js_15.resolveReferences; } });
174
+ Object.defineProperty(exports, "resolveRegistries", { enumerable: true, get: function () { return mod_js_15.resolveRegistries; } });
175
+ Object.defineProperty(exports, "resolveUpstreams", { enumerable: true, get: function () { return mod_js_15.resolveUpstreams; } });
176
+ Object.defineProperty(exports, "serializeLockfile", { enumerable: true, get: function () { return mod_js_15.serializeLockfile; } });
177
+ Object.defineProperty(exports, "sha256Bytes", { enumerable: true, get: function () { return mod_js_15.sha256Bytes; } });
178
+ Object.defineProperty(exports, "sha256String", { enumerable: true, get: function () { return mod_js_15.sha256String; } });
168
179
  // ── External sync model (ADR-022) ────────────────────────────────────────
169
- var mod_js_14 = require("./sync/mod.js");
170
- Object.defineProperty(exports, "aggregateStatusByState", { enumerable: true, get: function () { return mod_js_14.aggregateStatusByState; } });
171
- Object.defineProperty(exports, "encodeLogLine", { enumerable: true, get: function () { return mod_js_14.encodeLogLine; } });
172
- Object.defineProperty(exports, "inferLockedAttributes", { enumerable: true, get: function () { return mod_js_14.inferLockedAttributes; } });
173
- Object.defineProperty(exports, "parseLogLine", { enumerable: true, get: function () { return mod_js_14.parseLogLine; } });
174
- Object.defineProperty(exports, "parseMapping", { enumerable: true, get: function () { return mod_js_14.parseMapping; } });
175
- Object.defineProperty(exports, "validateMappings", { enumerable: true, get: function () { return mod_js_14.validateMappings; } });
180
+ var mod_js_16 = require("./sync/mod.js");
181
+ Object.defineProperty(exports, "aggregateStatusByState", { enumerable: true, get: function () { return mod_js_16.aggregateStatusByState; } });
182
+ Object.defineProperty(exports, "encodeLogLine", { enumerable: true, get: function () { return mod_js_16.encodeLogLine; } });
183
+ Object.defineProperty(exports, "inferLockedAttributes", { enumerable: true, get: function () { return mod_js_16.inferLockedAttributes; } });
184
+ Object.defineProperty(exports, "parseLogLine", { enumerable: true, get: function () { return mod_js_16.parseLogLine; } });
185
+ Object.defineProperty(exports, "parseMapping", { enumerable: true, get: function () { return mod_js_16.parseMapping; } });
186
+ Object.defineProperty(exports, "validateMappings", { enumerable: true, get: function () { return mod_js_16.validateMappings; } });
187
+ // ── Self-upgrade ─────────────────────────────────────────────────────────
188
+ var mod_js_17 = require("./self_upgrade/mod.js");
189
+ Object.defineProperty(exports, "classifyInstallPath", { enumerable: true, get: function () { return mod_js_17.classifyInstallPath; } });
190
+ Object.defineProperty(exports, "compareVersions", { enumerable: true, get: function () { return mod_js_17.compareVersions; } });
191
+ Object.defineProperty(exports, "detectTarget", { enumerable: true, get: function () { return mod_js_17.detectTarget; } });
192
+ Object.defineProperty(exports, "parseSha256Line", { enumerable: true, get: function () { return mod_js_17.parseSha256Line; } });
193
+ Object.defineProperty(exports, "platformFromBuild", { enumerable: true, get: function () { return mod_js_17.platformFromBuild; } });
194
+ Object.defineProperty(exports, "releaseAssets", { enumerable: true, get: function () { return mod_js_17.releaseAssets; } });
@@ -1 +1 @@
1
- {"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../src/parser/grammars.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAsCnD,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAY1D;AAmBD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../src/parser/grammars.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAU,MAAM,iBAAiB,CAAC;AAsCnD,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAY1D;AA2BD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -71,13 +71,19 @@ async function doLoad(grammarName) {
71
71
  // The compiled binary embeds grammars as .wasm.bin to bypass Deno's
72
72
  // WASM-import resolver (see scripts/compile_binary.ts). Prefer the
73
73
  // mirror when present; fall back to .wasm in dev mode.
74
+ //
75
+ // We always read bytes first with Deno.readFile() and pass Uint8Array to
76
+ // Language.load(). Passing a path string directly causes a NotSupported
77
+ // crash in compiled binaries: web-tree-sitter uses the Node.js fs shim
78
+ // internally, which cannot access Deno's virtual embedded filesystem.
79
+ // (readFileFromFd in ext:deno_node/fs.ts:320 — issue #513)
74
80
  const binPath = (0, path_1.join)(GRAMMARS_DIR, `${grammarName}.wasm.bin`);
75
81
  try {
76
82
  await Deno.stat(binPath);
77
- return web_tree_sitter_1.Language.load(binPath);
83
+ return web_tree_sitter_1.Language.load(await Deno.readFile(binPath));
78
84
  }
79
85
  catch {
80
- return web_tree_sitter_1.Language.load((0, path_1.join)(GRAMMARS_DIR, `${grammarName}.wasm`));
86
+ return web_tree_sitter_1.Language.load(await Deno.readFile((0, path_1.join)(GRAMMARS_DIR, `${grammarName}.wasm`)));
81
87
  }
82
88
  }
83
89
  var language_spec_js_1 = require("./language_spec.js");
@@ -98,7 +98,7 @@ function detectReferencesDocument(_file, explicit) {
98
98
  * Returns undefined if the list item is not an entry block.
99
99
  * Diagnostics (e.g., deprecation warnings) are pushed into the accumulator.
100
100
  */
101
- function extractEntry(item, markdownLines, file, definitions, isReferencesDoc, diagnostics, hasLineMap = false) {
101
+ function extractEntry(item, markdownLines, file, definitions, isReferencesDoc, diagnostics, _hasLineMap = false) {
102
102
  // Task list items (remark-gfm sets checked to true/false) are not entries.
103
103
  if (item.checked != null)
104
104
  return undefined;
@@ -409,27 +409,17 @@ function extractEntry(item, markdownLines, file, definitions, isReferencesDoc, d
409
409
  // Inline-construct tokens (ADR-016). Reuses the already-built bodyAst to
410
410
  // avoid a redundant mdast parse.
411
411
  //
412
- // bodyStartLine: when a lineMap is present (source-file path), use the
413
- // mdast position of the second child (the body paragraph) — the actual
414
- // buffer line where the body starts. CommonMark loose lists have a blank
415
- // line between title and body, so the body is at (entry_line + 2), not
416
- // (entry_line + 1). Without a lineMap we keep the legacy (entry_line + 1)
417
- // behaviour to avoid shifting existing markdown-file token locations.
412
+ // bodyStartLine: use the mdast position of the second child (the body
413
+ // paragraph) — the actual buffer line where the body starts. CommonMark
414
+ // loose lists have a blank line between title and body, so the body is at
415
+ // (entry_line + 2), not (entry_line + 1).
418
416
  //
419
- // columnOffset: when a lineMap is present, body text has been stripped of
420
- // the list-item indent (e.g., " " for column-1 items), so each token
421
- // column must be bumped by that indent width for the LineMap to translate
422
- // to the correct source column. Without a lineMap, no offset is applied
423
- // (legacy behaviour unchanged).
424
- const bodyIndent = hasLineMap
425
- // + 2 = the " " continuation indent prepended by wrapAsListItem to
426
- // every non-title line. Mirrors the indent computation in
427
- // extractBodyContent below.
428
- ? (item.position?.start.column ?? 1) - 1 + 2
429
- : 0;
430
- const bodyStartLine = hasLineMap
431
- ? (item.children[1]?.position?.start.line ?? (line + 1))
432
- : line + 1;
417
+ // columnOffset: body text has been stripped of the list-item indent (e.g.,
418
+ // " " for column-1 items), so each token column must be bumped by that
419
+ // indent width. The + 2 accounts for the " " continuation indent
420
+ // prepended by wrapAsListItem to every non-title line.
421
+ const bodyIndent = (item.position?.start.column ?? 1) - 1 + 2;
422
+ const bodyStartLine = item.children[1]?.position?.start.line ?? (line + 1);
433
423
  const bodyTokens = (0, body_tokens_js_1.extractBodyTokens)(body, bodyAst, {
434
424
  file,
435
425
  line: bodyStartLine,
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @module core/profile/display_id
3
+ *
4
+ * Shared parser for the `display-id-pattern` template used by profile
5
+ * type declarations. Patterns look like:
6
+ *
7
+ * STK_{n:4d}
8
+ * STK_AEB_{n:04d}
9
+ * REQ-{n:03d}-draft
10
+ *
11
+ * The `{n:Nd}` placeholder (with optional leading zero in the Nd
12
+ * form) names the sequential number slot. The text before the
13
+ * placeholder becomes the literal prefix; the text after becomes the
14
+ * literal suffix.
15
+ *
16
+ * Note: the `{scope}` placeholder documented in the profile schema
17
+ * is NOT substituted here — callers handle that separately. For
18
+ * patterns containing `{scope}`, the literal text `{scope}` ends up
19
+ * in `prefix` (or `suffix`) and must be replaced upstream before the
20
+ * pattern is fed to scaffolding.
21
+ */
22
+ /** Width-and-position decomposition of a display-id-pattern. */
23
+ export interface DisplayIdPatternShape {
24
+ /** Literal text before the `{n:Nd}` placeholder. */
25
+ readonly prefix: string;
26
+ /** Width of the zero-padded numeric segment. */
27
+ readonly width: number;
28
+ /** Literal text after the `{n:Nd}` placeholder (often empty). */
29
+ readonly suffix: string;
30
+ }
31
+ /**
32
+ * Parse a `display-id-pattern` template. Returns `undefined` when
33
+ * the pattern does not contain a recognised `{n:Nd}` placeholder so
34
+ * callers can decide how to surface the error (CLI exits, LSP
35
+ * silently skips the type).
36
+ */
37
+ export declare function parseDisplayIdPattern(pattern: string): DisplayIdPatternShape | undefined;
38
+ /**
39
+ * Pad a positive integer with leading zeros to at least `width`
40
+ * characters. Numbers longer than `width` are left unchanged — the
41
+ * pattern's width is a minimum, not a maximum, mirroring printf
42
+ * `%0Nd` semantics.
43
+ */
44
+ export declare function padDisplayIdNumber(n: number, width: number): string;
45
+ /**
46
+ * Format a display ID from a parsed pattern and a numeric value.
47
+ * Inverse of the per-entry scan that {@linkcode highestDisplayIdNumber}
48
+ * performs.
49
+ */
50
+ export declare function formatDisplayId(shape: DisplayIdPatternShape, n: number): string;
51
+ /**
52
+ * Scan `entries` for the highest numeric value used by any display
53
+ * ID that matches the given shape (same prefix AND same suffix; the
54
+ * numeric segment is parsed as a base-10 integer). Returns 0 when no
55
+ * matching ID exists, so `+ 1` yields the next sequential number.
56
+ */
57
+ export declare function highestDisplayIdNumber(shape: DisplayIdPatternShape, entries: Iterable<{
58
+ displayId: string;
59
+ }>): number;
60
+ //# sourceMappingURL=display_id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display_id.d.ts","sourceRoot":"","sources":["../../src/profile/display_id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAKD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GACd,qBAAqB,GAAG,SAAS,CAUnC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,qBAAqB,EAC5B,CAAC,EAAE,MAAM,GACR,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,QAAQ,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GACvC,MAAM,CAcR"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * @module core/profile/display_id
4
+ *
5
+ * Shared parser for the `display-id-pattern` template used by profile
6
+ * type declarations. Patterns look like:
7
+ *
8
+ * STK_{n:4d}
9
+ * STK_AEB_{n:04d}
10
+ * REQ-{n:03d}-draft
11
+ *
12
+ * The `{n:Nd}` placeholder (with optional leading zero in the Nd
13
+ * form) names the sequential number slot. The text before the
14
+ * placeholder becomes the literal prefix; the text after becomes the
15
+ * literal suffix.
16
+ *
17
+ * Note: the `{scope}` placeholder documented in the profile schema
18
+ * is NOT substituted here — callers handle that separately. For
19
+ * patterns containing `{scope}`, the literal text `{scope}` ends up
20
+ * in `prefix` (or `suffix`) and must be replaced upstream before the
21
+ * pattern is fed to scaffolding.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.parseDisplayIdPattern = parseDisplayIdPattern;
25
+ exports.padDisplayIdNumber = padDisplayIdNumber;
26
+ exports.formatDisplayId = formatDisplayId;
27
+ exports.highestDisplayIdNumber = highestDisplayIdNumber;
28
+ /** Regex capturing the `{n:Nd}` placeholder; `0` and the digit count are both captured. */
29
+ const PLACEHOLDER_RE = /\{n:(\d+)d\}/;
30
+ /**
31
+ * Parse a `display-id-pattern` template. Returns `undefined` when
32
+ * the pattern does not contain a recognised `{n:Nd}` placeholder so
33
+ * callers can decide how to surface the error (CLI exits, LSP
34
+ * silently skips the type).
35
+ */
36
+ function parseDisplayIdPattern(pattern) {
37
+ const match = PLACEHOLDER_RE.exec(pattern);
38
+ if (!match)
39
+ return undefined;
40
+ const width = parseInt(match[1], 10);
41
+ if (!Number.isFinite(width) || width < 1)
42
+ return undefined;
43
+ return {
44
+ prefix: pattern.slice(0, match.index),
45
+ width,
46
+ suffix: pattern.slice(match.index + match[0].length),
47
+ };
48
+ }
49
+ /**
50
+ * Pad a positive integer with leading zeros to at least `width`
51
+ * characters. Numbers longer than `width` are left unchanged — the
52
+ * pattern's width is a minimum, not a maximum, mirroring printf
53
+ * `%0Nd` semantics.
54
+ */
55
+ function padDisplayIdNumber(n, width) {
56
+ return n.toString().padStart(width, "0");
57
+ }
58
+ /**
59
+ * Format a display ID from a parsed pattern and a numeric value.
60
+ * Inverse of the per-entry scan that {@linkcode highestDisplayIdNumber}
61
+ * performs.
62
+ */
63
+ function formatDisplayId(shape, n) {
64
+ return `${shape.prefix}${padDisplayIdNumber(n, shape.width)}${shape.suffix}`;
65
+ }
66
+ /**
67
+ * Scan `entries` for the highest numeric value used by any display
68
+ * ID that matches the given shape (same prefix AND same suffix; the
69
+ * numeric segment is parsed as a base-10 integer). Returns 0 when no
70
+ * matching ID exists, so `+ 1` yields the next sequential number.
71
+ */
72
+ function highestDisplayIdNumber(shape, entries) {
73
+ let max = 0;
74
+ for (const entry of entries) {
75
+ const id = entry.displayId;
76
+ if (!id.startsWith(shape.prefix))
77
+ continue;
78
+ if (shape.suffix && !id.endsWith(shape.suffix))
79
+ continue;
80
+ const numberPart = id.slice(shape.prefix.length, id.length - shape.suffix.length);
81
+ const n = parseInt(numberPart, 10);
82
+ if (!isNaN(n) && n > max)
83
+ max = n;
84
+ }
85
+ return max;
86
+ }
@@ -19,6 +19,9 @@ export type { MergeResult } from "./merge.js";
19
19
  export { resolveEntryColor } from "./colors.js";
20
20
  export { buildEffectiveDisciplineRegistry } from "./discipline_registry.js";
21
21
  export { inferDisciplineMode, resolveDisciplineMode, } from "./discipline_mode.js";
22
+ export { formatDisplayId, highestDisplayIdNumber, padDisplayIdNumber, parseDisplayIdPattern, } from "./display_id.js";
23
+ export type { DisplayIdPatternShape } from "./display_id.js";
24
+ export { entryMatchesTargets, filterEntriesByTraceTargets, targetsForRelation, } from "./trace_targets.js";
22
25
  export { buildProfileIntrospection } from "./introspect.js";
23
26
  export type { AttributeDetail, ConventionDetail, LabelConcernDetail, ProfileElementDetail, ProfileElementKind, ProfileElementRef, ProfileIntrospection, ProfileOverview, ProvenancedDescription, RelationDetail, TypeDetail, } from "./introspect.js";
24
27
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/profile/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B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