(input, context, canUseTool, assistantMessage)
| 788 | }, |
| 789 | |
| 790 | async call(input, context, canUseTool, assistantMessage) { |
| 791 | if (feature('UDS_INBOX') && typeof input.message === 'string') { |
| 792 | const addr = parseAddress(input.to) |
| 793 | if (addr.scheme === 'bridge') { |
| 794 | // Re-check handle — checkPermissions blocks on user approval (can be |
| 795 | // minutes). validateInput's check is stale if the bridge dropped |
| 796 | // during the prompt wait; without this, from="unknown" ships. |
| 797 | // Also re-check isReplBridgeActive for outbound-only mode. |
| 798 | if (!getReplBridgeHandle() || !isReplBridgeActive()) { |
| 799 | return { |
| 800 | data: { |
| 801 | success: false, |
| 802 | message: `Remote Control disconnected before send — cannot deliver to ${input.to}`, |
| 803 | }, |
| 804 | } |
| 805 | } |
| 806 | /* eslint-disable @typescript-eslint/no-require-imports */ |
| 807 | const { postInterClaudeMessage } = |
| 808 | require('../../bridge/peerSessions.js') as typeof import('../../bridge/peerSessions.js') |
| 809 | /* eslint-enable @typescript-eslint/no-require-imports */ |
| 810 | const result = await postInterClaudeMessage( |
| 811 | addr.target, |
| 812 | input.message, |
| 813 | ) |
| 814 | const preview = input.summary || truncate(input.message, 50) |
| 815 | return { |
| 816 | data: { |
| 817 | success: result.ok, |
| 818 | message: result.ok |
| 819 | ? `“${preview}” → ${input.to}` |
| 820 | : `Failed to send to ${input.to}: ${result.error ?? 'unknown'}`, |
| 821 | }, |
| 822 | } |
| 823 | } |
| 824 | if (addr.scheme === 'uds') { |
| 825 | /* eslint-disable @typescript-eslint/no-require-imports */ |
| 826 | const { sendToUdsSocket } = |
| 827 | require('../../utils/udsClient.js') as typeof import('../../utils/udsClient.js') |
| 828 | /* eslint-enable @typescript-eslint/no-require-imports */ |
| 829 | try { |
| 830 | await sendToUdsSocket(addr.target, input.message) |
| 831 | const preview = input.summary || truncate(input.message, 50) |
| 832 | return { |
| 833 | data: { |
| 834 | success: true, |
| 835 | message: `“${preview}” → ${input.to}`, |
| 836 | }, |
| 837 | } |
| 838 | } catch (e) { |
| 839 | return { |
| 840 | data: { |
| 841 | success: false, |
| 842 | message: `Failed to send to ${input.to}: ${errorMessage(e)}`, |
| 843 | }, |
| 844 | } |
| 845 | } |
| 846 | } |
| 847 | } |
nothing calls this directly
no test coverage detected