@adhdev/daemon-standalone 1.0.38-rc.5 → 1.0.38-rc.6

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.js CHANGED
@@ -33364,10 +33364,10 @@ var require_dist3 = __commonJS({
33364
33364
  }
33365
33365
  function getDaemonBuildInfo() {
33366
33366
  if (cached2) return cached2;
33367
- const commit = readInjected(true ? "5da1eb80cc0d6986f8811e6a38a199255967c18f" : void 0) ?? "unknown";
33368
- const commitShort = readInjected(true ? "5da1eb80" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
33369
- const version2 = readInjected(true ? "1.0.38-rc.5" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
33370
- const builtAt = readInjected(true ? "2026-08-06T11:35:57.968Z" : void 0);
33367
+ const commit = readInjected(true ? "004d8bfc5ffe83c582737c2a3b15d27f5337e8ae" : void 0) ?? "unknown";
33368
+ const commitShort = readInjected(true ? "004d8bfc" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
33369
+ const version2 = readInjected(true ? "1.0.38-rc.6" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
33370
+ const builtAt = readInjected(true ? "2026-08-06T12:47:31.923Z" : void 0);
33371
33371
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
33372
33372
  return cached2;
33373
33373
  }
@@ -101515,12 +101515,19 @@ Run 'adhdev doctor' for detailed diagnostics.`
101515
101515
  /**
101516
101516
  * Sync the verified channel activations for `targetTypes`.
101517
101517
  *
101518
+ * `bootstrapAll: true` (fresh-install bootstrap) widens the target set to
101519
+ * EVERY activatable entry on the channel, ignoring `targetTypes`: a clean
101520
+ * machine has nothing in `.upstream` and no pointers, so there is no
101521
+ * installed set to diff against — the channel listing itself is the desired
101522
+ * end state. Only digest-verified entries activate; legacy-unverified /
101523
+ * unknown-algorithm rows stay typed skips exactly as in a targeted sync.
101524
+ *
101518
101525
  * Never throws for expected failure modes: every failure is reported as a
101519
101526
  * typed error in the returned report and the previous activations stay
101520
101527
  * live (last-known-good). Unexpected programming errors still throw.
101521
101528
  */
101522
101529
  async sync(options) {
101523
- const { channel, targetTypes } = options;
101530
+ const { channel, targetTypes, bootstrapAll } = options;
101524
101531
  const report = {
101525
101532
  channel,
101526
101533
  status: "up-to-date",
@@ -101540,7 +101547,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
101540
101547
  }
101541
101548
  const { activatable, skipped } = partitionChannelEntries(entries);
101542
101549
  report.skipped = skipped;
101543
- const targets = activatable.filter((e) => targetTypes.has(e.providerType));
101550
+ const targets = bootstrapAll ? activatable : activatable.filter((e) => targetTypes.has(e.providerType));
101544
101551
  const pending = [];
101545
101552
  for (const entry of targets) {
101546
101553
  let activeDigest = null;
@@ -102117,7 +102124,11 @@ Run 'adhdev doctor' for detailed diagnostics.`
102117
102124
  * 3. ~/.adhdev/providers/ (excluding .upstream) — user-authored customs,
102118
102125
  * always wins
102119
102126
  * Highest priority listed last (overwrites earlier loads).
102120
- * If .upstream/ is empty, call fetchLatest() before loadAll().
102127
+ * Empty .upstream/ is normal: verified channel activations (step 1.5) are
102128
+ * the primary source on a fresh install, bootstrapped from the registry by
102129
+ * maybeFirstSyncVerifiedChannel() at boot — fetchLatest() is NOT the
102130
+ * production path (gated behind providerAllowUnverifiedTarball, off by
102131
+ * default).
102121
102132
  */
102122
102133
  loadAll() {
102123
102134
  this.providers.clear();
@@ -102230,11 +102241,16 @@ Run 'adhdev doctor' for detailed diagnostics.`
102230
102241
  * (providers installed into .upstream via the dashboard install flow, plus
102231
102242
  * everything already activated on this channel).
102232
102243
  *
102244
+ * `bootstrapAll: true` (fresh-install bootstrap) instead targets every
102245
+ * activatable entry on the channel — used when a clean machine has an empty
102246
+ * .upstream AND an empty channel store, so there is no installed set to diff
102247
+ * against. Digest verification is unchanged: only verified entries activate.
102248
+ *
102233
102249
  * Fail-closed / last-known-good: on any metadata or transport failure
102234
102250
  * nothing new is activated and the previous active objects keep loading.
102235
102251
  * Reloads providers when at least one activation changed.
102236
102252
  */
102237
- async syncVerifiedChannel() {
102253
+ async syncVerifiedChannel(options) {
102238
102254
  if (!this.channelStore) {
102239
102255
  return {
102240
102256
  channel: this.channel,
@@ -102252,7 +102268,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
102252
102268
  ...this.channelSyncIO
102253
102269
  });
102254
102270
  const targetTypes = collectSyncTargetTypes(this.upstreamDir, this.channelStore, this.channel);
102255
- const report = await runtime.sync({ channel: this.channel, targetTypes });
102271
+ const report = await runtime.sync({ channel: this.channel, targetTypes, bootstrapAll: options?.bootstrapAll });
102256
102272
  for (const skip of report.skipped) {
102257
102273
  this.log(`\u26A0 Verified channel skip: ${skip.reason}`);
102258
102274
  }
@@ -102279,12 +102295,20 @@ Run 'adhdev doctor' for detailed diagnostics.`
102279
102295
  /**
102280
102296
  * Bounded one-shot first sync for an empty verified channel store.
102281
102297
  *
102282
- * Closes the rc.20 preview activation gap: a daemon whose provider channel
102283
- * newly derives to a channel with an EMPTY store (e.g. updateChannel=preview
102284
- * while providerChannel defaulted to stable) would otherwise sit at 0 active
102285
- * providers until a manual check_provider_updates. Runs at most one
102286
- * verified sync per call, only when the resolved channel has no pointers
102287
- * AND there are installed (.upstream) providers to sync. Fail-closed: any
102298
+ * Two empty-store cases, one gate (channel has no active pointers):
102299
+ *
102300
+ * 1. Providers installed into .upstream (upgrade / channel-switch paths
102301
+ * the rc.20 preview activation gap): targeted sync of the installed set.
102302
+ * 2. Fresh install .upstream empty AND store empty (the "daemon ships
102303
+ * empty" design left new users at 0 providers and unable to run
102304
+ * anything): bootstrap sync. The registry channel listing itself is the
102305
+ * target set, so the daemon self-populates the whole verified channel
102306
+ * on first boot. Only digest-verified entries activate;
102307
+ * legacy-unverified rows stay typed skips.
102308
+ *
102309
+ * Runs at most one verified sync per call and ONLY while the resolved
102310
+ * channel has zero pointers — once anything is activated the gate
102311
+ * short-circuits forever (no re-bootstrap, no network). Fail-closed: any
102288
102312
  * registry/transport failure activates nothing (last-known-good preserved)
102289
102313
  * and is retried on the next boot or via check_provider_updates. Never
102290
102314
  * invoked from any status path.
@@ -102294,8 +102318,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
102294
102318
  async maybeFirstSyncVerifiedChannel() {
102295
102319
  if (!this.channelStore) return null;
102296
102320
  if (this.countVerifiedChannelPointers() > 0) return null;
102297
- if (!this.hasUpstream()) return null;
102298
- return this.syncVerifiedChannel();
102321
+ if (this.hasUpstream()) return this.syncVerifiedChannel();
102322
+ try {
102323
+ fs38.mkdirSync(this.defaultProvidersDir, { recursive: true });
102324
+ } catch {
102325
+ }
102326
+ return this.syncVerifiedChannel({ bootstrapAll: true });
102299
102327
  }
102300
102328
  /**
102301
102329
  * The verified-channel PIN for each provider: what this daemon actually