@grosspoetrysystems/oompf 0.1.1 → 0.2.1

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.mts CHANGED
@@ -168,10 +168,12 @@ interface CliDeps {
168
168
  /**
169
169
  * OOMPF CLI version, surfaced by `oompf --version`.
170
170
  *
171
- * Must match `package.json`; `index.test.ts` asserts it, because a published
172
- * binary reporting the wrong version makes every bug report ambiguous.
171
+ * Read from `package.json` rather than restated, because npm publishes the
172
+ * manifest's version regardless of what the binary claims: a hand-maintained
173
+ * copy can only ever drift, and a binary reporting the wrong version makes
174
+ * every bug report ambiguous. The bundler inlines this at build time.
173
175
  */
174
- declare const CLI_VERSION = "0.1.1";
176
+ declare const CLI_VERSION: string;
175
177
  /** Build the OOMPF CLI with the given (optional) injectable seams. */
176
178
  declare function createCli(deps?: CliDeps): Cli.Cli<{}, undefined, undefined, undefined>;
177
179
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../packages/core/dist/omp-profile.d.ts","../../../packages/github/dist/gh.d.ts","../../../packages/github/dist/gists.d.ts","../src/deps.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;UAeiB;;WAEJ;;WAEA;;WAEA;;;UAGI;;WAEJ;;WAEA;;WAEA,UAAU;;WAEV;;;UAGI;;WAEJ;;;;;;;;;iBASW,qBAAqB,cAAc,UAAU,oBAAoB;;;;;;;;iBAQjE,qBAAqB,iBAAiB,UAAU,oBAAoB,QAAQ;;;;;;;;;iBAS5E,iBAAiB,UAAU,oBAAoB,QAAQ;;;;;;;;;;;;;;;;;;UChD9D;;WAEJ;WACA;WACA;;;UAGI;;WAEJ;;WAEA;;WAEA;;;;;;;;;;KAUD,iBAAiB,OAAO,iBAAiB,QAAQ;;;;UCG5C;WACJ;WACA;EACT,QAAQ;;;KAGA,aAAa,aAAa;WACzB,UAAU;MACjB,QAAQ;;;;UC3BG;WACN;WACA;EACT,QAAQ;;;KAIE,aACV,aACA;WACW;WACA,UAAU;WACV;MAER,QAAQ;;UAGI;;EAEf,OAAO,eAAe;;EAEtB,MAAM,cAAc,eAAe;;EAEnC,SAAS,eAAe;;EAExB,UAAU,cAAc,cAAc,eAAe;;;UAoCtC;;WAEN,0BAA0B;;WAE1B,KAAK;;WAEL;;WAEA,YAAY;;WAEZ,YAAY;;WAEZ;;WAEA,8BAA8B;;WAE9B,8BAA8B;;WAE9B,SAAS;;;;;;;;;;cC5EP;;iBAGG,UAAU,OAAM,UAAY,IAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../packages/core/dist/omp-profile.d.ts","../../../packages/github/dist/gh.d.ts","../../../packages/github/dist/gists.d.ts","../src/deps.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;UAeiB;;WAEJ;;WAEA;;WAEA;;;UAGI;;WAEJ;;WAEA;;WAEA,UAAU;;WAEV;;;UAGI;;WAEJ;;;;;;;;;iBASW,qBAAqB,cAAc,UAAU,oBAAoB;;;;;;;;iBAQjE,qBAAqB,iBAAiB,UAAU,oBAAoB,QAAQ;;;;;;;;;iBAS5E,iBAAiB,UAAU,oBAAoB,QAAQ;;;;;;;;;;;;;;;;;;UChD9D;;WAEJ;WACA;WACA;;;UAGI;;WAEJ;;WAEA;;WAEA;;;;;;;;;;KAUD,iBAAiB,OAAO,iBAAiB,QAAQ;;;;UCG5C;WACJ;WACA;EACT,QAAQ;;;KAGA,aAAa,aAAa;WACzB,UAAU;MACjB,QAAQ;;;;UC3BG;WACN;WACA;EACT,QAAQ;;;KAIE,aACV,aACA;WACW;WACA,UAAU;WACV;MAER,QAAQ;;UAGI;;EAEf,OAAO,eAAe;;EAEtB,MAAM,cAAc,eAAe;;EAEnC,SAAS,eAAe;;EAExB,UAAU,cAAc,cAAc,eAAe;;;UAoCtC;;WAEN,0BAA0B;;WAE1B,KAAK;;WAEL;;WAEA,YAAY;;WAEZ,YAAY;;WAEZ;;WAEA,8BAA8B;;WAE9B,8BAA8B;;WAE9B,SAAS;;;;;;;;;;;;cC1EP;;iBAGG,UAAU,OAAM,UAAY,IAAA"}
package/dist/index.mjs CHANGED
@@ -10,6 +10,9 @@ import { spawn } from "node:child_process";
10
10
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
11
11
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
12
12
  //#endregion
13
+ //#region package.json
14
+ var version = "0.2.1";
15
+ //#endregion
13
16
  //#region ../../packages/core/src/guards.ts
14
17
  /**
15
18
  * Canonical runtime type guards for `@oompf/core`.
@@ -8161,8 +8164,17 @@ function registerAdd(cli, deps) {
8161
8164
  try {
8162
8165
  const oompfId = parseOompfRef(c.args.ref);
8163
8166
  let sourceUrl = c.args.ref;
8164
- if (oompfId !== null) sourceUrl = (await fetchProfileMetadata(c.env.OOMPF_BASE_URL, oompfId, deps.httpFetch)).sourceUrl;
8165
- const gist = await fetchPublicGist(sourceUrl, { fetch: deps.gistFetch });
8167
+ let fetchUrl = sourceUrl;
8168
+ let expectedHash = null;
8169
+ if (oompfId !== null) {
8170
+ const record = await fetchProfileMetadata(c.env.OOMPF_BASE_URL, oompfId, deps.httpFetch);
8171
+ if (record.revision === null) throw new CommandError("unverifiable_artifact", "The indexed profile has no pinned revision and cannot be installed reproducibly.");
8172
+ sourceUrl = record.sourceUrl;
8173
+ fetchUrl = `https://api.github.com/gists/${record.gistId}/${record.revision}`;
8174
+ expectedHash = record.contentHash;
8175
+ }
8176
+ const gist = await fetchPublicGist(fetchUrl, { fetch: deps.gistFetch });
8177
+ if (expectedHash !== null && gist.contentHash !== expectedHash) throw new CommandError("fingerprint_mismatch", "The pinned profile bytes do not match the indexed fingerprint. Refusing to install.");
8166
8178
  const validation = validateArtifact({ yaml: gist.content });
8167
8179
  if (validation.structural === "invalid") throw new CommandError("invalid_artifact", `Refusing to install an invalid artifact: ${validation.errors.join("; ")}`);
8168
8180
  const stem = filenameStem$1(gist.filename);
@@ -8438,10 +8450,12 @@ function registerSearch(cli, deps) {
8438
8450
  /**
8439
8451
  * OOMPF CLI version, surfaced by `oompf --version`.
8440
8452
  *
8441
- * Must match `package.json`; `index.test.ts` asserts it, because a published
8442
- * binary reporting the wrong version makes every bug report ambiguous.
8453
+ * Read from `package.json` rather than restated, because npm publishes the
8454
+ * manifest's version regardless of what the binary claims: a hand-maintained
8455
+ * copy can only ever drift, and a binary reporting the wrong version makes
8456
+ * every bug report ambiguous. The bundler inlines this at build time.
8443
8457
  */
8444
- const CLI_VERSION = "0.1.1";
8458
+ const CLI_VERSION = version;
8445
8459
  /** Build the OOMPF CLI with the given (optional) injectable seams. */
8446
8460
  function createCli(deps = {}) {
8447
8461
  const resolved = resolveDeps(deps);