@kjanat/dreamcli 3.0.0-rc.1 → 3.0.0-rc.3

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 (137) hide show
  1. package/CHANGELOG.md +37 -1
  2. package/dist/core/cli/dispatch.mjs +214 -1
  3. package/dist/core/cli/help-links.mjs +41 -1
  4. package/dist/core/cli/index.mjs +901 -1
  5. package/dist/core/cli/planner.mjs +300 -1
  6. package/dist/core/cli/plugin.mjs +41 -1
  7. package/dist/core/cli/propagate.mjs +57 -1
  8. package/dist/core/cli/root-help.mjs +208 -4
  9. package/dist/core/cli/root-surface.mjs +27 -1
  10. package/dist/core/cli/runtime-preflight.mjs +168 -1
  11. package/dist/core/completion/index.mjs +90 -1
  12. package/dist/core/completion/shells/bash.mjs +304 -3
  13. package/dist/core/completion/shells/fish.mjs +159 -2
  14. package/dist/core/completion/shells/powershell.mjs +353 -2
  15. package/dist/core/completion/shells/shared.mjs +154 -1
  16. package/dist/core/completion/shells/zsh.mjs +244 -2
  17. package/dist/core/config/index.mjs +246 -1
  18. package/dist/core/config/package-json.mjs +385 -3
  19. package/dist/core/errors/index.mjs +87 -1
  20. package/dist/core/execution/index.mjs +189 -1
  21. package/dist/core/help/ansi.mjs +122 -2
  22. package/dist/core/help/index.mjs +329 -7
  23. package/dist/core/json-schema/index.mjs +487 -9
  24. package/dist/core/json-schema/meta-descriptions.generated.mjs +93 -28
  25. package/dist/core/output/activity.mjs +452 -1
  26. package/dist/core/output/bind.mjs +56 -1
  27. package/dist/core/output/contracts.mjs +57 -1
  28. package/dist/core/output/display-value.mjs +32 -1
  29. package/dist/core/output/index.d.mts +21 -0
  30. package/dist/core/output/index.mjs +442 -2
  31. package/dist/core/output/renderers.mjs +46 -1
  32. package/dist/core/output/writer.mjs +12 -1
  33. package/dist/core/parse/index.mjs +555 -1
  34. package/dist/core/prompt/index.d.mts +0 -1
  35. package/dist/core/prompt/index.mjs +348 -6
  36. package/dist/core/resolve/args.mjs +105 -1
  37. package/dist/core/resolve/coerce.mjs +279 -1
  38. package/dist/core/resolve/config.mjs +19 -1
  39. package/dist/core/resolve/errors.mjs +140 -2
  40. package/dist/core/resolve/flags.mjs +196 -1
  41. package/dist/core/resolve/index.mjs +85 -1
  42. package/dist/core/resolve/property.d.mts +0 -1
  43. package/dist/core/resolve/property.mjs +45 -1
  44. package/dist/core/schema/arg.mjs +463 -1
  45. package/dist/core/schema/command.d.mts +18 -0
  46. package/dist/core/schema/command.mjs +712 -1
  47. package/dist/core/schema/flag.mjs +453 -1
  48. package/dist/core/schema/middleware.mjs +41 -1
  49. package/dist/core/schema/number-constraints.mjs +60 -1
  50. package/dist/core/schema-dsl/runtime.mjs +271 -2
  51. package/dist/core/schema-dsl/to-json-schema.mjs +74 -1
  52. package/dist/core/testkit/index.mjs +83 -1
  53. package/dist/index.d.mts +2 -1
  54. package/dist/index.mjs +22 -1
  55. package/dist/runtime/adapter.mjs +82 -1
  56. package/dist/runtime/auto.mjs +46 -1
  57. package/dist/runtime/bun.mjs +28 -1
  58. package/dist/runtime/deno.mjs +217 -2
  59. package/dist/runtime/detect.mjs +45 -1
  60. package/dist/runtime/node.mjs +169 -2
  61. package/dist/runtime/paths.mjs +48 -1
  62. package/dist/runtime.mjs +7 -1
  63. package/dist/strings.mjs +22 -1
  64. package/dist/testkit.mjs +5 -1
  65. package/dist/version.d.mts +7 -3
  66. package/dist/version.mjs +7 -1
  67. package/package.json +21 -26
  68. package/src/core/cli/dispatch.ts +0 -355
  69. package/src/core/cli/help-links.ts +0 -82
  70. package/src/core/cli/index.ts +0 -1614
  71. package/src/core/cli/planner.ts +0 -656
  72. package/src/core/cli/plugin.ts +0 -117
  73. package/src/core/cli/propagate.ts +0 -97
  74. package/src/core/cli/root-help.ts +0 -342
  75. package/src/core/cli/root-surface.ts +0 -87
  76. package/src/core/cli/runtime-preflight.ts +0 -456
  77. package/src/core/completion/index.ts +0 -138
  78. package/src/core/completion/shells/bash.ts +0 -459
  79. package/src/core/completion/shells/fish.ts +0 -259
  80. package/src/core/completion/shells/powershell.ts +0 -439
  81. package/src/core/completion/shells/shared.ts +0 -310
  82. package/src/core/completion/shells/zsh.ts +0 -381
  83. package/src/core/config/index.ts +0 -417
  84. package/src/core/config/package-json.ts +0 -560
  85. package/src/core/errors/index.ts +0 -193
  86. package/src/core/execution/index.ts +0 -265
  87. package/src/core/help/ansi.ts +0 -144
  88. package/src/core/help/index.ts +0 -563
  89. package/src/core/json-schema/index.ts +0 -910
  90. package/src/core/json-schema/meta-descriptions.generated.ts +0 -202
  91. package/src/core/output/activity.ts +0 -575
  92. package/src/core/output/bind.ts +0 -59
  93. package/src/core/output/contracts.ts +0 -194
  94. package/src/core/output/display-value.ts +0 -48
  95. package/src/core/output/index.ts +0 -704
  96. package/src/core/output/renderers.ts +0 -125
  97. package/src/core/output/writer.ts +0 -46
  98. package/src/core/parse/index.ts +0 -742
  99. package/src/core/prompt/index.ts +0 -623
  100. package/src/core/resolve/args.ts +0 -144
  101. package/src/core/resolve/coerce.ts +0 -500
  102. package/src/core/resolve/config.ts +0 -26
  103. package/src/core/resolve/contracts.ts +0 -135
  104. package/src/core/resolve/errors.ts +0 -227
  105. package/src/core/resolve/flags.ts +0 -269
  106. package/src/core/resolve/index.ts +0 -108
  107. package/src/core/resolve/property.ts +0 -99
  108. package/src/core/schema/activity.ts +0 -240
  109. package/src/core/schema/arg.ts +0 -841
  110. package/src/core/schema/command.ts +0 -1500
  111. package/src/core/schema/flag.ts +0 -917
  112. package/src/core/schema/index.ts +0 -96
  113. package/src/core/schema/middleware.ts +0 -171
  114. package/src/core/schema/number-constraints.ts +0 -153
  115. package/src/core/schema/prompt.ts +0 -171
  116. package/src/core/schema/run.ts +0 -198
  117. package/src/core/schema-dsl/index.ts +0 -109
  118. package/src/core/schema-dsl/parse.ts +0 -262
  119. package/src/core/schema-dsl/runtime.ts +0 -609
  120. package/src/core/schema-dsl/to-json-schema.ts +0 -102
  121. package/src/core/testkit/index.ts +0 -147
  122. package/src/index.ts +0 -181
  123. package/src/runtime/adapter.ts +0 -303
  124. package/src/runtime/auto.ts +0 -86
  125. package/src/runtime/bun.ts +0 -48
  126. package/src/runtime/deno.ts +0 -367
  127. package/src/runtime/detect.ts +0 -105
  128. package/src/runtime/index.ts +0 -21
  129. package/src/runtime/node-builtins.d.ts +0 -27
  130. package/src/runtime/node.ts +0 -289
  131. package/src/runtime/paths.ts +0 -64
  132. package/src/runtime/support.ts +0 -77
  133. package/src/runtime.ts +0 -31
  134. package/src/schema.ts +0 -16
  135. package/src/strings.ts +0 -34
  136. package/src/testkit.ts +0 -25
  137. package/src/version.ts +0 -20
package/CHANGELOG.md CHANGED
@@ -7,6 +7,40 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.0.0-rc.3] - 2026-07-06
11
+
12
+ ### Added
13
+
14
+ - **`@kjanat/dreamcli/version` subpath** — exposes the framework's own build
15
+ identity as `DREAMCLI_VERSION` and `DREAMCLI_REVISION` (git short SHA) for
16
+ diagnostics and bug reports. Deliberately a subpath rather than root exports
17
+ so the constants stay out of root-import IDE completions; both report
18
+ `'dev'` when running unbundled source.
19
+
20
+ ## [3.0.0-rc.2] - 2026-07-06
21
+
22
+ ### Added
23
+
24
+ - **`out.color` — context-aware ANSI colors** — every handler's `out` now carries
25
+ a color palette powered by [`ansispeck`](https://github.com/kjanat/ansispeck).
26
+ Colors auto-enable only when stdout is a TTY, JSON mode is off, and the
27
+ environment supports color (`NO_COLOR`, `FORCE_COLOR`, `--no-color`, `--color`,
28
+ `CI` respected); otherwise every formatter is an identity function, so handlers
29
+ can write `out.log(out.color.green('✔ done'))` unconditionally.
30
+ `createOutput({ color })` forces the palette on/off (useful for asserting
31
+ colored output in tests), and the `Colors` type is re-exported from the root
32
+ entrypoint. First runtime dependency — kept external in `dist` (~1 kB gzipped
33
+ install).
34
+
35
+ ### Changed
36
+
37
+ - **npm package now resolves built `dist` on every runtime** — the `bun`/`deno`
38
+ → `src/*.ts` export conditions are gone and `src` is no longer published to
39
+ npm (JSR still ships source). Bun and Deno consumers previously loaded raw
40
+ source where build-time defines never ran, so `version` reported `'dev'`;
41
+ they now get the same tested output as Node, with the real version. The
42
+ export map is generated by tsdown at build time instead of hand-maintained.
43
+
10
44
  ## [3.0.0-rc.1] - 2026-07-02
11
45
 
12
46
  ### Added
@@ -1004,7 +1038,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1004
1038
  - MIT License.
1005
1039
  - Markdownlint configuration.
1006
1040
 
1007
- [Unreleased]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.1...HEAD
1041
+ [Unreleased]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.3...HEAD
1042
+ [3.0.0-rc.3]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.2...v3.0.0-rc.3
1043
+ [3.0.0-rc.2]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.1...v3.0.0-rc.2
1008
1044
  [3.0.0-rc.1]: https://github.com/kjanat/dreamcli/compare/v2.5.0...v3.0.0-rc.1
1009
1045
  [2.5.0]: https://github.com/kjanat/dreamcli/compare/v2.4.1...v2.5.0
1010
1046
  [2.4.1]: https://github.com/kjanat/dreamcli/compare/v2.4.0...v2.4.1
@@ -1 +1,214 @@
1
- import{buildFlagLookup as e,flagExpectsValue as t}from"../parse/index.mjs";function n(t,i,a=[],s=new Map){let c=-1;for(let e=0;e<t.length;e++){let n=t[e];if(n!==void 0){if(n===`--`){e+1<t.length&&(c=e+1);break}if(n.startsWith(`-`)){r(n,s)&&e++;continue}c=e;break}}if(c===-1)return{kind:`unknown`,input:``,candidates:o(i),parentPath:a};let l=t[c];if(l===void 0)return{kind:`unknown`,input:``,candidates:o(i),parentPath:a};let u=i.get(l);if(u===void 0)return{kind:`unknown`,input:l,candidates:o(i),parentPath:a};let d=[...t.slice(0,c),...t.slice(c+1)],f=[...a,u.schema];if(u.subcommands.size>0){let t=n(d,u.subcommands,f,e(u.schema.flags));switch(t.kind){case`match`:return t;case`unknown`:return t.input===``?u.schema.hasAction?{kind:`match`,command:u,commandPath:f,remainingArgv:d}:{kind:`needs-subcommand`,command:u,commandPath:f}:u.schema.hasAction?{kind:`match`,command:u,commandPath:f,remainingArgv:d}:t;case`needs-subcommand`:return t;default:return t}}return{kind:`match`,command:u,commandPath:f,remainingArgv:d}}function r(e,n){if(e.startsWith(`--`)){if(e.includes(`=`))return!1;let r=n.get(e.slice(2));return r!==void 0&&t(r[1])}let r=e.slice(1);for(let e=0;e<r.length;e++){let i=n.get(r.charAt(e));if(i===void 0)return!1;if(t(i[1]))return e===r.length-1}return!1}function i(e,t){let n=e.length,r=t.length,i=r+1,a=new Uint16Array(i),o=new Uint16Array(i);for(let e=0;e<=r;e++)a[e]=e;for(let i=1;i<=n;i++){o[0]=i;for(let n=1;n<=r;n++){let r=e.charAt(i-1)===t.charAt(n-1)?0:1,s=a[n]??0,c=o[n-1]??0,l=a[n-1]??0;o[n]=Math.min(s+1,c+1,l+r)}[a,o]=[o,a]}return a[r]??Math.max(n,r)}function a(e,t){let n,r=4;for(let a of t){let t=i(e,a.schema.name);t<r&&(r=t,n=a.schema.name);for(let t of a.schema.aliases){let o=i(e,t);o<r&&(r=o,n=a.schema.name)}}return r<=3?n:void 0}function o(e){let t=new Set,n=[];for(let r of e.values())t.has(r)||(t.add(r),n.push(r));return n}export{n as dispatch,a as findClosestCommand};
1
+ import { buildFlagLookup, flagExpectsValue } from "../parse/index.mjs";
2
+ //#region src/core/cli/dispatch.ts
3
+ /**
4
+ * Recursive command dispatch for nested command trees.
5
+ *
6
+ * Walks argv segments, matching command names at each level of the tree.
7
+ * Returns a discriminated union describing the dispatch outcome: a matched
8
+ * command with its ancestor path, a group that needs a subcommand, or an
9
+ * unknown command with suggestion candidates.
10
+ *
11
+ * @module dreamcli/core/cli/dispatch
12
+ * @internal
13
+ */
14
+ /**
15
+ * Recursively walk argv, consuming command name segments from the front.
16
+ *
17
+ * At each level, the first non-flag token is tested as a command name
18
+ * against the provided command map. If matched and the matched command
19
+ * has subcommands, dispatch recurses into the child level with the
20
+ * remaining argv.
21
+ *
22
+ * Ambiguity resolution for commands that have both an action handler AND
23
+ * subcommands (e.g. `git remote` lists remotes, `git remote add` dispatches):
24
+ * - If the next token matches a subcommand → descend
25
+ * - If the next token is unknown and the command has a handler → match here
26
+ * - If the next token is unknown and no handler → propagate unknown error
27
+ * - If no next token and command has a handler → match here
28
+ * - If no next token and no handler → needs-subcommand
29
+ *
30
+ * @param argv - Remaining argv tokens (command names + flags + args).
31
+ * @param commands - Command map at the current tree level.
32
+ * @param ancestorPath - Schema path from root to current level (exclusive).
33
+ * @param valueFlags - Lookup of flags valid at this level, used so a
34
+ * space-separated value-flag's value (`--region eu`) is not mistaken for a
35
+ * command name. Empty by default (arity-unaware, legacy behaviour).
36
+ * @returns Discriminated dispatch result.
37
+ *
38
+ * @internal
39
+ */
40
+ function dispatch(argv, commands, ancestorPath = [], valueFlags = /* @__PURE__ */ new Map()) {
41
+ let cmdIdx = -1;
42
+ for (let i = 0; i < argv.length; i++) {
43
+ const token = argv[i];
44
+ if (token === void 0) continue;
45
+ if (token === "--") {
46
+ if (i + 1 < argv.length) cmdIdx = i + 1;
47
+ break;
48
+ }
49
+ if (token.startsWith("-")) {
50
+ if (consumesFollowingToken(token, valueFlags)) i++;
51
+ continue;
52
+ }
53
+ cmdIdx = i;
54
+ break;
55
+ }
56
+ if (cmdIdx === -1) return {
57
+ kind: "unknown",
58
+ input: "",
59
+ candidates: uniqueCommands(commands),
60
+ parentPath: ancestorPath
61
+ };
62
+ const cmdName = argv[cmdIdx];
63
+ if (cmdName === void 0) return {
64
+ kind: "unknown",
65
+ input: "",
66
+ candidates: uniqueCommands(commands),
67
+ parentPath: ancestorPath
68
+ };
69
+ const matched = commands.get(cmdName);
70
+ if (matched === void 0) return {
71
+ kind: "unknown",
72
+ input: cmdName,
73
+ candidates: uniqueCommands(commands),
74
+ parentPath: ancestorPath
75
+ };
76
+ const remaining = [...argv.slice(0, cmdIdx), ...argv.slice(cmdIdx + 1)];
77
+ const currentPath = [...ancestorPath, matched.schema];
78
+ if (matched.subcommands.size > 0) {
79
+ const subResult = dispatch(remaining, matched.subcommands, currentPath, buildFlagLookup(matched.schema.flags));
80
+ switch (subResult.kind) {
81
+ case "match": return subResult;
82
+ case "unknown":
83
+ if (subResult.input === "") {
84
+ if (matched.schema.hasAction) return {
85
+ kind: "match",
86
+ command: matched,
87
+ commandPath: currentPath,
88
+ remainingArgv: remaining
89
+ };
90
+ return {
91
+ kind: "needs-subcommand",
92
+ command: matched,
93
+ commandPath: currentPath
94
+ };
95
+ }
96
+ if (matched.schema.hasAction) return {
97
+ kind: "match",
98
+ command: matched,
99
+ commandPath: currentPath,
100
+ remainingArgv: remaining
101
+ };
102
+ return subResult;
103
+ case "needs-subcommand": return subResult;
104
+ default: return subResult;
105
+ }
106
+ }
107
+ return {
108
+ kind: "match",
109
+ command: matched,
110
+ commandPath: currentPath,
111
+ remainingArgv: remaining
112
+ };
113
+ }
114
+ /**
115
+ * Whether a flag token consumes the following argv token as its value.
116
+ *
117
+ * Mirrors the parser's value-consumption rules (`parseLongFlag` /
118
+ * `parseShortFlags`) so the command-name scan skips exactly the tokens the
119
+ * parser would treat as flag values:
120
+ * - `--flag value` → consumes when `--flag` is a known value-flag.
121
+ * - `--flag=value` → self-contained, consumes nothing.
122
+ * - `-abc value` → consumes only when the trailing short flag is a value-flag;
123
+ * an earlier value-flag char takes the rest of the group as an inline value.
124
+ *
125
+ * Unknown flags conservatively consume nothing (the parser reports them later).
126
+ *
127
+ * @internal
128
+ */
129
+ function consumesFollowingToken(token, valueFlags) {
130
+ if (token.startsWith("--")) {
131
+ if (token.includes("=")) return false;
132
+ const entry = valueFlags.get(token.slice(2));
133
+ return entry !== void 0 && flagExpectsValue(entry[1]);
134
+ }
135
+ const chars = token.slice(1);
136
+ for (let i = 0; i < chars.length; i++) {
137
+ const entry = valueFlags.get(chars.charAt(i));
138
+ if (entry === void 0) return false;
139
+ if (!flagExpectsValue(entry[1])) continue;
140
+ return i === chars.length - 1;
141
+ }
142
+ return false;
143
+ }
144
+ /**
145
+ * Levenshtein distance between two strings.
146
+ * @internal
147
+ */
148
+ function levenshtein(a, b) {
149
+ const m = a.length;
150
+ const n = b.length;
151
+ const w = n + 1;
152
+ let prev = new Uint16Array(w);
153
+ let curr = new Uint16Array(w);
154
+ for (let j = 0; j <= n; j++) prev[j] = j;
155
+ for (let i = 1; i <= m; i++) {
156
+ curr[0] = i;
157
+ for (let j = 1; j <= n; j++) {
158
+ const cost = a.charAt(i - 1) === b.charAt(j - 1) ? 0 : 1;
159
+ const del = prev[j] ?? 0;
160
+ const ins = curr[j - 1] ?? 0;
161
+ const sub = prev[j - 1] ?? 0;
162
+ curr[j] = Math.min(del + 1, ins + 1, sub + cost);
163
+ }
164
+ [prev, curr] = [curr, prev];
165
+ }
166
+ return prev[n] ?? Math.max(m, n);
167
+ }
168
+ /**
169
+ * Find the closest command name match for a "did you mean?" suggestion.
170
+ *
171
+ * Searches command names and aliases. Returns `undefined` if no
172
+ * sufficiently close match exists (threshold: 3).
173
+ *
174
+ * @internal
175
+ */
176
+ function findClosestCommand(input, commands) {
177
+ const MAX_DISTANCE = 3;
178
+ let bestName;
179
+ let bestDist = 4;
180
+ for (const cmd of commands) {
181
+ const nameDist = levenshtein(input, cmd.schema.name);
182
+ if (nameDist < bestDist) {
183
+ bestDist = nameDist;
184
+ bestName = cmd.schema.name;
185
+ }
186
+ for (const alias of cmd.schema.aliases) {
187
+ const aliasDist = levenshtein(input, alias);
188
+ if (aliasDist < bestDist) {
189
+ bestDist = aliasDist;
190
+ bestName = cmd.schema.name;
191
+ }
192
+ }
193
+ }
194
+ return bestDist <= MAX_DISTANCE ? bestName : void 0;
195
+ }
196
+ /**
197
+ * Deduplicate commands from a name+alias map.
198
+ *
199
+ * A map keyed by name *and* alias contains duplicate entries for aliased
200
+ * commands. This returns unique commands (by schema identity).
201
+ *
202
+ * @internal
203
+ */
204
+ function uniqueCommands(commands) {
205
+ const seen = /* @__PURE__ */ new Set();
206
+ const result = [];
207
+ for (const cmd of commands.values()) if (!seen.has(cmd)) {
208
+ seen.add(cmd);
209
+ result.push(cmd);
210
+ }
211
+ return result;
212
+ }
213
+ //#endregion
214
+ export { dispatch, findClosestCommand };
@@ -1 +1,41 @@
1
- import{packageRepositoryUrl as e}from"../config/package-json.mjs";function t(e,t){let n;try{n=new URL(e).hostname}catch{return}if(n===`github.com`)return`${e}/releases/tag/v${t}`;if(n===`gitlab.com`)return`${e}/-/releases/v${t}`}function n(n,r,i){if(n===void 0)return;if(r===void 0||n.name!==void 0&&n.version!==void 0)return n;let a=e(r);return{name:n.name??a??r.homepage,version:n.version??(a!==void 0&&i!==void 0?t(a,i):void 0)}}export{n as deriveHelpLinks};
1
+ import { packageRepositoryUrl } from "../config/package-json.mjs";
2
+ //#region src/core/cli/help-links.ts
3
+ /**
4
+ * Build the release-tag URL for a version on a known forge.
5
+ *
6
+ * GitHub and GitLab have stable release-tag routes; other hosts return
7
+ * `undefined` rather than guessing.
8
+ *
9
+ * @internal
10
+ */
11
+ function releaseTagUrl(repoUrl, version) {
12
+ let hostname;
13
+ try {
14
+ hostname = new URL(repoUrl).hostname;
15
+ } catch {
16
+ return;
17
+ }
18
+ if (hostname === "github.com") return `${repoUrl}/releases/tag/v${version}`;
19
+ if (hostname === "gitlab.com") return `${repoUrl}/-/releases/v${version}`;
20
+ }
21
+ /**
22
+ * Fill `undefined` link fields from package.json metadata.
23
+ *
24
+ * Explicit URLs always win. The name falls back to the normalized
25
+ * `repository` URL, then `homepage`; the version falls back to the forge
26
+ * release-tag URL when both a repository and a version are known.
27
+ * Idempotent — already-resolved fields pass through unchanged.
28
+ *
29
+ * @internal
30
+ */
31
+ function deriveHelpLinks(links, pkg, version) {
32
+ if (links === void 0) return void 0;
33
+ if (pkg === void 0 || links.name !== void 0 && links.version !== void 0) return links;
34
+ const repoUrl = packageRepositoryUrl(pkg);
35
+ return {
36
+ name: links.name ?? repoUrl ?? pkg.homepage,
37
+ version: links.version ?? (repoUrl !== void 0 && version !== void 0 ? releaseTagUrl(repoUrl, version) : void 0)
38
+ };
39
+ }
40
+ //#endregion
41
+ export { deriveHelpLinks };