@adhdev/daemon-standalone 0.9.82-rc.312 → 0.9.82-rc.314

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
@@ -30029,10 +30029,10 @@ var require_dist3 = __commonJS({
30029
30029
  }
30030
30030
  function getDaemonBuildInfo() {
30031
30031
  if (cached2) return cached2;
30032
- const commit = readInjected(true ? "35facf0367dbbe37f25a3b5589287dc757ee6213" : void 0) ?? "unknown";
30033
- const commitShort = readInjected(true ? "35facf03" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30034
- const version2 = readInjected(true ? "0.9.82-rc.312" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30035
- const builtAt = readInjected(true ? "2026-06-17T22:49:21.710Z" : void 0);
30032
+ const commit = readInjected(true ? "f236ed7432cf04dbcfd2e530fa6c69e77e809c80" : void 0) ?? "unknown";
30033
+ const commitShort = readInjected(true ? "f236ed74" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30034
+ const version2 = readInjected(true ? "0.9.82-rc.314" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30035
+ const builtAt = readInjected(true ? "2026-06-18T04:16:06.357Z" : void 0);
30036
30036
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30037
30037
  return cached2;
30038
30038
  }
@@ -62017,7 +62017,7 @@ ${formatManifestValidationIssues2(validation.issues)}`,
62017
62017
  }
62018
62018
  if (action.type === "open_picker") {
62019
62019
  const choiceIndex = typeof flat.choiceIndex === "number" ? flat.choiceIndex : typeof flat.choiceIndex === "string" && flat.choiceIndex.trim() ? Number(flat.choiceIndex) : void 0;
62020
- const choiceLabel = typeof flat.choiceLabel === "string" ? flat.choiceLabel : typeof flat.choice === "string" ? flat.choice : void 0;
62020
+ const choiceLabel = typeof flat.choiceLabel === "string" ? flat.choiceLabel : typeof flat.choice === "string" ? flat.choice : typeof flat.value === "string" ? flat.value : void 0;
62021
62021
  if (typeof choiceIndex === "number" && Number.isFinite(choiceIndex) || choiceLabel && choiceLabel.trim()) {
62022
62022
  return this.selectPickerChoice(ctl, action, choiceIndex, choiceLabel);
62023
62023
  }
@@ -68145,6 +68145,39 @@ Run 'adhdev doctor' for detailed diagnostics.`
68145
68145
  } catch {
68146
68146
  }
68147
68147
  }
68148
+ function synthesizeControlsFromControlBar(specControls) {
68149
+ const out = [];
68150
+ specControls.forEach((ctl, index) => {
68151
+ const id = typeof ctl?.id === "string" ? ctl.id.trim() : "";
68152
+ const actionType = ctl?.action?.type;
68153
+ if (!id || !actionType) return;
68154
+ const label = typeof ctl?.label === "string" && ctl.label.trim() ? ctl.label : id;
68155
+ if (actionType === "open_picker") {
68156
+ out.push({
68157
+ id,
68158
+ type: "select",
68159
+ label,
68160
+ placement: "bar",
68161
+ dynamic: true,
68162
+ listScript: id,
68163
+ setScript: id,
68164
+ readFrom: id,
68165
+ order: index
68166
+ });
68167
+ } else if (actionType === "send_keys") {
68168
+ out.push({
68169
+ id,
68170
+ type: "action",
68171
+ label,
68172
+ placement: "bar",
68173
+ invokeScript: id,
68174
+ resultDisplay: "none",
68175
+ order: index
68176
+ });
68177
+ }
68178
+ });
68179
+ return out;
68180
+ }
68148
68181
  var ProviderLoader = class _ProviderLoader {
68149
68182
  providers = /* @__PURE__ */ new Map();
68150
68183
  providerAvailability = /* @__PURE__ */ new Map();
@@ -69083,6 +69116,13 @@ Run 'adhdev doctor' for detailed diagnostics.`
69083
69116
  });
69084
69117
  }
69085
69118
  }
69119
+ const hasDeclaredControls = Array.isArray(resolved.controls) && resolved.controls.length > 0;
69120
+ if (!hasDeclaredControls) {
69121
+ const synthesized = synthesizeControlsFromControlBar(specControls);
69122
+ if (synthesized.length > 0) {
69123
+ resolved.controls = synthesized;
69124
+ }
69125
+ }
69086
69126
  }
69087
69127
  if (nh) {
69088
69128
  let reader = null;
@@ -71667,39 +71707,48 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
71667
71707
  } catch {
71668
71708
  }
71669
71709
  }
71710
+ function safeRemoveStaleEntry(target, label) {
71711
+ try {
71712
+ fs24.rmSync(target, { recursive: true, force: true });
71713
+ appendUpgradeLog(`${label}: ${target}`);
71714
+ } catch (error48) {
71715
+ appendUpgradeLog(`Skipped locked stale entry (${error48?.code || "error"}): ${target} \u2014 ${error48?.message || String(error48)}`);
71716
+ }
71717
+ }
71670
71718
  function cleanupStaleGlobalInstallDirs(pkgName, surface) {
71671
- const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
71672
- const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
71673
- if (!npmRoot) return;
71674
- const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
71675
- const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
71676
- const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
71677
- const binNames = /* @__PURE__ */ new Set([packageBaseName]);
71678
- if (pkgName === "@adhdev/daemon-standalone") {
71679
- binNames.add("adhdev-standalone");
71680
- }
71681
- if (pkgName.startsWith("@")) {
71682
- const [scope, name] = pkgName.split("/");
71683
- const scopeDir = path35.join(npmRoot, scope);
71684
- if (!fs24.existsSync(scopeDir)) return;
71685
- for (const entry of fs24.readdirSync(scopeDir)) {
71686
- if (!entry.startsWith(`.${name}-`)) continue;
71687
- fs24.rmSync(path35.join(scopeDir, entry), { recursive: true, force: true });
71688
- appendUpgradeLog(`Removed stale scoped staging dir: ${path35.join(scopeDir, entry)}`);
71689
- }
71690
- } else {
71691
- for (const entry of fs24.readdirSync(npmRoot)) {
71692
- if (!entry.startsWith(`.${pkgName}-`)) continue;
71693
- fs24.rmSync(path35.join(npmRoot, entry), { recursive: true, force: true });
71694
- appendUpgradeLog(`Removed stale staging dir: ${path35.join(npmRoot, entry)}`);
71719
+ try {
71720
+ const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
71721
+ const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
71722
+ if (!npmRoot) return;
71723
+ const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
71724
+ const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
71725
+ const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
71726
+ const binNames = /* @__PURE__ */ new Set([packageBaseName]);
71727
+ if (pkgName === "@adhdev/daemon-standalone") {
71728
+ binNames.add("adhdev-standalone");
71729
+ }
71730
+ if (pkgName.startsWith("@")) {
71731
+ const [scope, name] = pkgName.split("/");
71732
+ const scopeDir = path35.join(npmRoot, scope);
71733
+ if (!fs24.existsSync(scopeDir)) return;
71734
+ for (const entry of fs24.readdirSync(scopeDir)) {
71735
+ if (!entry.startsWith(`.${name}-`)) continue;
71736
+ safeRemoveStaleEntry(path35.join(scopeDir, entry), "Removed stale scoped staging dir");
71737
+ }
71738
+ } else {
71739
+ for (const entry of fs24.readdirSync(npmRoot)) {
71740
+ if (!entry.startsWith(`.${pkgName}-`)) continue;
71741
+ safeRemoveStaleEntry(path35.join(npmRoot, entry), "Removed stale staging dir");
71742
+ }
71695
71743
  }
71696
- }
71697
- if (fs24.existsSync(binDir)) {
71698
- for (const entry of fs24.readdirSync(binDir)) {
71699
- if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
71700
- fs24.rmSync(path35.join(binDir, entry), { recursive: true, force: true });
71701
- appendUpgradeLog(`Removed stale bin staging entry: ${path35.join(binDir, entry)}`);
71744
+ if (fs24.existsSync(binDir)) {
71745
+ for (const entry of fs24.readdirSync(binDir)) {
71746
+ if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
71747
+ safeRemoveStaleEntry(path35.join(binDir, entry), "Removed stale bin staging entry");
71748
+ }
71702
71749
  }
71750
+ } catch (error48) {
71751
+ appendUpgradeLog(`Stale staging cleanup skipped (${error48?.code || "error"}): ${error48?.message || String(error48)}`);
71703
71752
  }
71704
71753
  }
71705
71754
  function spawnDetachedDaemonUpgradeHelper(payload) {