@hirey/hi-mcp-server 0.1.7 → 0.1.8

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.
@@ -0,0 +1,9 @@
1
+ export declare function resolveCanonicalOpenClawReceiverBinaryPath(homeDir?: string): string;
2
+ export declare function buildInstallReceiverCommandArgv(args: {
3
+ explicitArgv: string[];
4
+ receiverCommand: string;
5
+ hostKind: 'openclaw' | 'generic';
6
+ enableLocalReceiver: boolean;
7
+ homeDir?: string;
8
+ }): string[];
9
+ //# sourceMappingURL=receiver-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiver-command.d.ts","sourceRoot":"","sources":["../src/receiver-command.ts"],"names":[],"mappings":"AAGA,wBAAgB,0CAA0C,CAAC,OAAO,GAAE,MAAqB,GAAG,MAAM,CAEjG;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE;IACpD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,EAAE,CAQX"}
@@ -0,0 +1,16 @@
1
+ import os from 'node:os';
2
+ import path from 'node:path';
3
+ export function resolveCanonicalOpenClawReceiverBinaryPath(homeDir = os.homedir()) {
4
+ return path.join(homeDir, '.openclaw', 'vendor', 'hi', 'node_modules', '.bin', 'hi-agent-receiver');
5
+ }
6
+ export function buildInstallReceiverCommandArgv(args) {
7
+ if (args.explicitArgv.length > 0)
8
+ return args.explicitArgv;
9
+ if (args.receiverCommand)
10
+ return [args.receiverCommand];
11
+ // OpenClaw's public install path is user-local vendor install, not global PATH.
12
+ if (args.hostKind === 'openclaw' && args.enableLocalReceiver) {
13
+ return [resolveCanonicalOpenClawReceiverBinaryPath(args.homeDir)];
14
+ }
15
+ return ['hi-agent-receiver'];
16
+ }
package/dist/server.js CHANGED
@@ -13,6 +13,7 @@ import { AGENT_GATEWAY_EVENT_TOPICS, normalizeAgentEndpointList, normalizeAgentI
13
13
  import { createHiAgentClients, exchangeHiAgentClientCredentialsToken, HiAgentGatewayClient, HiAgentPlatformClient, } from '@hirey/hi-agent-sdk';
14
14
  import { readState, resolveCanonicalOpenClawStateDir, resolveDefaultStateDir, resolveLegacyStateFiles, resolveStateFile, updateState, normalizeStateProfile, } from './state.js';
15
15
  import { looksLikeOpenClawSessionKey, validateOpenClawSessionKey, } from './openclaw-session-key.js';
16
+ import { buildInstallReceiverCommandArgv, } from './receiver-command.js';
16
17
  const CAPABILITY_CACHE_TTL_MS = 30_000;
17
18
  const resolvedProfile = normalizeStateProfile(process.env.HI_MCP_PROFILE);
18
19
  const config = {
@@ -1152,13 +1153,12 @@ async function handleInstall(args) {
1152
1153
  const receiverTransport = normalizeReceiverTransport(args.receiver_transport);
1153
1154
  const subscribeDefaultTopics = args.subscribe_default_topics !== false;
1154
1155
  const receiverShouldStart = enableLocalReceiver ? args.receiver_start !== false : false;
1155
- const receiverCommandArgv = (() => {
1156
- const explicitArgv = normalizeCommandArgv(args.receiver_command_argv);
1157
- if (explicitArgv.length > 0)
1158
- return explicitArgv;
1159
- const command = normalizeText(args.receiver_command) || 'hi-agent-receiver';
1160
- return [command];
1161
- })();
1156
+ const receiverCommandArgv = buildInstallReceiverCommandArgv({
1157
+ explicitArgv: normalizeCommandArgv(args.receiver_command_argv),
1158
+ receiverCommand: normalizeText(args.receiver_command),
1159
+ hostKind,
1160
+ enableLocalReceiver,
1161
+ });
1162
1162
  const hostAdapterKindRaw = normalizeText(args.host_adapter_kind).toLowerCase();
1163
1163
  const hostAdapterKind = hostAdapterKindRaw === 'openresponses'
1164
1164
  ? 'openresponses'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirey/hi-mcp-server",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/server.js",