mycomesh-consumer 0.1.52 → 0.1.53

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mycomesh-consumer",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "description": "Native Node.js MycoMesh Consumer and OpenAI-compatible request CLI.",
5
5
  "repository": {
6
6
  "type": "git",
package/src/consumer.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { spawn as defaultSpawn } from "node:child_process";
2
2
  import { existsSync, readFileSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
3
3
  import { request as httpsRequest } from "node:https";
4
+ import { rootCertificates } from "node:tls";
4
5
  import { join, resolve } from "node:path";
5
6
  import { fileURLToPath } from "node:url";
6
7
  import * as readline from "node:readline/promises";
@@ -313,7 +314,11 @@ async function consumerDoctor({ parsed, env, stdout, fetch: injectedFetch, json
313
314
  add("local_process", running ? "ready" : "blocked", running ? "Consumer process is running" : "Consumer pid file is stale", { pid, running });
314
315
  }
315
316
 
316
- const fetchImpl = injectedFetch || ((url, options) => consumerDoctorFetch(url, options, parsed));
317
+ const doctorFetchConfig = {
318
+ ...parsed,
319
+ caFile: parsed.caFile || network?.tls_ca_file,
320
+ };
321
+ const fetchImpl = injectedFetch || ((url, options) => consumerDoctorFetch(url, options, doctorFetchConfig));
317
322
  const health = [];
318
323
  if (validRelays.length && typeof fetchImpl === "function") {
319
324
  await Promise.all(validRelays.map(async (relay) => {
@@ -349,18 +354,19 @@ async function consumerDoctor({ parsed, env, stdout, fetch: injectedFetch, json
349
354
  return report.status === "blocked" ? 1 : 0;
350
355
  }
351
356
 
352
- function consumerDoctorFetch(url, options = {}, parsed) {
357
+ export function consumerDoctorFetch(url, options = {}, parsed, requestImpl = httpsRequest) {
353
358
  const target = new URL(url);
354
359
  if (target.protocol !== "https:" || !parsed.caFile) return globalThis.fetch(url, options);
355
- const ca = readFileSync(resolve(parsed.caFile));
360
+ const ca = readFileSync(resolve(parsed.caFile)).toString("utf8");
356
361
  return new Promise((resolvePromise, reject) => {
357
- const request = httpsRequest({
362
+ const request = requestImpl({
358
363
  protocol: target.protocol,
359
364
  hostname: target.hostname,
360
365
  port: target.port || 443,
361
366
  path: `${target.pathname}${target.search}`,
362
367
  method: options.method || "GET",
363
- ca,
368
+ // A private manifest CA supplements, rather than replaces, public trust.
369
+ ca: [...rootCertificates, ca],
364
370
  rejectUnauthorized: true,
365
371
  }, (response) => {
366
372
  response.resume();
package/src/release.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // Package versions are kept in one runtime module so every executable reports
2
2
  // the same version as the package metadata that ships it.
3
- export const CONSUMER_RELEASE_VERSION = "0.1.52";
4
- export const PROVIDER_RELEASE_VERSION = "0.1.38";
3
+ export const CONSUMER_RELEASE_VERSION = "0.1.53";
4
+ export const PROVIDER_RELEASE_VERSION = "0.1.39";
5
5
 
6
6
  // Provider release pins are intentionally unbound in the source tree. The
7
7
  // release candidate builder injects the commit and immutable OCI digest into a