blun-king-cli 9.1.112 → 9.1.114

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.
@@ -93,6 +93,18 @@ function createDeferredToolLoader(selectedTools, deferredTools, loadedToolNames
93
93
  execute: async () => {
94
94
  const matches = searchDeferredTools([...available.values()], query);
95
95
  if (matches.length === 0) {
96
+ const alreadyLoaded = query.toLowerCase().startsWith('select:')
97
+ ? searchDeferredTools(
98
+ selectedTools.filter((tool) => tool?.name !== DEFERRED_TOOL_LOADER_NAME),
99
+ query,
100
+ )
101
+ : [];
102
+ if (alreadyLoaded.length === 1) {
103
+ return {
104
+ isError: false,
105
+ output: `Tool schema already loaded: ${alreadyLoaded[0].name}. Invoke it now.`,
106
+ };
107
+ }
96
108
  return {
97
109
  isError: true,
98
110
  output: `No deferred tools matched: ${query || '[empty query]'}`,
package/blun.mjs CHANGED
@@ -417951,11 +417951,11 @@ function telegramChannelConfigured(dir = telegramStateDir()) {
417951
417951
  function telegramChannelMcpServers(dir = telegramStateDir()) {
417952
417952
  if (!telegramChannelAttachEnabled()) return void 0;
417953
417953
  if (!telegramChannelConfigured(dir)) return void 0;
417954
- if (managedTelegramPluginEnabled()) return void 0;
417955
417954
  const server = resolveTelegramMcpEntry();
417956
417955
  if (server === void 0) return void 0;
417957
417956
  const launch = resolveNodeScriptLaunch(server);
417958
- return { telegram: {
417957
+ const runtimeName = managedTelegramPluginEnabled() ? pluginMcpRuntimeName("telegram", "telegram") : "telegram";
417958
+ return { [runtimeName]: {
417959
417959
  transport: "stdio",
417960
417960
  command: launch.command,
417961
417961
  args: launch.args,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.112",
3
+ "version": "9.1.114",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -52,5 +52,10 @@
52
52
  "directories": {
53
53
  "test": "test"
54
54
  },
55
- "type": "commonjs"
55
+ "type": "commonjs",
56
+ "dependencies": {
57
+ "blun-king-cli": "^9.1.62",
58
+ "node-addon-api": "^7.1.1"
59
+ },
60
+ "devDependencies": {}
56
61
  }
@@ -4390,11 +4390,10 @@ function claimPollerPid() {
4390
4390
  ownerPid = parseInt(readFileSync(pidFile(), "utf8"), 10);
4391
4391
  } catch {}
4392
4392
  if (ownerPid === process.pid) return true;
4393
- if (ownerPid !== void 0 && ownerPid > 1) try {
4394
- process.kill(ownerPid, 0);
4393
+ if (pidAlive(ownerPid)) {
4395
4394
  process.stderr.write(`telegram channel: live poller pid=${ownerPid} already owns the bot token\n`);
4396
4395
  return false;
4397
- } catch {}
4396
+ }
4398
4397
  try {
4399
4398
  rmSync(pidFile());
4400
4399
  } catch {
@@ -4498,8 +4497,8 @@ function pidAlive(pid) {
4498
4497
  try {
4499
4498
  process.kill(pid, 0);
4500
4499
  return true;
4501
- } catch {
4502
- return false;
4500
+ } catch (error) {
4501
+ return error?.code === "EPERM";
4503
4502
  }
4504
4503
  }
4505
4504
  function isTuiLeaseFresh(maxAgeMs = TUI_LEASE_MAX_AGE_MS, now = Date.now()) {