@penvhq/launcher 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { PenvError, ManifestEngine } from '@penvhq/core';
1
+ import { Environment, PenvError, ManifestEngine, PackageKind } from '@penvhq/core';
2
2
 
3
3
  /**
4
4
  * Every byte penv downloads comes through here.
@@ -156,50 +156,6 @@ interface WriteDeclarationOptions extends DeclarationSubject {
156
156
  /** Writes the declaration and answers with the path a message prints. */
157
157
  declare function writeDeclaration(options: WriteDeclarationOptions): string;
158
158
 
159
- /**
160
- * `$PENV_HOME` — the one directory the launcher owns.
161
- *
162
- * Engines and extensions are addressed by exact name and exact version, so a
163
- * machine holds every version any of its projects pins at once and no project's
164
- * command is ever answered by another project's bytes.
165
- */
166
- /** A read-only view of the process environment. */
167
- type Environment = Readonly<Record<string, string | undefined>>;
168
- /** The variable that moves the store off `~/.penv`. */
169
- declare const PENV_HOME_VAR = "PENV_HOME";
170
- /** The two things the store holds, and the directory each lives under. */
171
- type PackageKind = "engines" | "extensions";
172
- /** How the launcher was installed, recorded by the installer that did it. */
173
- declare const HOME_META_FILE = "meta.json";
174
- /** Written beside an installed package: the SSRI of the tarball it came from. */
175
- declare const INTEGRITY_FILE = ".penv-integrity";
176
- /** The update command for a launcher whose installer recorded nothing. */
177
- declare const NPM_UPDATE_COMMAND = "npm install -g @penvhq/launcher";
178
- /** The store, from the environment. `~/.penv` unless `$PENV_HOME` says otherwise. */
179
- declare function penvHome(env: Environment): string;
180
- /**
181
- * Where one exact version lives.
182
- *
183
- * The manifest's grammar already refuses a name or a version that could climb
184
- * out of the store, so the containment check is the second lock rather than the
185
- * first: this function is also reached from `penv add`, where the name is
186
- * whatever the user typed.
187
- *
188
- * Containment is measured against the bucket, not against `$PENV_HOME`. A name
189
- * of `../extensions/x` stays inside the store while landing an engine among the
190
- * extensions, and a store where the two are not separated is a store where the
191
- * kind a caller asked for is not the kind it gets.
192
- */
193
- declare function packageDir(home: string, kind: PackageKind, name: string, version: string): string;
194
- /**
195
- * The command that updates this launcher.
196
- *
197
- * Advisory, so it never throws: a store with no `meta.json`, or one holding
198
- * something unreadable, falls back to the npm form rather than turning a
199
- * manifest-format refusal into a second failure about a metadata file.
200
- */
201
- declare function launcherUpdateCommand(home: string): string;
202
-
203
159
  /**
204
160
  * Handing the command over.
205
161
  *
@@ -330,6 +286,23 @@ declare class AddLocalFlagError extends PenvError {
330
286
  readonly name = "AddLocalFlagError";
331
287
  constructor(subject: string);
332
288
  }
289
+ /**
290
+ * The extension resolved and is not something penv can import.
291
+ *
292
+ * `add` used to certify resolution and stop there, so a package whose `exports`
293
+ * pointed at TypeScript source got three green checks and failed much later,
294
+ * from an unrelated command. The load check runs here, at the one moment the
295
+ * operator is looking at the provider.
296
+ */
297
+ declare class ExtensionNotImportableError extends PenvError {
298
+ readonly name = "ExtensionNotImportableError";
299
+ constructor(name: string, entry: string | undefined, local: boolean);
300
+ }
301
+ /** The extension imported and threw. Its own failure is the diagnosis. */
302
+ declare class ExtensionUnloadableError extends PenvError {
303
+ readonly name = "ExtensionUnloadableError";
304
+ constructor(name: string, entry: string, detail: string, local: boolean);
305
+ }
333
306
  /** `--local` on a package the project does not have. */
334
307
  declare class LocalExtensionUnresolvedError extends PenvError {
335
308
  readonly name = "LocalExtensionUnresolvedError";
@@ -434,6 +407,29 @@ declare class EngineEntryError extends PenvError {
434
407
  constructor(name: string, version: string, dir: string);
435
408
  }
436
409
 
410
+ /**
411
+ * What the launcher alone knows about `$PENV_HOME`: how the installation that
412
+ * created it updates itself, and what it writes beside an installed package.
413
+ *
414
+ * The store's layout — where `$PENV_HOME` is and where one exact version lives —
415
+ * is `@penvhq/core`'s, because the engine reads the same directories the
416
+ * launcher fills.
417
+ */
418
+ /** How the launcher was installed, recorded by the installer that did it. */
419
+ declare const HOME_META_FILE = "meta.json";
420
+ /** Written beside an installed package: the SSRI of the tarball it came from. */
421
+ declare const INTEGRITY_FILE = ".penv-integrity";
422
+ /** The update command for a launcher whose installer recorded nothing. */
423
+ declare const NPM_UPDATE_COMMAND = "npm install -g @penvhq/launcher";
424
+ /**
425
+ * The command that updates this launcher.
426
+ *
427
+ * Advisory, so it never throws: a store with no `meta.json`, or one holding
428
+ * something unreadable, falls back to the npm form rather than turning a
429
+ * manifest-format refusal into a second failure about a metadata file.
430
+ */
431
+ declare function launcherUpdateCommand(home: string): string;
432
+
437
433
  /**
438
434
  * The one hash penv checks: npm's SSRI, over the tarball bytes.
439
435
  *
@@ -625,4 +621,4 @@ interface ArchiveSubject {
625
621
  /** Every regular file in an npm tarball, `package/` stripped. */
626
622
  declare function readTarball(gzipped: Uint8Array, subject: ArchiveSubject): TarEntry[];
627
623
 
628
- export { AddFlagError, AddLocalFlagError, AddLocalInCiError, AddNoDownloadError, AddNotInteractiveError, type AddOptions, AddPackageNameError, AddRegistryError, type AddResult, AddSubjectError, ArchiveError, type ArchiveSubject, BUNDLED_ENGINE_PIN, DEFAULT_REGISTRY, DEV_PIN_INTEGRITY, DEV_PIN_VERSION, DeclarationMissingError, DeclarationNotSelfContainedError, type DeclarationSubject, type Delegation, DownloadFailedError, DownloadIntegrityError, ENGINE_BIN, type Engine, EngineEntryError, EnginePinMismatchError, EnginePinUnreleasedError, type Environment, type ExtensionPackage, type Fetcher, HOME_META_FILE, INSTALL_COMMAND, INTEGRITY_FILE, InstallDeclinedError, type InstallOptions, type InstallState, type Installation, LOCAL_FLAG, type LauncherIo, type LauncherOptions, LocalExtensionUnresolvedError, MIN_PACKAGE_AGE_DAYS, NPM_UPDATE_COMMAND, NoProjectError, OfficialRegistryError, PENV_HOME_VAR, PackageCorruptError, type PackageKind, PackageMissingError, PackageTooYoungError, PackageUnknownError, type Pin, type Project, type ProviderEntry, RegistryUnreadableError, type Release, ReleaseIncompleteError, type ReleaseQuery, type Spawner, TRUST_YOUNG_FLAG, type TarEntry, TrustDeclinedError, TrustPublisherMissingError, TrustReasonMissingError, VersionUnknownError, add, assertReleasePin, bundledEngine, declarationPath, engineAt, fetchRelease, findAdoptedRoot, findProject, httpFetcher, inspectInstall, installPin, integrityOf, launcherUpdateCommand, nodeSpawner, packageDir, packumentUrl, penvHome, readExtensionPackage, readProviderEntries, readTarball, releaseEnginePin, renderDeclaration, runLauncher, setProviderType, tarballUrl, writeDeclaration };
624
+ export { AddFlagError, AddLocalFlagError, AddLocalInCiError, AddNoDownloadError, AddNotInteractiveError, type AddOptions, AddPackageNameError, AddRegistryError, type AddResult, AddSubjectError, ArchiveError, type ArchiveSubject, BUNDLED_ENGINE_PIN, DEFAULT_REGISTRY, DEV_PIN_INTEGRITY, DEV_PIN_VERSION, DeclarationMissingError, DeclarationNotSelfContainedError, type DeclarationSubject, type Delegation, DownloadFailedError, DownloadIntegrityError, ENGINE_BIN, type Engine, EngineEntryError, EnginePinMismatchError, EnginePinUnreleasedError, ExtensionNotImportableError, type ExtensionPackage, ExtensionUnloadableError, type Fetcher, HOME_META_FILE, INSTALL_COMMAND, INTEGRITY_FILE, InstallDeclinedError, type InstallOptions, type InstallState, type Installation, LOCAL_FLAG, type LauncherIo, type LauncherOptions, LocalExtensionUnresolvedError, MIN_PACKAGE_AGE_DAYS, NPM_UPDATE_COMMAND, NoProjectError, OfficialRegistryError, PackageCorruptError, PackageMissingError, PackageTooYoungError, PackageUnknownError, type Pin, type Project, type ProviderEntry, RegistryUnreadableError, type Release, ReleaseIncompleteError, type ReleaseQuery, type Spawner, TRUST_YOUNG_FLAG, type TarEntry, TrustDeclinedError, TrustPublisherMissingError, TrustReasonMissingError, VersionUnknownError, add, assertReleasePin, bundledEngine, declarationPath, engineAt, fetchRelease, findAdoptedRoot, findProject, httpFetcher, inspectInstall, installPin, integrityOf, launcherUpdateCommand, nodeSpawner, packumentUrl, readExtensionPackage, readProviderEntries, readTarball, releaseEnginePin, renderDeclaration, runLauncher, setProviderType, tarballUrl, writeDeclaration };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PenvError, ManifestEngine } from '@penvhq/core';
1
+ import { Environment, PenvError, ManifestEngine, PackageKind } from '@penvhq/core';
2
2
 
3
3
  /**
4
4
  * Every byte penv downloads comes through here.
@@ -156,50 +156,6 @@ interface WriteDeclarationOptions extends DeclarationSubject {
156
156
  /** Writes the declaration and answers with the path a message prints. */
157
157
  declare function writeDeclaration(options: WriteDeclarationOptions): string;
158
158
 
159
- /**
160
- * `$PENV_HOME` — the one directory the launcher owns.
161
- *
162
- * Engines and extensions are addressed by exact name and exact version, so a
163
- * machine holds every version any of its projects pins at once and no project's
164
- * command is ever answered by another project's bytes.
165
- */
166
- /** A read-only view of the process environment. */
167
- type Environment = Readonly<Record<string, string | undefined>>;
168
- /** The variable that moves the store off `~/.penv`. */
169
- declare const PENV_HOME_VAR = "PENV_HOME";
170
- /** The two things the store holds, and the directory each lives under. */
171
- type PackageKind = "engines" | "extensions";
172
- /** How the launcher was installed, recorded by the installer that did it. */
173
- declare const HOME_META_FILE = "meta.json";
174
- /** Written beside an installed package: the SSRI of the tarball it came from. */
175
- declare const INTEGRITY_FILE = ".penv-integrity";
176
- /** The update command for a launcher whose installer recorded nothing. */
177
- declare const NPM_UPDATE_COMMAND = "npm install -g @penvhq/launcher";
178
- /** The store, from the environment. `~/.penv` unless `$PENV_HOME` says otherwise. */
179
- declare function penvHome(env: Environment): string;
180
- /**
181
- * Where one exact version lives.
182
- *
183
- * The manifest's grammar already refuses a name or a version that could climb
184
- * out of the store, so the containment check is the second lock rather than the
185
- * first: this function is also reached from `penv add`, where the name is
186
- * whatever the user typed.
187
- *
188
- * Containment is measured against the bucket, not against `$PENV_HOME`. A name
189
- * of `../extensions/x` stays inside the store while landing an engine among the
190
- * extensions, and a store where the two are not separated is a store where the
191
- * kind a caller asked for is not the kind it gets.
192
- */
193
- declare function packageDir(home: string, kind: PackageKind, name: string, version: string): string;
194
- /**
195
- * The command that updates this launcher.
196
- *
197
- * Advisory, so it never throws: a store with no `meta.json`, or one holding
198
- * something unreadable, falls back to the npm form rather than turning a
199
- * manifest-format refusal into a second failure about a metadata file.
200
- */
201
- declare function launcherUpdateCommand(home: string): string;
202
-
203
159
  /**
204
160
  * Handing the command over.
205
161
  *
@@ -330,6 +286,23 @@ declare class AddLocalFlagError extends PenvError {
330
286
  readonly name = "AddLocalFlagError";
331
287
  constructor(subject: string);
332
288
  }
289
+ /**
290
+ * The extension resolved and is not something penv can import.
291
+ *
292
+ * `add` used to certify resolution and stop there, so a package whose `exports`
293
+ * pointed at TypeScript source got three green checks and failed much later,
294
+ * from an unrelated command. The load check runs here, at the one moment the
295
+ * operator is looking at the provider.
296
+ */
297
+ declare class ExtensionNotImportableError extends PenvError {
298
+ readonly name = "ExtensionNotImportableError";
299
+ constructor(name: string, entry: string | undefined, local: boolean);
300
+ }
301
+ /** The extension imported and threw. Its own failure is the diagnosis. */
302
+ declare class ExtensionUnloadableError extends PenvError {
303
+ readonly name = "ExtensionUnloadableError";
304
+ constructor(name: string, entry: string, detail: string, local: boolean);
305
+ }
333
306
  /** `--local` on a package the project does not have. */
334
307
  declare class LocalExtensionUnresolvedError extends PenvError {
335
308
  readonly name = "LocalExtensionUnresolvedError";
@@ -434,6 +407,29 @@ declare class EngineEntryError extends PenvError {
434
407
  constructor(name: string, version: string, dir: string);
435
408
  }
436
409
 
410
+ /**
411
+ * What the launcher alone knows about `$PENV_HOME`: how the installation that
412
+ * created it updates itself, and what it writes beside an installed package.
413
+ *
414
+ * The store's layout — where `$PENV_HOME` is and where one exact version lives —
415
+ * is `@penvhq/core`'s, because the engine reads the same directories the
416
+ * launcher fills.
417
+ */
418
+ /** How the launcher was installed, recorded by the installer that did it. */
419
+ declare const HOME_META_FILE = "meta.json";
420
+ /** Written beside an installed package: the SSRI of the tarball it came from. */
421
+ declare const INTEGRITY_FILE = ".penv-integrity";
422
+ /** The update command for a launcher whose installer recorded nothing. */
423
+ declare const NPM_UPDATE_COMMAND = "npm install -g @penvhq/launcher";
424
+ /**
425
+ * The command that updates this launcher.
426
+ *
427
+ * Advisory, so it never throws: a store with no `meta.json`, or one holding
428
+ * something unreadable, falls back to the npm form rather than turning a
429
+ * manifest-format refusal into a second failure about a metadata file.
430
+ */
431
+ declare function launcherUpdateCommand(home: string): string;
432
+
437
433
  /**
438
434
  * The one hash penv checks: npm's SSRI, over the tarball bytes.
439
435
  *
@@ -625,4 +621,4 @@ interface ArchiveSubject {
625
621
  /** Every regular file in an npm tarball, `package/` stripped. */
626
622
  declare function readTarball(gzipped: Uint8Array, subject: ArchiveSubject): TarEntry[];
627
623
 
628
- export { AddFlagError, AddLocalFlagError, AddLocalInCiError, AddNoDownloadError, AddNotInteractiveError, type AddOptions, AddPackageNameError, AddRegistryError, type AddResult, AddSubjectError, ArchiveError, type ArchiveSubject, BUNDLED_ENGINE_PIN, DEFAULT_REGISTRY, DEV_PIN_INTEGRITY, DEV_PIN_VERSION, DeclarationMissingError, DeclarationNotSelfContainedError, type DeclarationSubject, type Delegation, DownloadFailedError, DownloadIntegrityError, ENGINE_BIN, type Engine, EngineEntryError, EnginePinMismatchError, EnginePinUnreleasedError, type Environment, type ExtensionPackage, type Fetcher, HOME_META_FILE, INSTALL_COMMAND, INTEGRITY_FILE, InstallDeclinedError, type InstallOptions, type InstallState, type Installation, LOCAL_FLAG, type LauncherIo, type LauncherOptions, LocalExtensionUnresolvedError, MIN_PACKAGE_AGE_DAYS, NPM_UPDATE_COMMAND, NoProjectError, OfficialRegistryError, PENV_HOME_VAR, PackageCorruptError, type PackageKind, PackageMissingError, PackageTooYoungError, PackageUnknownError, type Pin, type Project, type ProviderEntry, RegistryUnreadableError, type Release, ReleaseIncompleteError, type ReleaseQuery, type Spawner, TRUST_YOUNG_FLAG, type TarEntry, TrustDeclinedError, TrustPublisherMissingError, TrustReasonMissingError, VersionUnknownError, add, assertReleasePin, bundledEngine, declarationPath, engineAt, fetchRelease, findAdoptedRoot, findProject, httpFetcher, inspectInstall, installPin, integrityOf, launcherUpdateCommand, nodeSpawner, packageDir, packumentUrl, penvHome, readExtensionPackage, readProviderEntries, readTarball, releaseEnginePin, renderDeclaration, runLauncher, setProviderType, tarballUrl, writeDeclaration };
624
+ export { AddFlagError, AddLocalFlagError, AddLocalInCiError, AddNoDownloadError, AddNotInteractiveError, type AddOptions, AddPackageNameError, AddRegistryError, type AddResult, AddSubjectError, ArchiveError, type ArchiveSubject, BUNDLED_ENGINE_PIN, DEFAULT_REGISTRY, DEV_PIN_INTEGRITY, DEV_PIN_VERSION, DeclarationMissingError, DeclarationNotSelfContainedError, type DeclarationSubject, type Delegation, DownloadFailedError, DownloadIntegrityError, ENGINE_BIN, type Engine, EngineEntryError, EnginePinMismatchError, EnginePinUnreleasedError, ExtensionNotImportableError, type ExtensionPackage, ExtensionUnloadableError, type Fetcher, HOME_META_FILE, INSTALL_COMMAND, INTEGRITY_FILE, InstallDeclinedError, type InstallOptions, type InstallState, type Installation, LOCAL_FLAG, type LauncherIo, type LauncherOptions, LocalExtensionUnresolvedError, MIN_PACKAGE_AGE_DAYS, NPM_UPDATE_COMMAND, NoProjectError, OfficialRegistryError, PackageCorruptError, PackageMissingError, PackageTooYoungError, PackageUnknownError, type Pin, type Project, type ProviderEntry, RegistryUnreadableError, type Release, ReleaseIncompleteError, type ReleaseQuery, type Spawner, TRUST_YOUNG_FLAG, type TarEntry, TrustDeclinedError, TrustPublisherMissingError, TrustReasonMissingError, VersionUnknownError, add, assertReleasePin, bundledEngine, declarationPath, engineAt, fetchRelease, findAdoptedRoot, findProject, httpFetcher, inspectInstall, installPin, integrityOf, launcherUpdateCommand, nodeSpawner, packumentUrl, readExtensionPackage, readProviderEntries, readTarball, releaseEnginePin, renderDeclaration, runLauncher, setProviderType, tarballUrl, writeDeclaration };
package/dist/index.js CHANGED
@@ -20,6 +20,8 @@ import {
20
20
  EngineEntryError,
21
21
  EnginePinMismatchError,
22
22
  EnginePinUnreleasedError,
23
+ ExtensionNotImportableError,
24
+ ExtensionUnloadableError,
23
25
  HOME_META_FILE,
24
26
  INSTALL_COMMAND,
25
27
  INTEGRITY_FILE,
@@ -30,7 +32,6 @@ import {
30
32
  NPM_UPDATE_COMMAND,
31
33
  NoProjectError,
32
34
  OfficialRegistryError,
33
- PENV_HOME_VAR,
34
35
  PackageCorruptError,
35
36
  PackageMissingError,
36
37
  PackageTooYoungError,
@@ -56,9 +57,7 @@ import {
56
57
  integrityOf,
57
58
  launcherUpdateCommand,
58
59
  nodeSpawner,
59
- packageDir,
60
60
  packumentUrl,
61
- penvHome,
62
61
  readExtensionPackage,
63
62
  readProviderEntries,
64
63
  readTarball,
@@ -68,7 +67,7 @@ import {
68
67
  setProviderType,
69
68
  tarballUrl,
70
69
  writeDeclaration
71
- } from "./chunk-4YZYBC5T.js";
70
+ } from "./chunk-BNUZ52VN.js";
72
71
  export {
73
72
  AddFlagError,
74
73
  AddLocalFlagError,
@@ -91,6 +90,8 @@ export {
91
90
  EngineEntryError,
92
91
  EnginePinMismatchError,
93
92
  EnginePinUnreleasedError,
93
+ ExtensionNotImportableError,
94
+ ExtensionUnloadableError,
94
95
  HOME_META_FILE,
95
96
  INSTALL_COMMAND,
96
97
  INTEGRITY_FILE,
@@ -101,7 +102,6 @@ export {
101
102
  NPM_UPDATE_COMMAND,
102
103
  NoProjectError,
103
104
  OfficialRegistryError,
104
- PENV_HOME_VAR,
105
105
  PackageCorruptError,
106
106
  PackageMissingError,
107
107
  PackageTooYoungError,
@@ -127,9 +127,7 @@ export {
127
127
  integrityOf,
128
128
  launcherUpdateCommand,
129
129
  nodeSpawner,
130
- packageDir,
131
130
  packumentUrl,
132
- penvHome,
133
131
  readExtensionPackage,
134
132
  readProviderEntries,
135
133
  readTarball,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@penvhq/launcher",
3
- "version": "0.9.5",
3
+ "version": "0.10.0",
4
4
  "description": "The stable penv launcher: it verifies the engine your project pins and hands over the command.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,8 +22,8 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "zod": "4.4.3",
25
- "@penvhq/cli": "0.9.5",
26
- "@penvhq/core": "0.9.5"
25
+ "@penvhq/cli": "0.10.0",
26
+ "@penvhq/core": "0.10.0"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "tsup"