@sublang/spex 4.2.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +438 -89
  2. package/dist/cli.js +80 -42
  3. package/dist/commands/add.d.ts +12 -0
  4. package/dist/commands/add.js +138 -0
  5. package/dist/commands/auth-target.d.ts +12 -0
  6. package/dist/commands/auth-target.js +52 -0
  7. package/dist/commands/environment.d.ts +117 -0
  8. package/dist/commands/environment.js +399 -0
  9. package/dist/commands/export.d.ts +21 -0
  10. package/dist/commands/export.js +663 -0
  11. package/dist/commands/home.d.ts +56 -0
  12. package/dist/commands/home.js +215 -0
  13. package/dist/commands/install.d.ts +2 -0
  14. package/dist/commands/install.js +48 -0
  15. package/dist/commands/list.d.ts +2 -0
  16. package/dist/commands/list.js +87 -0
  17. package/dist/commands/login.d.ts +2 -0
  18. package/dist/commands/login.js +211 -0
  19. package/dist/commands/logout.d.ts +2 -0
  20. package/dist/commands/logout.js +74 -0
  21. package/dist/commands/publish.d.ts +2 -0
  22. package/dist/commands/publish.js +120 -0
  23. package/dist/commands/remove.d.ts +2 -0
  24. package/dist/commands/remove.js +34 -0
  25. package/dist/commands/run.d.ts +50 -0
  26. package/dist/commands/run.js +312 -0
  27. package/dist/commands/search.d.ts +2 -0
  28. package/dist/commands/search.js +34 -0
  29. package/dist/commands/settle.d.ts +124 -0
  30. package/dist/commands/settle.js +475 -0
  31. package/dist/commands/update.d.ts +2 -0
  32. package/dist/commands/update.js +37 -0
  33. package/dist/commands/whoami.d.ts +2 -0
  34. package/dist/commands/whoami.js +71 -0
  35. package/dist/lib/environment/agent-folders.d.ts +14 -0
  36. package/dist/lib/environment/agent-folders.js +11 -0
  37. package/dist/lib/environment/archive.d.ts +39 -0
  38. package/dist/lib/environment/archive.js +122 -0
  39. package/dist/lib/environment/builtins.d.ts +112 -0
  40. package/dist/lib/environment/builtins.js +539 -0
  41. package/dist/lib/environment/citations.d.ts +75 -0
  42. package/dist/lib/environment/citations.js +267 -0
  43. package/dist/lib/environment/exports.d.ts +190 -0
  44. package/dist/lib/environment/exports.js +1029 -0
  45. package/dist/lib/environment/format.d.ts +133 -0
  46. package/dist/lib/environment/format.js +651 -0
  47. package/dist/lib/environment/git-source.d.ts +41 -0
  48. package/dist/lib/environment/git-source.js +159 -0
  49. package/dist/lib/environment/index.d.ts +20 -0
  50. package/dist/lib/environment/index.js +27 -0
  51. package/dist/lib/environment/install.d.ts +140 -0
  52. package/dist/lib/environment/install.js +694 -0
  53. package/dist/lib/environment/layout.d.ts +15 -0
  54. package/dist/lib/environment/layout.js +50 -0
  55. package/dist/lib/environment/lock.d.ts +87 -0
  56. package/dist/lib/environment/lock.js +305 -0
  57. package/dist/lib/environment/marker.d.ts +15 -0
  58. package/dist/lib/environment/marker.js +31 -0
  59. package/dist/lib/environment/own-paths.d.ts +59 -0
  60. package/dist/lib/environment/own-paths.js +174 -0
  61. package/dist/lib/environment/placed-record.d.ts +32 -0
  62. package/dist/lib/environment/placed-record.js +72 -0
  63. package/dist/lib/environment/registries.d.ts +23 -0
  64. package/dist/lib/environment/registries.js +48 -0
  65. package/dist/lib/environment/registry.d.ts +172 -0
  66. package/dist/lib/environment/registry.js +390 -0
  67. package/dist/lib/environment/requests.d.ts +109 -0
  68. package/dist/lib/environment/requests.js +401 -0
  69. package/dist/lib/environment/resolve.d.ts +70 -0
  70. package/dist/lib/environment/resolve.js +451 -0
  71. package/dist/lib/environment/semver.d.ts +30 -0
  72. package/dist/lib/environment/semver.js +130 -0
  73. package/dist/lib/environment/store.d.ts +23 -0
  74. package/dist/lib/environment/store.js +123 -0
  75. package/dist/lib/environment/tar.d.ts +27 -0
  76. package/dist/lib/environment/tar.js +219 -0
  77. package/dist/lib/files.d.ts +66 -0
  78. package/dist/lib/files.js +233 -0
  79. package/dist/lib/git-host.d.ts +579 -0
  80. package/dist/lib/git-host.js +1363 -0
  81. package/dist/lib/home-file.d.ts +124 -0
  82. package/dist/lib/home-file.js +288 -0
  83. package/dist/lib/instance.d.ts +63 -0
  84. package/dist/lib/instance.js +130 -0
  85. package/dist/lib/words.d.ts +32 -0
  86. package/dist/lib/words.js +27 -0
  87. package/dist/lint.js +8 -0
  88. package/dist/testing/index.d.ts +1 -0
  89. package/dist/testing/index.js +7 -0
  90. package/dist/testing/standin-registry.d.ts +94 -0
  91. package/dist/testing/standin-registry.js +449 -0
  92. package/package.json +37 -3
  93. package/dist/attached-cli.d.ts +0 -13
  94. package/dist/attached-cli.js +0 -249
  95. package/dist/attached-client.d.ts +0 -53
  96. package/dist/attached-client.js +0 -237
  97. package/dist/generated-protocol.d.ts +0 -2
  98. package/dist/generated-protocol.js +0 -6
  99. package/dist/package-init.d.ts +0 -21
  100. package/dist/package-init.js +0 -442
@@ -0,0 +1,399 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
3
+ // The environment a package command acts on (cli-1, environments-26,
4
+ // DR-165): its root is the nearest folder, the current one included,
5
+ // holding `spex.yaml`, else the top level of the Git work tree the
6
+ // current folder lies in, else the current folder. Its instance is the
7
+ // `space` its `spex.yaml` names, else the home's default instance
8
+ // (environments-2). The home is `SPEX_HOME` else `~/.spex`, read with
9
+ // no folder check; the store and the cache are the ones the app's core
10
+ // uses under it, so both hosts share one store (environments-7). No
11
+ // clone, lease, session or record of the home is read or written: a
12
+ // root inside the home, other than a seat's project under `projects/`,
13
+ // is refused, as is the user's home folder, whose agent folders are the
14
+ // user-level ones your own group's export writes (environments-8).
15
+ import { spawnSync } from "node:child_process";
16
+ import { realpathSync, statSync } from "node:fs";
17
+ import { homedir } from "node:os";
18
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
19
+ import { builtinRegistrySource, compositeRegistry, ContentStore, environmentInstance, environmentRegistry, FormatError, gitSource, installRegistryOrder, LockError, parseLock, parseRequests, RegistryClient, RegistryError, RequestsError, unaskedRegistry, } from "../lib/environment/index.js";
20
+ import { readVersioned } from "../lib/files.js";
21
+ import { CredentialChanged } from "../lib/git-host.js";
22
+ import { accountAt, instanceAt } from "../lib/home-file.js";
23
+ import { canonicalOrigin } from "../lib/instance.js";
24
+ import { clientOf, credentialsOf, defaultInstance, homeDir, hostCause, nameOf, readHome, registryName } from "./home.js";
25
+ import { Refusal } from "./run.js";
26
+ /** Where a path is on disk, spelled as the file system spells it: its
27
+ * nearest standing ancestor with every link resolved and every short
28
+ * name made long, and the rest as written. */
29
+ export function actualPath(path) {
30
+ const rest = [];
31
+ for (let current = resolve(path);; current = dirname(current)) {
32
+ try {
33
+ return join(realpathSync.native(current), ...rest.reverse());
34
+ }
35
+ catch {
36
+ if (dirname(current) === current)
37
+ return resolve(path);
38
+ rest.push(basename(current));
39
+ }
40
+ }
41
+ }
42
+ /** Whether `inner` is `outer` or lies below it. */
43
+ function within(outer, inner) {
44
+ const path = relative(outer, inner);
45
+ return path === "" || (path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path));
46
+ }
47
+ /** Why a folder cannot be an environment's root (cli-1), or null: the
48
+ * user's home folder, a folder inside the Spex home other than a seat's
49
+ * project below `projects/`, and a folder whose `.spex` holds the home. */
50
+ export function refusedRoot(dir, home) {
51
+ const at = actualPath(dir);
52
+ const spexHome = actualPath(home);
53
+ if (at === actualPath(homedir()))
54
+ return "is your home folder, where spex manages no packages";
55
+ if (within(spexHome, at) && !(within(join(spexHome, "projects"), at) && at !== join(spexHome, "projects"))) {
56
+ return `lies in the Spex home ${home}, which the app keeps`;
57
+ }
58
+ if (within(join(at, ".spex"), spexHome))
59
+ return `holds the Spex home ${home} as its .spex`;
60
+ return null;
61
+ }
62
+ /** The environment root of a command run in `cwd` (cli-1), spelled as
63
+ * `cwd` is, so a path given from `cwd` compares with it as text. A
64
+ * `spex.yaml` in a folder that cannot be a root is passed over; a root
65
+ * that cannot be one refuses the command. */
66
+ export function environmentRoot(cwd = process.cwd(), home = homeDir()) {
67
+ const start = resolve(cwd);
68
+ let root = null;
69
+ for (let dir = start;; dir = dirname(dir)) {
70
+ if (isFile(join(dir, "spex.yaml")) && refusedRoot(dir, home) === null) {
71
+ root = dir;
72
+ break;
73
+ }
74
+ if (dirname(dir) === dir)
75
+ break;
76
+ }
77
+ root ??= gitTopLevel(start) ?? start;
78
+ const refused = refusedRoot(root, home);
79
+ if (refused !== null)
80
+ throw new Refusal(`${root} ${refused} — run spex in a project folder`);
81
+ return root;
82
+ }
83
+ /** The top level of `start`'s Git work tree as Git names it, spelled as
84
+ * `start` is where the two are one folder. */
85
+ function spelledAs(start, top) {
86
+ const real = actualPath(top);
87
+ const path = relative(real, actualPath(start));
88
+ if (path === "")
89
+ return start;
90
+ if (path === ".." || path.startsWith(`..${sep}`) || isAbsolute(path))
91
+ return top;
92
+ const candidate = resolve(start, ...path.split(sep).map(() => ".."));
93
+ return actualPath(candidate) === real ? candidate : top;
94
+ }
95
+ function isFile(path) {
96
+ try {
97
+ return statSync(path).isFile();
98
+ }
99
+ catch {
100
+ return false;
101
+ }
102
+ }
103
+ /** The top level of the Git work tree `cwd` lies in; none where Git is
104
+ * absent or `cwd` lies in no work tree. */
105
+ function gitTopLevel(cwd) {
106
+ let result;
107
+ try {
108
+ result = spawnSync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
109
+ }
110
+ catch {
111
+ return null;
112
+ }
113
+ const top = result.status === 0 ? result.stdout.trim() : "";
114
+ return top === "" ? null : spelledAs(cwd, resolve(top));
115
+ }
116
+ /** A path under the root as a reader sees it, `/`-separated. */
117
+ export function shown(root, path) {
118
+ const inside = relative(root, path);
119
+ return inside === "" ? "." : inside.split(sep).join("/");
120
+ }
121
+ export class Environment {
122
+ root;
123
+ homeDir;
124
+ /** `home.yaml` as it stood when the command began; null where none. */
125
+ home;
126
+ requestsFile;
127
+ lockFile;
128
+ store;
129
+ cache;
130
+ git;
131
+ registries = new Map();
132
+ clients = new Map();
133
+ builtin;
134
+ constructor(cwd = process.cwd()) {
135
+ this.homeDir = homeDir();
136
+ this.root = environmentRoot(cwd, this.homeDir);
137
+ this.home = readHome(this.homeDir);
138
+ this.requestsFile = join(this.root, "spex.yaml");
139
+ this.lockFile = join(this.root, "spex.lock");
140
+ this.store = new ContentStore(this.homeDir);
141
+ this.cache = join(this.homeDir, "cache");
142
+ this.git = gitSource(this.cache);
143
+ }
144
+ /** `spex.yaml` as it stands, null where absent; one that does not read
145
+ * refuses the command saying why and what to do (environments-2,
146
+ * cli-13). */
147
+ readRequests() {
148
+ const { bytes, version } = readVersioned(this.requestsFile);
149
+ if (bytes === null)
150
+ return null;
151
+ const text = bytes.toString("utf8");
152
+ try {
153
+ return { requests: parseRequests(text), text, version };
154
+ }
155
+ catch (error) {
156
+ if (error instanceof RequestsError && error.newerFormat !== undefined)
157
+ throw new Refusal("spex.yaml is from a newer Spex — update Spex");
158
+ // The same words as the Packages tab's (DR-172).
159
+ throw new Refusal(`${error.message} — fix the file, then retry`);
160
+ }
161
+ }
162
+ /** `spex.lock` as it stands, null where absent; one from a newer Spex,
163
+ * or one that does not read, refuses the command saying what to do
164
+ * (environments-3, cli-13): `spex update` writes it again, where the
165
+ * Packages tab, whose Update refuses a lock that does not read, says
166
+ * to remove it first. */
167
+ readLock() {
168
+ const read = this.readLockForUpdate();
169
+ if (read !== null && read.lock === null)
170
+ throw new Refusal(`${read.cause} — spex update rewrites it`);
171
+ return read;
172
+ }
173
+ /** `spex.lock` as `spex update` reads it: one that does not read stands
174
+ * with its version and no lock, for the update to rewrite under that
175
+ * version; one from a newer Spex still refuses the command, as this
176
+ * Spex would lose what it records. */
177
+ readLockForUpdate() {
178
+ const { bytes, version } = readVersioned(this.lockFile);
179
+ if (bytes === null)
180
+ return null;
181
+ const text = bytes.toString("utf8");
182
+ try {
183
+ return { lock: parseLock(text), text, version };
184
+ }
185
+ catch (error) {
186
+ if (error instanceof LockError && error.newerFormat !== undefined)
187
+ throw new Refusal("spex.lock is from a newer Spex — update Spex");
188
+ return { lock: null, text, version, cause: error.message };
189
+ }
190
+ }
191
+ /** The home's default instance (storage-2). */
192
+ defaultOrigin() {
193
+ return canonicalOrigin(defaultInstance(this.home).origin);
194
+ }
195
+ /** The environment's instance (environments-2): the `space` the
196
+ * requests name, else the home's default instance. */
197
+ instanceOf(requests) {
198
+ return environmentInstance(requests, { origin: defaultInstance(this.home).origin, instances: this.home?.instances ?? [] });
199
+ }
200
+ registryOf(requests) {
201
+ return environmentRegistry(requests, { origin: defaultInstance(this.home).origin, instances: this.home?.instances ?? [] });
202
+ }
203
+ /** A registry as the reader knows it (cli-22): its descriptor's
204
+ * display name, else its host; never a Space entry's name. */
205
+ registryName(origin) {
206
+ return registryName(this.homeDir, origin);
207
+ }
208
+ /** The login a registry call presents at an origin, for a refusal to
209
+ * name (cli-13): null where this computer holds no sign-in for that
210
+ * purpose there; undefined where it holds one whose login cannot be
211
+ * read now. A Space's login is its home entry's; a registry's is read
212
+ * from its account API. */
213
+ async loginAt(origin) {
214
+ const credentials = credentialsOf(this.homeDir, origin, "registry");
215
+ try {
216
+ if (!(await credentials.read()))
217
+ return null;
218
+ }
219
+ catch {
220
+ return undefined;
221
+ }
222
+ try {
223
+ return (await clientOf(origin, credentials, undefined, "registry").me()).login;
224
+ }
225
+ catch {
226
+ try {
227
+ return (await credentials.read()) ? undefined : null;
228
+ }
229
+ catch {
230
+ return undefined;
231
+ }
232
+ }
233
+ }
234
+ /** A registry's refusal or failure as one phrase ending in what to do
235
+ * (cli-13): the registry named as cli-22 names it, a private package by
236
+ * the sign-in state, a 403 by the operation refused. */
237
+ async registryRefusal(error, context) {
238
+ if (error instanceof Refusal)
239
+ return error;
240
+ if (error instanceof FormatError) {
241
+ const issues = error.issues.map((issue) => (issue.path ? `${issue.path}: ${issue.message}` : issue.message)).join("; ");
242
+ return new Refusal(`the package is not ready: ${issues} — fix its meta.yaml, then retry`);
243
+ }
244
+ if (!(error instanceof RegistryError))
245
+ return new Refusal(`${error instanceof Error ? error.message : String(error)} — retry`);
246
+ let origin = context.origin;
247
+ try {
248
+ if (error.registry !== undefined)
249
+ origin = canonicalOrigin(error.registry);
250
+ }
251
+ catch { /* the registry asked */ }
252
+ const name = await this.registryName(origin);
253
+ const pkg = error.packageName;
254
+ // `spex login` selects this folder's package registry (cli-10).
255
+ // An exact locked source at another registry names that target.
256
+ const login = context.operation !== "publish" && origin === context.origin
257
+ ? "spex login"
258
+ : `spex login --registry ${origin}`;
259
+ const about = pkg ? `${pkg}: ` : "";
260
+ if (error.cause instanceof CredentialChanged)
261
+ return new Refusal(`your sign-in at ${name} changed meanwhile — retry`);
262
+ switch (error.kind) {
263
+ case "not_found": {
264
+ if (error.code === "suppressed")
265
+ return new Refusal(`${about}withdrawn at ${name} — spex update picks another version`);
266
+ const who = await this.loginAt(origin);
267
+ if (who === null)
268
+ return new Refusal(`${about}not at ${name}, or private — ${login}, then retry`);
269
+ return new Refusal(`${about}not at ${name}, or not shared with ${who === undefined ? "this account" : `@${who}`} — check the name, or ask its owner`);
270
+ }
271
+ case "forbidden": {
272
+ if (context.operation === "publish") {
273
+ const org = pkg?.split("/")[0] ?? "this org";
274
+ return new Refusal(`${org} is not yours at ${name} — claim it at ${origin}/account/orgs?scope=registry`);
275
+ }
276
+ const who = await this.loginAt(origin);
277
+ return new Refusal(`${about}not shared with ${typeof who === "string" ? `@${who}` : "this account"} at ${name} — ask its owner`);
278
+ }
279
+ case "unauthenticated":
280
+ return new Refusal(`sign-in expired at ${name} — ${login}`);
281
+ case "unavailable":
282
+ if (error.code === "orgs_unavailable")
283
+ return new Refusal(`Your orgs at ${name} could not be read — check the connection, then retry`);
284
+ if (error.code === "unreachable")
285
+ return new Refusal(`${name} could not be reached — check the connection, then retry`);
286
+ // A registry the lock names by no address is never asked.
287
+ if (error.code === "unasked")
288
+ return new Refusal(`${about}spex.lock names no registry address for it — spex update writes spex.lock again`);
289
+ if (error.status !== undefined && error.status >= 500)
290
+ return new Refusal(`${name} is down (${error.status}) — retry later`);
291
+ if (error.status !== undefined)
292
+ return new Refusal(`${name} answered ${error.status} — retry later`);
293
+ // No sign-in to present: its cause, which says what to do.
294
+ return new Refusal(/ — /.test(error.message) ? error.message : `${error.message} — retry later`);
295
+ case "rejected": {
296
+ const release = pkg && context.version ? `${pkg}@${context.version}` : pkg ?? "the package";
297
+ if (error.status === 409)
298
+ return new Refusal(`${release} is already at ${name} — raise the version in meta.yaml, then retry`);
299
+ if (error.status === 413)
300
+ return new Refusal(`${release} is too large for ${name} — leave out what it does not need, then retry`);
301
+ const details = (error.details ?? []).map((detail) => typeof detail === "object" && detail !== null && "message" in detail ? String(detail.message) : JSON.stringify(detail));
302
+ return new Refusal(`${name} refused ${release}${details.length > 0 ? `: ${details.join("; ")}` : ""} — fix the package, then retry`);
303
+ }
304
+ case "format":
305
+ return new Refusal(`${error.message} — update Spex`);
306
+ case "unreadable":
307
+ return new Refusal(`${error.message} — retry later, or update Spex`);
308
+ }
309
+ }
310
+ /** A Space as the reader knows it: its display name where the home
311
+ * holds one, else its host. */
312
+ nameOf(origin) {
313
+ const entry = (this.home && instanceAt(this.home, origin)) ?? { origin, clientId: "spex" };
314
+ return nameOf(entry);
315
+ }
316
+ /** Whether the device is signed in at an instance: the home lists it
317
+ * with its account, not signed out. */
318
+ signedInAt(origin) {
319
+ return this.home !== null && accountAt(this.home, origin) !== null;
320
+ }
321
+ /** Every instance the home is signed in to, in its order. */
322
+ signedIn() {
323
+ return (this.home?.instances ?? []).filter((entry) => this.signedInAt(entry.origin)).map((entry) => entry.origin);
324
+ }
325
+ /** The package registry's access secret, kept current by its scoped
326
+ * client (environments-12), independent of any Space sign-in. */
327
+ async tokenAt(origin) {
328
+ if (!(await credentialsOf(this.homeDir, origin, "registry").read()))
329
+ return null;
330
+ try {
331
+ return await this.clientAt(origin).accessSecret();
332
+ }
333
+ catch (error) {
334
+ throw new Error(hostCause(error, await this.registryName(origin)));
335
+ }
336
+ }
337
+ /** One registry-purpose client per origin. A refused refresh affects
338
+ * only its registry slot and never the Space's home entry. */
339
+ clientAt(origin) {
340
+ const at = canonicalOrigin(origin);
341
+ const key = at;
342
+ let client = this.clients.get(key);
343
+ if (!client) {
344
+ client = clientOf(at, credentialsOf(this.homeDir, at, "registry"), undefined, "registry");
345
+ this.clients.set(key, client);
346
+ }
347
+ return client;
348
+ }
349
+ /** The built-in spec package as this device's seed holds it
350
+ * (environments-7, environments-11): what the app seeded into the
351
+ * shared store, read from `cache/builtins/`; the command line ships
352
+ * none of its own. */
353
+ seed() {
354
+ this.builtin ??= builtinRegistrySource({ store: this.store, cacheDir: this.cache });
355
+ return this.builtin;
356
+ }
357
+ /** One package registry and its independent grant, composed with the
358
+ * device's built-in seed (environments-12). */
359
+ registry(origin) {
360
+ const at = canonicalOrigin(origin);
361
+ const key = at;
362
+ let registry = this.registries.get(key);
363
+ if (!registry) {
364
+ const remote = new RegistryClient({
365
+ url: at,
366
+ token: () => this.tokenAt(at),
367
+ refused: async (token) => {
368
+ if (!(await this.clientAt(at).signOutRefused(token)))
369
+ throw new CredentialChanged();
370
+ },
371
+ });
372
+ registry = { remote, source: compositeRegistry(this.seed(), remote) };
373
+ this.registries.set(key, registry);
374
+ }
375
+ return registry;
376
+ }
377
+ registryAt(origin) {
378
+ return this.registry(origin).source;
379
+ }
380
+ registryClientAt(origin) {
381
+ return this.registry(origin).remote;
382
+ }
383
+ /** The registries an install asks for a registry package's files, in
384
+ * the library's order (environments-7). */
385
+ installRegistries(instance, source) {
386
+ return installRegistryOrder(instance, source.registry, [])
387
+ .map((entry) => ("origin" in entry ? this.registryAt(entry.origin) : compositeRegistry(this.seed(), unaskedRegistry(entry.unasked))));
388
+ }
389
+ }
390
+ /** Whether a folder stands at a path. */
391
+ export function isDirectory(path) {
392
+ try {
393
+ return statSync(path).isDirectory();
394
+ }
395
+ catch {
396
+ return false;
397
+ }
398
+ }
399
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1,21 @@
1
+ import { type Command } from "./run.js";
2
+ interface Frontmatter {
3
+ name?: string;
4
+ description?: string;
5
+ /** The field whose unquoted value YAML refuses (`: ` inside it). */
6
+ unreadable?: "name" | "description";
7
+ }
8
+ /** The top-level string fields of a SKILL.md's YAML frontmatter that
9
+ * matter here — `name` and `description` — read from the common YAML
10
+ * forms: plain, single- or double-quoted, and `|` or `>` blocks. A field
11
+ * of another form reads as absent. The frontmatter is found as a
12
+ * release's readers find it, from the text's first character: nothing
13
+ * before `---`, a byte order mark included, is skipped. */
14
+ export declare function skillFrontmatter(text: string): Frontmatter;
15
+ /** The first paragraph under a spec's Intent heading, its lines joined. */
16
+ export declare function intentParagraph(text: string): string | undefined;
17
+ /** The license a root's LICENSE names (cli-23). */
18
+ export declare function detectLicense(text: string | undefined): string;
19
+ /** `spex export` (cli-23): build the folder from the project's files. */
20
+ export declare const exportPackage: Command;
21
+ export {};