@adhdev/daemon-core 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.mjs CHANGED
@@ -311,10 +311,10 @@ function readInjected(value) {
311
311
  }
312
312
  function getDaemonBuildInfo() {
313
313
  if (cached) return cached;
314
- const commit = readInjected(true ? "35facf0367dbbe37f25a3b5589287dc757ee6213" : void 0) ?? "unknown";
315
- const commitShort = readInjected(true ? "35facf03" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
316
- const version = readInjected(true ? "0.9.82-rc.312" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
317
- const builtAt = readInjected(true ? "2026-06-17T22:48:50.124Z" : void 0);
314
+ const commit = readInjected(true ? "f236ed7432cf04dbcfd2e530fa6c69e77e809c80" : void 0) ?? "unknown";
315
+ const commitShort = readInjected(true ? "f236ed74" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
316
+ const version = readInjected(true ? "0.9.82-rc.314" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
317
+ const builtAt = readInjected(true ? "2026-06-18T04:15:40.033Z" : void 0);
318
318
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
319
319
  return cached;
320
320
  }
@@ -32057,7 +32057,7 @@ var SpecCliAdapter = class _SpecCliAdapter {
32057
32057
  }
32058
32058
  if (action.type === "open_picker") {
32059
32059
  const choiceIndex = typeof flat.choiceIndex === "number" ? flat.choiceIndex : typeof flat.choiceIndex === "string" && flat.choiceIndex.trim() ? Number(flat.choiceIndex) : void 0;
32060
- const choiceLabel = typeof flat.choiceLabel === "string" ? flat.choiceLabel : typeof flat.choice === "string" ? flat.choice : void 0;
32060
+ const choiceLabel = typeof flat.choiceLabel === "string" ? flat.choiceLabel : typeof flat.choice === "string" ? flat.choice : typeof flat.value === "string" ? flat.value : void 0;
32061
32061
  if (typeof choiceIndex === "number" && Number.isFinite(choiceIndex) || choiceLabel && choiceLabel.trim()) {
32062
32062
  return this.selectPickerChoice(ctl, action, choiceIndex, choiceLabel);
32063
32063
  }
@@ -38228,6 +38228,39 @@ function registerProviderScriptRootSafely(root) {
38228
38228
  } catch {
38229
38229
  }
38230
38230
  }
38231
+ function synthesizeControlsFromControlBar(specControls) {
38232
+ const out = [];
38233
+ specControls.forEach((ctl, index) => {
38234
+ const id = typeof ctl?.id === "string" ? ctl.id.trim() : "";
38235
+ const actionType = ctl?.action?.type;
38236
+ if (!id || !actionType) return;
38237
+ const label = typeof ctl?.label === "string" && ctl.label.trim() ? ctl.label : id;
38238
+ if (actionType === "open_picker") {
38239
+ out.push({
38240
+ id,
38241
+ type: "select",
38242
+ label,
38243
+ placement: "bar",
38244
+ dynamic: true,
38245
+ listScript: id,
38246
+ setScript: id,
38247
+ readFrom: id,
38248
+ order: index
38249
+ });
38250
+ } else if (actionType === "send_keys") {
38251
+ out.push({
38252
+ id,
38253
+ type: "action",
38254
+ label,
38255
+ placement: "bar",
38256
+ invokeScript: id,
38257
+ resultDisplay: "none",
38258
+ order: index
38259
+ });
38260
+ }
38261
+ });
38262
+ return out;
38263
+ }
38231
38264
  var ProviderLoader = class _ProviderLoader {
38232
38265
  providers = /* @__PURE__ */ new Map();
38233
38266
  providerAvailability = /* @__PURE__ */ new Map();
@@ -39166,6 +39199,13 @@ var ProviderLoader = class _ProviderLoader {
39166
39199
  });
39167
39200
  }
39168
39201
  }
39202
+ const hasDeclaredControls = Array.isArray(resolved.controls) && resolved.controls.length > 0;
39203
+ if (!hasDeclaredControls) {
39204
+ const synthesized = synthesizeControlsFromControlBar(specControls);
39205
+ if (synthesized.length > 0) {
39206
+ resolved.controls = synthesized;
39207
+ }
39208
+ }
39169
39209
  }
39170
39210
  if (nh) {
39171
39211
  let reader = null;
@@ -41780,39 +41820,48 @@ function removeDaemonPidFile() {
41780
41820
  } catch {
41781
41821
  }
41782
41822
  }
41823
+ function safeRemoveStaleEntry(target, label) {
41824
+ try {
41825
+ fs24.rmSync(target, { recursive: true, force: true });
41826
+ appendUpgradeLog(`${label}: ${target}`);
41827
+ } catch (error) {
41828
+ appendUpgradeLog(`Skipped locked stale entry (${error?.code || "error"}): ${target} \u2014 ${error?.message || String(error)}`);
41829
+ }
41830
+ }
41783
41831
  function cleanupStaleGlobalInstallDirs(pkgName, surface) {
41784
- const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
41785
- const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41786
- if (!npmRoot) return;
41787
- const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41788
- const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
41789
- const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
41790
- const binNames = /* @__PURE__ */ new Set([packageBaseName]);
41791
- if (pkgName === "@adhdev/daemon-standalone") {
41792
- binNames.add("adhdev-standalone");
41793
- }
41794
- if (pkgName.startsWith("@")) {
41795
- const [scope, name] = pkgName.split("/");
41796
- const scopeDir = path35.join(npmRoot, scope);
41797
- if (!fs24.existsSync(scopeDir)) return;
41798
- for (const entry of fs24.readdirSync(scopeDir)) {
41799
- if (!entry.startsWith(`.${name}-`)) continue;
41800
- fs24.rmSync(path35.join(scopeDir, entry), { recursive: true, force: true });
41801
- appendUpgradeLog(`Removed stale scoped staging dir: ${path35.join(scopeDir, entry)}`);
41802
- }
41803
- } else {
41804
- for (const entry of fs24.readdirSync(npmRoot)) {
41805
- if (!entry.startsWith(`.${pkgName}-`)) continue;
41806
- fs24.rmSync(path35.join(npmRoot, entry), { recursive: true, force: true });
41807
- appendUpgradeLog(`Removed stale staging dir: ${path35.join(npmRoot, entry)}`);
41832
+ try {
41833
+ const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
41834
+ const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41835
+ if (!npmRoot) return;
41836
+ const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41837
+ const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
41838
+ const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
41839
+ const binNames = /* @__PURE__ */ new Set([packageBaseName]);
41840
+ if (pkgName === "@adhdev/daemon-standalone") {
41841
+ binNames.add("adhdev-standalone");
41842
+ }
41843
+ if (pkgName.startsWith("@")) {
41844
+ const [scope, name] = pkgName.split("/");
41845
+ const scopeDir = path35.join(npmRoot, scope);
41846
+ if (!fs24.existsSync(scopeDir)) return;
41847
+ for (const entry of fs24.readdirSync(scopeDir)) {
41848
+ if (!entry.startsWith(`.${name}-`)) continue;
41849
+ safeRemoveStaleEntry(path35.join(scopeDir, entry), "Removed stale scoped staging dir");
41850
+ }
41851
+ } else {
41852
+ for (const entry of fs24.readdirSync(npmRoot)) {
41853
+ if (!entry.startsWith(`.${pkgName}-`)) continue;
41854
+ safeRemoveStaleEntry(path35.join(npmRoot, entry), "Removed stale staging dir");
41855
+ }
41808
41856
  }
41809
- }
41810
- if (fs24.existsSync(binDir)) {
41811
- for (const entry of fs24.readdirSync(binDir)) {
41812
- if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
41813
- fs24.rmSync(path35.join(binDir, entry), { recursive: true, force: true });
41814
- appendUpgradeLog(`Removed stale bin staging entry: ${path35.join(binDir, entry)}`);
41857
+ if (fs24.existsSync(binDir)) {
41858
+ for (const entry of fs24.readdirSync(binDir)) {
41859
+ if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
41860
+ safeRemoveStaleEntry(path35.join(binDir, entry), "Removed stale bin staging entry");
41861
+ }
41815
41862
  }
41863
+ } catch (error) {
41864
+ appendUpgradeLog(`Stale staging cleanup skipped (${error?.code || "error"}): ${error?.message || String(error)}`);
41816
41865
  }
41817
41866
  }
41818
41867
  function spawnDetachedDaemonUpgradeHelper(payload) {