claude-slack-channel-bots 0.6.2 → 0.6.3

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/postinstall.ts +21 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-slack-channel-bots",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Multi-session Slack-to-Claude bridge — run multiple Claude Code bots across Slack channels via Socket Mode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,6 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/bun": "^1.0.0",
37
+ "semver": "^7.6.0",
37
38
  "typescript": "^5.4.0"
38
39
  },
39
40
  "license": "MIT",
@@ -10,12 +10,30 @@
10
10
  * SPDX-License-Identifier: MIT
11
11
  */
12
12
 
13
- import { existsSync, mkdirSync, writeFileSync, symlinkSync, readlinkSync, unlinkSync, renameSync } from 'fs'
13
+ import { existsSync, mkdirSync, writeFileSync, symlinkSync, readlinkSync, unlinkSync, renameSync, readFileSync } from 'fs'
14
14
  import { homedir } from 'os'
15
15
  import { dirname, join, resolve } from 'path'
16
16
  import { defaultAccess } from './lib.ts'
17
17
  import { MCP_SERVER_NAME } from './config.ts'
18
18
 
19
+ /**
20
+ * Read the agent-director dependency range from the shipping package.json.
21
+ * Same pattern as src/agent-director-client.ts's MIN_AD_VERSION derivation —
22
+ * one source of truth for the AD version requirement.
23
+ */
24
+ export function readAdDependencyRange(): string {
25
+ const pkgPath = resolve(dirname(import.meta.filename), '..', 'package.json')
26
+ const raw = readFileSync(pkgPath, 'utf-8')
27
+ const pkg = JSON.parse(raw) as { dependencies?: Record<string, string> }
28
+ const range = pkg.dependencies?.['agent-director']
29
+ if (typeof range !== 'string' || range.length === 0) {
30
+ throw new Error(
31
+ `postinstall: package.json dependencies['agent-director'] is missing or empty`,
32
+ )
33
+ }
34
+ return range
35
+ }
36
+
19
37
  // ---------------------------------------------------------------------------
20
38
  // Types
21
39
  // ---------------------------------------------------------------------------
@@ -147,9 +165,10 @@ export async function runAgentDirectorPostinstallProbe(): Promise<void> {
147
165
  }
148
166
  } catch (err) {
149
167
  const detail = err instanceof Error ? err.message : String(err)
168
+ const adRange = readAdDependencyRange()
150
169
  console.warn(
151
170
  `postinstall warning: agent-director probe failed (${detail}). ` +
152
- `Install agent-director (\`bun add agent-director@^0.4.3\`) before running ` +
171
+ `Install agent-director (\`bun add agent-director@${adRange}\`) before running ` +
153
172
  `\`claude-slack-channel-bots start\`; the startup gate will fail otherwise.`,
154
173
  )
155
174
  }